hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c507e6adaf03cd522d3dbd03d630d7c0e13c6898 | 5,327 | py | Python | project01/fetch.py | uva-sp2021-cs5010-g6/finalproject | 28de55b5b4f1117e019b2b4462d28357fa264d40 | [
"MIT"
] | 1 | 2021-12-03T13:09:05.000Z | 2021-12-03T13:09:05.000Z | project01/fetch.py | uva-sp2021-cs5010-g6/finalproject | 28de55b5b4f1117e019b2b4462d28357fa264d40 | [
"MIT"
] | null | null | null | project01/fetch.py | uva-sp2021-cs5010-g6/finalproject | 28de55b5b4f1117e019b2b4462d28357fa264d40 | [
"MIT"
] | null | null | null | # -*- 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... | 37.251748 | 103 | 0.568425 | # -*- 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... | 74 | 3,855 | 46 |
097c39ef7b2193a39cbb4d7c9a251be0d9424a7a | 40 | py | Python | feeds/tests.py | none-da/zeshare | 6c13cd3bd9d82d89f53d4a8b287fe2c30f1d3779 | [
"BSD-3-Clause"
] | null | null | null | feeds/tests.py | none-da/zeshare | 6c13cd3bd9d82d89f53d4a8b287fe2c30f1d3779 | [
"BSD-3-Clause"
] | null | null | null | feeds/tests.py | none-da/zeshare | 6c13cd3bd9d82d89f53d4a8b287fe2c30f1d3779 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T11:43:38.000Z | 2021-04-12T11:43:38.000Z | from feeds.alltests.feeds_tests import * | 40 | 40 | 0.85 | from feeds.alltests.feeds_tests import * | 0 | 0 | 0 |
8ff7ad33d527b024371f2a14d237166846f79aee | 1,880 | py | Python | doc/examples/constrainedtutorial.py | sroet/regreg | 299ff18b8680872d4d85447953793bf438f78bba | [
"BSD-3-Clause"
] | 11 | 2016-02-25T01:53:03.000Z | 2020-11-30T00:59:46.000Z | doc/examples/constrainedtutorial.py | sroet/regreg | 299ff18b8680872d4d85447953793bf438f78bba | [
"BSD-3-Clause"
] | 21 | 2015-09-17T19:18:09.000Z | 2021-04-28T06:15:02.000Z | doc/examples/constrainedtutorial.py | sroet/regreg | 299ff18b8680872d4d85447953793bf438f78bba | [
"BSD-3-Clause"
] | 8 | 2016-03-24T00:03:03.000Z | 2019-08-25T23:40:42.000Z | 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) +... | 39.166667 | 97 | 0.778723 | 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) +... | 0 | 0 | 0 |
acdd6093a64d5ef0e855683a94c035b8c58462bd | 9,635 | py | Python | tests/ws/test_ws.py | tclh123/aio-openapi | 7c63eb628b7735501508aea6c83e458715fb070b | [
"BSD-3-Clause"
] | 19 | 2019-03-04T22:50:38.000Z | 2022-03-02T09:28:17.000Z | tests/ws/test_ws.py | tclh123/aio-openapi | 7c63eb628b7735501508aea6c83e458715fb070b | [
"BSD-3-Clause"
] | 116 | 2018-05-17T21:55:02.000Z | 2019-02-14T08:35:31.000Z | tests/ws/test_ws.py | tclh123/aio-openapi | 7c63eb628b7735501508aea6c83e458715fb070b | [
"BSD-3-Clause"
] | 3 | 2020-05-20T17:43:08.000Z | 2021-10-06T10:47:41.000Z | from typing import Dict
import aiohttp
from async_timeout import timeout
from openapi.testing import json_body
| 34.53405 | 88 | 0.566373 | from typing import Dict
import aiohttp
from async_timeout import timeout
from openapi.testing import json_body
async def server_info(ws) -> Dict:
await ws.send_json(dict(id="abc", method="server_info"))
msg = await ws.receive()
assert msg.type == aiohttp.WSMsgType.TEXT
data = msg.json()
return d... | 9,162 | 0 | 345 |
da62af548f22f44a721cd325cc6da0ebf80d1858 | 1,034 | py | Python | inject_version.py | Open-Security-Tools/security_model_tw_plugin | 86ec04bf161ce0484362786bdc7e9ea0c5c3785e | [
"MIT"
] | 1 | 2022-03-07T11:03:48.000Z | 2022-03-07T11:03:48.000Z | inject_version.py | paulopensecuritytools/security_model_tw_plugin | aea955880afb8cbebf06f1c6a2132200a1accda9 | [
"MIT"
] | 4 | 2022-03-13T20:40:12.000Z | 2022-03-13T21:02:27.000Z | inject_version.py | paulopensecuritytools/security_model_tw_plugin | aea955880afb8cbebf06f1c6a2132200a1accda9 | [
"MIT"
] | 2 | 2022-03-07T10:56:55.000Z | 2022-03-07T18:49:32.000Z | #!/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() | 29.542857 | 96 | 0.583172 | #!/usr/bin/env python
import os
import subprocess
TID_FILE = "src/tiddlers/system/plugins/security_tools/twsm.tid"
VERSION_FILE = "VERSION"
def get_commit_count():
return int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"]).decode('utf-8'))
def main():
with open(VERSION_FILE, "r") as f:
... | 809 | 0 | 46 |
478fb4e795e1b6bd9e1b186fa0b56db2798d0412 | 910 | py | Python | OuTimer.py | ouyangjunqiu/ou.py | fe9faf76e5726b61d322a25cad3beacb8a291483 | [
"MIT"
] | null | null | null | OuTimer.py | ouyangjunqiu/ou.py | fe9faf76e5726b61d322a25cad3beacb8a291483 | [
"MIT"
] | null | null | null | OuTimer.py | ouyangjunqiu/ou.py | fe9faf76e5726b61d322a25cad3beacb8a291483 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
@author: oShine <oyjqdlp@126.com>
@link: https://github.com/ouyangjunqiu/ou.py
定时器,每隔一段时间执行一次
"""
import threading
| 23.947368 | 77 | 0.583516 | # coding=utf-8
"""
@author: oShine <oyjqdlp@126.com>
@link: https://github.com/ouyangjunqiu/ou.py
定时器,每隔一段时间执行一次
"""
import threading
class Timer(threading.Thread):
def __init__(self, interval, function, args=[], kwargs={}):
threading.Thread.__init__(self)
self.interval = interval
self.... | 634 | 9 | 130 |
ec0fa68cf9cc1766bd49b5d29a11fe28e91e8d09 | 158 | py | Python | PartI/Lab_1_1/PY/Factorial.py | DmitrTRC/LabTraining | 9c689e5965d0fbdeacd2e991945c05e4b06c6928 | [
"Apache-2.0"
] | null | null | null | PartI/Lab_1_1/PY/Factorial.py | DmitrTRC/LabTraining | 9c689e5965d0fbdeacd2e991945c05e4b06c6928 | [
"Apache-2.0"
] | 1 | 2021-12-11T16:51:56.000Z | 2021-12-11T16:51:56.000Z | PartI/Lab_1_1/PY/Factorial.py | DmitrTRC/LabTraining | 9c689e5965d0fbdeacd2e991945c05e4b06c6928 | [
"Apache-2.0"
] | 1 | 2021-12-27T15:30:29.000Z | 2021-12-27T15:30:29.000Z |
for n in range(10):
print(n, factorial(n))
| 15.8 | 29 | 0.556962 | def factorial(n):
result = 1
for x in range(1, n + 1):
result = result * x
return result
for n in range(10):
print(n, factorial(n))
| 87 | 0 | 22 |
5e1005b0831231fec5f3422dae56261f92942f04 | 1,686 | py | Python | 09WebFramework/day02/basic01.py | HaoZhang95/PythonAndMachineLearning | b897224b8a0e6a5734f408df8c24846a98c553bf | [
"MIT"
] | 937 | 2019-05-08T08:46:25.000Z | 2022-03-31T12:56:07.000Z | 09WebFramework/day02/basic01.py | Sakura-gh/Python24 | b97e18867264a0647d5645c7d757a0040e755577 | [
"MIT"
] | 47 | 2019-09-17T10:06:02.000Z | 2022-03-11T23:46:52.000Z | 09WebFramework/day02/basic01.py | Sakura-gh/Python24 | b97e18867264a0647d5645c7d757a0040e755577 | [
"MIT"
] | 354 | 2019-05-10T02:15:26.000Z | 2022-03-30T05:52:57.000Z |
@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函数的返回值,当作装饰器进行装饰... | 21.341772 | 77 | 0.576512 | def set_log(log_level):
def super_set_func(func):
def call_func(*args, **kwargs):
log_level_info_dict = {
1: "Warning",
2: "Error"
}
# 根据闭包内存空间的log——level的不同,处理不同业务
print("****Log日志:%s****" % log_level_info_dict[log_level])
... | 887 | 0 | 197 |
6355d20d8eeada5c93a95b1bf589b1629cd420ef | 3,128 | py | Python | tests/test_layer.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_layer.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_layer.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/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... | 33.634409 | 103 | 0.612212 | #!/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,230 | 11 | 293 |
ffa2ba8542bbb2f4dda70dc14aadfbd1f8734d95 | 4,466 | py | Python | pdftables/pdftables_analysis.py | pombredanne/pdftables | 3bd927cc2d045de116780267c4b4a5bbc1a17714 | [
"BSD-2-Clause"
] | 2 | 2015-06-15T15:18:04.000Z | 2016-08-12T19:02:46.000Z | pdftables/pdftables_analysis.py | pombredanne/pdftables | 3bd927cc2d045de116780267c4b4a5bbc1a17714 | [
"BSD-2-Clause"
] | null | null | null | pdftables/pdftables_analysis.py | pombredanne/pdftables | 3bd927cc2d045de116780267c4b4a5bbc1a17714 | [
"BSD-2-Clause"
] | null | null | null | #!/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... | 31.673759 | 140 | 0.62584 | #!/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... | 1,563 | 0 | 46 |
a5e5675c12e9e7e5ca2d38ebcf83a40bbd68b717 | 333 | py | Python | Python/Area_BREP-2D.py | chansiky/Rhinosciprts | d63f1354c9b3ff2b6a0f8dc687605b1eaaef87cb | [
"MIT"
] | null | null | null | Python/Area_BREP-2D.py | chansiky/Rhinosciprts | d63f1354c9b3ff2b6a0f8dc687605b1eaaef87cb | [
"MIT"
] | 1 | 2019-04-23T01:32:49.000Z | 2019-05-31T19:00:31.000Z | Python/Area_BREP-2D.py | chansiky/Rhinosciprts | d63f1354c9b3ff2b6a0f8dc687605b1eaaef87cb | [
"MIT"
] | null | null | null | import rhinoscriptsyntax as rs
| 27.75 | 73 | 0.66967 | import rhinoscriptsyntax as rs
def Area_Brep2D():
points = rs.GetObjects("select points to connect:",rs.filter.point);
if points: rs.Prompt("points exist")
findClosestPointPairs();
def getClosedBrep(str):
brep = rs.GetObject(str,rs.filter.polysurface);
if brep == rs.IsBrep.func_... | 237 | 0 | 54 |
9234cfcb3f24c5650d265a803fde31fb6be53cf9 | 344 | py | Python | pyunit_idcard/__init__.py | PyUnit/pyunit-idCard | 73ba98e62e71ece45315951fea0edaf46f2d9d4a | [
"Apache-2.0"
] | 5 | 2020-06-25T19:24:19.000Z | 2021-06-27T10:31:33.000Z | pyunit_idcard/__init__.py | PyUnit/pyunit-idCard | 73ba98e62e71ece45315951fea0edaf46f2d9d4a | [
"Apache-2.0"
] | null | null | null | pyunit_idcard/__init__.py | PyUnit/pyunit-idCard | 73ba98e62e71ece45315951fea0edaf46f2d9d4a | [
"Apache-2.0"
] | 1 | 2021-09-28T05:24:21.000Z | 2021-09-28T05:24:21.000Z | # !/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... | 24.571429 | 51 | 0.694767 | # !/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... | 0 | 0 | 0 |
47ec389ae010bc11002a26931d2d23167e7da0a7 | 2,720 | py | Python | petastorm/tests/test_pyarrow_serializer.py | xiaohanhuang/petastorm | 9a903d9885759674f81b412dc133aeb9577e00dd | [
"Apache-2.0"
] | 1 | 2019-07-02T23:50:49.000Z | 2019-07-02T23:50:49.000Z | petastorm/tests/test_pyarrow_serializer.py | xiaohanhuang/petastorm | 9a903d9885759674f81b412dc133aeb9577e00dd | [
"Apache-2.0"
] | 18 | 2020-02-20T17:50:41.000Z | 2020-03-10T10:57:29.000Z | petastorm/tests/test_pyarrow_serializer.py | xiaohanhuang/petastorm | 9a903d9885759674f81b412dc133aeb9577e00dd | [
"Apache-2.0"
] | 3 | 2020-04-16T18:25:24.000Z | 2020-05-08T17:59:43.000Z | # -*- 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... | 35.324675 | 112 | 0.65625 | # -*- 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... | 1,440 | 0 | 69 |
e9ec181413a9e9cb8f16bd5c0931f7424447337d | 1,626 | py | Python | rhoci/db/cli.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | rhoci/db/cli.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | rhoci/db/cli.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | # 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... | 31.882353 | 78 | 0.702952 | # 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... | 0 | 0 | 0 |
3e2dc2e2f1d1a664ac76556b3f85d8801cbe1e88 | 5,585 | py | Python | tests/integrated_recognizers/test_phone_number_recognizer.py | openredact/pii-identifier | 97eaef56d6de59718501095d631a0fb49700e45a | [
"MIT"
] | 14 | 2020-07-31T18:45:29.000Z | 2022-02-21T13:24:00.000Z | tests/integrated_recognizers/test_phone_number_recognizer.py | openredact/pii-identifier | 97eaef56d6de59718501095d631a0fb49700e45a | [
"MIT"
] | 7 | 2020-07-31T06:17:21.000Z | 2021-05-23T08:40:24.000Z | tests/integrated_recognizers/test_phone_number_recognizer.py | openredact/pii-identifier | 97eaef56d6de59718501095d631a0fb49700e45a | [
"MIT"
] | 1 | 2020-09-30T01:42:57.000Z | 2020-09-30T01:42:57.000Z | 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
| 29.240838 | 115 | 0.710295 | import pytest
from nerwhal.integrated_recognizers.phone_number_recognizer import PhoneNumberRecognizer
@pytest.fixture(scope="module")
def backend(setup_backend):
recognizer = PhoneNumberRecognizer
backend = setup_backend(recognizer.BACKEND)
backend.register_recognizer(recognizer)
return backend
# ... | 4,684 | 0 | 620 |
2b90b0219ec4f978b9c98124f19912ea51efc6a7 | 9,811 | py | Python | tests/test_torchvision.py | L-Net-1992/sahi | 43f008948419ebff1e0c1861c3cee4ead23fcad1 | [
"MIT"
] | null | null | null | tests/test_torchvision.py | L-Net-1992/sahi | 43f008948419ebff1e0c1861c3cee4ead23fcad1 | [
"MIT"
] | null | null | null | tests/test_torchvision.py | L-Net-1992/sahi | 43f008948419ebff1e0c1861c3cee4ead23fcad1 | [
"MIT"
] | null | null | null | # 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()
| 38.175097 | 105 | 0.68729 | # 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
class TestTorchVisionDetectionModel(unittest.TestCase):
def test_load_model(self... | 9,255 | 34 | 238 |
f150b468fc5a4677db999329c6f07b5a5287c396 | 594 | py | Python | tool/urls.py | borislavstoychev/RecrutmentTool | 80cc8db9b653c05dcafe3b79b6da8847111e92f9 | [
"MIT"
] | null | null | null | tool/urls.py | borislavstoychev/RecrutmentTool | 80cc8db9b653c05dcafe3b79b6da8847111e92f9 | [
"MIT"
] | null | null | null | tool/urls.py | borislavstoychev/RecrutmentTool | 80cc8db9b653c05dcafe3b79b6da8847111e92f9 | [
"MIT"
] | null | null | null | 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... | 37.125 | 79 | 0.728956 | 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... | 0 | 0 | 0 |
9c1f567ad31a45b2467adb5d9a636e985095e04e | 2,826 | py | Python | tests/python/unittest/test_tvm_op.py | niallomahony93/mxnet | 31164c59de97607d6b24ed03bed5074bbc86c5d4 | [
"Apache-2.0"
] | 5 | 2018-02-08T01:53:43.000Z | 2019-01-08T07:39:32.000Z | tests/python/unittest/test_tvm_op.py | LXL1314/incubator-mxnet | d8b6e47b91a737d29c0589bda8640aee69d8599b | [
"Apache-2.0"
] | 10 | 2017-05-27T01:00:48.000Z | 2019-10-20T20:38:11.000Z | tests/python/unittest/test_tvm_op.py | LXL1314/incubator-mxnet | d8b6e47b91a737d29c0589bda8640aee69d8599b | [
"Apache-2.0"
] | 2 | 2019-10-03T21:00:55.000Z | 2020-07-30T06:44:06.000Z | # 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... | 38.189189 | 87 | 0.584572 | # 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... | 1,762 | 0 | 22 |
23fe8c70dfacbc77988ed88e654337d760f4624f | 2,960 | py | Python | app/settings/ssl_setting.py | hirossan4049/Schreen | 9f00fff45a1a92b96df98aa6996aa2eeba72cc69 | [
"MIT"
] | null | null | null | app/settings/ssl_setting.py | hirossan4049/Schreen | 9f00fff45a1a92b96df98aa6996aa2eeba72cc69 | [
"MIT"
] | 30 | 2020-03-22T13:12:07.000Z | 2022-03-12T00:19:40.000Z | app/settings/ssl_setting.py | hirossan4049/Schreen | 9f00fff45a1a92b96df98aa6996aa2eeba72cc69 | [
"MIT"
] | 1 | 2020-06-13T07:46:53.000Z | 2020-06-13T07:46:53.000Z | import pexpect
import timeout_decorator
#csk = CreateSSLKey()
#csk.start()
| 29.89899 | 209 | 0.592905 | import pexpect
import timeout_decorator
class OpenSSLNotFoundError(Exception):
pass
def getOpenSSLVersion():
getversion = pexpect.run("openssl version").decode("utf-8")
whatSSL = getversion.split(" ")[0]
if whatSSL == "LibreSSL":
return getversion
elif whatSSL == "OpenSSL":
r... | 2,455 | 330 | 103 |
4dc039663206e0b82700e923905f52c317ad41f3 | 9,884 | py | Python | run_single_model.py | ECNU-ICA/ECNU-SenseMaker | 24f829c3dfefccea5fecbbe75904858ec1fefffb | [
"MIT"
] | 16 | 2020-07-29T06:31:15.000Z | 2021-08-08T13:06:19.000Z | run_single_model.py | ECNU-ICA/ECNU-SenseMaker | 24f829c3dfefccea5fecbbe75904858ec1fefffb | [
"MIT"
] | 1 | 2020-11-30T10:09:07.000Z | 2020-12-10T16:28:39.000Z | run_single_model.py | ECNU-ICA/ECNU-SenseMaker | 24f829c3dfefccea5fecbbe75904858ec1fefffb | [
"MIT"
] | 5 | 2020-12-14T12:29:21.000Z | 2021-11-04T09:15:46.000Z | 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... | 53.139785 | 117 | 0.681303 | 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... | 3,587 | 0 | 23 |
3afcfbfacf166c45b411c3b091cd1bc8b5fc8edf | 4,559 | py | Python | mqtt/publisher/publisher.py | smartx-usman/IIoT-SDP2-Apps | 58371d4d7fd8d39ddf0e47ba8cc3d2e7ad6a3aab | [
"MIT"
] | null | null | null | mqtt/publisher/publisher.py | smartx-usman/IIoT-SDP2-Apps | 58371d4d7fd8d39ddf0e47ba8cc3d2e7ad6a3aab | [
"MIT"
] | null | null | null | mqtt/publisher/publisher.py | smartx-usman/IIoT-SDP2-Apps | 58371d4d7fd8d39ddf0e47ba8cc3d2e7ad6a3aab | [
"MIT"
] | null | null | null | # 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... | 29.038217 | 131 | 0.631498 | # 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... | 3,104 | 0 | 133 |
cae07a7a2dd4c6d84ff7268be68d469feebd55d4 | 1,118 | py | Python | docs/examples/rbac/python/conftest.py | connec/oso | a12d94206807b69beb6fe7a9070b9afcacdfc845 | [
"Apache-2.0"
] | 2,167 | 2020-07-28T15:49:48.000Z | 2022-03-31T06:11:28.000Z | docs/examples/rbac/python/conftest.py | connec/oso | a12d94206807b69beb6fe7a9070b9afcacdfc845 | [
"Apache-2.0"
] | 1,060 | 2020-07-25T18:37:07.000Z | 2022-03-30T05:49:44.000Z | docs/examples/rbac/python/conftest.py | connec/oso | a12d94206807b69beb6fe7a9070b9afcacdfc845 | [
"Apache-2.0"
] | 118 | 2020-08-05T19:27:14.000Z | 2022-03-31T16:37:39.000Z | 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
| 20.327273 | 63 | 0.756708 | import pytest
from .app import oso, Organization, Repository, User
@pytest.fixture
def test_oso():
oso.clear_rules()
yield oso
@pytest.fixture
def alpha_association():
yield Organization("Alpha Association")
@pytest.fixture
def beta_business():
yield Organization("Beta Business")
@pytest.fixtur... | 690 | 0 | 198 |
3285a935e3d8ddc6ff997c57eaf99b8988eba617 | 303 | py | Python | Snippets and Basic Functions/File Operations/CSV/buffer-to-csv.py | sckulkarni246/python-snippets-for-embedded-programmers | 9dfd0b193f86a6de54598917f3d7088a60ec4abc | [
"MIT"
] | null | null | null | Snippets and Basic Functions/File Operations/CSV/buffer-to-csv.py | sckulkarni246/python-snippets-for-embedded-programmers | 9dfd0b193f86a6de54598917f3d7088a60ec4abc | [
"MIT"
] | null | null | null | Snippets and Basic Functions/File Operations/CSV/buffer-to-csv.py | sckulkarni246/python-snippets-for-embedded-programmers | 9dfd0b193f86a6de54598917f3d7088a60ec4abc | [
"MIT"
] | null | null | null | 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") | 23.307692 | 46 | 0.719472 | import csv
def data_logger_csv(buffer,fileName):
with open(fileName,"w+") as my_csv:
csvWriter = csv.writer(my_csv,delimiter=',')
csvWriter.writerow(buffer)
buffer = []
for i in range(0,100):
buffer.append(i)
print("Writing buffer to buffer.csv now...")
data_logger_csv(buffer,"buffer.csv") | 129 | 0 | 24 |
6f89caaaf10f882f2c5f619564d22f9b69db3230 | 1,699 | py | Python | omnipresence/plugins/mstranslate/test_mstranslate.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | null | null | null | omnipresence/plugins/mstranslate/test_mstranslate.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | 10 | 2016-04-05T04:36:15.000Z | 2018-03-25T00:15:47.000Z | omnipresence/plugins/mstranslate/test_mstranslate.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | null | null | null | # -*- 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
| 33.313725 | 77 | 0.721012 | # -*- 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
class MicrosoftTransla... | 834 | 567 | 23 |
bf9dee300e397ab9f957bfa1623d795ac2adad18 | 1,639 | py | Python | mlflow/tracking/default_experiment/abstract_context.py | Sohamkayal4103/mlflow | 4e444efdf73c710644ee039b44fa36a31d716f69 | [
"Apache-2.0"
] | 1 | 2022-01-11T02:51:17.000Z | 2022-01-11T02:51:17.000Z | mlflow/tracking/default_experiment/abstract_context.py | Sohamkayal4103/mlflow | 4e444efdf73c710644ee039b44fa36a31d716f69 | [
"Apache-2.0"
] | null | null | null | mlflow/tracking/default_experiment/abstract_context.py | Sohamkayal4103/mlflow | 4e444efdf73c710644ee039b44fa36a31d716f69 | [
"Apache-2.0"
] | 2 | 2019-05-11T08:13:38.000Z | 2019-05-14T13:33:54.000Z | 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 ... | 40.975 | 96 | 0.702257 | 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 ... | 0 | 0 | 0 |
80fabec1ff1e4a6c005789471136c5024f97c954 | 2,416 | py | Python | src/pyramid_torque_engine/traverse.py | thruflo/pyramid_torque_engine | 3797c11d4fcc85cdad126b4a11d505279a7345a1 | [
"Unlicense"
] | 1 | 2015-06-23T12:51:43.000Z | 2015-06-23T12:51:43.000Z | src/pyramid_torque_engine/traverse.py | thruflo/pyramid_torque_engine | 3797c11d4fcc85cdad126b4a11d505279a7345a1 | [
"Unlicense"
] | 3 | 2019-12-26T16:36:59.000Z | 2022-03-21T22:16:06.000Z | src/pyramid_torque_engine/traverse.py | thruflo/pyramid_torque_engine | 3797c11d4fcc85cdad126b4a11d505279a7345a1 | [
"Unlicense"
] | 3 | 2015-06-24T10:25:35.000Z | 2015-12-19T18:28:44.000Z | # -*- 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 ... | 29.463415 | 80 | 0.695778 | # -*- 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 ... | 218 | 42 | 75 |
7d7e43646f9d564913eda04a91de6bceb3b055b4 | 883 | py | Python | near200.py | Logic-gate/datasig | 7199a85f54877f1f5c03720eed34742c2afc3052 | [
"BSD-3-Clause"
] | 3 | 2017-07-14T14:30:18.000Z | 2018-05-19T10:58:17.000Z | near200.py | Logic-gate/datasig | 7199a85f54877f1f5c03720eed34742c2afc3052 | [
"BSD-3-Clause"
] | null | null | null | near200.py | Logic-gate/datasig | 7199a85f54877f1f5c03720eed34742c2afc3052 | [
"BSD-3-Clause"
] | null | null | null | #!/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'
| 23.236842 | 175 | 0.604757 | #!/usr/bin/env python
import urllib2
class http_code:
def append_http(self, url):
url = url + '/../..'
self.error(url)
def error(self, url):
code = str(self.urlOpen(url))
print url, code
client_error = set(['401', '403', '404', '405']) #add as much as you like
... | 478 | -5 | 108 |
953bc88512fafb4107b9253d52fe392ea8f7bc19 | 183 | py | Python | url/cli-open-url.py | rawswift/python-collections | 05b61611473a15c666058de3bd5f2707f82d9a4d | [
"MIT"
] | null | null | null | url/cli-open-url.py | rawswift/python-collections | 05b61611473a15c666058de3bd5f2707f82d9a4d | [
"MIT"
] | null | null | null | url/cli-open-url.py | rawswift/python-collections | 05b61611473a15c666058de3bd5f2707f82d9a4d | [
"MIT"
] | null | null | null | #!/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)
| 16.636364 | 53 | 0.68306 | #!/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)
| 0 | 0 | 0 |
afda7eaae1dfe7212fc26cbf35ca428db941d626 | 961 | py | Python | prep.py | michalsn13/Python-Flashcards | d51dea28811e430385962b7a2d768ee882a23d8c | [
"MIT"
] | null | null | null | prep.py | michalsn13/Python-Flashcards | d51dea28811e430385962b7a2d768ee882a23d8c | [
"MIT"
] | null | null | null | prep.py | michalsn13/Python-Flashcards | d51dea28811e430385962b7a2d768ee882a23d8c | [
"MIT"
] | null | null | null | # 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... | 32.033333 | 127 | 0.670135 | # 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... | 0 | 0 | 0 |
82dafd6d77e556704f95a3230fe6f0e16c2cdd87 | 664 | py | Python | MaximumLikelihoodEstimation.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | MaximumLikelihoodEstimation.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | MaximumLikelihoodEstimation.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | 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... | 34.947368 | 95 | 0.691265 | 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
def gaussian(X, theta):
res = (1 / (np.sqrt(2 * np.pi * theta[1]))) * np.exp(-(X - theta[0]) ** 2 / (2 * theta[1]))
retu... | 113 | 0 | 22 |
8f44b2b8007e951ec71898b33e27eafd9b4f8cff | 5,283 | py | Python | Code_Versions/climate_app-backup.py | robgauer/sqlalchemy-challenge | ba4ace59bd06d953760b98395b5599e9728b81f7 | [
"ADSL"
] | null | null | null | Code_Versions/climate_app-backup.py | robgauer/sqlalchemy-challenge | ba4ace59bd06d953760b98395b5599e9728b81f7 | [
"ADSL"
] | null | null | null | Code_Versions/climate_app-backup.py | robgauer/sqlalchemy-challenge | ba4ace59bd06d953760b98395b5599e9728b81f7 | [
"ADSL"
] | null | null | null | # 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... | 30.715116 | 183 | 0.625781 | # 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,780 | 0 | 88 |
0072deb84cc27969f17d8d6766cc5bc2e5efcc26 | 289 | py | Python | modules/login.py | dindamajesty13/web-risk | 8ba90ceecf3146049a44df7359ac021de0a3d4ce | [
"MIT"
] | null | null | null | modules/login.py | dindamajesty13/web-risk | 8ba90ceecf3146049a44df7359ac021de0a3d4ce | [
"MIT"
] | null | null | null | modules/login.py | dindamajesty13/web-risk | 8ba90ceecf3146049a44df7359ac021de0a3d4ce | [
"MIT"
] | null | null | null | from lib.database import db_connect | 32.111111 | 101 | 0.647059 | from lib.database import db_connect
def getUsers(username, password):
conn = db_connect()
with conn:
cur = conn.cursor()
cur.execute(f"SELECT * FROM public.users WHERE email='{username}' and password='{password}'")
data = cur.fetchone()
return data | 231 | 0 | 23 |
1418e793952352dd30d391cb7e26480664b52705 | 1,922 | py | Python | vsf_erpnext/cart.py | vijaywm/vsf-erpnext | 84a566fb9af8208696b11690d01a160a0da0250c | [
"MIT"
] | 2 | 2019-11-30T07:30:41.000Z | 2019-12-19T08:33:59.000Z | vsf_erpnext/cart.py | vijaywm/vsf-erpnext | 84a566fb9af8208696b11690d01a160a0da0250c | [
"MIT"
] | 1 | 2020-01-04T06:13:17.000Z | 2020-01-04T06:13:17.000Z | vsf_erpnext/cart.py | vijaywm/vsf-erpnext | 84a566fb9af8208696b11690d01a160a0da0250c | [
"MIT"
] | 6 | 2020-06-07T09:55:42.000Z | 2022-03-17T16:53:51.000Z | # -*- 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)
| 32.033333 | 111 | 0.59001 | # -*- 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=
def update(token=None, cartId=None,):
# https:/... | 1,571 | 0 | 44 |
393e4363ab5a4ab78c760cd41d325bb36e4401ca | 1,787 | py | Python | hermes/tests/test_email_engine.py | Yo-main/akingbee.com | 144940df99900226073eb4bf721a6ab407a3911d | [
"MIT"
] | null | null | null | hermes/tests/test_email_engine.py | Yo-main/akingbee.com | 144940df99900226073eb4bf721a6ab407a3911d | [
"MIT"
] | 20 | 2019-10-06T20:24:49.000Z | 2022-02-28T01:55:49.000Z | hermes/tests/test_email_engine.py | yo-main/akingbee | a8b4b307e2262f98eb93459c6dd4207e707cee1e | [
"MIT"
] | null | null | null | 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)
| 25.528571 | 66 | 0.731953 | 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)
def set_config():
CONFIG.set("COUCOU_EMAIL_PASSWORD", "123")
CONFIG.set("SENDER_EMAIL_PASSWORD", "LoveYou")
CONFIG.set("EMAIL_SER... | 1,426 | 64 | 114 |
aebef7f18389f1bc898095c22cef8105f51f76c7 | 61,931 | py | Python | examples/jirasearch/handle.py | Bingnum1/luceneserver | 3cd784352e9fe0bbb9cf236a200ed20061c3314a | [
"Apache-2.0"
] | 1 | 2021-01-23T09:06:51.000Z | 2021-01-23T09:06:51.000Z | examples/jirasearch/handle.py | Bingnum1/luceneserver | 3cd784352e9fe0bbb9cf236a200ed20061c3314a | [
"Apache-2.0"
] | null | null | null | examples/jirasearch/handle.py | Bingnum1/luceneserver | 3cd784352e9fe0bbb9cf236a200ed20061c3314a | [
"Apache-2.0"
] | null | null | null | # 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 ... | 30.658911 | 217 | 0.540472 | # 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 ... | 56,101 | 294 | 1,128 |
6fb3319ecbd299b06e929aebe71749f66112ab97 | 3,138 | py | Python | case_case.py | athityakumar/harvey | 3102656e4adeb939217e9eb5b85e002a2fc84136 | [
"MIT"
] | 2 | 2019-02-08T22:24:41.000Z | 2022-02-16T11:59:52.000Z | case_case.py | athityakumar/harvey | 3102656e4adeb939217e9eb5b85e002a2fc84136 | [
"MIT"
] | 11 | 2019-02-05T11:53:05.000Z | 2019-03-05T15:57:19.000Z | case_case.py | athityakumar/harvey | 3102656e4adeb939217e9eb5b85e002a2fc84136 | [
"MIT"
] | 3 | 2019-03-02T15:09:35.000Z | 2022-01-25T07:01:03.000Z | 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... | 41.84 | 174 | 0.756533 | 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... | 0 | 0 | 0 |
6a803cec7a3a49196e6e4583c184c940972f3ced | 1,177 | py | Python | nlpblock/model/RNN_Attention.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | 3 | 2019-02-27T13:41:26.000Z | 2021-05-13T07:02:39.000Z | nlpblock/model/RNN_Attention.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | null | null | null | nlpblock/model/RNN_Attention.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | 3 | 2019-03-02T02:19:46.000Z | 2021-10-03T18:46:52.000Z | 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,... | 34.617647 | 121 | 0.665251 | import torch
import torch.nn as nn
import nlpblock as nb
class RNN_Attention(nn.Module):
def __init__(self, emb_dim,
n_class, n_hidden, n_layers=1, bidirectional=False, linearTransform=True):
super(RNN_Attention, self).__init__()
self.n_hidden = n_hidden
self.num_direction... | 722 | 10 | 103 |
429702683092087dda7bd45ce349996c664998f9 | 2,387 | py | Python | backend/apps/tophatter/router.py | ukibbb/goodmood-inc | 006b3bb91125df15480b08832403ee22b10537ac | [
"MIT"
] | null | null | null | backend/apps/tophatter/router.py | ukibbb/goodmood-inc | 006b3bb91125df15480b08832403ee22b10537ac | [
"MIT"
] | null | null | null | backend/apps/tophatter/router.py | ukibbb/goodmood-inc | 006b3bb91125df15480b08832403ee22b10537ac | [
"MIT"
] | null | null | null | 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... | 29.109756 | 79 | 0.697528 | 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... | 1,639 | 0 | 110 |
464015c029a4482be5a93282e61c8b2308f6ae53 | 1,506 | py | Python | Desafio22.py | rsmelocunha/Python-projects | 1740d1cbafb0aebfffeb0bfdb4ccccf0dbd14093 | [
"MIT"
] | null | null | null | Desafio22.py | rsmelocunha/Python-projects | 1740d1cbafb0aebfffeb0bfdb4ccccf0dbd14093 | [
"MIT"
] | null | null | null | Desafio22.py | rsmelocunha/Python-projects | 1740d1cbafb0aebfffeb0bfdb4ccccf0dbd14093 | [
"MIT"
] | null | null | null | 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 é: ... | 115.846154 | 137 | 0.500664 | 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 é: ... | 0 | 0 | 0 |
b5227a7e5839f4d1ee9a7e32c5df052cd91c354e | 4,238 | py | Python | justmltools/repo/abstract_repo_downloader.py | BigNerd/justmltools | 97133380f2675596fdd9c87d9bc570ccd5fc20b9 | [
"MIT"
] | null | null | null | justmltools/repo/abstract_repo_downloader.py | BigNerd/justmltools | 97133380f2675596fdd9c87d9bc570ccd5fc20b9 | [
"MIT"
] | 3 | 2021-09-17T06:42:03.000Z | 2021-09-17T06:42:04.000Z | justmltools/repo/abstract_repo_downloader.py | BigNerd/justmltools | 97133380f2675596fdd9c87d9bc570ccd5fc20b9 | [
"MIT"
] | 1 | 2020-06-24T15:17:59.000Z | 2020-06-24T15:17:59.000Z | 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
| 43.690722 | 117 | 0.722511 | 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
class AbstractRepoDownloader(abc.ABC):
def __init__(self, remote_data_path_config: AbstractDataPat... | 3,697 | 302 | 23 |
0009e946b7b5b9f3e765ad2fd6103cf20ad6f912 | 6,645 | py | Python | app/intro_py/intro/cli.py | thebridge0491/intro_py | c8ef32d8df10fa07a3c7b191474074b2dfd640c3 | [
"CECILL-B"
] | null | null | null | app/intro_py/intro/cli.py | thebridge0491/intro_py | c8ef32d8df10fa07a3c7b191474074b2dfd640c3 | [
"CECILL-B"
] | null | null | null | app/intro_py/intro/cli.py | thebridge0491/intro_py | c8ef32d8df10fa07a3c7b191474074b2dfd640c3 | [
"CECILL-B"
] | null | null | null | # -*- 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... | 32.414634 | 80 | 0.61836 | # -*- 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... | 3,774 | 0 | 69 |
88e924dee2c792d20797021950f2e3dc5810c1c7 | 1,586 | py | Python | src/validation/VersionDropout.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | src/validation/VersionDropout.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | src/validation/VersionDropout.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | 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, ... | 36.883721 | 109 | 0.592055 | from sklearn.model_selection import BaseCrossValidator
import numpy as np
import pandas as pd
class VersionDropout(BaseCrossValidator):
def __init__(self, n_repeats = 10, dropout = 0.3):
self.n_repeats = n_repeats
self.dropout = dropout
# We dont implement this one
def _iter_test_... | 821 | 20 | 142 |
60f271887d5583280854a15c63199927894da99a | 4,371 | py | Python | lib/Phase3/alu_P3.py | prafgup/risc_v_assembler | ce2bea5f8e8b4f2ebb2f88aff1f0b2de5dc176b3 | [
"MIT"
] | 2 | 2020-07-23T16:57:04.000Z | 2020-07-27T08:59:25.000Z | lib/Phase3/alu_P3.py | prafgup/risc_v_assembler | ce2bea5f8e8b4f2ebb2f88aff1f0b2de5dc176b3 | [
"MIT"
] | null | null | null | lib/Phase3/alu_P3.py | prafgup/risc_v_assembler | ce2bea5f8e8b4f2ebb2f88aff1f0b2de5dc176b3 | [
"MIT"
] | null | null | null |
# 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... | 16.683206 | 174 | 0.512011 | def DTB(n):
b=bin(n).replace("0b","")
k=32-len(b)
c="0"*k
b=c+b
return b
def BTD(n):
return int(n,2)
# 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... | 3,211 | 0 | 210 |
467487ac228f1ed29b28cfee4341fb034f701791 | 3,348 | py | Python | backend/forum/views.py | lautarianoo/lautacademy | beec082bdffe8c773fcec51974a687aced278a76 | [
"BSD-3-Clause"
] | 2 | 2021-11-29T15:34:24.000Z | 2021-12-02T14:47:20.000Z | backend/forum/views.py | lautarianoo/lautacademy | beec082bdffe8c773fcec51974a687aced278a76 | [
"BSD-3-Clause"
] | null | null | null | backend/forum/views.py | lautarianoo/lautacademy | beec082bdffe8c773fcec51974a687aced278a76 | [
"BSD-3-Clause"
] | null | null | null | 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... | 31.885714 | 103 | 0.669952 | 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... | 1,309 | 0 | 215 |
30c57ec5cfdd4cc03fe09d8e584165c9e0546fd3 | 195 | py | Python | Desafio Python/Aula 23 des114.py | ayresmajor/Curso-python | 006229cec38ea365bf43b19e3ce93fbd32e1dca6 | [
"MIT"
] | null | null | null | Desafio Python/Aula 23 des114.py | ayresmajor/Curso-python | 006229cec38ea365bf43b19e3ce93fbd32e1dca6 | [
"MIT"
] | null | null | null | Desafio Python/Aula 23 des114.py | ayresmajor/Curso-python | 006229cec38ea365bf43b19e3ce93fbd32e1dca6 | [
"MIT"
] | null | null | null | 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')
| 21.666667 | 57 | 0.702564 | 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')
| 0 | 0 | 0 |
7b69b51615be9dc30924134e49ad37d51de6c157 | 35,658 | py | Python | craton/api/v1/schemas.py | sigmavirus24/craton | 911577978d9c67ed735fc87c4e36e9ddb01a78b3 | [
"Apache-2.0"
] | null | null | null | craton/api/v1/schemas.py | sigmavirus24/craton | 911577978d9c67ed735fc87c4e36e9ddb01a78b3 | [
"Apache-2.0"
] | null | null | null | craton/api/v1/schemas.py | sigmavirus24/craton | 911577978d9c67ed735fc87c4e36e9ddb01a78b3 | [
"Apache-2.0"
] | null | null | null | import six
DefinitionsHost = {'discriminator': 'name',
'required': ['name',
'region_id',
'ip_address',
'device_type'],
'type': 'object',
'properties': {
... | 43.221818 | 79 | 0.391245 | import six
DefinitionsHost = {'discriminator': 'name',
'required': ['name',
'region_id',
'ip_address',
'device_type'],
'type': 'object',
'properties': {
... | 3,638 | 97 | 69 |
6e01753da913bb1f17997203ba999ed0c9230a2f | 8,602 | py | Python | modules/dialogPassword_ui.py | bcavlin/onering | becd3969e4e2ae4f3161221ace6d8912aad1c9ca | [
"Apache-2.0"
] | 1 | 2017-10-14T01:47:30.000Z | 2017-10-14T01:47:30.000Z | modules/dialogPassword_ui.py | bcavlin/onering | becd3969e4e2ae4f3161221ace6d8912aad1c9ca | [
"Apache-2.0"
] | null | null | null | modules/dialogPassword_ui.py | bcavlin/onering | becd3969e4e2ae4f3161221ace6d8912aad1c9ca | [
"Apache-2.0"
] | null | null | null | # -*- 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:
... | 63.25 | 112 | 0.76273 | # -*- 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:
de... | 8,046 | 11 | 154 |
d483b4213dcecfc34458e8d5770b083343438c72 | 88 | py | Python | ontology/logistic_regression/sherlock/listify_circuits_k16_forward.py | ehbeam/neuro-knowledge-engine | 9dc56ade0bbbd8d14f0660774f787c3f46d7e632 | [
"MIT"
] | 15 | 2020-07-17T07:10:26.000Z | 2022-02-18T05:51:45.000Z | ontology/neural_network/sherlock/listify_circuits_k16_forward.py | YifeiCAO/neuro-knowledge-engine | 9dc56ade0bbbd8d14f0660774f787c3f46d7e632 | [
"MIT"
] | 2 | 2022-01-14T09:10:12.000Z | 2022-01-28T17:32:42.000Z | ontology/neural_network/sherlock/listify_circuits_k16_forward.py | YifeiCAO/neuro-knowledge-engine | 9dc56ade0bbbd8d14f0660774f787c3f46d7e632 | [
"MIT"
] | 4 | 2021-12-22T13:27:32.000Z | 2022-02-18T05:51:47.000Z | #!/bin/python
import listify_circuits
listify_circuits.optimize_circuits(16, 'forward') | 22 | 49 | 0.829545 | #!/bin/python
import listify_circuits
listify_circuits.optimize_circuits(16, 'forward') | 0 | 0 | 0 |
46b09847bebe5d7b83147bb9de7289ec119e929b | 296 | py | Python | setup.py | shuvamlal9/download_audioset | fdcc8baeaf1f6884b6e95ccacb1cd59603c8c973 | [
"Apache-2.0"
] | 58 | 2019-02-15T06:42:25.000Z | 2022-02-07T05:44:48.000Z | setup.py | shuvamlal9/download_audioset | fdcc8baeaf1f6884b6e95ccacb1cd59603c8c973 | [
"Apache-2.0"
] | 7 | 2018-11-08T20:09:19.000Z | 2021-09-03T12:35:19.000Z | setup.py | shuvamlal9/download_audioset | fdcc8baeaf1f6884b6e95ccacb1cd59603c8c973 | [
"Apache-2.0"
] | 18 | 2019-09-25T04:46:57.000Z | 2021-08-04T11:54:40.000Z | '''
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)
| 21.142857 | 53 | 0.675676 | '''
Quick setup script.
'''
import os
def pip_install(modules):
for i in range(len(modules)):
os.system('pip3 install %s'%(modules[i]))
os.system('brew install ffmpeg')
os.system('brew install youtube-dl')
modules=['ffmpy','pandas','soundfile','pafy', 'tqdm']
pip_install(modules)
| 88 | 0 | 23 |
bd31657dc3f392331c02e7aeee504595dddd7d6b | 5,819 | py | Python | codestosort/NaturalLanguage/module/tester.py | jimmy-academia/Deeper-Learnings | ac363efe5450dd2751c0c1bea0ee7af457f7ac24 | [
"MIT"
] | 2 | 2019-09-30T04:57:11.000Z | 2020-04-06T04:27:46.000Z | codestosort/NaturalLanguage/module/tester.py | jimmy-academia/Deeper-Learnings | ac363efe5450dd2751c0c1bea0ee7af457f7ac24 | [
"MIT"
] | null | null | null | codestosort/NaturalLanguage/module/tester.py | jimmy-academia/Deeper-Learnings | ac363efe5450dd2751c0c1bea0ee7af457f7ac24 | [
"MIT"
] | null | null | null | 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
| 34.636905 | 102 | 0.562983 | 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
cla... | 5,147 | 282 | 72 |
76a2c4c049f86c17dc660de2b14672bf68776fd2 | 467 | py | Python | iiits/migrations/0021_auto_20160423_1110.py | IIITS/iiits.ac.in | fd1bcd656a2f1a038d331b005224c546998a23a6 | [
"MIT"
] | 6 | 2016-02-27T04:35:28.000Z | 2020-06-09T04:18:38.000Z | iiits/migrations/0021_auto_20160423_1110.py | IIITS/iiits.ac.in | fd1bcd656a2f1a038d331b005224c546998a23a6 | [
"MIT"
] | null | null | null | iiits/migrations/0021_auto_20160423_1110.py | IIITS/iiits.ac.in | fd1bcd656a2f1a038d331b005224c546998a23a6 | [
"MIT"
] | 5 | 2016-03-01T07:28:20.000Z | 2021-01-19T10:51:58.000Z | # -*- 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
| 22.238095 | 60 | 0.627409 | # -*- 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
class Migration(migrations.Migration):
dependencies = [
('iiits', '0020_imageslider_researchcentreprofile'),
]
operations = [
migrations... | 0 | 291 | 23 |
1cea88c1648db23639f82885fc29e436b37f54cf | 345 | py | Python | python/setup.py | Impavidity/pinfrastructure | b5577fe1e140e0b360aec2834349ba87647eb000 | [
"MIT"
] | 10 | 2017-12-04T03:50:50.000Z | 2020-09-25T07:24:32.000Z | python/setup.py | Impavidity/pinfrastructure | b5577fe1e140e0b360aec2834349ba87647eb000 | [
"MIT"
] | 8 | 2018-07-14T09:45:38.000Z | 2018-09-17T20:56:52.000Z | python/setup.py | Impavidity/pinfrastructure | b5577fe1e140e0b360aec2834349ba87647eb000 | [
"MIT"
] | 1 | 2017-11-24T18:31:53.000Z | 2017-11-24T18:31:53.000Z | 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... | 20.294118 | 59 | 0.669565 | 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... | 0 | 0 | 0 |
90016a8b27c1095766448f52872ada34f0d5ea62 | 1,499 | py | Python | web/migrations/versions/4cbe8e432c6b_add_action_table.py | skystrife/piazza-roles | be1c45fa9b8ecd75e41dc005d4eb7ec5c645d980 | [
"MIT"
] | null | null | null | web/migrations/versions/4cbe8e432c6b_add_action_table.py | skystrife/piazza-roles | be1c45fa9b8ecd75e41dc005d4eb7ec5c645d980 | [
"MIT"
] | null | null | null | web/migrations/versions/4cbe8e432c6b_add_action_table.py | skystrife/piazza-roles | be1c45fa9b8ecd75e41dc005d4eb7ec5c645d980 | [
"MIT"
] | null | null | null | """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
| 31.229167 | 75 | 0.668446 | """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
def upgrade():
... | 1,150 | 0 | 46 |
bb841a9f17b94bb83e50a9e9c80862e3e8d31edf | 10,825 | py | Python | src/sqlalchemyseed/seeder.py | jedymatt/sqlalchemyseed | 2bb18889ac958df525afc235f52d7e4bfa7f12f8 | [
"MIT"
] | 5 | 2021-07-27T18:06:12.000Z | 2021-12-26T06:12:07.000Z | src/sqlalchemyseed/seeder.py | jedymatt/sqlalchemyseed | 2bb18889ac958df525afc235f52d7e4bfa7f12f8 | [
"MIT"
] | 5 | 2021-08-28T00:54:15.000Z | 2022-01-19T12:42:24.000Z | src/sqlalchemyseed/seeder.py | jedymatt/sqlalchemyseed | 2bb18889ac958df525afc235f52d7e4bfa7f12f8 | [
"MIT"
] | 1 | 2021-08-08T14:35:02.000Z | 2021-08-08T14:35:02.000Z | """
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... | 32.41018 | 98 | 0.661247 | """
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... | 6,843 | 288 | 599 |
c6ae817802838c9c1fcaecb00a60b1cdde36ad6c | 1,024 | py | Python | strongr/schedulerdomain/model/scalingdrivers/scalingdriver.py | bigr-erasmusmc/StrongR | 48573e170771a251f629f2d13dba7173f010a38c | [
"Apache-2.0"
] | null | null | null | strongr/schedulerdomain/model/scalingdrivers/scalingdriver.py | bigr-erasmusmc/StrongR | 48573e170771a251f629f2d13dba7173f010a38c | [
"Apache-2.0"
] | null | null | null | strongr/schedulerdomain/model/scalingdrivers/scalingdriver.py | bigr-erasmusmc/StrongR | 48573e170771a251f629f2d13dba7173f010a38c | [
"Apache-2.0"
] | null | null | null | 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... | 51.2 | 381 | 0.805664 | 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... | 0 | 0 | 0 |
f9a6ef735c3f7d5839603fb65b8f00b4e1d4343e | 4,124 | py | Python | backend/post/serializers.py | tecty/SENG2021 | f04c58b61c8ad44e776a0a1694a77a1b9b6eed6a | [
"MIT"
] | null | null | null | backend/post/serializers.py | tecty/SENG2021 | f04c58b61c8ad44e776a0a1694a77a1b9b6eed6a | [
"MIT"
] | null | null | null | backend/post/serializers.py | tecty/SENG2021 | f04c58b61c8ad44e776a0a1694a77a1b9b6eed6a | [
"MIT"
] | null | null | null | 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... | 32.730159 | 78 | 0.606208 | 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... | 1,048 | 2,293 | 92 |
662dc0ec782ab21f5dae39888bc5bc9d581181e0 | 10,291 | py | Python | visnav/missions/toynokia.py | oknuutti/hw_visnav | 5254b8bdd146548413554c00e6e76264a2540e8b | [
"MIT"
] | null | null | null | visnav/missions/toynokia.py | oknuutti/hw_visnav | 5254b8bdd146548413554c00e6e76264a2540e8b | [
"MIT"
] | null | null | null | visnav/missions/toynokia.py | oknuutti/hw_visnav | 5254b8bdd146548413554c00e6e76264a2540e8b | [
"MIT"
] | null | null | null | 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... | 42.17623 | 120 | 0.519386 | 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... | 9,260 | 535 | 24 |
55180a11f1205eacca52dbb58ef6d813c676ac21 | 383 | py | Python | LeetCode/Session3/TaskScheduler_ii.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/TaskScheduler_ii.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/TaskScheduler_ii.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | from typing import List
from collections import Counter
| 29.461538 | 62 | 0.574413 | from typing import List
from collections import Counter
class Solution:
def leastInterval(self, tasks: List[str], n: int) -> int:
freq = sorted(Counter(tasks).values())
maxVal = freq[-1] - 1
idleSlots = maxVal * n
for freq in freq[-2::-1]:
idleSlots -= mi... | 283 | -6 | 49 |
44399eb4722e282205d533abf1009cd04c03e3f2 | 861 | py | Python | setup.py | limdongjin/smart-crawler | bc5f4f78528ae28cb7cf5f33515c3353aa72169f | [
"MIT"
] | 1 | 2019-09-08T22:04:55.000Z | 2019-09-08T22:04:55.000Z | setup.py | limdongjin/smart-crawller | bc5f4f78528ae28cb7cf5f33515c3353aa72169f | [
"MIT"
] | 1 | 2021-06-02T00:20:16.000Z | 2021-06-02T00:20:16.000Z | setup.py | limdongjin/smart-crawller | bc5f4f78528ae28cb7cf5f33515c3353aa72169f | [
"MIT"
] | 1 | 2020-08-15T12:27:58.000Z | 2020-08-15T12:27:58.000Z | 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... | 25.323529 | 60 | 0.54007 | import io
from setuptools import setup, find_packages
def long_description():
with io.open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
return readme
setup(
name='smart-crawler',
version='0.2',
url='https://github.com/limdongjin/smart-crawler',
license='MIT',
autho... | 105 | 0 | 23 |
d8db5ebb95e08d462648397b5a96142b82994143 | 838 | py | Python | solar/solar.py | laluferu/hw_7 | 8f8fa38695d23a6aaa97fed7facc6bf03481c03d | [
"MIT"
] | null | null | null | solar/solar.py | laluferu/hw_7 | 8f8fa38695d23a6aaa97fed7facc6bf03481c03d | [
"MIT"
] | null | null | null | solar/solar.py | laluferu/hw_7 | 8f8fa38695d23a6aaa97fed7facc6bf03481c03d | [
"MIT"
] | null | null | null | 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... | 15.518519 | 47 | 0.632458 | 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... | 0 | 0 | 0 |
b6735ebf0a44f6ae0930212653b892df8d69005a | 4,767 | py | Python | pmtc/pmtc_csgo.py | amosbastian/mhp | 97bfd505a1b2925b384246689e09abf6c296f598 | [
"MIT"
] | 1 | 2021-12-15T09:29:05.000Z | 2021-12-15T09:29:05.000Z | pmtc/pmtc_csgo.py | amosbastian/mhp | 97bfd505a1b2925b384246689e09abf6c296f598 | [
"MIT"
] | 3 | 2021-01-08T08:55:23.000Z | 2021-12-13T19:42:46.000Z | pmtc/pmtc_csgo.py | amosbastian/mhp | 97bfd505a1b2925b384246689e09abf6c296f598 | [
"MIT"
] | 2 | 2020-06-20T21:14:55.000Z | 2020-07-15T18:19:06.000Z | 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:
... | 30.557692 | 79 | 0.591777 | 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:
... | 116 | 0 | 23 |
e54d408698a4c259a13050d9e1d7580f64ca0679 | 6,620 | py | Python | common/src/build-data/scripts/dist.py | ane-community/botan-crypto-ane | 71056f5f0d5fd706e6d42e2f7ec0f7f55d86fb74 | [
"MIT"
] | 1 | 2018-03-09T20:21:47.000Z | 2018-03-09T20:21:47.000Z | common/src/build-data/scripts/dist.py | ane-community/botan-crypto-ane | 71056f5f0d5fd706e6d42e2f7ec0f7f55d86fb74 | [
"MIT"
] | null | null | null | common/src/build-data/scripts/dist.py | ane-community/botan-crypto-ane | 71056f5f0d5fd706e6d42e2f7ec0f7f55d86fb74 | [
"MIT"
] | null | null | null | #!/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__ == '__... | 28.782609 | 90 | 0.573867 | #!/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
def check_subproce... | 5,931 | 0 | 184 |
1df314dca28913ceda289e2ee311b3e80def76d2 | 2,023 | py | Python | tab.py | sarrionandia/tournatrack | 4c13a23f43da5317eea4614870a7a8510fc540ec | [
"Apache-2.0"
] | 1 | 2015-08-13T14:35:11.000Z | 2015-08-13T14:35:11.000Z | tab.py | sarrionandia/tournatrack | 4c13a23f43da5317eea4614870a7a8510fc540ec | [
"Apache-2.0"
] | null | null | null | tab.py | sarrionandia/tournatrack | 4c13a23f43da5317eea4614870a7a8510fc540ec | [
"Apache-2.0"
] | null | null | null | # 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... | 27.712329 | 74 | 0.687593 | # 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... | 1,006 | 20 | 46 |
b6de34c73f637ea19a9f7821a4d1cb53b0ef6313 | 1,254 | py | Python | jiangrong/jit-block.py | ronjian/once-for-all | 6d0a76be5007fda31c8b366a51f23b626bb8f24c | [
"Apache-2.0"
] | null | null | null | jiangrong/jit-block.py | ronjian/once-for-all | 6d0a76be5007fda31c8b366a51f23b626bb8f24c | [
"Apache-2.0"
] | null | null | null | jiangrong/jit-block.py | ronjian/once-for-all | 6d0a76be5007fda31c8b366a51f23b626bb8f24c | [
"Apache-2.0"
] | null | null | null | 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... | 33.891892 | 70 | 0.500797 | 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... | 0 | 0 | 0 |
3b129e434026a38b5463ceebe1db46e822ca59cb | 1,743 | py | Python | bspump/declarative/expression/utility/context.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 17 | 2019-02-14T09:26:03.000Z | 2022-03-11T09:23:52.000Z | bspump/declarative/expression/utility/context.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 91 | 2019-05-06T18:59:02.000Z | 2022-01-11T06:22:32.000Z | bspump/declarative/expression/utility/context.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 10 | 2019-04-23T08:48:58.000Z | 2022-02-13T14:24:28.000Z | from ...abc import Expression
from ..value.valueexpr import VALUE
class CONTEXT(Expression):
"""
The current context.
Usage:
```
!CONTEXT
``
"""
Attributes = {
}
| 21.518519 | 83 | 0.660356 | from ...abc import Expression
from ..value.valueexpr import VALUE
class CONTEXT(Expression):
"""
The current context.
Usage:
```
!CONTEXT
``
"""
Attributes = {
}
def __init__(self, app, *, value):
super().__init__(app)
assert(value == "")
def __call__(self, context, event, *args, **kwargs):
return con... | 1,317 | 184 | 71 |
29647b3a757c29b49e6efec66afbc1819cb55c41 | 291 | py | Python | build/lib/ctrlengine/__init__.py | 0xJeremy/ctrl.engine | 19abba70df149a05edc5722cc95ceacc538448e6 | [
"MIT"
] | 3 | 2020-04-18T19:28:15.000Z | 2021-02-25T18:48:08.000Z | build/lib/ctrlengine/__init__.py | 0xJeremy/ctrl.engine | 19abba70df149a05edc5722cc95ceacc538448e6 | [
"MIT"
] | null | null | null | build/lib/ctrlengine/__init__.py | 0xJeremy/ctrl.engine | 19abba70df149a05edc5722cc95ceacc538448e6 | [
"MIT"
] | null | null | null | 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
| 24.25 | 63 | 0.852234 | 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
| 0 | 0 | 0 |
f1f48ef92a9073f542579d5b744ac993e40d285d | 2,480 | py | Python | clef/clef_dataloaders/clef_paths.py | ogaloglu/pre-training-multilingual-document-encoders | 6cfd31c42bf9e9368a01f7a57489413b0dd8e8a3 | [
"Apache-2.0"
] | null | null | null | clef/clef_dataloaders/clef_paths.py | ogaloglu/pre-training-multilingual-document-encoders | 6cfd31c42bf9e9368a01f7a57489413b0dd8e8a3 | [
"Apache-2.0"
] | null | null | null | clef/clef_dataloaders/clef_paths.py | ogaloglu/pre-training-multilingual-document-encoders | 6cfd31c42bf9e9368a01f7a57489413b0dd8e8a3 | [
"Apache-2.0"
] | null | null | null | 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... | 42.033898 | 106 | 0.719355 | 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... | 84 | 0 | 22 |
0efa9312381966faa89ed0b842c0044959a6f17f | 81 | py | Python | src/parameters.py | brenorms/ispy-hijackdet | e9d95c2c287406769ba4382928f126abc5faa75c | [
"MIT"
] | null | null | null | src/parameters.py | brenorms/ispy-hijackdet | e9d95c2c287406769ba4382928f126abc5faa75c | [
"MIT"
] | null | null | null | src/parameters.py | brenorms/ispy-hijackdet | e9d95c2c287406769ba4382928f126abc5faa75c | [
"MIT"
] | null | null | null | DESTINATION = "dest"
ROUTE = "route"
TIMESTAMP = "time"
INCOMPLETE = "incomplete" | 20.25 | 25 | 0.716049 | DESTINATION = "dest"
ROUTE = "route"
TIMESTAMP = "time"
INCOMPLETE = "incomplete" | 0 | 0 | 0 |
899565351183ed11982ca23bd721f826d9db3dc3 | 10,726 | py | Python | legtool/async/asyncio_qt.py | jpieper/legtool | ab3946051bd16817b61d3073ce7be8bd27af90d0 | [
"Apache-2.0"
] | 10 | 2015-09-23T19:28:06.000Z | 2021-04-27T02:32:27.000Z | legtool/async/asyncio_qt.py | jpieper/legtool | ab3946051bd16817b61d3073ce7be8bd27af90d0 | [
"Apache-2.0"
] | null | null | null | legtool/async/asyncio_qt.py | jpieper/legtool | ab3946051bd16817b61d3073ce7be8bd27af90d0 | [
"Apache-2.0"
] | 9 | 2015-10-16T07:26:18.000Z | 2021-01-13T07:18:35.000Z | # 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... | 32.113772 | 78 | 0.580832 | # 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... | 8,396 | 1,217 | 180 |
43b5ac3a72f9f95842b15538afd7bc1f2c01b85a | 409 | py | Python | tests/test_route53.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | tests/test_route53.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | tests/test_route53.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from troposphere.route53 import AliasTarget
if __name__ == "__main__":
unittest.main()
| 27.266667 | 86 | 0.738386 | import unittest
from troposphere.route53 import AliasTarget
class TestAliasTarget(unittest.TestCase):
def test_bucket_template(self):
AliasTarget("zone", "dnsname", True)
AliasTarget(hostedzoneid="zone", dnsname="dnsname", evaluatetargethealth=True)
AliasTarget(HostedZoneId="zone", DNSNam... | 229 | 20 | 49 |
31e0663dbc76bff63285d4bb8f3f2e71fbc4584c | 8,143 | py | Python | mmdeploy/apis/onnx/partition.py | grimoire/mmdeploy | e84bc30f4a036dd19cb3af854203922a91098e84 | [
"Apache-2.0"
] | 746 | 2021-12-27T10:50:28.000Z | 2022-03-31T13:34:14.000Z | mmdeploy/apis/onnx/partition.py | grimoire/mmdeploy | e84bc30f4a036dd19cb3af854203922a91098e84 | [
"Apache-2.0"
] | 253 | 2021-12-28T05:59:13.000Z | 2022-03-31T18:22:25.000Z | mmdeploy/apis/onnx/partition.py | grimoire/mmdeploy | e84bc30f4a036dd19cb3af854203922a91098e84 | [
"Apache-2.0"
] | 147 | 2021-12-27T10:50:33.000Z | 2022-03-30T10:44:20.000Z | # 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... | 39.529126 | 79 | 0.557534 | # 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... | 0 | 0 | 0 |
5d7f2e56aabd9c24bae1c58515d40f566137a253 | 30,722 | py | Python | Utilities/Data_Retrieval.py | MaximilianJanetschek/Urban_Intermodal_Transportation | 632caf668636448dc9290d54cf1c7b527c68a957 | [
"MIT"
] | null | null | null | Utilities/Data_Retrieval.py | MaximilianJanetschek/Urban_Intermodal_Transportation | 632caf668636448dc9290d54cf1c7b527c68a957 | [
"MIT"
] | null | null | null | Utilities/Data_Retrieval.py | MaximilianJanetschek/Urban_Intermodal_Transportation | 632caf668636448dc9290d54cf1c7b527c68a957 | [
"MIT"
] | null | null | null | 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... | 48.229199 | 163 | 0.571252 | 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... | 19,711 | 0 | 478 |
9f26d6035b6573e34596eb9fde7c872ffce0a295 | 834 | py | Python | Python3-Exercises/P4_BasicPrototype/create_table.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-Exercises/P4_BasicPrototype/create_table.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-Exercises/P4_BasicPrototype/create_table.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | # 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 ... | 29.785714 | 98 | 0.645084 | # 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 ... | 0 | 0 | 0 |
518d85a3aef403f601f2a5017033b27fa0b6353e | 670 | py | Python | Advance_Python/Threads/Interface.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Threads/Interface.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Threads/Interface.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | # 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() | 12.884615 | 35 | 0.565672 | # Interface
from abc import ABC, abstractmethod
class DefenceForce(ABC):
@abstractmethod
def gun(self):
pass
@abstractmethod
def area(self):
pass
class Army(DefenceForce):
def gun(self):
print("Gun : AK47")
def area(self):
print("Area : Land")
class AirFor... | 144 | 113 | 254 |
066da45179243a03d94f2d09baf50607a017d988 | 2,479 | py | Python | validation/validation_data_parser.py | djgroen/FabCovid | 9449f2a9ac5562c28bb7d25c2b772daba4930e21 | [
"BSD-3-Clause"
] | null | null | null | validation/validation_data_parser.py | djgroen/FabCovid | 9449f2a9ac5562c28bb7d25c2b772daba4930e21 | [
"BSD-3-Clause"
] | null | null | null | validation/validation_data_parser.py | djgroen/FabCovid | 9449f2a9ac5562c28bb7d25c2b772daba4930e21 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import os
if __name__ == '__main__':
update_validation_data(force=True)
print('Done') | 33.5 | 87 | 0.498992 | import pandas as pd
import os
def get_region_names():
path = '../config_files'
return os.listdir(path)
def get_validation_names():
path = 'raw_data'
d = os.listdir(path)
d = list(set(['_'.join(x.split('_')[:-1]) for x in d]))
return d
def update_validation_data(regions='all', force=False):
... | 2,295 | 0 | 69 |
97b8adc68cda8f76e6a472a5ea0c1148ad16237a | 4,241 | py | Python | auto.py | Angel-cuba/Painonhallinta_LAST | c7176dca2b5812470667e07357ffcfecff5f3ba4 | [
"CC0-1.0"
] | null | null | null | auto.py | Angel-cuba/Painonhallinta_LAST | c7176dca2b5812470667e07357ffcfecff5f3ba4 | [
"CC0-1.0"
] | null | null | null | auto.py | Angel-cuba/Painonhallinta_LAST | c7176dca2b5812470667e07357ffcfecff5f3ba4 | [
"CC0-1.0"
] | null | null | null |
# 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... | 39.268519 | 193 | 0.656685 |
# Auto-luokka yliluokka erilaisille autotyypeille
# Ominaisuudet (Field, Property) merkki, malli, vuosimalli, kilometrit, käyttövoima, vaihteistotyyppi, väri ja
class Auto():
# Olionmuodostin eli knstruktori
def __init__(self, rek, merkki, malli, vm, km, kvoima, vaihteito, vari, paastot, s_tilavuus, hin... | 947 | 2,353 | 76 |
92d78602e71ff019637a48c3901e7b88a151aaae | 3,475 | py | Python | BaseEditor.py | Demezy/SpeedSearch | dc25090d2e30ecc1f669a3a6c9d7a2277fd9ca32 | [
"BSD-3-Clause"
] | null | null | null | BaseEditor.py | Demezy/SpeedSearch | dc25090d2e30ecc1f669a3a6c9d7a2277fd9ca32 | [
"BSD-3-Clause"
] | null | null | null | BaseEditor.py | Demezy/SpeedSearch | dc25090d2e30ecc1f669a3a6c9d7a2277fd9ca32 | [
"BSD-3-Clause"
] | null | null | null | import os
import sqlite3
def cursore_maker(method):
"""Декоратор, создающий курсор, для работы с бд"""
return wrapper
class SQLWorker:
"""Это API для работы с SQLite таблицами, заточенный под основную программу"""
@cursore_maker
def make_table(self, cur):
"""Метод, создающий таблицу (... | 36.968085 | 118 | 0.640288 | import os
import sqlite3
def cursore_maker(method):
"""Декоратор, создающий курсор, для работы с бд"""
def wrapper(self, *args, **kwargs):
with sqlite3.connect(self.name) as base:
cur = base.cursor()
return_value = method(self, cur, *args, **kwargs)
base.commit()
... | 428 | 0 | 81 |
c5d1d1b86bf3bdcb3ec08d34977098d33c7f38d4 | 9,846 | py | Python | layers.py | Gladys-Zhao/mRNN-mLSTM | 23499f237ea8b0f68c96f756fbf0f4028836e64c | [
"BSD-3-Clause"
] | 15 | 2020-06-17T06:40:00.000Z | 2021-11-18T09:08:23.000Z | layers.py | Gladys-Zhao/mRNN-mLSTM | 23499f237ea8b0f68c96f756fbf0f4028836e64c | [
"BSD-3-Clause"
] | null | null | null | layers.py | Gladys-Zhao/mRNN-mLSTM | 23499f237ea8b0f68c96f756fbf0f4028836e64c | [
"BSD-3-Clause"
] | 3 | 2020-07-17T09:00:44.000Z | 2021-11-18T09:08:24.000Z | #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... | 42.808696 | 228 | 0.591205 | #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... | 8,582 | 346 | 384 |
aa9bc77eb78bd2c1fefa580f9e9e571616cbb9c0 | 9,384 | py | Python | train_procgen/policies.py | yanlai00/train-procgen | 9785eb8945f55e1c30ed50fe33345405688ed6d8 | [
"MIT"
] | null | null | null | train_procgen/policies.py | yanlai00/train-procgen | 9785eb8945f55e1c30ed50fe33345405688ed6d8 | [
"MIT"
] | null | null | null | train_procgen/policies.py | yanlai00/train-procgen | 9785eb8945f55e1c30ed50fe33345405688ed6d8 | [
"MIT"
] | null | null | null | 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... | 36.092308 | 154 | 0.62159 | 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... | 6,394 | 12 | 364 |
a4e036509faa2256a7a9e09c740aa8cc9007b65a | 1,704 | py | Python | examples/irp_wind/Hornsrev_aep.py | DTUWindEnergy/TopFarm2 | cba70b20431f7a828370447117fe2e7533edf7c2 | [
"MIT"
] | 4 | 2019-02-18T08:46:00.000Z | 2021-01-28T06:35:52.000Z | examples/irp_wind/Hornsrev_aep.py | DTUWindEnergy/TopFarm2 | cba70b20431f7a828370447117fe2e7533edf7c2 | [
"MIT"
] | 1 | 2019-11-26T12:12:12.000Z | 2019-11-26T12:12:12.000Z | examples/irp_wind/Hornsrev_aep.py | DTUWindEnergy/TopFarm2 | cba70b20431f7a828370447117fe2e7533edf7c2 | [
"MIT"
] | 8 | 2019-01-14T09:33:26.000Z | 2021-06-30T11:56:03.000Z | 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... | 42.6 | 116 | 0.72946 | 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... | 1,059 | 0 | 46 |
7cc174b27a3a5124410ce82ecece72d829e47756 | 9,973 | py | Python | ELCplotter_tester.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 2 | 2018-10-08T04:59:38.000Z | 2021-01-19T08:10:04.000Z | ELCplotter_tester.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 1 | 2021-07-20T16:42:43.000Z | 2021-07-20T16:42:43.000Z | ELCplotter_tester.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 1 | 2018-07-31T14:36:24.000Z | 2018-07-31T14:36:24.000Z | 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... | 38.655039 | 115 | 0.702497 | 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... | 318 | 0 | 22 |
ea3901051a292a10d6c15b1c314255b8605ae047 | 655 | py | Python | Python_Code/experimentFive/experimentFive_test2.py | xiaoandx/learningCode | 2c41bc7199ef21a70d1935f32296d520e18f719f | [
"MIT"
] | 13 | 2020-10-25T15:38:15.000Z | 2022-02-21T02:21:24.000Z | Python_Code/experimentFive/experimentFive_test2.py | xiaoandx/learningCode | 2c41bc7199ef21a70d1935f32296d520e18f719f | [
"MIT"
] | 4 | 2020-10-26T08:37:27.000Z | 2020-12-14T08:49:51.000Z | Python_Code/experimentFive/experimentFive_test2.py | xiaoandx/learningCode | 2c41bc7199ef21a70d1935f32296d520e18f719f | [
"MIT"
] | 10 | 2020-10-25T15:38:30.000Z | 2021-09-15T03:54:39.000Z | """
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... | 29.772727 | 95 | 0.674809 | """
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... | 0 | 0 | 0 |
a8cff26b77d278126f40e2754f5933fcf1c52d1e | 4,142 | py | Python | nlpaug/augmenter/char/char_augmenter.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | 1 | 2021-06-09T20:07:30.000Z | 2021-06-09T20:07:30.000Z | nlpaug/augmenter/char/char_augmenter.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | null | null | null | nlpaug/augmenter/char/char_augmenter.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | null | null | null | 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
| 30.455882 | 82 | 0.569049 | 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
class CharAugmenter(Augmenter):
def __init__(
self,
action,
name="Char_Au... | 3,652 | 249 | 23 |
71e3e1197df9eb06e7e634ae3138a713531bf1f2 | 595 | py | Python | src/pyproject_api/__init__.py | graingert/pyproject-api | 8304504643efc88061966c685eca4cd8958671c5 | [
"MIT"
] | null | null | null | src/pyproject_api/__init__.py | graingert/pyproject-api | 8304504643efc88061966c685eca4cd8958671c5 | [
"MIT"
] | null | null | null | src/pyproject_api/__init__.py | graingert/pyproject-api | 8304504643efc88061966c685eca4cd8958671c5 | [
"MIT"
] | null | null | null | 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... | 20.517241 | 53 | 0.719328 | 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... | 0 | 0 | 0 |
9f6ae539927188c3ccbaedb48cb3e751417e791e | 1,483 | py | Python | drafts/exercises/mnist.py | ItamarRocha/AI | 134e4e39f7034657472d7996ce70f37ff7a6e74b | [
"MIT"
] | 2 | 2020-06-23T16:28:26.000Z | 2020-07-11T11:39:18.000Z | drafts/exercises/mnist.py | ItamarRocha/AI | 134e4e39f7034657472d7996ce70f37ff7a6e74b | [
"MIT"
] | 12 | 2021-09-08T02:38:57.000Z | 2022-03-12T01:00:12.000Z | drafts/exercises/mnist.py | ItamarRocha/AI | 134e4e39f7034657472d7996ce70f37ff7a6e74b | [
"MIT"
] | 1 | 2021-05-07T15:22:50.000Z | 2021-05-07T15:22:50.000Z | #!/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... | 23.539683 | 76 | 0.710722 | #!/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... | 0 | 0 | 0 |
4b51e1a3362a0e32ccb7ef438623c2ac446267bf | 155 | py | Python | api/models/task.py | stanfordv/curriculum1 | 57a7b4cbe1b2191fa1ba62c99128024007f4418e | [
"MIT"
] | null | null | null | api/models/task.py | stanfordv/curriculum1 | 57a7b4cbe1b2191fa1ba62c99128024007f4418e | [
"MIT"
] | null | null | null | api/models/task.py | stanfordv/curriculum1 | 57a7b4cbe1b2191fa1ba62c99128024007f4418e | [
"MIT"
] | null | null | null | from api import db
| 19.375 | 38 | 0.645161 | from api import db
class Task(db.Document):
description = db.StringField()
order = db.IntField()
done = db.BoolField(default=False)
| 0 | 108 | 23 |
3f54db164b94291e4109a8565d89cdaaf68dbfba | 2,264 | py | Python | taxishare/anneal/preparations.py | SatoPj-mitou2018/demo-taxishare | f8701cac5d160d0cd94dae9a9a56cb84a3cdb9f0 | [
"MIT"
] | null | null | null | taxishare/anneal/preparations.py | SatoPj-mitou2018/demo-taxishare | f8701cac5d160d0cd94dae9a9a56cb84a3cdb9f0 | [
"MIT"
] | null | null | null | taxishare/anneal/preparations.py | SatoPj-mitou2018/demo-taxishare | f8701cac5d160d0cd94dae9a9a56cb84a3cdb9f0 | [
"MIT"
] | null | null | null | 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... | 22.415842 | 84 | 0.587014 | 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... | 0 | 0 | 0 |
911b134dc6a86be73b332315c97a1543c0b6cc2d | 740 | py | Python | spotify_uri/__init__.py | zeroday0619/pyspotify-uri | d2b4cba6c02051901eda13742b9385315341dbb2 | [
"MIT"
] | 7 | 2021-01-10T13:28:55.000Z | 2021-09-17T13:01:07.000Z | spotify_uri/__init__.py | zeroday0619/pyspotify-uri | d2b4cba6c02051901eda13742b9385315341dbb2 | [
"MIT"
] | null | null | null | spotify_uri/__init__.py | zeroday0619/pyspotify-uri | d2b4cba6c02051901eda13742b9385315341dbb2 | [
"MIT"
] | null | null | null | __version__ = "1.0.3"
from spotify_uri.parse import parse as _parse
from spotify_uri.spotify import SpotifyUri
| 25.517241 | 77 | 0.7 | __version__ = "1.0.3"
from spotify_uri.parse import parse as _parse
from spotify_uri.spotify import SpotifyUri
def parse(uri: str):
return _parse(uri)
def formatURI(_input: str) -> str:
_uri: SpotifyUri = parse(_input) if bool(type(_input) == str) else _input
return _uri.toURI()
def formatEmbedURL(_i... | 508 | 0 | 115 |
fc815432329bd50b5b3563f1a31416a62326e975 | 3,531 | py | Python | cloudwine/inference.py | elmidelange/CloudWine | 04f61c39c0256252569ed2cfdde196dc981a0b00 | [
"MIT"
] | 2 | 2020-06-13T00:56:13.000Z | 2020-08-09T23:20:24.000Z | cloudwine/inference.py | elmidelange/CloudWine | 04f61c39c0256252569ed2cfdde196dc981a0b00 | [
"MIT"
] | 1 | 2020-06-08T19:19:49.000Z | 2020-06-08T19:19:49.000Z | cloudwine/inference.py | elmidelange/CloudWine | 04f61c39c0256252569ed2cfdde196dc981a0b00 | [
"MIT"
] | 3 | 2020-06-05T09:25:28.000Z | 2020-06-20T13:55:20.000Z | 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')... | 33 | 106 | 0.730105 | 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')... | 2,903 | 0 | 89 |
5da6029a6ba369a85c387ca30d12077ef7203cee | 4,910 | py | Python | frontera/utils/tester.py | TeamHG-Memex/frontera | 06ab4002428528a2d8b67c1e82368cc5988b2228 | [
"BSD-3-Clause"
] | 3 | 2015-11-11T19:37:16.000Z | 2017-03-15T13:33:54.000Z | frontera/utils/tester.py | TeamHG-Memex/frontera | 06ab4002428528a2d8b67c1e82368cc5988b2228 | [
"BSD-3-Clause"
] | null | null | null | frontera/utils/tester.py | TeamHG-Memex/frontera | 06ab4002428528a2d8b67c1e82368cc5988b2228 | [
"BSD-3-Clause"
] | 2 | 2016-09-08T08:30:24.000Z | 2018-10-02T22:00:47.000Z | from __future__ import absolute_import
from collections import OrderedDict, deque
from urlparse import urlparse
| 35.839416 | 111 | 0.58391 | from __future__ import absolute_import
from collections import OrderedDict, deque
from urlparse import urlparse
class FrontierTester(object):
def __init__(self, frontier, graph_manager, downloader_simulator, max_next_requests=0):
self.frontier = frontier
self.graph_manager = graph_manager
... | 4,214 | 55 | 526 |
f295231c2c5bcf4995f2f897318fddbc3bbf1400 | 1,209 | py | Python | get_tweets.py | gacarvalho/analyze-tweets-disney-plus | fd17c43c15bcaa1cc16501dfa7b3b620d12f3df5 | [
"MIT"
] | 3 | 2021-03-15T02:31:20.000Z | 2021-03-16T19:29:02.000Z | get_tweets.py | gacarvalho/analyze-tweets-disney-plus | fd17c43c15bcaa1cc16501dfa7b3b620d12f3df5 | [
"MIT"
] | null | null | null | get_tweets.py | gacarvalho/analyze-tweets-disney-plus | fd17c43c15bcaa1cc16501dfa7b3b620d12f3df5 | [
"MIT"
] | null | null | null | 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... | 30.225 | 93 | 0.751034 | 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... | 126 | 12 | 80 |
7f0687c914a7105497485044516ecd34881ec454 | 432 | py | Python | setup.py | jo-nas/pygitea | 0937d26dbd33523c728e2eefa80f327d952864a5 | [
"WTFPL"
] | null | null | null | setup.py | jo-nas/pygitea | 0937d26dbd33523c728e2eefa80f327d952864a5 | [
"WTFPL"
] | null | null | null | setup.py | jo-nas/pygitea | 0937d26dbd33523c728e2eefa80f327d952864a5 | [
"WTFPL"
] | 2 | 2019-01-04T18:43:34.000Z | 2021-10-18T17:43:25.000Z | #!/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'
],
... | 20.571429 | 47 | 0.618056 | #!/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'
],
... | 0 | 0 | 0 |
25584d02d5183657403585eb275a864235199159 | 4,300 | py | Python | pybitup/pce/expan.py | jcoheur/pybitup | 6b31cbea7ae871a09aad154829eb85e599ce9214 | [
"MIT"
] | 2 | 2022-02-16T13:40:37.000Z | 2022-02-16T13:41:12.000Z | pybitup/pce/expan.py | jcoheur/pybitup | 6b31cbea7ae871a09aad154829eb85e599ce9214 | [
"MIT"
] | 2 | 2021-03-11T10:36:47.000Z | 2021-03-15T16:47:44.000Z | pybitup/pce/expan.py | jcoheur/pybitup | 6b31cbea7ae871a09aad154829eb85e599ce9214 | [
"MIT"
] | null | null | null | 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):
... | 27.564103 | 77 | 0.593721 | 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"""
def __init__(self,coef,poly):
coef = np.array(coef)
self.var = np.sum(coef[1:]**2,a... | 594 | 0 | 54 |
b2a2a7758bad19e47fa940cb62f9dd9224347ef8 | 920 | py | Python | steps/common.py | dmchu/Ellie | 28a96fa21b99eac467e4cbc9b5f94ea76726f435 | [
"Apache-2.0"
] | null | null | null | steps/common.py | dmchu/Ellie | 28a96fa21b99eac467e4cbc9b5f94ea76726f435 | [
"Apache-2.0"
] | null | null | null | steps/common.py | dmchu/Ellie | 28a96fa21b99eac467e4cbc9b5f94ea76726f435 | [
"Apache-2.0"
] | null | null | null | 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
| 36.8 | 110 | 0.791304 | 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
def login(driver, username = 'admin', password = DEFAULT_PASSWORD):
driv... | 583 | 0 | 92 |
0f65bd7945e09d510901fa4ee3f32dc50a902dbb | 2,423 | py | Python | MUDI_V1.00/scRNAseq.py | yufanzhouonline/MUDI | f07a2b062bd8788574caace0d0d9137259dcf8e9 | [
"MIT"
] | null | null | null | MUDI_V1.00/scRNAseq.py | yufanzhouonline/MUDI | f07a2b062bd8788574caace0d0d9137259dcf8e9 | [
"MIT"
] | null | null | null | MUDI_V1.00/scRNAseq.py | yufanzhouonline/MUDI | f07a2b062bd8788574caace0d0d9137259dcf8e9 | [
"MIT"
] | null | null | null | from RNAseq import *
| 45.716981 | 123 | 0.616591 | from RNAseq import *
class scRNAseq(RNAseq):
def __init__(self):
self.loadClusterDEG()
self.loadVarGene()
self.loadTotalDEG()
self.loadClusterN()
self.loadcellType()
self.loadcellRatio()
def loadClusterDEG(self, degPath = '/data/scRNAseq/clusterDEG.txt')... | 1,446 | 932 | 23 |
fed2b0bb7db552e26ad977eb89f8483ac69e83cb | 2,713 | py | Python | unb_cli/unb/version.py | jacktrades/unb-cli | 51cb451fc66352ca85ded03bfbc3bf01913f33ca | [
"MIT"
] | null | null | null | unb_cli/unb/version.py | jacktrades/unb-cli | 51cb451fc66352ca85ded03bfbc3bf01913f33ca | [
"MIT"
] | null | null | null | unb_cli/unb/version.py | jacktrades/unb-cli | 51cb451fc66352ca85ded03bfbc3bf01913f33ca | [
"MIT"
] | null | null | null | 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."""
... | 24.889908 | 80 | 0.62477 | 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."""
... | 0 | 0 | 0 |
372f3fbe66b9552da037522d5d2ed2b846b21b5d | 1,334 | py | Python | crawlers/crawlers/spiders/zgka8.py | jackliusr/scrapy-crawlers | f3af825bf240c4b53aa9fa61903d89f09386c6a2 | [
"Apache-2.0"
] | 3 | 2015-02-18T21:03:27.000Z | 2019-06-27T13:23:25.000Z | crawlers/crawlers/spiders/zgka8.py | jackliusr/scrapy-crawlers | f3af825bf240c4b53aa9fa61903d89f09386c6a2 | [
"Apache-2.0"
] | 3 | 2021-03-24T11:34:33.000Z | 2021-03-24T11:34:33.000Z | crawlers/crawlers/spiders/zgka8.py | jackliusr/scrapy-crawlers | f3af825bf240c4b53aa9fa61903d89f09386c6a2 | [
"Apache-2.0"
] | null | null | null | 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
| 39.235294 | 114 | 0.633433 | 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
class Zgka8Spider(CrawlSpider):
name = 'zgka8'
allowed_domain... | 647 | 414 | 23 |
6ee61b6e296d95c10f882a5b0e42f5f62e85b58e | 2,403 | py | Python | main/solutions/uncrossed_lines.py | techrabbit58/LeetCode30DaysMay2020Challenge | 3798c5ce104e806372922a73b5ba66b29fc51dbd | [
"Unlicense"
] | 1 | 2020-06-10T10:28:44.000Z | 2020-06-10T10:28:44.000Z | main/solutions/uncrossed_lines.py | techrabbit58/LeetCode30DaysMay2020Challenge | 3798c5ce104e806372922a73b5ba66b29fc51dbd | [
"Unlicense"
] | null | null | null | main/solutions/uncrossed_lines.py | techrabbit58/LeetCode30DaysMay2020Challenge | 3798c5ce104e806372922a73b5ba66b29fc51dbd | [
"Unlicense"
] | null | null | null | """
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... | 27 | 102 | 0.587599 | """
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... | 397 | -6 | 49 |
54978b7601bcb8c99b5e7286e3bb9ff5fe9e4e0d | 5,500 | py | Python | dpqueue.py | TouchTone/pyjsit | 52eb3eafdbab82c8ef6ba340eeaa5a7e6446a36f | [
"MIT",
"BSD-3-Clause"
] | 1 | 2015-05-22T21:26:51.000Z | 2015-05-22T21:26:51.000Z | dpqueue.py | TouchTone/pyjsit | 52eb3eafdbab82c8ef6ba340eeaa5a7e6446a36f | [
"MIT",
"BSD-3-Clause"
] | 6 | 2015-01-02T22:29:38.000Z | 2015-06-17T17:26:57.000Z | dpqueue.py | TouchTone/pyjsit | 52eb3eafdbab82c8ef6ba340eeaa5a7e6446a36f | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/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... | 25.345622 | 65 | 0.467455 | #!/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... | 3,782 | 0 | 407 |
e690e30135a7c23fd19d28745ce8909768fa577a | 1,005 | py | Python | lottery_nums.py | ChangLuis/LearningSpider | 84c2a53e6d6a77c0f0281e1a06cd2d0602059786 | [
"MIT"
] | null | null | null | lottery_nums.py | ChangLuis/LearningSpider | 84c2a53e6d6a77c0f0281e1a06cd2d0602059786 | [
"MIT"
] | null | null | null | lottery_nums.py | ChangLuis/LearningSpider | 84c2a53e6d6a77c0f0281e1a06cd2d0602059786 | [
"MIT"
] | null | null | null | 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... | 33.5 | 101 | 0.614925 | 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... | 0 | 0 | 0 |