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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f720cbcab58f05b66ace66127442ad6b2998f33d | 2,069 | py | Python | botnet/modules/lib/cache.py | admdev8/botnet-2 | 2fd43237e628869eb34d8e7a6747da6d71c1192c | [
"MIT"
] | 69 | 2015-02-24T19:24:23.000Z | 2022-02-23T08:04:53.000Z | botnet/modules/lib/cache.py | admdev8/botnet-2 | 2fd43237e628869eb34d8e7a6747da6d71c1192c | [
"MIT"
] | 10 | 2017-06-28T21:08:29.000Z | 2022-01-26T07:46:02.000Z | botnet/modules/lib/cache.py | admdev8/botnet-2 | 2fd43237e628869eb34d8e7a6747da6d71c1192c | [
"MIT"
] | 39 | 2015-11-19T10:07:21.000Z | 2022-03-30T10:56:24.000Z | """
Contains cache implementations which can be used by the modules, for example
to cache results acquired from various online APIs.
"""
import datetime
import hashlib
def get_md5(string):
"""Returns a hash of a string."""
m = hashlib.md5()
m.update(string.encode('utf-8'))
return m.hexdigest(... | 26.87013 | 80 | 0.581924 |
import datetime
import hashlib
def get_md5(string):
m = hashlib.md5()
m.update(string.encode('utf-8'))
return m.hexdigest()
class BaseCache(object):
def __init__(self, default_timeout=300):
self.default_timeout = default_timeout
def set(self, key, value, timeout=None):
return ... | true | true |
f720cc9a775ee8a5289c1096d9e20c36d79908d3 | 15,229 | py | Python | src/main.py | Steffuu/tgMensaBotDD | 04bca6ce839d5fb040e0e6232163f4343bcb85fb | [
"MIT"
] | null | null | null | src/main.py | Steffuu/tgMensaBotDD | 04bca6ce839d5fb040e0e6232163f4343bcb85fb | [
"MIT"
] | null | null | null | src/main.py | Steffuu/tgMensaBotDD | 04bca6ce839d5fb040e0e6232163f4343bcb85fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler
import telegram as tg
import requests
import json
import os
import io
import time
import logging
from datetime import timedelta
import translate
import random
import praw
RED... | 40.395225 | 1,074 | 0.690919 |
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler
import telegram as tg
import requests
import json
import os
import io
import time
import logging
from datetime import timedelta
import translate
import random
import praw
REDDIT_BOT_ID = os.environ['REDDIT_BOT_ID']
REDDIT... | true | true |
f720ccd4ee2f6948386979975d4872da8241f475 | 232 | py | Python | handroll/i18n.py | mblayman/handroll | 42703cf5c969dccd0eb0715402ab84056ab65e22 | [
"BSD-2-Clause"
] | null | null | null | handroll/i18n.py | mblayman/handroll | 42703cf5c969dccd0eb0715402ab84056ab65e22 | [
"BSD-2-Clause"
] | null | null | null | handroll/i18n.py | mblayman/handroll | 42703cf5c969dccd0eb0715402ab84056ab65e22 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014, Matt Layman
import gettext
import os
localedir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
translate = gettext.translation('handroll', localedir, fallback=True)
_ = translate.gettext
| 25.777778 | 78 | 0.762931 |
import gettext
import os
localedir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
translate = gettext.translation('handroll', localedir, fallback=True)
_ = translate.gettext
| true | true |
f720cf1b4711518700b108a7d64fb57a175679e5 | 18,297 | py | Python | neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py | huiweics/neutron | 8c7ca776d8cbe967a8bbe773ab38c361414a7068 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py | huiweics/neutron | 8c7ca776d8cbe967a8bbe773ab38c361414a7068 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py | huiweics/neutron | 8c7ca776d8cbe967a8bbe773ab38c361414a7068 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Red Hat, 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 agre... | 42.158986 | 79 | 0.6283 |
import functools
import mock
from oslo_config import cfg
from oslo_utils import uuidutils
from neutron.common.ovn import constants as ovn_const
from neutron.common.ovn import utils
from neutron.common import utils as n_utils
from neutron.db import ovn_revision_numbers_db as db_rev
from neutron.tests.fun... | true | true |
f720cfcd78b89cb225ad9d77d9115e223033a0da | 8,174 | py | Python | tensorflow_federated/python/core/impl/value_utils.py | hieunq95/federated | 15402997ce7fb35d782d715758acf82767206916 | [
"Apache-2.0"
] | 5 | 2019-07-23T14:49:46.000Z | 2022-03-30T13:54:22.000Z | tensorflow_federated/python/core/impl/value_utils.py | hieunq95/federated | 15402997ce7fb35d782d715758acf82767206916 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/value_utils.py | hieunq95/federated | 15402997ce7fb35d782d715758acf82767206916 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 42.572917 | 80 | 0.722535 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import range
from tensorflow_federated.python.common_libs import anonymous_tuple
from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.... | true | true |
f720d050c37ee3d16536fe8dff1a9deb55d14284 | 5,304 | py | Python | backend/tests/baserow/contrib/database/field/test_number_field_type.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | 1 | 2021-04-13T16:27:58.000Z | 2021-04-13T16:27:58.000Z | backend/tests/baserow/contrib/database/field/test_number_field_type.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | null | null | null | backend/tests/baserow/contrib/database/field/test_number_field_type.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | null | null | null | import pytest
from decimal import Decimal
from baserow.contrib.database.fields.handler import FieldHandler
from baserow.contrib.database.fields.registries import field_type_registry
@pytest.mark.django_db
@pytest.mark.parametrize(
"expected,field_kwargs",
[
(
[
9223372036... | 40.181818 | 88 | 0.601244 | import pytest
from decimal import Decimal
from baserow.contrib.database.fields.handler import FieldHandler
from baserow.contrib.database.fields.registries import field_type_registry
@pytest.mark.django_db
@pytest.mark.parametrize(
"expected,field_kwargs",
[
(
[
9223372036... | true | true |
f720d05559826b7b3e8260bdfa239a1cb56c9a6c | 4,465 | py | Python | generated-libraries/python/netapp/iscsi/iscsi_received_stats_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/iscsi/iscsi_received_stats_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/iscsi/iscsi_received_stats_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class IscsiReceivedStatsInfo(NetAppObject):
"""
Counts for PDUs received.
"""
_data_out = None
@property
def data_out(self):
"""
Count of data out requests.
"""
return self._data_out
@data_out.setter
def ... | 26.264706 | 92 | 0.520717 | from netapp.netapp_object import NetAppObject
class IscsiReceivedStatsInfo(NetAppObject):
_data_out = None
@property
def data_out(self):
return self._data_out
@data_out.setter
def data_out(self, val):
if val != None:
self.validate('data_out', val)
self._data... | true | true |
f720d09b09639cf12c6d88a9b93e2140d324a4fc | 6,209 | py | Python | data-analysis/analyze_E017+020.py | JakobHavtorn/es-rl | 30d81ad908a30e78d03c83d37454dbe8e05d1452 | [
"MIT"
] | 1 | 2021-09-03T17:54:14.000Z | 2021-09-03T17:54:14.000Z | data-analysis/analyze_E017+020.py | JakobHavtorn/es-rl | 30d81ad908a30e78d03c83d37454dbe8e05d1452 | [
"MIT"
] | null | null | null | data-analysis/analyze_E017+020.py | JakobHavtorn/es-rl | 30d81ad908a30e78d03c83d37454dbe8e05d1452 | [
"MIT"
] | null | null | null | import os
from distutils.dir_util import copy_tree
import warnings
import IPython
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
import torch
from context import utils
import utils.filesystem as fs
import utils.plotting as plot
from utils.data_analysis impo... | 42.82069 | 133 | 0.639394 | import os
from distutils.dir_util import copy_tree
import warnings
import IPython
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
import torch
from context import utils
import utils.filesystem as fs
import utils.plotting as plot
from utils.data_analysis impo... | true | true |
f720d1f5708dbc5ccf4ce7f998568b7bcfcee378 | 686 | py | Python | test/test_relay.py | steinwurf/kodo-simulations-python | f9d9bcce70adf1666cf8bac9f352fbbf640ca783 | [
"BSD-3-Clause"
] | 2 | 2017-12-09T20:41:02.000Z | 2022-01-10T23:23:01.000Z | test/test_relay.py | steinwurf/kodo-simulations-python | f9d9bcce70adf1666cf8bac9f352fbbf640ca783 | [
"BSD-3-Clause"
] | null | null | null | test/test_relay.py | steinwurf/kodo-simulations-python | f9d9bcce70adf1666cf8bac9f352fbbf640ca783 | [
"BSD-3-Clause"
] | 5 | 2016-10-12T12:18:59.000Z | 2022-01-10T23:23:55.000Z | #! /usr/bin/env python
# encoding: utf-8
import sys
sys.path.append('..')
sys.path.append('mock')
import unittest
from mock import Mock
import simulator.relay
class TestPacket(unittest.TestCase):
"""Class for testing Relay."""
def test_instantiation(self):
"""Test instantiation."""
id = "te... | 23.655172 | 53 | 0.650146 |
import sys
sys.path.append('..')
sys.path.append('mock')
import unittest
from mock import Mock
import simulator.relay
class TestPacket(unittest.TestCase):
def test_instantiation(self):
id = "test_id"
stats = {}
decoder = Mock(name="decoder_object")
decoder.block_size = Mock(re... | true | true |
f720d23a79090927f1bcc5cdbf04f6da46a364cb | 10,513 | py | Python | ui_automation_tests/step_defs/test_open_application.py | uktrade/lite-exporter-frontend | cf42ac37a21236486aa303c8935c44a7eba91ef5 | [
"MIT"
] | 3 | 2019-05-31T06:36:17.000Z | 2020-02-12T16:02:24.000Z | ui_automation_tests/step_defs/test_open_application.py | uktrade/lite-exporter-frontend | cf42ac37a21236486aa303c8935c44a7eba91ef5 | [
"MIT"
] | 33 | 2019-03-28T10:20:14.000Z | 2020-07-16T15:12:43.000Z | ui_automation_tests/step_defs/test_open_application.py | uktrade/lite-exporter-frontend | cf42ac37a21236486aa303c8935c44a7eba91ef5 | [
"MIT"
] | 1 | 2019-05-01T15:52:02.000Z | 2019-05-01T15:52:02.000Z | from pytest_bdd import scenarios, when, then, parsers
import ui_automation_tests.shared.tools.helpers as utils
from ui_automation_tests.pages.generic_application.task_list import TaskListPage
from ui_automation_tests.pages.open_application.country_contract_types import OpenApplicationCountryContractTypes
from ui_autom... | 44.54661 | 129 | 0.799106 | from pytest_bdd import scenarios, when, then, parsers
import ui_automation_tests.shared.tools.helpers as utils
from ui_automation_tests.pages.generic_application.task_list import TaskListPage
from ui_automation_tests.pages.open_application.country_contract_types import OpenApplicationCountryContractTypes
from ui_autom... | true | true |
f720d28d694930288ecc3e99c146b144020f7a87 | 13,442 | py | Python | lib/redis_cache/rediscache.py | eapearson/kb_Metrics | f1c3c8457577060c9c695d6f4cbb7ec8f7fae17f | [
"MIT"
] | null | null | null | lib/redis_cache/rediscache.py | eapearson/kb_Metrics | f1c3c8457577060c9c695d6f4cbb7ec8f7fae17f | [
"MIT"
] | null | null | null | lib/redis_cache/rediscache.py | eapearson/kb_Metrics | f1c3c8457577060c9c695d6f4cbb7ec8f7fae17f | [
"MIT"
] | null | null | null | """
A simple redis-cache interface for storing python objects.
"""
from functools import wraps
import pickle
import json
import hashlib
import redis
import logging
from redis._compat import basestring, unicode
DEFAULT_EXPIRY = 60 * 60 * 24
class RedisConnect(object):
"""
A simple object to store and pass da... | 34.64433 | 107 | 0.588157 | from functools import wraps
import pickle
import json
import hashlib
import redis
import logging
from redis._compat import basestring, unicode
DEFAULT_EXPIRY = 60 * 60 * 24
class RedisConnect(object):
def __init__(self, host=None, port=None, db=None, password=None):
self.host = host if host else 'localh... | true | true |
f720d329eaad65945f4c82bf41d8502618bb8cd8 | 892 | py | Python | setup.py | msaroufim/spektral | 6881e6650602b2f98b09516f490c185678075bc8 | [
"MIT"
] | 1 | 2020-07-28T09:11:57.000Z | 2020-07-28T09:11:57.000Z | setup.py | msaroufim/spektral | 6881e6650602b2f98b09516f490c185678075bc8 | [
"MIT"
] | null | null | null | setup.py | msaroufim/spektral | 6881e6650602b2f98b09516f490c185678075bc8 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='spektral',
version='0.6.0',
packages=find_packages(),
install_requires=['tensorflow>=2.1.0',
'networkx',
'pandas',
... | 29.733333 | 69 | 0.545964 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='spektral',
version='0.6.0',
packages=find_packages(),
install_requires=['tensorflow>=2.1.0',
'networkx',
'pandas',
... | true | true |
f720d5217ca55aacc0922b9a609c312d27b6d596 | 3,175 | py | Python | tests/unit/test_subscribers.py | cclauss/s3transfer | 258c3c69416338f8df307621ec5cefa85c453150 | [
"Apache-2.0"
] | 1 | 2021-05-08T10:43:40.000Z | 2021-05-08T10:43:40.000Z | tests/unit/test_subscribers.py | Saiprasad16/s3transfer | 59e968d05288092948284001710c416677102266 | [
"Apache-2.0"
] | 1 | 2021-04-08T21:25:06.000Z | 2021-04-13T16:36:43.000Z | tests/unit/test_subscribers.py | Saiprasad16/s3transfer | 59e968d05288092948284001710c416677102266 | [
"Apache-2.0"
] | 1 | 2020-12-28T19:16:31.000Z | 2020-12-28T19:16:31.000Z | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License'). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file accompa... | 35.674157 | 75 | 0.716535 |
from tests import unittest
from s3transfer.exceptions import InvalidSubscriberMethodError
from s3transfer.subscribers import BaseSubscriber
class ExtraMethodsSubscriber(BaseSubscriber):
def extra_method(self):
return 'called extra method'
class NotCallableSubscriber(BaseSubscriber):
on_d... | true | true |
f720d5fe861a06e326fd1453b262a21ad8d73c63 | 233 | py | Python | encapsulation_exercise/restaurant/project/beverage/cold_beverage.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | encapsulation_exercise/restaurant/project/beverage/cold_beverage.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | encapsulation_exercise/restaurant/project/beverage/cold_beverage.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | from encapsulation_exercise.restaurant.project.beverage.beverage import Beverage
class ColdBeverage(Beverage):
def __init__(self, name: str, price: float, milliliters: float):
super().__init__(name, price, milliliters)
| 33.285714 | 80 | 0.76824 | from encapsulation_exercise.restaurant.project.beverage.beverage import Beverage
class ColdBeverage(Beverage):
def __init__(self, name: str, price: float, milliliters: float):
super().__init__(name, price, milliliters)
| true | true |
f720d64ceba2868cd71f12c692ec517b850f2ae3 | 5,655 | py | Python | qiskit/providers/basicaer/statevector_simulator.py | biplab37/qiskit-aakash | e10b204887606f1f75bdfde182bb0c6d0a322c68 | [
"Apache-2.0"
] | 22 | 2019-08-15T04:39:15.000Z | 2022-03-06T05:17:04.000Z | qiskit/providers/basicaer/statevector_simulator.py | biplab37/qiskit-aakash | e10b204887606f1f75bdfde182bb0c6d0a322c68 | [
"Apache-2.0"
] | 2 | 2020-10-26T07:12:12.000Z | 2021-12-09T16:22:51.000Z | qiskit/providers/basicaer/statevector_simulator.py | biplab37/qiskit-aakash | e10b204887606f1f75bdfde182bb0c6d0a322c68 | [
"Apache-2.0"
] | 9 | 2019-09-05T05:33:00.000Z | 2021-10-09T16:04:53.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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 modif... | 36.019108 | 93 | 0.567286 |
import logging
from math import log2
from qiskit.util import local_hardware_info
from qiskit.providers.basicaer.exceptions import BasicAerError
from qiskit.providers.models import QasmBackendConfiguration
from .qasm_simulator import QasmSimulatorPy
logger = logging.getLogger(__name__)
class Statevect... | true | true |
f720d6c78dc5035a3c9b881b6fc3670b51d08456 | 3,919 | py | Python | myprojectenv/lib/python3.5/site-packages/ansible/modules/windows/win_unzip.py | lancerenteria/doFlask | 2d4e242469b108c6c8316ee18a540307497bfb53 | [
"MIT"
] | null | null | null | myprojectenv/lib/python3.5/site-packages/ansible/modules/windows/win_unzip.py | lancerenteria/doFlask | 2d4e242469b108c6c8316ee18a540307497bfb53 | [
"MIT"
] | null | null | null | myprojectenv/lib/python3.5/site-packages/ansible/modules/windows/win_unzip.py | lancerenteria/doFlask | 2d4e242469b108c6c8316ee18a540307497bfb53 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Phil Schwartz <schwartzmx@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 32.932773 | 156 | 0.713958 |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_unzip
version_added: "2.0"
short_description: Unzips compressed files and archives on the Windows node
description:
- U... | true | true |
f720d7542161f6d3c83a81ed0d3c647a9030afd4 | 259 | py | Python | mmaction/apis/__init__.py | HypnosXC/mmaction2 | a26d5f981449445a5e22a0a60d8b285e06c3dd6e | [
"Apache-2.0"
] | 648 | 2021-06-24T19:33:09.000Z | 2022-03-31T06:27:24.000Z | mmaction/apis/__init__.py | xumingze0308/mmaction2 | 777546f27f8f5a3c83e10d966e2149be2fc9fa31 | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | mmaction/apis/__init__.py | xumingze0308/mmaction2 | 777546f27f8f5a3c83e10d966e2149be2fc9fa31 | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | from .inference import inference_recognizer, init_recognizer
from .test import multi_gpu_test, single_gpu_test
from .train import train_model
__all__ = [
'train_model', 'init_recognizer', 'inference_recognizer', 'multi_gpu_test',
'single_gpu_test'
]
| 28.777778 | 79 | 0.791506 | from .inference import inference_recognizer, init_recognizer
from .test import multi_gpu_test, single_gpu_test
from .train import train_model
__all__ = [
'train_model', 'init_recognizer', 'inference_recognizer', 'multi_gpu_test',
'single_gpu_test'
]
| true | true |
f720d77ecc540423a6a6545f9e50c117ad1c08db | 2,579 | py | Python | se3_transformer/model/layers/linear.py | RosettaCommons/RFDesign | b404b8b2c57f89c047529c30259aeeb8f6012b61 | [
"MIT"
] | 45 | 2022-01-12T04:39:36.000Z | 2022-03-25T12:33:36.000Z | se3_transformer/model/layers/linear.py | RosettaCommons/RFDesign | b404b8b2c57f89c047529c30259aeeb8f6012b61 | [
"MIT"
] | 6 | 2022-01-15T16:48:39.000Z | 2022-03-15T16:20:34.000Z | se3_transformer/model/layers/linear.py | RosettaCommons/RFDesign | b404b8b2c57f89c047529c30259aeeb8f6012b61 | [
"MIT"
] | 10 | 2022-01-12T11:28:03.000Z | 2022-03-30T11:36:41.000Z | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# 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... | 42.983333 | 97 | 0.703761 |
from typing import Dict
import numpy as np
import torch
import torch.nn as nn
from torch import Tensor
from se3_transformer.model.fiber import Fiber
class LinearSE3(nn.Module):
def __init__(self, fiber_in: Fiber, fiber_out: Fiber):
super().__init__()
self.weights = nn.Pa... | true | true |
f720d79b4d6d96c43d1bfceebd505df12ce179cf | 1,524 | py | Python | plotly/validators/streamtube/colorbar/_titlefont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/streamtube/colorbar/_titlefont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/streamtube/colorbar/_titlefont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class TitlefontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name='titlefont',
parent_name='streamtube.colorbar',
**kwargs
):
super(TitlefontValidator, self).__init__(
plotly_name=p... | 36.285714 | 73 | 0.557743 | import _plotly_utils.basevalidators
class TitlefontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name='titlefont',
parent_name='streamtube.colorbar',
**kwargs
):
super(TitlefontValidator, self).__init__(
plotly_name=p... | true | true |
f720d9caab26b0c898d32c3bc5d19d61e2797724 | 7,527 | py | Python | divvydata/historical_data.py | chrisluedtke/divvy-data-analysis | 441fa9028ed4bb77ad47e8109a8be749ea1d30b1 | [
"MIT"
] | 2 | 2019-02-09T12:54:02.000Z | 2019-02-11T23:02:35.000Z | divvydata/historical_data.py | chrisluedtke/divvy-data-analysis | 441fa9028ed4bb77ad47e8109a8be749ea1d30b1 | [
"MIT"
] | null | null | null | divvydata/historical_data.py | chrisluedtke/divvy-data-analysis | 441fa9028ed4bb77ad47e8109a8be749ea1d30b1 | [
"MIT"
] | null | null | null | """
Pulls data from:
https://www.divvybikes.com/system-data
https://s3.amazonaws.com/divvy-data/tripdata
"""
from io import BytesIO
import os
import re
import requests
from zipfile import ZipFile
from typing import List
from lxml import html
import pandas as pd
from .stations_feed import StationsFeed
STN_DT_FORM = ... | 29.287938 | 77 | 0.563571 | from io import BytesIO
import os
import re
import requests
from zipfile import ZipFile
from typing import List
from lxml import html
import pandas as pd
from .stations_feed import StationsFeed
STN_DT_FORM = {
'2013': "%m/%d/%Y",
'2014_Q1Q2': None,
'2014_Q3Q4': "%m/%d/%Y %H:%M",
'2015': None,
... | true | true |
f720d9f5df4419371640fe5d3822b74acdb36bf0 | 35,757 | py | Python | incidentes/views.py | Alvaruz/ATMS | 962a1967e1654efe4d448891deb7881fa3addf85 | [
"MIT"
] | null | null | null | incidentes/views.py | Alvaruz/ATMS | 962a1967e1654efe4d448891deb7881fa3addf85 | [
"MIT"
] | null | null | null | incidentes/views.py | Alvaruz/ATMS | 962a1967e1654efe4d448891deb7881fa3addf85 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.template import loader
from django.urls import reverse_lazy
from .models import *
from django.http import HttpResponse
from .forms import TicketForm
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from django.core.paginator import E... | 44.090012 | 228 | 0.711833 | from django.shortcuts import render, redirect
from django.template import loader
from django.urls import reverse_lazy
from .models import *
from django.http import HttpResponse
from .forms import TicketForm
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from django.core.paginator import E... | true | true |
f720da7486a07c56f32fcbde3e8956ad3ccbd326 | 1,830 | py | Python | doc/listings/interstore/webcal.py | jonathanj/mantissa | 53e5502aba23ce99be78b27f923a276593033fe8 | [
"MIT"
] | 6 | 2016-02-17T15:04:53.000Z | 2021-08-20T09:44:10.000Z | doc/listings/interstore/webcal.py | jonathanj/mantissa | 53e5502aba23ce99be78b27f923a276593033fe8 | [
"MIT"
] | 62 | 2015-02-04T23:40:55.000Z | 2021-02-18T19:56:02.000Z | doc/listings/interstore/webcal.py | jonathanj/mantissa | 53e5502aba23ce99be78b27f923a276593033fe8 | [
"MIT"
] | 8 | 2015-11-15T17:26:42.000Z | 2020-12-02T06:36:52.000Z |
from datetime import timedelta
from epsilon.extime import Time
from nevow.page import renderer
from nevow.loaders import stan
from nevow.tags import div
from nevow.athena import LiveElement
from xmantissa.liveform import TEXT_INPUT, LiveForm, Parameter
class CalendarElement(LiveElement):
docFactory = stan(di... | 29.516129 | 80 | 0.604918 |
from datetime import timedelta
from epsilon.extime import Time
from nevow.page import renderer
from nevow.loaders import stan
from nevow.tags import div
from nevow.athena import LiveElement
from xmantissa.liveform import TEXT_INPUT, LiveForm, Parameter
class CalendarElement(LiveElement):
docFactory = stan(di... | true | true |
f720da77bf370fc9b4db8eeeefff5308d08c418c | 197 | py | Python | robots/test/strategies/run_tests/tests/test_sharing/test_share/t1.py | memristor/mep2 | bc5cddacba3d740f791f3454b8cb51bda83ce202 | [
"MIT"
] | 5 | 2018-11-27T15:15:00.000Z | 2022-02-10T21:44:13.000Z | robots/test/strategies/run_tests/tests/test_sharing/test_share/t1.py | memristor/mep2 | bc5cddacba3d740f791f3454b8cb51bda83ce202 | [
"MIT"
] | 2 | 2018-10-20T15:48:40.000Z | 2018-11-20T05:11:33.000Z | robots/test/strategies/run_tests/tests/test_sharing/test_share/t1.py | memristor/mep2 | bc5cddacba3d740f791f3454b8cb51bda83ce202 | [
"MIT"
] | 1 | 2020-02-07T12:44:47.000Z | 2020-02-07T12:44:47.000Z | weight=1
a=_State('a', name='var1', shared=True)
def run():
@_do
def _():
print(a.val)
sleep(10)
a.val = 5
@_do
def _():
print(a.val)
sleep(10)
a.val = 8
@_do
def _():
print(a.val)
| 11.588235 | 39 | 0.563452 | weight=1
a=_State('a', name='var1', shared=True)
def run():
@_do
def _():
print(a.val)
sleep(10)
a.val = 5
@_do
def _():
print(a.val)
sleep(10)
a.val = 8
@_do
def _():
print(a.val)
| true | true |
f720da93b083e8b08000df92605af508a5009d38 | 2,479 | py | Python | csympy/tests/test_arit.py | shipci/csympy | 6b5a1d7d8a3f9bbe0b983b78a44be90a70db0743 | [
"MIT"
] | null | null | null | csympy/tests/test_arit.py | shipci/csympy | 6b5a1d7d8a3f9bbe0b983b78a44be90a70db0743 | [
"MIT"
] | null | null | null | csympy/tests/test_arit.py | shipci/csympy | 6b5a1d7d8a3f9bbe0b983b78a44be90a70db0743 | [
"MIT"
] | null | null | null | from nose.tools import raises
from csympy import Symbol, Integer, Add, Pow
def test_arit1():
x = Symbol("x")
y = Symbol("y")
e = x + y
e = x * y
e = Integer(2)*x
e = 2*x
e = x + 1
e = 1 + x
def test_arit2():
x = Symbol("x")
y = Symbol("y")
assert x+x == Integer(2) * x
... | 21.938053 | 79 | 0.449375 | from nose.tools import raises
from csympy import Symbol, Integer, Add, Pow
def test_arit1():
x = Symbol("x")
y = Symbol("y")
e = x + y
e = x * y
e = Integer(2)*x
e = 2*x
e = x + 1
e = 1 + x
def test_arit2():
x = Symbol("x")
y = Symbol("y")
assert x+x == Integer(2) * x
... | true | true |
f720db2bca4a842dab5f8a8604fb53fae21bea7f | 2,309 | py | Python | epytope/Data/pssms/smmpmbec/mat/B_07_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smmpmbec/mat/B_07_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smmpmbec/mat/B_07_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | B_07_02_9 = {0: {'A': -0.332, 'C': 0.186, 'E': 0.544, 'D': 0.788, 'G': 0.214, 'F': -0.118, 'I': -0.161, 'H': -0.257, 'K': -0.244, 'M': -0.332, 'L': -0.105, 'N': 0.105, 'Q': 0.294, 'P': 0.58, 'S': -0.286, 'R': -0.62, 'T': 0.187, 'W': -0.114, 'V': -0.03, 'Y': -0.3}, 1: {'A': -0.604, 'C': 0.467, 'E': 0.468, 'D': 0.371, 'G... | 2,309 | 2,309 | 0.395409 | B_07_02_9 = {0: {'A': -0.332, 'C': 0.186, 'E': 0.544, 'D': 0.788, 'G': 0.214, 'F': -0.118, 'I': -0.161, 'H': -0.257, 'K': -0.244, 'M': -0.332, 'L': -0.105, 'N': 0.105, 'Q': 0.294, 'P': 0.58, 'S': -0.286, 'R': -0.62, 'T': 0.187, 'W': -0.114, 'V': -0.03, 'Y': -0.3}, 1: {'A': -0.604, 'C': 0.467, 'E': 0.468, 'D': 0.371, 'G... | true | true |
f720dbb912a33f6df1fac7c953a783e5d94e86e3 | 13,329 | py | Python | SourceControlMgmt/SourceControlMgmt.py | tigelane/ACI-Simplified-GUI-Management | f2c3d27375421a75de0f5b9bbdc645c380549f05 | [
"MIT"
] | null | null | null | SourceControlMgmt/SourceControlMgmt.py | tigelane/ACI-Simplified-GUI-Management | f2c3d27375421a75de0f5b9bbdc645c380549f05 | [
"MIT"
] | 14 | 2020-02-14T23:47:50.000Z | 2020-03-04T20:16:29.000Z | SourceControlMgmt/SourceControlMgmt.py | IGNW/devnet-create-2020 | 1eea17891a6cd1fedc265605a7b06378542762bb | [
"MIT"
] | 1 | 2021-07-06T14:42:55.000Z | 2021-07-06T14:42:55.000Z | from pathlib import Path
from datetime import datetime
import shutil
import subprocess
import yaml
import requests
class SCMCredentialValidationError(Exception):
pass
class SCMCloneRepoError(Exception):
pass
class SCMCreateBranchError(Exception):
pass
class SCMWriteFileError(Exception):
pass
c... | 38.082857 | 162 | 0.579038 | from pathlib import Path
from datetime import datetime
import shutil
import subprocess
import yaml
import requests
class SCMCredentialValidationError(Exception):
pass
class SCMCloneRepoError(Exception):
pass
class SCMCreateBranchError(Exception):
pass
class SCMWriteFileError(Exception):
pass
c... | true | true |
f720dc83e899603cde1322429190880fb730dec1 | 682 | py | Python | recommendation/recommendation/apps/films/migrations/0003_auto_20200314_0357.py | WillionLei/recommendation | 49fd28a47574877a91458201b21ec2a80409bb5f | [
"MIT"
] | null | null | null | recommendation/recommendation/apps/films/migrations/0003_auto_20200314_0357.py | WillionLei/recommendation | 49fd28a47574877a91458201b21ec2a80409bb5f | [
"MIT"
] | null | null | null | recommendation/recommendation/apps/films/migrations/0003_auto_20200314_0357.py | WillionLei/recommendation | 49fd28a47574877a91458201b21ec2a80409bb5f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2020-03-14 03:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('films', '0002_film'),
]
operations = [
migrations.AddField(
mo... | 26.230769 | 116 | 0.577713 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('films', '0002_film'),
]
operations = [
migrations.AddField(
model_name='film',
name='charge',
field=models.Sma... | true | true |
f720dca24b37afd8444ce644acfa3b1e0c6ddc1c | 197 | py | Python | pola/tests/commands/test_send_ai_pics_stats.py | rodkiewicz/pola-backend | e26df1cea07b43c8b4272739234b7e78e2ce08c9 | [
"BSD-3-Clause"
] | 30 | 2015-08-13T01:05:36.000Z | 2022-01-22T03:02:50.000Z | pola/tests/commands/test_send_ai_pics_stats.py | rodkiewicz/pola-backend | e26df1cea07b43c8b4272739234b7e78e2ce08c9 | [
"BSD-3-Clause"
] | 1,428 | 2015-10-08T07:38:26.000Z | 2022-03-31T08:36:08.000Z | pola/tests/commands/test_send_ai_pics_stats.py | rodkiewicz/pola-backend | e26df1cea07b43c8b4272739234b7e78e2ce08c9 | [
"BSD-3-Clause"
] | 13 | 2015-12-27T22:35:25.000Z | 2022-02-01T15:55:58.000Z | from unittest import TestCase
from django.core.management import call_command
class SendAiPicsStatsTestCase(TestCase):
def test_run_command(self):
call_command('send_ai_pics_stats')
| 21.888889 | 47 | 0.796954 | from unittest import TestCase
from django.core.management import call_command
class SendAiPicsStatsTestCase(TestCase):
def test_run_command(self):
call_command('send_ai_pics_stats')
| true | true |
f720de11464a36f7cc26d40b9c9c173b3751a6c4 | 6,695 | py | Python | tests/kafkatest/tests/core/fetch_from_follower_test.py | heyingquan13/kafka | 620ada9888f82756d6ed0eabe96bb9b54518b378 | [
"Apache-2.0"
] | 35 | 2016-09-22T22:53:14.000Z | 2020-02-13T15:12:21.000Z | tests/kafkatest/tests/core/fetch_from_follower_test.py | heyingquan13/kafka | 620ada9888f82756d6ed0eabe96bb9b54518b378 | [
"Apache-2.0"
] | 27 | 2022-02-07T21:53:02.000Z | 2022-03-15T20:38:46.000Z | tests/kafkatest/tests/core/fetch_from_follower_test.py | heyingquan13/kafka | 620ada9888f82756d6ed0eabe96bb9b54518b378 | [
"Apache-2.0"
] | 88 | 2016-11-27T02:16:11.000Z | 2020-02-28T05:10:26.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 49.592593 | 142 | 0.64003 |
import time
from collections import defaultdict
from ducktape.mark import matrix
from ducktape.mark.resource import cluster
from kafkatest.services.console_consumer import ConsoleConsumer
from kafkatest.services.kafka import KafkaService, quorum
from kafkatest.services.monitor.jmx import JmxTool
from k... | true | true |
f720def8adc18a066172259ff0e5e88e433e15c0 | 39,628 | py | Python | python/dgl/distributed/graph_partition_book.py | hoangdzung/dgl | f7ce267164118a0526dd2f42f3baf799bb59d6b7 | [
"Apache-2.0"
] | 1 | 2021-08-18T11:54:42.000Z | 2021-08-18T11:54:42.000Z | python/dgl/distributed/graph_partition_book.py | amorehead/dgl | 738b75f41e5d3229e5ccda52d76e1297d7b0520d | [
"Apache-2.0"
] | null | null | null | python/dgl/distributed/graph_partition_book.py | amorehead/dgl | 738b75f41e5d3229e5ccda52d76e1297d7b0520d | [
"Apache-2.0"
] | 1 | 2021-11-28T09:16:55.000Z | 2021-11-28T09:16:55.000Z | """Define graph partition book."""
import pickle
from abc import ABC
import numpy as np
from .. import backend as F
from ..base import NID, EID
from .. import utils
from .shared_mem_utils import _to_shared_mem, _get_ndata_path, _get_edata_path, DTYPE_DICT
from .._ffi.ndarray import empty_shared_mem
from ..ndarray imp... | 35.540807 | 100 | 0.609266 |
import pickle
from abc import ABC
import numpy as np
from .. import backend as F
from ..base import NID, EID
from .. import utils
from .shared_mem_utils import _to_shared_mem, _get_ndata_path, _get_edata_path, DTYPE_DICT
from .._ffi.ndarray import empty_shared_mem
from ..ndarray import exist_shared_mem_array
from .id... | true | true |
f720df0b58abbc375a8a7a17d5d8da4f91638bcc | 53,237 | py | Python | ecl/tests/unit/test_resource.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | 5 | 2017-04-07T06:23:04.000Z | 2019-11-19T00:52:34.000Z | ecl/tests/unit/test_resource.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | 16 | 2018-09-12T11:14:40.000Z | 2021-04-19T09:02:44.000Z | ecl/tests/unit/test_resource.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | 14 | 2017-05-11T14:26:26.000Z | 2021-07-14T14:00:06.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 34.704694 | 79 | 0.608148 |
import copy
import json
import os
from keystoneauth1 import session
import mock
import requests
from testtools import matchers
from ecl import exceptions
from ecl import format
from ecl import resource
from ecl.tests.unit import base
from ecl import utils
fake_parent = 'robert'
fake_name = 'rey'
fake_id... | true | true |
f720df1f8976d6666a660d614734f5c3010f2b3d | 5,980 | py | Python | deep-learning-for-image-processing-master/pytorch_object_detection/train_coco_dataset/network_files/boxes.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | null | null | null | deep-learning-for-image-processing-master/pytorch_object_detection/train_coco_dataset/network_files/boxes.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | null | null | null | deep-learning-for-image-processing-master/pytorch_object_detection/train_coco_dataset/network_files/boxes.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | 2 | 2021-06-26T16:53:38.000Z | 2021-08-29T22:16:20.000Z | import torch
from typing import Tuple
from torch import Tensor
import torchvision
def nms(boxes, scores, iou_threshold):
# type: (Tensor, Tensor, float) -> Tensor
"""
Performs non-maximum suppression (NMS) on the boxes according
to their intersection-over-union (IoU).
NMS iteratively removes lowe... | 32.857143 | 98 | 0.634783 | import torch
from typing import Tuple
from torch import Tensor
import torchvision
def nms(boxes, scores, iou_threshold):
return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
def batched_nms(boxes, scores, idxs, iou_threshold):
if boxes.numel() == 0:
return torch.empty((0,), dtype... | true | true |
f720dfa2212e24646fbef26faa5e5bdf2d802ce4 | 14,811 | py | Python | PyObjCTest/test_nsgraphics.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | PyObjCTest/test_nsgraphics.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | PyObjCTest/test_nsgraphics.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | import AppKit
import objc
from PyObjCTools.TestSupport import TestCase, min_os_level
class TestNSGraphics(TestCase):
def testConstants(self):
self.assertEqual(AppKit.NSCompositeClear, 0)
self.assertEqual(AppKit.NSCompositeCopy, 1)
self.assertEqual(AppKit.NSCompositeSourceOver, 2)
s... | 47.932039 | 209 | 0.667207 | import AppKit
import objc
from PyObjCTools.TestSupport import TestCase, min_os_level
class TestNSGraphics(TestCase):
def testConstants(self):
self.assertEqual(AppKit.NSCompositeClear, 0)
self.assertEqual(AppKit.NSCompositeCopy, 1)
self.assertEqual(AppKit.NSCompositeSourceOver, 2)
s... | true | true |
f720dfbd8a87908f745dd0e7e519b11314b25551 | 2,649 | py | Python | zExtraLearning/MLPrep/tf2.0/NbExtracts/23tf2_0_mirrored_strategy.py | talk2sunil83/UpgradLearning | 70c4f993c68ce5030e9df0edd15004bbb9fc71e7 | [
"Apache-2.0"
] | null | null | null | zExtraLearning/MLPrep/tf2.0/NbExtracts/23tf2_0_mirrored_strategy.py | talk2sunil83/UpgradLearning | 70c4f993c68ce5030e9df0edd15004bbb9fc71e7 | [
"Apache-2.0"
] | null | null | null | zExtraLearning/MLPrep/tf2.0/NbExtracts/23tf2_0_mirrored_strategy.py | talk2sunil83/UpgradLearning | 70c4f993c68ce5030e9df0edd15004bbb9fc71e7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""TF2.0 Mirrored Strategy.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1e7_N_vVQGyfa3Wz9ND0smWnnsHsQUs_k
"""
# Commented out IPython magic to ensure Python compatibility.
from tensorflow.keras.models import Model
from ... | 29.10989 | 128 | 0.678369 |
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, Dense, Flatten, Dropout, GlobalMaxPooling2D, MaxPooling2D, BatchNormalization
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
print(tf.__version__)
cifar10 = tf.keras.datasets.cifar10
(x_trai... | true | true |
f720e314a25973213209e088a8ac815f6b5568fc | 20,043 | py | Python | src/pregame.py | the5thEmperor/lykos | 62cc7694ec24eb0c177dfd25db79725a092a57fa | [
"BSD-2-Clause"
] | null | null | null | src/pregame.py | the5thEmperor/lykos | 62cc7694ec24eb0c177dfd25db79725a092a57fa | [
"BSD-2-Clause"
] | null | null | null | src/pregame.py | the5thEmperor/lykos | 62cc7694ec24eb0c177dfd25db79725a092a57fa | [
"BSD-2-Clause"
] | null | null | null | from collections import defaultdict, Counter
from datetime import datetime, timedelta
import threading
import itertools
import random
import time
import math
import re
from src.containers import UserDict, UserSet
from src.decorators import COMMANDS, command, event_listener, handle_error
from src.functions import get_... | 39.3 | 159 | 0.612533 | from collections import defaultdict, Counter
from datetime import datetime, timedelta
import threading
import itertools
import random
import time
import math
import re
from src.containers import UserDict, UserSet
from src.decorators import COMMANDS, command, event_listener, handle_error
from src.functions import get_... | true | true |
f720e349ea77eb354bef27e43be8e0b0f558fa43 | 3,840 | py | Python | wes_service/util.py | SamarthVP/workflow-service | a4a557ca17a38c1e8642983c2d3af6b6325da0f8 | [
"Apache-2.0"
] | 2 | 2020-02-14T18:41:08.000Z | 2020-02-17T06:56:10.000Z | wes_service/util.py | Sage-Bionetworks/workflow-service | 8b5dc0afe9ea0972014cdf48a693ee6f893cfe5e | [
"Apache-2.0"
] | 9 | 2021-03-31T19:32:52.000Z | 2022-02-26T23:21:38.000Z | wes_service/util.py | Sage-Bionetworks/workflow-service | 8b5dc0afe9ea0972014cdf48a693ee6f893cfe5e | [
"Apache-2.0"
] | 2 | 2020-02-12T23:21:35.000Z | 2020-06-02T14:50:31.000Z | import tempfile
import json
import os
import logging
from six import itervalues, iterlists
import connexion
from werkzeug.utils import secure_filename
def visit(d, op):
"""Recursively call op(d) for all list subelements and dictionary 'values' that d may have."""
op(d)
if isinstance(d, list):
for... | 38.019802 | 113 | 0.507552 | import tempfile
import json
import os
import logging
from six import itervalues, iterlists
import connexion
from werkzeug.utils import secure_filename
def visit(d, op):
op(d)
if isinstance(d, list):
for i in d:
visit(i, op)
elif isinstance(d, dict):
for i in itervalues(d):
... | true | true |
f720e41f86ef851d3645b1502f4b7c42729748ba | 27,550 | py | Python | autosklearn/smbo.py | a1rb4Ck/auto-sklearn | cdf48b82632927ec56c8c14258c0bfc4c6b2e7d1 | [
"BSD-3-Clause"
] | null | null | null | autosklearn/smbo.py | a1rb4Ck/auto-sklearn | cdf48b82632927ec56c8c14258c0bfc4c6b2e7d1 | [
"BSD-3-Clause"
] | null | null | null | autosklearn/smbo.py | a1rb4Ck/auto-sklearn | cdf48b82632927ec56c8c14258c0bfc4c6b2e7d1 | [
"BSD-3-Clause"
] | null | null | null | import json
import os
import time
import traceback
import warnings
import numpy as np
import pynisher
from smac.facade.smac_facade import SMAC
from smac.optimizer.objective import average_cost
from smac.runhistory.runhistory import RunHistory
from smac.runhistory.runhistory2epm import RunHistory2EPM4Cost
from smac.sc... | 41.742424 | 92 | 0.59147 | import json
import os
import time
import traceback
import warnings
import numpy as np
import pynisher
from smac.facade.smac_facade import SMAC
from smac.optimizer.objective import average_cost
from smac.runhistory.runhistory import RunHistory
from smac.runhistory.runhistory2epm import RunHistory2EPM4Cost
from smac.sc... | true | true |
f720e4b13eef675ed79b1d8f5021f8b090a3e097 | 3,223 | py | Python | harbor/datadog_checks/harbor/config_models/defaults.py | codylerum/integrations-core | aee18148cebf5026099abde7bc218d3ba8d2e75c | [
"BSD-3-Clause"
] | null | null | null | harbor/datadog_checks/harbor/config_models/defaults.py | codylerum/integrations-core | aee18148cebf5026099abde7bc218d3ba8d2e75c | [
"BSD-3-Clause"
] | null | null | null | harbor/datadog_checks/harbor/config_models/defaults.py | codylerum/integrations-core | aee18148cebf5026099abde7bc218d3ba8d2e75c | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_proxy(field, value):
return get_default_field_value(field, value)
def shared_service(field, value):
return... | 20.018634 | 75 | 0.779398 |
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_proxy(field, value):
return get_default_field_value(field, value)
def shared_service(field, value):
return get_default_field_value(field, value)
def shared_skip_proxy(field, value):
return False
def shared_time... | true | true |
f720e54b8a4add55c8bb4945dbfdd8f7cd946e00 | 790 | py | Python | st2common/st2common/exceptions/ssh.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | null | null | null | st2common/st2common/exceptions/ssh.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | st2common/st2common/exceptions/ssh.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 1 | 2021-07-10T15:02:29.000Z | 2021-07-10T15:02:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | 29.259259 | 74 | 0.764557 |
__all__ = [
'InvalidCredentialsException'
]
class InvalidCredentialsException(Exception):
pass
class NoHostsConnectedToException(Exception):
pass
| true | true |
f720e5c38c523665abca1c94ba91d51a3d76168c | 18,992 | py | Python | flytekit/common/launch_plan.py | tnsetting/flytekit | 4782264ffbc4bfdbaabe7a789a9ad76cb7e5499e | [
"Apache-2.0"
] | null | null | null | flytekit/common/launch_plan.py | tnsetting/flytekit | 4782264ffbc4bfdbaabe7a789a9ad76cb7e5499e | [
"Apache-2.0"
] | null | null | null | flytekit/common/launch_plan.py | tnsetting/flytekit | 4782264ffbc4bfdbaabe7a789a9ad76cb7e5499e | [
"Apache-2.0"
] | null | null | null | import datetime as _datetime
import logging as _logging
import uuid as _uuid
import six as _six
from deprecated import deprecated as _deprecated
from flytekit.common import interface as _interface
from flytekit.common import nodes as _nodes
from flytekit.common import promise as _promises
from flytekit.common import ... | 40.15222 | 120 | 0.662647 | import datetime as _datetime
import logging as _logging
import uuid as _uuid
import six as _six
from deprecated import deprecated as _deprecated
from flytekit.common import interface as _interface
from flytekit.common import nodes as _nodes
from flytekit.common import promise as _promises
from flytekit.common import ... | true | true |
f720e5c62f21e8d5ff58e6fa829b2e05a1daba2e | 3,614 | py | Python | model_v2/synthetic_data.py | suchir/passenger_screening_algorithm_challenge | 65e3e3ce1889e9a100f6b9b6a53fe5c785a84612 | [
"MIT"
] | 7 | 2018-02-05T01:57:30.000Z | 2019-06-25T08:00:40.000Z | model_v2/synthetic_data.py | suchir/passenger_screening_algorithm_challenge | 65e3e3ce1889e9a100f6b9b6a53fe5c785a84612 | [
"MIT"
] | 1 | 2018-05-07T15:28:29.000Z | 2018-05-07T15:28:29.000Z | model_v2/synthetic_data.py | suchir/passenger_screening_algorithm_challenge | 65e3e3ce1889e9a100f6b9b6a53fe5c785a84612 | [
"MIT"
] | 3 | 2018-05-16T03:50:44.000Z | 2018-08-20T12:40:58.000Z | from common.caching import read_input_dir, cached, read_log_dir
from common.dataio import get_aps_data_hdf5, get_passenger_clusters, get_data
from . import dataio
from collections import defaultdict
import numpy as np
import skimage.transform
import skimage.io
import skimage.color
import glob
import os
import tqdm
im... | 31.426087 | 92 | 0.571942 | from common.caching import read_input_dir, cached, read_log_dir
from common.dataio import get_aps_data_hdf5, get_passenger_clusters, get_data
from . import dataio
from collections import defaultdict
import numpy as np
import skimage.transform
import skimage.io
import skimage.color
import glob
import os
import tqdm
im... | true | true |
f720e6032cfc7932950462b55a729037d787591f | 404 | py | Python | AboutModel/migrations/0006_person_upload.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | AboutModel/migrations/0006_person_upload.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | AboutModel/migrations/0006_person_upload.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-26 09:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AboutModel', '0005_auto_20180926_1639'),
]
operations = [
migrations.AddField(
model_name='person',
name='upload',
... | 21.263158 | 67 | 0.596535 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AboutModel', '0005_auto_20180926_1639'),
]
operations = [
migrations.AddField(
model_name='person',
name='upload',
field=models.FileField(default='', u... | true | true |
f720e775b9e53621d7ef0b929530a0e01f683291 | 216 | py | Python | display/display/handlers/calendar/calendar.py | owlsn/h_crawl | c0431ee6484e61d9339553c3350962ea517749d6 | [
"MIT"
] | null | null | null | display/display/handlers/calendar/calendar.py | owlsn/h_crawl | c0431ee6484e61d9339553c3350962ea517749d6 | [
"MIT"
] | 8 | 2021-03-18T20:33:29.000Z | 2022-03-11T23:21:04.000Z | display/display/handlers/calendar/calendar.py | owlsn/h_crawl | c0431ee6484e61d9339553c3350962ea517749d6 | [
"MIT"
] | null | null | null | from display.handlers.base import BaseHandler
class CalendarHandler(BaseHandler):
def get(self):
title = 'CalendarHandler'
self.render('calendar/calendar.html', title = title, **self.render_dict) | 36 | 80 | 0.722222 | from display.handlers.base import BaseHandler
class CalendarHandler(BaseHandler):
def get(self):
title = 'CalendarHandler'
self.render('calendar/calendar.html', title = title, **self.render_dict) | true | true |
f720e782756412b8e32b05c6b3b8cd42bb215506 | 298 | py | Python | 1.py | lorenaEscobar0014/TALLER-DE-FOR | a448358b336d6e240ff3017a9c44d7df67bf173e | [
"MIT"
] | null | null | null | 1.py | lorenaEscobar0014/TALLER-DE-FOR | a448358b336d6e240ff3017a9c44d7df67bf173e | [
"MIT"
] | null | null | null | 1.py | lorenaEscobar0014/TALLER-DE-FOR | a448358b336d6e240ff3017a9c44d7df67bf173e | [
"MIT"
] | null | null | null | archivo = open('paises.txt', 'r')
lista = []
ciudad = []
for i in archivo:
a = i.index(":")
for r in range(a+2, len(i)):
lista.append(i[r])
a = "".join(lista)
ciudad.append(a)
lista = []
for i in ciudad:
if(i[0] == "M"):
print(i)
lista.append(i)
print(len(lista))
archivo.close() | 18.625 | 33 | 0.57047 | archivo = open('paises.txt', 'r')
lista = []
ciudad = []
for i in archivo:
a = i.index(":")
for r in range(a+2, len(i)):
lista.append(i[r])
a = "".join(lista)
ciudad.append(a)
lista = []
for i in ciudad:
if(i[0] == "M"):
print(i)
lista.append(i)
print(len(lista))
archivo.close() | true | true |
f720e79407295f9aac9a3426d1cae24917442d5c | 2,720 | py | Python | src/pipelines/vaccinations/se_authority.py | chrismayemba/covid-19-open-data | cacecb05cd8277f8e61b6e7932915826f41af24b | [
"Apache-2.0"
] | 1 | 2021-10-21T15:24:08.000Z | 2021-10-21T15:24:08.000Z | src/pipelines/vaccinations/se_authority.py | chrismayemba/covid-19-open-data | cacecb05cd8277f8e61b6e7932915826f41af24b | [
"Apache-2.0"
] | null | null | null | src/pipelines/vaccinations/se_authority.py | chrismayemba/covid-19-open-data | cacecb05cd8277f8e61b6e7932915826f41af24b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 40 | 100 | 0.683088 |
import datetime
from typing import Any, Dict
from pandas import DataFrame, concat
from lib.data_source import DataSource
from lib.time import datetime_isoformat
from lib.utils import aggregate_admin_level, table_merge, table_rename
from pipelines.epidemiology.it_authority import _subregion1_code_converter... | true | true |
f720e7b3881bb7f2ca7c123f52d4f902222b4dac | 2,385 | py | Python | imblearn/under_sampling/_prototype_selection/tests/test_instance_hardness_threshold.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | imblearn/under_sampling/_prototype_selection/tests/test_instance_hardness_threshold.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | imblearn/under_sampling/_prototype_selection/tests/test_instance_hardness_threshold.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | """Test the module ."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import pytest
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from imblearn.under_sampling import InstanceHardnessThreshold
RND_SEED = 0
X = np.array(
[
[-0... | 30.189873 | 77 | 0.678826 |
import pytest
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from imblearn.under_sampling import InstanceHardnessThreshold
RND_SEED = 0
X = np.array(
[
[-0.3879569, 0.6894251],
[-0.09322739, 1.28177189],
[-0.77740357, 0.74097941],
[0.91542919, -0.65... | true | true |
f720e859b033940aead6b8c6f677e377794adbc7 | 798 | py | Python | piton/lib/readchar/readchar.py | piton-package-manager/PPM | 19015b76184befe1e2daa63189a13b039787868d | [
"MIT"
] | 19 | 2016-04-08T04:00:07.000Z | 2021-11-12T19:36:56.000Z | piton/lib/readchar/readchar.py | LookLikeAPro/PPM | 19015b76184befe1e2daa63189a13b039787868d | [
"MIT"
] | 9 | 2017-01-03T13:39:47.000Z | 2022-01-15T20:38:20.000Z | piton/lib/readchar/readchar.py | LookLikeAPro/PPM | 19015b76184befe1e2daa63189a13b039787868d | [
"MIT"
] | 6 | 2017-04-01T03:38:45.000Z | 2021-05-06T11:25:31.000Z | # -*- coding: utf-8 -*-
# This file is based on this gist:
# http://code.activestate.com/recipes/134892/
# So real authors are DannyYoo and company.
import sys
if sys.platform.startswith('linux'):
from .readchar_linux import readchar
elif sys.platform == 'darwin':
from .readchar_linux import readchar
elif sys... | 25.741935 | 79 | 0.645363 |
import sys
if sys.platform.startswith('linux'):
from .readchar_linux import readchar
elif sys.platform == 'darwin':
from .readchar_linux import readchar
elif sys.platform in ('win32', 'cygwin'):
from .readchar_windows import readchar
else:
raise NotImplemented('The platform %s is not supported yet... | true | true |
f720e8b77258c01a05c510ec80e3283dcdbe46b3 | 1,698 | py | Python | leetcode/combination_sum_III.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | leetcode/combination_sum_III.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | leetcode/combination_sum_III.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | """
https://leetcode.com/problems/combination-sum-iii/
Tags: Practice; Concepts; Algorithms; Recursion/BackTracking; Medium
"""
from typing import List
class Solution:
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
# Create a list of nums to choose fromx
return self.combi... | 32.653846 | 114 | 0.579505 |
from typing import List
class Solution:
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
return self.combinations(list(range(1, 10)), [], n, k)
def combinations(self, nums: List[int], combi: List[int], s: int, k: int):
ans = []
if len(combi) == k - 1... | true | true |
f720e94c7b98eefd4db2a78ffdc2366c09186edd | 942 | py | Python | hypernet/src/thermophysicalModels/chemistry/reactions/reactionRate/arrhenius.py | christian-jacobsen/hypernet | 9f62e1531eb152cc08af0b0c6b09d6fde8d42400 | [
"Apache-2.0"
] | null | null | null | hypernet/src/thermophysicalModels/chemistry/reactions/reactionRate/arrhenius.py | christian-jacobsen/hypernet | 9f62e1531eb152cc08af0b0c6b09d6fde8d42400 | [
"Apache-2.0"
] | null | null | null | hypernet/src/thermophysicalModels/chemistry/reactions/reactionRate/arrhenius.py | christian-jacobsen/hypernet | 9f62e1531eb152cc08af0b0c6b09d6fde8d42400 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from hypernet.src.thermophysicalModels.chemistry.reactions.reactionRate import Basic
class Arrhenius(Basic):
# Initialization
###########################################################################
def __init__(
self,
reactionsDatabase,
*args,
**kwa... | 28.545455 | 84 | 0.440552 | import numpy as np
from hypernet.src.thermophysicalModels.chemistry.reactions.reactionRate import Basic
class Arrhenius(Basic):
| true | true |
f720eaa230ec470ea6eabf1b1bc884458772e552 | 9,670 | py | Python | qpth/qp.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | qpth/qp.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | qpth/qp.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | import torch
from torch.autograd import Function
from .util import bger, expandParam, extract_nBatch
from . import solvers
from .solvers.pdipm import batch as pdipm_b
from .solvers.pdipm import spbatch as pdipm_spb
# from .solvers.pdipm import single as pdipm_s
from enum import Enum
class QPSolvers(Enum):
PDIPM... | 37.773438 | 84 | 0.512099 | import torch
from torch.autograd import Function
from .util import bger, expandParam, extract_nBatch
from . import solvers
from .solvers.pdipm import batch as pdipm_b
from .solvers.pdipm import spbatch as pdipm_spb
from enum import Enum
class QPSolvers(Enum):
PDIPM_BATCHED = 1
CVXPY = 2
def QPFunction(ep... | true | true |
f720ef19782f7092c0e07d4d635eb810543e0ea4 | 9,608 | py | Python | tests/functional/tests/management/test_add_remove.py | beef9999/ocf | 4d1b086956e3019456fa86c33954eeb53cfeab9e | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/functional/tests/management/test_add_remove.py | beef9999/ocf | 4d1b086956e3019456fa86c33954eeb53cfeab9e | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/functional/tests/management/test_add_remove.py | beef9999/ocf | 4d1b086956e3019456fa86c33954eeb53cfeab9e | [
"BSD-3-Clause-Clear"
] | null | null | null | # Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import pytest
from ctypes import c_int
from random import randint
from pyocf.types.cache import Cache, CacheMode
from pyocf.types.core import Core
from pyocf.types.volume import Volume
from pyocf.types.data import Data
from pyo... | 30.405063 | 82 | 0.679954 |
import pytest
from ctypes import c_int
from random import randint
from pyocf.types.cache import Cache, CacheMode
from pyocf.types.core import Core
from pyocf.types.volume import Volume
from pyocf.types.data import Data
from pyocf.types.io import IoDir
from pyocf.utils import Size as S
from pyocf.types.shared impor... | true | true |
f720efc3c7a943431ee1490b8c525586b3496e7e | 98 | py | Python | game/forms.py | mingaleg/yakubovich | 95398c78eaffbd6ff69f8fdbedfc847531219d8a | [
"MIT"
] | 5 | 2018-12-12T16:24:42.000Z | 2020-02-29T18:45:30.000Z | game/forms.py | mingaleg/yakubovich | 95398c78eaffbd6ff69f8fdbedfc847531219d8a | [
"MIT"
] | 3 | 2020-06-05T17:47:13.000Z | 2022-02-11T03:39:54.000Z | game/forms.py | mingaleg/yakubovich | 95398c78eaffbd6ff69f8fdbedfc847531219d8a | [
"MIT"
] | null | null | null | from django import forms
class GuessForm(forms.Form):
guess = forms.CharField(max_length=32) | 19.6 | 42 | 0.765306 | from django import forms
class GuessForm(forms.Form):
guess = forms.CharField(max_length=32) | true | true |
f720f0cdfccab7e5f9e79ca3a814fc670b37f244 | 7,403 | py | Python | packages/syft/src/syft/core/node/network.py | Noob-can-Compile/PySyft | 156cf93489b16dd0205b0058d4d23d56b3a91ab8 | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/network.py | Noob-can-Compile/PySyft | 156cf93489b16dd0205b0058d4d23d56b3a91ab8 | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/network.py | Noob-can-Compile/PySyft | 156cf93489b16dd0205b0058d4d23d56b3a91ab8 | [
"Apache-2.0"
] | null | null | null | # future
from __future__ import annotations
# stdlib
import os
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
# third party
import ascii_magic
from nacl.signing import SigningKey
from nacl.signing import VerifyKey
from pydantic import BaseSe... | 35.763285 | 87 | 0.694178 |
from __future__ import annotations
import os
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
import ascii_magic
from nacl.signing import SigningKey
from nacl.signing import VerifyKey
from pydantic import BaseSettings
from ...lib.python i... | true | true |
f720f0e6e33f0328fc6c7ca0e2c409dffe494e2d | 469 | py | Python | rest/taskrouter/activities/list/get/example-1/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/taskrouter/activities/list/get/example-1/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/taskrouter/activities/list/get/example-1/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2020-05-22T23:31:21.000Z | 2021-06-10T18:33:45.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
... | 36.076923 | 72 | 0.831557 |
from twilio.rest import TwilioTaskRouterClient
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client = TwilioTaskRouterClient(account_sid, auth_token)
for activity in client.activities(workspace_sid).list():
print(activity.... | true | true |
f720f0e9572244aa93d948eff6a96fb8c4142ebe | 26,980 | py | Python | lang/python/github/com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder_pb2.py | metaprov/modelaapi | 64ab493dd73329196235e15776e5177c72281990 | [
"Apache-2.0"
] | 5 | 2022-02-18T03:40:10.000Z | 2022-03-01T16:11:24.000Z | lang/python/github/com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder_pb2.py | metaprov/modelaapi | 64ab493dd73329196235e15776e5177c72281990 | [
"Apache-2.0"
] | 1 | 2022-01-07T19:59:25.000Z | 2022-02-04T01:21:14.000Z | lang/python/github/com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder_pb2.py | metaprov/modelaapi | 64ab493dd73329196235e15776e5177c72281990 | [
"Apache-2.0"
] | 1 | 2022-03-25T10:21:43.000Z | 2022-03-25T10:21:43.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: github.com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 48.092692 | 3,212 | 0.807969 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.api import annotations_pb2 as google_dot_api... | true | true |
f720f1e95b326e40c9aeac42acdf9e1f3addaa58 | 753 | py | Python | tests/instructions/test_tfr.py | rob-smallshire/asm68 | a9bbb99e7a7fbbe7656815df488c74606d08b252 | [
"X11"
] | null | null | null | tests/instructions/test_tfr.py | rob-smallshire/asm68 | a9bbb99e7a7fbbe7656815df488c74606d08b252 | [
"X11"
] | null | null | null | tests/instructions/test_tfr.py | rob-smallshire/asm68 | a9bbb99e7a7fbbe7656815df488c74606d08b252 | [
"X11"
] | 1 | 2018-05-08T11:03:22.000Z | 2018-05-08T11:03:22.000Z | from asm68.registers import *
from asm68.mnemonics import TFR
from asm68.asmdsl import AsmDsl, statements
from asm68.assembler import assemble, InterRegisterError
from helpers.code import check_object_code
from pytest import raises
def test_tfr_a_a():
check_object_code('1F 88', TFR, (A, A))
def test_tfr_a_b():
... | 23.53125 | 56 | 0.718459 | from asm68.registers import *
from asm68.mnemonics import TFR
from asm68.asmdsl import AsmDsl, statements
from asm68.assembler import assemble, InterRegisterError
from helpers.code import check_object_code
from pytest import raises
def test_tfr_a_a():
check_object_code('1F 88', TFR, (A, A))
def test_tfr_a_b():
... | true | true |
f720f269f987186e910ee271a51453fc316eb7d7 | 4,231 | py | Python | tests/sender/cli.py | OvidiuMM/python-sdk | 8e5c4e5b00de1269f75d44e7614d2d8d5c934b3b | [
"MIT"
] | 2 | 2020-07-20T09:07:12.000Z | 2020-07-20T09:56:21.000Z | tests/sender/cli.py | OvidiuMM/python-sdk | 8e5c4e5b00de1269f75d44e7614d2d8d5c934b3b | [
"MIT"
] | null | null | null | tests/sender/cli.py | OvidiuMM/python-sdk | 8e5c4e5b00de1269f75d44e7614d2d8d5c934b3b | [
"MIT"
] | null | null | null | import unittest
import socket
from click.testing import CliRunner
from devo.common import Configuration
from devo.sender.scripts.sender_cli import data
from devo.sender import DevoSenderException
try:
from .load_certs import *
except ImportError:
from load_certs import *
class TestSender(unittest.TestCase):
... | 40.295238 | 77 | 0.523044 | import unittest
import socket
from click.testing import CliRunner
from devo.common import Configuration
from devo.sender.scripts.sender_cli import data
from devo.sender import DevoSenderException
try:
from .load_certs import *
except ImportError:
from load_certs import *
class TestSender(unittest.TestCase):
... | true | true |
f720f373767dfe318e91d21f618da8dedddfa285 | 3,700 | py | Python | examples/poisson_test.py | intact-solutions/pysparse | f3dca3ae9d02ab3f49486fbae5d9d68059a318ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/poisson_test.py | intact-solutions/pysparse | f3dca3ae9d02ab3f49486fbae5d9d68059a318ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/poisson_test.py | intact-solutions/pysparse | f3dca3ae9d02ab3f49486fbae5d9d68059a318ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import numpy as np
import math
from pysparse.sparse import spmatrix
from pysparse.itsolvers.krylov import pcg, qmrs
from pysparse.precon import precon
import time
def poisson2d(n):
L = spmatrix.ll_mat(n*n, n*n)
for i in range(n):
for j in range(n):
k = i + n*j
L[k,k] = 4
... | 25 | 100 | 0.481081 | import numpy as np
import math
from pysparse.sparse import spmatrix
from pysparse.itsolvers.krylov import pcg, qmrs
from pysparse.precon import precon
import time
def poisson2d(n):
L = spmatrix.ll_mat(n*n, n*n)
for i in range(n):
for j in range(n):
k = i + n*j
L[k,k] = 4
... | true | true |
f720f3ad35136c86211956b945ba2de3bd65784c | 170 | py | Python | scripts/item/consume_2432355.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/item/consume_2432355.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/item/consume_2432355.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | # Snowflake Damage Skin
success = sm.addDamageSkin(2432355)
if success:
sm.chat("The Snowflake Damage Skin has been added to your account's damage skin collection.")
| 34 | 97 | 0.770588 |
success = sm.addDamageSkin(2432355)
if success:
sm.chat("The Snowflake Damage Skin has been added to your account's damage skin collection.")
| true | true |
f720f5d9454e5ea4b2e9262d909e29b9ee507501 | 1,314 | py | Python | app/core/tests/test_admin.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='royandri.dev@gmail.com',
... | 31.285714 | 68 | 0.637747 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='royandri.dev@gmail.com',
... | true | true |
f720f7d7aa6b5c6b8450862f0abd2256a26a8136 | 58 | py | Python | www/speed/benchmarks/function_call.py | olemis/brython | 3ef4a602eed5a75130e507707579ad9aa2dc3e5c | [
"BSD-3-Clause"
] | 2 | 2018-06-09T15:29:48.000Z | 2019-11-13T09:15:08.000Z | www/speed/benchmarks/function_call.py | olemis/brython | 3ef4a602eed5a75130e507707579ad9aa2dc3e5c | [
"BSD-3-Clause"
] | 2 | 2017-04-14T03:52:41.000Z | 2017-04-14T04:02:06.000Z | client/components/ide/brython/www/speed/benchmarks/function_call.py | pascualy/coding_blind | 420947c61ec3cd0169d5a25f7b01ae6df9541607 | [
"MIT"
] | 2 | 2018-02-22T09:48:18.000Z | 2020-06-04T17:00:09.000Z | def f(x):
return x
for i in range(1000000):
f(i)
| 9.666667 | 24 | 0.551724 | def f(x):
return x
for i in range(1000000):
f(i)
| true | true |
f720f8eccc250efd8c3d430ddb9ee9afde19d1ec | 4,224 | py | Python | lmctl/cli/commands/targets/behaviour_projects.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 3 | 2021-07-19T09:46:01.000Z | 2022-03-07T13:51:25.000Z | lmctl/cli/commands/targets/behaviour_projects.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 43 | 2019-08-27T12:36:29.000Z | 2020-08-27T14:50:40.000Z | lmctl/cli/commands/targets/behaviour_projects.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 7 | 2020-09-22T20:32:17.000Z | 2022-03-29T12:25:51.000Z | import click
from typing import Dict
from lmctl.client import TNCOClient, TNCOClientHttpError
from lmctl.cli.arguments import common_output_format_handler
from lmctl.cli.format import Table, Column
from .tnco_target import TNCOTarget, LmGet, LmCreate, LmUpdate, LmDelete, LmGen
class ProjectTable(Table):
colum... | 44.93617 | 189 | 0.60535 | import click
from typing import Dict
from lmctl.client import TNCOClient, TNCOClientHttpError
from lmctl.cli.arguments import common_output_format_handler
from lmctl.cli.format import Table, Column
from .tnco_target import TNCOTarget, LmGet, LmCreate, LmUpdate, LmDelete, LmGen
class ProjectTable(Table):
colum... | true | true |
f720f9e7fd9b231b60cfa0de9c50219e99364bef | 2,516 | py | Python | api/serializers.py | NiklasMerz/shoppinglist | 38c494b2a2f80a0c543beaf0d9d9a75870bdbb22 | [
"MIT"
] | null | null | null | api/serializers.py | NiklasMerz/shoppinglist | 38c494b2a2f80a0c543beaf0d9d9a75870bdbb22 | [
"MIT"
] | 45 | 2021-11-03T20:48:50.000Z | 2021-12-14T21:22:12.000Z | api/serializers.py | NiklasMerz/shoppinglist | 38c494b2a2f80a0c543beaf0d9d9a75870bdbb22 | [
"MIT"
] | null | null | null | from list.models import *
from rest_framework import serializers
class CatalogItemSerializer(serializers.ModelSerializer):
class Meta:
model = CatalogItem
fields = ['id', 'description']
class ItemSerializer(serializers.ModelSerializer):
last_checkout = serializers.SerializerMethodField()
... | 33.546667 | 165 | 0.661367 | from list.models import *
from rest_framework import serializers
class CatalogItemSerializer(serializers.ModelSerializer):
class Meta:
model = CatalogItem
fields = ['id', 'description']
class ItemSerializer(serializers.ModelSerializer):
last_checkout = serializers.SerializerMethodField()
... | true | true |
f720fb43dcf64ffc735cf5c4010db34b4ad229a7 | 8,091 | py | Python | tests/test_cli_exiftool.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | tests/test_cli_exiftool.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | tests/test_cli_exiftool.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | """Tests for `osxphotos exiftool` command."""
import glob
import json
import os
import pytest
from click.testing import CliRunner
from osxphotos.cli.exiftool_cli import exiftool
from osxphotos.cli.export import export
from osxphotos.exiftool import ExifTool, get_exiftool_path
from .test_cli import CLI_EXIFTOOL, PHO... | 30.303371 | 88 | 0.502163 |
import glob
import json
import os
import pytest
from click.testing import CliRunner
from osxphotos.cli.exiftool_cli import exiftool
from osxphotos.cli.export import export
from osxphotos.exiftool import ExifTool, get_exiftool_path
from .test_cli import CLI_EXIFTOOL, PHOTOS_DB_15_7
try:
exiftool_path = get_exi... | true | true |
f720fb57cc3918cd168d86f2c7f319f139afdefb | 1,488 | py | Python | datasets/raman_tablets/__init__.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 3 | 2019-03-18T03:22:06.000Z | 2021-04-06T07:53:51.000Z | datasets/raman_tablets/__init__.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | null | null | null | datasets/raman_tablets/__init__.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 2 | 2020-10-05T08:22:25.000Z | 2020-10-05T08:24:02.000Z | #!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, February 2017
import os
import scipy.io as sio
import... | 29.76 | 93 | 0.635753 |
import os
import scipy.io as sio
import utils.datasets as utils
__data_set_path = "{}/data/Ramandata_tablets.mat".format(os.path.split(__file__)[0])
__pickle_path = "{}/cache/raman_tablets.pickle".format(os.path.split(__file__)[0])
@utils.load_data_from_pickle(__pickle_path)
def load_raman_tablets()... | true | true |
f720fb60277344026d5780ac04e0013b225304fb | 4,616 | py | Python | homeassistant/components/climate/homekit_controller.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | homeassistant/components/climate/homekit_controller.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:25:50.000Z | 2022-03-11T23:27:53.000Z | homeassistant/components/climate/homekit_controller.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2018-09-14T07:34:09.000Z | 2018-09-29T12:57:10.000Z | """
Support for Homekit climate devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.homekit_controller/
"""
import logging
from homeassistant.components.homekit_controller import (
HomeKitEntity, KNOWN_ACCESSORIES)
from homeassistant.com... | 35.236641 | 79 | 0.649697 | import logging
from homeassistant.components.homekit_controller import (
HomeKitEntity, KNOWN_ACCESSORIES)
from homeassistant.components.climate import (
ClimateDevice, STATE_HEAT, STATE_COOL, STATE_IDLE,
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
from homeassistant.const import TEMP_CELSIUS, STAT... | true | true |
f720fb753855fb74cefd74341a9ca1be69022a34 | 247 | py | Python | frappe/patches/v5_3/rename_chinese_languages.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | 1 | 2021-06-03T07:04:48.000Z | 2021-06-03T07:04:48.000Z | frappe/patches/v5_3/rename_chinese_languages.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | null | null | null | frappe/patches/v5_3/rename_chinese_languages.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import frappe
from frappe.translate import rename_language
def execute():
language_map = {
"中国(简体)": "簡體中文",
"中國(繁體)": "正體中文"
}
for old_name, new_name in language_map.items():
rename_language(old_name, new_name)
| 19 | 48 | 0.684211 |
import frappe
from frappe.translate import rename_language
def execute():
language_map = {
"中国(简体)": "簡體中文",
"中國(繁體)": "正體中文"
}
for old_name, new_name in language_map.items():
rename_language(old_name, new_name)
| true | true |
f720fbff40e522e9a078688ae64f8333f985dc4f | 110 | py | Python | video.py | KazukiChiyo/lane-keeping | 46ac1ce2cb96eb32a0da4946433c8d0ecbf4dc53 | [
"MIT"
] | 1 | 2018-10-09T12:59:30.000Z | 2018-10-09T12:59:30.000Z | video.py | KazukiChiyo/lane-keeping | 46ac1ce2cb96eb32a0da4946433c8d0ecbf4dc53 | [
"MIT"
] | null | null | null | video.py | KazukiChiyo/lane-keeping | 46ac1ce2cb96eb32a0da4946433c8d0ecbf4dc53 | [
"MIT"
] | 1 | 2020-05-22T05:57:29.000Z | 2020-05-22T05:57:29.000Z | from moviepy.editor import VideoFileClip
clip = VideoFileClip("output_images/out_video.mp4")
print(clip.fps)
| 22 | 51 | 0.818182 | from moviepy.editor import VideoFileClip
clip = VideoFileClip("output_images/out_video.mp4")
print(clip.fps)
| true | true |
f720fc48a7b225366d7031ba6afe3845468b78f8 | 5,354 | py | Python | tests/test_node_licenses.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | tests/test_node_licenses.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | tests/test_node_licenses.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | # -*- coding: utf-8 -*-
import builtins
import json
import unittest
import mock
import pytest
from django.core.exceptions import ValidationError
from nose.tools import * # noqa: F403 (PEP8 asserts)
from framework.auth import Auth
from osf_tests.factories import (AuthUserFactory, NodeLicenseRecordFactory,
... | 37.704225 | 98 | 0.678371 |
import builtins
import json
import unittest
import mock
import pytest
from django.core.exceptions import ValidationError
from nose.tools import *
from framework.auth import Auth
from osf_tests.factories import (AuthUserFactory, NodeLicenseRecordFactory,
ProjectFactory)
from tests.b... | true | true |
f720fc870a26f0386b206c00d49fa2c271f5ac7a | 6,675 | py | Python | cavalgada_do_mar/src/webapps/website.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | cavalgada_do_mar/src/webapps/website.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | 1 | 2015-11-08T11:49:35.000Z | 2015-11-08T11:49:43.000Z | cavalgada_do_mar/src/webapps/website.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import web
from web.contrib import PyRSS2Gen
import render_website as render
import model
import forms
import logging
from paginator import Paginator, PaginatorSearch, PaginatorPublicacao
from datetime import datetime
from configuration import WEBSITE_URL
from utils import break_string
urls =... | 34.585492 | 115 | 0.625019 |
import web
from web.contrib import PyRSS2Gen
import render_website as render
import model
import forms
import logging
from paginator import Paginator, PaginatorSearch, PaginatorPublicacao
from datetime import datetime
from configuration import WEBSITE_URL
from utils import break_string
urls = (
'', 'Index',
'/'... | true | true |
f720fd62a5d1381a1365405380ceac93188e3ca0 | 11,640 | py | Python | clients/client/python/ory_client/model/project_revisions.py | ALTELMA/sdk | a04d56edd0431382dda8a9d10229b8479174aa8e | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/project_revisions.py | ALTELMA/sdk | a04d56edd0431382dda8a9d10229b8479174aa8e | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/project_revisions.py | ALTELMA/sdk | a04d56edd0431382dda8a9d10229b8479174aa8e | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.93
Contact: support@ory.sh
Generated by: htt... | 40.842105 | 194 | 0.563574 |
import re
import sys
from ory_client.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,
OpenA... | true | true |
f720fe1037c1d4bf5fae4c4643726fa3e26e29a5 | 2,400 | py | Python | rlkit/core/eval_util.py | ethanabrooks/oyster | 08b758b15ca19c50c43a137cba733b79be55654a | [
"MIT"
] | null | null | null | rlkit/core/eval_util.py | ethanabrooks/oyster | 08b758b15ca19c50c43a137cba733b79be55654a | [
"MIT"
] | null | null | null | rlkit/core/eval_util.py | ethanabrooks/oyster | 08b758b15ca19c50c43a137cba733b79be55654a | [
"MIT"
] | null | null | null | """
Common evaluation utilities.
"""
from collections import OrderedDict
from numbers import Number
import os
import numpy as np
def dprint(*args):
# hacky, but will do for now
if int(os.environ["DEBUG"]) == 1:
print(args)
def get_generic_path_information(paths, stat_prefix=""):
"""
Get an ... | 28.235294 | 85 | 0.635 |
from collections import OrderedDict
from numbers import Number
import os
import numpy as np
def dprint(*args):
if int(os.environ["DEBUG"]) == 1:
print(args)
def get_generic_path_information(paths, stat_prefix=""):
statistics = OrderedDict()
returns = [sum(path["rewards"]) for path in paths... | true | true |
f720ff6a241c7d87d8b54a04ab91ce4d35a8ee45 | 55,439 | py | Python | dlpy/timeseries.py | qzlvyh/sassoftware-python-dlpy | 9bf8cc4ffd5ae235e377004644ef70398431e09c | [
"Apache-2.0"
] | 1 | 2019-04-02T14:36:55.000Z | 2019-04-02T14:36:55.000Z | dlpy/timeseries.py | qzlvyh/sassoftware-python-dlpy | 9bf8cc4ffd5ae235e377004644ef70398431e09c | [
"Apache-2.0"
] | null | null | null | dlpy/timeseries.py | qzlvyh/sassoftware-python-dlpy | 9bf8cc4ffd5ae235e377004644ef70398431e09c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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 b... | 41.840755 | 116 | 0.570771 |
from __future__ import (print_function, division, absolute_import, unicode_literals)
from swat.cas.table import CASTable
from .utils import random_name, get_cas_host_type, char_to_double, int_to_double
from dlpy.utils import DLPyError
from swat.cas import datamsghandlers
import numpy as np
import pan... | true | true |
f720ffac3d7e28046fdffc89dc587da7ce834892 | 9,152 | py | Python | tests/utils_tests/test_functional.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/utils_tests/test_functional.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/utils_tests/test_functional.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | from unittest import mock
from django.test import SimpleTestCase
from django.test.utils import ignore_warnings
from django.utils.deprecation import RemovedInDjango50Warning
from django.utils.functional import cached_property, classproperty, lazy
class FunctionalTests(SimpleTestCase):
def test_lazy(self):
... | 31.777778 | 89 | 0.573864 | from unittest import mock
from django.test import SimpleTestCase
from django.test.utils import ignore_warnings
from django.utils.deprecation import RemovedInDjango50Warning
from django.utils.functional import cached_property, classproperty, lazy
class FunctionalTests(SimpleTestCase):
def test_lazy(self):
... | true | true |
f7210110e7084f60ae5367f63c7dbd932a3b569e | 4,446 | py | Python | examples/batch_mode/14-burning_ship-deeper_DEM.py | GBillotey/Fractalshades | e100b12db031f016bf1a8a1f4fad9ca1c64a0302 | [
"MIT"
] | null | null | null | examples/batch_mode/14-burning_ship-deeper_DEM.py | GBillotey/Fractalshades | e100b12db031f016bf1a8a1f4fad9ca1c64a0302 | [
"MIT"
] | 1 | 2021-11-01T14:55:57.000Z | 2021-11-01T14:55:57.000Z | examples/batch_mode/14-burning_ship-deeper_DEM.py | GBillotey/Fractalshades | e100b12db031f016bf1a8a1f4fad9ca1c64a0302 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
============================
14 - Burning ship deeper DEM
============================
Plotting of a distance estimation for the Burning ship (power-2).
This zoom is deeper, featuring a miniship at 1.e-101
Reference:
`fractalshades.models.Perturbation_burning_ship`
"""
import os
import nu... | 27.7875 | 123 | 0.639226 |
import os
import numpy as np
import fractalshades as fs
import fractalshades.models as fsm
import fractalshades.colors as fscolors
from fractalshades.postproc import (
Postproc_batch,
Continuous_iter_pp,
DEM_normal_pp,
DEM_pp,
Raw_pp,
)
from fractalshades.colors.layers import (
Color_layer,
... | true | true |
f721011b4e470373ce2d983fc11e2f51ebcc9318 | 2,154 | py | Python | mean_var_std.py | jmacdonald2010/mean-variance-standard-deviation-calculator | badae42c099081610fd55ea5a788867c352da6c0 | [
"MIT"
] | null | null | null | mean_var_std.py | jmacdonald2010/mean-variance-standard-deviation-calculator | badae42c099081610fd55ea5a788867c352da6c0 | [
"MIT"
] | null | null | null | mean_var_std.py | jmacdonald2010/mean-variance-standard-deviation-calculator | badae42c099081610fd55ea5a788867c352da6c0 | [
"MIT"
] | null | null | null | import numpy as np
def calculate(list):
if len(list) != 9:
raise ValueError('List must contain nine numbers.')
input_array = np.array([[list[0], list[1], list[2]], [list[3], list[4], list[5]], [list[6], list[7], list[8]]])
calculations = dict()
print(input_array)
# calc mean
c_mean = n... | 35.9 | 162 | 0.633705 | import numpy as np
def calculate(list):
if len(list) != 9:
raise ValueError('List must contain nine numbers.')
input_array = np.array([[list[0], list[1], list[2]], [list[3], list[4], list[5]], [list[6], list[7], list[8]]])
calculations = dict()
print(input_array)
c_mean = np.mean(inpu... | true | true |
f7210156036c5232eb883f6a274abc49ea56fb3e | 154 | py | Python | src/wsgi.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-01-16T23:36:10.000Z | 2020-01-16T23:36:10.000Z | src/wsgi.py | mononobi/imovie-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 24 | 2020-06-08T18:27:04.000Z | 2021-06-06T12:01:39.000Z | src/wsgi.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-12-20T05:29:04.000Z | 2020-12-20T05:29:04.000Z | # -*- coding: utf-8 -*-
"""
wsgi module.
"""
from charma import CharmaApplication
app = CharmaApplication()
if __name__ == '__main__':
app.run()
| 11 | 36 | 0.62987 |
from charma import CharmaApplication
app = CharmaApplication()
if __name__ == '__main__':
app.run()
| true | true |
f721018bc2069beaa9e6763bc79cdfced921521d | 667 | py | Python | examples/pipelayer_microservice/src/service/api/__init__.py | greater-than/PipeLayer | 569f43b65992f8a32079835585b864d5fe0bb251 | [
"BSD-2-Clause"
] | 61 | 2021-02-03T02:54:18.000Z | 2021-12-26T11:38:51.000Z | examples/pipelayer_microservice/src/service/api/__init__.py | greater-than/PipeLayer | 569f43b65992f8a32079835585b864d5fe0bb251 | [
"BSD-2-Clause"
] | 1 | 2021-02-16T13:58:33.000Z | 2021-02-18T12:56:32.000Z | examples/pipelayer_microservice/src/service/api/__init__.py | greater-than/PipeLayer | 569f43b65992f8a32079835585b864d5fe0bb251 | [
"BSD-2-Clause"
] | null | null | null | from logging import Logger
from typing import cast
from service.exception import ResponseException
def handle_exception(e: Exception, log: Logger = Logger("Error Logger")) -> dict:
log.error("Error")
if isinstance(e, [ResponseException]):
e: ResponseException = cast(ResponseException, e)
log.... | 30.318182 | 81 | 0.626687 | from logging import Logger
from typing import cast
from service.exception import ResponseException
def handle_exception(e: Exception, log: Logger = Logger("Error Logger")) -> dict:
log.error("Error")
if isinstance(e, [ResponseException]):
e: ResponseException = cast(ResponseException, e)
log.... | true | true |
f7210264f1cece9dc5803d333f7cdf0b48ec3e1d | 68,178 | py | Python | pymc3/tests/test_distributions.py | semohr/pymc3 | 198d13e2ed6f32b33fd8f4b591a47dc8dd8fe2df | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_distributions.py | semohr/pymc3 | 198d13e2ed6f32b33fd8f4b591a47dc8dd8fe2df | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_distributions.py | semohr/pymc3 | 198d13e2ed6f32b33fd8f4b591a47dc8dd8fe2df | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.46815 | 160 | 0.551014 |
import itertools
import sys
from .helpers import SeededTest, select_by_precision
from ..vartypes import continuous_types
from ..model import Model, Point, Deterministic
from ..blocking import DictToVarBijection
from ..distributions import (
DensityDist,
Categorical,
Multinomial,
VonMises,... | true | true |
f72103e31fd52dd21e230b7d278470e15c333340 | 4,056 | py | Python | volttron/platform/agent/math_utils.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 73 | 2017-07-11T21:46:41.000Z | 2022-03-11T03:35:25.000Z | volttron/platform/agent/math_utils.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 19 | 2017-10-10T22:06:15.000Z | 2022-03-28T21:03:33.000Z | volttron/platform/agent/math_utils.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 36 | 2017-06-24T00:17:03.000Z | 2022-03-31T13:58:36.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistri... | 41.387755 | 72 | 0.747288 |
def mean(data):
n = len(data)
if n < 1:
raise ValueError('mean requires at least one data point')
return sum(data)/n
def _ss(data):
c = mean(data)
ss = sum((x-c)**2 for x in data)
return ss
def pstdev(data):
n = len(data)
... | true | true |
f721053f1c2b0366de64431ea3ca1a8eaac1c75f | 9,874 | py | Python | tests/conftest.py | dobixu/elastalert2 | 2d403918514d7c6e8aa24658c4c1f683dd143d89 | [
"Apache-2.0"
] | 250 | 2021-04-24T18:06:30.000Z | 2022-03-31T04:37:47.000Z | tests/conftest.py | dobixu/elastalert2 | 2d403918514d7c6e8aa24658c4c1f683dd143d89 | [
"Apache-2.0"
] | 129 | 2021-04-24T17:09:50.000Z | 2022-03-29T08:52:14.000Z | tests/conftest.py | dobixu/elastalert2 | 2d403918514d7c6e8aa24658c4c1f683dd143d89 | [
"Apache-2.0"
] | 128 | 2021-04-25T15:20:34.000Z | 2022-03-31T04:37:49.000Z | # -*- coding: utf-8 -*-
import datetime
import logging
import os
from unittest import mock
import pytest
import elastalert.elastalert
import elastalert.util
from elastalert.util import dt_to_ts
from elastalert.util import ts_to_dt
writeback_index = 'wb'
def pytest_addoption(parser):
parser.addoption(
"... | 38.570313 | 110 | 0.623962 |
import datetime
import logging
import os
from unittest import mock
import pytest
import elastalert.elastalert
import elastalert.util
from elastalert.util import dt_to_ts
from elastalert.util import ts_to_dt
writeback_index = 'wb'
def pytest_addoption(parser):
parser.addoption(
"--runelasticsearch", ac... | true | true |
f721054ced7239cd366b9a4117dc04473f5453e9 | 310 | py | Python | allauth/app_settings.py | tobiasgoecke/django-allauth | 5e80865e521a6ec7b4e0bf4aa62ba470a8376e28 | [
"MIT"
] | 2 | 2016-05-24T21:13:32.000Z | 2017-12-27T13:43:26.000Z | allauth/app_settings.py | tobiasgoecke/django-allauth | 5e80865e521a6ec7b4e0bf4aa62ba470a8376e28 | [
"MIT"
] | null | null | null | allauth/app_settings.py | tobiasgoecke/django-allauth | 5e80865e521a6ec7b4e0bf4aa62ba470a8376e28 | [
"MIT"
] | null | null | null | from django.conf import settings
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
REGISTRATION_OPEN = getattr(settings, 'REGISTRATION_OPEN', 'True')
| 25.833333 | 74 | 0.790323 | from django.conf import settings
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
REGISTRATION_OPEN = getattr(settings, 'REGISTRATION_OPEN', 'True')
| true | true |
f721060bb454c8f7e5e8d09071be951a7eff3765 | 13,013 | py | Python | tests/p2p/discv5/test_enr.py | AndreMiras/trinity | 6c20e2b63a698d345c282db8ab0cd426f4329ff5 | [
"MIT"
] | null | null | null | tests/p2p/discv5/test_enr.py | AndreMiras/trinity | 6c20e2b63a698d345c282db8ab0cd426f4329ff5 | [
"MIT"
] | null | null | null | tests/p2p/discv5/test_enr.py | AndreMiras/trinity | 6c20e2b63a698d345c282db8ab0cd426f4329ff5 | [
"MIT"
] | null | null | null | import base64
import pytest
import rlp
from eth_utils import (
decode_hex,
to_bytes,
ValidationError,
)
from eth_utils.toolz import (
assoc,
assoc_in,
)
from p2p.discv5.enr import (
ENR,
ENRSedes,
UnsignedENR,
)
from p2p.discv5.identity_schemes import (
IdentityScheme,
V4Iden... | 31.508475 | 99 | 0.683394 | import base64
import pytest
import rlp
from eth_utils import (
decode_hex,
to_bytes,
ValidationError,
)
from eth_utils.toolz import (
assoc,
assoc_in,
)
from p2p.discv5.enr import (
ENR,
ENRSedes,
UnsignedENR,
)
from p2p.discv5.identity_schemes import (
IdentityScheme,
V4Iden... | true | true |
f72107e0ab86bdefce931d0993f38f0d3db29c26 | 12,483 | py | Python | mypy/test/testpep561.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | 1 | 2019-06-15T08:26:28.000Z | 2019-06-15T08:26:28.000Z | mypy/test/testpep561.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | 1 | 2021-03-31T20:22:11.000Z | 2021-03-31T20:22:11.000Z | mypy/test/testpep561.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | null | null | null | from contextlib import contextmanager
from enum import Enum
import os
import sys
import tempfile
from typing import Tuple, List, Generator, Optional
from unittest import TestCase, main
import mypy.api
from mypy.modulefinder import get_site_packages_dirs
from mypy.test.config import package_path
from mypy.test.helpers ... | 37.827273 | 98 | 0.599295 | from contextlib import contextmanager
from enum import Enum
import os
import sys
import tempfile
from typing import Tuple, List, Generator, Optional
from unittest import TestCase, main
import mypy.api
from mypy.modulefinder import get_site_packages_dirs
from mypy.test.config import package_path
from mypy.test.helpers ... | true | true |
f72108b9bfb35d1a7e2ad22f95c5ce9bc663f987 | 14,680 | py | Python | scripts/cluster/agent.py | nobusugi246/microk8s | 797720e2d1e74030fc3d8df5d291469c6082aaac | [
"Apache-2.0"
] | null | null | null | scripts/cluster/agent.py | nobusugi246/microk8s | 797720e2d1e74030fc3d8df5d291469c6082aaac | [
"Apache-2.0"
] | null | null | null | scripts/cluster/agent.py | nobusugi246/microk8s | 797720e2d1e74030fc3d8df5d291469c6082aaac | [
"Apache-2.0"
] | null | null | null | #!flask/bin/python
import getopt
import json
import os
import shutil
import socket
import string
import random
import subprocess
import sys
from .common.utils import try_set_file_permissions
from flask import Flask, jsonify, request, abort, Response
app = Flask(__name__)
CLUSTER_API="cluster/api/v1.0"
snapdata_path ... | 32.767857 | 119 | 0.611512 |
import getopt
import json
import os
import shutil
import socket
import string
import random
import subprocess
import sys
from .common.utils import try_set_file_permissions
from flask import Flask, jsonify, request, abort, Response
app = Flask(__name__)
CLUSTER_API="cluster/api/v1.0"
snapdata_path = os.environ.get('... | true | true |
f721099fd7f552499a35dce11281e52eec0ef465 | 887 | py | Python | OpenCV/Glyph/fontReplacePixel.py | GaryMK/Machine-Learning | 0eb89ed4c6ea712f518741fdcc63f1b2109b4212 | [
"MIT"
] | 1 | 2021-03-12T07:46:00.000Z | 2021-03-12T07:46:00.000Z | OpenCV/Glyph/fontReplacePixel.py | GaryMK/Kaggle | 0eb89ed4c6ea712f518741fdcc63f1b2109b4212 | [
"MIT"
] | null | null | null | OpenCV/Glyph/fontReplacePixel.py | GaryMK/Kaggle | 0eb89ed4c6ea712f518741fdcc63f1b2109b4212 | [
"MIT"
] | null | null | null | # @author: GaryMK
# @EMAIL: chenxingmk@gmail.com
# @Date: 2021/2/14 0:28
# @Version: 1.0
# @Description:
from PIL import Image, ImageDraw, ImageFont
import cv2
import os
def draw(pic):
img = cv2.imread('source/' + pic)
img = img[:, :, (2, 1, 0)]
blank = Image.new("RGB", [len(img[0]), len(img)], "whit... | 25.342857 | 91 | 0.563698 |
from PIL import Image, ImageDraw, ImageFont
import cv2
import os
def draw(pic):
img = cv2.imread('source/' + pic)
img = img[:, :, (2, 1, 0)]
blank = Image.new("RGB", [len(img[0]), len(img)], "white")
drawObj = ImageDraw.Draw(blank)
n = 10
font = ImageFont.truetype('C:/Windows/Fonts/Mic... | true | true |
f7210a163a4280e095d1c9a4bc619202c8d534a1 | 29 | py | Python | nlpblock/model/__init__.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | 3 | 2019-02-27T13:41:26.000Z | 2021-05-13T07:02:39.000Z | nlpblock/model/__init__.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | null | null | null | nlpblock/model/__init__.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | 3 | 2019-03-02T02:19:46.000Z | 2021-10-03T18:46:52.000Z | from nlpblock.model import *
| 14.5 | 28 | 0.793103 | from nlpblock.model import *
| true | true |
f7210a7be7a7a9686e849af8805af4b5236ca87c | 1,558 | py | Python | Code/finance.py | Naghipourfar/TraderBot | 2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce | [
"MIT"
] | 3 | 2019-02-06T09:45:39.000Z | 2022-01-15T04:48:07.000Z | Code/finance.py | Naghipourfar/TraderBot | 2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce | [
"MIT"
] | null | null | null | Code/finance.py | Naghipourfar/TraderBot | 2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce | [
"MIT"
] | 1 | 2020-01-07T05:20:24.000Z | 2020-01-07T05:20:24.000Z | import numpy as np
import pandas as pd
from pandas_datareader import data
import tensorflow as tf
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Dropout, BatchNormalization
from keras.models import Model
from keras.callbacks import History, CSVLogger
"""
Created by Mohsen Nag... | 28.327273 | 72 | 0.734275 | import numpy as np
import pandas as pd
from pandas_datareader import data
import tensorflow as tf
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Dropout, BatchNormalization
from keras.models import Model
from keras.callbacks import History, CSVLogger
tickers = ['AAPL', 'MSFT', '... | true | true |
f7210a7f9de0f160b00a0a52aaf0e082c37d647d | 1,685 | py | Python | lib/lib_apscheduler.py | ZhaoUncle/skstack | 9e00305f50fdd60125ec37884247b94b70a9020c | [
"Apache-2.0"
] | null | null | null | lib/lib_apscheduler.py | ZhaoUncle/skstack | 9e00305f50fdd60125ec37884247b94b70a9020c | [
"Apache-2.0"
] | null | null | null | lib/lib_apscheduler.py | ZhaoUncle/skstack | 9e00305f50fdd60125ec37884247b94b70a9020c | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2018年6月19日 @author: encodingl
'''
import time
import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.schedulers.background import BackgroundScheduler
def job1(f):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.lo... | 29.051724 | 130 | 0.645697 |
import time
import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.schedulers.background import BackgroundScheduler
def job1(f):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), f)
def job2(args1, args2, f):
print(f, args1, args2)
def job3(*... | true | true |
f7210b036da2023fc30a4f620fdbe6743b369a69 | 4,058 | py | Python | movienightbot/db/models.py | squirrelo/MovieNightBot | 53fad77d533f13587d47d64fe7583db55529184a | [
"WTFPL"
] | 3 | 2020-02-22T14:22:21.000Z | 2021-02-04T19:44:38.000Z | movienightbot/db/models.py | squirrelo/MovieNightBot | 53fad77d533f13587d47d64fe7583db55529184a | [
"WTFPL"
] | 42 | 2020-02-10T03:42:29.000Z | 2022-02-12T23:43:43.000Z | movienightbot/db/models.py | squirrelo/MovieNightBot | 53fad77d533f13587d47d64fe7583db55529184a | [
"WTFPL"
] | 3 | 2020-02-14T23:22:24.000Z | 2020-06-06T21:00:14.000Z | import datetime
import peewee as pw
from . import BaseModel
class Server(BaseModel):
id = pw.IntegerField(primary_key=True)
channel = pw.IntegerField(null=False)
movie_time = pw.TimeField(null=False, formats="%H:%M", default="12:00")
admin_role = pw.TextField(null=False, default="Movie Master")
t... | 32.99187 | 116 | 0.673238 | import datetime
import peewee as pw
from . import BaseModel
class Server(BaseModel):
id = pw.IntegerField(primary_key=True)
channel = pw.IntegerField(null=False)
movie_time = pw.TimeField(null=False, formats="%H:%M", default="12:00")
admin_role = pw.TextField(null=False, default="Movie Master")
t... | true | true |
f7210b6d933a1774a42b9590a91353ac70a354f7 | 5,252 | py | Python | euler/large_sum.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | euler/large_sum.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | euler/large_sum.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | example = '''
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
... | 48.62963 | 53 | 0.967822 | example = '''
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
... | true | true |
f7210c49de22ec515aedef5c7f5415db79dc84ea | 21,828 | py | Python | recipes/openscenegraph/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 2 | 2021-08-12T06:17:58.000Z | 2021-09-07T23:12:25.000Z | recipes/openscenegraph/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9 | 2020-01-21T08:27:51.000Z | 2021-01-23T19:21:46.000Z | recipes/openscenegraph/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 2 | 2021-05-12T10:37:57.000Z | 2021-12-15T13:38:16.000Z | from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.29.1"
class OpenSceneGraphConanFile(ConanFile):
name = "openscenegraph"
description = "OpenSceneGraph is an open source high performance 3D graphics toolkit"
topics = ("o... | 40.8 | 189 | 0.624748 | from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.29.1"
class OpenSceneGraphConanFile(ConanFile):
name = "openscenegraph"
description = "OpenSceneGraph is an open source high performance 3D graphics toolkit"
topics = ("o... | true | true |
f7210dc85edd4d0b6ad091c50f23892394528a1e | 1,558 | py | Python | examples/aws_lambda/aws_lambda_oauth.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | 1 | 2021-05-02T16:06:44.000Z | 2021-05-02T16:06:44.000Z | examples/aws_lambda/aws_lambda_oauth.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | 1 | 2021-02-23T21:05:57.000Z | 2021-02-23T21:05:57.000Z | examples/aws_lambda/aws_lambda_oauth.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | null | null | null | # ------------------------------------------------
# instead of slack_bolt in requirements.txt
import sys
sys.path.insert(1, "vendor")
# ------------------------------------------------
import logging
from slack_bolt import App
from slack_bolt.adapter.aws_lambda import SlackRequestHandler
from slack_bolt.adapter.aws... | 29.396226 | 96 | 0.727856 |
import sys
sys.path.insert(1, "vendor")
import logging
from slack_bolt import App
from slack_bolt.adapter.aws_lambda import SlackRequestHandler
from slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow import LambdaS3OAuthFlow
app = App(process_before_response=True, oauth_flow=LambdaS3OAuthFlow(),)
@app.event("... | true | true |
f7210e74f4ea154ad8e0c98314be558c787c9440 | 483 | py | Python | app/settings.py | rchapman83/sticks-clothing | dfdb5283b00c9209f854648e50f30140a0bb3004 | [
"MIT"
] | null | null | null | app/settings.py | rchapman83/sticks-clothing | dfdb5283b00c9209f854648e50f30140a0bb3004 | [
"MIT"
] | null | null | null | app/settings.py | rchapman83/sticks-clothing | dfdb5283b00c9209f854648e50f30140a0bb3004 | [
"MIT"
] | null | null | null | # -*- settings:utf-8 -*-
# Flask settings
import logging
import os
proj_name = os.environ.get('PROJECT_NAME')
debug_mode = os.environ.get('FLASK_DEBUG')
secret_code = os.environ.get('FLASK_SECRET')
DEBUG = debug_mode
TESTING = False
USE_X_SENDFILE = False
CSRF_ENABLED = True
SECRET_KEY = secret_code
# LOGGING
LO... | 21.954545 | 55 | 0.730849 |
import logging
import os
proj_name = os.environ.get('PROJECT_NAME')
debug_mode = os.environ.get('FLASK_DEBUG')
secret_code = os.environ.get('FLASK_SECRET')
DEBUG = debug_mode
TESTING = False
USE_X_SENDFILE = False
CSRF_ENABLED = True
SECRET_KEY = secret_code
LOGGER_NAME = '%s_log' % proj_name
LOG_FILENAME = '/... | true | true |
f7210f83b40555129d292b05eb3bd12a490ff744 | 1,857 | py | Python | samplers.py | linkserendipity/deep-person-reid | 564ccf307336af1b3343fa42c55f9d53df0fa20a | [
"MIT"
] | null | null | null | samplers.py | linkserendipity/deep-person-reid | 564ccf307336af1b3343fa42c55f9d53df0fa20a | [
"MIT"
] | null | null | null | samplers.py | linkserendipity/deep-person-reid | 564ccf307336af1b3343fa42c55f9d53df0fa20a | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data.sampler import Sampler
class RandomIdentitySampler(Sampler):
"""
Randomly sample N identities, then for each identity,
randomly sample K instances, therefore batch size is N*K.... | 37.14 | 113 | 0.662897 | from __future__ import absolute_import
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data.sampler import Sampler
class RandomIdentitySampler(Sampler):
def __init__(self, data_source, num_instances=4):
self.data_source = data_source
self.num_instances = num_in... | true | true |
f7210fbfe983a9e81665dcac17e1a9498a07d28d | 5,545 | py | Python | examples/pwr_run/ml_regression/new_speedup_def/knn_k80.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/ml_regression/new_speedup_def/knn_k80.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/ml_regression/new_speedup_def/knn_k80.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | import pandas
import pdb
from datetime import datetime
import matplotlib
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import glob
import sys
from matplotlib.ticker import MultipleLocator
from scipy.stats import pearsonr, spearmanr
from sklearn import neighbors
from sklearn.... | 31.327684 | 83 | 0.658431 | import pandas
import pdb
from datetime import datetime
import matplotlib
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import glob
import sys
from matplotlib.ticker import MultipleLocator
from scipy.stats import pearsonr, spearmanr
from sklearn import neighbors
from sklearn.... | true | true |
f7210feadbc98c8ee9e14ec28cba851c6e06e25b | 1,367 | py | Python | ssseg/cfgs/fcn/cfgs_voc_resnest101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 411 | 2020-10-22T02:24:57.000Z | 2022-03-31T11:19:17.000Z | ssseg/cfgs/fcn/cfgs_voc_resnest101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 24 | 2020-12-21T03:53:54.000Z | 2022-03-17T06:50:00.000Z | ssseg/cfgs/fcn/cfgs_voc_resnest101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 59 | 2020-12-04T03:40:12.000Z | 2022-03-30T09:12:47.000Z | '''define the config file for voc and resnest101os8'''
import os
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'voc',
'rootdir': os.path.join(os.getcwd(), 'VOCdevkit/VOC2012'),
})
DATASET_CFG['train']['set'] = 'trainaug'
# modify dataloader confi... | 25.314815 | 88 | 0.653255 | import os
from .base_cfg import *
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'voc',
'rootdir': os.path.join(os.getcwd(), 'VOCdevkit/VOC2012'),
})
DATASET_CFG['train']['set'] = 'trainaug'
DATALOADER_CFG = DATALOADER_CFG.copy()
OPTIMIZER_CFG = OPTIMIZER_CFG.copy()
OPTIMIZER_CFG.update(
... | true | true |
f721104366206bc775401b5c4d6634e901a2440d | 495 | py | Python | skype2.py | tullowhurler/GMIT-project-submissions | 5c75d5303bbdf75068b2b874debccf3531c7b80b | [
"Apache-2.0"
] | null | null | null | skype2.py | tullowhurler/GMIT-project-submissions | 5c75d5303bbdf75068b2b874debccf3531c7b80b | [
"Apache-2.0"
] | null | null | null | skype2.py | tullowhurler/GMIT-project-submissions | 5c75d5303bbdf75068b2b874debccf3531c7b80b | [
"Apache-2.0"
] | null | null | null | #Solution 2
#16/3/18 Ian's Solution
def ispalindrome(s): # s is the string
ans = True # thats what will print out
for i in range(len(s)): # loops through s which we put down in print
if s[i] != s[len(s) - 1 -i]: # len s of radar is = 5 as there is 5 digits, we want to get to 0-4 so have to -1, i starts ... | 35.357143 | 137 | 0.640404 |
def ispalindrome(s): # s is the string
ans = True # thats what will print out
for i in range(len(s)): # loops through s which we put down in print
if s[i] != s[len(s) - 1 -i]: # len s of radar is = 5 as there is 5 digits, we want to get to 0-4 so have to -1, i starts at 0 and
ans = False # ... | true | true |
f7211163c547410a5d37c79cba8d58a47a6c46de | 7,205 | py | Python | final-exam/tic_toc_toe_messy.py | Tanner-York-Make-School/SPD-2.31-Testing-and-Architecture | 623537a05cf5a9d50370a414a5056a78f95288eb | [
"MIT"
] | null | null | null | final-exam/tic_toc_toe_messy.py | Tanner-York-Make-School/SPD-2.31-Testing-and-Architecture | 623537a05cf5a9d50370a414a5056a78f95288eb | [
"MIT"
] | null | null | null | final-exam/tic_toc_toe_messy.py | Tanner-York-Make-School/SPD-2.31-Testing-and-Architecture | 623537a05cf5a9d50370a414a5056a78f95288eb | [
"MIT"
] | null | null | null | """
Tic Tac Toe
Reference: With modification from http://inventwithpython.com/chapter10.html.
# TODOs:
# 1. Find all TODO items and see whether you can improve the code.
# In most cases (if not all), you can make them more readable/modular.
# 2. Add/fix function's docstrings
"""
import random
# I didn't refactor ... | 36.025 | 98 | 0.624427 |
import random
# function because that would be drastically changing how the
# code works. Instead of creating a normal tic tac toe game like intended,
# it would add a new feature for creating larger boards, no longer making this
# refactoring but adding a new feature.
def draw_board(board):
# "board" is a list... | true | true |
f721131d0c71c26b6d07fafc53e439f251dd92fe | 18,055 | py | Python | test/test_l2bd_arp_term.py | snergfdio/vppclone | a288f8a1020eb74687eeb0a0a771977ce9b0c01d | [
"Apache-2.0"
] | null | null | null | test/test_l2bd_arp_term.py | snergfdio/vppclone | a288f8a1020eb74687eeb0a0a771977ce9b0c01d | [
"Apache-2.0"
] | 1 | 2021-06-01T23:30:08.000Z | 2021-06-01T23:30:08.000Z | test/test_l2bd_arp_term.py | snergfdio/vppclone | a288f8a1020eb74687eeb0a0a771977ce9b0c01d | [
"Apache-2.0"
] | 1 | 2019-03-11T19:28:31.000Z | 2019-03-11T19:28:31.000Z | #!/usr/bin/env python
""" L2BD ARP term Test """
import unittest
import random
import copy
from socket import AF_INET, AF_INET6
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
from scapy.layers.inet import IP
from scapy.utils import inet_pton, inet_ntop
from scapy.utils6 import in6_getnsma, in6_g... | 36.92229 | 79 | 0.608419 |
import unittest
import random
import copy
from socket import AF_INET, AF_INET6
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
from scapy.layers.inet import IP
from scapy.utils import inet_pton, inet_ntop
from scapy.utils6 import in6_getnsma, in6_getnsmac, in6_ptop, in6_islladdr, \
in6_macto... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.