hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7251f33ee91ecf48c4a7be3c6944bab432a6275 | 1,011 | py | Python | main_app/urls.py | m-code12/Rescue | 24ece6ac97aeb177435ec7cc3d822d17e75724c8 | [
"MIT"
] | null | null | null | main_app/urls.py | m-code12/Rescue | 24ece6ac97aeb177435ec7cc3d822d17e75724c8 | [
"MIT"
] | 1 | 2021-02-19T17:09:40.000Z | 2021-02-19T17:09:40.000Z | main_app/urls.py | m-code12/Rescue | 24ece6ac97aeb177435ec7cc3d822d17e75724c8 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = "main_app"
urlpatterns = [
path('', views.home, name="home"),
path('home/', views.home, name="home"),
path('register/', views.register, name="register"),
path('logout/', views.logout_request, name="logout"),
path('login/', views.login_req... | 48.142857 | 82 | 0.691395 | from django.urls import path
from . import views
app_name = "main_app"
urlpatterns = [
path('', views.home, name="home"),
path('home/', views.home, name="home"),
path('register/', views.register, name="register"),
path('logout/', views.logout_request, name="logout"),
path('login/', views.login_req... | true | true |
f7251f49ee1a7989325fce02781fdfdd20216e2b | 40,049 | py | Python | chain/core/resources.py | ielm/chain-api | 8fba4b8ebdedbe1de65fe2bde0e0a6f330177c91 | [
"MIT"
] | 23 | 2015-08-14T02:23:51.000Z | 2021-04-16T14:59:59.000Z | chain/core/resources.py | ResEnv/chain-api | 8fba4b8ebdedbe1de65fe2bde0e0a6f330177c91 | [
"MIT"
] | 27 | 2015-05-26T22:29:57.000Z | 2020-06-05T16:40:51.000Z | chain/core/resources.py | ielm/chain-api | 8fba4b8ebdedbe1de65fe2bde0e0a6f330177c91 | [
"MIT"
] | 10 | 2015-07-05T07:15:46.000Z | 2020-06-30T18:28:08.000Z | from chain.core.api import Resource, ResourceField, CollectionField, \
MetadataCollectionField
from chain.core.api import full_reverse, render_error
from chain.core.api import CHAIN_CURIES
from chain.core.api import BadRequestException, HTTP_STATUS_BAD_REQUEST
from chain.core.api import register_resource
from chain... | 35.254401 | 107 | 0.571375 | from chain.core.api import Resource, ResourceField, CollectionField, \
MetadataCollectionField
from chain.core.api import full_reverse, render_error
from chain.core.api import CHAIN_CURIES
from chain.core.api import BadRequestException, HTTP_STATUS_BAD_REQUEST
from chain.core.api import register_resource
from chain... | true | true |
f7251f653992e182b50932f276e0b927de32b712 | 8,687 | py | Python | tests/losses/test_fastap_loss.py | cwkeam/pytorch-metric-learning | 63e4ecb781c5735ad714f61a3eecc55f72496905 | [
"MIT"
] | 4,357 | 2020-01-15T23:42:35.000Z | 2022-03-31T08:11:48.000Z | tests/losses/test_fastap_loss.py | cwkeam/pytorch-metric-learning | 63e4ecb781c5735ad714f61a3eecc55f72496905 | [
"MIT"
] | 386 | 2020-01-16T02:06:37.000Z | 2022-03-30T07:59:47.000Z | tests/losses/test_fastap_loss.py | cwkeam/pytorch-metric-learning | 63e4ecb781c5735ad714f61a3eecc55f72496905 | [
"MIT"
] | 568 | 2020-01-16T01:08:23.000Z | 2022-03-30T09:18:48.000Z | ######################################
#######ORIGINAL IMPLEMENTATION########
######################################
# FROM https://github.com/kunhe/FastAP-metric-learning/blob/master/pytorch/FastAP_loss.py
# This code is copied directly from the official implementation
# so that we can make sure our implementation ret... | 36.045643 | 89 | 0.590998 | torch.mm(input, input.t())
# 3. estimate discrete histograms
Delta = torch.tensor(4.0 / num_bins).to(input.device)
Z = torch.linspace(0.0, 4.0, steps=num_bins + 1).to(input.device)
L = Z.size()[0]
h_pos = torch.zeros((N, L), dtype=input.dtype).to(input.device)
h_neg = to... | true | true |
f72520d5e3e11a9dcb64026d7e62f1b47d0d54fa | 1,554 | py | Python | setup.py | pgjones/flake8-flask | e7099ed941086c92b6f752d4cf2e95c027f7605d | [
"MIT"
] | null | null | null | setup.py | pgjones/flake8-flask | e7099ed941086c92b6f752d4cf2e95c027f7605d | [
"MIT"
] | null | null | null | setup.py | pgjones/flake8-flask | e7099ed941086c92b6f752d4cf2e95c027f7605d | [
"MIT"
] | null | null | null | import os
from setuptools import setup
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(PROJECT_ROOT, 'flake8_flask.py')) as file_:
version_line = [line for line in file_ if line.startswith('__version__')][0]
__version__ = version_line.split('=')[1].strip().strip("'").strip('"')
... | 29.320755 | 87 | 0.622909 | import os
from setuptools import setup
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(PROJECT_ROOT, 'flake8_flask.py')) as file_:
version_line = [line for line in file_ if line.startswith('__version__')][0]
__version__ = version_line.split('=')[1].strip().strip("'").strip('"')
... | true | true |
f72520ddf2e5e6b82e03983937f6030c0042fce3 | 4,902 | py | Python | testplan/exporters/testing/pdf/renderers/entries/base.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/exporters/testing/pdf/renderers/entries/base.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/exporters/testing/pdf/renderers/entries/base.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:13:18.000Z | 2019-09-11T09:13:18.000Z | from reportlab.lib import colors
from reportlab.lib.units import inch
from reportlab.platypus import Image
from testplan.common.exporters.pdf import RowStyle, create_table
from testplan.common.exporters.pdf import format_table_style
from testplan.common.utils.registry import Registry
from testplan.testing.multitest.en... | 36.311111 | 80 | 0.621991 | from reportlab.lib import colors
from reportlab.lib.units import inch
from reportlab.platypus import Image
from testplan.common.exporters.pdf import RowStyle, create_table
from testplan.common.exporters.pdf import format_table_style
from testplan.common.utils.registry import Registry
from testplan.testing.multitest.en... | true | true |
f72521063380e9fb0c546147201e0347312a3209 | 560 | py | Python | python/0011_finding_the_percentage.py | basoares/hackerrank | 3d294ba6da38efff0da496b16085ca557ce35985 | [
"MIT"
] | null | null | null | python/0011_finding_the_percentage.py | basoares/hackerrank | 3d294ba6da38efff0da496b16085ca557ce35985 | [
"MIT"
] | null | null | null | python/0011_finding_the_percentage.py | basoares/hackerrank | 3d294ba6da38efff0da496b16085ca557ce35985 | [
"MIT"
] | null | null | null | '''
The provided code stub will read in a dictionary containing key/value pairs of
name:[marks] for a list of students. Print the average of the marks array for
the student name provided, showing 2 places after the decimal.
'''
if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in rang... | 29.473684 | 78 | 0.648214 | if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
marks = student_marks[query_name]
print(f'{(sum(marks)/float(len(marks)))... | true | true |
f72522049a195e8802f79fdd1006b47629498830 | 287 | py | Python | readH5.py | ChutianShen/pointnet_kitti | 6ebd2c7c203c4fcc8172f306c85e55ea06429ba5 | [
"MIT"
] | null | null | null | readH5.py | ChutianShen/pointnet_kitti | 6ebd2c7c203c4fcc8172f306c85e55ea06429ba5 | [
"MIT"
] | null | null | null | readH5.py | ChutianShen/pointnet_kitti | 6ebd2c7c203c4fcc8172f306c85e55ea06429ba5 | [
"MIT"
] | null | null | null | import h5py
filename = './sem_seg/indoor3d_sem_seg_hdf5_data/ply_data_all_0.h5'
#filename = './sem_seg/converted_KITTI/frame_10.h5'
f = h5py.File(filename, 'r')
data_file = f['data'][:]
label_file = f['label'][:]
print (data_file.shape, label_file.shape)
print (type(label_file[0])) | 22.076923 | 67 | 0.728223 | import h5py
filename = './sem_seg/indoor3d_sem_seg_hdf5_data/ply_data_all_0.h5'
f = h5py.File(filename, 'r')
data_file = f['data'][:]
label_file = f['label'][:]
print (data_file.shape, label_file.shape)
print (type(label_file[0])) | true | true |
f725220f95e7ed6a18489ee1563dd48ce5f224d6 | 2,985 | py | Python | solutions/day18.py | nitekat1124/advent-of-code-2021 | 74501b84f0a08b33f48b4e5a2d66b8293c854150 | [
"WTFPL"
] | 3 | 2021-12-22T17:44:39.000Z | 2022-01-14T17:18:15.000Z | solutions/day18.py | nitekat1124/advent-of-code-2021 | 74501b84f0a08b33f48b4e5a2d66b8293c854150 | [
"WTFPL"
] | null | null | null | solutions/day18.py | nitekat1124/advent-of-code-2021 | 74501b84f0a08b33f48b4e5a2d66b8293c854150 | [
"WTFPL"
] | null | null | null | import re
from itertools import combinations
from utils.solution_base import SolutionBase
class Solution(SolutionBase):
def solve(self, part_num: int):
self.test_runner(part_num)
func = getattr(self, f"part{part_num}")
result = func(self.data)
return result
def test_runner(s... | 34.310345 | 114 | 0.524958 | import re
from itertools import combinations
from utils.solution_base import SolutionBase
class Solution(SolutionBase):
def solve(self, part_num: int):
self.test_runner(part_num)
func = getattr(self, f"part{part_num}")
result = func(self.data)
return result
def test_runner(s... | true | true |
f725222b5c43f17680f783bce12dae0b4c033b90 | 1,813 | py | Python | sdk/purview/azure-purview-administration/tests/testcase.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/purview/azure-purview-administration/tests/testcase.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/purview/azure-purview-administration/tests/testcase.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 35.54902 | 87 | 0.689465 |
import functools
from devtools_testutils import AzureTestCase, PowerShellPreparer
from azure.purview.administration.account import PurviewAccountClient
from azure.purview.administration.metadatapolicies import PurviewMetadataPoliciesClient
class PurviewAccountTest(AzureTestCase):
def __init__(self, method_n... | true | true |
f72523871d8c380b139a74c4120ab78813f97178 | 206 | py | Python | scripts/portal/NextStg.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 9 | 2021-04-26T11:59:29.000Z | 2021-12-20T13:15:27.000Z | scripts/portal/NextStg.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/portal/NextStg.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 6 | 2021-07-14T06:32:05.000Z | 2022-02-06T02:32:56.000Z | fieldID = sm.getFieldID()
if fieldID == 811000500:
sm.warpInstanceOut(811000008)
elif not sm.hasMobsInField():
sm.warp(fieldID + 100)
else:
sm.chat("The portal is not opened yet.")
sm.dispose()
| 22.888889 | 44 | 0.699029 | fieldID = sm.getFieldID()
if fieldID == 811000500:
sm.warpInstanceOut(811000008)
elif not sm.hasMobsInField():
sm.warp(fieldID + 100)
else:
sm.chat("The portal is not opened yet.")
sm.dispose()
| true | true |
f725258ae5d9a6973d2e1d634a663f91c4a30abf | 2,281 | py | Python | userbot/plugins/antiflood.py | Solivagantt/userbot | 9c2bb02ad24998e2739209381fcb66dc27daff32 | [
"MIT"
] | null | null | null | userbot/plugins/antiflood.py | Solivagantt/userbot | 9c2bb02ad24998e2739209381fcb66dc27daff32 | [
"MIT"
] | null | null | null | userbot/plugins/antiflood.py | Solivagantt/userbot | 9c2bb02ad24998e2739209381fcb66dc27daff32 | [
"MIT"
] | 2 | 2020-04-19T13:24:12.000Z | 2021-02-14T14:01:31.000Z | import asyncio
from telethon import events
from telethon.tl.functions.channels import EditBannedRequest
from telethon.tl.types import ChatBannedRights
from userbot.utils import admin_cmd
import userbot.plugins.sql_helper.antiflood_sql as sql
import userbot.utils
from userbot.utils import humanbytes, progress, time_form... | 31.680556 | 89 | 0.676019 | import asyncio
from telethon import events
from telethon.tl.functions.channels import EditBannedRequest
from telethon.tl.types import ChatBannedRights
from userbot.utils import admin_cmd
import userbot.plugins.sql_helper.antiflood_sql as sql
import userbot.utils
from userbot.utils import humanbytes, progress, time_form... | true | true |
f725258bf01873662ce2f235301796c73aa1e811 | 72,727 | py | Python | sql/engines/tests.py | bosen365/Archery | 424479fcb77646de0c5ef2d68a6fae9d3a685f00 | [
"Apache-2.0"
] | 1 | 2019-06-03T09:39:40.000Z | 2019-06-03T09:39:40.000Z | sql/engines/tests.py | bosen365/Archery | 424479fcb77646de0c5ef2d68a6fae9d3a685f00 | [
"Apache-2.0"
] | 4 | 2021-06-05T00:00:45.000Z | 2022-02-10T12:17:14.000Z | sql/engines/tests.py | bosen365/Archery | 424479fcb77646de0c5ef2d68a6fae9d3a685f00 | [
"Apache-2.0"
] | 1 | 2021-12-01T05:36:59.000Z | 2021-12-01T05:36:59.000Z | import MySQLdb
import json
from datetime import timedelta, datetime
from unittest.mock import patch, Mock, ANY
import sqlparse
from django.contrib.auth import get_user_model
from django.test import TestCase
from common.config import SysConfig
from sql.engines import EngineBase
from sql.engines.goinception import GoIn... | 45.425984 | 196 | 0.636545 | import MySQLdb
import json
from datetime import timedelta, datetime
from unittest.mock import patch, Mock, ANY
import sqlparse
from django.contrib.auth import get_user_model
from django.test import TestCase
from common.config import SysConfig
from sql.engines import EngineBase
from sql.engines.goinception import GoIn... | true | true |
f72526b6ad715d5466f1db2a8ab71d035fe309e3 | 567 | py | Python | Python/Xiaoxiang_Python/lec04/BMR_1.0.py | kevindeng123/Programming | a06e9f7773fc083bcb153af21e6e9942a4114b4a | [
"MIT"
] | null | null | null | Python/Xiaoxiang_Python/lec04/BMR_1.0.py | kevindeng123/Programming | a06e9f7773fc083bcb153af21e6e9942a4114b4a | [
"MIT"
] | null | null | null | Python/Xiaoxiang_Python/lec04/BMR_1.0.py | kevindeng123/Programming | a06e9f7773fc083bcb153af21e6e9942a4114b4a | [
"MIT"
] | null | null | null | """
作者:邓经纬
功能:BMR 计算器
版本:1.0
日期:26/10/2018
"""
def main():
"""
主函数
"""
# 性别
gender = '男'
# 体重
weight = 70
# 身高(cm)
height = 175
# 年龄
age = 25
if gender == '男':
# 男性
bmr = (13.7 * weight) + (5.0 * height) - (6.8 * age) + 66
elif... | 14.538462 | 65 | 0.391534 |
def main():
gender = '男'
weight = 70
height = 175
age = 25
if gender == '男':
bmr = (13.7 * weight) + (5.0 * height) - (6.8 * age) + 66
elif gender == '女':
bmr = (9.6 * weight) + (1.8 * height) - (4.7 * age) +655
else:
bmr = -... | true | true |
f725288fe158ce24e1007dc29528d22db5be4be5 | 1,248 | py | Python | tests/config/test_bucket_data_path_config.py | ranbb/justmltools | 06fa74d04eb915afbe32617eb24bcb70396289d7 | [
"MIT"
] | null | null | null | tests/config/test_bucket_data_path_config.py | ranbb/justmltools | 06fa74d04eb915afbe32617eb24bcb70396289d7 | [
"MIT"
] | 3 | 2021-09-17T06:42:03.000Z | 2021-09-17T06:42:04.000Z | tests/config/test_bucket_data_path_config.py | ranbb/justmltools | 06fa74d04eb915afbe32617eb24bcb70396289d7 | [
"MIT"
] | 1 | 2020-06-24T15:17:59.000Z | 2020-06-24T15:17:59.000Z | from unittest import TestCase
from justmltools.config.bucket_data_path_config import BucketDataPathConfig
PREFIX = "my_bucket_key_prefix"
class TestBucketDataPathConfig(TestCase):
def setUp(self) -> None:
self.sut: BucketDataPathConfig = BucketDataPathConfig(prefix=PREFIX)
def test_get_prefix(self... | 35.657143 | 95 | 0.729167 | from unittest import TestCase
from justmltools.config.bucket_data_path_config import BucketDataPathConfig
PREFIX = "my_bucket_key_prefix"
class TestBucketDataPathConfig(TestCase):
def setUp(self) -> None:
self.sut: BucketDataPathConfig = BucketDataPathConfig(prefix=PREFIX)
def test_get_prefix(self... | true | true |
f72528dd8a067e6d5e70862cf8082bf8332d66e0 | 572 | py | Python | revelation/app/hook/hooks/movieform.py | uyamazak/oceanus | 6158cdc313a381f8228562605d33713ad4e776f1 | [
"MIT"
] | 8 | 2017-02-10T07:24:43.000Z | 2019-06-03T07:45:29.000Z | revelation/app/hook/hooks/movieform.py | uyamazak/oceanus | 6158cdc313a381f8228562605d33713ad4e776f1 | [
"MIT"
] | 3 | 2017-02-20T10:24:20.000Z | 2017-08-15T04:54:36.000Z | revelation/app/hook/hooks/movieform.py | uyamazak/oceanus | 6158cdc313a381f8228562605d33713ad4e776f1 | [
"MIT"
] | null | null | null | from hook.base import BaseHook
from task.gspread.tasks import send2ws
class MovieformHook(BaseHook):
def main(self) -> int:
channel = self.item.get("channel")
if channel != "movieform":
return 0
data = self.item.get("data")
dt = self.item.get("dt")
count = 1
... | 22 | 44 | 0.48951 | from hook.base import BaseHook
from task.gspread.tasks import send2ws
class MovieformHook(BaseHook):
def main(self) -> int:
channel = self.item.get("channel")
if channel != "movieform":
return 0
data = self.item.get("data")
dt = self.item.get("dt")
count = 1
... | true | true |
f72528ea404b5476c1151c85d0a3295f31a0e405 | 6,337 | py | Python | main.py | kb1p/json-inspector | 388596bf2d2eb014ab070e9fbc8a5e5d90eb00df | [
"MIT"
] | null | null | null | main.py | kb1p/json-inspector | 388596bf2d2eb014ab070e9fbc8a5e5d90eb00df | [
"MIT"
] | null | null | null | main.py | kb1p/json-inspector | 388596bf2d2eb014ab070e9fbc8a5e5d90eb00df | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 28 19:58:07 2020
@author: kb1p
"""
import sys
import PyQt5.QtCore as Core
import PyQt5.QtWidgets as Gui
import PyQt5.QtGui as GuiMisc
import data_models
import dialogs
import json
class MainWindow(Gui.QMainWindow):
__slots__ = "tvStructure", "tblProps", "mdlStructur... | 40.107595 | 114 | 0.603125 |
import sys
import PyQt5.QtCore as Core
import PyQt5.QtWidgets as Gui
import PyQt5.QtGui as GuiMisc
import data_models
import dialogs
import json
class MainWindow(Gui.QMainWindow):
__slots__ = "tvStructure", "tblProps", "mdlStructure", "mdlProps", "currentFile", "config", \
"splitter", "editorDlg"... | true | true |
f7252950efe183c9396feb149b40fe1dc37cdd64 | 10,665 | py | Python | Thesis@3.9.1/Lib/site-packages/django/db/models/fields/reverse_related.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/django/db/models/fields/reverse_related.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/django/db/models/fields/reverse_related.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """
"Rel objects" for related fields.
"Rel objects" (for lack of a better name) carry information about the relation
modeled by a related field and provide some utility functions. They're stored
in the ``remote_field`` attribute of the field.
They also act as reverse fields for the purposes of the Meta API because
th... | 31.27566 | 104 | 0.644069 |
from django.core import exceptions
from django.utils.functional import cached_property
from . import BLANK_CHOICE_DASH
from .mixins import FieldCacheMixin
class ForeignObjectRel(FieldCacheMixin):
auto_created = True
concrete = False
editable = False
is_relation = True
# foreign key o... | true | true |
f7252ab67d2d7b09f44add6e1853b7582a5b415f | 1,646 | py | Python | networks/resample2d_package/resample2d.py | ryannggy/fn-colab | 2aefe81bc50ec0e52c0eb7c5bc94178fa66d6ec8 | [
"Apache-2.0"
] | null | null | null | networks/resample2d_package/resample2d.py | ryannggy/fn-colab | 2aefe81bc50ec0e52c0eb7c5bc94178fa66d6ec8 | [
"Apache-2.0"
] | null | null | null | networks/resample2d_package/resample2d.py | ryannggy/fn-colab | 2aefe81bc50ec0e52c0eb7c5bc94178fa66d6ec8 | [
"Apache-2.0"
] | null | null | null | from torch.nn.modules.module import Module
from torch.autograd import Function, Variable
import resample2d_cuda
class Resample2dFunction(Function):
@staticmethod
def forward(ctx, input1, input2, kernel_size=1, bilinear= True):
assert input1.is_contiguous()
assert input2.is_contiguous(... | 32.92 | 91 | 0.634265 | from torch.nn.modules.module import Module
from torch.autograd import Function, Variable
import resample2d_cuda
class Resample2dFunction(Function):
@staticmethod
def forward(ctx, input1, input2, kernel_size=1, bilinear= True):
assert input1.is_contiguous()
assert input2.is_contiguous(... | true | true |
f7252c82c5f17709b13320a16f6f349e51df4253 | 6,134 | py | Python | cogs/permissions.py | cephox/bettermod | 13750ed01095976d594a96cf12b92bed340a4a8e | [
"MIT"
] | 1 | 2021-01-24T17:42:42.000Z | 2021-01-24T17:42:42.000Z | cogs/permissions.py | cephox/bettermod | 13750ed01095976d594a96cf12b92bed340a4a8e | [
"MIT"
] | null | null | null | cogs/permissions.py | cephox/bettermod | 13750ed01095976d594a96cf12b92bed340a4a8e | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Optional, Union
from discord.embeds import Embed
from discord.ext.commands import Cog, Context, group, has_permissions
from discord.member import Member
from discord.role import Role
from colors import Colors
from log import log
from permission import update_user_permi... | 51.546218 | 118 | 0.584773 | from datetime import datetime
from typing import Optional, Union
from discord.embeds import Embed
from discord.ext.commands import Cog, Context, group, has_permissions
from discord.member import Member
from discord.role import Role
from colors import Colors
from log import log
from permission import update_user_permi... | true | true |
f7252f66bf5fa79b977b4129cd0bfdf672edf213 | 4,156 | py | Python | dkist/net/globus/tests/test_auth.py | DKISTDC/dkist | 3b97d7c0db144a717cfbe648b7402b8b8f9f2da2 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 21 | 2018-05-18T13:43:59.000Z | 2022-03-16T21:17:39.000Z | dkist/net/globus/tests/test_auth.py | Cadair/dkist | 2f4d930ea0e002db40e8ef17a79b0b4fb2e6d3f3 | [
"BSD-3-Clause"
] | 134 | 2017-12-07T16:09:24.000Z | 2022-03-17T16:13:55.000Z | dkist/net/globus/tests/test_auth.py | Cadair/dkist | 2f4d930ea0e002db40e8ef17a79b0b4fb2e6d3f3 | [
"BSD-3-Clause"
] | 4 | 2017-12-04T10:49:49.000Z | 2022-01-10T12:20:46.000Z | import json
import stat
import pathlib
import platform
import globus_sdk
import requests
from dkist.net.globus.auth import (ensure_globus_authorized, get_cache_contents,
get_cache_file_path, get_refresh_token_authorizer,
save_auth_cache, start_loca... | 33.788618 | 90 | 0.698027 | import json
import stat
import pathlib
import platform
import globus_sdk
import requests
from dkist.net.globus.auth import (ensure_globus_authorized, get_cache_contents,
get_cache_file_path, get_refresh_token_authorizer,
save_auth_cache, start_loca... | true | true |
f7252fa094b50021b73b758dbb88c52ca1b4bf3a | 739 | py | Python | src/pytuya/devices/heater.py | python-tuya/python-tuya | c1938491a04bd6285d05defef0a9918f50d8bbc9 | [
"MIT"
] | 10 | 2017-07-11T16:58:33.000Z | 2021-03-15T23:19:28.000Z | src/pytuya/devices/heater.py | python-tuya/python-tuya | c1938491a04bd6285d05defef0a9918f50d8bbc9 | [
"MIT"
] | 3 | 2017-07-21T03:22:19.000Z | 2018-01-04T14:02:51.000Z | src/pytuya/devices/heater.py | python-tuya/python-tuya | c1938491a04bd6285d05defef0a9918f50d8bbc9 | [
"MIT"
] | null | null | null | from pytuya.devices.base import TuyaDevice
class TuyaHeater(TuyaDevice):
"""
Represents a Tuya Heater.
"""
def __init__(self, id, password, local_key, region):
super(TuyaHeater, self).__init__(id, password, local_key, region)
def state(self):
return self._last_reading.get('1', Fal... | 24.633333 | 73 | 0.641407 | from pytuya.devices.base import TuyaDevice
class TuyaHeater(TuyaDevice):
def __init__(self, id, password, local_key, region):
super(TuyaHeater, self).__init__(id, password, local_key, region)
def state(self):
return self._last_reading.get('1', False)
def is_on(self):
return self.... | true | true |
f7252fb0603ecf1d70f00062b7fba0b9355d9f42 | 718 | py | Python | scripts/adapter.py | Skalwalker/BreastCancerRecognition | d934948103f6cc45eae65d6e11a351f8f69b3ae0 | [
"MIT"
] | null | null | null | scripts/adapter.py | Skalwalker/BreastCancerRecognition | d934948103f6cc45eae65d6e11a351f8f69b3ae0 | [
"MIT"
] | null | null | null | scripts/adapter.py | Skalwalker/BreastCancerRecognition | d934948103f6cc45eae65d6e11a351f8f69b3ae0 | [
"MIT"
] | 1 | 2020-11-10T15:09:34.000Z | 2020-11-10T15:09:34.000Z | import readfiles
import learnAlgorithms as learn
from plot import Plot as Plot
class Adapter(object):
def __init__(self, kernel, turnPlot, interactions):
self.log("Lendo Dados")
rf = readfiles.ReadFiles()
self.data = rf.getData()
self.labels = rf.getLabels()
self.la = learn... | 28.72 | 92 | 0.650418 | import readfiles
import learnAlgorithms as learn
from plot import Plot as Plot
class Adapter(object):
def __init__(self, kernel, turnPlot, interactions):
self.log("Lendo Dados")
rf = readfiles.ReadFiles()
self.data = rf.getData()
self.labels = rf.getLabels()
self.la = learn... | true | true |
f7252fb765341c7239f0b406db114d6920488e05 | 216,381 | py | Python | pysnmp-with-texts/Wellfleet-FRSW-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Wellfleet-FRSW-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Wellfleet-FRSW-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Wellfleet-FRSW-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-FRSW-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:40:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... | 156.006489 | 12,584 | 0.795407 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuild... | true | true |
f7253028cdd82bf123f765e9eee0f96a6ac55fad | 6,819 | py | Python | src/walax/metadata.py | hazelmollusk/django-walax | 60cd05483e155bdd817df60a0c9fc7922f80c500 | [
"MIT"
] | null | null | null | src/walax/metadata.py | hazelmollusk/django-walax | 60cd05483e155bdd817df60a0c9fc7922f80c500 | [
"MIT"
] | null | null | null | src/walax/metadata.py | hazelmollusk/django-walax | 60cd05483e155bdd817df60a0c9fc7922f80c500 | [
"MIT"
] | null | null | null | from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.utils.encoding import force_str
from rest_framework import exceptions, serializers
from rest_framework.relations import PrimaryKeyRelatedField
from rest_framework.request import clone_request
from collections import Ordered... | 38.308989 | 140 | 0.592169 | from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.utils.encoding import force_str
from rest_framework import exceptions, serializers
from rest_framework.relations import PrimaryKeyRelatedField
from rest_framework.request import clone_request
from collections import Ordered... | true | true |
f725309690ad014e3b8fcbe2e6561e01b841f7ec | 574 | py | Python | subframe/datatables.py | joshbode/subframe | af035ee75f2c9a0d11f538dd88b9491c92389b65 | [
"MIT"
] | 2 | 2015-08-24T02:19:01.000Z | 2015-08-24T03:31:06.000Z | subframe/datatables.py | joshbode/subframe | af035ee75f2c9a0d11f538dd88b9491c92389b65 | [
"MIT"
] | null | null | null | subframe/datatables.py | joshbode/subframe | af035ee75f2c9a0d11f538dd88b9491c92389b65 | [
"MIT"
] | null | null | null | """
DataTable display.
"""
from .subframe import SubFrame
from .plugin import plugins
class DataTable(SubFrame):
"""Display a DataFrame as a DataTable."""
_plugins = [plugins.datatables]
def _js(self, data):
"""Javascript callback body."""
data = data.to_records()
data = self._... | 22.076923 | 86 | 0.562718 |
from .subframe import SubFrame
from .plugin import plugins
class DataTable(SubFrame):
_plugins = [plugins.datatables]
def _js(self, data):
data = data.to_records()
data = self._json({
'data': data.tolist(),
'columns': [
{'title': x} for x in self._ma... | true | true |
f72530ff5351dea5d4081b0e5aac7da571510f0f | 346 | py | Python | setup.py | Qman11010101/blogen_neo | a56bd5e7a0622488e4f3a4dd87c6e4cf126ed2cb | [
"MIT"
] | null | null | null | setup.py | Qman11010101/blogen_neo | a56bd5e7a0622488e4f3a4dd87c6e4cf126ed2cb | [
"MIT"
] | null | null | null | setup.py | Qman11010101/blogen_neo | a56bd5e7a0622488e4f3a4dd87c6e4cf126ed2cb | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="blogen_neo",
version="0.0.1",
description="Simple static site generator for blog",
author="Kjuman Enobikto",
author_email="qmanenobikto@gmail.com",
install_requires=["jinja2", "fire"],
entry_points={
"console_scripts": [
"blogen ... | 21.625 | 56 | 0.612717 | from setuptools import setup
setup(
name="blogen_neo",
version="0.0.1",
description="Simple static site generator for blog",
author="Kjuman Enobikto",
author_email="qmanenobikto@gmail.com",
install_requires=["jinja2", "fire"],
entry_points={
"console_scripts": [
"blogen ... | true | true |
f7253166d60df35b6e5baa2e8773dc05e8fdf3db | 4,335 | py | Python | src/runners/episode_runner.py | dennismalmgren/marl | baa846dc4144cf6f53e51d8cf1e2fcf5800c9f95 | [
"Apache-2.0"
] | null | null | null | src/runners/episode_runner.py | dennismalmgren/marl | baa846dc4144cf6f53e51d8cf1e2fcf5800c9f95 | [
"Apache-2.0"
] | null | null | null | src/runners/episode_runner.py | dennismalmgren/marl | baa846dc4144cf6f53e51d8cf1e2fcf5800c9f95 | [
"Apache-2.0"
] | null | null | null | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
import numpy as np
class EpisodeRunner:
def __init__(self, args, logger):
self.args = args
self.logger = logger
self.batch_size = self.args.batch_size_run
ass... | 34.959677 | 111 | 0.608074 | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
import numpy as np
class EpisodeRunner:
def __init__(self, args, logger):
self.args = args
self.logger = logger
self.batch_size = self.args.batch_size_run
ass... | true | true |
f72532605be0861ccc1b4e26456972b2f7cf7351 | 997 | py | Python | pynsot/serializers.py | dropbox/pynsot | 3a0ff2f6994860beaea147486d914fc0e7e37080 | [
"Apache-2.0"
] | 41 | 2015-01-17T02:59:44.000Z | 2021-12-01T16:16:25.000Z | pynsot/serializers.py | dropbox/pynsot | 3a0ff2f6994860beaea147486d914fc0e7e37080 | [
"Apache-2.0"
] | 88 | 2015-03-09T21:30:53.000Z | 2021-05-21T14:58:23.000Z | pynsot/serializers.py | dropbox/pynsot | 3a0ff2f6994860beaea147486d914fc0e7e37080 | [
"Apache-2.0"
] | 30 | 2015-01-17T02:59:15.000Z | 2021-04-19T22:32:57.000Z | # -*- coding: utf-8 -*-
"""
Specialized serializers for NSoT API client.
This is an example of how you would use this with the Client object, to make it
return objects instead of dicts::
>>> serializer = ModelSerializer()
>>> api = Client(url, serializer=serializer)
>>> obj = api.sites(1).get()
>>> o... | 25.564103 | 79 | 0.697091 |
from __future__ import unicode_literals
from __future__ import absolute_import
from slumber.serialize import JsonSerializer
from .import models
__author__ = 'Jathan McCollum'
__maintainer__ = 'Jathan McCollum'
__email__ = 'jathan@dropbox.com'
__copyright__ = 'Copyright (c) 2015-2016 Dropbox, Inc.'
class ModelSe... | true | true |
f72532c82404f85f49d2567399b1b9784361b2ba | 779 | py | Python | app/Model/Model_facedetection.py | Renanrbsc/System_Face_Recognition | 45a6778e18325245bea27abe41d3a646fa09863c | [
"MIT"
] | null | null | null | app/Model/Model_facedetection.py | Renanrbsc/System_Face_Recognition | 45a6778e18325245bea27abe41d3a646fa09863c | [
"MIT"
] | null | null | null | app/Model/Model_facedetection.py | Renanrbsc/System_Face_Recognition | 45a6778e18325245bea27abe41d3a646fa09863c | [
"MIT"
] | null | null | null | import cv2
from app.Model.Model_cascades import Cascades
class FaceDetection:
def __init__(self):
self.type_cascade = Cascades.FACECASCADE
def get_type_cascade(self):
return self.type_cascade
def detection_rectangle_dimensions(self):
scaleFactor = 1.3
minNeighbors = 5
... | 27.821429 | 68 | 0.640565 | import cv2
from app.Model.Model_cascades import Cascades
class FaceDetection:
def __init__(self):
self.type_cascade = Cascades.FACECASCADE
def get_type_cascade(self):
return self.type_cascade
def detection_rectangle_dimensions(self):
scaleFactor = 1.3
minNeighbors = 5
... | true | true |
f72534dd903118747d36c4ba1c73abaee618366c | 825 | py | Python | setup.py | elliotnunn/macresources | cc7c6aacec7d241c945d925c3a2473c3917ef4e0 | [
"MIT"
] | 5 | 2019-09-25T01:09:07.000Z | 2021-11-03T02:39:42.000Z | setup.py | elliotnunn/macresources | cc7c6aacec7d241c945d925c3a2473c3917ef4e0 | [
"MIT"
] | null | null | null | setup.py | elliotnunn/macresources | cc7c6aacec7d241c945d925c3a2473c3917ef4e0 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='macresources',
version='1.2',
author='Elliot Nunn',
author_email='elliotnunn@me.com',
description='Library for working with legacy Macintosh resource forks',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
... | 35.869565 | 138 | 0.647273 | from setuptools import setup
setup(
name='macresources',
version='1.2',
author='Elliot Nunn',
author_email='elliotnunn@me.com',
description='Library for working with legacy Macintosh resource forks',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
... | true | true |
f72535000dbea0756b1c0b1ca77caaa8aa396926 | 3,406 | py | Python | main.py | chanhee0222/feed2resp | 16dc7071f17af56cbf019eeabcd12a5dbd0693e7 | [
"MIT"
] | null | null | null | main.py | chanhee0222/feed2resp | 16dc7071f17af56cbf019eeabcd12a5dbd0693e7 | [
"MIT"
] | null | null | null | main.py | chanhee0222/feed2resp | 16dc7071f17af56cbf019eeabcd12a5dbd0693e7 | [
"MIT"
] | null | null | null | import argparse
import datetime
import glob
import logging
import os
import time
import torch
from logging_helper import init_logger
from models import Discriminator, BartSystem
from train import train
from transformer_base import add_generic_args, generic_train
class Config():
# data_path = './data/chatbot/'
... | 28.383333 | 122 | 0.668526 | import argparse
import datetime
import glob
import logging
import os
import time
import torch
from logging_helper import init_logger
from models import Discriminator, BartSystem
from train import train
from transformer_base import add_generic_args, generic_train
class Config():
save_path = './save'
... | true | true |
f7253541b69cfbfcfbec4e8411f5009f4337f8ed | 6,853 | py | Python | homeassistant/components/mqtt/number.py | Kiskae/core | f538e07902b5370fdf448627798444df43a32085 | [
"Apache-2.0"
] | 3 | 2021-03-31T12:56:27.000Z | 2021-05-25T15:26:01.000Z | homeassistant/components/mqtt/number.py | Kiskae/core | f538e07902b5370fdf448627798444df43a32085 | [
"Apache-2.0"
] | 65 | 2018-10-14T08:59:06.000Z | 2022-03-31T06:04:07.000Z | homeassistant/components/mqtt/number.py | Kiskae/core | f538e07902b5370fdf448627798444df43a32085 | [
"Apache-2.0"
] | 1 | 2021-03-29T18:56:52.000Z | 2021-03-29T18:56:52.000Z | """Configure number in a device through MQTT topic."""
import functools
import logging
import voluptuous as vol
from homeassistant.components import number
from homeassistant.components.number import (
DEFAULT_MAX_VALUE,
DEFAULT_MIN_VALUE,
DEFAULT_STEP,
NumberEntity,
)
from homeassistant.const import ... | 31.726852 | 87 | 0.637531 | import functools
import logging
import voluptuous as vol
from homeassistant.components import number
from homeassistant.components.number import (
DEFAULT_MAX_VALUE,
DEFAULT_MIN_VALUE,
DEFAULT_STEP,
NumberEntity,
)
from homeassistant.const import CONF_NAME, CONF_OPTIMISTIC, CONF_VALUE_TEMPLATE
from ho... | true | true |
f72536cc54c5ab45ec1ef476582c6f686e353776 | 9,038 | py | Python | netapp/santricity/models/v2/discovery_start_request.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | netapp/santricity/models/v2/discovery_start_request.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | netapp/santricity/models/v2/discovery_start_request.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | # coding: utf-8
"""
DiscoveryStartRequest.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are... | 39.295652 | 844 | 0.645829 |
from pprint import pformat
from six import iteritems
class DiscoveryStartRequest(object):
def __init__(self):
self.swagger_types = {
'start_ip': 'str',
'end_ip': 'str',
'use_agents': 'bool',
'connection_timeout': 'int',
'max_ports_to_u... | true | true |
f72536e7634a6d0146e21e210682f4ef9a21937b | 1,108 | py | Python | tests/test_async_manager.py | yehonadav/qaviton_io | 936c444db06d5c0a9fa75a56742c70a0deebee65 | [
"Apache-2.0"
] | null | null | null | tests/test_async_manager.py | yehonadav/qaviton_io | 936c444db06d5c0a9fa75a56742c70a0deebee65 | [
"Apache-2.0"
] | null | null | null | tests/test_async_manager.py | yehonadav/qaviton_io | 936c444db06d5c0a9fa75a56742c70a0deebee65 | [
"Apache-2.0"
] | null | null | null | from time import time
from requests import get
from qaviton_io.async_manager import AsyncManager
from tests.utils import server
def test_simple_requests():
def execute_tasks(number_of_tasks: int):
errors = {}
rs = []
def task():
try:
with server() as (host, por... | 26.380952 | 55 | 0.50361 | from time import time
from requests import get
from qaviton_io.async_manager import AsyncManager
from tests.utils import server
def test_simple_requests():
def execute_tasks(number_of_tasks: int):
errors = {}
rs = []
def task():
try:
with server() as (host, por... | true | true |
f72537a956b381dcd8b8b8636b46fb369b4e987b | 4,514 | py | Python | pymare/stats.py | tsalo/PyMARE | 7eb950fb137b6221f2ea5d381ca91d16eb4b8a35 | [
"MIT"
] | null | null | null | pymare/stats.py | tsalo/PyMARE | 7eb950fb137b6221f2ea5d381ca91d16eb4b8a35 | [
"MIT"
] | null | null | null | pymare/stats.py | tsalo/PyMARE | 7eb950fb137b6221f2ea5d381ca91d16eb4b8a35 | [
"MIT"
] | null | null | null | """Miscellaneous statistical functions."""
import numpy as np
import scipy.stats as ss
from scipy.optimize import Bounds, minimize
def weighted_least_squares(y, v, X, tau2=0.0, return_cov=False):
"""2-D weighted least squares.
Args:
y (NDArray): 2-d array of estimates (studies x parallel datasets)
... | 36.699187 | 89 | 0.634692 |
import numpy as np
import scipy.stats as ss
from scipy.optimize import Bounds, minimize
def weighted_least_squares(y, v, X, tau2=0.0, return_cov=False):
w = 1.0 / (v + tau2)
wX = np.einsum("kp,ki->ipk", X, w)
cov = wX.dot(X)
precision = np.linalg.pinv(cov).T
pwX = np.einsum("ip... | true | true |
f72538c76f49ccac9bcd5d18c35fad8c0e5bdbe6 | 691 | py | Python | backtracking/0216_combination_sum_3.py | MartinMa28/Algorithms_review | 3f2297038c00f5a560941360ca702e6868530f34 | [
"MIT"
] | null | null | null | backtracking/0216_combination_sum_3.py | MartinMa28/Algorithms_review | 3f2297038c00f5a560941360ca702e6868530f34 | [
"MIT"
] | null | null | null | backtracking/0216_combination_sum_3.py | MartinMa28/Algorithms_review | 3f2297038c00f5a560941360ca702e6868530f34 | [
"MIT"
] | null | null | null | class Solution:
def __init__(self):
self.combs = []
def _backtrack(self, candidates, cur, target, k):
if len(cur) == k and sum(cur) == target:
self.combs.append(cur[:])
return
if sum(cur) > target:
return
elif len(cur) < k:
... | 30.043478 | 69 | 0.474674 | class Solution:
def __init__(self):
self.combs = []
def _backtrack(self, candidates, cur, target, k):
if len(cur) == k and sum(cur) == target:
self.combs.append(cur[:])
return
if sum(cur) > target:
return
elif len(cur) < k:
... | true | true |
f72538f645e6c0711034952f80384b2e12169de0 | 1,211 | py | Python | src/Aula19ex94UneDicLista.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | src/Aula19ex94UneDicLista.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | src/Aula19ex94UneDicLista.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | #CADASTRO DE PESSOAS em dicionário - AULA 19 EXERCÍCIO 94
#dados das pessos: nome, sexo e idade
#todos os dicionários numa lista
#Informar quantos cadastrados, média de idade, lista de mulheres e nomes de pessoas de idade acima da média
#
pessoa = dict()
grupo = list()
somaidades = media = 0
while True:
pessoa.clea... | 35.617647 | 107 | 0.630058 |
pessoa = dict()
grupo = list()
somaidades = media = 0
while True:
pessoa.clear()
pessoa["nome"] = str(input('Nome: ')).strip()
pessoa["sexo"] = str(input('Sexo: [M/F] ')).strip().upper()
pessoa["idade"] = int(input('Idade: '))
grupo.append(pessoa.copy())
cont = str(input('Continuar? [S/N]... | true | true |
f7253987a63d4e5b5b25935dff1c1a6614e9432f | 804 | py | Python | app.py | computercavemen/web-scraping-challenge | 3a68fd3bd6ddfcfc3fbd033d6f1d472ab6a76a10 | [
"ADSL"
] | null | null | null | app.py | computercavemen/web-scraping-challenge | 3a68fd3bd6ddfcfc3fbd033d6f1d472ab6a76a10 | [
"ADSL"
] | null | null | null | app.py | computercavemen/web-scraping-challenge | 3a68fd3bd6ddfcfc3fbd033d6f1d472ab6a76a10 | [
"ADSL"
] | null | null | null | from flask import Flask, render_template, redirect
from jinja2 import Template
from splinter import browser
from flask_pymongo import PyMongo
import scrape_mars
# Create an instance of our Flask app.
app = Flask(__name__)
# Use flask_pymongo to set up mongo connection
app.config["MONGO_URI"] = "mongodb://localhost:2... | 23.647059 | 63 | 0.732587 | from flask import Flask, render_template, redirect
from jinja2 import Template
from splinter import browser
from flask_pymongo import PyMongo
import scrape_mars
app = Flask(__name__)
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
mongo.db.mars_page.drop()
@app.route("/")
def... | true | true |
f72539f2e8f0879fdd0b4a7738c5479966731504 | 14,082 | py | Python | python/ccxt/async_support/base/exchange.py | Beaxy/ccxt | 4ade917da0f202dfbe614240223ab74832a3fc0d | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | Beaxy/ccxt | 4ade917da0f202dfbe614240223ab74832a3fc0d | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | Beaxy/ccxt | 4ade917da0f202dfbe614240223ab74832a3fc0d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.40.88'
# -----------------------------------------------------------------------------
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
i... | 42.802432 | 355 | 0.619656 |
__version__ = '1.40.88'
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttle import throttle
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ExchangeNotAvailable
from ccxt.base.er... | true | true |
f7253a302858e90ec0abb748061c7a21bef6c41b | 844 | py | Python | casbin/model/assertion.py | goodrain/pycasbin | 1a481ba1af7619e1cc7e83896581d14976927d80 | [
"Apache-2.0"
] | null | null | null | casbin/model/assertion.py | goodrain/pycasbin | 1a481ba1af7619e1cc7e83896581d14976927d80 | [
"Apache-2.0"
] | null | null | null | casbin/model/assertion.py | goodrain/pycasbin | 1a481ba1af7619e1cc7e83896581d14976927d80 | [
"Apache-2.0"
] | null | null | null | from casbin import log
class Assertion:
key = ""
value = ""
tokens = []
policy = []
rm = None
def build_role_links(self, rm):
self.rm = rm
count = self.value.count("_")
for rule in self.policy:
if count < 2:
raise RuntimeError('the number o... | 27.225806 | 95 | 0.520142 | from casbin import log
class Assertion:
key = ""
value = ""
tokens = []
policy = []
rm = None
def build_role_links(self, rm):
self.rm = rm
count = self.value.count("_")
for rule in self.policy:
if count < 2:
raise RuntimeError('the number o... | true | true |
f7253a8356e22c76da232f80805a7d9f35a574cc | 292 | py | Python | src/cli.py | nlitz88/ipmifan | 0c479298d8e7e8c9cd2a439e96dc182eca4866af | [
"MIT"
] | null | null | null | src/cli.py | nlitz88/ipmifan | 0c479298d8e7e8c9cd2a439e96dc182eca4866af | [
"MIT"
] | null | null | null | src/cli.py | nlitz88/ipmifan | 0c479298d8e7e8c9cd2a439e96dc182eca4866af | [
"MIT"
] | null | null | null |
# This file is just meant to include functions that can be called from the command line to interact with the service.
# or in other words, these functions will basically make up the service. Perhaps these will actually just end up in the controller.py file.
# Created this file for planning. | 73 | 139 | 0.791096 | true | true | |
f7253ad485c45ab64e6260d07fb70431869f4c85 | 4,179 | py | Python | third_party/rust_crates/vendor/ct-logs/build.py | zhangpf/fuchsia-rs | 903568f28ddf45f09157ead36d61b50322c9cf49 | [
"BSD-3-Clause"
] | 14 | 2020-10-25T05:48:36.000Z | 2021-09-20T02:46:20.000Z | third_party/rust_crates/vendor/ct-logs/build.py | zhangpf/fuchsia-rs | 903568f28ddf45f09157ead36d61b50322c9cf49 | [
"BSD-3-Clause"
] | 16 | 2020-09-04T19:01:11.000Z | 2021-05-28T03:23:09.000Z | third_party/rust_crates/vendor/ct-logs/build.py | ZVNexus/fuchsia | c5610ad15208208c98693618a79c705af935270c | [
"BSD-3-Clause"
] | 4 | 2020-12-28T17:04:45.000Z | 2022-03-12T03:20:44.000Z | # -*- coding: utf-8 -*-
import subprocess
import sys
import json
import hashlib
import time
import base64
from binascii import hexlify
from collections import namedtuple
HEADER = """//!
//! This library is automatically generated from Google's list of known CT
//! logs. Don't edit it.
//!
//! The generation is done ... | 26.96129 | 87 | 0.554439 |
import subprocess
import sys
import json
import hashlib
import time
import base64
from binascii import hexlify
from collections import namedtuple
HEADER = """//!
//! This library is automatically generated from Google's list of known CT
//! logs. Don't edit it.
//!
//! The generation is done deterministically so yo... | true | true |
f7253effa72e1fa6a01a0b839772bc4261a78df2 | 5,904 | py | Python | fixture/contact.py | talareq/jenkins | 6371b1faedf1990b8d1de57392dff5f57d239246 | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | talareq/jenkins | 6371b1faedf1990b8d1de57392dff5f57d239246 | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | talareq/jenkins | 6371b1faedf1990b8d1de57392dff5f57d239246 | [
"Apache-2.0"
] | null | null | null | from model.formfiller import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def add_new_contact(self, contact):
wd = self.app.wd
if not len(wd.find_elements_by_name("searchstring")) > 0:
self.app.open_home_page()
# add mew contact
... | 39.624161 | 148 | 0.646172 | from model.formfiller import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def add_new_contact(self, contact):
wd = self.app.wd
if not len(wd.find_elements_by_name("searchstring")) > 0:
self.app.open_home_page()
wd.find_el... | true | true |
f7253f2da62ae21d3ff22ab8085cb80e2d6cdb84 | 2,260 | py | Python | ryu/app/openstate/playground/start_many_to_1_ctrl.py | Tesi-Luca-Davide/ryu | f4b74d55d594dab0938bae0656d5143e284e0846 | [
"Apache-2.0"
] | null | null | null | ryu/app/openstate/playground/start_many_to_1_ctrl.py | Tesi-Luca-Davide/ryu | f4b74d55d594dab0938bae0656d5143e284e0846 | [
"Apache-2.0"
] | null | null | null | ryu/app/openstate/playground/start_many_to_1_ctrl.py | Tesi-Luca-Davide/ryu | f4b74d55d594dab0938bae0656d5143e284e0846 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.node import UserSwitch,RemoteController
from mininet.term import makeTerm
import os, time
class MyTopo( Topo ):
"Simple topology example."
def __init__( self):
"Create custom topo."
... | 32.753623 | 137 | 0.626991 |
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.node import UserSwitch,RemoteController
from mininet.term import makeTerm
import os, time
class MyTopo( Topo ):
def __init__( self):
Topo.__init__(self)
Host1=self.addHost('h1'... | true | true |
f7254068f9b6b41261cccdb04ae15cf40d62dba9 | 8,954 | py | Python | tseries_crossval.py | Yashgh7076/CU-Thesis | 59a7c6e8009395b5773b1ee47c38ca287ed6c189 | [
"MIT"
] | 1 | 2021-03-03T22:11:29.000Z | 2021-03-03T22:11:29.000Z | tseries_crossval.py | Yashgh7076/CU-Thesis | 59a7c6e8009395b5773b1ee47c38ca287ed6c189 | [
"MIT"
] | null | null | null | tseries_crossval.py | Yashgh7076/CU-Thesis | 59a7c6e8009395b5773b1ee47c38ca287ed6c189 | [
"MIT"
] | null | null | null | import numpy as np
import sys
import os
import math
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TF info
import tensorflow as tf
#import matplotlib.pyplot as plt
# Define constants
stride = 15 #1 second @ 15 Hz sampling
window = 30*15 #30 seconds window considered
folder = sys.argv[1]
if not os.... | 39.619469 | 189 | 0.615814 | import numpy as np
import sys
import os
import math
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
stride = 15
window = 30*15
folder = sys.argv[1]
if not os.path.exists(folder):
print("Unable to open folder containing data, check that folder exists \n")
exit(0)
total_files ... | true | true |
f725440da7378c0c7c83b48d5b2433930ec3d062 | 5,063 | py | Python | catalog/bindings/csw/animate_color_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/csw/animate_color_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/csw/animate_color_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from decimal import Decimal
from typing import Dict, List, Optional, Union
from bindings.csw.anim_mode_attrs_calc_mode import AnimModeAttrsCalcMode
from bindings.csw.animate_color_prototype import AnimateColorPrototype
from bindings.csw.fill_default_type import FillDefaultType
f... | 26.097938 | 75 | 0.540786 | from dataclasses import dataclass, field
from decimal import Decimal
from typing import Dict, List, Optional, Union
from bindings.csw.anim_mode_attrs_calc_mode import AnimModeAttrsCalcMode
from bindings.csw.animate_color_prototype import AnimateColorPrototype
from bindings.csw.fill_default_type import FillDefaultType
f... | true | true |
f7254419547fb3e85242fc0a78ab9478810397a4 | 4,518 | py | Python | contrib/testgen/gen_base58_test_vectors.py | artiqox/artiqox | 782d58837ec8a8a84a41f0508a71b060af7ed9fc | [
"MIT"
] | 9 | 2018-04-01T23:21:15.000Z | 2018-08-10T20:59:16.000Z | contrib/testgen/gen_base58_test_vectors.py | artiqox/artiqox | 782d58837ec8a8a84a41f0508a71b060af7ed9fc | [
"MIT"
] | 1 | 2019-06-16T00:58:29.000Z | 2019-06-23T23:46:33.000Z | contrib/testgen/gen_base58_test_vectors.py | artiqox/artiqox | 782d58837ec8a8a84a41f0508a71b060af7ed9fc | [
"MIT"
] | 5 | 2018-03-27T09:26:45.000Z | 2019-10-23T00:15:00.000Z | #!/usr/bin/env python
# Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_ve... | 35.023256 | 97 | 0.615095 |
import os
from itertools import islice
from base58 import b58encode, b58decode, b58encode_chk, b58decode_chk, b58chars
import random
from binascii import b2a_hex
PUBKEY_ADDRESS = 23
SCRIPT_ADDRESS = 82
PUBKEY_ADDRESS_TEST = 113
SCRIPT_ADDRESS_TEST = 196
PRIVKEY = 158
PRIVKEY_TEST = 241
metadata_keys = ['isPriv... | true | true |
f7254560c04c87549cd65488408ce3ddfcd4bf5f | 104,573 | py | Python | youtube_dl/YoutubeDL.py | 404NotFoundJ/ytubr | 7c4aa6fd6fd6fadf1cf1942c279cd5c0ff5ae498 | [
"Unlicense"
] | null | null | null | youtube_dl/YoutubeDL.py | 404NotFoundJ/ytubr | 7c4aa6fd6fd6fadf1cf1942c279cd5c0ff5ae498 | [
"Unlicense"
] | null | null | null | youtube_dl/YoutubeDL.py | 404NotFoundJ/ytubr | 7c4aa6fd6fd6fadf1cf1942c279cd5c0ff5ae498 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import copy
import datetime
import errno
import fileinput
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
import shutil
import su... | 46.14872 | 194 | 0.551653 |
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import copy
import datetime
import errno
import fileinput
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
import shutil
import subprocess
import socket
import sys
im... | true | true |
f725461411704fbc79dc7ae2a9d1d39784ab8ad4 | 678 | py | Python | var/spack/repos/builtin/packages/shapelib/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/shapelib/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/shapelib/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Shapelib(CMakePackage):
"""The Shapefile C Library provides the ability to write simple C ... | 35.684211 | 95 | 0.738938 |
from spack import *
class Shapelib(CMakePackage):
homepage = "http://shapelib.maptools.org/"
url = "https://github.com/OSGeo/shapelib/archive/v1.5.0.tar.gz"
version('1.5.0', sha256='48de3a6a8691b0b111b909c0b908af4627635c75322b3a501c0c0885f3558cad')
| true | true |
f725468d7e8fa6ad83dd70dda266a65d8900285a | 4,522 | py | Python | tests/extension/thread_/stream_reduce_source_join/thread_stream_reduce_source_join.py | Pyverilog/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | tests/extension/thread_/stream_reduce_source_join/thread_stream_reduce_source_join.py | Pyverilog/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | tests/extension/thread_/stream_reduce_source_join/thread_stream_reduce_source_join.py | shtaxxx/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... | 27.406061 | 84 | 0.587351 | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import veriloggen.thread as vthread
import veriloggen.type... | true | true |
f72546b650f48e4a4338cf5ec715dc344a3257bd | 14,857 | py | Python | slack_sdk/socket_mode/aiohttp/__init__.py | jans-forks/python-slackclient | ff798cbe00ead477ce98efa8468cb2c1c99635f3 | [
"MIT"
] | null | null | null | slack_sdk/socket_mode/aiohttp/__init__.py | jans-forks/python-slackclient | ff798cbe00ead477ce98efa8468cb2c1c99635f3 | [
"MIT"
] | null | null | null | slack_sdk/socket_mode/aiohttp/__init__.py | jans-forks/python-slackclient | ff798cbe00ead477ce98efa8468cb2c1c99635f3 | [
"MIT"
] | null | null | null | """aiohttp based Socket Mode client
* https://api.slack.com/apis/connections/socket
* https://slack.dev/python-slack-sdk/socket-mode/
* https://pypi.org/project/aiohttp/
"""
import asyncio
import logging
import time
from asyncio import Future, Lock
from asyncio import Queue
from logging import Logger
from typing impo... | 43.825959 | 120 | 0.568755 | import asyncio
import logging
import time
from asyncio import Future, Lock
from asyncio import Queue
from logging import Logger
from typing import Union, Optional, List, Callable, Awaitable
import aiohttp
from aiohttp import ClientWebSocketResponse, WSMessage, WSMsgType, ClientConnectionError
from slack_sdk.proxy_env... | true | true |
f72547daa09175d778fa9ae8f7c4bef863150db5 | 840 | py | Python | Setup/PreRelease/setup.py | tushariyer/sit-rep | c7ff39182e78b6630922765289f6343a7f14e18a | [
"MIT"
] | null | null | null | Setup/PreRelease/setup.py | tushariyer/sit-rep | c7ff39182e78b6630922765289f6343a7f14e18a | [
"MIT"
] | null | null | null | Setup/PreRelease/setup.py | tushariyer/sit-rep | c7ff39182e78b6630922765289f6343a7f14e18a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
long_desc = 'Licensed under the generic MIT License.\"sit-rep\" can either be downloaded from the ' \
'Releases page on GitHub and manually added to PATH or installed via \"pip\".'
version = ''
with open("Setup/version.txt", "r", encoding="utf-8") as... | 33.6 | 101 | 0.65 |
from distutils.core import setup
long_desc = 'Licensed under the generic MIT License.\"sit-rep\" can either be downloaded from the ' \
'Releases page on GitHub and manually added to PATH or installed via \"pip\".'
version = ''
with open("Setup/version.txt", "r", encoding="utf-8") as fh:
version = fh... | true | true |
f72547e17a96865f9a04a22b21403532cfa71d79 | 3,673 | py | Python | src/tools/vis_tracking_kittimots.py | gafaua/PolyTrack | 5a4b409732b9396be8271f5cba4ad426808d5af5 | [
"MIT"
] | 10 | 2021-11-07T04:25:08.000Z | 2022-03-25T03:33:21.000Z | src/tools/vis_tracking_kittimots.py | gafaua/PolyTrack | 5a4b409732b9396be8271f5cba4ad426808d5af5 | [
"MIT"
] | null | null | null | src/tools/vis_tracking_kittimots.py | gafaua/PolyTrack | 5a4b409732b9396be8271f5cba4ad426808d5af5 | [
"MIT"
] | 6 | 2021-11-03T21:27:06.000Z | 2022-03-27T17:27:40.000Z | import numpy as np
import cv2
import os
import glob
import sys
from collections import defaultdict
from pathlib import Path
import pycocotools.mask as rletools
from PIL import Image, ImageDraw
import matplotlib.pyplot as plt
DATA_PATH = '../../data/KITTIMOTS/'
IMG_PATH = DATA_PATH + 'train/'
SAVE_VIDEO = False
IS_GT =... | 30.865546 | 94 | 0.572829 | import numpy as np
import cv2
import os
import glob
import sys
from collections import defaultdict
from pathlib import Path
import pycocotools.mask as rletools
from PIL import Image, ImageDraw
import matplotlib.pyplot as plt
DATA_PATH = '../../data/KITTIMOTS/'
IMG_PATH = DATA_PATH + 'train/'
SAVE_VIDEO = False
IS_GT =... | true | true |
f7254891c728997635a95c7943f2f2e7d783a797 | 14,518 | py | Python | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/syncrep/test_basic.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/syncrep/test_basic.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/syncrep/test_basic.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | #!/usr/bin/env python
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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... | 44.533742 | 131 | 0.564403 |
from tinctest import logger
from mpp.lib.PSQL import PSQL
from mpp.models import MPPTestCase
from gppylib.db import dbconn
from mpp.gpdb.tests.storage.walrepl.run import StandbyRunMixin
from mpp.gpdb.tests.storage import walrepl
from mpp.gpdb.tests.storage.walrepl.lib.walcomm import *
from mpp.gpdb.tests.storage.wa... | true | true |
f7254a9efae6931fc674550384bd79222176447d | 3,222 | py | Python | commands/FBAutoLayoutCommands.py | zddd/chisel | 7782bdde3062e15ccbdc5f617aa3a8f096b6751b | [
"MIT"
] | 1 | 2020-03-04T20:24:33.000Z | 2020-03-04T20:24:33.000Z | commands/FBAutoLayoutCommands.py | zddd/chisel | 7782bdde3062e15ccbdc5f617aa3a8f096b6751b | [
"MIT"
] | null | null | null | commands/FBAutoLayoutCommands.py | zddd/chisel | 7782bdde3062e15ccbdc5f617aa3a8f096b6751b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import lldb
import fblldbbase as fb
import fblldbviewhelpers as viewHelpers
def lldbcommands():
ret... | 37.905882 | 178 | 0.724705 |
import lldb
import fblldbbase as fb
import fblldbviewhelpers as viewHelpers
def lldbcommands():
return [
FBPrintAutolayoutTrace(),
FBAutolayoutBorderAmbiguous(),
FBAutolayoutUnborderAmbiguous(),
]
class FBPrintAutolayoutTrace(fb.FBCommand):
def name(self):
return 'paltrace'
def descri... | true | true |
f7254bd8d5c655e025a0e95e3c6aac92193bfd17 | 658 | py | Python | gans/datasets/abstract_dataset.py | tlatkowski/gans-2.0 | 974efc5bbcea39c0a7dec9405ba4514ada6dc39c | [
"MIT"
] | 78 | 2019-09-25T15:09:18.000Z | 2022-02-09T09:56:15.000Z | gans/datasets/abstract_dataset.py | tlatkowski/gans-2.0 | 974efc5bbcea39c0a7dec9405ba4514ada6dc39c | [
"MIT"
] | 23 | 2019-10-09T21:24:39.000Z | 2022-03-12T00:00:53.000Z | gans/datasets/abstract_dataset.py | tlatkowski/gans-2.0 | 974efc5bbcea39c0a7dec9405ba4514ada6dc39c | [
"MIT"
] | 18 | 2020-01-24T13:13:57.000Z | 2022-02-15T18:58:12.000Z | import abc
from abc import abstractmethod
class Dataset(abc.ABC):
def __init__(
self,
input_params,
with_labels=False,
):
self.batch_size = input_params.batch_size
self.buffer_size = input_params.buffer_size
if with_labels:
self.train_da... | 22.689655 | 61 | 0.641337 | import abc
from abc import abstractmethod
class Dataset(abc.ABC):
def __init__(
self,
input_params,
with_labels=False,
):
self.batch_size = input_params.batch_size
self.buffer_size = input_params.buffer_size
if with_labels:
self.train_da... | true | true |
f7254bdd4bb068fb20e4ad809d0645054278cee9 | 5,620 | py | Python | SimpleLoggingServerToCsvFile.py | II43/SimpleLoggingServerToCsvFile | d3d50778041a5995e58b6a8f623519e3cb41a5ce | [
"MIT"
] | null | null | null | SimpleLoggingServerToCsvFile.py | II43/SimpleLoggingServerToCsvFile | d3d50778041a5995e58b6a8f623519e3cb41a5ce | [
"MIT"
] | null | null | null | SimpleLoggingServerToCsvFile.py | II43/SimpleLoggingServerToCsvFile | d3d50778041a5995e58b6a8f623519e3cb41a5ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Simple HTTP server in Python for logging events to CSV file
Motivation: Use this CSV file later for data agregation and plotting
Inspired by: Very simple HTTP server in Python for logging requests
https://gist.github.com/mdonkers/63e115cc0c79b4f6b8b3a6b797e485c7
Usage::
./SimpleLoggingS... | 37.972973 | 103 | 0.477224 |
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
from datetime import datetime
import csv
from os import curdir, sep, path
from shutil import copyfile
LOG_FILE = r'events.log'
MASTER_KEY = "jQw5xZVq9Kp4fm7hiZko"
KEYS = ["q67idhrJ56oQj7IElukH",
MASTER_KEY]
class S... | true | true |
f7254c126abf533a0ae20a41208a5dc83bf968ca | 712 | py | Python | src/schctest/pypacket_dissector/decoder.py | saguilarDevel/open_schc | ac7f2a84b6120964c8fdaabf9f5c8ca8ae39c289 | [
"MIT"
] | 21 | 2018-11-05T06:48:32.000Z | 2022-02-28T14:38:09.000Z | src/schctest/pypacket_dissector/decoder.py | saguilarDevel/open_schc | ac7f2a84b6120964c8fdaabf9f5c8ca8ae39c289 | [
"MIT"
] | 34 | 2019-01-28T01:32:41.000Z | 2021-05-06T09:40:14.000Z | src/schctest/pypacket_dissector/decoder.py | saguilarDevel/open_schc | ac7f2a84b6120964c8fdaabf9f5c8ca8ae39c289 | [
"MIT"
] | 28 | 2018-10-31T22:21:26.000Z | 2022-03-17T09:44:40.000Z | try:
from _json_keys import *
from _util import *
from defs_L3 import dissectors_L3
except:
from ._json_keys import *
from ._util import *
from .defs_L3 import dissectors_L3
def decoder(x):
'''
return (dissectors_L3)
or
return { JK_EMSG:(error-message) }
'''
this = None
... | 22.967742 | 61 | 0.588483 | try:
from _json_keys import *
from _util import *
from defs_L3 import dissectors_L3
except:
from ._json_keys import *
from ._util import *
from .defs_L3 import dissectors_L3
def decoder(x):
this = None
if len(x) < 1:
return { JK_EMSG:"invalid packet length" }
proto = (... | true | true |
f7254c2e00bea89d99a5f93b0d09b97a572ca11a | 1,521 | py | Python | tests/test_stock.py | condereis/mean-variance-portfolio | 526b1e86d1e92f08ceca9a7c204b043089272744 | [
"MIT"
] | 7 | 2018-08-22T19:16:33.000Z | 2021-08-14T03:50:08.000Z | tests/test_stock.py | condereis/mean-variance-portfolio | 526b1e86d1e92f08ceca9a7c204b043089272744 | [
"MIT"
] | 280 | 2018-07-12T20:20:20.000Z | 2022-03-27T20:01:20.000Z | tests/test_stock.py | condereis/mean-variance-portfolio | 526b1e86d1e92f08ceca9a7c204b043089272744 | [
"MIT"
] | 2 | 2020-04-02T02:30:42.000Z | 2021-07-22T21:13:04.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `mvport` package."""
import unittest
import numpy as np
from mvport.stock import Stock
class TestStock(unittest.TestCase):
"""Tests for `mvport` package."""
def setUp(self):
"""SetUp."""
self.ticker = 'AAPL'
self.returns =... | 27.654545 | 87 | 0.618014 |
import unittest
import numpy as np
from mvport.stock import Stock
class TestStock(unittest.TestCase):
def setUp(self):
self.ticker = 'AAPL'
self.returns = [-2, -1, 0, 1, 2]
self.stock = Stock(self.ticker, self.returns)
def test_get_ticker(self):
self.assertEqual(self.st... | true | true |
f7254caf0aa3637ad03dd57110d9475938728d0b | 301 | py | Python | compiler_gym/util/flags/output_dir.py | mostafaelhoushi/CompilerGym | cf11c58333d263b3ebc5ece2110a429e9af499c1 | [
"MIT"
] | 562 | 2020-12-21T14:10:20.000Z | 2022-03-31T21:23:55.000Z | compiler_gym/util/flags/output_dir.py | mostafaelhoushi/CompilerGym | cf11c58333d263b3ebc5ece2110a429e9af499c1 | [
"MIT"
] | 433 | 2020-12-22T03:40:41.000Z | 2022-03-31T18:16:17.000Z | compiler_gym/util/flags/output_dir.py | mostafaelhoushi/CompilerGym | cf11c58333d263b3ebc5ece2110a429e9af499c1 | [
"MIT"
] | 88 | 2020-12-22T08:22:00.000Z | 2022-03-20T19:00:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from absl import flags
flags.DEFINE_string(
"output_dir",
None,
"The directory to read and write files to.",
)
| 25.083333 | 65 | 0.724252 |
from absl import flags
flags.DEFINE_string(
"output_dir",
None,
"The directory to read and write files to.",
)
| true | true |
f7254ce72ce8155285a2f4a9a1febb88f4b64006 | 3,161 | py | Python | leasing/models/basis_of_rent.py | tuomas777/mvj | e9a12e42c399b9fb77fd8fad85fc8f0f6d4ce405 | [
"MIT"
] | null | null | null | leasing/models/basis_of_rent.py | tuomas777/mvj | e9a12e42c399b9fb77fd8fad85fc8f0f6d4ce405 | [
"MIT"
] | null | null | null | leasing/models/basis_of_rent.py | tuomas777/mvj | e9a12e42c399b9fb77fd8fad85fc8f0f6d4ce405 | [
"MIT"
] | null | null | null | from auditlog.registry import auditlog
from django.db import models
from django.utils.translation import ugettext_lazy as _
from enumfields import EnumField
from leasing.enums import PeriodType
from .mixins import NameModel, TimeStampedSafeDeleteModel
class BasisOfRentPlotType(NameModel):
"""
In Finnish: To... | 35.920455 | 120 | 0.691237 | from auditlog.registry import auditlog
from django.db import models
from django.utils.translation import ugettext_lazy as _
from enumfields import EnumField
from leasing.enums import PeriodType
from .mixins import NameModel, TimeStampedSafeDeleteModel
class BasisOfRentPlotType(NameModel):
class BasisOfRent(TimeSt... | true | true |
f7254d485119f2dd92ad0be5fa608833d0405c1d | 38 | py | Python | irclogs/__init__.py | dokipen/trac-irclogs-plugin | 811aa16fdaf7f6de9bfa6200073f5b33da09fc1a | [
"BSD-3-Clause"
] | null | null | null | irclogs/__init__.py | dokipen/trac-irclogs-plugin | 811aa16fdaf7f6de9bfa6200073f5b33da09fc1a | [
"BSD-3-Clause"
] | 1 | 2015-02-26T23:17:12.000Z | 2015-03-02T15:03:45.000Z | irclogs/__init__.py | dokipen/trac-irclogs-plugin | 811aa16fdaf7f6de9bfa6200073f5b33da09fc1a | [
"BSD-3-Clause"
] | null | null | null | from console import update_irc_search
| 19 | 37 | 0.894737 | from console import update_irc_search
| true | true |
f7254e36b7c014cfeea985736099019756c9cb78 | 1,026 | py | Python | program/experiments/localization/calibrate.py | JankaSvK/thesis | c440ab8242b058f580fdf9d5a1d00708a1696561 | [
"MIT"
] | 1 | 2018-11-29T14:13:47.000Z | 2018-11-29T14:13:47.000Z | program/experiments/localization/calibrate.py | JankaSvK/thesis | c440ab8242b058f580fdf9d5a1d00708a1696561 | [
"MIT"
] | 3 | 2018-04-24T18:30:00.000Z | 2018-05-11T23:25:07.000Z | program/experiments/localization/calibrate.py | JankaSvK/thesis | c440ab8242b058f580fdf9d5a1d00708a1696561 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
from sys import argv
if os.name == 'nt':
python = "python"
else:
python = "python3"
try:
experiment_id = int(argv[1])
except Exception:
experiment_id = 63
def command(video1, video2, chessboard):
return "{} ../../Main.py --video1={} --video2={} --chessboard={}".forma... | 24.428571 | 112 | 0.640351 |
import os
from sys import argv
if os.name == 'nt':
python = "python"
else:
python = "python3"
try:
experiment_id = int(argv[1])
except Exception:
experiment_id = 63
def command(video1, video2, chessboard):
return "{} ../../Main.py --video1={} --video2={} --chessboard={}".format(python, video1, ... | true | true |
f7254e6e57d13e131c3fc738bd9c4a2d139d00b0 | 5,481 | py | Python | src/polytopes/run_polychora_examples.py | mohi7solanki/pywonderland | 2b9d61a8414d4cfa92d34325e5e2b9b5d501abca | [
"MIT"
] | null | null | null | src/polytopes/run_polychora_examples.py | mohi7solanki/pywonderland | 2b9d61a8414d4cfa92d34325e5e2b9b5d501abca | [
"MIT"
] | null | null | null | src/polytopes/run_polychora_examples.py | mohi7solanki/pywonderland | 2b9d61a8414d4cfa92d34325e5e2b9b5d501abca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Render curved 4d polychoron examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script draws uniform polychoron whose vertices lie
on the unit sphere S^3 by using stereographic projection
to map them into 3d space.
:copyright (c) 2018 by Zhao Liang.
"""
... | 29.95082 | 85 | 0.561759 |
import subprocess
from fractions import Fraction
import numpy as np
from models import Polychora
import helpers
POV_EXE = "povray"
SCENE_FILE = "polychora_curved.pov"
IMAGE_SIZE = 600
IMAGE_QUALITY_LEVEL = 11
SUPER_SAMPLING_LEVEL = 7
ANTIALIASING_LE... | true | true |
f7254fe63f765868c8428af33d90ac77ae356bbd | 7,055 | py | Python | deltametrics/sample_data/sample_data.py | amoodie/DeltaMetrics | 9b823bea36851adcebc446c8941f8783325b1a4f | [
"MIT"
] | null | null | null | deltametrics/sample_data/sample_data.py | amoodie/DeltaMetrics | 9b823bea36851adcebc446c8941f8783325b1a4f | [
"MIT"
] | null | null | null | deltametrics/sample_data/sample_data.py | amoodie/DeltaMetrics | 9b823bea36851adcebc446c8941f8783325b1a4f | [
"MIT"
] | null | null | null | import sys
import os
import pkg_resources
import warnings
import numpy as np
import netCDF4
import pooch
from .. import cube
from .. import utils
# deltametrics version
__version__ = utils._get_version()
# enusre DeprecationWarning is shown
warnings.simplefilter("default")
# configure the data registry
REGISTRY ... | 32.813953 | 125 | 0.632034 | import sys
import os
import pkg_resources
import warnings
import numpy as np
import netCDF4
import pooch
from .. import cube
from .. import utils
__version__ = utils._get_version()
warnings.simplefilter("default")
REGISTRY = pooch.create(
path=pooch.os_cache("deltametrics"),
base_url='https://github.c... | true | true |
f72550174de22fb7301842e0d293f4de18995253 | 3,836 | py | Python | cirq-core/cirq/ops/two_qubit_diagonal_gate_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/ops/two_qubit_diagonal_gate_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/ops/two_qubit_diagonal_gate_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 31.966667 | 96 | 0.676747 |
import numpy as np
import pytest
import sympy
import cirq
@pytest.mark.parametrize(
'gate',
(
(
cirq.TwoQubitDiagonalGate([2, 3, 5, 7]),
cirq.TwoQubitDiagonalGate([0, 0, 0, 0]),
cirq.TwoQubitDiagonalGate([2, 3, 5, sympy.Symbol('a')]),
cirq... | true | true |
f725507deeef1871cc78aa29f14a4bf893392a8e | 3,010 | py | Python | mt4forexparser/UniLogger.py | Tim55667757/MT4ForexParser | 4aceab05f150cfccc0ad4622c612476e279b68f0 | [
"MIT"
] | 11 | 2020-07-23T22:34:07.000Z | 2022-03-03T04:42:22.000Z | mt4forexparser/UniLogger.py | Tim55667757/MT4ForexParser | 4aceab05f150cfccc0ad4622c612476e279b68f0 | [
"MIT"
] | null | null | null | mt4forexparser/UniLogger.py | Tim55667757/MT4ForexParser | 4aceab05f150cfccc0ad4622c612476e279b68f0 | [
"MIT"
] | 4 | 2021-03-02T08:04:15.000Z | 2021-08-24T13:46:35.000Z | # -*- coding: utf-8 -*-
#
# Author: Timur Gilmullin
# This module initialize standard python logging system.
import sys
import logging.handlers
# initialize Main Parent Logger:
UniLogger = logging.getLogger("UniLogger")
formatString = "%(filename)-20sL:%(lineno)-5d%(levelname)-8s[%(asctime)s] %(message)s"
formatte... | 29.223301 | 119 | 0.68206 |
import sys
import logging.handlers
UniLogger = logging.getLogger("UniLogger")
formatString = "%(filename)-20sL:%(lineno)-5d%(levelname)-8s[%(asctime)s] %(message)s"
formatter = logging.Formatter(formatString)
sys.stderr = sys.stdout
def SetLevel(vLevel='ERROR'):
UniLogger.level = logging.NOTSET
if ... | true | true |
f72551baa697a8dbad37b7a7ff3d920bbdc9c06b | 271 | py | Python | Functional Programming/Sum_of_numbers_Recursion.py | youngtech515/PythonScripts | c890c84113ba4e05aea15d1347886dbfb52d3bf9 | [
"MIT"
] | null | null | null | Functional Programming/Sum_of_numbers_Recursion.py | youngtech515/PythonScripts | c890c84113ba4e05aea15d1347886dbfb52d3bf9 | [
"MIT"
] | null | null | null | Functional Programming/Sum_of_numbers_Recursion.py | youngtech515/PythonScripts | c890c84113ba4e05aea15d1347886dbfb52d3bf9 | [
"MIT"
] | null | null | null | print("To print the sum of numbers using recursion")
def calculatatesum(num):
if(num):
a=num+calculatatesum(num-1)
return a
else:
return 0
n=int(input("Enter the Number value:"))
print("The Sum of numbers is,",calculatatesum(n))
| 27.1 | 53 | 0.630996 | print("To print the sum of numbers using recursion")
def calculatatesum(num):
if(num):
a=num+calculatatesum(num-1)
return a
else:
return 0
n=int(input("Enter the Number value:"))
print("The Sum of numbers is,",calculatatesum(n))
| true | true |
f725525a43e73f257b95eb328de9c2b2b9780b5e | 494 | py | Python | optoanalysis/optoanalysis/__init__.py | markusrademacher/DataHandling | 240c7c8378541cc2624fec049a185646f3016233 | [
"MIT"
] | 2 | 2017-07-12T11:18:51.000Z | 2018-08-26T10:31:00.000Z | optoanalysis/optoanalysis/__init__.py | markusrademacher/DataHandling | 240c7c8378541cc2624fec049a185646f3016233 | [
"MIT"
] | 7 | 2017-04-24T18:42:23.000Z | 2017-06-20T13:00:09.000Z | optoanalysis/optoanalysis/__init__.py | AshleySetter/optoanalysis | 2b24a4176508d5e0e5e8644bb617a34f73b041f7 | [
"MIT"
] | 3 | 2017-04-09T19:15:06.000Z | 2017-04-28T09:31:32.000Z | """
optoanalysis
============
Package of functions for the Matter-Wave Interferometry
group for handling experimental data.
"""
# init file
import os
_mypackage_root_dir = os.path.dirname(__file__)
_version_file = open(os.path.join(_mypackage_root_dir, 'VERSION'))
__version__ = _version_file.read().strip()
# th... | 19.76 | 67 | 0.777328 |
import os
_mypackage_root_dir = os.path.dirname(__file__)
_version_file = open(os.path.join(_mypackage_root_dir, 'VERSION'))
__version__ = _version_file.read().strip()
from .optoanalysis import *
import optoanalysis.thermo
import optoanalysis.LeCroy
import optoanalysis.Saleae
| true | true |
f72552862a7eea93f641832290eb243900232978 | 1,055 | py | Python | web_audio/helpers.py | SaxAlien/crap-code | bff99bc4501d1c7bc8c169c1b66a2d6bd7ad3494 | [
"Apache-2.0"
] | null | null | null | web_audio/helpers.py | SaxAlien/crap-code | bff99bc4501d1c7bc8c169c1b66a2d6bd7ad3494 | [
"Apache-2.0"
] | null | null | null | web_audio/helpers.py | SaxAlien/crap-code | bff99bc4501d1c7bc8c169c1b66a2d6bd7ad3494 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Crap class
but make code more compact. lmao
WARNING! WARNING!
HIGH CONCENTRATION OF SHIT!
and in future here will be adding more and more methods and classes
but i'm not shure
"""
import os
def success(message):
return '<div class="alert... | 25.731707 | 98 | 0.611374 |
import os
def success(message):
return '<div class="alert alert-success alert-dismissable">' \
'<button type="button" class="close" data-dismiss="alert">×</button>' \
'{}</div>'.format(message)
def warning(message):
return '<div class="alert alert-danger alert-dismissable">' \... | true | true |
f725541a544124a0f547895b485bcf1f5d21572b | 1,467 | py | Python | problems/pctsp/salesman/pctsp/application.py | AYaddaden/attention-learn-to-route | 74c2d6533d9e0faae80fa85f6bee2df2142708ba | [
"MIT"
] | 540 | 2019-02-07T13:52:30.000Z | 2022-03-31T12:51:46.000Z | problems/pctsp/salesman/pctsp/application.py | AYaddaden/attention-learn-to-route | 74c2d6533d9e0faae80fa85f6bee2df2142708ba | [
"MIT"
] | 40 | 2019-02-06T17:57:11.000Z | 2022-03-18T12:18:48.000Z | problems/pctsp/salesman/pctsp/application.py | AYaddaden/attention-learn-to-route | 74c2d6533d9e0faae80fa85f6bee2df2142708ba | [
"MIT"
] | 227 | 2019-02-15T09:25:02.000Z | 2022-03-27T10:42:21.000Z | # module application.py
#
# Copyright (c) 2015 Rafael Reis
#
"""
application module - Main module that solves the Prize Collecting Travelling Salesman Problem
"""
from pctsp.model.pctsp import *
from pctsp.model import solution
from pctsp.algo.genius import genius
from pctsp.algo import ilocal_search as ils
from pkg_... | 24.04918 | 93 | 0.652352 |
from pctsp.model.pctsp import *
from pctsp.model import solution
from pctsp.algo.genius import genius
from pctsp.algo import ilocal_search as ils
from pkg_resources import resource_filename
import random
INPUT_INSTANCE_FILE = resource_filename('pctsp', 'data/problem_20_100_100_1000.pctsp')
def solve_instance(fil... | true | true |
f72555b7e4d80fd6f6a428c1e413cc4fa2ac3266 | 5,723 | py | Python | azure-batch/azure/batch/models/cloud_job_schedule.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-batch/azure/batch/models/cloud_job_schedule.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-batch/azure/batch/models/cloud_job_schedule.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 52.990741 | 298 | 0.687227 |
from msrest.serialization import Model
class CloudJobSchedule(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'url': {'key': 'url', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'la... | true | true |
f725565a4176de2b5beb230d5de6c67dc05f4158 | 4,574 | py | Python | troposphere/iotwireless.py | vasinov/troposphere | db117248dfb0fc500ae9d10db34c42608240bb8d | [
"BSD-2-Clause"
] | null | null | null | troposphere/iotwireless.py | vasinov/troposphere | db117248dfb0fc500ae9d10db34c42608240bb8d | [
"BSD-2-Clause"
] | null | null | null | troposphere/iotwireless.py | vasinov/troposphere | db117248dfb0fc500ae9d10db34c42608240bb8d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import boolean, integer... | 25.131868 | 55 | 0.566463 |
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import boolean, integer
class Destination(AWSObject):
resource_type = "AWS::IoTWireless::Destination"
props = {
"Description": (str, False),
"Expression": (str, True),
"ExpressionType": (str, ... | true | true |
f7255693150e9fa60c4098be227a094b573e4ddb | 2,130 | py | Python | tests/test_http.py | flome/uproot | eb2ae1ffe6fb2c2ce8cb7cbdc0919d5b51c0ff0f | [
"BSD-3-Clause"
] | null | null | null | tests/test_http.py | flome/uproot | eb2ae1ffe6fb2c2ce8cb7cbdc0919d5b51c0ff0f | [
"BSD-3-Clause"
] | null | null | null | tests/test_http.py | flome/uproot | eb2ae1ffe6fb2c2ce8cb7cbdc0919d5b51c0ff0f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot/blob/master/LICENSE
import pytest
import mock
HTTPError = pytest.importorskip('requests.exceptions').HTTPError
import uproot
FILE = "foriter"
LOCAL = "tests/samples/{FILE}.root".format(FILE=FILE)
URL = "http://scikit-hep.org/upro... | 34.354839 | 86 | 0.643662 |
import pytest
import mock
HTTPError = pytest.importorskip('requests.exceptions').HTTPError
import uproot
FILE = "foriter"
LOCAL = "tests/samples/{FILE}.root".format(FILE=FILE)
URL = "http://scikit-hep.org/uproot/examples/{FILE}.root".format(FILE=FILE)
URL_AUTH = "http://scikit-hep.org/uproot/authentication/{FILE}... | true | true |
f72557569101118345344ad6a9f06be139d1e4a8 | 424 | py | Python | core/migrations/0036_alter_event_submission_type.py | saggins/lynbrook-app-backend | d5bad6e0742853bb39c5a15d3b7332b7114b671d | [
"MIT"
] | null | null | null | core/migrations/0036_alter_event_submission_type.py | saggins/lynbrook-app-backend | d5bad6e0742853bb39c5a15d3b7332b7114b671d | [
"MIT"
] | 1 | 2022-02-17T07:01:51.000Z | 2022-02-17T07:01:51.000Z | core/migrations/0036_alter_event_submission_type.py | saggins/lynbrook-app-backend | d5bad6e0742853bb39c5a15d3b7332b7114b671d | [
"MIT"
] | 1 | 2022-02-17T05:16:58.000Z | 2022-02-17T05:16:58.000Z | # Generated by Django 3.2.5 on 2021-08-27 09:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0035_alter_event_code'),
]
operations = [
migrations.AlterField(
model_name='event',
name='submission_type',... | 22.315789 | 85 | 0.589623 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0035_alter_event_code'),
]
operations = [
migrations.AlterField(
model_name='event',
name='submission_type',
field=models.IntegerField(choices=... | true | true |
f7255769c302384481f7ccaa713331893763eddb | 2,983 | py | Python | core/brain/dialog.py | vsilent/smarty-bot | 963cba05433be14494ba339343c9903ccab3c37d | [
"MIT"
] | 1 | 2016-10-08T09:01:05.000Z | 2016-10-08T09:01:05.000Z | core/brain/dialog.py | vsilent/smarty-bot | 963cba05433be14494ba339343c9903ccab3c37d | [
"MIT"
] | 1 | 2019-09-24T09:56:52.000Z | 2019-09-24T09:56:52.000Z | core/brain/dialog.py | vsilent/smarty-bot | 963cba05433be14494ba339343c9903ccab3c37d | [
"MIT"
] | null | null | null | def start_dialog(text):
if text is None:
text = recognize_by_google()
if text is None:
return
logging.debug( "You said: " + text )
c = Confirm(text)
state = c.get_state( sentence=text )
logging.debug(type(state))
logging.debug(state)
if(( state == 0) or (state ... | 35.511905 | 153 | 0.584982 | def start_dialog(text):
if text is None:
text = recognize_by_google()
if text is None:
return
logging.debug( "You said: " + text )
c = Confirm(text)
state = c.get_state( sentence=text )
logging.debug(type(state))
logging.debug(state)
if(( state == 0) or (state ... | true | true |
f72558e0ae0df4436c838a4cc5685909f6d3e117 | 711 | py | Python | distribute_repo.py | ewhitesides/pulp_operations | b6a3541559e48c717926b245bbbf2dd87638e093 | [
"MIT"
] | null | null | null | distribute_repo.py | ewhitesides/pulp_operations | b6a3541559e48c717926b245bbbf2dd87638e093 | [
"MIT"
] | 1 | 2021-06-17T04:35:05.000Z | 2021-06-17T04:35:05.000Z | distribute_repo.py | ewhitesides/pulp_operations | b6a3541559e48c717926b245bbbf2dd87638e093 | [
"MIT"
] | null | null | null | """
script to distribute repos from repo_data.py
"""
import urllib3
import pulp_operations
from repo_data import repo_data
#disable ssl warnings for now
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#release latest version of the repo to distribution 'latest'
for os in repo_data:
for repo i... | 28.44 | 68 | 0.729958 |
import urllib3
import pulp_operations
from repo_data import repo_data
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
for os in repo_data:
for repo in repo_data[os]:
repo_name = f"{os}-{repo}"
dist_name = f"{repo_name}-latest"
pulp_operations.release(repo_name, 0, di... | true | true |
f72558ec957eca8761389e372a0381b0b817ae58 | 21,798 | py | Python | Old/hoop_detection_angle.py | multirotorsociety/SAFMC-19-D2-Autonomous-Drone | fd9f0fae5d7cbf618b327224e06a7f459612b4ca | [
"MIT"
] | 6 | 2019-04-01T02:38:40.000Z | 2021-06-05T18:23:06.000Z | Old/hoop_detection_angle.py | multirotorsociety/SAFMC-19-D2-Autonomous-Drone | fd9f0fae5d7cbf618b327224e06a7f459612b4ca | [
"MIT"
] | null | null | null | Old/hoop_detection_angle.py | multirotorsociety/SAFMC-19-D2-Autonomous-Drone | fd9f0fae5d7cbf618b327224e06a7f459612b4ca | [
"MIT"
] | 1 | 2019-09-01T08:58:28.000Z | 2019-09-01T08:58:28.000Z | from __future__ import print_function
import time
import math
import thread
# Dk imports
from pymavlink import mavutil
from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative
# Mux and TOF imports
import I2CMultiplexer
import VL53L1X
# CV imports
import cv2
import numpy as np
from picamer... | 34.6 | 206 | 0.65006 | from __future__ import print_function
import time
import math
import thread
from pymavlink import mavutil
from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative
import I2CMultiplexer
import VL53L1X
import cv2
import numpy as np
from picamera.array import PiRGBArray
from picamera impor... | true | true |
f7255a8df81f50ed5c1b02a6f21936c3d0283313 | 449 | py | Python | msg/urls_api.py | paul-wolf/django-stack | 7b45b3087659e15d936182b15ba6b07c14549584 | [
"MIT"
] | null | null | null | msg/urls_api.py | paul-wolf/django-stack | 7b45b3087659e15d936182b15ba6b07c14549584 | [
"MIT"
] | null | null | null | msg/urls_api.py | paul-wolf/django-stack | 7b45b3087659e15d936182b15ba6b07c14549584 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include, patterns
from rest_framework import routers
from . import views
# this gets our Foo model routed
router = routers.DefaultRouter()
router.register(r'foo', views.FooViewSet)
urlpatterns = patterns(
'',
url(r'^', include(router.urls)), # Foo REST urls
url(r'^api-a... | 24.944444 | 87 | 0.674833 | from django.conf.urls import url, include, patterns
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'foo', views.FooViewSet)
urlpatterns = patterns(
'',
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls',
... | true | true |
f7255b2ec1f0592cd0f12cd48061fd80b46db0c4 | 1,544 | py | Python | src/socialhand/forms.py | GonzaloAvilez/site | 10866c826fa0df89f7f25e7392fd0fc8e395f54d | [
"MIT"
] | null | null | null | src/socialhand/forms.py | GonzaloAvilez/site | 10866c826fa0df89f7f25e7392fd0fc8e395f54d | [
"MIT"
] | 12 | 2019-10-02T17:18:09.000Z | 2022-03-11T23:54:53.000Z | src/socialhand/forms.py | GonzaloAvilez/site | 10866c826fa0df89f7f25e7392fd0fc8e395f54d | [
"MIT"
] | null | null | null | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field, Fieldset
from crispy_forms.bootstrap import InlineField
class ContactForm(forms.Form):
subject = forms.CharField (required... | 33.565217 | 90 | 0.654793 | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field, Fieldset
from crispy_forms.bootstrap import InlineField
class ContactForm(forms.Form):
subject = forms.CharField (required... | true | true |
f7255b8e53122ef5294b9fbb88a6f9fa7e69aa5f | 12,799 | py | Python | python_packages_static/flopy/mf6/modflow/mfgwtsrc.py | usgs/neversink_workflow | acd61435b8553e38d4a903c8cd7a3afc612446f9 | [
"CC0-1.0"
] | null | null | null | python_packages_static/flopy/mf6/modflow/mfgwtsrc.py | usgs/neversink_workflow | acd61435b8553e38d4a903c8cd7a3afc612446f9 | [
"CC0-1.0"
] | null | null | null | python_packages_static/flopy/mf6/modflow/mfgwtsrc.py | usgs/neversink_workflow | acd61435b8553e38d4a903c8cd7a3afc612446f9 | [
"CC0-1.0"
] | null | null | null | # DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY
# mf6/utils/createpackages.py
# FILE created on February 18, 2021 16:23:05 UTC
from .. import mfpackage
from ..data.mfdatautil import ListTemplateGenerator
class ModflowGwtsrc(mfpackage.MFPackage):
"""
ModflowGwtsrc defines a src package within... | 36.464387 | 79 | 0.57067 |
from .. import mfpackage
from ..data.mfdatautil import ListTemplateGenerator
class ModflowGwtsrc(mfpackage.MFPackage):
auxiliary = ListTemplateGenerator(("gwt6", "src", "options", "auxiliary"))
ts_filerecord = ListTemplateGenerator(
("gwt6", "src", "options", "ts_filerecord")
)
obs_filerec... | true | true |
f7255db587da3c1bac8640b99f5f51ab4e48fd2b | 1,492 | py | Python | hmm/scripts/easy_casino_learn.py | ondrejba/hmm | 1e9fe47a6057d93e7c77614016a89d5d46959e97 | [
"MIT"
] | null | null | null | hmm/scripts/easy_casino_learn.py | ondrejba/hmm | 1e9fe47a6057d93e7c77614016a89d5d46959e97 | [
"MIT"
] | null | null | null | hmm/scripts/easy_casino_learn.py | ondrejba/hmm | 1e9fe47a6057d93e7c77614016a89d5d46959e97 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from ..easy_casino import Casino
from ..hmm_multinoulli import HMMMultinoulli
hmm = HMMMultinoulli(Casino.A, Casino.PX, Casino.INIT)
# generate sequence
seq_length = 300
batch_size = 500
xs_batch = []
zs_batch = []
for j in range(batch_size):
casino = Casino()... | 20.438356 | 77 | 0.678954 | import numpy as np
import matplotlib.pyplot as plt
from ..easy_casino import Casino
from ..hmm_multinoulli import HMMMultinoulli
hmm = HMMMultinoulli(Casino.A, Casino.PX, Casino.INIT)
seq_length = 300
batch_size = 500
xs_batch = []
zs_batch = []
for j in range(batch_size):
casino = Casino()
xs = [casino.... | true | true |
f7255dc9372185d8116fca049ef881d946cb5401 | 5,629 | py | Python | test/functional/mempool_persist.py | HunterCanimun/surgeofficial-surge-coin | 663dc25517e9045a65a9b1e0993bbaa06d564284 | [
"MIT"
] | null | null | null | test/functional/mempool_persist.py | HunterCanimun/surgeofficial-surge-coin | 663dc25517e9045a65a9b1e0993bbaa06d564284 | [
"MIT"
] | null | null | null | test/functional/mempool_persist.py | HunterCanimun/surgeofficial-surge-coin | 663dc25517e9045a65a9b1e0993bbaa06d564284 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on st... | 45.764228 | 127 | 0.693907 |
from decimal import Decimal
import os
from test_framework.test_framework import SurgeTestFramework
from test_framework.util import (
assert_equal,
wait_until,
)
class MempoolPersistTest(SurgeTestFramework):
def set_test_params(self):
self.num_nodes = 3
self.extra_args = [[], ["-persis... | true | true |
f7256127fb8bcd69a2e2866490517a48fb8fa051 | 2,814 | py | Python | examples/00-basic-examples/Create_Netlist.py | sparfenyuk/PyAEDT | efe8d219be974fa8a164d84ca9bc5c0e1b32256c | [
"MIT"
] | null | null | null | examples/00-basic-examples/Create_Netlist.py | sparfenyuk/PyAEDT | efe8d219be974fa8a164d84ca9bc5c0e1b32256c | [
"MIT"
] | null | null | null | examples/00-basic-examples/Create_Netlist.py | sparfenyuk/PyAEDT | efe8d219be974fa8a164d84ca9bc5c0e1b32256c | [
"MIT"
] | null | null | null | """
Netlist Example Analysis
--------------------------------------------
# This Example shows how to Import Netlist in AEDT Nexxim
Netlists supported are HSPICE and, partially, Mentor
"""
import sys
import os
#########################################################
# Import Packages
# Setup The local path to the... | 25.125 | 134 | 0.542644 |
import sys
import os
| true | true |
f725615748650d8ad2045fa8fddd4a9cd2da6c74 | 2,799 | py | Python | torch/fx/experimental/unification/utils.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | torch/fx/experimental/unification/utils.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | torch/fx/experimental/unification/utils.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | def hashable(x):
try:
hash(x)
return True
except TypeError:
return False
def transitive_get(key, d):
""" Transitive dict.get
>>> d = {1: 2, 2: 3, 3: 4}
>>> d.get(1)
2
>>> transitive_get(1, d)
4
"""
while hashable(key) and key in d:
key = d[key]
... | 26.913462 | 77 | 0.568775 | def hashable(x):
try:
hash(x)
return True
except TypeError:
return False
def transitive_get(key, d):
while hashable(key) and key in d:
key = d[key]
return key
def raises(err, lamda):
try:
lamda()
return False
except err:
return True
... | true | true |
f725615e2782bb4b02f5432ef2200adf2c96f1c1 | 1,971 | py | Python | dpaycli/instance.py | dpays/dpay-cli | dfa80898e1faea2cee92ebec6fe04873381bd40f | [
"MIT"
] | null | null | null | dpaycli/instance.py | dpays/dpay-cli | dfa80898e1faea2cee92ebec6fe04873381bd40f | [
"MIT"
] | null | null | null | dpaycli/instance.py | dpays/dpay-cli | dfa80898e1faea2cee92ebec6fe04873381bd40f | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
import dpaycli as stm
class SharedInstance(object):
"""Singelton for the DPay Insta... | 29.863636 | 80 | 0.702689 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
import dpaycli as stm
class SharedInstance(object):
instance = None
config = {}
def shared_dpay_instance():
if not SharedInsta... | true | true |
f72562f7f2fd98b8968e23cb2d33be250c5fd8dd | 8,348 | py | Python | script/hassfest/requirements.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 1 | 2020-10-01T13:36:50.000Z | 2020-10-01T13:36:50.000Z | script/hassfest/requirements.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 69 | 2020-08-04T09:03:43.000Z | 2022-03-31T06:13:01.000Z | script/hassfest/requirements.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 1 | 2020-10-26T10:44:32.000Z | 2020-10-26T10:44:32.000Z | """Validate requirements."""
from __future__ import annotations
from collections import deque
import json
import operator
import os
import re
import subprocess
import sys
from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
from stdlib_list import stdlib_list
from tqdm import tqdm
from homeassistant.con... | 28.298305 | 94 | 0.622185 | from __future__ import annotations
from collections import deque
import json
import operator
import os
import re
import subprocess
import sys
from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
from stdlib_list import stdlib_list
from tqdm import tqdm
from homeassistant.const import REQUIRED_PYTHON_VER... | true | true |
f72563ebf144b5c4ed5d91972f5d809a8a4c52e3 | 2,010 | py | Python | a02_zapatamezaj.py | 2019-fall-csc-226/a02-loopy-turtles-loopy-languages-zapatamezaj-a02 | 0a390e93a2f32ce7dbaaf963e660e1f98fd5741c | [
"MIT"
] | null | null | null | a02_zapatamezaj.py | 2019-fall-csc-226/a02-loopy-turtles-loopy-languages-zapatamezaj-a02 | 0a390e93a2f32ce7dbaaf963e660e1f98fd5741c | [
"MIT"
] | null | null | null | a02_zapatamezaj.py | 2019-fall-csc-226/a02-loopy-turtles-loopy-languages-zapatamezaj-a02 | 0a390e93a2f32ce7dbaaf963e660e1f98fd5741c | [
"MIT"
] | null | null | null | ######################################################################
# Author: Jose Zapata Meza
# Username: zapatamezaj
# Assignment: A02: Loopy Turtle, Loopy Languages
# Purpose: Practice using the turtle library and loops
######################################################################
# Acknowledgements:
#... | 21.157895 | 75 | 0.653234 | true | true | |
f72563f0c25147eb28eb5f134aa0a5390efffad7 | 11,449 | py | Python | client_code/Slider/__init__.py | hugetim/anvil-extras | ca83f6ada5149514c2affbe1ab081a4ca677c7e0 | [
"MIT"
] | null | null | null | client_code/Slider/__init__.py | hugetim/anvil-extras | ca83f6ada5149514c2affbe1ab081a4ca677c7e0 | [
"MIT"
] | null | null | null | client_code/Slider/__init__.py | hugetim/anvil-extras | ca83f6ada5149514c2affbe1ab081a4ca677c7e0 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
#
# Copyright (c) 2021 The Anvil Extras project team members listed at
# https://github.com/anvilistas/anvil-extras/graphs/contributors
#
# This software is published at https://github.com/anvilistas/anvil-extras
import anvil.js
from anvil import HtmlPanel as _HtmlPanel
from ..utils._co... | 29.507732 | 97 | 0.599354 |
import anvil.js
from anvil import HtmlPanel as _HtmlPanel
from ..utils._component_helpers import _get_color, _html_injector, _spacing_property
from ._anvil_designer import SliderTemplate
__version__ = "1.7.1"
noui_version = "15.4.0"
_html_injector.cdn(
f"https://cdn.jsdelivr.net/npm/nouislider@{noui_vers... | true | true |
f72564206e9156bd00056bf1ef33a09cb7439d94 | 338 | py | Python | server/twitter/migrations/0004_auto_20200822_2202.py | vanviethieuanh/twitter-clone | bac1be8118514ec8ce169eb0c0f4d5658ab2013a | [
"MIT"
] | 1 | 2021-12-29T00:49:51.000Z | 2021-12-29T00:49:51.000Z | server/twitter/migrations/0004_auto_20200822_2202.py | vanviethieuanh/twitter-clone | bac1be8118514ec8ce169eb0c0f4d5658ab2013a | [
"MIT"
] | null | null | null | server/twitter/migrations/0004_auto_20200822_2202.py | vanviethieuanh/twitter-clone | bac1be8118514ec8ce169eb0c0f4d5658ab2013a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-08-22 15:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('twitter', '0003_auto_20200822_2127'),
]
operations = [
migrations.AlterUniqueTogether(
name='follow',
unique_together=set(),... | 18.777778 | 47 | 0.60355 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('twitter', '0003_auto_20200822_2127'),
]
operations = [
migrations.AlterUniqueTogether(
name='follow',
unique_together=set(),
),
]
| true | true |
f72564424a1cdf41e8a72d242dbdc9892b53b527 | 3,217 | py | Python | model/snl_block.py | ustbjdl1021/improved_snl_unet | 7f7bf092153e1a535337b80bd1b673eff3ddec52 | [
"MIT"
] | null | null | null | model/snl_block.py | ustbjdl1021/improved_snl_unet | 7f7bf092153e1a535337b80bd1b673eff3ddec52 | [
"MIT"
] | 2 | 2022-03-30T13:05:27.000Z | 2022-03-31T13:43:22.000Z | model/snl_block.py | ustbjdl1021/improved_snl_unet | 7f7bf092153e1a535337b80bd1b673eff3ddec52 | [
"MIT"
] | 1 | 2022-03-31T13:33:30.000Z | 2022-03-31T13:33:30.000Z | import torch
import torch.nn as nn
class ImprovedSNL(nn.Module):
def __init__(self, in_channels, transfer_channels, stage_num=2):
super(ImprovedSNL, self).__init__()
self.in_channels = in_channels
self.transfer_channels = transfer_channels
self.stage_num = stage_num
... | 36.556818 | 111 | 0.587193 | import torch
import torch.nn as nn
class ImprovedSNL(nn.Module):
def __init__(self, in_channels, transfer_channels, stage_num=2):
super(ImprovedSNL, self).__init__()
self.in_channels = in_channels
self.transfer_channels = transfer_channels
self.stage_num = stage_num
... | true | true |
f72565ec076f5d92978bba872dc9b48d63e0a69e | 10,084 | py | Python | regym/rl_algorithms/algorithms/PPO/rnd_loss.py | KnwSondess/Regym | 825c7dacf955a3e2f6c658c0ecb879a0ca036c1a | [
"MIT"
] | 2 | 2020-09-13T15:53:20.000Z | 2020-12-08T15:57:05.000Z | regym/rl_algorithms/algorithms/PPO/rnd_loss.py | KnwSondess/Regym | 825c7dacf955a3e2f6c658c0ecb879a0ca036c1a | [
"MIT"
] | null | null | null | regym/rl_algorithms/algorithms/PPO/rnd_loss.py | KnwSondess/Regym | 825c7dacf955a3e2f6c658c0ecb879a0ca036c1a | [
"MIT"
] | 1 | 2021-09-20T13:48:30.000Z | 2021-09-20T13:48:30.000Z | from typing import Dict, List
import torch
import torch.nn.functional as F
def compute_loss(states: torch.Tensor,
actions: torch.Tensor,
next_states: torch.Tensor,
log_probs_old: torch.Tensor,
ext_returns: torch.Tensor,
ext_advant... | 61.865031 | 139 | 0.673344 | from typing import Dict, List
import torch
import torch.nn.functional as F
def compute_loss(states: torch.Tensor,
actions: torch.Tensor,
next_states: torch.Tensor,
log_probs_old: torch.Tensor,
ext_returns: torch.Tensor,
ext_advant... | true | true |
f725663a96725554f28f77d984f7989ab3fbe8af | 4,939 | py | Python | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/cluster_cert.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/cluster_cert.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/cluster_cert.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ClusterCert:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is att... | 29.224852 | 100 | 0.606803 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ClusterCert:
sensitive_list = []
openapi_types = {
'server': 'str',
'certificate_authority_data': 'str',
'insecure_skip_tls_verify': 'bool'
}
attribute_map = {
... | true | true |
f7256728eb65c78928992820c0d53c79800f694d | 483 | py | Python | app/api/migrations/0002_auto_20210201_1602.py | ingjavierpinilla/magentrack-test | 4b5ee34aafbe85c4f536ceafd5efdc9271a26008 | [
"MIT"
] | null | null | null | app/api/migrations/0002_auto_20210201_1602.py | ingjavierpinilla/magentrack-test | 4b5ee34aafbe85c4f536ceafd5efdc9271a26008 | [
"MIT"
] | null | null | null | app/api/migrations/0002_auto_20210201_1602.py | ingjavierpinilla/magentrack-test | 4b5ee34aafbe85c4f536ceafd5efdc9271a26008 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-01 16:02
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name=... | 23 | 109 | 0.625259 |
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='dataset',
name='date',
... | true | true |
f72568c0fee6e2b462e73799b21aa117bda8f7a5 | 1,562 | py | Python | sdk/python/pulumi_azure_native/management/v20200501/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/management/v20200501/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/management/v20200501/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .get_entity import *
from .get_hierarchy_setting import *
from .get_management_group import *
from .ge... | 37.190476 | 101 | 0.707426 |
# Export this package's modules as members:
from .get_entity import *
from .get_hierarchy_setting import *
from .get_management_group import *
from .get_management_group_subscription import *
from .hierarchy_setting import *
from .management_group import *
from .management_group_subscription import *
from ._inputs ... | true | true |
f72569012f6a31830be2670b47bccbad2cee3f8e | 4,367 | py | Python | vimms_gym/viewer_helper.py | glasgowcompbio/vimms-gym | 95cb6fa84ee6e3a64618b7a2a54c3835ad0d7867 | [
"MIT"
] | null | null | null | vimms_gym/viewer_helper.py | glasgowcompbio/vimms-gym | 95cb6fa84ee6e3a64618b7a2a54c3835ad0d7867 | [
"MIT"
] | null | null | null | vimms_gym/viewer_helper.py | glasgowcompbio/vimms-gym | 95cb6fa84ee6e3a64618b7a2a54c3835ad0d7867 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import streamlit as st
from stable_baselines3 import PPO
from vimms.ChemicalSamplers import UniformRTAndIntensitySampler, GaussianChromatogramSampler, \
UniformMZFormulaSampler
from vimms.Common import POSITIVE
from vimms_gym.common import METHOD_PPO, METHOD_TOPN
sys.path.... | 30.971631 | 95 | 0.615068 | import os
import sys
import numpy as np
import streamlit as st
from stable_baselines3 import PPO
from vimms.ChemicalSamplers import UniformRTAndIntensitySampler, GaussianChromatogramSampler, \
UniformMZFormulaSampler
from vimms.Common import POSITIVE
from vimms_gym.common import METHOD_PPO, METHOD_TOPN
sys.path.... | true | true |
f7256a59d601a2c803274ba2986fc1dd01ff4e55 | 5,081 | py | Python | samples/add_nic_to_vm.py | jm66/pyvmomi-community-samples | 5ca4a50b767500e07b9bce9fba70240bfa963a4e | [
"Apache-2.0"
] | 4 | 2019-05-27T23:36:34.000Z | 2020-11-12T17:08:04.000Z | samples/add_nic_to_vm.py | zhangjiahaol/pyvmomi-community-samples | 905ec34edfbd151531832e98b6a0748fa6ff5e0e | [
"Apache-2.0"
] | 12 | 2019-04-17T02:47:25.000Z | 2021-04-02T09:15:37.000Z | samples/add_nic_to_vm.py | zhangjiahaol/pyvmomi-community-samples | 905ec34edfbd151531832e98b6a0748fa6ff5e0e | [
"Apache-2.0"
] | 15 | 2018-04-26T05:18:12.000Z | 2021-11-06T04:44:58.000Z | #!/usr/bin/env python
"""
Written by nickcooper-zhangtonghao
Github: https://github.com/nickcooper-zhangtonghao
Email: nickcooper-zhangtonghao@opencloud.tech
Note: Example code For testing purposes only
This code has been released under the terms of the Apache-2.0 license
http://opensource.org/licenses/Apache-2.0
"""... | 30.244048 | 75 | 0.605196 |
from pyVmomi import vim
from pyVmomi import vmodl
from tools import tasks
from pyVim.connect import SmartConnect, SmartConnectNoSSL, Disconnect
import atexit
import argparse
import getpass
def get_args():
parser = argparse.ArgumentParser(
description='Arguments for talking to vCenter')
parser.add_ar... | true | true |
f7256ae570b6c12768a5d1a994314b4d86c179d6 | 894 | py | Python | modules/signatures/windows/antiav_srp.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 24 | 2021-06-21T07:35:37.000Z | 2022-03-22T03:33:59.000Z | modules/signatures/windows/antiav_srp.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 3 | 2021-07-01T08:09:05.000Z | 2022-01-28T03:38:36.000Z | modules/signatures/windows/antiav_srp.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 6 | 2021-06-22T05:32:57.000Z | 2022-02-11T02:05:45.000Z | # Copyright (C) 2014 Optiv, Inc. (brad.spengler@optiv.com), Updated 2016 for cuckoo 2.0
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class AntiAVSRP(Signature):
name = "antiav_srp"
d... | 34.384615 | 110 | 0.651007 |
from lib.cuckoo.common.abstracts import Signature
class AntiAVSRP(Signature):
name = "antiav_srp"
description = "Modifies Software Restriction Policies likely to cripple AV"
severity = 3
categories = ["anti-av"]
authors = ["Optiv"]
minimum = "2.0"
ttp = ["T1089"]
regkeys_re = [
... | true | true |
f7256b2ee02db620d84d3addaae0bc4e05297053 | 1,900 | py | Python | 06_Transformacoes_do_Conjunto_de_Dados/6.6_Projecao_Aleatoria/6.6.1._O_Lema_de_Johnson-Lindenstrauss.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | 06_Transformacoes_do_Conjunto_de_Dados/6.6_Projecao_Aleatoria/6.6.1._O_Lema_de_Johnson-Lindenstrauss.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | 06_Transformacoes_do_Conjunto_de_Dados/6.6_Projecao_Aleatoria/6.6.1._O_Lema_de_Johnson-Lindenstrauss.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | ########## 6.6.1. O lema de Johnson-Lindenstrauss ##########
# O principal resultado teórico por trás da eficiência da projeção aleatória é o lema de Johnson-Lindenstrauss (citando a Wikipedia):
# Em matemática, o lema de Johnson-Lindenstrauss é um resultado sobre embeddings de baixa distorção de pontos de ... | 52.777778 | 493 | 0.792105 | true | true | |
f7256c0b18316e9401a8678074fb2dce8d2668b5 | 2,659 | py | Python | ddsp/training/preprocessing.py | jesseengel/ddsp | de195af0a21fba52e6b88c23886c244d8607e49c | [
"Apache-2.0"
] | 7 | 2020-01-18T13:12:52.000Z | 2021-06-24T20:32:19.000Z | ddsp/training/preprocessing.py | jesseengel/ddsp | de195af0a21fba52e6b88c23886c244d8607e49c | [
"Apache-2.0"
] | null | null | null | ddsp/training/preprocessing.py | jesseengel/ddsp | de195af0a21fba52e6b88c23886c244d8607e49c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 32.426829 | 80 | 0.699511 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import ddsp
import gin
import tensorflow.compat.v1 as tf
hz_to_midi = ddsp.core.hz_to_midi
F0_RANGE = ddsp.spectral_ops.F0_RANGE
LD_RANGE = ddsp.spectral_ops.LD_RANGE
def at_leas... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.