hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70c25e9166e6ebd1af0d494cb03847dc405a4fb | 285 | py | Python | setup.py | DK1515/cli | f89be9083c4f44306118a3ef27c21e63ab21388c | [
"MIT"
] | 1 | 2018-11-29T23:21:47.000Z | 2018-11-29T23:21:47.000Z | setup.py | DK1515/cli | f89be9083c4f44306118a3ef27c21e63ab21388c | [
"MIT"
] | 7 | 2018-11-15T17:45:06.000Z | 2018-11-15T17:45:30.000Z | ClickTest/setup.py | DK1515/REST_API_Project_5 | 708b13d5b81cbb1a5efeef3093186159327b2043 | [
"MIT"
] | 3 | 2018-10-23T17:34:03.000Z | 2018-11-12T23:14:13.000Z | from setuptools import setup
setup(
name="myhello",
version='0.1',
py_modules=['colors'],
include_package_data=True,
install_requires=[
'Click',
'colorama',
],
entry_points='''
[console_scripts]
myhello=hello:cli
''',
)
| 16.764706 | 30 | 0.564912 | from setuptools import setup
setup(
name="myhello",
version='0.1',
py_modules=['colors'],
include_package_data=True,
install_requires=[
'Click',
'colorama',
],
entry_points='''
[console_scripts]
myhello=hello:cli
''',
)
| true | true |
f70c25f3f908dc76375bcf8842ae66d0664b7932 | 2,421 | py | Python | zcrmsdk/src/com/zoho/crm/api/modules/argument.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/modules/argument.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/modules/argument.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Argument(object):
def __init__(self):
"""Creates an instance of Argument"""
self.__name = Non... | 24.21 | 100 | 0.712515 | try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Argument(object):
def __init__(self):
self.__name = None
self.__value = None
self.__key_mod... | true | true |
f70c2728edd3ea8062890acf9c7820743b28fe2a | 9,753 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/bfd/bfdsession.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/bfd/bfdsession.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/bfd/bfdsession.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 26.008 | 191 | 0.715985 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_excepti... | true | true |
f70c274faeae977083489369b7de5cf47e642696 | 2,548 | py | Python | api/modules/holidays/views.py | HemabhKamboj/server | 4ca2666cd49694245aeee0e658bf5ebce448e50e | [
"MIT"
] | null | null | null | api/modules/holidays/views.py | HemabhKamboj/server | 4ca2666cd49694245aeee0e658bf5ebce448e50e | [
"MIT"
] | null | null | null | api/modules/holidays/views.py | HemabhKamboj/server | 4ca2666cd49694245aeee0e658bf5ebce448e50e | [
"MIT"
] | null | null | null | import datetime
import math
import requests_cache
from bs4 import BeautifulSoup
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from api.modules.holidays.constants import HOLIDAYS_PAGE_URL, HINDI_DAY_STRING_MAP, HINDI_MONTH_STRING_MAP
from ... | 36.927536 | 106 | 0.605965 | import datetime
import math
import requests_cache
from bs4 import BeautifulSoup
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from api.modules.holidays.constants import HOLIDAYS_PAGE_URL, HINDI_DAY_STRING_MAP, HINDI_MONTH_STRING_MAP
from ... | true | true |
f70c286a9902002e58cba1233b064d8d8b626ec2 | 2,583 | py | Python | xarray/backends/pynio_.py | martindurant/xarray | 98a05f11c6f38489c82e86c9e9df796e7fb65fd2 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | xarray/backends/pynio_.py | martindurant/xarray | 98a05f11c6f38489c82e86c9e9df796e7fb65fd2 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | xarray/backends/pynio_.py | martindurant/xarray | 98a05f11c6f38489c82e86c9e9df796e7fb65fd2 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
from .. import Variable
from ..core.utils import (FrozenOrderedDict, Frozen,
NdimSizeLenMixin, DunderArrayMixin)
from ..core import indexing
from... | 32.2875 | 79 | 0.650019 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
from .. import Variable
from ..core.utils import (FrozenOrderedDict, Frozen,
NdimSizeLenMixin, DunderArrayMixin)
from ..core import indexing
from... | true | true |
f70c28cf5ae8ad999f86f2c1d054ba9d5b3f343a | 3,237 | py | Python | Scenario2-fan-out/python/subscribe_2.py | rido-min/IoTHubMQTTBrokerPreviewSamples | ee5e556822c1f3abf7faa5a597f25429022625fe | [
"MIT"
] | null | null | null | Scenario2-fan-out/python/subscribe_2.py | rido-min/IoTHubMQTTBrokerPreviewSamples | ee5e556822c1f3abf7faa5a597f25429022625fe | [
"MIT"
] | null | null | null | Scenario2-fan-out/python/subscribe_2.py | rido-min/IoTHubMQTTBrokerPreviewSamples | ee5e556822c1f3abf7faa5a597f25429022625fe | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.S
# Licensed under the MIT License. See License.txt in the project root for
# license information.
import os
import sys
import logging # noqa: F401
import json
import time
from concurrent.futures import ThreadPoolExecutor
from paho_client import PahoClient
""... | 29.427273 | 88 | 0.574915 |
import os
import sys
import logging
import json
import time
from concurrent.futures import ThreadPoolExecutor
from paho_client import PahoClient
| true | true |
f70c2904f29d66cf924fa7d4d4333085ff320187 | 1,786 | py | Python | ee/models/explicit_team_membership.py | brave-care/posthog | 8edd14a16ad936fb241dcf856925e9f2ea87cba4 | [
"MIT"
] | 7,409 | 2020-02-09T23:18:10.000Z | 2022-03-31T22:36:25.000Z | ee/models/explicit_team_membership.py | brave-care/posthog | 8edd14a16ad936fb241dcf856925e9f2ea87cba4 | [
"MIT"
] | 5,709 | 2020-02-09T23:26:13.000Z | 2022-03-31T20:20:01.000Z | ee/models/explicit_team_membership.py | brave-care/posthog | 8edd14a16ad936fb241dcf856925e9f2ea87cba4 | [
"MIT"
] | 647 | 2020-02-13T17:50:55.000Z | 2022-03-31T11:24:19.000Z | from typing import TYPE_CHECKING
from django.db import models
from posthog.models.utils import UUIDModel, sane_repr
if TYPE_CHECKING:
from posthog.models.organization import OrganizationMembership
class ExplicitTeamMembership(UUIDModel):
class Level(models.IntegerChoices):
"""Keep in sync with Orga... | 35.019608 | 118 | 0.715566 | from typing import TYPE_CHECKING
from django.db import models
from posthog.models.utils import UUIDModel, sane_repr
if TYPE_CHECKING:
from posthog.models.organization import OrganizationMembership
class ExplicitTeamMembership(UUIDModel):
class Level(models.IntegerChoices):
MEMBER = 1, "member"
... | true | true |
f70c29e07b84aee9f07e33726a5727e28f2dadee | 1,789 | py | Python | print_utils.py | FieryRider/matrix-archive | 77c49b9ac56346a2e8136851b71512fb53096cc2 | [
"Apache-2.0"
] | null | null | null | print_utils.py | FieryRider/matrix-archive | 77c49b9ac56346a2e8136851b71512fb53096cc2 | [
"Apache-2.0"
] | null | null | null | print_utils.py | FieryRider/matrix-archive | 77c49b9ac56346a2e8136851b71512fb53096cc2 | [
"Apache-2.0"
] | 1 | 2021-04-22T06:27:04.000Z | 2021-04-22T06:27:04.000Z | import sys
class PrintUtils:
progress = 0
total_progress = 0
@classmethod
def print_progress_bar(cls, iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', print_end = "\r"):
"""
Call in a loop to create terminal progress bar
@params:
i... | 39.755556 | 134 | 0.539966 | import sys
class PrintUtils:
progress = 0
total_progress = 0
@classmethod
def print_progress_bar(cls, iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', print_end = "\r"):
cls.progress = iteration
cls.total_progress = total
if prefix != "":
... | true | true |
f70c2a289f03467d3edc480afd9ba976b3622b9d | 354 | py | Python | PythonExercicios/des034.py | leuosilveira/Exercicios-Python_Curso-em-Video | 17793a5dde868dd6c9a34604ade4b68582db4563 | [
"MIT"
] | null | null | null | PythonExercicios/des034.py | leuosilveira/Exercicios-Python_Curso-em-Video | 17793a5dde868dd6c9a34604ade4b68582db4563 | [
"MIT"
] | null | null | null | PythonExercicios/des034.py | leuosilveira/Exercicios-Python_Curso-em-Video | 17793a5dde868dd6c9a34604ade4b68582db4563 | [
"MIT"
] | null | null | null | print('Olá!\nvou te ajudar a calcular o valor do aumento que você receberá.')
sal = float(input('Qual o seu salário atual? \n R$'))
if sal > 1250.00:
print('Seu salário final será de R${:.2f}, pois seu aumento foi de 10%.'.format(sal+sal*0.10))
else:
print('Seu salário final será de R${:.2f}, pois seu aumento f... | 50.571429 | 98 | 0.675141 | print('Olá!\nvou te ajudar a calcular o valor do aumento que você receberá.')
sal = float(input('Qual o seu salário atual? \n R$'))
if sal > 1250.00:
print('Seu salário final será de R${:.2f}, pois seu aumento foi de 10%.'.format(sal+sal*0.10))
else:
print('Seu salário final será de R${:.2f}, pois seu aumento f... | true | true |
f70c2b3d4122d9726b7335d3f84e1321b0abeb30 | 3,040 | py | Python | src/HttpCtrl/http_handler.py | annoviko/robotframework-httpctrl | 5514d2d567a8b817df8b3598ab559419e6825acd | [
"BSD-3-Clause"
] | 16 | 2019-03-15T12:29:06.000Z | 2022-02-25T21:17:27.000Z | src/HttpCtrl/http_handler.py | annoviko/robotframework-httpctrl | 5514d2d567a8b817df8b3598ab559419e6825acd | [
"BSD-3-Clause"
] | 29 | 2019-03-15T12:50:18.000Z | 2022-01-03T13:28:34.000Z | src/HttpCtrl/http_handler.py | annoviko/robotframework-httpctrl | 5514d2d567a8b817df8b3598ab559419e6825acd | [
"BSD-3-Clause"
] | 3 | 2019-11-22T21:06:48.000Z | 2021-06-16T10:00:58.000Z | """
HttpCtrl library provides HTTP/HTTPS client and server API to Robot Framework to make REST API testing easy.
Authors: Andrei Novikov
Date: 2018-2021
Copyright: The 3-Clause BSD License
"""
from http.server import SimpleHTTPRequestHandler
from robot.api import logger
from HttpCtrl.internal_messages... | 25.982906 | 109 | 0.622368 |
from http.server import SimpleHTTPRequestHandler
from robot.api import logger
from HttpCtrl.internal_messages import TerminationRequest, IgnoreRequest
from HttpCtrl.request import Request
from HttpCtrl.request_storage import RequestStorage
from HttpCtrl.response_storage import ResponseStorage
class HttpHa... | true | true |
f70c2bde40e80afd180cc8ccd64d2e3d06547f1d | 677 | py | Python | tests/qtest.py | henry232323/henrio | 315225094d4d1fdad2142534b8cd640462e8b81f | [
"MIT"
] | 6 | 2017-12-12T00:49:02.000Z | 2020-12-03T11:12:40.000Z | tests/qtest.py | henry232323/henrio | 315225094d4d1fdad2142534b8cd640462e8b81f | [
"MIT"
] | 3 | 2017-10-04T02:05:31.000Z | 2020-10-03T04:28:18.000Z | tests/qtest.py | henry232323/henrio | 315225094d4d1fdad2142534b8cd640462e8b81f | [
"MIT"
] | 2 | 2017-10-04T01:59:10.000Z | 2017-12-23T21:24:22.000Z | from henrio import *
import unittest
class QueueTest(unittest.TestCase):
def test_queue(self):
try:
l = get_default_loop()
q = HeapQueue(50)
print(q)
async def d():
return await q.get()
async def a(i):
await sl... | 20.515152 | 51 | 0.456425 | from henrio import *
import unittest
class QueueTest(unittest.TestCase):
def test_queue(self):
try:
l = get_default_loop()
q = HeapQueue(50)
print(q)
async def d():
return await q.get()
async def a(i):
await sl... | true | true |
f70c2ca88960421c39d473ad7ec4ca9d39d7ff13 | 11,031 | py | Python | data/utils/sample.py | NielsOerbaek/leaf | db007a6310da41d73c5dec071ffe1453519d028b | [
"BSD-2-Clause"
] | null | null | null | data/utils/sample.py | NielsOerbaek/leaf | db007a6310da41d73c5dec071ffe1453519d028b | [
"BSD-2-Clause"
] | null | null | null | data/utils/sample.py | NielsOerbaek/leaf | db007a6310da41d73c5dec071ffe1453519d028b | [
"BSD-2-Clause"
] | null | null | null | '''
samples from all raw data;
by default samples in a non-iid manner; namely, randomly selects users from
raw data until their cumulative amount of data exceeds the given number of
datapoints to sample (specified by --fraction argument);
ordering of original data points is not preserved in sampled data
'''
import a... | 34.908228 | 91 | 0.573928 |
import argparse
import json
import os
import random
import time
from collections import OrderedDict
from constants import DATASETS, SEED_FILES
from util import iid_divide
parser = argparse.ArgumentParser()
parser.add_argument('--name',
help='name of dataset to parse; default: sent140;',
... | true | true |
f70c2cbe9e3ad8b0d91c44d57ee280780565d023 | 5,297 | py | Python | firststreet/api/historic.py | opleban/fsf_api_access_python | ebe4af99e0f1dd59f7273fa62e6f05953aa8a510 | [
"MIT"
] | null | null | null | firststreet/api/historic.py | opleban/fsf_api_access_python | ebe4af99e0f1dd59f7273fa62e6f05953aa8a510 | [
"MIT"
] | null | null | null | firststreet/api/historic.py | opleban/fsf_api_access_python | ebe4af99e0f1dd59f7273fa62e6f05953aa8a510 | [
"MIT"
] | null | null | null | # Author: Kelvin Lai <kelvin@firststreet.org>
# Copyright: This module is owned by First Street Foundation
# Standard Imports
import logging
# Internal Imports
from firststreet.api import csv_format
from firststreet.api.api import Api
from firststreet.errors import InvalidArgument
from firststreet.models.historic imp... | 41.382813 | 120 | 0.666037 |
import logging
from firststreet.api import csv_format
from firststreet.api.api import Api
from firststreet.errors import InvalidArgument
from firststreet.models.historic import HistoricEvent, HistoricSummary
class Historic(Api):
def get_event(self, search_item, csv=False, output_dir=None, extra_param=None)... | true | true |
f70c2ccaa66136c4e168b5107d277a7a896ae606 | 72,840 | py | Python | intersight/model/virtualization_iwe_host_interface_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/virtualization_iwe_host_interface_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/virtualization_iwe_host_interface_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 62.685026 | 1,678 | 0.657606 |
import re
import sys
from intersight.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def la... | true | true |
f70c2d8d45be6f5330ff2d3db61a1152fce3e388 | 4,299 | py | Python | common-python/bcctools/bcc_ansible/bcc_switch_agent_datasource.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 28 | 2016-11-07T14:03:25.000Z | 2022-02-01T08:46:52.000Z | common-python/bcctools/bcc_ansible/bcc_switch_agent_datasource.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 3 | 2016-11-09T13:23:03.000Z | 2018-04-05T15:49:22.000Z | common-python/bcctools/bcc_ansible/bcc_switch_agent_datasource.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 13 | 2016-10-27T17:59:38.000Z | 2022-02-18T04:38:38.000Z | #!/usr/bin/python
# The MIT License (MIT)
#
# Copyright (c) 2017 Oracle
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | 32.816794 | 115 | 0.612933 |
__author__ = "Michael Shanley (Oracle A-Team)"
__copyright__ = "Copyright (c) 2017 Oracle"
__version__ = "1.0.0.0"
__date__ = "@BUILDDATE@"
__status__ = "Development"
__module__ = "switch_agent_datasource"
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],... | true | true |
f70c2d9f2af9f994a71e25fe38bb042a3b41ce76 | 86 | py | Python | todo/admin.py | Overexm/django_git_merey | 85ca0fa1c38e4dee40259a31fcb904897f6d3cbc | [
"MIT"
] | null | null | null | todo/admin.py | Overexm/django_git_merey | 85ca0fa1c38e4dee40259a31fcb904897f6d3cbc | [
"MIT"
] | null | null | null | todo/admin.py | Overexm/django_git_merey | 85ca0fa1c38e4dee40259a31fcb904897f6d3cbc | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import ToDo
admin.site.register(ToDo)
| 14.333333 | 32 | 0.802326 | from django.contrib import admin
from .models import ToDo
admin.site.register(ToDo)
| true | true |
f70c2ddc8e681bddcb67b9de0718cd3fd68ded9f | 33,074 | py | Python | python-wamp-client/labby/rpc.py | Simon-Deuring/labgrid-frotend-mle | 11dd53167c9fea06c6ad9af07b87f0cae1df5fd0 | [
"MIT"
] | null | null | null | python-wamp-client/labby/rpc.py | Simon-Deuring/labgrid-frotend-mle | 11dd53167c9fea06c6ad9af07b87f0cae1df5fd0 | [
"MIT"
] | 19 | 2021-10-15T08:31:51.000Z | 2021-10-19T12:53:46.000Z | python-wamp-client/labby/rpc.py | Simon-Deuring/labgrid-frotend-mle | 11dd53167c9fea06c6ad9af07b87f0cae1df5fd0 | [
"MIT"
] | null | null | null | """
Generic RPC functions for labby
"""
# import asyncio
import asyncio
from cgi import print_exception
import os
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Type, Union
import yaml
from attr import attrib, attrs
from autobahn.wamp.exception import ApplicationError
from ... | 38.36891 | 170 | 0.635151 |
import asyncio
from cgi import print_exception
import os
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Type, Union
import yaml
from attr import attrib, attrs
from autobahn.wamp.exception import ApplicationError
from labby.console import Console
from labby.resource import... | true | true |
f70c2f0326e85540f299fe27470653d4c2fb01bf | 1,985 | py | Python | data_collection/gazette/spiders/es_vila_velha.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 454 | 2018-04-07T03:32:57.000Z | 2020-08-17T19:56:22.000Z | data_collection/gazette/spiders/es_vila_velha.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 165 | 2018-04-13T00:36:17.000Z | 2020-08-17T23:41:45.000Z | data_collection/gazette/spiders/es_vila_velha.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 183 | 2018-04-11T15:09:37.000Z | 2020-08-15T18:55:11.000Z | from datetime import date
import dateparser
from scrapy import FormRequest, Request
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class VilaVelhaSpider(BaseGazetteSpider):
name = "es_vila_velha"
allowed_domains = ["www.vilavelha.es.gov.br"]
TERRITORY_ID = "3205200... | 36.090909 | 86 | 0.63073 | from datetime import date
import dateparser
from scrapy import FormRequest, Request
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class VilaVelhaSpider(BaseGazetteSpider):
name = "es_vila_velha"
allowed_domains = ["www.vilavelha.es.gov.br"]
TERRITORY_ID = "3205200... | true | true |
f70c2fd4c461e1403893699683a5364d22263b7f | 5,630 | py | Python | docs/source/conf.py | DouglasWebster/gdscript-to-restructured | e8a6513bbeaf204a9c0d267f86c41c203581af44 | [
"MIT"
] | null | null | null | docs/source/conf.py | DouglasWebster/gdscript-to-restructured | e8a6513bbeaf204a9c0d267f86c41c203581af44 | [
"MIT"
] | null | null | null | docs/source/conf.py | DouglasWebster/gdscript-to-restructured | e8a6513bbeaf204a9c0d267f86c41c203581af44 | [
"MIT"
] | null | null | null | # 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... | 29.631579 | 129 | 0.668206 |
import sphinx_rtd_theme
import os
import sys
project = 'GDScript to reStructured'
copyright = '2021, GDScript'
author = 'Nathan Lavato'
version = '0.1.0'
release = version
pygments_style = 'sphinx'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
needs_sphinx = '3.0'
sys.path.appen... | true | true |
f70c3014ecf1637bf94b800311ac7370413a10c1 | 617 | py | Python | tests/plugins/tasks/networking/test_netmiko_file_transfer.py | MatthiasGabriel/nornir | af948f20daee725f9bf257b0e73b688838ebcbc2 | [
"Apache-2.0"
] | 1 | 2019-04-10T08:14:59.000Z | 2019-04-10T08:14:59.000Z | tests/plugins/tasks/networking/test_netmiko_file_transfer.py | MatthiasGabriel/nornir | af948f20daee725f9bf257b0e73b688838ebcbc2 | [
"Apache-2.0"
] | null | null | null | tests/plugins/tasks/networking/test_netmiko_file_transfer.py | MatthiasGabriel/nornir | af948f20daee725f9bf257b0e73b688838ebcbc2 | [
"Apache-2.0"
] | null | null | null | import os
from nornir.plugins.tasks import networking
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
class Test(object):
def test_netmiko_file_transfer(self, nornir):
source_file = os.path.join(THIS_DIR, "data", "test_file.txt")
dest_file = "test_file.txt"
result = nornir.filter... | 26.826087 | 69 | 0.623987 | import os
from nornir.plugins.tasks import networking
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
class Test(object):
def test_netmiko_file_transfer(self, nornir):
source_file = os.path.join(THIS_DIR, "data", "test_file.txt")
dest_file = "test_file.txt"
result = nornir.filter... | true | true |
f70c321544f9877f102645bed6748a44c12c94c1 | 8,019 | py | Python | pyshapelets/lts_smaller_shap_dicts.py | GillesVandewiele/pyShapelets | d7e91150c17bf0f5fed55dc36d0c4d2d447e80c9 | [
"MIT"
] | 16 | 2017-07-12T12:24:21.000Z | 2021-01-23T14:11:24.000Z | pyshapelets/lts_smaller_shap_dicts.py | GillesVandewiele/pyShapelets | d7e91150c17bf0f5fed55dc36d0c4d2d447e80c9 | [
"MIT"
] | 13 | 2017-07-09T08:06:41.000Z | 2017-09-21T14:16:04.000Z | pyshapelets/lts_smaller_shap_dicts.py | GillesVandewiele/pyShapelets | d7e91150c17bf0f5fed55dc36d0c4d2d447e80c9 | [
"MIT"
] | 4 | 2017-12-07T16:47:22.000Z | 2019-11-08T20:42:40.000Z | import time
from collections import Counter, defaultdict
import warnings; warnings.filterwarnings('ignore')
import glob
import re
import ast
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from algorithms import ShapeletTransformer
from extractors.extractor import MultiGeneticExtractor
from dat... | 38.73913 | 127 | 0.654695 | import time
from collections import Counter, defaultdict
import warnings; warnings.filterwarnings('ignore')
import glob
import re
import ast
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from algorithms import ShapeletTransformer
from extractors.extractor import MultiGeneticExtractor
from dat... | true | true |
f70c3267c713a80d0e3f5d9f83fe64fcabba8b3f | 3,941 | py | Python | python/317_shortest_distance_from_all_buildings.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 17 | 2016-03-01T22:40:53.000Z | 2021-04-19T02:15:03.000Z | python/317_shortest_distance_from_all_buildings.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | null | null | null | python/317_shortest_distance_from_all_buildings.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 3 | 2019-03-07T03:48:43.000Z | 2020-04-05T01:11:36.000Z |
class SolutionTLE:
def shortestDistance(self, grid: List[List[int]]) -> int:
buildings = []
rows, cols = len(grid), len(grid[0])
for row in range(rows):
for col in range(cols):
if grid[row][col] == 1:
buildings.append((row, col))
def... | 36.831776 | 85 | 0.511038 |
class SolutionTLE:
def shortestDistance(self, grid: List[List[int]]) -> int:
buildings = []
rows, cols = len(grid), len(grid[0])
for row in range(rows):
for col in range(cols):
if grid[row][col] == 1:
buildings.append((row, col))
def... | true | true |
f70c343abe32b3e4f1f802f02e6469b2c98b9f06 | 1,170 | py | Python | hearthstone/training/pytorch/worker/distributed/remote_agent.py | JDBumgardner/stone_ground_hearth_battles | 9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f | [
"Apache-2.0"
] | 20 | 2020-08-01T03:14:57.000Z | 2021-12-19T11:47:50.000Z | hearthstone/training/pytorch/worker/distributed/remote_agent.py | JDBumgardner/stone_ground_hearth_battles | 9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f | [
"Apache-2.0"
] | 48 | 2020-08-01T03:06:43.000Z | 2022-02-27T10:03:47.000Z | hearthstone/training/pytorch/worker/distributed/remote_agent.py | JDBumgardner/stone_ground_hearth_battles | 9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f | [
"Apache-2.0"
] | 3 | 2020-06-28T01:23:37.000Z | 2021-11-11T23:09:36.000Z | from torch.distributed.rpc import RRef
from hearthstone.simulator.agent import AnnotatingAgent, Annotation, DiscoverChoiceAction, StandardAction, \
RearrangeCardsAction, HeroChoiceAction
class RemoteAgent(AnnotatingAgent):
def __init__(self, remote_agent: RRef):
self.remote_agent = remote_agent
... | 46.8 | 109 | 0.769231 | from torch.distributed.rpc import RRef
from hearthstone.simulator.agent import AnnotatingAgent, Annotation, DiscoverChoiceAction, StandardAction, \
RearrangeCardsAction, HeroChoiceAction
class RemoteAgent(AnnotatingAgent):
def __init__(self, remote_agent: RRef):
self.remote_agent = remote_agent
... | true | true |
f70c34cd3bb99fa7462ca40b5ee544919ee9b2e1 | 279 | py | Python | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_30/ar_/test_artificial_1024_RelativeDifference_MovingMedian_30__100.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_30/ar_/test_artificial_1024_RelativeDifference_MovingMedian_30__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_30/ar_/test_artificial_1024_RelativeDifference_MovingMedian_30__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 0); | 39.857143 | 179 | 0.74552 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 0); | true | true |
f70c34e56b4dd10253f14bf6d684816904c53872 | 168,083 | py | Python | src/sage/modular/abvar/abvar.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/modular/abvar/abvar.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/modular/abvar/abvar.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | """
Base class for modular abelian varieties
AUTHORS:
- William Stein (2007-03)
TESTS::
sage: A = J0(33)
sage: D = A.decomposition(); D
[
Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33),
Simple abelian subvariety 11a(3,33) of dimension 1 of J0(33),
Simple abelian subvariety 33a(... | 35.460549 | 253 | 0.556243 |
) * n
L = self.lattice().basis_matrix()
lattice = block_diagonal_matrix([L]*n).row_module(ZZ)
return ModularAbelianVariety(groups, lattice, self.base_field(), check=False)
def __mul__(self, other):
if not is_ModularAbelianVariety(other):
raise TypeError("other must be a... | true | true |
f70c35c3bf5d9fb9d99edee5fbf24e31338a5077 | 16,625 | py | Python | test/run-spec-test.py | losfair/wasm3 | 7a47041e3af6f69f5e2b469aa9dab301d5878f50 | [
"MIT"
] | null | null | null | test/run-spec-test.py | losfair/wasm3 | 7a47041e3af6f69f5e2b469aa9dab301d5878f50 | [
"MIT"
] | null | null | null | test/run-spec-test.py | losfair/wasm3 | 7a47041e3af6f69f5e2b469aa9dab301d5878f50 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec ../build-custom/wasm3
# ./run-spec-test.py --engine... | 29.529307 | 111 | 0.546045 |
import argparse
import os, sys, glob, time
import subprocess
import json
import re
import struct
import math
import pathlib
scriptDir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(os.path.join(scriptDir, '..', 'extra'))
from testutils import *
from pprint import pprint
parse... | true | true |
f70c35edfcb73c5024264ba6523c1067d54f29ec | 2,147 | py | Python | src/python/tests/appengine/handlers/testcase_detail/delete_test.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 1 | 2021-12-20T14:48:42.000Z | 2021-12-20T14:48:42.000Z | src/python/tests/appengine/handlers/testcase_detail/delete_test.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 2 | 2021-09-28T05:36:03.000Z | 2021-12-13T20:48:34.000Z | src/python/tests/appengine/handlers/testcase_detail/delete_test.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 1 | 2021-11-06T06:22:00.000Z | 2021-11-06T06:22:00.000Z | # Copyright 2019 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, ... | 31.573529 | 74 | 0.706567 |
import flask
import unittest
import webtest
from datastore import data_types
from handlers.testcase_detail import delete
from libs import form
from tests.test_libs import helpers as test_helpers
from tests.test_libs import test_utils
@test_utils.with_cloud_emulators('datastore')
class HandlerTest(unitte... | true | true |
f70c37294d6f69da394b7f0744c44c5134a50d0e | 767 | py | Python | lektor/types/fake.py | yagebu/lektor | a31d8e57a5b2f4b090072527269c26a65202c736 | [
"BSD-3-Clause"
] | 4,104 | 2015-11-16T18:37:51.000Z | 2022-03-28T14:28:24.000Z | lektor/types/fake.py | yagebu/lektor | a31d8e57a5b2f4b090072527269c26a65202c736 | [
"BSD-3-Clause"
] | 854 | 2015-12-05T12:19:02.000Z | 2022-03-31T16:47:27.000Z | lektor/types/fake.py | yagebu/lektor | a31d8e57a5b2f4b090072527269c26a65202c736 | [
"BSD-3-Clause"
] | 442 | 2015-11-21T10:18:02.000Z | 2022-03-29T19:55:17.000Z | from lektor.constants import PRIMARY_ALT
from lektor.i18n import get_i18n_block
from lektor.types.base import Type
class FakeType(Type):
def value_from_raw(self, raw):
return None
def to_json(self, pad, record=None, alt=PRIMARY_ALT):
rv = Type.to_json(self, pad, record, alt)
rv["is_fa... | 21.914286 | 68 | 0.670143 | from lektor.constants import PRIMARY_ALT
from lektor.i18n import get_i18n_block
from lektor.types.base import Type
class FakeType(Type):
def value_from_raw(self, raw):
return None
def to_json(self, pad, record=None, alt=PRIMARY_ALT):
rv = Type.to_json(self, pad, record, alt)
rv["is_fa... | true | true |
f70c37c40d7c1c21c618b91fdf97259c369995d3 | 3,246 | py | Python | trafficlights/trafficlight.py | jean-charles-gibier/TrafficLights | a513e28c3c7349abefb39553ec46d3487af60a3d | [
"CC0-1.0"
] | null | null | null | trafficlights/trafficlight.py | jean-charles-gibier/TrafficLights | a513e28c3c7349abefb39553ec46d3487af60a3d | [
"CC0-1.0"
] | null | null | null | trafficlights/trafficlight.py | jean-charles-gibier/TrafficLights | a513e28c3c7349abefb39553ec46d3487af60a3d | [
"CC0-1.0"
] | null | null | null | """Module implémentant des classes en relations avec le menu."""
from typing import Callable, Dict, List, Tuple, AnyStr
class Trafficlight:
"""Modélise un feu de circulation présentant un état lumineux donné.
wrarn : la couleur affectée par défaut n'est pas validée par l'init
autrement dit on pe... | 37.744186 | 93 | 0.558534 |
from typing import Callable, Dict, List, Tuple, AnyStr
class Trafficlight:
def __init__(self, name: str = "None", current: str = "rouge") -> None:
self._name: str = name
self._current: str = current
self._triggers: Dict = {}
def add(self, trigger: AnyStr, source: AnyStr, ... | true | true |
f70c38682f59465a9fb9eb7311497596f5bc838a | 1,201 | py | Python | operators/clip.py | ngiambla/nnflex | 7c8bf46218ea70c6dad1efedf9e2069e41c4c3fa | [
"MIT"
] | null | null | null | operators/clip.py | ngiambla/nnflex | 7c8bf46218ea70c6dad1efedf9e2069e41c4c3fa | [
"MIT"
] | null | null | null | operators/clip.py | ngiambla/nnflex | 7c8bf46218ea70c6dad1efedf9e2069e41c4c3fa | [
"MIT"
] | null | null | null | ''' clip.py:
Implement's the clip ONNX node as a flexnode (for use with any accelerator)
'''
import uuid
import numpy as np
from operators.flexnode import FlexNode
from core.defines import Operator
from core.messaging import Message
class Clip(FlexNode):
def __init__(self, onnx_node, inputs, outputs):
... | 24.02 | 87 | 0.636969 | import uuid
import numpy as np
from operators.flexnode import FlexNode
from core.defines import Operator
from core.messaging import Message
class Clip(FlexNode):
def __init__(self, onnx_node, inputs, outputs):
FlexNode.__init__(self, onnx_node, inputs, outputs)
self._min = -3.402823466e+38
... | true | true |
f70c3872a89eb986046522f1dedbedb36f6db349 | 22,020 | py | Python | django/db/backends/sqlite3/base.py | krallin/django | c94db53eaa9b344f9227fa4dff2b1a5e9c7dce9d | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/sqlite3/base.py | krallin/django | c94db53eaa9b344f9227fa4dff2b1a5e9c7dce9d | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/sqlite3/base.py | krallin/django | c94db53eaa9b344f9227fa4dff2b1a5e9c7dce9d | [
"BSD-3-Clause"
] | null | null | null | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.db import utils
from django.db.backends import *
from django.db.backends.sqlite3.clien... | 42.264875 | 120 | 0.655767 | from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.db import utils
from django.db.backends import *
from django.db.backends.sqlite3.client import DatabaseClient
from django.db.backends.sqlite3.creation import DatabaseCreation
from django.db.backends.sqlite3.in... | true | true |
f70c38f2abdfbf52893c3f87e11b6b3559539623 | 817 | py | Python | Desafio069 - Cadastro de Pessoas.py | tmoura1981/Python_Exercicios | c873e2758dfd9058d2c2d83b5b38b522c6264029 | [
"MIT"
] | 1 | 2021-11-25T11:19:59.000Z | 2021-11-25T11:19:59.000Z | Desafio069 - Cadastro de Pessoas.py | tmoura1981/Python_Exercicios | c873e2758dfd9058d2c2d83b5b38b522c6264029 | [
"MIT"
] | null | null | null | Desafio069 - Cadastro de Pessoas.py | tmoura1981/Python_Exercicios | c873e2758dfd9058d2c2d83b5b38b522c6264029 | [
"MIT"
] | null | null | null | titulo = 'Cadastro de Pessoas'
print(titulo.center(50, '='))
print('')
idade = total = homens = mulheres = 0
sexo = ''
while True:
idade = int(input('Idade: '))
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
while sexo not in 'MF':
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
res... | 31.423077 | 69 | 0.549572 | titulo = 'Cadastro de Pessoas'
print(titulo.center(50, '='))
print('')
idade = total = homens = mulheres = 0
sexo = ''
while True:
idade = int(input('Idade: '))
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
while sexo not in 'MF':
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
res... | true | true |
f70c39a91009422b412e87c735b11f70e09938c7 | 743 | py | Python | paths.py | Leather128/Pygame-Pong | 33f6d76049c24edb56532314e1b29f4536269733 | [
"Apache-2.0"
] | null | null | null | paths.py | Leather128/Pygame-Pong | 33f6d76049c24edb56532314e1b29f4536269733 | [
"Apache-2.0"
] | null | null | null | paths.py | Leather128/Pygame-Pong | 33f6d76049c24edb56532314e1b29f4536269733 | [
"Apache-2.0"
] | null | null | null | import os
# Finds path of any file in the assets folder #
def findPath(folders, file, extension):
# Checks if it's an array (or other type of list idk, basically this should do the job) #
if(isinstance(folders, list)):
# Default folder path, being nothing #
folderPath = ""
# Loops thro... | 41.277778 | 115 | 0.631225 | import os
def findPath(folders, file, extension):
if(isinstance(folders, list)):
# Default folder path, being nothing #
folderPath = ""
# Loops through all the folders #
for x in folders:
# Joins them together #
folderPath = os.path.join(folderPath, x)
... | true | true |
f70c3a0de9e404646df16597de37a8fc1a1bd4bf | 3,818 | py | Python | setup.py | jimfulton/python-bigquery-sqlalchemy | 0443d7267a9330cba095193b4f9635574c8f7b05 | [
"MIT"
] | null | null | null | setup.py | jimfulton/python-bigquery-sqlalchemy | 0443d7267a9330cba095193b4f9635574c8f7b05 | [
"MIT"
] | null | null | null | setup.py | jimfulton/python-bigquery-sqlalchemy | 0443d7267a9330cba095193b4f9635574c8f7b05 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017 The sqlalchemy-bigquery Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# ... | 37.80198 | 82 | 0.688318 |
import io
import itertools
import os
import re
from setuptools import setup
name = "sqlalchemy-bigquery"
description = "SQLAlchemy dialect for BigQuery"
release_status = "Development Status :: 5 - Production/Stable"
package_root = os.path.abspath(os.path.dirname(__file__))
with open(os.path... | true | true |
f70c3a66baf4cad25be1fb1673d7a08bb0a51d03 | 11,737 | py | Python | TUI/Inst/APOGEE/ShutterWdgSet.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/Inst/APOGEE/ShutterWdgSet.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/Inst/APOGEE/ShutterWdgSet.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""APOGEE cold shutter control and status
History:
2011-08-30 ROwen
2011-09-01 ROwen Added support for cancelling commands.
2012-11-14 ROwen Stop using Checkbutton indicatoron=False; it is no longer supported on MacOS X.
2015-11-03 ROwen Replace "== None" with "is None" and "!= None" wit... | 32.693593 | 108 | 0.583113 |
import Tkinter
import RO.Constants
import RO.Wdg
import RO.TkUtil
import RO.StringUtil
import TUI.Models
import TUI.Base.Wdg
from . import BaseDeviceWdg
class ShutterWdgSet(object):
_ShutterCat = "shutter"
_NumLEDs = 4
def __init__(self, gridder, statusBar, colSpan=3, helpURL=None):
self.statusBar... | true | true |
f70c3b84214c735184f59a3de3b8b210a112ae56 | 2,142 | py | Python | nnutil2/layers/segment.py | aroig/nnutil2 | 1fc77df351d4eee1166688e25a94287a5cfa27c4 | [
"BSD-3-Clause"
] | null | null | null | nnutil2/layers/segment.py | aroig/nnutil2 | 1fc77df351d4eee1166688e25a94287a5cfa27c4 | [
"BSD-3-Clause"
] | 3 | 2020-11-13T18:33:29.000Z | 2021-08-25T15:55:57.000Z | nnutil2/layers/segment.py | aroig/nnutil2 | 1fc77df351d4eee1166688e25a94287a5cfa27c4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# nnutil2 - Tensorflow utilities for training neural networks
# Copyright (c) 2019, Abdó Roig-Maranges <abdo.roig@gmail.com>
#
# This file is part of 'nnutil2'.
#
# This file may be modified and distributed under the terms of the 3-clause BSD
# license. See the LICENSE fi... | 27.113924 | 79 | 0.618581 |
from typing import List
import tensorflow as tf
from ..util import kwargs_for
from .layer import Layer
class Segment(Layer):
def __init__(self, layers: List[Layer] = [], activation=None, **kwargs):
super(Segment, self).__init__(**kwargs)
self._segment_layers = layers
self._seg... | true | true |
f70c3bc48d5319be629fe2d74c0f6f5b9d4ad98a | 1,556 | py | Python | setup.py | KarstenSchulz/twodolib | b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8 | [
"ISC"
] | 10 | 2015-09-24T02:23:24.000Z | 2020-03-08T09:21:20.000Z | setup.py | KarstenSchulz/twodolib | b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8 | [
"ISC"
] | 7 | 2015-09-15T15:45:00.000Z | 2020-08-21T07:04:44.000Z | setup.py | KarstenSchulz/twodolib | b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8 | [
"ISC"
] | 2 | 2017-07-03T14:15:50.000Z | 2019-08-30T13:58:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup script for twodolib."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.re... | 28.290909 | 72 | 0.621465 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', '')
test_requirements = ['tox', ]
setup(
... | true | true |
f70c3bf1f81136316a9893d94d4bb86d634c3446 | 13,790 | py | Python | old_version_python/window.py | eweca-d/DysonSphereProgramCalculator | 935e3f15aeba7b10f716bee54d98b36d6fca771c | [
"MIT"
] | 32 | 2021-02-07T04:35:52.000Z | 2021-12-14T07:02:27.000Z | old_version_python/window.py | ladeca-d/DysonSphereProgramCalculator | 935e3f15aeba7b10f716bee54d98b36d6fca771c | [
"MIT"
] | null | null | null | old_version_python/window.py | ladeca-d/DysonSphereProgramCalculator | 935e3f15aeba7b10f716bee54d98b36d6fca771c | [
"MIT"
] | 11 | 2021-02-08T11:14:17.000Z | 2021-12-17T10:13:54.000Z | from PySide2.QtWidgets import QPushButton, QMainWindow, QLabel, QLineEdit, QGroupBox
from math import ceil
import source
class MainWindow(QMainWindow):
def __init__(self, screen_width, screen_height):
self.screen_width = screen_width
self.screen_height = screen_height
self.screen_ratio = s... | 48.385965 | 126 | 0.626613 | from PySide2.QtWidgets import QPushButton, QMainWindow, QLabel, QLineEdit, QGroupBox
from math import ceil
import source
class MainWindow(QMainWindow):
def __init__(self, screen_width, screen_height):
self.screen_width = screen_width
self.screen_height = screen_height
self.screen_ratio = s... | true | true |
f70c3cfc48871815483645f3e9d8c0ea781f9872 | 1,352 | py | Python | saleor/graphql/product/types/digital_contents.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 2 | 2021-01-31T00:28:42.000Z | 2021-01-31T12:30:46.000Z | saleor/graphql/product/types/digital_contents.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 19 | 2022-02-21T04:34:12.000Z | 2022-03-28T04:55:08.000Z | saleor/graphql/product/types/digital_contents.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 3 | 2021-02-22T16:37:18.000Z | 2021-02-22T18:56:28.000Z | import graphene
from graphene import relay
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...core.scalars import UUID
from ...meta.types import ObjectWithMetadata
class DigitalContentUrl(CountableDjangoObjectType):
url = graphene.String(description="URL for digital c... | 28.166667 | 69 | 0.656805 | import graphene
from graphene import relay
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...core.scalars import UUID
from ...meta.types import ObjectWithMetadata
class DigitalContentUrl(CountableDjangoObjectType):
url = graphene.String(description="URL for digital c... | true | true |
f70c3d27090122cbd9fceb2fd2fbf70a2213269b | 15,418 | py | Python | python/yb/download_and_extract_archive.py | deepld/yugabyte-db | 3a4464deef220f5bbc58cce22ad6bfa8c57c98a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/yb/download_and_extract_archive.py | deepld/yugabyte-db | 3a4464deef220f5bbc58cce22ad6bfa8c57c98a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/yb/download_and_extract_archive.py | deepld/yugabyte-db | 3a4464deef220f5bbc58cce22ad6bfa8c57c98a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) YugaByte, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 40.046753 | 99 | 0.644247 |
# even installed.
import os
import sys
import re
import logging
import socket
import random
import atexit
import subprocess
import argparse
import tempfile
import time
import getpass
import platform
import fcntl
import errno
g_verbose = False
EXPECTED_ARCHIVE_EXTENSION = '.tar.gz'
CHECKSUM_EXTENSION... | true | true |
f70c3dfba447061d7e08725b7b0184cabf89a717 | 162 | py | Python | python-port/speedclue/cards.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | 1 | 2017-10-20T14:24:06.000Z | 2017-10-20T14:24:06.000Z | python-port/speedclue/cards.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | null | null | null | python-port/speedclue/cards.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | null | null | null | CARDS = (
(('Gr', 'Mu', 'Pe', 'Pl', 'Sc', 'Wh')),
(('Ca', 'Kn', 'Pi', 'Re', 'Ro', 'Wr')),
(('Ba', 'Bi', 'Co', 'Di', 'Ha', 'Ki', 'Li', 'Lo', 'St')),
)
| 27 | 61 | 0.290123 | CARDS = (
(('Gr', 'Mu', 'Pe', 'Pl', 'Sc', 'Wh')),
(('Ca', 'Kn', 'Pi', 'Re', 'Ro', 'Wr')),
(('Ba', 'Bi', 'Co', 'Di', 'Ha', 'Ki', 'Li', 'Lo', 'St')),
)
| true | true |
f70c3e29979e263ef86f35ed84b4216ab4557a46 | 933 | py | Python | emcee/__init__.py | eteq/emcee | b410abe67936fb816c38470b3043532d2e2e6d0b | [
"MIT"
] | 14 | 2020-07-20T07:09:50.000Z | 2022-03-11T03:26:13.000Z | emcee/__init__.py | eteq/emcee | b410abe67936fb816c38470b3043532d2e2e6d0b | [
"MIT"
] | 38 | 2020-05-21T19:03:45.000Z | 2022-01-17T03:44:25.000Z | emcee/__init__.py | eteq/emcee | b410abe67936fb816c38470b3043532d2e2e6d0b | [
"MIT"
] | 8 | 2020-06-01T14:23:07.000Z | 2022-01-28T19:05:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
from .sampler import *
from .mh import *
from .ensemble import *
from .ptsampler import *
from . import utils
from . import autocorr
__version__ = "2.1.0"
def t... | 24.552632 | 69 | 0.542337 |
from __future__ import (division, print_function, absolute_import,
unicode_literals)
from .sampler import *
from .mh import *
from .ensemble import *
from .ptsampler import *
from . import utils
from . import autocorr
__version__ = "2.1.0"
def test():
from inspect import getmembers, i... | true | true |
f70c3ec3e56c2cdd2299164142b1f0f2606d10e9 | 3,763 | py | Python | byceps/services/seating/area_service.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 23 | 2015-08-03T23:28:54.000Z | 2018-12-12T20:11:45.000Z | byceps/services/seating/area_service.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 1 | 2018-09-30T18:18:24.000Z | 2018-09-30T18:18:24.000Z | byceps/services/seating/area_service.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 9 | 2015-08-06T16:41:36.000Z | 2018-09-25T11:17:31.000Z | """
byceps.services.seating.area_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from typing import Optional
from sqlalchemy import select
from sqlalchemy.sql import Select
from ...d... | 27.874074 | 80 | 0.675791 |
from __future__ import annotations
from typing import Optional
from sqlalchemy import select
from sqlalchemy.sql import Select
from ...database import db, paginate, Pagination
from ...typing import PartyID
from ..ticketing.dbmodels.ticket import Ticket as DbTicket
from .dbmodels.area import Area as DbArea
from .db... | true | true |
f70c3f84510bef0cd92d2e436087e79ae700c7a7 | 1,617 | py | Python | docs/cornell CS class/lesson 10. Algorithm Design/demos/test_helpers.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 10. Algorithm Design/demos/test_helpers.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 10. Algorithm Design/demos/test_helpers.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
Unit test for multiple modules
This module illustrates what a proper unit test should look like.
Each function being tested has its own test procedure.
It also has a segment of "script code" that invokes the test
procedure when this module is run as an script.
Author: Walker M. White
Date: February 14, 2019
""... | 23.779412 | 65 | 0.682127 | import introcs
import helpers
def test_first_name():
print('Testing first_name')
result = helpers.first_name('Walker White')
introcs.assert_equals('Walker',result)
result = helpers.first_name('Walker White')
introcs.assert_equals('Walker',result)
def test_last... | true | true |
f70c4348b188e43d79cf8b756f4fb1b4466cb021 | 2,025 | py | Python | indy-tests/utils/utils.py | NgoAnhKhoi/indy-testcase | 1f85d2b7e77a5bb9637379286d7f7f142c2c626e | [
"MIT"
] | null | null | null | indy-tests/utils/utils.py | NgoAnhKhoi/indy-testcase | 1f85d2b7e77a5bb9637379286d7f7f142c2c626e | [
"MIT"
] | null | null | null | indy-tests/utils/utils.py | NgoAnhKhoi/indy-testcase | 1f85d2b7e77a5bb9637379286d7f7f142c2c626e | [
"MIT"
] | null | null | null | '''
Created on Nov 9, 2017
@author: khoi.ngo
'''
def generate_random_string(prefix="", suffix="", size=20):
"""
Generate random string .
:param prefix: (optional) Prefix of a string.
:param suffix: (optional) Suffix of a string.
:param length: (optional) Max length of a string (include prefix an... | 25.961538 | 109 | 0.620247 |
def generate_random_string(prefix="", suffix="", size=20):
import random
import string
left_size = size - len(prefix) - len(suffix)
random_str = ""
if left_size > 0:
random_str = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(left_size))
else:
prin... | true | true |
f70c43bdfff63a45fb5bec5cb16598d64f9c9443 | 2,990 | py | Python | Alexa.py | Rashid7520/alexa | 7b5ed9df32222ce1c402f230ade22c7a69b33677 | [
"Apache-2.0"
] | 1 | 2022-02-28T17:03:13.000Z | 2022-02-28T17:03:13.000Z | Alexa.py | Rashid7520/alexa | 7b5ed9df32222ce1c402f230ade22c7a69b33677 | [
"Apache-2.0"
] | null | null | null | Alexa.py | Rashid7520/alexa | 7b5ed9df32222ce1c402f230ade22c7a69b33677 | [
"Apache-2.0"
] | null | null | null | import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
import webbrowser
import os
#import pyaudio
listenner = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty("voices")
engine.setProperty('voice', voices[1].id)
def talk(text):... | 27.181818 | 100 | 0.576254 | import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
import webbrowser
import os
listenner = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty("voices")
engine.setProperty('voice', voices[1].id)
def talk(text):
engine.s... | true | true |
f70c43e5dc3ab182467438f8d6eb12b710ec1190 | 615 | py | Python | backend/restaurants/migrations/0007_restaurantlocation_owner.py | mahmoud-batman/resturants-club | 095bf9b9b5d82a86d6e610517770f1223bb1ef59 | [
"MIT"
] | null | null | null | backend/restaurants/migrations/0007_restaurantlocation_owner.py | mahmoud-batman/resturants-club | 095bf9b9b5d82a86d6e610517770f1223bb1ef59 | [
"MIT"
] | null | null | null | backend/restaurants/migrations/0007_restaurantlocation_owner.py | mahmoud-batman/resturants-club | 095bf9b9b5d82a86d6e610517770f1223bb1ef59 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-27 18:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('restaurants', '0006_auto... | 27.954545 | 133 | 0.686179 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('restaurants', '0006_auto_20200927_0920'),
]
operations = [
... | true | true |
f70c44b187ccf305b57f7409d5e44844eb21cf70 | 629 | py | Python | test_bdmodels/testmigs/migrations/0001_initial.py | Matific/broken-down-models | abc665917928102052069ed07f6f396b5a603373 | [
"MIT"
] | 4 | 2021-08-18T14:34:17.000Z | 2021-11-23T12:55:05.000Z | test_bdmodels/testmigs/migrations/0001_initial.py | Matific/broken-down-models | abc665917928102052069ed07f6f396b5a603373 | [
"MIT"
] | 13 | 2021-08-18T10:17:58.000Z | 2022-02-13T15:11:21.000Z | test_bdmodels/testmigs/migrations/0001_initial.py | Matific/broken-down-models | abc665917928102052069ed07f6f396b5a603373 | [
"MIT"
] | 1 | 2021-09-09T16:08:04.000Z | 2021-09-09T16:08:04.000Z | # Generated by Django 2.2.23 on 2021-07-07 13:18
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BigModel',
fields=[
('id', models.AutoFiel... | 25.16 | 76 | 0.54213 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BigModel',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
... | true | true |
f70c4510e1c769c5ddba6263ecda35d921c80b8e | 4,335 | py | Python | lightly/openapi_generated/swagger_client/models/job_status_data_result.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 1,515 | 2020-10-05T13:04:17.000Z | 2022-03-31T16:14:55.000Z | lightly/openapi_generated/swagger_client/models/job_status_data_result.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 628 | 2020-10-14T11:38:51.000Z | 2022-03-31T14:40:54.000Z | lightly/openapi_generated/swagger_client/models/job_status_data_result.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 108 | 2020-10-17T08:31:06.000Z | 2022-03-20T16:44:22.000Z | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version: 1.0.0
Contact: support@lightly... | 28.708609 | 220 | 0.582699 |
import pprint
import re
import six
from lightly.openapi_generated.swagger_client.configuration import Configuration
class JobStatusDataResult(object):
swagger_types = {
'type': 'JobResultType',
'data': 'GeneralJobResult'
}
attribute_map = {
'type': 'type',
'data':... | true | true |
f70c45334caae225348d1f4da8df8a9711e75ae9 | 349 | py | Python | Flask/apps/main/errors.py | bkjml/online-bus-tickting-system | 8b3728238417532b34b90e2af98d445b10c1c3be | [
"MIT"
] | null | null | null | Flask/apps/main/errors.py | bkjml/online-bus-tickting-system | 8b3728238417532b34b90e2af98d445b10c1c3be | [
"MIT"
] | null | null | null | Flask/apps/main/errors.py | bkjml/online-bus-tickting-system | 8b3728238417532b34b90e2af98d445b10c1c3be | [
"MIT"
] | null | null | null | from flask import render_template
from .import main
@main.app_errorhandler(404) #if error handlers used instead app_errorhandler the instnace is available only for errors originate in blueprint
def page_not_found(e):
return render_template(''), 404
@main.app_errorhandler(500)
def internal_server_error(e):
re... | 34.9 | 142 | 0.796562 | from flask import render_template
from .import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template(''), 404
@main.app_errorhandler(500)
def internal_server_error(e):
return render_template(''), 500 | true | true |
f70c45d1c780fe80cae7e22e7cf26e9752f6ec9c | 341 | py | Python | lib/setup.py | quartictech/orinoco | d0f2dec19a687f5140ae5d1b61975be617065690 | [
"BSD-3-Clause"
] | null | null | null | lib/setup.py | quartictech/orinoco | d0f2dec19a687f5140ae5d1b61975be617065690 | [
"BSD-3-Clause"
] | null | null | null | lib/setup.py | quartictech/orinoco | d0f2dec19a687f5140ae5d1b61975be617065690 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
setup(name='orinoco',
version='0.1',
description='Sweet data integration',
author='Quartic Technologies',
author_email='alex@quartic.io',
license='MIT',
packages=['orinoco'],
install_requires=[
'aiohttp',
'pyformance'
],
... | 22.733333 | 43 | 0.592375 | from setuptools import setup
setup(name='orinoco',
version='0.1',
description='Sweet data integration',
author='Quartic Technologies',
author_email='alex@quartic.io',
license='MIT',
packages=['orinoco'],
install_requires=[
'aiohttp',
'pyformance'
],
... | true | true |
f70c4887921a9859df7647540889e198cf25bbcd | 3,362 | py | Python | src/utils/output_inference_images.py | stasys-hub/Collembola_AI | 373266d5edde0ad04d898de82c2a1eac89961e30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T12:49:12.000Z | 2022-03-31T12:49:12.000Z | src/utils/output_inference_images.py | stasys-hub/Collembola_AI | 373266d5edde0ad04d898de82c2a1eac89961e30 | [
"BSD-3-Clause"
] | null | null | null | src/utils/output_inference_images.py | stasys-hub/Collembola_AI | 373266d5edde0ad04d898de82c2a1eac89961e30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Project title: CollembolAI
Authors: Stephan Weißbach, Stanislav Sys, Clément Schneider
Original repository: https://github.com/stasys-hub/Collembola_AI.git
Module title: output_inference_images
.py
Purpose: draws bounding boxes from annotation on pictures.... | 39.552941 | 172 | 0.629982 |
from PIL import Image, ImageFont, ImageDraw
import os
from utils.cocoutils import coco2df
def draw_coco_bbox(
coco,
out_dir,
coco_dir,
eval_mode=False,
prefix="annotated",
line_width=10,
fontsize=80,
fontYshift=-70,
):
with open(
os.path.join(os.path.dirname(os.path.... | true | true |
f70c488c62af1145be4b18caddcaa7a6a066aabc | 60 | py | Python | tutorials/unittests/python/src/evenodd_finder.py | nithyarajendiran/softwaretesting | 0fdaaca51804529acf5578e59b2afb0119524dbd | [
"MIT"
] | 13 | 2016-02-08T04:32:22.000Z | 2021-11-15T16:19:10.000Z | tutorials/unittests/python/src/evenodd_finder.py | nithyarajendiran/softwaretesting | 0fdaaca51804529acf5578e59b2afb0119524dbd | [
"MIT"
] | 3 | 2016-04-18T19:04:27.000Z | 2017-01-21T19:07:01.000Z | tutorials/unittests/python/src/evenodd_finder.py | nithyarajendiran/softwaretesting | 0fdaaca51804529acf5578e59b2afb0119524dbd | [
"MIT"
] | 67 | 2015-07-27T23:44:47.000Z | 2022-02-20T14:38:49.000Z | def is_even(n):
if n%2 is 0:
return True
return False
| 12 | 15 | 0.65 | def is_even(n):
if n%2 is 0:
return True
return False
| true | true |
f70c48d4ef5485c7e9a680e396b7437268194f99 | 924 | bzl | Python | third_party/llvm/workspace.bzl | Jonathan-Atrey/tensorflow | 7b508870c2d19dc9772745aa55d953517fcb406d | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | Jonathan-Atrey/tensorflow | 7b508870c2d19dc9772745aa55d953517fcb406d | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | Jonathan-Atrey/tensorflow | 7b508870c2d19dc9772745aa55d953517fcb406d | [
"Apache-2.0"
] | null | null | null | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "5020e104a1349a0ae6532b007b48c68b8f64c049"
LLVM_SHA256 = "3113dbc5f7b3e6405375eedfe95e220268bcc4818c8d8453a23ef00f82d4b172"
tf_http_archive(
... | 42 | 149 | 0.676407 |
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
LLVM_COMMIT = "5020e104a1349a0ae6532b007b48c68b8f64c049"
LLVM_SHA256 = "3113dbc5f7b3e6405375eedfe95e220268bcc4818c8d8453a23ef00f82d4b172"
tf_http_archive(
name = name,
sha256 = LLVM_SHA256,
strip_prefix = "llvm-proj... | true | true |
f70c49fdef97e4475c713c043941d0fc73f98979 | 638 | py | Python | example/tests/orders/test_orders_signals.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 222 | 2020-02-03T16:58:56.000Z | 2022-03-30T16:35:35.000Z | example/tests/orders/test_orders_signals.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 16 | 2020-03-17T12:38:27.000Z | 2022-03-16T13:14:55.000Z | example/tests/orders/test_orders_signals.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 23 | 2020-08-28T04:46:33.000Z | 2022-01-12T21:57:39.000Z | import pytest
from salesman.orders.models import Order
from salesman.orders.signals import status_changed
_signal_called = False
def on_status_changed(sender, order, new_status, old_status, **kwargs):
global _signal_called
_signal_called = True
@pytest.mark.django_db
def test_order_changed_signal(rf):
... | 29 | 84 | 0.789969 | import pytest
from salesman.orders.models import Order
from salesman.orders.signals import status_changed
_signal_called = False
def on_status_changed(sender, order, new_status, old_status, **kwargs):
global _signal_called
_signal_called = True
@pytest.mark.django_db
def test_order_changed_signal(rf):
... | true | true |
f70c4b0fbc3e1bc9072c62f3aaa47973f8478299 | 37 | py | Python | archive/model/__init__.py | winstonwzhang/osumapper | e773b45650f8a013de48ff169a93ea1745c6f931 | [
"Apache-2.0"
] | null | null | null | archive/model/__init__.py | winstonwzhang/osumapper | e773b45650f8a013de48ff169a93ea1745c6f931 | [
"Apache-2.0"
] | null | null | null | archive/model/__init__.py | winstonwzhang/osumapper | e773b45650f8a013de48ff169a93ea1745c6f931 | [
"Apache-2.0"
] | null | null | null |
import sys
sys.path.append('model/') | 12.333333 | 25 | 0.72973 |
import sys
sys.path.append('model/') | true | true |
f70c4c0aca8a0ff7a8de0e6c05ec2770c0771307 | 555 | py | Python | pyvo/vomas/utils/file_utils.py | lmichel/pyvo | 8296bee2e799843909805fb6ae528a9b23776e8d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | pyvo/vomas/utils/file_utils.py | lmichel/pyvo | 8296bee2e799843909805fb6ae528a9b23776e8d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | pyvo/vomas/utils/file_utils.py | lmichel/pyvo | 8296bee2e799843909805fb6ae528a9b23776e8d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | '''
Created on Feb 26, 2021
@author: laurentmichel
'''
import os
class FileUtils(object):
file_path = os.path.dirname(os.path.realpath(__file__))
@staticmethod
def get_datadir():
return os.path.realpath(os.path.join(FileUtils.file_path, "../client/tests/", "data"))
@staticmethod
def... | 25.227273 | 94 | 0.643243 | import os
class FileUtils(object):
file_path = os.path.dirname(os.path.realpath(__file__))
@staticmethod
def get_datadir():
return os.path.realpath(os.path.join(FileUtils.file_path, "../client/tests/", "data"))
@staticmethod
def get_projectdir():
return os.path.realpath(os.pa... | true | true |
f70c4cd98e14e53f4160fd2649739493408ee4e7 | 5,578 | py | Python | train.py | briancylui/ALOCC-CVPR2018 | 78b6a1e8f3fcde8a46a88294926074a65ff0726a | [
"MIT"
] | 208 | 2018-03-16T11:48:59.000Z | 2022-03-22T14:34:06.000Z | train.py | briancylui/ALOCC-CVPR2018 | 78b6a1e8f3fcde8a46a88294926074a65ff0726a | [
"MIT"
] | 24 | 2018-05-10T09:07:08.000Z | 2022-02-15T10:03:46.000Z | train.py | briancylui/ALOCC-CVPR2018 | 78b6a1e8f3fcde8a46a88294926074a65ff0726a | [
"MIT"
] | 80 | 2018-03-21T08:16:18.000Z | 2022-03-13T12:52:29.000Z | import os
import numpy as np
from models import ALOCC_Model
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 40, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.002, "Learning rate of for adam [0.0002]")
flags.DEFINE_fl... | 44.269841 | 131 | 0.609896 | import os
import numpy as np
from models import ALOCC_Model
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 40, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.002, "Learning rate of for adam [0.0002]")
flags.DEFINE_fl... | true | true |
f70c4d3b5c86a34651890132efccc338f4586820 | 918 | py | Python | pipeline/pipeline_import_paths.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 118 | 2020-11-04T16:48:12.000Z | 2022-03-28T13:15:37.000Z | pipeline/pipeline_import_paths.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 23 | 2020-10-19T09:01:37.000Z | 2022-03-25T09:12:31.000Z | pipeline/pipeline_import_paths.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 29 | 2020-11-25T05:28:32.000Z | 2022-03-23T07:20:23.000Z | # Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import sys
import os.path as path
# when developing, prefer local kapture to the one installed on the system
HERE_PATH = path.abspath(path.normpath(path.dirname(__file__)))
KATURE_LOCALIZATION_REPO_PATH = path.normpath(path.join(HERE_PATH, '../'))
# che... | 43.714286 | 93 | 0.781046 |
import sys
import os.path as path
HERE_PATH = path.abspath(path.normpath(path.dirname(__file__)))
KATURE_LOCALIZATION_REPO_PATH = path.normpath(path.join(HERE_PATH, '../'))
if path.isdir(path.join(KATURE_LOCALIZATION_REPO_PATH, 'kapture_localization')):
sys.path.insert(0, KATURE_LOCALIZATION_REPO_PATH)
... | true | true |
f70c505c88c54964fea3593bedb0769499834a3c | 257 | py | Python | examples/exclude_defaults_none.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 118 | 2020-05-24T20:22:27.000Z | 2022-03-23T23:04:50.000Z | examples/exclude_defaults_none.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 89 | 2021-02-26T14:22:41.000Z | 2022-03-30T22:17:06.000Z | examples/exclude_defaults_none.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 13 | 2020-12-24T22:43:50.000Z | 2022-03-13T15:03:44.000Z | from dataclasses import dataclass
from apischema import serialize
@dataclass
class Foo:
bar: int = 0
baz: str | None = None
assert serialize(Foo, Foo(), exclude_defaults=True) == {}
assert serialize(Foo, Foo(), exclude_none=True) == {"bar": 0}
| 18.357143 | 61 | 0.692607 | from dataclasses import dataclass
from apischema import serialize
@dataclass
class Foo:
bar: int = 0
baz: str | None = None
assert serialize(Foo, Foo(), exclude_defaults=True) == {}
assert serialize(Foo, Foo(), exclude_none=True) == {"bar": 0}
| true | true |
f70c51db8a5f81dccf5c9556e871a85a69eb8c42 | 2,267 | py | Python | Code/Molweni/MolweniConfig.py | Aopolin-Lv/NLP_MRC | 62507e1fa0d024e2c6ca3cab37f94a015c071cf9 | [
"Apache-2.0"
] | null | null | null | Code/Molweni/MolweniConfig.py | Aopolin-Lv/NLP_MRC | 62507e1fa0d024e2c6ca3cab37f94a015c071cf9 | [
"Apache-2.0"
] | null | null | null | Code/Molweni/MolweniConfig.py | Aopolin-Lv/NLP_MRC | 62507e1fa0d024e2c6ca3cab37f94a015c071cf9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
@Time: 2020/11/14 2:15 下午
@Author: Aopolin
@File: MolweniConfig.py
@Contact: aopolin.ii@gmail.com
@Description:
"""
class Config(object):
def __init__(self):
self.SQUAD_DIR = "../../Dataset/squad2.0"
self.MOLWENI_DIR = "../../Dataset/Molweni"
... | 31.929577 | 128 | 0.602117 |
class Config(object):
def __init__(self):
self.SQUAD_DIR = "../../Dataset/squad2.0"
self.MOLWENI_DIR = "../../Dataset/Molweni"
self.model_type = "bert"
self.model_name_or_path = "bert-base-uncased"
self.output_dir = "/tmp/debug_squad/"
self.data_dir = ""
... | true | true |
f70c531988d553f61ca2d9e8c0976401be0015f1 | 8,831 | py | Python | google/cloud/aiplatform_v1/types/dataset.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/dataset.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/dataset.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 37.261603 | 110 | 0.649417 |
import proto
from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
from google.cloud.aiplatform_v1.types import io
from google.protobuf import struct_pb2
from google.protobuf import timestamp_pb2
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1",... | true | true |
f70c53fffb048f9fbd54384d990e79e47914bdb4 | 590 | py | Python | pyformlang/regular_expression/__init__.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | pyformlang/regular_expression/__init__.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | 1 | 2020-07-22T11:40:30.000Z | 2020-07-22T11:40:30.000Z | pyformlang/regular_expression/__init__.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | """
:mod:`pyformlang.regular_expression`
====================================
This module deals with regular expression.
By default, this module does not use the standard way to write regular
expressions. Please read the documentation of Regex for more information.
Available Classes
-----------------
Regex
A re... | 22.692308 | 73 | 0.720339 |
from .regex import Regex
from .regex_objects import MisformedRegexError
from .python_regex import PythonRegex
__all__ = ["Regex", "PythonRegex", "MisformedRegexError"]
| true | true |
f70c54a7ba4a717f4018e33e0949863ac4c6ac3f | 1,947 | py | Python | setup.py | mzy2240/openSE | b6ab59b49efe46ac60e7e993a6096d8a69e3219b | [
"Apache-2.0"
] | null | null | null | setup.py | mzy2240/openSE | b6ab59b49efe46ac60e7e993a6096d8a69e3219b | [
"Apache-2.0"
] | null | null | null | setup.py | mzy2240/openSE | b6ab59b49efe46ac60e7e993a6096d8a69e3219b | [
"Apache-2.0"
] | null | null | null | from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
# note: all settings are in settings.ini; edit there, not here
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
... | 40.5625 | 102 | 0.666667 | from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
cfg_keys = 'version description keywords author author_email'... | true | true |
f70c54ace8d3b1e3d7e5d360387aff531bf3b870 | 4,368 | py | Python | src/tagging/train.py | grahamwhiteuk/neutralizing-bias | a6ef764046fcc68ac0daa612c160ec23a79d3e73 | [
"MIT"
] | 169 | 2019-11-20T05:20:05.000Z | 2022-03-25T11:56:26.000Z | src/tagging/train.py | grahamwhiteuk/neutralizing-bias | a6ef764046fcc68ac0daa612c160ec23a79d3e73 | [
"MIT"
] | 10 | 2020-02-10T21:41:10.000Z | 2022-02-05T10:37:52.000Z | src/tagging/train.py | grahamwhiteuk/neutralizing-bias | a6ef764046fcc68ac0daa612c160ec23a79d3e73 | [
"MIT"
] | 44 | 2019-11-26T11:54:45.000Z | 2022-03-03T23:16:04.000Z | # -*- coding: utf-8 -*-
"""
train bert
python tagging/train.py --train ../../data/v6/corpus.wordbiased.tag.train --test ../../data/v6/corpus.wordbiased.tag.test --working_dir TEST --train_batch_size 3 --test_batch_size 10 --hidden_size 32 --debug_skip
"""
from pytorch_pretrained_bert.tokenization import BertTokenize... | 31.883212 | 213 | 0.690247 |
from pytorch_pretrained_bert.tokenization import BertTokenizer
from pytorch_pretrained_bert.optimization import BertAdam
from collections import defaultdict
from torch.utils.data import TensorDataset, DataLoader, RandomSampler
from tqdm import tqdm
import torch
import torch.nn as nn
import pickle
import sys
import os... | true | true |
f70c558e8e110dc473b09a410155f7b271c28ec7 | 480 | py | Python | Pupil3dDetectorOSC/SetROI.py | SummerSigh/VrEyeToolbox | 8e7c21e4a5ee95db9aea4b1bce0a3966156b9e5c | [
"MIT"
] | 9 | 2022-03-17T02:00:45.000Z | 2022-03-21T00:20:46.000Z | Pupil3dDetectorOSC/SetROI.py | SummerSigh/VrEyeToolbox | 8e7c21e4a5ee95db9aea4b1bce0a3966156b9e5c | [
"MIT"
] | null | null | null | Pupil3dDetectorOSC/SetROI.py | SummerSigh/VrEyeToolbox | 8e7c21e4a5ee95db9aea4b1bce0a3966156b9e5c | [
"MIT"
] | null | null | null | from re import X
from tkinter import Y
import cv2
cap = cv2.VideoCapture("demo2.mp4")
ret, img = cap.read()
roibb = cv2.selectROI("image", img, fromCenter=False, showCrosshair=True)
print('X', roibb[0])
print('Y', roibb[1])
print('Width', roibb[2])
print('Height', roibb[3])
with open('roi.cfg', 'w+') as rf:
rf.w... | 22.857143 | 73 | 0.625 | from re import X
from tkinter import Y
import cv2
cap = cv2.VideoCapture("demo2.mp4")
ret, img = cap.read()
roibb = cv2.selectROI("image", img, fromCenter=False, showCrosshair=True)
print('X', roibb[0])
print('Y', roibb[1])
print('Width', roibb[2])
print('Height', roibb[3])
with open('roi.cfg', 'w+') as rf:
rf.w... | true | true |
f70c5661944cec2cc6f4ba9452219086980e1ea2 | 655 | py | Python | venv/Lib/site-packages/nipype/interfaces/dipy/registration.py | richung99/digitizePlots | 6b408c820660a415a289726e3223e8f558d3e18b | [
"MIT"
] | 585 | 2015-01-12T16:06:47.000Z | 2022-03-26T14:51:08.000Z | nipype/interfaces/dipy/registration.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 2,329 | 2015-01-01T09:56:41.000Z | 2022-03-30T14:24:49.000Z | nipype/interfaces/dipy/registration.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 487 | 2015-01-20T01:04:52.000Z | 2022-03-21T21:22:47.000Z | from distutils.version import LooseVersion
from ... import logging
from .base import HAVE_DIPY, dipy_version, dipy_to_nipype_interface, get_dipy_workflows
IFLOGGER = logging.getLogger("nipype.interface")
if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion("0.15"):
from dipy.workflows import align
... | 29.772727 | 87 | 0.717557 | from distutils.version import LooseVersion
from ... import logging
from .base import HAVE_DIPY, dipy_version, dipy_to_nipype_interface, get_dipy_workflows
IFLOGGER = logging.getLogger("nipype.interface")
if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion("0.15"):
from dipy.workflows import align
... | true | true |
f70c56dae054122f2ba8494eb90f9965b9b545a2 | 203 | py | Python | approaches/__init__.py | JetBrains-Research/docs-fine-tuning | a56e1f1e4183432994a40ac796a36095a747e052 | [
"MIT"
] | null | null | null | approaches/__init__.py | JetBrains-Research/docs-fine-tuning | a56e1f1e4183432994a40ac796a36095a747e052 | [
"MIT"
] | null | null | null | approaches/__init__.py | JetBrains-Research/docs-fine-tuning | a56e1f1e4183432994a40ac796a36095a747e052 | [
"MIT"
] | null | null | null | from approaches.abstract_approach import AbstractApproach
from approaches.simple import SimpleApproach
from approaches.tfidf import TfIdfApproach
from approaches.intersection import IntersectionApproach
| 40.6 | 57 | 0.901478 | from approaches.abstract_approach import AbstractApproach
from approaches.simple import SimpleApproach
from approaches.tfidf import TfIdfApproach
from approaches.intersection import IntersectionApproach
| true | true |
f70c56e55155862a4b331fc2e4813966d327374e | 6,619 | py | Python | sagemaker-dash/tutorials/app15.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 13 | 2021-05-23T15:47:24.000Z | 2022-03-24T16:22:14.000Z | sagemaker-dash/tutorials/app15.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 4 | 2021-11-16T20:44:55.000Z | 2022-01-13T19:13:38.000Z | sagemaker-dash/tutorials/app15.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 11 | 2021-01-31T06:18:10.000Z | 2021-11-21T00:02:05.000Z | import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.express as px
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
df = pd.read_csv('https://plotly.github.io/data... | 35.395722 | 78 | 0.500227 | import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.express as px
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
df = pd.read_csv('https://plotly.github.io/data... | true | true |
f70c5741e0bdc69a1654286b32fcf96209f03e6b | 3,111 | py | Python | tests/semver/test_parse_constraint.py | henryiii/poetry-core | c0d7e52f49b12092ba6829ecb02db7701cbff019 | [
"MIT"
] | null | null | null | tests/semver/test_parse_constraint.py | henryiii/poetry-core | c0d7e52f49b12092ba6829ecb02db7701cbff019 | [
"MIT"
] | null | null | null | tests/semver/test_parse_constraint.py | henryiii/poetry-core | c0d7e52f49b12092ba6829ecb02db7701cbff019 | [
"MIT"
] | 1 | 2021-04-08T03:26:23.000Z | 2021-04-08T03:26:23.000Z | import pytest
from poetry.core.semver import Version
from poetry.core.semver import VersionRange
from poetry.core.semver import VersionUnion
from poetry.core.semver import parse_constraint
@pytest.mark.parametrize(
"constraint,version",
[
("~=3.8", VersionRange(min=Version(3, 8), max=Version(4, 0), i... | 34.186813 | 88 | 0.491803 | import pytest
from poetry.core.semver import Version
from poetry.core.semver import VersionRange
from poetry.core.semver import VersionUnion
from poetry.core.semver import parse_constraint
@pytest.mark.parametrize(
"constraint,version",
[
("~=3.8", VersionRange(min=Version(3, 8), max=Version(4, 0), i... | true | true |
f70c577d5a00a0cb8f77a0f4b89135a1f7157793 | 206 | py | Python | PyMOTW/source/itertools/itertools_repeat_map.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/itertools/itertools_repeat_map.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/itertools/itertools_repeat_map.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
"""Using repeat() and map()
"""
#end_pymotw_header
from itertools import *
for i in map(lambda x, y: (x, y, x * y), repeat(2), range(5)):
print('{:d} * {:d} = {:d}'.format(*i))
| 20.6 | 62 | 0.572816 |
from itertools import *
for i in map(lambda x, y: (x, y, x * y), repeat(2), range(5)):
print('{:d} * {:d} = {:d}'.format(*i))
| true | true |
f70c5874fbd5bf53254b675479e8a23d62b45722 | 8,237 | py | Python | Projects/Sugarscape/Model.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | 16 | 2019-01-10T18:54:13.000Z | 2022-01-28T20:07:20.000Z | Projects/Sugarscape/Model.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | null | null | null | Projects/Sugarscape/Model.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | 15 | 2019-01-24T17:11:20.000Z | 2021-12-11T01:53:57.000Z | import numpy as np
import pandas as pd
from scipy.stats.mstats import gmean
import random
import math
from randomdict import RandomDict
# from chest import *
import shelve
from Patch import *
from AgentBranch import *
import gc
from memory_profiler import memory_usage
#Model.py
class Model():
def __init__(self, gu... | 42.901042 | 119 | 0.552264 | import numpy as np
import pandas as pd
from scipy.stats.mstats import gmean
import random
import math
from randomdict import RandomDict
import shelve
from Patch import *
from AgentBranch import *
import gc
from memory_profiler import memory_usage
class Model():
def __init__(self, gui, num_agents, mutate, genetic... | true | true |
f70c58be42fabc014fde7ab38fe60f065cf15661 | 1,583 | py | Python | fixture/create_identity_docs.py | bancone/test | b3ffd796e19ab9e7c2317ce0397717e6102f7cca | [
"Apache-2.0"
] | null | null | null | fixture/create_identity_docs.py | bancone/test | b3ffd796e19ab9e7c2317ce0397717e6102f7cca | [
"Apache-2.0"
] | null | null | null | fixture/create_identity_docs.py | bancone/test | b3ffd796e19ab9e7c2317ce0397717e6102f7cca | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import time
import os
class CreateID:
def __init__(self, rpapp):
self.rpapp = rpapp
def create_docs(self):
driver = self.rpapp.driver
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='ti'])[1]/following::button[6]").click(... | 45.228571 | 117 | 0.600758 |
import time
import os
class CreateID:
def __init__(self, rpapp):
self.rpapp = rpapp
def create_docs(self):
driver = self.rpapp.driver
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='ti'])[1]/following::button[6]").click()
driv... | true | true |
f70c591798e6640713a38f3ccae3131033c4b307 | 1,306 | py | Python | moto/sts/models.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | moto/sts/models.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | moto/sts/models.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | import datetime
from moto.core import BaseBackend
from moto.core.utils import iso_8601_datetime
class Token(object):
def __init__(self, duration, name=None, policy=None):
now = datetime.datetime.now()
self.expiration = now + datetime.timedelta(seconds=duration)
self.name = name
sel... | 28.391304 | 83 | 0.687596 | import datetime
from moto.core import BaseBackend
from moto.core.utils import iso_8601_datetime
class Token(object):
def __init__(self, duration, name=None, policy=None):
now = datetime.datetime.now()
self.expiration = now + datetime.timedelta(seconds=duration)
self.name = name
sel... | true | true |
f70c5ab8d21eb367285ecde00b1cc823ba363c25 | 41,663 | py | Python | utils/gen_onnx_mlir.py | eashdown/onnx-mlir | 2662d5530a01ddb11056ae7958118e82487a9eb8 | [
"Apache-2.0"
] | null | null | null | utils/gen_onnx_mlir.py | eashdown/onnx-mlir | 2662d5530a01ddb11056ae7958118e82487a9eb8 | [
"Apache-2.0"
] | null | null | null | utils/gen_onnx_mlir.py | eashdown/onnx-mlir | 2662d5530a01ddb11056ae7958118e82487a9eb8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict, OrderedDict
from io import StringIO
import io
import os
import sys
import datetime
import argparse
import nump... | 34.15 | 105 | 0.595612 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict, OrderedDict
from io import StringIO
import io
import os
import sys
import datetime
import argparse
import numpy as np
from onnx ... | true | true |
f70c5bac57d302bc5a45ac3b4b947aa42b326dfb | 5,320 | py | Python | tests/components/smartthings/test_sensor.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | tests/components/smartthings/test_sensor.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | tests/components/smartthings/test_sensor.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """
Test for the SmartThings sensors platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import ATTRIBUTES, CAPABILITIES, Attribute, Capability
from homeassistant.components.sensor import DEVICE_CLASSES, DOMAIN as ... | 42.56 | 88 | 0.738346 | from pysmartthings import ATTRIBUTES, CAPABILITIES, Attribute, Capability
from homeassistant.components.sensor import DEVICE_CLASSES, DOMAIN as SENSOR_DOMAIN
from homeassistant.components.smartthings import sensor
from homeassistant.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE
from homeassista... | true | true |
f70c5e0ef140c99c7cfd6c015d53084e18fd2d1c | 2,676 | py | Python | pvoutput.py | houthacker/solar | fd7b3d36ce27a8287eee4a5cd7a2c383d1bb4379 | [
"MIT"
] | 6 | 2017-12-02T00:31:11.000Z | 2020-04-16T18:48:37.000Z | pvoutput.py | semonet/solar | fd7b3d36ce27a8287eee4a5cd7a2c383d1bb4379 | [
"MIT"
] | null | null | null | pvoutput.py | semonet/solar | fd7b3d36ce27a8287eee4a5cd7a2c383d1bb4379 | [
"MIT"
] | 2 | 2019-04-11T08:46:46.000Z | 2020-09-14T18:57:51.000Z | #!/usr/bin/env python3
# pvoutput.py
#
# Simple library for uploading data to PVOutput.
import urllib.request
import urllib.parse
import urllib.error
import logging
import sys
logger = logging.getLogger(__name__)
class System:
"""Provides methods for direct uploading to PVOutput for set system."""
def ... | 31.116279 | 80 | 0.628176 |
import urllib.request
import urllib.parse
import urllib.error
import logging
import sys
logger = logging.getLogger(__name__)
class System:
def __init__(self, api_key, system_id):
self.api_key = api_key
self.system_id = system_id
def add_output(self, data):
url = "http:/... | true | true |
f70c5e1a08b6c30cd22ab82097aa427cc601e770 | 758 | py | Python | weddingPlanner/urls.py | mithran77/online-wedding-planner | 9212d163de5ec75c30f33e1733a3d863049f1a59 | [
"BSD-2-Clause"
] | null | null | null | weddingPlanner/urls.py | mithran77/online-wedding-planner | 9212d163de5ec75c30f33e1733a3d863049f1a59 | [
"BSD-2-Clause"
] | 4 | 2020-02-11T21:37:44.000Z | 2021-06-10T17:26:16.000Z | weddingPlanner/urls.py | mithran77/online-wedding-planner | 9212d163de5ec75c30f33e1733a3d863049f1a59 | [
"BSD-2-Clause"
] | null | null | null | from django.conf.urls import include, url # pragma: no cover
from django.contrib import admin # pragma: no cover
from weddingServices import views as ws_views # pragma: no cover
from django.contrib.auth import views as auth_views # pragma: no cover
urlpatterns = [ # pragma: no cover
# Examples:
# url(r'^$', '... | 42.111111 | 99 | 0.693931 | from django.conf.urls import include, url
from django.contrib import admin
from weddingServices import views as ws_views
from django.contrib.auth import views as auth_views
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^login/$', auth_views.login, {'template_name': 'weddin... | true | true |
f70c5e61b4dd32058f4477ae50c3d199891c6439 | 19,730 | py | Python | modules/s3db/tour.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | 1 | 2015-01-24T04:31:51.000Z | 2015-01-24T04:31:51.000Z | modules/s3db/tour.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | modules/s3db/tour.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Guided Tour Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software w... | 42.15812 | 93 | 0.456918 |
__all__ = ("S3GuidedTourModel",
"tour_rheader",
"tour_builder",
)
from gluon import *
from gluon.storage import Storage
from ..s3 import *
class S3GuidedTourModel(S3Model):
names = ("tour_config",
"tour_details",
"tour_user",
)
def... | true | true |
f70c5edb71a501cc0a19546d7d5381683b20c5ec | 5,403 | py | Python | rasa/core/channels/rest.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | null | null | null | rasa/core/channels/rest.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | null | null | null | rasa/core/channels/rest.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | 1 | 2022-02-22T12:35:19.000Z | 2022-02-22T12:35:19.000Z | import asyncio
import inspect
import json
import logging
from asyncio import Queue, CancelledError
from sanic import Blueprint, response
from sanic.request import Request
from sanic.response import HTTPResponse, ResponseStream
from typing import Text, Dict, Any, Optional, Callable, Awaitable, NoReturn, Union
import ra... | 33.351852 | 86 | 0.581529 | import asyncio
import inspect
import json
import logging
from asyncio import Queue, CancelledError
from sanic import Blueprint, response
from sanic.request import Request
from sanic.response import HTTPResponse, ResponseStream
from typing import Text, Dict, Any, Optional, Callable, Awaitable, NoReturn, Union
import ra... | true | true |
f70c5fcd09a063102113a02480cf3a39f1d26fcb | 7,804 | py | Python | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/pickle/ChemkinPickler.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 31 | 2018-11-21T01:49:06.000Z | 2022-03-30T03:41:43.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/pickle/ChemkinPickler.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 123 | 2019-03-12T22:27:29.000Z | 2022-03-29T17:00:04.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/pickle/ChemkinPickler.py | sundials-codes/PelePhysics | 5624f83a04f43aa95288be9d8a7bb372a4adefe6 | [
"BSD-3-Clause-LBNL"
] | 32 | 2018-11-05T11:51:59.000Z | 2022-03-29T13:09:32.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~... | 25.92691 | 82 | 0.481164 |
from weaver.mills.LineMill import LineMill
class ChemkinPickler(LineMill):
names = ["chemkin"]
def _renderDocument(self, mechanism, options=None):
self.pickleElementSection(mechanism)
self.pickleSpeciesSection(mechanism)
self.pickleThermoSection(mechanism)
self.... | true | true |
f70c60815fe4aa5aa2583779ef34546134b65f1c | 4,527 | py | Python | main.py | Mattstacey321/ulauncher-vscodium-recent | 19d0ddbcfbc384ae85c878f2f2683df57fb040f4 | [
"MIT"
] | null | null | null | main.py | Mattstacey321/ulauncher-vscodium-recent | 19d0ddbcfbc384ae85c878f2f2683df57fb040f4 | [
"MIT"
] | null | null | null | main.py | Mattstacey321/ulauncher-vscodium-recent | 19d0ddbcfbc384ae85c878f2f2683df57fb040f4 | [
"MIT"
] | null | null | null | import os
import os.path
import json
import pathlib
from types import prepare_class
from ulauncher.api.client.Extension import Extension
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import (
KeywordQueryEvent,
ItemEnterEvent,
PreferencesEvent,
PreferencesUpdateEvent,
... | 30.587838 | 121 | 0.737133 | import os
import os.path
import json
import pathlib
from types import prepare_class
from ulauncher.api.client.Extension import Extension
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import (
KeywordQueryEvent,
ItemEnterEvent,
PreferencesEvent,
PreferencesUpdateEvent,
... | true | true |
f70c60bcf9f085a2a93faecbc3574b70bb4fe4af | 1,457 | py | Python | tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py | AnthonyQuantum/open_model_zoo | 7d235755e2d17f6186b11243a169966e4f05385a | [
"Apache-2.0"
] | 4 | 2021-04-21T02:38:04.000Z | 2021-10-13T12:15:33.000Z | tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py | AnthonyQuantum/open_model_zoo | 7d235755e2d17f6186b11243a169966e4f05385a | [
"Apache-2.0"
] | 6 | 2020-11-13T19:02:47.000Z | 2022-03-12T00:43:24.000Z | tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py | AnthonyQuantum/open_model_zoo | 7d235755e2d17f6186b11243a169966e4f05385a | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019 Intel Corporation
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,... | 40.472222 | 102 | 0.739876 |
from ..representation import PoseEstimation3dAnnotation, PoseEstimation3dPrediction
from .postprocessor import Postprocessor
class Translate3dPoses(Postprocessor):
__provider__ = 'translate_3d_poses'
annotation_types = (PoseEstimation3dAnnotation,)
prediction_types = (PoseEstimation3dPrediction,)
de... | true | true |
f70c60debfd9c884bf61bf9fe74a7c883dea56e0 | 1,078 | py | Python | get_similar_words_triples.py | t2hk/scdv_glove_elasticsearch | 41cd336decf1e14e77439caaa26f64edf28ce42b | [
"Apache-2.0"
] | 2 | 2020-01-07T15:44:04.000Z | 2020-02-28T08:03:15.000Z | get_similar_words_triples.py | t2hk/scdv_glove_elasticsearch | 41cd336decf1e14e77439caaa26f64edf28ce42b | [
"Apache-2.0"
] | null | null | null | get_similar_words_triples.py | t2hk/scdv_glove_elasticsearch | 41cd336decf1e14e77439caaa26f64edf28ce42b | [
"Apache-2.0"
] | null | null | null | from gensim.models import KeyedVectors
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.font_manager as fm
import pandas as pd
glove_vector_file = "vectors.txt"
gensim_glove_vector_file = "gensim_glove_vectors.txt"
top_k = 10
words_triple_file = 'similarity_words.ttl'
# G... | 27.641026 | 89 | 0.748609 | from gensim.models import KeyedVectors
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.font_manager as fm
import pandas as pd
glove_vector_file = "vectors.txt"
gensim_glove_vector_file = "gensim_glove_vectors.txt"
top_k = 10
words_triple_file = 'similarity_words.ttl'
ve... | true | true |
f70c614d16242661bb9c6d13d42fa1394aa4231b | 17,585 | py | Python | extra/osmprovider.py | bebora/LeafRoute | c80ed77789c73f0173c986c5482de4f2503f7cc1 | [
"BSD-2-Clause"
] | 3 | 2019-05-26T12:32:20.000Z | 2019-10-07T11:29:28.000Z | extra/osmprovider.py | bebora/LeafRoute | c80ed77789c73f0173c986c5482de4f2503f7cc1 | [
"BSD-2-Clause"
] | null | null | null | extra/osmprovider.py | bebora/LeafRoute | c80ed77789c73f0173c986c5482de4f2503f7cc1 | [
"BSD-2-Clause"
] | 6 | 2019-06-20T10:41:43.000Z | 2019-10-10T00:17:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Leonardo Arcari @leonardoarcari"
from networkx.relabel import convert_node_labels_to_integers
import networkx as nx
from pathlib import Path
from osgeo import ogr
from osgeo import osr
from math import cos, sin, asin, sqrt, radians
import random
## Modules
... | 32.20696 | 219 | 0.557805 |
__author__ = "Leonardo Arcari @leonardoarcari"
from networkx.relabel import convert_node_labels_to_integers
import networkx as nx
from pathlib import Path
from osgeo import ogr
from osgeo import osr
from math import cos, sin, asin, sqrt, radians
import random
th import radians, cos, sin, asin, sqrt
import argparse... | true | true |
f70c628036311a35fe236d5b94ccde4248cfc56c | 269 | py | Python | 1-moderate/robo-and-robitta/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 21 | 2015-02-09T18:41:15.000Z | 2021-07-31T02:43:28.000Z | 1-moderate/robo-and-robitta/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | null | null | null | 1-moderate/robo-and-robitta/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 37 | 2015-01-06T06:20:17.000Z | 2021-06-21T18:22:13.000Z | import re
import sys
def walk(m, n, x, y):
c = 0
while n > y:
c, m, n, x, y = c + m, n - 1, m, n - y, x
return c + x
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
print(walk(*map(int, re.findall(r'\d+', test))))
| 17.933333 | 56 | 0.505576 | import re
import sys
def walk(m, n, x, y):
c = 0
while n > y:
c, m, n, x, y = c + m, n - 1, m, n - y, x
return c + x
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
print(walk(*map(int, re.findall(r'\d+', test))))
| true | true |
f70c62a3ac4a06f3848d9bf75d7cfce91bf451dc | 3,889 | py | Python | Python/Module/JoyStick.py | Hajime-Saitou/Games | f7ec0807855481cd1c6b135cd7c6d0f3898d3c59 | [
"MIT"
] | 1 | 2021-02-27T17:58:14.000Z | 2021-02-27T17:58:14.000Z | Python/Module/JoyStick.py | Hajime-Saitou/Games | f7ec0807855481cd1c6b135cd7c6d0f3898d3c59 | [
"MIT"
] | null | null | null | Python/Module/JoyStick.py | Hajime-Saitou/Games | f7ec0807855481cd1c6b135cd7c6d0f3898d3c59 | [
"MIT"
] | null | null | null | # JoyStick
#
# Copyright (c) 2021 Hajime Saito
#
# Released under the MIT license.
# see https://opensource.org/licenses/MIT
import pygame
from pygame.locals import *
import Repeater
JOY_MAX_TRIGGER = 16
JOY_NOINPUT = 0
JOY_UP = 0x1 << JOY_MAX_TRIGGER
JOY_RIGHT = 0x2 << JOY_MAX_TRIGGER
JOY_DOWN = 0x4 <<... | 24.770701 | 66 | 0.701723 |
import pygame
from pygame.locals import *
import Repeater
JOY_MAX_TRIGGER = 16
JOY_NOINPUT = 0
JOY_UP = 0x1 << JOY_MAX_TRIGGER
JOY_RIGHT = 0x2 << JOY_MAX_TRIGGER
JOY_DOWN = 0x4 << JOY_MAX_TRIGGER
JOY_LEFT = 0x8 << JOY_MAX_TRIGGER
JOY_TRIGGER1 = 0x1 << 0
JOY_TRIGGER2 = 0x1 << 1
JOY_TRIGGER3 ... | true | true |
f70c62fba7c4424468351fa0d5cf2e162e2be301 | 1,399 | py | Python | auth_api/views.py | sodascourse/note-storage | 2e7decf968c6939b30ca52573e1a33d12ce32e0e | [
"Apache-2.0"
] | null | null | null | auth_api/views.py | sodascourse/note-storage | 2e7decf968c6939b30ca52573e1a33d12ce32e0e | [
"Apache-2.0"
] | null | null | null | auth_api/views.py | sodascourse/note-storage | 2e7decf968c6939b30ca52573e1a33d12ce32e0e | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.generics import CreateAPIView
User = get_user_model()
class SignupSerializer(serializers.Serializer):
error_message = "'{value}' is a registered {field}. Contact admin if you forgets password."
username... | 33.309524 | 95 | 0.706219 | from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.generics import CreateAPIView
User = get_user_model()
class SignupSerializer(serializers.Serializer):
error_message = "'{value}' is a registered {field}. Contact admin if you forgets password."
username... | true | true |
f70c64f401fdeb5c96c28f7172af6fe7f9010dbf | 49,435 | py | Python | qiskit/pulse/schedule.py | SooluThomas/qiskit-terra | 25b47af83f14afb3441d7b2c1bd31bda93e3549d | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/schedule.py | SooluThomas/qiskit-terra | 25b47af83f14afb3441d7b2c1bd31bda93e3549d | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/schedule.py | SooluThomas/qiskit-terra | 25b47af83f14afb3441d7b2c1bd31bda93e3549d | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 42.07234 | 100 | 0.588834 |
import abc
import copy
import itertools
import multiprocessing as mp
import sys
import warnings
from collections import defaultdict
from typing import List, Tuple, Iterable, Union, Dict, Callable, Set, Optional, Any
import numpy as np
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.par... | true | true |
f70c650c83c204939534be015e5d5136526af01e | 38,121 | py | Python | microsetta_admin/server.py | microsetta/microsetta-admin | 1ba6787c0315a74d50cafd722dbbe044d507c07f | [
"BSD-3-Clause"
] | null | null | null | microsetta_admin/server.py | microsetta/microsetta-admin | 1ba6787c0315a74d50cafd722dbbe044d507c07f | [
"BSD-3-Clause"
] | null | null | null | microsetta_admin/server.py | microsetta/microsetta-admin | 1ba6787c0315a74d50cafd722dbbe044d507c07f | [
"BSD-3-Clause"
] | null | null | null | import jwt
from flask import render_template, Flask, request, session, send_file
import secrets
from datetime import datetime
import io
from jwt import PyJWTError
from werkzeug.exceptions import BadRequest
from werkzeug.utils import redirect
import pandas as pd
from microsetta_admin import metadata_util, upload_util
... | 38.780264 | 98 | 0.574906 | import jwt
from flask import render_template, Flask, request, session, send_file
import secrets
from datetime import datetime
import io
from jwt import PyJWTError
from werkzeug.exceptions import BadRequest
from werkzeug.utils import redirect
import pandas as pd
from microsetta_admin import metadata_util, upload_util
... | true | true |
f70c651bfec18a770fd048a9281fc8526c3a4a28 | 53,701 | py | Python | htools/core.py | hdmamin/htools | 620c6add29561b77c10d793e4be7beeb28b32bab | [
"MIT"
] | 1 | 2019-12-14T15:24:38.000Z | 2019-12-14T15:24:38.000Z | htools/core.py | hdmamin/htools | 620c6add29561b77c10d793e4be7beeb28b32bab | [
"MIT"
] | null | null | null | htools/core.py | hdmamin/htools | 620c6add29561b77c10d793e4be7beeb28b32bab | [
"MIT"
] | 1 | 2020-03-30T17:26:39.000Z | 2020-03-30T17:26:39.000Z | from bz2 import BZ2File
from collections import Counter, Sequence, Iterable, \
Mapping
from functools import partial
import gc
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email import encoders
from inspect import signature, getattr_... | 31.964881 | 79 | 0.625798 | from bz2 import BZ2File
from collections import Counter, Sequence, Iterable, \
Mapping
from functools import partial
import gc
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email import encoders
from inspect import signature, getattr_... | true | true |
f70c651ffebe47bce3c52d330166eb8fc9ad41b9 | 475 | py | Python | frameworks/tensorflow/print_tensor_in_ckpt.py | JasonWayne/deep-learning-snippets | 7c64e065752fcbb902494d757a41140f42facf05 | [
"MIT"
] | null | null | null | frameworks/tensorflow/print_tensor_in_ckpt.py | JasonWayne/deep-learning-snippets | 7c64e065752fcbb902494d757a41140f42facf05 | [
"MIT"
] | null | null | null | frameworks/tensorflow/print_tensor_in_ckpt.py | JasonWayne/deep-learning-snippets | 7c64e065752fcbb902494d757a41140f42facf05 | [
"MIT"
] | null | null | null | '''
common usage:
1. put this script in ckpt folder
2. python print_tensor_in_ckpt.py > tensors.txt
'''
# ref: https://stackoverflow.com/questions/38218174/how-do-i-find-the-variable-names-and-values-that-are-saved-in-a-checkpoint
import tensorflow as tf
from tensorflow.python.tools.inspect_checkpoint import print... | 36.538462 | 126 | 0.8 |
import tensorflow as tf
from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
latest_ckp = tf.train.latest_checkpoint('./')
print_tensors_in_checkpoint_file(latest_ckp, all_tensors=True, tensor_name='')
| true | true |
f70c657b24f5e01e4e11443197e6a739d6dc1295 | 90,707 | py | Python | test/functional/p2p-segwit.py | chanchoi829/favcoin | 8f836036faae2e3575ef05a22c450e88b120a5fa | [
"MIT"
] | null | null | null | test/functional/p2p-segwit.py | chanchoi829/favcoin | 8f836036faae2e3575ef05a22c450e88b120a5fa | [
"MIT"
] | null | null | null | test/functional/p2p-segwit.py | chanchoi829/favcoin | 8f836036faae2e3575ef05a22c450e88b120a5fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_fram... | 46.302705 | 150 | 0.658615 |
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, get_witness_script, WITNESS_COMMITMENT_HEADER
from ... | true | true |
f70c6638a3a13cbe074afeaa5a903fcedc67e553 | 7,114 | py | Python | notion_tqdm/std.py | shunyooo/notion-tqdm | 78c05eeea9427deaed63709740c4b9329fb1b7e7 | [
"MIT"
] | 52 | 2020-11-26T09:07:27.000Z | 2022-03-22T21:14:49.000Z | notion_tqdm/std.py | shunyooo/notion-tqdm | 78c05eeea9427deaed63709740c4b9329fb1b7e7 | [
"MIT"
] | 1 | 2021-05-25T18:35:18.000Z | 2021-05-25T18:35:18.000Z | notion_tqdm/std.py | shunyooo/notion-tqdm | 78c05eeea9427deaed63709740c4b9329fb1b7e7 | [
"MIT"
] | 3 | 2021-02-20T09:36:36.000Z | 2022-01-11T17:36:20.000Z | import inspect
import json
import logging
import threading
from datetime import datetime, timezone
from time import time
import pytz
import requests
from notion.block import TextBlock
from notion.client import NotionClient
from notion.collection import NotionDate
from tqdm import tqdm
from tzlocal import get_localzone... | 34.201923 | 199 | 0.608237 | import inspect
import json
import logging
import threading
from datetime import datetime, timezone
from time import time
import pytz
import requests
from notion.block import TextBlock
from notion.client import NotionClient
from notion.collection import NotionDate
from tqdm import tqdm
from tzlocal import get_localzone... | true | true |
f70c665447c79ac8275fcc74e677d12bb8275fcf | 299 | py | Python | cleanup_repo.py | cweb-project/cweb-project | 53e4b77018996533a8bae8e79c30abf62e81ea5a | [
"MIT"
] | 2 | 2018-11-06T12:43:29.000Z | 2019-01-09T15:23:18.000Z | cleanup_repo.py | cweb-project/cweb-project | 53e4b77018996533a8bae8e79c30abf62e81ea5a | [
"MIT"
] | 1 | 2018-11-06T20:37:57.000Z | 2018-11-13T17:13:11.000Z | cleanup_repo.py | cweb-project/cweb-project | 53e4b77018996533a8bae8e79c30abf62e81ea5a | [
"MIT"
] | 3 | 2019-01-15T17:35:26.000Z | 2020-03-01T18:53:03.000Z | import shutil
import sys
import os
for (root,dirs,files) in os.walk(os.path.abspath('.'),topdown=True):
for d in dirs:
path = os.path.join(root,d)
if '__pycache__' in path:
shutil.rmtree(path)
for f in files:
path = os.path.join(root,f)
if '.DS_Store' in path:
os.remove(path)
| 18.6875 | 69 | 0.665552 | import shutil
import sys
import os
for (root,dirs,files) in os.walk(os.path.abspath('.'),topdown=True):
for d in dirs:
path = os.path.join(root,d)
if '__pycache__' in path:
shutil.rmtree(path)
for f in files:
path = os.path.join(root,f)
if '.DS_Store' in path:
os.remove(path)
| true | true |
f70c669144c2a6b334af8258d02f848255428606 | 2,915 | py | Python | libragram/objects/messageEntities.py | kensoi/libragram | a0119244dceb09edca36b23c95f3e97a28ddae9a | [
"Apache-2.0"
] | null | null | null | libragram/objects/messageEntities.py | kensoi/libragram | a0119244dceb09edca36b23c95f3e97a28ddae9a | [
"Apache-2.0"
] | null | null | null | libragram/objects/messageEntities.py | kensoi/libragram | a0119244dceb09edca36b23c95f3e97a28ddae9a | [
"Apache-2.0"
] | null | null | null | class messageEntity:
isBotMention = False
start: int
end: int
def __repr__(self):
return "<class 'messageEntity' ({})>".format(type(self))
class formatEntity(messageEntity):
pass
class mention(messageEntity): #(@username)
text: str
user: str
def __init__(self, text, user = N... | 19.433333 | 77 | 0.590395 | class messageEntity:
isBotMention = False
start: int
end: int
def __repr__(self):
return "<class 'messageEntity' ({})>".format(type(self))
class formatEntity(messageEntity):
pass
class mention(messageEntity):
text: str
user: str
def __init__(self, text, user = None, botname... | true | true |
f70c67dc63f485a17c66eca2fd849f64dc0f0e72 | 1,185 | py | Python | keystoneclient/tests/v3/test_domains.py | citrix-openstack-build/python-keystoneclient | e170955d6de5cbf521d54105bdefaf606ccdb356 | [
"Apache-1.1"
] | 1 | 2015-02-26T03:24:30.000Z | 2015-02-26T03:24:30.000Z | keystoneclient/tests/v3/test_domains.py | NeCTAR-RC/python-keystoneclient | dca1d4259d44a0d282396a18c895de834580fe66 | [
"Apache-1.1"
] | null | null | null | keystoneclient/tests/v3/test_domains.py | NeCTAR-RC/python-keystoneclient | dca1d4259d44a0d282396a18c895de834580fe66 | [
"Apache-1.1"
] | 1 | 2019-03-08T07:21:48.000Z | 2019-03-08T07:21:48.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | 34.852941 | 78 | 0.69789 |
import uuid
from keystoneclient.tests.v3 import utils
from keystoneclient.v3 import domains
class DomainTests(utils.TestCase, utils.CrudTests):
def setUp(self):
super(DomainTests, self).setUp()
self.key = 'domain'
self.collection_key = 'domains'
self.model = domains.... | true | true |
f70c687e1484c9313c581a5b09bc28790ea9805d | 2,435 | py | Python | setup.py | asmeurer/markdown-it-py | ee34305cc8b590c7390b0ac4149d0d22104cf908 | [
"MIT"
] | null | null | null | setup.py | asmeurer/markdown-it-py | ee34305cc8b590c7390b0ac4149d0d22104cf908 | [
"MIT"
] | null | null | null | setup.py | asmeurer/markdown-it-py | ee34305cc8b590c7390b0ac4149d0d22104cf908 | [
"MIT"
] | null | null | null | # from importlib import import_module
from os import path
import re
from setuptools import find_packages, setup
def get_version():
text = open(path.join(path.dirname(__file__), "markdown_it", "__init__.py")).read()
match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text)
return mat... | 33.819444 | 87 | 0.571253 |
from os import path
import re
from setuptools import find_packages, setup
def get_version():
text = open(path.join(path.dirname(__file__), "markdown_it", "__init__.py")).read()
match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text)
return match.group(1)
setup(
name="markdo... | true | true |
f70c6ba3ffd63063082dff1b3d2ca2ae52c325fe | 1,000 | py | Python | app/http/controllers/BlogController.py | kerlinlopes/kerlin-blog-backend | f77f07a60d554b6ab28cd926e27d7acc66a4ec6b | [
"MIT"
] | null | null | null | app/http/controllers/BlogController.py | kerlinlopes/kerlin-blog-backend | f77f07a60d554b6ab28cd926e27d7acc66a4ec6b | [
"MIT"
] | null | null | null | app/http/controllers/BlogController.py | kerlinlopes/kerlin-blog-backend | f77f07a60d554b6ab28cd926e27d7acc66a4ec6b | [
"MIT"
] | 1 | 2021-12-06T23:03:46.000Z | 2021-12-06T23:03:46.000Z | """ A BlogController Module """
from masonite.controllers import Controller
from masonite.request import Request
from app.Blog import Blog
class BlogController(Controller):
def __init__(self, request: Request):
self.request = request
def show(self):
id = self.request.param("id")
retur... | 28.571429 | 67 | 0.601 |
from masonite.controllers import Controller
from masonite.request import Request
from app.Blog import Blog
class BlogController(Controller):
def __init__(self, request: Request):
self.request = request
def show(self):
id = self.request.param("id")
return Blog.find(id)
def index(s... | true | true |
f70c6bdd656e55c1af0d5793d4d9788da45852c8 | 19,704 | py | Python | ramp-database/ramp_database/model/event.py | symerio/ramp-board | 977b27ffdd648eccc5c992926870319bfef544b6 | [
"BSD-3-Clause"
] | 13 | 2019-02-16T22:30:11.000Z | 2021-01-11T10:13:47.000Z | ramp-database/ramp_database/model/event.py | symerio/ramp-board | 977b27ffdd648eccc5c992926870319bfef544b6 | [
"BSD-3-Clause"
] | 427 | 2018-11-22T22:01:47.000Z | 2022-03-15T17:35:57.000Z | ramp-database/ramp_database/model/event.py | symerio/ramp-board | 977b27ffdd648eccc5c992926870319bfef544b6 | [
"BSD-3-Clause"
] | 18 | 2018-11-22T16:22:18.000Z | 2021-12-07T14:42:41.000Z | import uuid
import datetime
from sqlalchemy import Float
from sqlalchemy import Column
from sqlalchemy import String
from sqlalchemy import Integer
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import backref... | 34.568421 | 88 | 0.661541 | import uuid
import datetime
from sqlalchemy import Float
from sqlalchemy import Column
from sqlalchemy import String
from sqlalchemy import Integer
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import backref... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.