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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1f9e5180b90e9fe78c88e2eca412a8c6f01fee | 1,979 | py | Python | bk_monitor/utils/metric.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 75 | 2021-07-14T09:32:36.000Z | 2022-03-31T15:26:53.000Z | bk_monitor/utils/metric.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 561 | 2021-07-14T07:45:47.000Z | 2022-03-31T11:41:28.000Z | bk_monitor/utils/metric.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 41 | 2021-07-14T07:39:50.000Z | 2022-03-25T09:22:18.000Z | # -*- coding: utf-8 -*-
from functools import wraps
from django.conf import settings
from bk_monitor.constants import TimeFilterEnum
REGISTERED_METRICS = []
def register_metric(namespace, data_name, description="", time_filter=TimeFilterEnum.MINUTE1):
"""
注册对应metric
"""
def wrapped_view(func):
... | 27.873239 | 94 | 0.579586 |
from functools import wraps
from django.conf import settings
from bk_monitor.constants import TimeFilterEnum
REGISTERED_METRICS = []
def register_metric(namespace, data_name, description="", time_filter=TimeFilterEnum.MINUTE1):
def wrapped_view(func):
def _wrapped_view(*args, **kwargs):
r... | true | true |
1c1f9ecb65f407462f235a57e9c3ba2856aa45a5 | 450 | py | Python | resource.py | Drumstickz64/flappy-bird-clone | d0d9e2eaf2e6b5cfaf955b0410e044fc215d228d | [
"MIT"
] | null | null | null | resource.py | Drumstickz64/flappy-bird-clone | d0d9e2eaf2e6b5cfaf955b0410e044fc215d228d | [
"MIT"
] | null | null | null | resource.py | Drumstickz64/flappy-bird-clone | d0d9e2eaf2e6b5cfaf955b0410e044fc215d228d | [
"MIT"
] | null | null | null | import pygame as pg
import os, platform
SOUND_FILE_EXT = ".wav" if platform.system() == "Windows" else ".ogg"
def load_sprite(sprite):
return pg.image.load(os.path.join("assets", "sprites", sprite)).convert_alpha()
def load_sound(sound_name):
return pg.mixer.Sound(os.path.join("assets", "audio", sound... | 26.470588 | 87 | 0.686667 | import pygame as pg
import os, platform
SOUND_FILE_EXT = ".wav" if platform.system() == "Windows" else ".ogg"
def load_sprite(sprite):
return pg.image.load(os.path.join("assets", "sprites", sprite)).convert_alpha()
def load_sound(sound_name):
return pg.mixer.Sound(os.path.join("assets", "audio", sound... | true | true |
1c1fa075921e641ffa1f0728bedb8bb1ff52cb87 | 1,345 | py | Python | news/handle.py | DreamCloudWalker/MySimpleServers | ca835a6e67c655044878930b6fcd8483ae7f16ae | [
"MIT"
] | null | null | null | news/handle.py | DreamCloudWalker/MySimpleServers | ca835a6e67c655044878930b6fcd8483ae7f16ae | [
"MIT"
] | null | null | null | news/handle.py | DreamCloudWalker/MySimpleServers | ca835a6e67c655044878930b6fcd8483ae7f16ae | [
"MIT"
] | null | null | null | import newspaper # need pip install newspaper3k in python3.x env
import web # need: pip install web.py
import json
def get_html(url):
return newspaper.build(url, language='zh')
def get_data(content):
result = {"reason": "success"}
newsresult = {"stat": "1"}
data = []
for article in content.ar... | 25.377358 | 68 | 0.553903 | import newspaper
import web
import json
def get_html(url):
return newspaper.build(url, language='zh')
def get_data(content):
result = {"reason": "success"}
newsresult = {"stat": "1"}
data = []
for article in content.articles:
news = {}
try:
article.download()
... | true | true |
1c1fa1b529c6de31111dba9a45b011a8701b3d7c | 14,841 | py | Python | tests/core/full_node/test_coin_store.py | Ecostake-Network/ecostake-blockchain | 8ea8bb9743c7caccb2f8c670853d93ee12d00c86 | [
"Apache-2.0"
] | 2 | 2022-03-29T23:36:29.000Z | 2022-03-30T04:18:42.000Z | tests/core/full_node/test_coin_store.py | Ecostake-Network/ecostake-blockchain | 8ea8bb9743c7caccb2f8c670853d93ee12d00c86 | [
"Apache-2.0"
] | 11 | 2022-03-31T06:30:52.000Z | 2022-03-31T17:02:45.000Z | tests/core/full_node/test_coin_store.py | Ecostake-Network/ecostake-blockchain | 8ea8bb9743c7caccb2f8c670853d93ee12d00c86 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
from typing import List, Optional, Set, Tuple
import pytest
from ecostake.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from ecostake.consensus.blockchain import Blockchain, ReceiveBlockResult
from ecostake.consensus.coinbase import create_farmer_coin... | 44.567568 | 120 | 0.573546 | import asyncio
import logging
from typing import List, Optional, Set, Tuple
import pytest
from ecostake.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from ecostake.consensus.blockchain import Blockchain, ReceiveBlockResult
from ecostake.consensus.coinbase import create_farmer_coin... | true | true |
1c1fa1dd4a33bcf971eb9829c20b51674b5890fa | 361 | py | Python | jsython/utils.py | szopu/jsython | 37c21c4fb2bef63756a455581a4c9a232d7d7b44 | [
"MIT"
] | 1 | 2016-04-02T00:58:06.000Z | 2016-04-02T00:58:06.000Z | jsython/utils.py | szopu/jsython | 37c21c4fb2bef63756a455581a4c9a232d7d7b44 | [
"MIT"
] | null | null | null | jsython/utils.py | szopu/jsython | 37c21c4fb2bef63756a455581a4c9a232d7d7b44 | [
"MIT"
] | null | null | null | def yield_join(sep, iterable, yielder):
notfirst = False
for elem in iterable:
if notfirst:
yield sep
else:
notfirst = True
yield from yielder(elem)
def transpile_join(sep, iterable, info):
def yielder(elem):
yield from elem.transpile(info)
yield... | 24.066667 | 49 | 0.620499 | def yield_join(sep, iterable, yielder):
notfirst = False
for elem in iterable:
if notfirst:
yield sep
else:
notfirst = True
yield from yielder(elem)
def transpile_join(sep, iterable, info):
def yielder(elem):
yield from elem.transpile(info)
yield... | true | true |
1c1fa346d79b1bccbd70402b596d2deb6b4107ed | 6,775 | py | Python | tests/test_overleaf.py | katiebreivik/showyourwork | 77a15de6778e14c3a3936e86e181539cc31cc693 | [
"MIT"
] | null | null | null | tests/test_overleaf.py | katiebreivik/showyourwork | 77a15de6778e14c3a3936e86e181539cc31cc693 | [
"MIT"
] | null | null | null | tests/test_overleaf.py | katiebreivik/showyourwork | 77a15de6778e14c3a3936e86e181539cc31cc693 | [
"MIT"
] | null | null | null | from helpers import (
TemporaryShowyourworkRepository,
ShowyourworkRepositoryActions,
)
from showyourwork import overleaf, exceptions
from showyourwork.config import edit_yaml
from showyourwork.logging import get_logger
from showyourwork.subproc import get_stdout
import time
class TestOverleaf(
TemporaryS... | 37.638889 | 96 | 0.55941 | from helpers import (
TemporaryShowyourworkRepository,
ShowyourworkRepositoryActions,
)
from showyourwork import overleaf, exceptions
from showyourwork.config import edit_yaml
from showyourwork.logging import get_logger
from showyourwork.subproc import get_stdout
import time
class TestOverleaf(
TemporaryS... | true | true |
1c1fa358cf5e40ab5cbb4930c98cca0e3cca0fed | 10,658 | py | Python | tests/test_kernel.py | kennethhuang123/rift-python | f4c208fe39cb14535573708637fa2345c919666b | [
"Apache-2.0"
] | 43 | 2018-07-19T17:41:35.000Z | 2022-03-16T04:04:09.000Z | tests/test_kernel.py | kennethhuang123/rift-python | f4c208fe39cb14535573708637fa2345c919666b | [
"Apache-2.0"
] | 96 | 2018-07-19T11:06:08.000Z | 2021-07-27T10:52:09.000Z | tests/test_kernel.py | kennethhuang123/rift-python | f4c208fe39cb14535573708637fa2345c919666b | [
"Apache-2.0"
] | 29 | 2018-07-24T22:01:20.000Z | 2022-02-13T21:28:18.000Z | import re
from kernel import Kernel
from fib_route import FibRoute
from next_hop import NextHop
from packet_common import add_missing_methods_to_thrift, make_ip_address, make_ip_prefix
# pylint: disable=line-too-long
# pylint: disable=bad-continuation
def test_create_kernel():
_kernel_1 = Kernel(simulated_interf... | 50.752381 | 127 | 0.482267 | import re
from kernel import Kernel
from fib_route import FibRoute
from next_hop import NextHop
from packet_common import add_missing_methods_to_thrift, make_ip_address, make_ip_prefix
def test_create_kernel():
_kernel_1 = Kernel(simulated_interfaces=False, log=None, log_id="", table_name="main")
_kernel_2... | true | true |
1c1fa39914f17e854a661bd370edfda491b3cab5 | 1,800 | py | Python | parser/reader/data.py | cheery/better_web_language | 0700a60af0efe7d7a05364dd4af26bc9fe26332d | [
"MIT"
] | 136 | 2015-12-18T21:11:59.000Z | 2022-02-21T19:47:36.000Z | parser/reader/data.py | cheery/better_web_language | 0700a60af0efe7d7a05364dd4af26bc9fe26332d | [
"MIT"
] | 1 | 2021-05-07T11:17:02.000Z | 2021-05-07T18:15:07.000Z | parser/reader/data.py | cheery/better_web_language | 0700a60af0efe7d7a05364dd4af26bc9fe26332d | [
"MIT"
] | 13 | 2016-03-06T18:27:17.000Z | 2020-06-18T14:27:32.000Z | """
The structures exposed outside
reader module.
"""
class Position(object):
def __init__(self, col, lno):
self.col = col
self.lno = lno
def repr(self):
return u"%d:%d" % (self.lno, self.col)
def eq(self, other):
return self.col == other.col and self.lno == other.l... | 24.657534 | 74 | 0.506111 | class Position(object):
def __init__(self, col, lno):
self.col = col
self.lno = lno
def repr(self):
return u"%d:%d" % (self.lno, self.col)
def eq(self, other):
return self.col == other.col and self.lno == other.lno
def ne(self, other):
return self.col != other.... | true | true |
1c1fa47ea0c3877d8da6acb2e9b278d3b7afc0e9 | 3,273 | py | Python | pipeline/engine/signals/handlers.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 1 | 2020-09-24T07:39:16.000Z | 2020-09-24T07:39:16.000Z | pipeline/engine/signals/handlers.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:46:54.000Z | 2021-06-10T22:54:45.000Z | pipeline/engine/signals/handlers.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 32.73 | 116 | 0.711274 |
from pipeline.engine import tasks
from pipeline.engine.models import ProcessCeleryTask, ScheduleCeleryTask, NodeCeleryTask
def pipeline_ready_handler(sender, process_id, **kwargs):
ProcessCeleryTask.objects.start_task(
process_id=process_id,
start_func=tasks.start.apply_async,
kwargs={
... | true | true |
1c1fa4fcb623d3d8b15bca398f5b7e35d89f13ea | 9,936 | py | Python | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 51.216495 | 122 | 0.687701 |
from msrest import Serializer, Deserializer
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Any, Iterable, Optional
from azure.core.paging import ItemPaged
from azure.core.polling import LROPoller
class MultiapiServiceClientOperationsMixin(object):
def begin_tes... | true | true |
1c1fa52ef2af9bdb1d6018305b319bf18ed5d3e0 | 1,494 | py | Python | python/HOSTU/tun_client_share.py | fongkei320/SeedLab-VPN-Tunneling-Lab | a8ce739291aa06493a66f290f29b0ecd50001b6c | [
"MIT"
] | 1 | 2022-03-29T15:04:50.000Z | 2022-03-29T15:04:50.000Z | python/HOSTU/tun_client_share.py | fongkei320/SeedLab-VPN-Tunneling-Lab | a8ce739291aa06493a66f290f29b0ecd50001b6c | [
"MIT"
] | null | null | null | python/HOSTU/tun_client_share.py | fongkei320/SeedLab-VPN-Tunneling-Lab | a8ce739291aa06493a66f290f29b0ecd50001b6c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import select
import fcntl
import struct
import os
import time
from scapy.all import *
TUNSETIFF = 0x400454ca
IFF_TUN = 0x0001
IFF_TAP = 0x0002
IFF_NO_PI = 0x1000
# Create the tun interface
tun = os.open("/dev/net/tun", os.O_RDWR)
ifr = struct.pack('16sH', b'tun%d', IFF_TUN | IFF_NO_PI)
ifname_bytes... | 27.163636 | 73 | 0.667336 |
import select
import fcntl
import struct
import os
import time
from scapy.all import *
TUNSETIFF = 0x400454ca
IFF_TUN = 0x0001
IFF_TAP = 0x0002
IFF_NO_PI = 0x1000
tun = os.open("/dev/net/tun", os.O_RDWR)
ifr = struct.pack('16sH', b'tun%d', IFF_TUN | IFF_NO_PI)
ifname_bytes = fcntl.ioctl(tun, TUNSETIFF, ifr)
ifname... | true | true |
1c1fa54839d2f3a8d3308adece4d7ea928886347 | 393 | py | Python | classify/asgi.py | kuromadara/cervical_classifier_webapp | 1df917b6e5af571e01edc33af04bc0eb9d9ca02e | [
"MIT"
] | null | null | null | classify/asgi.py | kuromadara/cervical_classifier_webapp | 1df917b6e5af571e01edc33af04bc0eb9d9ca02e | [
"MIT"
] | null | null | null | classify/asgi.py | kuromadara/cervical_classifier_webapp | 1df917b6e5af571e01edc33af04bc0eb9d9ca02e | [
"MIT"
] | null | null | null | """
ASGI config for classify project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'classify.settings')
application = get_asgi_application()
| true | true |
1c1fa6b25abd50812e87cae26d5f13299520af09 | 11,018 | py | Python | Class/Release.py | zhmsg/dms | 3ac2b71c4a83ac721987c6f5a2f81bc0618ceca2 | [
"MIT"
] | null | null | null | Class/Release.py | zhmsg/dms | 3ac2b71c4a83ac721987c6f5a2f81bc0618ceca2 | [
"MIT"
] | 12 | 2015-09-18T01:19:28.000Z | 2021-12-13T19:51:10.000Z | Class/Release.py | zhmsg/dms | 3ac2b71c4a83ac721987c6f5a2f81bc0618ceca2 | [
"MIT"
] | 1 | 2017-06-30T08:11:10.000Z | 2017-06-30T08:11:10.000Z | #! /usr/bin/env python
# coding: utf-8
import sys
from fabric.api import *
from datetime import datetime
from time import time
from Tools.Mysql_db import DB
from Class import mns_topic
from Class.WeiXin import WeiXinManager
from Class.Task import TaskManager
from Class.PullRequest import PullRequestManager
from Class ... | 43.039063 | 187 | 0.619985 |
import sys
from fabric.api import *
from datetime import datetime
from time import time
from Tools.Mysql_db import DB
from Class import mns_topic
from Class.WeiXin import WeiXinManager
from Class.Task import TaskManager
from Class.PullRequest import PullRequestManager
from Class import TIME_FORMAT, wx_service, relea... | true | true |
1c1fa72d85b27994be803f35ca5fba154c49aaf1 | 2,461 | py | Python | docs/conf.py | kundajelab/fastISM | 1573feccba1ad5d9f1cee508f5bb03c4aa09bb2b | [
"MIT"
] | 12 | 2020-09-20T17:03:48.000Z | 2022-03-16T06:51:52.000Z | docs/conf.py | kundajelab/fastISM | 1573feccba1ad5d9f1cee508f5bb03c4aa09bb2b | [
"MIT"
] | 5 | 2020-10-24T20:43:45.000Z | 2022-02-25T19:40:47.000Z | docs/conf.py | kundajelab/fastISM | 1573feccba1ad5d9f1cee508f5bb03c4aa09bb2b | [
"MIT"
] | 2 | 2020-10-14T05:18:55.000Z | 2022-02-21T07:34:14.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 31.961039 | 79 | 0.642828 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from fastISM.fast_ism_utils import *
project = 'fastISM'
copyright = '2020, Kundaje Lab'
author = 'Surag Nair'
extensions = ['sphinx.ext.autodoc', 'recommonmark', 'nbsphinx']
templates_path = ['_templates']
exclude_patterns = ['_... | true | true |
1c1fa7a4d5ddf91cfadcf4abbc613978bcfa7c79 | 569 | py | Python | fn_portal/migrations/0007_fn013_fn014_slugs_nullable.py | AdamCottrill/FishNetPortal | 4e58e05f52346ac1ab46698a03d4229c74828406 | [
"MIT"
] | null | null | null | fn_portal/migrations/0007_fn013_fn014_slugs_nullable.py | AdamCottrill/FishNetPortal | 4e58e05f52346ac1ab46698a03d4229c74828406 | [
"MIT"
] | null | null | null | fn_portal/migrations/0007_fn013_fn014_slugs_nullable.py | AdamCottrill/FishNetPortal | 4e58e05f52346ac1ab46698a03d4229c74828406 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.23 on 2021-06-08 13:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fn_portal', '0006_add_FN124'),
]
operations = [
migrations.AddField(
model_name='fn013',
name='slug',
f... | 23.708333 | 73 | 0.574692 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fn_portal', '0006_add_FN124'),
]
operations = [
migrations.AddField(
model_name='fn013',
name='slug',
field=models.SlugField(blank=True, max_length=20,... | true | true |
1c1fa7ecfca7d63b0b2d9566d6ff443a2d896365 | 22,115 | py | Python | lib/galaxy/tool_util/deps/container_resolvers/mulled.py | fubar2/galaxy | 2d363ea6a374d9339ed1eb55b5565f9bba3fcab1 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tool_util/deps/container_resolvers/mulled.py | fubar2/galaxy | 2d363ea6a374d9339ed1eb55b5565f9bba3fcab1 | [
"CC-BY-3.0"
] | 2 | 2020-08-19T18:14:59.000Z | 2020-08-20T01:19:12.000Z | lib/galaxy/tool_util/deps/container_resolvers/mulled.py | CloudVE/galaxy | 002fac90618529c53c11ec846566ca438a7e02cf | [
"CC-BY-3.0"
] | null | null | null | """This module describes the :class:`MulledContainerResolver` ContainerResolver plugin."""
import collections
import logging
import os
import subprocess
from galaxy.util import (
string_as_bool,
unicodify,
)
from galaxy.util.commands import shell
from ..container_classes import CONTAINER_CLASSES
from ..conta... | 38.12931 | 154 | 0.654759 |
import collections
import logging
import os
import subprocess
from galaxy.util import (
string_as_bool,
unicodify,
)
from galaxy.util.commands import shell
from ..container_classes import CONTAINER_CLASSES
from ..container_resolvers import (
ContainerResolver,
)
from ..docker_util import build_docker_ima... | true | true |
1c1fa86d8c951f49077fb9d94da7db387e7e0171 | 1,645 | py | Python | dizoo/atari/config/serial/qbert/qbert_rainbow_config.py | LuciusMos/DI-engine | b040b1c36afce038effec9eb483f625131573824 | [
"Apache-2.0"
] | 464 | 2021-07-08T07:26:33.000Z | 2022-03-31T12:35:16.000Z | dizoo/atari/config/serial/qbert/qbert_rainbow_config.py | LuciusMos/DI-engine | b040b1c36afce038effec9eb483f625131573824 | [
"Apache-2.0"
] | 177 | 2021-07-09T08:22:55.000Z | 2022-03-31T07:35:22.000Z | dizoo/atari/config/serial/qbert/qbert_rainbow_config.py | LuciusMos/DI-engine | b040b1c36afce038effec9eb483f625131573824 | [
"Apache-2.0"
] | 92 | 2021-07-08T12:16:37.000Z | 2022-03-31T09:24:41.000Z | from copy import deepcopy
from ding.entry import serial_pipeline
from easydict import EasyDict
qbert_rainbow_config = dict(
env=dict(
collector_env_num=8,
evaluator_env_num=8,
n_evaluator_episode=8,
stop_value=30000,
env_id='QbertNoFrameskip-v4',
frame_stack=4,
... | 26.111111 | 60 | 0.567173 | from copy import deepcopy
from ding.entry import serial_pipeline
from easydict import EasyDict
qbert_rainbow_config = dict(
env=dict(
collector_env_num=8,
evaluator_env_num=8,
n_evaluator_episode=8,
stop_value=30000,
env_id='QbertNoFrameskip-v4',
frame_stack=4,
... | true | true |
1c1fa8a1f2ed8cf454a4998769d95d7c6e36b87b | 1,253 | py | Python | savu/plugins/segmentation/evolving_contours/region_grow3D_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/segmentation/evolving_contours/region_grow3D_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/segmentation/evolving_contours/region_grow3D_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class RegionGrow3dTools(PluginTools):
"""Fast 3D segmentation by evolving the user-given mask, the initialised
mask should be set in the central part of the object to be segmented.
"""
def define_parameters(self):
"""
threshold:
... | 28.477273 | 76 | 0.563448 | from savu.plugins.plugin_tools import PluginTools
class RegionGrow3dTools(PluginTools):
def define_parameters(self):
| true | true |
1c1fa8d0293b4b82c2e652464b1df1d0a69b6754 | 8,035 | py | Python | pycsw/ogc/gml/gml3.py | Rastopapola/pycsw | 5ec837a88b25410032e863048efa285b8777a177 | [
"MIT"
] | null | null | null | pycsw/ogc/gml/gml3.py | Rastopapola/pycsw | 5ec837a88b25410032e863048efa285b8777a177 | [
"MIT"
] | null | null | null | pycsw/ogc/gml/gml3.py | Rastopapola/pycsw | 5ec837a88b25410032e863048efa285b8777a177 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the ... | 34.337607 | 78 | 0.544991 |
import logging
from owslib import crs
from pycsw.core import util
from pycsw.core.etree import etree
LOGGER = logging.getLogger(__name__)
TYPES = ['gml:Point', 'gml:LineString', 'gml:Polygon', 'gml:Envelope']
DEFAULT_SRS = crs.Crs('urn:x-ogc:def:crs:EPSG:6.11:4326')
def _poslist2wkt(... | true | true |
1c1fa8edabffd8b6927f7866a498ee414c6049f0 | 1,244 | py | Python | pkg/keyboards/inline/panel.py | Boryslavq/user_of_theday_bot | afecde804bbad06068fd5b02a47301aa2b6d4ed5 | [
"MIT"
] | null | null | null | pkg/keyboards/inline/panel.py | Boryslavq/user_of_theday_bot | afecde804bbad06068fd5b02a47301aa2b6d4ed5 | [
"MIT"
] | null | null | null | pkg/keyboards/inline/panel.py | Boryslavq/user_of_theday_bot | afecde804bbad06068fd5b02a47301aa2b6d4ed5 | [
"MIT"
] | null | null | null | from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.utils.callback_data import CallbackData
admin_callback = CallbackData("admin", "name", "action")
button_callback = CallbackData("button", "change", "index")
async def panel():
kb = InlineKeyboardMarkup()
kb.add(InlineKeyboardB... | 32.736842 | 105 | 0.646302 | from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.utils.callback_data import CallbackData
admin_callback = CallbackData("admin", "name", "action")
button_callback = CallbackData("button", "change", "index")
async def panel():
kb = InlineKeyboardMarkup()
kb.add(InlineKeyboardB... | true | true |
1c1fa9279c4f2f09d355c281af05a1989ebf5c7d | 2,918 | py | Python | tests/sentry/api/endpoints/test_user_index.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/api/endpoints/test_user_index.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/api/endpoints/test_user_index.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.models import UserPermission
from sentry.testutils import APITestCase
class UserListTest(APITestCase):
@fixture
def path(self):
return reverse("sentry-api-0-user-index... | 40.527778 | 93 | 0.673406 | from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.models import UserPermission
from sentry.testutils import APITestCase
class UserListTest(APITestCase):
@fixture
def path(self):
return reverse("sentry-api-0-user-index... | true | true |
1c1fa9752cd40b69dc3de4e4432897e80380c450 | 48,369 | py | Python | PythonAPI/examples/manual_control.py | PhDittmann/carla | f114dc0aa187c5e0abad04731ba1e1d7b32102f0 | [
"MIT"
] | null | null | null | PythonAPI/examples/manual_control.py | PhDittmann/carla | f114dc0aa187c5e0abad04731ba1e1d7b32102f0 | [
"MIT"
] | null | null | null | PythonAPI/examples/manual_control.py | PhDittmann/carla | f114dc0aa187c5e0abad04731ba1e1d7b32102f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Allows controlling a vehicle with a keyboard. For a simpler and more
# docu... | 43.263864 | 127 | 0.540015 |
from __future__ import print_function
import glob
import os
import sys
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pa... | true | true |
1c1fa97a2650f537f8c410e922bbe3db8d731112 | 2,410 | py | Python | detect/v2/archive_rule.py | bluPhy/api-samples-python | de50f715e9fee8e29626ba26eb9c5abae54e7827 | [
"Apache-2.0"
] | 10 | 2020-02-13T22:05:00.000Z | 2020-06-17T17:38:49.000Z | detect/v2/archive_rule.py | bluPhy/api-samples-python | de50f715e9fee8e29626ba26eb9c5abae54e7827 | [
"Apache-2.0"
] | 7 | 2020-09-15T21:46:52.000Z | 2021-01-12T05:57:48.000Z | detect/v2/archive_rule.py | bluPhy/api-samples-python | de50f715e9fee8e29626ba26eb9c5abae54e7827 | [
"Apache-2.0"
] | 10 | 2021-05-07T19:31:11.000Z | 2022-03-16T20:09:34.000Z | #!/usr/bin/env python3
# Copyright 2021 Google LLC
#
# 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... | 31.710526 | 76 | 0.744398 |
import argparse
from google.auth.transport import requests
from common import chronicle_auth
from common import regions
CHRONICLE_API_BASE_URL = "https://backstory.googleapis.com"
def archive_rule(http_session: requests.AuthorizedSession, version_id: str):
url = f"{CHRONICLE_API_BASE_URL}/v2/det... | true | true |
1c1fab2c15dd3f6620b146b078f5c500e9e5ea6a | 361 | py | Python | app/tool_results/krakenhll/models.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/krakenhll/models.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/krakenhll/models.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | # pylint: disable=too-few-public-methods
"""Models for Kraken tool module."""
from app.extensions import mongoDB
from app.tool_results.models import ToolResult
class KrakenHLLResult(ToolResult):
"""Kraken tool's result type."""
# Taxa is of the form: {<taxon_name>: <abundance_value>}
taxa = mongoDB.Map... | 25.785714 | 62 | 0.734072 |
from app.extensions import mongoDB
from app.tool_results.models import ToolResult
class KrakenHLLResult(ToolResult):
taxa = mongoDB.MapField(mongoDB.IntField(), required=True)
| true | true |
1c1fab8a0a9872ea416c1970b8ce72e32c106d21 | 38,868 | py | Python | numpyro/infer/hmc_gibbs.py | MarcoGorelli/numpyro | 77be4d8171b0570bcabbebf1456f70ef94f9d0e8 | [
"Apache-2.0"
] | null | null | null | numpyro/infer/hmc_gibbs.py | MarcoGorelli/numpyro | 77be4d8171b0570bcabbebf1456f70ef94f9d0e8 | [
"Apache-2.0"
] | null | null | null | numpyro/infer/hmc_gibbs.py | MarcoGorelli/numpyro | 77be4d8171b0570bcabbebf1456f70ef94f9d0e8 | [
"Apache-2.0"
] | 1 | 2020-09-18T11:33:33.000Z | 2020-09-18T11:33:33.000Z | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import defaultdict, namedtuple
import copy
from functools import partial
import warnings
import numpy as np
from jax import (
device_put,
grad,
hessian,
jacfwd,
jacobian,
lax,
ops,
ran... | 39.701736 | 113 | 0.619301 |
from collections import defaultdict, namedtuple
import copy
from functools import partial
import warnings
import numpy as np
from jax import (
device_put,
grad,
hessian,
jacfwd,
jacobian,
lax,
ops,
random,
value_and_grad,
)
from jax.flatten_util import ravel_pytree
import jax.nu... | true | true |
1c1faba5726932a15fbb82636a7727cfaf4d07ef | 433 | py | Python | exercises/de/exc_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | TRAINING_DATA = [
(
"Reddit und Patreon helfen Kreativen beim Aufbau von Communities",
{"entities": [(0, 6, "WEBSITE"), (11, 18, "WEBSITE")]},
),
("PewDiePie knackt Rekord auf YouTube", {"entities": [____, (28, 35, "WEBSITE")]}),
(
"Mitgründer von Reddit, Alexis Ohanian, schenkt ... | 33.307692 | 87 | 0.570439 | TRAINING_DATA = [
(
"Reddit und Patreon helfen Kreativen beim Aufbau von Communities",
{"entities": [(0, 6, "WEBSITE"), (11, 18, "WEBSITE")]},
),
("PewDiePie knackt Rekord auf YouTube", {"entities": [____, (28, 35, "WEBSITE")]}),
(
"Mitgründer von Reddit, Alexis Ohanian, schenkt ... | true | true |
1c1fad6632267e60d0822155bd5539b826cd5abe | 499 | py | Python | praetorian_ssh_proxy/run.py | Praetorian-Defence/praetorian-ssh-proxy | 068141bf0cee9fcf10434fab2dc5c16cfdd35f5a | [
"MIT"
] | null | null | null | praetorian_ssh_proxy/run.py | Praetorian-Defence/praetorian-ssh-proxy | 068141bf0cee9fcf10434fab2dc5c16cfdd35f5a | [
"MIT"
] | null | null | null | praetorian_ssh_proxy/run.py | Praetorian-Defence/praetorian-ssh-proxy | 068141bf0cee9fcf10434fab2dc5c16cfdd35f5a | [
"MIT"
] | null | null | null | import logging
import sys
from praetorian_ssh_proxy.application import Application
def main():
if not len(sys.argv[1:]):
logging.error('Usage: server.py <SERVER> <PORT>')
sys.exit()
host = sys.argv[1]
try:
port = int(sys.argv[2])
except ValueError:
logging.error('Spe... | 19.96 | 58 | 0.635271 | import logging
import sys
from praetorian_ssh_proxy.application import Application
def main():
if not len(sys.argv[1:]):
logging.error('Usage: server.py <SERVER> <PORT>')
sys.exit()
host = sys.argv[1]
try:
port = int(sys.argv[2])
except ValueError:
logging.error('Spe... | true | true |
1c1fadaf2e82b2d4472d1e3bb5b7dd07a224e428 | 30,002 | py | Python | scrambleFUN.py | phukeo/SCRAMBLE | 35d222edb6533e24d09f48a82175281af32eb91f | [
"MIT"
] | null | null | null | scrambleFUN.py | phukeo/SCRAMBLE | 35d222edb6533e24d09f48a82175281af32eb91f | [
"MIT"
] | null | null | null | scrambleFUN.py | phukeo/SCRAMBLE | 35d222edb6533e24d09f48a82175281af32eb91f | [
"MIT"
] | 1 | 2021-07-01T14:30:11.000Z | 2021-07-01T14:30:11.000Z | import os
import numpy as np
import matplotlib.pyplot as pp
import pandas as pd
#########################
## INTIALISE VARIABLES ##
#########################
newDesk=[]
selectedList=[]
yPlotlabel=""
flow=["red", "orange","brown","tan", "lime", "purple", "teal", "black", "blue", "grey", "pink", "violet", "... | 50.003333 | 171 | 0.624792 | import os
import numpy as np
import matplotlib.pyplot as pp
import pandas as pd
idvgData=pd.concat([idvgData,df],axis=1)
newDesk.append(newTitle)
global copied_original
copied_original=idvgData.copy()
copied_original.name=device
return copied_original,device,new... | true | true |
1c1fade6eb09f628dae58f53773003780b1cf7b4 | 435 | py | Python | app/urls.py | rosan-magar/base64bmp-base64png | bf4c77acbef57b67325505c0b8d10ba807c5af37 | [
"Unlicense"
] | null | null | null | app/urls.py | rosan-magar/base64bmp-base64png | bf4c77acbef57b67325505c0b8d10ba807c5af37 | [
"Unlicense"
] | null | null | null | app/urls.py | rosan-magar/base64bmp-base64png | bf4c77acbef57b67325505c0b8d10ba807c5af37 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from django.urls import path
from rest_framework import routers, urlpatterns
from .views import UploadImage
from django.urls import include
router=routers.DefaultRouter()
# router.register('upload-image', UploadImage.as_view())
urlpatterns = [
path("", include(router.urls)),
p... | 29 | 69 | 0.758621 | from django.contrib import admin
from django.urls import path
from rest_framework import routers, urlpatterns
from .views import UploadImage
from django.urls import include
router=routers.DefaultRouter()
urlpatterns = [
path("", include(router.urls)),
path("upload-image", UploadImage.as_view())
] | true | true |
1c1fadfcef9352d0a8b44bfcf5bba2010f63c29b | 349 | py | Python | Python/PythonExercicios/ex004.py | isabellathome/College-Activities | 12fc73f8416f5a9572d0a8c59eb7403d9c88ed0f | [
"MIT"
] | null | null | null | Python/PythonExercicios/ex004.py | isabellathome/College-Activities | 12fc73f8416f5a9572d0a8c59eb7403d9c88ed0f | [
"MIT"
] | null | null | null | Python/PythonExercicios/ex004.py | isabellathome/College-Activities | 12fc73f8416f5a9572d0a8c59eb7403d9c88ed0f | [
"MIT"
] | null | null | null | a = input('Digite algo: ')
print('O tipo primitivo desse valor é', type(a))
print('Só tem espaços?', a.isspace())
print('É um número?', a.isnumeric())
print('É alfabética?', a.isalpha())
print('É alfanúmerico?', a.isalnum())
print('Está em maiúsculo?', a.isupper())
print('Está em minúsculo?', a.islower())
print('Está c... | 31.727273 | 48 | 0.673352 | a = input('Digite algo: ')
print('O tipo primitivo desse valor é', type(a))
print('Só tem espaços?', a.isspace())
print('É um número?', a.isnumeric())
print('É alfabética?', a.isalpha())
print('É alfanúmerico?', a.isalnum())
print('Está em maiúsculo?', a.isupper())
print('Está em minúsculo?', a.islower())
print('Está c... | true | true |
1c1fafde7e1cb759a40ac63f76567dca2b82305d | 1,234 | py | Python | apps/local_apps/account/templatetags/other_service_tags.py | google-code-export/django-hotclub | d783a5bbcc06816289565f3eae6d99461188ca4a | [
"MIT"
] | 4 | 2016-05-08T06:07:50.000Z | 2021-11-21T19:41:40.000Z | pinax/apps/account/templatetags/other_service_tags.py | SMiGL/pinax | d08b2655fe661566bd13c5c170b1a4cad9e67a1d | [
"MIT"
] | null | null | null | pinax/apps/account/templatetags/other_service_tags.py | SMiGL/pinax | d08b2655fe661566bd13c5c170b1a4cad9e67a1d | [
"MIT"
] | 3 | 2017-07-09T02:14:54.000Z | 2021-07-13T19:16:59.000Z | import re
from django import template
from account.models import other_service
register = template.Library()
class OtherServiceNode(template.Node):
def __init__(self, user, key, asvar):
self.user = user
self.key = key
self.asvar = asvar
def render(self, context):
user = s... | 28.697674 | 93 | 0.594003 | import re
from django import template
from account.models import other_service
register = template.Library()
class OtherServiceNode(template.Node):
def __init__(self, user, key, asvar):
self.user = user
self.key = key
self.asvar = asvar
def render(self, context):
user = s... | true | true |
1c1fb08258f64802d9872e2f47d143667920539e | 10,211 | py | Python | pywps/validator/complexvalidator.py | ausecocloud/pywps | 2451e6f2e34f815141bf35d24a99a2d817d6136c | [
"MIT"
] | null | null | null | pywps/validator/complexvalidator.py | ausecocloud/pywps | 2451e6f2e34f815141bf35d24a99a2d817d6136c | [
"MIT"
] | null | null | null | pywps/validator/complexvalidator.py | ausecocloud/pywps | 2451e6f2e34f815141bf35d24a99a2d817d6136c | [
"MIT"
] | null | null | null | ##################################################################
# Copyright 2018 Open Source Geospatial Foundation and others #
# licensed under MIT, Please consult LICENSE.txt for details #
##################################################################
"""Validator classes are used for ComplexInputs, to... | 28.522346 | 229 | 0.609735 | ype}
if mode >= MODE.STRICT:
from pywps.dependencies import ogr
import zipfile
z = zipfile.ZipFile(data_input.file)
shape_name = None
for name in z.namelist():
z.extract(name, data_input.tempdir)
if os.path.splitext(name)[1].lower() == '.shp':
... | true | true |
1c1fb0a97bf366456845be600f848520458a1bba | 3,850 | py | Python | tacker/vnfm/infra_drivers/openstack/heat_client.py | takahashi-tsc/tacker | a0ae01a13dcc51bb374060adcbb4fd484ab37156 | [
"Apache-2.0"
] | null | null | null | tacker/vnfm/infra_drivers/openstack/heat_client.py | takahashi-tsc/tacker | a0ae01a13dcc51bb374060adcbb4fd484ab37156 | [
"Apache-2.0"
] | null | null | null | tacker/vnfm/infra_drivers/openstack/heat_client.py | takahashi-tsc/tacker | a0ae01a13dcc51bb374060adcbb4fd484ab37156 | [
"Apache-2.0"
] | 1 | 2020-11-16T02:14:35.000Z | 2020-11-16T02:14:35.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 36.666667 | 77 | 0.649091 |
import sys
from heatclient import exc as heatException
from oslo_log import log as logging
from tacker.common import clients
from tacker.extensions import vnfm
LOG = logging.getLogger(__name__)
class HeatClient(object):
def __init__(self, auth_attr, region_name=None):
self.heat = c... | true | true |
1c1fb0d5e662e79e2f6eb8dd651cf644c538b626 | 51 | py | Python | torchmm/__init__.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | 42 | 2022-01-05T13:49:48.000Z | 2022-03-30T20:20:18.000Z | torchmm/__init__.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | null | null | null | torchmm/__init__.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | 5 | 2022-01-19T00:27:24.000Z | 2022-03-23T08:29:50.000Z | from .start import TorchMM
__all__ = ['TorchMM'] | 17 | 27 | 0.705882 | from .start import TorchMM
__all__ = ['TorchMM'] | true | true |
1c1fb2da52bfee157b038a71424f484bb55280a2 | 1,157 | py | Python | translate/cloud-client/translate_v3_delete_glossary_test.py | jaymicrocode/python-docs-samples | 486e75dcbbeeaefbff4aa8fd0b79a50ebac4bc47 | [
"Apache-2.0"
] | 1 | 2020-03-05T18:24:45.000Z | 2020-03-05T18:24:45.000Z | translate/cloud-client/translate_v3_delete_glossary_test.py | jaymicrocode/python-docs-samples | 486e75dcbbeeaefbff4aa8fd0b79a50ebac4bc47 | [
"Apache-2.0"
] | null | null | null | translate/cloud-client/translate_v3_delete_glossary_test.py | jaymicrocode/python-docs-samples | 486e75dcbbeeaefbff4aa8fd0b79a50ebac4bc47 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 33.057143 | 74 | 0.764909 |
import os
import translate_v3_create_glossary
import translate_v3_delete_glossary
import uuid
PROJECT_ID = os.environ["GCLOUD_PROJECT"]
GLOSSARY_INPUT_URI = "gs://cloud-samples-data/translation/glossary_ja.csv"
def test_delete_glossary(capsys):
glossary_id = "must-start-with-letters-" + str(uu... | true | true |
1c1fb355d914554a519059c6a0f420c5398f854e | 9,519 | py | Python | test/test_encryptor.py | pellcorp/pghoard | 8a83960ea9ee99fbe2bffa8753e7b7356f7c4417 | [
"Apache-2.0"
] | 731 | 2018-06-01T21:48:43.000Z | 2022-03-29T08:21:42.000Z | test/test_encryptor.py | pellcorp/pghoard | 8a83960ea9ee99fbe2bffa8753e7b7356f7c4417 | [
"Apache-2.0"
] | 124 | 2018-06-19T05:59:50.000Z | 2022-03-31T18:17:59.000Z | test/test_encryptor.py | pellcorp/pghoard | 8a83960ea9ee99fbe2bffa8753e7b7356f7c4417 | [
"Apache-2.0"
] | 64 | 2018-06-26T14:12:53.000Z | 2022-03-20T07:33:33.000Z | """
pghoard
Copyright (c) 2015 Ohmu Ltd
See LICENSE for details
"""
import io
import json
import os
import random
import tarfile
import pytest
from pghoard.rohmu import IO_BLOCK_SIZE
from pghoard.rohmu.encryptor import (Decryptor, DecryptorFile, Encryptor, EncryptorFile, EncryptorStream)
from .base import CONSTANT_... | 36.471264 | 119 | 0.668768 | import io
import json
import os
import random
import tarfile
import pytest
from pghoard.rohmu import IO_BLOCK_SIZE
from pghoard.rohmu.encryptor import (Decryptor, DecryptorFile, Encryptor, EncryptorFile, EncryptorStream)
from .base import CONSTANT_TEST_RSA_PRIVATE_KEY, CONSTANT_TEST_RSA_PUBLIC_KEY
def test_encrypt... | true | true |
1c1fb371f9a704f77286e849750e94bcb2f1d73c | 62 | py | Python | run.py | GTmmiller/pokego-evol-maximizer | 9cc24b502a41be28d4e0bc2adba8871783387ca3 | [
"BSD-2-Clause"
] | null | null | null | run.py | GTmmiller/pokego-evol-maximizer | 9cc24b502a41be28d4e0bc2adba8871783387ca3 | [
"BSD-2-Clause"
] | null | null | null | run.py | GTmmiller/pokego-evol-maximizer | 9cc24b502a41be28d4e0bc2adba8871783387ca3 | [
"BSD-2-Clause"
] | null | null | null | from pokego_evol_maximizer_site import app
app.run(debug=True) | 31 | 42 | 0.870968 | from pokego_evol_maximizer_site import app
app.run(debug=True) | true | true |
1c1fb386cd0a07f21c87e08b588a75bd3eea7024 | 9,162 | py | Python | kubernetes_asyncio/client/models/version_info.py | dineshsonachalam/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | 1 | 2021-02-25T04:36:18.000Z | 2021-02-25T04:36:18.000Z | kubernetes_asyncio/client/models/version_info.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/version_info.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | 27.763636 | 181 | 0.581532 |
import pprint
import re
import six
class VersionInfo(object):
swagger_types = {
'build_date': 'str',
'compiler': 'str',
'git_commit': 'str',
'git_tree_state': 'str',
'git_version': 'str',
'go_version': 'str',
'major': 'str',
'minor': 'str',
... | true | true |
1c1fb3efa71735969ed86022b454884aaa826e1d | 3,434 | py | Python | infer_precursors.py | bruyle/oxidizable-pfas-precursor-inference | b8a763c6eb0b3e49bca54ea7e85c692678822eef | [
"MIT"
] | null | null | null | infer_precursors.py | bruyle/oxidizable-pfas-precursor-inference | b8a763c6eb0b3e49bca54ea7e85c692678822eef | [
"MIT"
] | 1 | 2022-01-05T08:46:14.000Z | 2022-01-08T03:30:54.000Z | infer_precursors.py | bruyle/oxidizable-pfas-precursor-inference | b8a763c6eb0b3e49bca54ea7e85c692678822eef | [
"MIT"
] | 3 | 2021-02-24T12:17:33.000Z | 2021-12-30T08:04:20.000Z | """ Generate samples of the posterior for PFAA precursors from TOP assay
measurements in aqueous matrices.
Authors:
Colin Thackray (thackray@seas.harvard.edu)
Bridger Ruyle (bruyle@g.harvard.edu)
"""
import argparse
import numpy as np
import pandas as pd
from sampling import sample_measurement
from functions import ma... | 38.58427 | 78 | 0.584741 | import argparse
import numpy as np
import pandas as pd
from sampling import sample_measurement
from functions import makeb
parser = argparse.ArgumentParser(
description='Sample posterior for precursors.')
parser.add_argument('ISTART', metavar='istart', type=int,
help='first sample index (first... | true | true |
1c1fb42741a1754d7b8b945b870379563a0a3498 | 371 | py | Python | src/erc20_snapshot/__init__.py | aleph-im/erc20-snapshot | d9fa71bbba5e773aff30a0c51268ea7ce144bcd8 | [
"MIT"
] | 1 | 2022-02-28T17:15:23.000Z | 2022-02-28T17:15:23.000Z | src/erc20_snapshot/__init__.py | aleph-im/erc20-snapshot | d9fa71bbba5e773aff30a0c51268ea7ce144bcd8 | [
"MIT"
] | 1 | 2020-09-27T14:22:57.000Z | 2020-09-27T14:22:57.000Z | src/erc20_snapshot/__init__.py | aleph-im/erc20-snapshot | d9fa71bbba5e773aff30a0c51268ea7ce144bcd8 | [
"MIT"
] | 1 | 2021-08-06T02:54:34.000Z | 2021-08-06T02:54:34.000Z | # -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound
try:
# Change here if project is renamed and does not equal the package name
dist_name = 'erc20-snapshot'
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
final... | 30.916667 | 75 | 0.765499 |
from pkg_resources import get_distribution, DistributionNotFound
try:
dist_name = 'erc20-snapshot'
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
finally:
del get_distribution, DistributionNotFound
| true | true |
1c1fb4620bdbf30ab13cb938e97e1e32582e1be4 | 4,228 | py | Python | tempest/stress/cleanup.py | xavpaice/tempest | 958bd694df27511e0346d799876fe49331b8145c | [
"Apache-2.0"
] | null | null | null | tempest/stress/cleanup.py | xavpaice/tempest | 958bd694df27511e0346d799876fe49331b8145c | [
"Apache-2.0"
] | null | null | null | tempest/stress/cleanup.py | xavpaice/tempest | 958bd694df27511e0346d799876fe49331b8145c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2013 Quanta Research Cambridge, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 35.529412 | 78 | 0.652081 |
from oslo_log import log as logging
from tempest.common import credentials_factory as credentials
from tempest.common import waiters
LOG = logging.getLogger(__name__)
def cleanup():
admin_manager = credentials.AdminManager()
body = admin_manager.servers_client.list_servers(all_tenants=True)... | true | true |
1c1fb4e022d6f0ef6968614e5058f3574e41ff3c | 1,901 | py | Python | packages/sqlmap-master/plugins/dbms/informix/connector.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/sqlmap-master/plugins/dbms/informix/connector.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/sqlmap-master/plugins/dbms/informix/connector.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2006-2021 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
try:
import ibm_db_dbi
except:
pass
import logging
from lib.core.common import getSafeExString
from lib.core.data import conf
from lib.core.data import logger
from lib.c... | 31.163934 | 112 | 0.679642 |
try:
import ibm_db_dbi
except:
pass
import logging
from lib.core.common import getSafeExString
from lib.core.data import conf
from lib.core.data import logger
from lib.core.exception import SqlmapConnectionException
from plugins.generic.connector import Connector as GenericConnector
class Connector(Generi... | true | true |
1c1fb5b42dec46b2ca2e72f3de2f8c25e444de42 | 1,125 | py | Python | faker/providers/job/ja_JP/__init__.py | StabbarN/faker | 57882ff73255cb248d8f995b2abfce5cfee45ab3 | [
"MIT"
] | 12,077 | 2015-01-01T18:30:07.000Z | 2022-03-31T23:22:01.000Z | faker/providers/job/ja_JP/__init__.py | StabbarN/faker | 57882ff73255cb248d8f995b2abfce5cfee45ab3 | [
"MIT"
] | 1,306 | 2015-01-03T05:18:55.000Z | 2022-03-31T02:43:04.000Z | faker/providers/job/ja_JP/__init__.py | StabbarN/faker | 57882ff73255cb248d8f995b2abfce5cfee45ab3 | [
"MIT"
] | 1,855 | 2015-01-08T14:20:10.000Z | 2022-03-25T17:23:32.000Z | from .. import Provider as BaseProvider
class Provider(BaseProvider):
"""
source: https://ja.wikipedia.org/wiki/%E8%81%B7%E6%A5%AD%E4%B8%80%E8%A6%A7
"""
jobs = [
'アイドル',
'アーティスト',
'アートディレクター',
'アナウンサー',
'アニメーター',
'医師',
'イラストレーター',
'医療事務員... | 16.791045 | 78 | 0.335111 | from .. import Provider as BaseProvider
class Provider(BaseProvider):
jobs = [
'アイドル',
'アーティスト',
'アートディレクター',
'アナウンサー',
'アニメーター',
'医師',
'イラストレーター',
'医療事務員',
'ウェディングプランナー',
'ウェブデザイナー',
'占い師',
'運転士',
'映画監督',
... | true | true |
1c1fb63a3647c35defb62891143c05ef4a5b5cb8 | 377 | py | Python | aula08excript.py | rafaelclemes81/Python | 0e685b4e528a29bb23ecf11c9ccdbae8730b3ac3 | [
"MIT"
] | null | null | null | aula08excript.py | rafaelclemes81/Python | 0e685b4e528a29bb23ecf11c9ccdbae8730b3ac3 | [
"MIT"
] | null | null | null | aula08excript.py | rafaelclemes81/Python | 0e685b4e528a29bb23ecf11c9ccdbae8730b3ac3 | [
"MIT"
] | null | null | null | from tkinter import *
def bt_click():
lb['text'] = ed.get() # a funçao get() retorna o valor que foi digitado no objeto Entry
janela = Tk()
ed = Entry(janela)
ed.place(x=50, y=50)
bt = Button(janela, width=20, text='Ok', command=bt_click)
bt.place(x=50, y=80)
lb = Label(janela, text='Label')
lb.place(x=50, y=1... | 20.944444 | 91 | 0.676393 | from tkinter import *
def bt_click():
lb['text'] = ed.get()
janela = Tk()
ed = Entry(janela)
ed.place(x=50, y=50)
bt = Button(janela, width=20, text='Ok', command=bt_click)
bt.place(x=50, y=80)
lb = Label(janela, text='Label')
lb.place(x=50, y=110)
janela.geometry('300x300+200+200')
janela.mainloop() | true | true |
1c1fb65b90f154d12238f4ff55166902f8360ec7 | 1,392 | py | Python | PyScraper/middlewares/downloadmiddlewares/put_task_middleware.py | nikan1996/PyScraper | ed6ba5aa490fce96b5ff59e1461b408886744c04 | [
"Apache-2.0"
] | null | null | null | PyScraper/middlewares/downloadmiddlewares/put_task_middleware.py | nikan1996/PyScraper | ed6ba5aa490fce96b5ff59e1461b408886744c04 | [
"Apache-2.0"
] | 1 | 2018-05-31T19:08:40.000Z | 2018-05-31T19:08:40.000Z | PyScraper/middlewares/downloadmiddlewares/put_task_middleware.py | nikan1996/PyScraper | ed6ba5aa490fce96b5ff59e1461b408886744c04 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
@author:nikan
@file: put_task_middleware.py
@time: 2018/6/6 下午3:52
"""
from scrapy.exceptions import IgnoreRequest
from PyScraper.server.app import create_app_forcontext
from PyScraper.server.resource_handlers.task_handler import TaskHandler
import logging
logger = loggi... | 29.617021 | 118 | 0.676724 |
from scrapy.exceptions import IgnoreRequest
from PyScraper.server.app import create_app_forcontext
from PyScraper.server.resource_handlers.task_handler import TaskHandler
import logging
logger = logging.getLogger(__name__)
class TaskMiddleware:
@classmethod
def from_crawler(cls, crawler):
return cl... | true | true |
1c1fb9ed0a07d9cbabca124fcf8972ecc1fdfcb0 | 935 | py | Python | Stage_I/rescale.py | dyzc1234/opencv_practice | eaf0cf89abef24c105c1b01b94e6beacc9edfbe4 | [
"MIT"
] | 1 | 2022-03-04T12:54:32.000Z | 2022-03-04T12:54:32.000Z | Stage_I/rescale.py | dyzc1234/opencv_practice | eaf0cf89abef24c105c1b01b94e6beacc9edfbe4 | [
"MIT"
] | null | null | null | Stage_I/rescale.py | dyzc1234/opencv_practice | eaf0cf89abef24c105c1b01b94e6beacc9edfbe4 | [
"MIT"
] | null | null | null | import cv2 as cv
img = cv.imread('F:/opencv_learning/photos/Doraemen.jpg')
cv.imshow('Doraemen',img)
def rescaleFrame(frame,scale = 0.75):
#photos videos live videos
height = int(frame.shape[0] * scale)
width = int(frame.shape[1] * scale)
dimensions = (width,height)
return cv.resize(frame,dimensi... | 23.375 | 66 | 0.704813 | import cv2 as cv
img = cv.imread('F:/opencv_learning/photos/Doraemen.jpg')
cv.imshow('Doraemen',img)
def rescaleFrame(frame,scale = 0.75):
height = int(frame.shape[0] * scale)
width = int(frame.shape[1] * scale)
dimensions = (width,height)
return cv.resize(frame,dimensions,interpolation=cv.INTER... | true | true |
1c1fbc2d7eecacc7613747beaaf167450be41fc0 | 19,580 | py | Python | tests/unit/conftest.py | ChristopherJHart/scrapli | 062a5f4995539e2dd3b260c7e1eaf66f19b3bedb | [
"MIT"
] | null | null | null | tests/unit/conftest.py | ChristopherJHart/scrapli | 062a5f4995539e2dd3b260c7e1eaf66f19b3bedb | [
"MIT"
] | null | null | null | tests/unit/conftest.py | ChristopherJHart/scrapli | 062a5f4995539e2dd3b260c7e1eaf66f19b3bedb | [
"MIT"
] | null | null | null | import sys
from copy import deepcopy
import pytest
from scrapli.channel.async_channel import AsyncChannel
from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs
from scrapli.channel.sync_channel import Channel
from scrapli.driver.base.async_driver import AsyncDriver
from scrapli.driver.base.base_driver... | 34.350877 | 100 | 0.746578 | import sys
from copy import deepcopy
import pytest
from scrapli.channel.async_channel import AsyncChannel
from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs
from scrapli.channel.sync_channel import Channel
from scrapli.driver.base.async_driver import AsyncDriver
from scrapli.driver.base.base_driver... | true | true |
1c1fbe82593331b1eced82ed376c86a5e16c43a9 | 207 | py | Python | vctk/build_vocab.py | florianthonig/listen-attend-and-spell | 218dd4f200cd564d3052c550dbbfe1f2cd836008 | [
"Apache-2.0"
] | 96 | 2018-06-06T08:01:37.000Z | 2021-10-06T03:40:00.000Z | vctk/build_vocab.py | florianthonig/listen-attend-and-spell | 218dd4f200cd564d3052c550dbbfe1f2cd836008 | [
"Apache-2.0"
] | 10 | 2018-06-28T02:33:14.000Z | 2019-07-08T07:22:29.000Z | vctk/build_vocab.py | florianthonig/listen-attend-and-spell | 218dd4f200cd564d3052c550dbbfe1f2cd836008 | [
"Apache-2.0"
] | 37 | 2018-08-09T16:42:28.000Z | 2021-10-21T03:42:59.000Z | import sys
import numpy as np
s = set()
f = np.load(sys.argv[1]).item()
for line in f.values():
s.update(line)
d = sorted(list(s))
with open(sys.argv[2], 'w') as f:
print('\n'.join(d), file=f)
| 12.9375 | 33 | 0.589372 | import sys
import numpy as np
s = set()
f = np.load(sys.argv[1]).item()
for line in f.values():
s.update(line)
d = sorted(list(s))
with open(sys.argv[2], 'w') as f:
print('\n'.join(d), file=f)
| true | true |
1c1fbe9aec8335aec89bfb3dfbaaef73f32cfcda | 5,550 | py | Python | tf_quant_finance/experimental/pricing_platform/framework/market_data/volatility_surface.py | dbbpjch/tf-quant-finance | fa577701afe2f40b6cf0740336f44dc3c1b8222b | [
"Apache-2.0"
] | 1 | 2021-04-22T15:48:38.000Z | 2021-04-22T15:48:38.000Z | tf_quant_finance/experimental/pricing_platform/framework/market_data/volatility_surface.py | dbbpjch/tf-quant-finance | fa577701afe2f40b6cf0740336f44dc3c1b8222b | [
"Apache-2.0"
] | null | null | null | tf_quant_finance/experimental/pricing_platform/framework/market_data/volatility_surface.py | dbbpjch/tf-quant-finance | fa577701afe2f40b6cf0740336f44dc3c1b8222b | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 Google LLC
#
# 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 agr... | 41.729323 | 102 | 0.733153 |
from typing import Optional
import tensorflow.compat.v2 as tf
from tf_quant_finance import datetime as dateslib
from tf_quant_finance import math
from tf_quant_finance.experimental.pricing_platform.framework.core import daycount_conventions
from tf_quant_finance.experimental.pricing_platform.framework.... | true | true |
1c1fbf8692cd4824ba43680bfcc4c3bc4ecceae7 | 275 | py | Python | Python-Introduction/Exercise/Exercise3.py | itzpc/Google-MLCC-NITJ | a0a4f3f7020175476b503ca144f4da246f59b26c | [
"MIT"
] | null | null | null | Python-Introduction/Exercise/Exercise3.py | itzpc/Google-MLCC-NITJ | a0a4f3f7020175476b503ca144f4da246f59b26c | [
"MIT"
] | null | null | null | Python-Introduction/Exercise/Exercise3.py | itzpc/Google-MLCC-NITJ | a0a4f3f7020175476b503ca144f4da246f59b26c | [
"MIT"
] | null | null | null | def main():
choice='z'
if choice == 'a':
print("You chose 'a'.")
elif choice == 'b':
print("You chose 'b'.")
elif choice == 'c':
print("You chose 'c'.")
else:
print("Invalid choice.")
if __name__ == '__main__':
main()
| 19.642857 | 32 | 0.476364 | def main():
choice='z'
if choice == 'a':
print("You chose 'a'.")
elif choice == 'b':
print("You chose 'b'.")
elif choice == 'c':
print("You chose 'c'.")
else:
print("Invalid choice.")
if __name__ == '__main__':
main()
| true | true |
1c1fc08b5b23ce11672f879e292d4b3e6056a7fc | 18,803 | py | Python | ironstubs/generator3/generator3.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | ironstubs/generator3/generator3.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | ironstubs/generator3/generator3.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | # encoding: utf-8
import atexit
import zipfile
import shutil
# TODO: Move all CLR-specific functions to clr_tools
from pycharm_generator_utils.module_redeclarator import *
from pycharm_generator_utils.util_methods import *
from pycharm_generator_utils.constants import *
from pycharm_generator_utils.clr_tools import *... | 34.312044 | 135 | 0.535021 |
import atexit
import zipfile
import shutil
from pycharm_generator_utils.module_redeclarator import *
from pycharm_generator_utils.util_methods import *
from pycharm_generator_utils.constants import *
from pycharm_generator_utils.clr_tools import *
debug_mode = False
def redo_module(module_name, outfile, module_... | true | true |
1c1fc0d52ba6b2ac6a9b09cf3d94e3efb6a66eb1 | 1,859 | py | Python | main.py | heyyyelijah/personal-portfolio | 7a06c231fd88d335b2c1d5c51f974107f2f828e0 | [
"CC-BY-3.0"
] | null | null | null | main.py | heyyyelijah/personal-portfolio | 7a06c231fd88d335b2c1d5c51f974107f2f828e0 | [
"CC-BY-3.0"
] | null | null | null | main.py | heyyyelijah/personal-portfolio | 7a06c231fd88d335b2c1d5c51f974107f2f828e0 | [
"CC-BY-3.0"
] | null | null | null | from flask import Flask, render_template, redirect, url_for, request, flash, abort
import requests
from decouple import config
import smtplib
app = Flask(__name__)
url = config('URL')
MY_EMAIL = config('email')
PASSWORD = config('password')
def sendEmail(data):
data = data.json()
ip = data['ip']
if ip !... | 29.507937 | 82 | 0.611081 | from flask import Flask, render_template, redirect, url_for, request, flash, abort
import requests
from decouple import config
import smtplib
app = Flask(__name__)
url = config('URL')
MY_EMAIL = config('email')
PASSWORD = config('password')
def sendEmail(data):
data = data.json()
ip = data['ip']
if ip !... | true | true |
1c1fc0e3231507850453d7e45f40bb16ccad1ef1 | 2,811 | py | Python | tspme/metaheuristics.py | rodrigoarenas456/tspme | 7d429b482851a6a5bfda293c65b7e4e4df8cca2b | [
"MIT"
] | null | null | null | tspme/metaheuristics.py | rodrigoarenas456/tspme | 7d429b482851a6a5bfda293c65b7e4e4df8cca2b | [
"MIT"
] | null | null | null | tspme/metaheuristics.py | rodrigoarenas456/tspme | 7d429b482851a6a5bfda293c65b7e4e4df8cca2b | [
"MIT"
] | null | null | null | import numpy as np
import random
from sklearn.metrics.pairwise import euclidean_distances
from tspme.utils.customer_properties import LazyProperty
class SimulatedAnnealing:
def __init__(self, init_temp_factor=1, alpha=0.995, stop_temp=0.5, n_cycles=50):
self.init_temp = init_temp_factor
self.alph... | 39.041667 | 116 | 0.646033 | import numpy as np
import random
from sklearn.metrics.pairwise import euclidean_distances
from tspme.utils.customer_properties import LazyProperty
class SimulatedAnnealing:
def __init__(self, init_temp_factor=1, alpha=0.995, stop_temp=0.5, n_cycles=50):
self.init_temp = init_temp_factor
self.alph... | true | true |
1c1fc1091b6103f5733810cb0df433864f073695 | 5,748 | py | Python | pysnmp/BAS-TG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/BAS-TG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/BAS-TG-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 BAS-TG-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BAS-TG-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:17:56 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | 112.705882 | 625 | 0.760612 |
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuild... | true | true |
1c1fc2d6b7c9645d7e20936ce5e031d87c9c651c | 6,066 | py | Python | instats/feedmatch.py | nramkissoon/Instats | 0d433e2ecab351e390cd9c06a7dee1d47c4280a2 | [
"MIT"
] | 2 | 2020-08-14T16:46:07.000Z | 2020-09-10T09:55:19.000Z | instats/feedmatch.py | nramkissoon/Instats | 0d433e2ecab351e390cd9c06a7dee1d47c4280a2 | [
"MIT"
] | null | null | null | instats/feedmatch.py | nramkissoon/Instats | 0d433e2ecab351e390cd9c06a7dee1d47c4280a2 | [
"MIT"
] | null | null | null | from colorstats import Photoset, Photo
from .feedmatch_utils import *
import requests
from io import BytesIO
class FeedMatch:
"""
Class for handling data and methods regarding profile feed coherency.
"""
def __init__(self, posts: [], pixel_count=20000):
"""
Constructor
:param... | 39.907895 | 107 | 0.621332 | from colorstats import Photoset, Photo
from .feedmatch_utils import *
import requests
from io import BytesIO
class FeedMatch:
def __init__(self, posts: [], pixel_count=20000):
self.px_count = pixel_count
self.urls = []
for post in posts:
self.urls.append(post.url)
i... | true | true |
1c1fc36ff2ccf21ac49d79ec1afe428338d05820 | 5,345 | py | Python | datasets/ljspeech.py | qingyundou/tacotron_qdou | aca014e8ea73bbab617029b81368cee235f47ce2 | [
"MIT"
] | 2 | 2020-12-16T12:53:52.000Z | 2021-09-18T06:52:05.000Z | datasets/ljspeech.py | qingyundou/tacotron_qdou | aca014e8ea73bbab617029b81368cee235f47ce2 | [
"MIT"
] | null | null | null | datasets/ljspeech.py | qingyundou/tacotron_qdou | aca014e8ea73bbab617029b81368cee235f47ce2 | [
"MIT"
] | 1 | 2021-03-05T03:44:39.000Z | 2021-03-05T03:44:39.000Z | from concurrent.futures import ProcessPoolExecutor
from functools import partial
import glob
import numpy as np
import os
from util import audio
import shutil
from datasets import linear_dir, mel_dir, pml_dir, pml_data_dir, wav_dir
def build_from_path(in_dir, out_dir, hparams, num_workers=1, tqdm=lambda x: x):
''... | 41.434109 | 127 | 0.69579 | from concurrent.futures import ProcessPoolExecutor
from functools import partial
import glob
import numpy as np
import os
from util import audio
import shutil
from datasets import linear_dir, mel_dir, pml_dir, pml_data_dir, wav_dir
def build_from_path(in_dir, out_dir, hparams, num_workers=1, tqdm=lambda x: x):
... | true | true |
1c1fc473f47ab5a34092ade647df9eedf5038471 | 1,350 | py | Python | electrum/gui/kivy/nfc_scanner/__init__.py | zcoinofficial/electrum | 5fdc234f817aed1d7d4bcd894fafd99972423314 | [
"MIT"
] | 23 | 2018-02-19T16:59:23.000Z | 2020-09-10T16:58:44.000Z | electrum/gui/kivy/nfc_scanner/__init__.py | zcoinofficial/electrum | 5fdc234f817aed1d7d4bcd894fafd99972423314 | [
"MIT"
] | 37 | 2018-03-04T11:59:44.000Z | 2020-09-27T19:58:21.000Z | electrum/gui/kivy/nfc_scanner/__init__.py | zcoinofficial/electrum | 5fdc234f817aed1d7d4bcd894fafd99972423314 | [
"MIT"
] | 12 | 2018-02-20T01:37:48.000Z | 2020-08-06T06:18:42.000Z | from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.core import core_select_lib
__all__ = ('NFCBase', 'NFCScanner')
class NFCBase(Widget):
''' This is the base Abstract definition class that the actual hardware dependent
implementations would be based on. If you want to def... | 27.55102 | 130 | 0.654074 | from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.core import core_select_lib
__all__ = ('NFCBase', 'NFCScanner')
class NFCBase(Widget):
payload = ObjectProperty(None)
def nfc_init(self):
pass
def nfc_disable(self):
pass
def nfc_enable(self):
... | true | true |
1c1fc4df7e34836edae257ff58f1a0153688ef14 | 22 | py | Python | btd6_memory_info/generated/UnityEngine/Experimental/TerrainAPI/terrain_api.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/Experimental/TerrainAPI/terrain_api.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/Experimental/TerrainAPI/terrain_api.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class TerrainAPI: pass | 22 | 22 | 0.863636 | class TerrainAPI: pass | true | true |
1c1fc5837c8db7a7bfccee73b5ceb661f8e4a0b9 | 3,477 | py | Python | unittests/test_apiv2_user.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 249 | 2016-09-06T21:04:40.000Z | 2018-01-19T15:59:44.000Z | unittests/test_apiv2_user.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 275 | 2021-02-19T15:16:15.000Z | 2022-03-31T21:09:29.000Z | unittests/test_apiv2_user.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 152 | 2016-09-06T21:04:54.000Z | 2018-01-18T08:52:24.000Z | from rest_framework.test import APITestCase, APIClient
from django.urls import reverse
from rest_framework.authtoken.models import Token
class UserTest(APITestCase):
"""
Test the User APIv2 endpoint.
"""
fixtures = ['dojo_testdata.json']
def setUp(self):
token = Token.objects.get(user__us... | 39.067416 | 100 | 0.581823 | from rest_framework.test import APITestCase, APIClient
from django.urls import reverse
from rest_framework.authtoken.models import Token
class UserTest(APITestCase):
fixtures = ['dojo_testdata.json']
def setUp(self):
token = Token.objects.get(user__username='admin')
self.client = APIClient()
... | true | true |
1c1fc59ce02c2e97bfcae81c0ea1f0e024ae16bd | 30,881 | py | Python | tools/check.py | bham-carpentries/2018-10-29-bham_git-novice | cd49ab9ae0210f95fdb48e5c3f40e7184cee51d5 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2018-09-28T17:26:57.000Z | 2018-09-28T17:26:57.000Z | tools/check.py | bham-carpentries/2018-10-29-bham_git-novice | cd49ab9ae0210f95fdb48e5c3f40e7184cee51d5 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2018-11-05T19:39:01.000Z | 2018-11-05T19:39:01.000Z | tools/check.py | bham-carpentries/2018-10-29-bham_git-novice | cd49ab9ae0210f95fdb48e5c3f40e7184cee51d5 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2020-01-09T16:45:44.000Z | 2020-01-09T16:45:44.000Z | #! /usr/bin/env python
"""
Validate Software Carpentry lessons
according to the Markdown template specification described here:
http://software-carpentry.org/blog/2014/10/new-lesson-template-v2.html
Validates the presence of headings, as well as specific sub-nodes.
Contains validators for several kinds of template.
... | 36.37338 | 82 | 0.592144 |
import argparse
import collections
import functools
import glob
import hashlib
import logging
import os
import re
import sys
import CommonMark
import yaml
import validation_helpers as vh
NUMBER_OF_ERRORS = 0
def incr_error(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
global NUMBER_... | true | true |
1c1fc6c6c8d7994ad153f146feb9b86d0d6c0a28 | 9,990 | py | Python | v2020.0/RaspPi.py | ROBO-BEV/Tapomatic | c8bbb06e6c4a64632210959b5be262b8e86db36f | [
"CC-BY-3.0",
"MIT"
] | 1 | 2020-02-20T15:58:09.000Z | 2020-02-20T15:58:09.000Z | v2020.0/RaspPi.py | ROBO-BEV/Tapomatic | c8bbb06e6c4a64632210959b5be262b8e86db36f | [
"CC-BY-3.0",
"MIT"
] | 20 | 2020-02-18T19:15:18.000Z | 2020-07-22T20:31:23.000Z | v2020.0/RaspPi.py | ROBO-BEV/Tapomatic | c8bbb06e6c4a64632210959b5be262b8e86db36f | [
"CC-BY-3.0",
"MIT"
] | 2 | 2020-06-26T14:50:37.000Z | 2020-07-13T16:43:41.000Z | #!/usr/bin/env python3
"""
__author__ = "Blaze Sanders"
__email__ = "blaze@cocotaps.com"
__company__ = "CocoTaps"
__status__ = "Development"
__date__ = "Late Updated: 2020-10-15"
__doc__ = "Class to document the internal configurations of the Raspberry Pi's"
"""
# Allow program to extract filename of the cu... | 34.93007 | 167 | 0.667067 |
"""
__author__ = "Blaze Sanders"
__email__ = "blaze@cocotaps.com"
__company__ = "CocoTaps"
__status__ = "Development"
__date__ = "Late Updated: 2020-10-15"
__doc__ = "Class to document the internal configurations of the Raspberry Pi's"
"""
# Allow program to extract filename of the current file
import os
... | false | true |
1c1fc9b20a26f0ee4ed55686daf2d9431edf1105 | 621 | py | Python | views/mode1.py | lis-space/flood-test | 77a19c3c268627d6842fa9beda6e67ac7875c728 | [
"MIT"
] | null | null | null | views/mode1.py | lis-space/flood-test | 77a19c3c268627d6842fa9beda6e67ac7875c728 | [
"MIT"
] | null | null | null | views/mode1.py | lis-space/flood-test | 77a19c3c268627d6842fa9beda6e67ac7875c728 | [
"MIT"
] | 1 | 2019-10-21T07:13:58.000Z | 2019-10-21T07:13:58.000Z | from aiohttp import web
import config
class Mode1(web.View):
async def get(self):
num = self.request.match_info.get('num')
num = int(num) if num else 0
if num < config.MAX_REDIRECTS - 1:
num += 1
url = self.request.app.router['mode1_num'].url_for(
... | 23.884615 | 70 | 0.507246 | from aiohttp import web
import config
class Mode1(web.View):
async def get(self):
num = self.request.match_info.get('num')
num = int(num) if num else 0
if num < config.MAX_REDIRECTS - 1:
num += 1
url = self.request.app.router['mode1_num'].url_for(
... | true | true |
1c1fc9fd5e44e5df9e824ccf98d911fc5d706890 | 769 | py | Python | staff/admin/instructor_work_day.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | staff/admin/instructor_work_day.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | staff/admin/instructor_work_day.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib import admin
from .. import models
class InstructorWorkDayForm(forms.ModelForm):
class Meta:
model = models.InstructorWorkDay
fields = '__all__'
class InstructorWorkDayAdmin(admin.ModelAdmin):
form = InstructorWorkDayForm
fields = (('instruc... | 30.76 | 71 | 0.644993 | from django import forms
from django.contrib import admin
from .. import models
class InstructorWorkDayForm(forms.ModelForm):
class Meta:
model = models.InstructorWorkDay
fields = '__all__'
class InstructorWorkDayAdmin(admin.ModelAdmin):
form = InstructorWorkDayForm
fields = (('instruc... | true | true |
1c1fca295e8bab2a3fbcc66daffcc81055d5ec36 | 6,159 | py | Python | scripts/eval_baseline_methods.py | tijsmaas/TrafficPrediction | 9129faea8fee8c2d90595d2974f0b11030ad2674 | [
"MIT"
] | 17 | 2020-08-16T04:17:57.000Z | 2022-02-28T01:13:49.000Z | scripts/eval_baseline_methods.py | tijsmaas/TrafficPrediction | 9129faea8fee8c2d90595d2974f0b11030ad2674 | [
"MIT"
] | null | null | null | scripts/eval_baseline_methods.py | tijsmaas/TrafficPrediction | 9129faea8fee8c2d90595d2974f0b11030ad2674 | [
"MIT"
] | 5 | 2020-05-23T07:47:15.000Z | 2021-11-16T15:05:05.000Z | import argparse
import numpy as np
import pandas as pd
from statsmodels.tsa.vector_ar.var_model import VAR
from lib.logger import get_logger
from lib.metrics.metrics_np import masked_rmse_np, masked_mape_np, masked_mae_np
from lib.utils import StandardScaler
def historical_average_predict(df, period=... | 42.475862 | 117 | 0.659036 | import argparse
import numpy as np
import pandas as pd
from statsmodels.tsa.vector_ar.var_model import VAR
from lib.logger import get_logger
from lib.metrics.metrics_np import masked_rmse_np, masked_mape_np, masked_mae_np
from lib.utils import StandardScaler
def historical_average_predict(df, period=... | true | true |
1c1fcb8faf65c85868e730e469524543d35665aa | 5,881 | py | Python | hard-gists/2620735/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/2620735/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/2620735/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
"""
simple example script for running and testing notebooks.
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
# License: Public Domain, but credit is nice (Min RK).
import os,sys,time
im... | 29.113861 | 116 | 0.557048 |
"""
simple example script for running and testing notebooks.
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
import os,sys,time
import base64
import re
from collections import defaultdict
from Queue impor... | false | true |
1c1fcc0ab819d3845cea4baa7465a3e0977c85b8 | 17,238 | py | Python | src/pynwb/image.py | tjd2002/pynwb | 426109b85c2e683d96f2126286fb3369013abb8b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/pynwb/image.py | tjd2002/pynwb | 426109b85c2e683d96f2126286fb3369013abb8b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/pynwb/image.py | tjd2002/pynwb | 426109b85c2e683d96f2126286fb3369013abb8b | [
"BSD-3-Clause-LBNL"
] | null | null | null | import numpy as np
from collections import Iterable
from .form.utils import docval, popargs, call_docval_func
from . import register_class, CORE_NAMESPACE
from .base import TimeSeries, _default_resolution, _default_conversion
@register_class('ImageSeries', CORE_NAMESPACE)
class ImageSeries(TimeSeries):
'''
... | 63.608856 | 114 | 0.600592 | import numpy as np
from collections import Iterable
from .form.utils import docval, popargs, call_docval_func
from . import register_class, CORE_NAMESPACE
from .base import TimeSeries, _default_resolution, _default_conversion
@register_class('ImageSeries', CORE_NAMESPACE)
class ImageSeries(TimeSeries):
__nwbfi... | true | true |
1c1fcc2d115ff58d931b03bb50b4a74973a97e35 | 1,612 | py | Python | amico/preproc.py | nightwnvol/AMICO | 88638dbbe05a89bbf96354ccca79622828bd3c75 | [
"BSD-3-Clause"
] | null | null | null | amico/preproc.py | nightwnvol/AMICO | 88638dbbe05a89bbf96354ccca79622828bd3c75 | [
"BSD-3-Clause"
] | null | null | null | amico/preproc.py | nightwnvol/AMICO | 88638dbbe05a89bbf96354ccca79622828bd3c75 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import numpy as np
from scipy.optimize import minimize
import scipy.special
from tqdm import tqdm
from amico.util import get_verbose
# Kaden's functionals
def F_norm_Diff_K(E0,Signal,sigma_diff):
# ------- SMT functional
sig2 = sigma_diff**2.0
F_norm = np.sum( ( Si... | 40.3 | 149 | 0.578164 | from __future__ import print_function
import numpy as np
from scipy.optimize import minimize
import scipy.special
from tqdm import tqdm
from amico.util import get_verbose
def F_norm_Diff_K(E0,Signal,sigma_diff):
# ------- SMT functional
sig2 = sigma_diff**2.0
F_norm = np.sum( ( Signal - np.sqrt( (np.p... | true | true |
1c1fcc692e992fce8cb774c7f691fdd9f8493c80 | 1,400 | py | Python | torchbenchmark/models/fastNLP/reproduction/coreference_resolution/model/softmax_loss.py | Chillee/benchmark | 91e1b2871327e44b9b7d24d173ca93720fb6565b | [
"BSD-3-Clause"
] | 2,693 | 2018-03-08T03:09:20.000Z | 2022-03-30T07:38:42.000Z | reproduction/coreference_resolution/model/softmax_loss.py | stratoes/fastNLP | a8a458230489710ab945b37ec22e93315230f2de | [
"Apache-2.0"
] | 291 | 2018-07-21T07:43:17.000Z | 2022-03-07T13:06:58.000Z | reproduction/coreference_resolution/model/softmax_loss.py | stratoes/fastNLP | a8a458230489710ab945b37ec22e93315230f2de | [
"Apache-2.0"
] | 514 | 2018-03-09T06:54:25.000Z | 2022-03-26T20:11:44.000Z | from fastNLP.core.losses import LossBase
from reproduction.coreference_resolution.model.preprocess import get_labels
from reproduction.coreference_resolution.model.config import Config
import torch
class SoftmaxLoss(LossBase):
"""
交叉熵loss
允许多标签分类
"""
def __init__(self, antecedent_scores=None, ta... | 42.424242 | 151 | 0.705 | from fastNLP.core.losses import LossBase
from reproduction.coreference_resolution.model.preprocess import get_labels
from reproduction.coreference_resolution.model.config import Config
import torch
class SoftmaxLoss(LossBase):
def __init__(self, antecedent_scores=None, target=None, mention_start_tensor=None, me... | true | true |
1c1fcdcb41cf3f2e19cef73b0d45d8d2575681af | 10,513 | bzl | Python | rust/private/rustdoc.bzl | vaticle/rules_rust | f9ff78318f83281993c9d66a4b0cf4d72c883633 | [
"Apache-2.0"
] | 1 | 2021-08-28T17:47:49.000Z | 2021-08-28T17:47:49.000Z | rust/private/rustdoc.bzl | aproxs/rules_rust | 77285c1aaebc1c55e6e80acc27be4c54aa30076d | [
"Apache-2.0"
] | null | null | null | rust/private/rustdoc.bzl | aproxs/rules_rust | 77285c1aaebc1c55e6e80acc27be4c54aa30076d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.133117 | 126 | 0.624465 |
load("//rust/private:common.bzl", "rust_common")
load("//rust/private:rustc.bzl", "collect_deps", "collect_inputs", "construct_arguments")
load("//rust/private:utils.bzl", "dedent", "find_cc_toolchain", "find_toolchain")
def _strip_crate_info_output(crate_info):
return rust_common.create_crate_info(... | true | true |
1c1fce9db5f51ab419dba9d2891fce57e99f8ce0 | 5,969 | py | Python | python-threatexchange/threatexchange/fetcher/simple/state.py | Samyakk123/ThreatExchange | 447b5e9738aff5d1cc895f6208a0d3bc15a14ebc | [
"BSD-3-Clause"
] | 1 | 2022-02-08T01:32:58.000Z | 2022-02-08T01:32:58.000Z | python-threatexchange/threatexchange/fetcher/simple/state.py | Samyakk123/ThreatExchange | 447b5e9738aff5d1cc895f6208a0d3bc15a14ebc | [
"BSD-3-Clause"
] | null | null | null | python-threatexchange/threatexchange/fetcher/simple/state.py | Samyakk123/ThreatExchange | 447b5e9738aff5d1cc895f6208a0d3bc15a14ebc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from collections import defaultdict
from dataclasses import dataclass, field
import logging
import typing as t
from threatexchange.fetcher.fetch_api import SignalExchangeAPI
from threatexchange.signal_type.signal_base import SignalType
from threa... | 32.617486 | 88 | 0.654884 |
from collections import defaultdict
from dataclasses import dataclass, field
import logging
import typing as t
from threatexchange.fetcher.fetch_api import SignalExchangeAPI
from threatexchange.signal_type.signal_base import SignalType
from threatexchange.fetcher import fetch_state
from threatexchange.fetcher.colla... | true | true |
1c1fcfb75945af8f5be0c99806f1dc488cf270be | 8,165 | py | Python | tests/components/alexa/test_smart_home.py | jamescurtin/home-assistant | 6a9968ccb9b0082f5629e50955549d432aba7d90 | [
"Apache-2.0"
] | 1 | 2017-09-26T06:13:10.000Z | 2017-09-26T06:13:10.000Z | tests/components/alexa/test_smart_home.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | null | null | null | tests/components/alexa/test_smart_home.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | null | null | null | """Test for smart home alexa support."""
import asyncio
from uuid import uuid4
import pytest
from homeassistant.components.alexa import smart_home
from tests.common import async_mock_service
def get_new_request(namespace, name, endpoint=None):
"""Generate a new API message."""
raw_msg = {
'directiv... | 31.164122 | 79 | 0.617881 | import asyncio
from uuid import uuid4
import pytest
from homeassistant.components.alexa import smart_home
from tests.common import async_mock_service
def get_new_request(namespace, name, endpoint=None):
raw_msg = {
'directive': {
'header': {
'namespace': namespace,
... | true | true |
1c1fd1352ddfb7ceac662c827fc83f7acf69f848 | 2,734 | py | Python | bids/variables/tests/test_entities.py | KirstieJane/pybids | 4d4115311bf4d7042bfef23007b8e8a33972d88e | [
"MIT"
] | null | null | null | bids/variables/tests/test_entities.py | KirstieJane/pybids | 4d4115311bf4d7042bfef23007b8e8a33972d88e | [
"MIT"
] | null | null | null | bids/variables/tests/test_entities.py | KirstieJane/pybids | 4d4115311bf4d7042bfef23007b8e8a33972d88e | [
"MIT"
] | null | null | null | from bids.layout import BIDSLayout
from bids.variables.entities import RunNode, Node, NodeIndex
from bids.variables import load_variables
from bids.variables import BIDSRunVariableCollection
import pytest
from os.path import join
from bids.tests import get_test_data_path
@pytest.fixture(scope="module")
def layout1():... | 33.753086 | 74 | 0.67447 | from bids.layout import BIDSLayout
from bids.variables.entities import RunNode, Node, NodeIndex
from bids.variables import load_variables
from bids.variables import BIDSRunVariableCollection
import pytest
from os.path import join
from bids.tests import get_test_data_path
@pytest.fixture(scope="module")
def layout1():... | true | true |
1c1fd2f9718cd0e121ffb8953a0281885586006d | 9,693 | py | Python | examples/compare_composites.py | dmargala/tpcorr | 64544a4ca51f622e5847407d191fc9a52e0e7e5c | [
"MIT"
] | null | null | null | examples/compare_composites.py | dmargala/tpcorr | 64544a4ca51f622e5847407d191fc9a52e0e7e5c | [
"MIT"
] | null | null | null | examples/compare_composites.py | dmargala/tpcorr | 64544a4ca51f622e5847407d191fc9a52e0e7e5c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
"""
import argparse
import os
import h5py
import numpy as np
from astropy.io import fits
import scipy.interpolate
import scipy.stats.mstats as mstats
import scipy.signal
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 14})
mpl.rcParams.update({'savefig.dpi': 100})... | 42.889381 | 130 | 0.678634 |
"""
"""
import argparse
import os
import h5py
import numpy as np
from astropy.io import fits
import scipy.interpolate
import scipy.stats.mstats as mstats
import scipy.signal
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 14})
mpl.rcParams.update({'savefig.dpi': 100})
mpl.rcParams.update(... | false | true |
1c1fd4256db985a3c568e298bdb50b84de6fafeb | 36,793 | py | Python | sdk/python/pulumi_azure_native/network/v20180801/express_route_circuit.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180801/express_route_circuit.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180801/express_route_circuit.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 55.494721 | 5,784 | 0.699861 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['ExpressRouteCircuitArgs', 'ExpressRouteCircuit']
@pulumi.input_type
class ExpressRouteC... | true | true |
1c1fd56a9e1a3223222a3044ebd6034331aa8895 | 1,985 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/input_message_pinned.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_message_pinned.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_message_pinned.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.015625 | 103 | 0.631738 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
| true | true |
1c1fd628797bda60225fd4c5faf13fdd6b78410d | 7,579 | py | Python | selfdrive/car/gm/carstate.py | darknight11ish/openpilot | 0b7391f014f793044f8fdd5e3495098ca5c5e947 | [
"MIT"
] | 5 | 2021-11-12T03:18:47.000Z | 2021-11-20T05:23:26.000Z | selfdrive/car/gm/carstate.py | darknight11ish/openpilot | 0b7391f014f793044f8fdd5e3495098ca5c5e947 | [
"MIT"
] | null | null | null | selfdrive/car/gm/carstate.py | darknight11ish/openpilot | 0b7391f014f793044f8fdd5e3495098ca5c5e947 | [
"MIT"
] | null | null | null | from cereal import car
from common.numpy_fast import mean
from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.gm.values import DBC, CAR, AccState, CanBus, \
CruiseButtons, STEER_THR... | 38.472081 | 109 | 0.680433 | from cereal import car
from common.numpy_fast import mean
from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.gm.values import DBC, CAR, AccState, CanBus, \
CruiseButtons, STEER_THR... | true | true |
1c1fd645a60a41ede8a57a1d3310d5f3479dd57c | 2,057 | py | Python | stubs.min/Autodesk/Revit/DB/__init___parts/SweptProfile.py | denfromufa/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2017-07-07T11:15:45.000Z | 2017-07-07T11:15:45.000Z | stubs.min/Autodesk/Revit/DB/__init___parts/SweptProfile.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Autodesk/Revit/DB/__init___parts/SweptProfile.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class SweptProfile(object,IDisposable):
""" Represents an extruded profile swept along a driving curve. """
def Dispose(self):
""" Dispose(self: SweptProfile) """
pass
def GetDrivingCurve(self):
"""
GetDrivingCurve(self: SweptProfile) -> Curve
Provides access to the curve that dictates the p... | 33.721311 | 215 | 0.693243 | class SweptProfile(object,IDisposable):
def Dispose(self):
pass
def GetDrivingCurve(self):
GetSweptProfile(self: SweptProfile) -> Profile
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
""" x.__init__(...) initializes x; see x.__class__.__doc__ for s... | true | true |
1c1fd73ff016799308f6fce2be8e5feba39cd30d | 908 | py | Python | BlurredMask.py | aseber/OpenCV | 9b5deef24acdc3664e7989e78d8935bbd140a880 | [
"Apache-2.0"
] | 2 | 2016-03-27T01:50:05.000Z | 2020-05-17T11:44:31.000Z | BlurredMask.py | aseber/OpenCV | 9b5deef24acdc3664e7989e78d8935bbd140a880 | [
"Apache-2.0"
] | null | null | null | BlurredMask.py | aseber/OpenCV | 9b5deef24acdc3664e7989e78d8935bbd140a880 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy
def main():
##Use default camera
camera = cv2.VideoCapture(-1)
# cv2.namedwindow('Original')
while camera.isOpened():
_, image = camera.read()
cv2.imshow('Original', image)
#print image
cv2.waitKey(5)
hsvImage = cv2.cvtColor(image, cv2.CO... | 25.942857 | 106 | 0.637665 | import cv2
import numpy
def main():
ideoCapture(-1)
while camera.isOpened():
_, image = camera.read()
cv2.imshow('Original', image)
cv2.waitKey(5)
hsvImage = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
lower_yellow = numpy.array([25,0,120])
upper_yello... | true | true |
1c1fd7852e50650dc968ae520e08ad4f3aff1b80 | 30,940 | py | Python | modules/ts/misc/table_formatter.py | ghennadii/opencv | c6a4bad3692e62ff6733fe98f51b557d75ce65a0 | [
"BSD-3-Clause"
] | 163 | 2019-06-04T02:00:58.000Z | 2022-03-26T14:23:10.000Z | modules/ts/misc/table_formatter.py | eozmen410/opencv | 1a9695490a42cb30c0ac895022ec1145f7b71660 | [
"BSD-3-Clause"
] | 8 | 2019-11-03T10:16:58.000Z | 2022-03-16T17:00:14.000Z | modules/ts/misc/table_formatter.py | eozmen410/opencv | 1a9695490a42cb30c0ac895022ec1145f7b71660 | [
"BSD-3-Clause"
] | 29 | 2019-01-08T05:43:58.000Z | 2022-03-24T00:07:03.000Z | #!/usr/bin/env python
from __future__ import print_function
import sys, re, os.path, cgi, stat, math
from optparse import OptionParser
from color import getColorizer, dummyColorizer
class tblCell(object):
def __init__(self, text, value = None, props = None):
self.text = text
self.value = value
... | 38.197531 | 382 | 0.523885 |
from __future__ import print_function
import sys, re, os.path, cgi, stat, math
from optparse import OptionParser
from color import getColorizer, dummyColorizer
class tblCell(object):
def __init__(self, text, value = None, props = None):
self.text = text
self.value = value
self.props = pro... | true | true |
1c1fd7a9cb244987e03f4249f452ab00a2fcc747 | 1,890 | py | Python | nkzalimi/migrations/env.py | nkzalimi/nkzalimi-backend | d30622b5f49e9555c980083545b7cd11e746976f | [
"MIT"
] | null | null | null | nkzalimi/migrations/env.py | nkzalimi/nkzalimi-backend | d30622b5f49e9555c980083545b7cd11e746976f | [
"MIT"
] | null | null | null | nkzalimi/migrations/env.py | nkzalimi/nkzalimi-backend | d30622b5f49e9555c980083545b7cd11e746976f | [
"MIT"
] | null | null | null | from __future__ import with_statement
from alembic import context
from nkzalimi.orm import Base
from sqlalchemy import engine_from_config
from sqlalchemy import pool
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# add your model's Meta... | 26.619718 | 69 | 0.721164 | from __future__ import with_statement
from alembic import context
from nkzalimi.orm import Base
from sqlalchemy import engine_from_config
from sqlalchemy import pool
config = context.config
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
target_metadata = Base.me... | true | true |
1c1fd7c823f59695c04308269a609e9d7e1122aa | 59 | py | Python | side_effects/__init__.py | yunojuno/django-side-effects | c236a15799436c31994cb8d703c50f6f12c02ef6 | [
"MIT"
] | 8 | 2017-03-16T22:17:06.000Z | 2021-09-27T16:53:12.000Z | side_effects/__init__.py | yunojuno/django-side-effects | c236a15799436c31994cb8d703c50f6f12c02ef6 | [
"MIT"
] | 9 | 2017-04-04T20:07:09.000Z | 2020-11-30T14:04:40.000Z | side_effects/__init__.py | yunojuno/django-side-effects | c236a15799436c31994cb8d703c50f6f12c02ef6 | [
"MIT"
] | 2 | 2017-04-04T19:40:30.000Z | 2019-07-03T09:28:51.000Z | default_app_config = "side_effects.apps.SideEffectsConfig"
| 29.5 | 58 | 0.864407 | default_app_config = "side_effects.apps.SideEffectsConfig"
| true | true |
1c1fd7dbb61ff5f65b5d6cd8aed734416dee173b | 3,569 | py | Python | Lib/ctypes/test/test_values.py | Ricky-Wilson/Python | 9896d7a9901dabea4b3d555af471577a624d1b95 | [
"PSF-2.0"
] | 6 | 2016-03-15T19:07:14.000Z | 2018-08-15T13:11:03.000Z | Lib/ctypes/test/test_values.py | Ricky-Wilson/Python | 9896d7a9901dabea4b3d555af471577a624d1b95 | [
"PSF-2.0"
] | null | null | null | Lib/ctypes/test/test_values.py | Ricky-Wilson/Python | 9896d7a9901dabea4b3d555af471577a624d1b95 | [
"PSF-2.0"
] | 3 | 2016-04-21T07:58:27.000Z | 2016-05-06T21:34:44.000Z | """
A testcase which accesses *values* in a dll.
"""
import unittest
import sys
from ctypes import *
import _ctypes_test
class ValuesTestCase(unittest.TestCase):
def test_an_integer(self):
# This test checks and changes an integer stored inside the
# _ctypes_test dll/shared lib.
ctdll = ... | 37.177083 | 78 | 0.630149 |
import unittest
import sys
from ctypes import *
import _ctypes_test
class ValuesTestCase(unittest.TestCase):
def test_an_integer(self):
ctdll = CDLL(_ctypes_test.__file__)
an_integer = c_int.in_dll(ctdll, "an_integer")
x = an_integer.value
self.assertEqual(x, ct... | true | true |
1c1fd9021805add490b239bc4d6908de4e3a83e5 | 2,021 | py | Python | setup.py | wuschi/mopidy-phoniebox-idletimer | 9e1b63aefd91f4f5320f343a6548461fcf37ed79 | [
"Apache-2.0"
] | 1 | 2020-07-15T15:09:47.000Z | 2020-07-15T15:09:47.000Z | setup.py | wuschi/mopidy-phoniebox | 9e1b63aefd91f4f5320f343a6548461fcf37ed79 | [
"Apache-2.0"
] | null | null | null | setup.py | wuschi/mopidy-phoniebox | 9e1b63aefd91f4f5320f343a6548461fcf37ed79 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 Thomas Wunschel (https://github.com/wuschi)
#
# 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 ... | 31.092308 | 75 | 0.647699 |
from __future__ import unicode_literals
import re
from setuptools import find_packages, setup
def get_version(filename):
with open(filename) as fh:
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read()))
return metadata['version']
setup(
name='Mopidy-Phoniebox',
... | true | true |
1c1fd9a8dd2500b174984a407728a485d8bcc228 | 4,030 | py | Python | setup.py | nawaidshamim/PyAthenaJDBC | fc1bf5cc750d17c0af6cd65f21cc1ca93f083ded | [
"MIT"
] | null | null | null | setup.py | nawaidshamim/PyAthenaJDBC | fc1bf5cc750d17c0af6cd65f21cc1ca93f083ded | [
"MIT"
] | null | null | null | setup.py | nawaidshamim/PyAthenaJDBC | fc1bf5cc750d17c0af6cd65f21cc1ca93f083ded | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import codecs
import os
import sys
from glob import glob
from setuptools import Command, find_packages, setup
from setuptools.command.install import install
import pyathenajdbc
if sys.version_info[0] == 2:
from urllib import ur... | 26 | 94 | 0.621092 |
from __future__ import print_function
import codecs
import os
import sys
from glob import glob
from setuptools import Command, find_packages, setup
from setuptools.command.install import install
import pyathenajdbc
if sys.version_info[0] == 2:
from urllib import urlretrieve
else:
from urllib.request impor... | true | true |
1c1fdbb416e2fa6492c03dab6ee3beab009291a4 | 101,183 | py | Python | mbuild/compound.py | dubosese/mbuild | 5823c22ded6d31dc00bb3e8e30583720414ddfe0 | [
"MIT"
] | null | null | null | mbuild/compound.py | dubosese/mbuild | 5823c22ded6d31dc00bb3e8e30583720414ddfe0 | [
"MIT"
] | null | null | null | mbuild/compound.py | dubosese/mbuild | 5823c22ded6d31dc00bb3e8e30583720414ddfe0 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
__all__ = ['load', 'clone', 'Compound', 'Particle']
import collections
from collections import OrderedDict, defaultdict
from copy import deepcopy
import itertools
import os
import sys
import tempfile
from warnings import warn
import mdtraj as md
from mdtraj.core.elemen... | 39.570982 | 100 | 0.581511 | from __future__ import print_function, division
__all__ = ['load', 'clone', 'Compound', 'Particle']
import collections
from collections import OrderedDict, defaultdict
from copy import deepcopy
import itertools
import os
import sys
import tempfile
from warnings import warn
import mdtraj as md
from mdtraj.core.elemen... | true | true |
1c1fdbcbac7c89bb459c1432e6ddbadb06b4b754 | 4,302 | py | Python | benchmark/startQiskit_Class3062.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class3062.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class3062.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=43
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.416 | 140 | 0.645979 |
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_xor(s: str, t: str) -> str:
l... | true | true |
1c1fdd57af2971abd65cb72c7d14fbe417c01caa | 3,861 | py | Python | auto_forensicate/macdisk.py | meeehow/GiftStick | 2f43ad7bd433c7dafb155f34d649bdd3c3f40053 | [
"Apache-2.0"
] | 1 | 2021-12-02T10:18:57.000Z | 2021-12-02T10:18:57.000Z | auto_forensicate/macdisk.py | meeehow/GiftStick | 2f43ad7bd433c7dafb155f34d649bdd3c3f40053 | [
"Apache-2.0"
] | null | null | null | auto_forensicate/macdisk.py | meeehow/GiftStick | 2f43ad7bd433c7dafb155f34d649bdd3c3f40053 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 Google LLC
#
# 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 o... | 29.473282 | 79 | 0.692308 |
import subprocess
import sys
try:
import biplist
except ImportError as e:
if sys.platform == 'darwin':
print('It looks like you are acquiring raw disk on a MacOS platform. \n'
'Please install the biplist python module')
class MacDiskError(Exception):
def _DictFromSubprocess(command)... | true | true |
1c1fde6a89e11da5fb0173003e88daeb7521445a | 2,929 | py | Python | hexonet/apiconnector/socketconfig.py | qyanu-pull-requests/python-sdk | ae27a7b680637025529e3421016d8931cbc28306 | [
"MIT"
] | null | null | null | hexonet/apiconnector/socketconfig.py | qyanu-pull-requests/python-sdk | ae27a7b680637025529e3421016d8931cbc28306 | [
"MIT"
] | null | null | null | hexonet/apiconnector/socketconfig.py | qyanu-pull-requests/python-sdk | ae27a7b680637025529e3421016d8931cbc28306 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
hexonet.apiconnector.socketconfig
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module covers all necessary functionality to
pre-configure http communication with our Backend System.
:copyright: © 2018 by HEXONET GmbH.
:license: MIT, see LICENSE for more details.
"""
from u... | 25.920354 | 99 | 0.544554 |
from urllib.parse import quote, unquote
class SocketConfig(object):
def __init__(self):
self.__entity = None
self.__login = None
self.__otp = None
self.__pw = None
self.__remoteaddr = None
self.__session = Non... | true | true |
1c1fdeb20acef83bd0b0271e0b77d5c9a8688d8a | 260 | py | Python | tests/test_group.py | ideoforms/python-supercollider | 43b6cfdf41dea48830b767159865a3044a792151 | [
"MIT"
] | 48 | 2019-10-07T14:59:14.000Z | 2022-03-30T04:58:32.000Z | tests/test_group.py | ideoforms/python-supercollider | 43b6cfdf41dea48830b767159865a3044a792151 | [
"MIT"
] | 11 | 2019-10-07T08:48:10.000Z | 2021-07-18T19:55:37.000Z | tests/test_group.py | ideoforms/python-supercollider | 43b6cfdf41dea48830b767159865a3044a792151 | [
"MIT"
] | 2 | 2019-12-17T14:32:20.000Z | 2021-07-11T11:23:58.000Z | import supercollider
from tests.shared import server
def test_group(server):
group1 = supercollider.Group(server)
assert group1.id > 0
group2 = supercollider.Group(server)
assert group2.id == group1.id + 1
group1.free()
group2.free()
| 21.666667 | 40 | 0.703846 | import supercollider
from tests.shared import server
def test_group(server):
group1 = supercollider.Group(server)
assert group1.id > 0
group2 = supercollider.Group(server)
assert group2.id == group1.id + 1
group1.free()
group2.free()
| true | true |
1c1fdf5bbffd0c796b0bab794c72167807b95b9b | 5,088 | py | Python | web/server/codechecker_server/database/config_db_model.py | LebedevRI/codechecker | f4548444851e19c8cc7b8fd621f3dcdf987d7140 | [
"Apache-2.0"
] | null | null | null | web/server/codechecker_server/database/config_db_model.py | LebedevRI/codechecker | f4548444851e19c8cc7b8fd621f3dcdf987d7140 | [
"Apache-2.0"
] | null | null | null | web/server/codechecker_server/database/config_db_model.py | LebedevRI/codechecker | f4548444851e19c8cc7b8fd621f3dcdf987d7140 | [
"Apache-2.0"
] | 1 | 2021-01-27T21:45:14.000Z | 2021-01-27T21:45:14.000Z | # -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... | 32.615385 | 77 | 0.652909 |
from datetime import datetime
import sys
from sqlalchemy import MetaData, Column, Integer, Enum, String, Boolean, \
ForeignKey, CHAR, DateTime, Text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql.expression import false, true
from ..permissions import get_permissions
CC_META =... | true | true |
1c1fe11896f6d619a61ea268c55b93beb6c9a27b | 226 | py | Python | thonny/plugins/esp/esp8266_api_stubs/ds18x20.py | shreyas202/thonny | ef894c359200b0591cf98451907243395b817c63 | [
"MIT"
] | 2 | 2020-02-13T06:41:07.000Z | 2022-02-14T09:28:02.000Z | Thonny/Lib/site-packages/thonny/plugins/esp/esp32_api_stubs/ds18x20.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 30 | 2019-01-04T10:14:56.000Z | 2020-10-12T14:00:31.000Z | Thonny/Lib/site-packages/thonny/plugins/esp/esp32_api_stubs/ds18x20.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 3 | 2018-11-24T14:00:30.000Z | 2019-07-02T02:32:26.000Z | class DS18X20:
""
def convert_temp():
pass
def read_scratch():
pass
def read_temp():
pass
def scan():
pass
def write_scratch():
pass
def const():
pass
| 10.272727 | 24 | 0.482301 | class DS18X20:
def convert_temp():
pass
def read_scratch():
pass
def read_temp():
pass
def scan():
pass
def write_scratch():
pass
def const():
pass
| true | true |
1c1fe2e2818d603743afec3f9c352ef70f01e00a | 5,313 | py | Python | src/sampling.py | FrancescoNegri/federated-learning-gmm | 4351b5a4c9ff30df2c6d2244029f73ae02492c76 | [
"MIT"
] | 1 | 2021-04-11T16:52:46.000Z | 2021-04-11T16:52:46.000Z | src/sampling.py | FrancescoNegri/federated-learning-gmm | 4351b5a4c9ff30df2c6d2244029f73ae02492c76 | [
"MIT"
] | null | null | null | src/sampling.py | FrancescoNegri/federated-learning-gmm | 4351b5a4c9ff30df2c6d2244029f73ae02492c76 | [
"MIT"
] | null | null | null | import math
import numpy as np
# from torchvision import datasets, transforms
def sample_iid(dataset, n_clients):
n_samples = int(len(dataset) / n_clients)
clients_groups, all_idxs = {}, [i for i in range(len(dataset))]
for i in range(n_clients):
clients_groups[i] = set(np.random.choice(all_id... | 40.869231 | 105 | 0.587615 | import math
import numpy as np
def sample_iid(dataset, n_clients):
n_samples = int(len(dataset) / n_clients)
clients_groups, all_idxs = {}, [i for i in range(len(dataset))]
for i in range(n_clients):
clients_groups[i] = set(np.random.choice(all_idxs, n_samples, replace=False))
all_idx... | true | true |
1c1fe2fa4aec7bb8ace5bbb698d8bacbf6d3734c | 17,681 | py | Python | tests/inventory/pipelines/test_data/fake_cloudsql.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | 1 | 2018-03-26T08:15:21.000Z | 2018-03-26T08:15:21.000Z | tests/inventory/pipelines/test_data/fake_cloudsql.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | tests/inventory/pipelines/test_data/fake_cloudsql.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 43.982587 | 1,248 | 0.629602 |
from copy import deepcopy
FAKE_CLOUDSQL_MAP = [{
'project_number':
11111,
'instances': [{
u'backendType':
u'SECOND_GEN',
u'connectionName':
u'project-1:us-east1:cloudsql-instance',
u'databaseVersion':
u'MYSQL_5_7',
u'eta... | true | true |
1c1fe371190299f459d535f2cb9fcaa3b96828ba | 1,930 | py | Python | tests/unit/student_t_distribution_test.py | konradarchicinski/stpp | 8e4d959d96cd79e74c866e75e32e961c78c56fd1 | [
"MIT"
] | 1 | 2021-12-01T05:41:27.000Z | 2021-12-01T05:41:27.000Z | tests/unit/student_t_distribution_test.py | konradarchicinski/stpp | 8e4d959d96cd79e74c866e75e32e961c78c56fd1 | [
"MIT"
] | 5 | 2021-05-17T07:35:58.000Z | 2021-05-17T07:38:38.000Z | tests/unit/student_t_distribution_test.py | konradarchicinski/stpp | 8e4d959d96cd79e74c866e75e32e961c78c56fd1 | [
"MIT"
] | null | null | null | import unittest
import fistpp as fs
class StudentTDistributionTests(unittest.TestCase):
def setUp(self):
self.studentt = fs.StudentTDistribution()
self.expected_values = [
-7.17318221978239200, -4.60409487134981700, -3.74694738797919150,
-2.77644510519782400, -2.13184678632... | 41.06383 | 77 | 0.618653 | import unittest
import fistpp as fs
class StudentTDistributionTests(unittest.TestCase):
def setUp(self):
self.studentt = fs.StudentTDistribution()
self.expected_values = [
-7.17318221978239200, -4.60409487134981700, -3.74694738797919150,
-2.77644510519782400, -2.13184678632... | true | true |
1c1fe37c49d159d0fe65752b6211d8003e52b037 | 2,124 | py | Python | config.py | Fayis9633/BILALAUTO | 8801c9def74b8c6fb245a4240415b010f6511c4a | [
"MIT"
] | 1 | 2022-03-15T15:36:19.000Z | 2022-03-15T15:36:19.000Z | config.py | Fayis9633/BILALAUTO | 8801c9def74b8c6fb245a4240415b010f6511c4a | [
"MIT"
] | null | null | null | config.py | Fayis9633/BILALAUTO | 8801c9def74b8c6fb245a4240415b010f6511c4a | [
"MIT"
] | null | null | null | import re
from os import environ
from translation import LuciferMoringstar
id_pattern = re.compile(r'^.\d+$')
def is_enabled(value, default):
if value.lower() in ["true", "yes", "1", "enable", "on"]:
return True
elif value.lower() in ["false", "no", "0", "disable", "off"]:
return False
else:... | 40.846154 | 111 | 0.686441 | import re
from os import environ
from translation import LuciferMoringstar
id_pattern = re.compile(r'^.\d+$')
def is_enabled(value, default):
if value.lower() in ["true", "yes", "1", "enable", "on"]:
return True
elif value.lower() in ["false", "no", "0", "disable", "off"]:
return False
else:... | true | true |
1c1fe3994908cf35329e1f0fb664bb0f12698e2a | 1,380 | py | Python | setup.py | vkmrishad/python-http-client | 3f851276120254e49eaef0545fc5ef59dffde793 | [
"MIT"
] | null | null | null | setup.py | vkmrishad/python-http-client | 3f851276120254e49eaef0545fc5ef59dffde793 | [
"MIT"
] | null | null | null | setup.py | vkmrishad/python-http-client | 3f851276120254e49eaef0545fc5ef59dffde793 | [
"MIT"
] | null | null | null | import io
import os
from distutils.file_util import copy_file
from setuptools import find_packages, setup
dir_path = os.path.abspath(os.path.dirname(__file__))
readme = io.open(os.path.join(dir_path, 'README.rst'), encoding='utf-8').read()
version = io.open(os.path.join(dir_path, 'VERSION.txt'), encoding='utf-8').rea... | 32.857143 | 89 | 0.637681 | import io
import os
from distutils.file_util import copy_file
from setuptools import find_packages, setup
dir_path = os.path.abspath(os.path.dirname(__file__))
readme = io.open(os.path.join(dir_path, 'README.rst'), encoding='utf-8').read()
version = io.open(os.path.join(dir_path, 'VERSION.txt'), encoding='utf-8').rea... | true | true |
1c1fe3abad54c60bd0c3d671ed3dee6ccbbb6d20 | 1,120 | py | Python | app/admin/forms.py | maxnovais/Flapy_Blog | e543faa4c8f99ef3a2cdb1470de507d9cfb330bf | [
"Apache-2.0"
] | null | null | null | app/admin/forms.py | maxnovais/Flapy_Blog | e543faa4c8f99ef3a2cdb1470de507d9cfb330bf | [
"Apache-2.0"
] | null | null | null | app/admin/forms.py | maxnovais/Flapy_Blog | e543faa4c8f99ef3a2cdb1470de507d9cfb330bf | [
"Apache-2.0"
] | null | null | null | from flask.ext.wtf import Form
from flask.ext.pagedown.fields import PageDownField
from wtforms import TextField, SubmitField
from wtforms.validators import Required, Length
class EditProfileForm(Form):
first_name = TextField('First Name', [Required(), Length(1, 255)])
last_name = TextField('Last Name', [Requ... | 30.27027 | 70 | 0.665179 | from flask.ext.wtf import Form
from flask.ext.pagedown.fields import PageDownField
from wtforms import TextField, SubmitField
from wtforms.validators import Required, Length
class EditProfileForm(Form):
first_name = TextField('First Name', [Required(), Length(1, 255)])
last_name = TextField('Last Name', [Requ... | true | true |
1c1fe3fe5d84a06873bdcf56567d541d892d6fc9 | 555 | py | Python | HelloWorld/repfields.py | Th3RedMan/python-course | fa5e73903d319aeca89af91aa41a047c5158993c | [
"MIT"
] | null | null | null | HelloWorld/repfields.py | Th3RedMan/python-course | fa5e73903d319aeca89af91aa41a047c5158993c | [
"MIT"
] | null | null | null | HelloWorld/repfields.py | Th3RedMan/python-course | fa5e73903d319aeca89af91aa41a047c5158993c | [
"MIT"
] | null | null | null | age = 24
print("My age is {0} years" .format(age))
print("There are {0} days in {1}, {2}, {3}, {4}, {5}, {6}, and {7}"
.format(31, "Jan", "Mar", "May", "Jul", "Aug", "Oct", "Dec"))
print("There are {0} days in Jan, Mar, May, Jul, Aug, Oct, and Dec".format(31))
print("Jan: {2}, Feb: {0}, Mar: {2}, Apr: {1}, May:... | 21.346154 | 117 | 0.486486 | age = 24
print("My age is {0} years" .format(age))
print("There are {0} days in {1}, {2}, {3}, {4}, {5}, {6}, and {7}"
.format(31, "Jan", "Mar", "May", "Jul", "Aug", "Oct", "Dec"))
print("There are {0} days in Jan, Mar, May, Jul, Aug, Oct, and Dec".format(31))
print("Jan: {2}, Feb: {0}, Mar: {2}, Apr: {1}, May:... | true | true |
1c1fe4282f5608924760ca7883ab7db094eeb4c0 | 2,381 | py | Python | opcode/opcode/__init__.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 126 | 2019-07-19T14:42:41.000Z | 2022-03-21T22:22:19.000Z | opcode/opcode/__init__.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 38 | 2019-08-28T01:46:31.000Z | 2022-03-17T05:46:51.000Z | opcode/opcode/__init__.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 55 | 2019-08-02T09:32:33.000Z | 2021-12-22T11:25:51.000Z | # This file is part of the standard library of Pycopy project, minimalist
# and lightweight Python implementation.
#
# https://github.com/pfalcon/pycopy
# https://github.com/pfalcon/pycopy-lib
#
# The MIT License (MIT)
#
# Copyright (c) 2019 Paul Sokolovsky
#
# Permission is hereby granted, free of charge, to any perso... | 39.683333 | 103 | 0.678286 |
from .upyopcodes import *
from .upyopmap import *
def stack_effect(opcode, *args):
delta = op_stack_effect[opcode]
if delta is not None:
return delta
if opcode == opmap["CALL_FUNCTION"]:
return -(1 + args[0] + args[1] * 2) + 1
if opcode == opmap["CALL_FUNCTI... | true | true |
1c1fe5a66915d102f7c24f21baf1c4b049dc9a75 | 575 | py | Python | ComputeScore/Injection Removal/ImageDiff.py | samik1986/ML_Semantic_Segmenation_NMI | eaf963e13e18ce091edb45dcb0cc67727ef32f1a | [
"MIT"
] | 13 | 2020-07-13T17:44:39.000Z | 2021-12-15T01:44:24.000Z | ComputeScore/Injection Removal/ImageDiff.py | samik1986/ML_Semantic_Segmenation_NMI | eaf963e13e18ce091edb45dcb0cc67727ef32f1a | [
"MIT"
] | 22 | 2020-03-31T11:48:27.000Z | 2022-02-10T01:50:35.000Z | ComputeScore/Injection Removal/ImageDiff.py | samik1986/ML_Semantic_Segmenation_NMI | eaf963e13e18ce091edb45dcb0cc67727ef32f1a | [
"MIT"
] | 5 | 2020-11-07T11:06:53.000Z | 2021-11-13T19:19:07.000Z | import os
from PIL import Image
# image_path = 'data/FINALIZE/Injection_84.tif'
#
#
# image = Image.open(image_path)
# cropped = image.crop((0, 0, 8192, 11264))
# cropped.save('data/FINALIZE/Injection_84_cropped.tif')
image_path = '001.tif'
mask_path = 'StitchedImage_Z084_L001_InjectionMask.tif'
output_... | 26.136364 | 57 | 0.718261 | import os
from PIL import Image
image_path = '001.tif'
mask_path = 'StitchedImage_Z084_L001_InjectionMask.tif'
output_path = 'Samik_84_masked.tif'
image2 = Image.open(image_path)
image1 = Image.new('L', image2.size, 0)
mask = Image.open(mask_path)
mask = mask.crop((0, 0, 8192, 11264))
new_image... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.