hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71304694bf0a8c50772bd6404f430c84c395310 | 14,235 | py | Python | sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py | pulumi-bot/pulumi-azure | 64d5c30a77b3f4de117068add359ef85293cef8e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py | pulumi-bot/pulumi-azure | 64d5c30a77b3f4de117068add359ef85293cef8e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py | pulumi-bot/pulumi-azure | 64d5c30a77b3f4de117068add359ef85293cef8e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Kubern... | 61.891304 | 399 | 0.70144 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class KubernetesClusterNodePool(pulumi.CustomResource):
availability_zones: pulumi.Output[list]
enable_auto_scaling: pulumi.Output[bool]
enable_node_public_ip: pulumi.Output[bool]
... | true | true |
f71304e38931d2ddc525dcc080573bd1623348ca | 2,137 | py | Python | conans/test/util/detect_test.py | ytimenkov/conan | 89eb275b9696b308aaaa1fbfaa0f8cdab284a764 | [
"MIT"
] | null | null | null | conans/test/util/detect_test.py | ytimenkov/conan | 89eb275b9696b308aaaa1fbfaa0f8cdab284a764 | [
"MIT"
] | null | null | null | conans/test/util/detect_test.py | ytimenkov/conan | 89eb275b9696b308aaaa1fbfaa0f8cdab284a764 | [
"MIT"
] | null | null | null | import platform
import subprocess
import unittest
from conans import tools
from conans.client.conf.detect import detect_defaults_settings
from conans.test.utils.tools import TestBufferConanOutput
class DetectTest(unittest.TestCase):
def detect_default_compilers_test(self):
platform_default_compilers = {... | 39.574074 | 103 | 0.659336 | import platform
import subprocess
import unittest
from conans import tools
from conans.client.conf.detect import detect_defaults_settings
from conans.test.utils.tools import TestBufferConanOutput
class DetectTest(unittest.TestCase):
def detect_default_compilers_test(self):
platform_default_compilers = {... | true | true |
f7130518f2b9fedcf4b6b2640fe15a1a4a845769 | 5,898 | py | Python | src/fonduer_utils.py | kaikun213/fonduer-troy200 | d5653df48e3ce3037f4f1b500d454947ad0d010c | [
"MIT"
] | null | null | null | src/fonduer_utils.py | kaikun213/fonduer-troy200 | d5653df48e3ce3037f4f1b500d454947ad0d010c | [
"MIT"
] | null | null | null | src/fonduer_utils.py | kaikun213/fonduer-troy200 | d5653df48e3ce3037f4f1b500d454947ad0d010c | [
"MIT"
] | null | null | null | import emmental
import numpy as np
from fonduer import Meta
from emmental.modules.embedding_module import EmbeddingModule
from emmental.data import EmmentalDataLoader
from emmental.model import EmmentalModel
from emmental.learner import EmmentalLearner
from fonduer.learning.utils import collect_word_counter
from fondu... | 34.694118 | 116 | 0.651577 | import emmental
import numpy as np
from fonduer import Meta
from emmental.modules.embedding_module import EmbeddingModule
from emmental.data import EmmentalDataLoader
from emmental.model import EmmentalModel
from emmental.learner import EmmentalLearner
from fonduer.learning.utils import collect_word_counter
from fondu... | true | true |
f71305b2f41d57068e7b72cf7780ca0349393aab | 1,949 | py | Python | contrib/performance/sqlusage/requests/propfind_invite.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 462 | 2016-08-14T17:43:24.000Z | 2022-03-17T07:38:16.000Z | contrib/performance/sqlusage/requests/propfind_invite.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 72 | 2016-09-01T23:19:35.000Z | 2020-02-05T02:09:26.000Z | contrib/performance/sqlusage/requests/propfind_invite.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 171 | 2016-08-16T03:50:30.000Z | 2022-03-26T11:49:55.000Z | ##
# Copyright (c) 2012-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 35.436364 | 94 | 0.709595 |
from caldavclientlibrary.protocol.http.data.string import ResponseDataString
from caldavclientlibrary.protocol.webdav.definitions import statuscodes, \
headers
from caldavclientlibrary.protocol.webdav.propfind import PropFind
from contrib.performance.sqlusage.requests.httpTests import HTTPTestBase
fro... | true | true |
f713067ddbfe4dba691898fb82829f79228edd1c | 11,238 | py | Python | src/plivo/rest/freeswitch/cacheserver.py | mknecht/plivoframework | 29fc41fb3c887d5d9022a941e87bbeb2269112ff | [
"Condor-1.1"
] | 151 | 2015-01-14T13:35:47.000Z | 2022-01-25T02:47:14.000Z | src/plivo/rest/freeswitch/cacheserver.py | altanai/plivoframework | d8d182c7af17c3fbe514d7dfd68d0608ce798f47 | [
"Condor-1.1"
] | 14 | 2015-01-02T05:12:04.000Z | 2021-02-03T04:25:39.000Z | src/plivo/rest/freeswitch/cacheserver.py | altanai/plivoframework | d8d182c7af17c3fbe514d7dfd68d0608ce798f47 | [
"Condor-1.1"
] | 107 | 2015-01-02T04:15:28.000Z | 2022-02-07T18:14:18.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2011 Plivo Team. See LICENSE for details
from gevent import monkey
monkey.patch_all()
import grp
import os
import pwd
import signal
import sys
import optparse
from flask import Flask
import gevent
from gevent.wsgi import WSGIServer
from gevent.pywsgi import WSGIServer as PyWSG... | 37.211921 | 122 | 0.559797 |
from gevent import monkey
monkey.patch_all()
import grp
import os
import pwd
import signal
import sys
import optparse
from flask import Flask
import gevent
from gevent.wsgi import WSGIServer
from gevent.pywsgi import WSGIServer as PyWSGIServer
from plivo.rest.freeswitch.cacheapi import PlivoCacheApi
import plivo.... | false | true |
f71306cdaf57f6277c680b055dcbfff2c9f23428 | 1,567 | py | Python | integrations-and-supported-tools/optuna/scripts/Neptune_Optuna_integration_customize_callback.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 15 | 2021-06-11T16:35:15.000Z | 2022-03-29T15:53:59.000Z | integrations-and-supported-tools/optuna/scripts/Neptune_Optuna_integration_customize_callback.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 12 | 2021-04-26T13:07:50.000Z | 2021-11-15T10:50:03.000Z | integrations-and-supported-tools/optuna/scripts/Neptune_Optuna_integration_customize_callback.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 10 | 2021-05-07T16:28:18.000Z | 2022-02-28T21:47:11.000Z | import lightgbm as lgb
import neptune.new as neptune
import neptune.new.integrations.optuna as optuna_utils
import optuna
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
def objective(trial):
data, target = load_breast_... | 30.72549 | 85 | 0.730696 | import lightgbm as lgb
import neptune.new as neptune
import neptune.new.integrations.optuna as optuna_utils
import optuna
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
def objective(trial):
data, target = load_breast_... | true | true |
f713088ab00e8c25a1a72f8168121f4e7a2c67f4 | 1,476 | py | Python | src/ice/persistence/config_file_backing_store.py | geraldhumphries/Ice | ec466e85407361bbbc87b9e484fe427c1769b4fe | [
"MIT"
] | null | null | null | src/ice/persistence/config_file_backing_store.py | geraldhumphries/Ice | ec466e85407361bbbc87b9e484fe427c1769b4fe | [
"MIT"
] | null | null | null | src/ice/persistence/config_file_backing_store.py | geraldhumphries/Ice | ec466e85407361bbbc87b9e484fe427c1769b4fe | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
config_file_backing_store.py
Created by Scott on 2014-08-12.
Copyright (c) 2014 Scott Rice. All rights reserved.
"""
import ConfigParser
import backing_store
class ConfigFileBackingStore(backing_store.BackingStore):
def __init__(self, path):
super(ConfigFileBackingStore, self).__init__... | 26.836364 | 73 | 0.70935 |
import ConfigParser
import backing_store
class ConfigFileBackingStore(backing_store.BackingStore):
def __init__(self, path):
super(ConfigFileBackingStore, self).__init__(path)
self.configParser = ConfigParser.RawConfigParser()
self.configParser.read(self.path)
def identifiers(self):
return se... | true | true |
f71308ef91bdc04340e4aa7f18beafcd02c04cc6 | 3,880 | py | Python | lib/searchengine.py | mavlyutovrus/light_search | 6b0d2d78de99820ca366c6c1bd8efce93a789100 | [
"MIT"
] | null | null | null | lib/searchengine.py | mavlyutovrus/light_search | 6b0d2d78de99820ca366c6c1bd8efce93a789100 | [
"MIT"
] | null | null | null | lib/searchengine.py | mavlyutovrus/light_search | 6b0d2d78de99820ca366c6c1bd8efce93a789100 | [
"MIT"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | 30.551181 | 117 | 0.688402 |
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_searchengine', [dirname(__file__)])
except ImportError:
i... | true | true |
f71308fd0107b25762f8b57a132aa2e42da40da3 | 19,704 | py | Python | control_parameters_step/tk_control_parameters.py | paulsaxe/control_parameters_step | e789c8c329d150683a44e8a8cdfef3c61e2158a6 | [
"BSD-3-Clause"
] | null | null | null | control_parameters_step/tk_control_parameters.py | paulsaxe/control_parameters_step | e789c8c329d150683a44e8a8cdfef3c61e2158a6 | [
"BSD-3-Clause"
] | null | null | null | control_parameters_step/tk_control_parameters.py | paulsaxe/control_parameters_step | e789c8c329d150683a44e8a8cdfef3c61e2158a6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""The graphical part of a Control Parameters step"""
import seamm
from seamm_util import ureg, Q_, units_class # noqa: F401
import seamm_widgets as sw
import control_parameters_step # noqa: F401
import Pmw
import pprint # noqa: F401
import tkinter as tk
import tkinter.ttk as ttk
class Tk... | 29.719457 | 88 | 0.537911 |
import seamm
from seamm_util import ureg, Q_, units_class
import seamm_widgets as sw
import control_parameters_step
import Pmw
import pprint
import tkinter as tk
import tkinter.ttk as ttk
class TkControlParameters(seamm.TkNode):
def __init__(
self, tk_flowchart=None, node=None, canvas=None, x=No... | true | true |
f7130949530e3c8080cfb33ad2f69288e627d3c5 | 151 | py | Python | lux/_config/__init__.py | piyushg9794/lux | f5be470f5a4837db2746c950bebe2694665c25dc | [
"Apache-2.0"
] | null | null | null | lux/_config/__init__.py | piyushg9794/lux | f5be470f5a4837db2746c950bebe2694665c25dc | [
"Apache-2.0"
] | null | null | null | lux/_config/__init__.py | piyushg9794/lux | f5be470f5a4837db2746c950bebe2694665c25dc | [
"Apache-2.0"
] | null | null | null | from lux._config import config
from lux._config.config import (
register_action,
remove_action,
actions,
update_actions,
config,
)
| 16.777778 | 32 | 0.708609 | from lux._config import config
from lux._config.config import (
register_action,
remove_action,
actions,
update_actions,
config,
)
| true | true |
f71309838213fda3d2ccfb8239566aa6840f11d6 | 1,693 | py | Python | tests/unittests/azure_namespace_import/azure_namespace_import.py | gohar94/azure-functions-python-worker | 4322e53ddbcc1eea40c1b061b42653336d9003f6 | [
"MIT"
] | 277 | 2018-01-25T23:13:03.000Z | 2022-02-22T06:12:04.000Z | tests/unittests/azure_namespace_import/azure_namespace_import.py | gohar94/azure-functions-python-worker | 4322e53ddbcc1eea40c1b061b42653336d9003f6 | [
"MIT"
] | 731 | 2018-01-18T18:54:38.000Z | 2022-03-29T00:01:46.000Z | tests/unittests/azure_namespace_import/azure_namespace_import.py | YunchuWang/azure-functions-python-worker | 1f23e038a506c6412e4efbf07eb471a6afab0c2a | [
"MIT"
] | 109 | 2018-01-18T02:22:57.000Z | 2022-02-15T18:59:54.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import sys
import shutil
import asyncio
from azure_functions_worker import protos
from azure_functions_worker import testutils
async def vertify_nested_namespace_import():
test_env = {}
request = protos.Fu... | 30.232143 | 78 | 0.705848 |
import os
import sys
import shutil
import asyncio
from azure_functions_worker import protos
from azure_functions_worker import testutils
async def vertify_nested_namespace_import():
test_env = {}
request = protos.FunctionEnvironmentReloadRequest(
environment_variables=test_env)
request_msg = p... | true | true |
f7130a131ee35ac383e4e4fbe789078fd95b52cf | 6,620 | py | Python | tests/test_utils.py | KaczuH/pykechain | 2bc734ddf2df4926e7ad5612197e50fee6e24071 | [
"Apache-2.0"
] | 5 | 2017-05-03T12:19:51.000Z | 2021-07-07T11:55:50.000Z | tests/test_utils.py | KaczuH/pykechain | 2bc734ddf2df4926e7ad5612197e50fee6e24071 | [
"Apache-2.0"
] | 593 | 2016-12-22T15:41:54.000Z | 2022-03-22T12:39:49.000Z | tests/test_utils.py | KaczuH/pykechain | 2bc734ddf2df4926e7ad5612197e50fee6e24071 | [
"Apache-2.0"
] | 5 | 2017-03-13T17:36:28.000Z | 2021-06-24T09:37:55.000Z | from unittest import TestCase
from pykechain.utils import is_url, is_valid_email, Empty, get_in_chunks
from tests.classes import SixTestCase
class TestIsURL(SixTestCase):
def test_is_url_returns_true_on_valid_url(self):
addresses = [
u"http://foobar.dk",
u"http://foobar.museum/foo... | 35.212766 | 107 | 0.488671 | from unittest import TestCase
from pykechain.utils import is_url, is_valid_email, Empty, get_in_chunks
from tests.classes import SixTestCase
class TestIsURL(SixTestCase):
def test_is_url_returns_true_on_valid_url(self):
addresses = [
u"http://foobar.dk",
u"http://foobar.museum/foo... | true | true |
f7130a19783ebc588021ea51528389bdf45f5fd1 | 1,611 | py | Python | src/scripts/create_shelters_thumbnails.py | rodekruis/shelter-database | 99f96bf06a7287e925b7385dbf7cc363caf4a2bd | [
"MIT"
] | 9 | 2016-07-12T06:41:48.000Z | 2022-02-03T05:55:17.000Z | src/scripts/create_shelters_thumbnails.py | rodekruis/shelter-database | 99f96bf06a7287e925b7385dbf7cc363caf4a2bd | [
"MIT"
] | 22 | 2016-09-06T05:36:37.000Z | 2021-09-07T23:41:26.000Z | src/scripts/create_shelters_thumbnails.py | rodekruis/shelter-database | 99f96bf06a7287e925b7385dbf7cc363caf4a2bd | [
"MIT"
] | 3 | 2016-08-19T05:37:08.000Z | 2017-02-20T06:58:03.000Z | #! /usr/bin/python
#-*- coding:utf-8 -*
import os
import conf
from web.models import Shelter, ShelterPicture
from bootstrap import db
from PIL import Image
def create_shelters_thumbnails():
shelters = Shelter.query.all()
pictures = ShelterPicture.query.all()
for picture in pictures:
filepath... | 40.275 | 117 | 0.610801 |
import os
import conf
from web.models import Shelter, ShelterPicture
from bootstrap import db
from PIL import Image
def create_shelters_thumbnails():
shelters = Shelter.query.all()
pictures = ShelterPicture.query.all()
for picture in pictures:
filepath = os.path.join(conf.SHELTERS_PICTURES... | true | true |
f7130b08ef855e3db989ab8893f0a61477a14c5f | 71 | py | Python | dataset/__init__.py | kylematoba/pest | 749b3f02cc98d3bf06dc7e2142306fc6d252f3ce | [
"MIT"
] | 2 | 2021-10-30T06:48:05.000Z | 2021-12-17T07:19:49.000Z | dataset/__init__.py | kylematoba/pest | 749b3f02cc98d3bf06dc7e2142306fc6d252f3ce | [
"MIT"
] | null | null | null | dataset/__init__.py | kylematoba/pest | 749b3f02cc98d3bf06dc7e2142306fc6d252f3ce | [
"MIT"
] | 1 | 2022-02-21T14:51:08.000Z | 2022-02-21T14:51:08.000Z | from .wrapper import get_dataset
from .adversarial import class_indices | 35.5 | 38 | 0.873239 | from .wrapper import get_dataset
from .adversarial import class_indices | true | true |
f7130b8a5d6998992435ddd3445404406a4916cf | 119 | py | Python | mmdet/models/decision_net/__init__.py | ruyueshuo/MaskTrackRCNN | 3c6ada36be3c2b2df32176349ec5c0ee5b24e724 | [
"Apache-2.0"
] | 1 | 2020-01-03T08:30:42.000Z | 2020-01-03T08:30:42.000Z | mmdet/models/decision_net/__init__.py | ruyueshuo/MaskTrackRCNN | 3c6ada36be3c2b2df32176349ec5c0ee5b24e724 | [
"Apache-2.0"
] | null | null | null | mmdet/models/decision_net/__init__.py | ruyueshuo/MaskTrackRCNN | 3c6ada36be3c2b2df32176349ec5c0ee5b24e724 | [
"Apache-2.0"
] | null | null | null | from .env import DecisionEnv
from .base import BaseRL
from .ddpg import *
from .dqn import *
__all__ = ['DecisionEnv'] | 19.833333 | 28 | 0.747899 | from .env import DecisionEnv
from .base import BaseRL
from .ddpg import *
from .dqn import *
__all__ = ['DecisionEnv'] | true | true |
f7130d848e1f61bab8213b7f7c4bdf4bf08d3b40 | 4,184 | py | Python | openGaussBase/testcase/GUC/RUN_STATISTICS/Opengauss_Function_Guc_Run_Statistics_Case0003.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/RUN_STATISTICS/Opengauss_Function_Guc_Run_Statistics_Case0003.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/RUN_STATISTICS/Opengauss_Function_Guc_Run_Statistics_Case0003.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 38.385321 | 126 | 0.595363 |
import sys
import unittest
sys.path.append(sys.path[0] + "/../")
from testcase.utils.Logger import Logger
from testcase.utils.Constant import Constant
from testcase.utils.CommonSH import CommonSH
logger = Logger()
commonsh = CommonSH('PrimaryDbUser')
class Guctestcase(unittest.TestCase):
def setUp(self):
... | true | true |
f7130df6ae5f73d9d9ed55e9e0eca965972ab216 | 12,178 | py | Python | liegroups/torch/se2.py | mttgdd/liegroups | ca637bd461300d70d70f90bff7a18462d06f5f82 | [
"MIT"
] | 1 | 2021-04-27T16:51:34.000Z | 2021-04-27T16:51:34.000Z | liegroups/torch/se2.py | mttgdd/liegroups | ca637bd461300d70d70f90bff7a18462d06f5f82 | [
"MIT"
] | null | null | null | liegroups/torch/se2.py | mttgdd/liegroups | ca637bd461300d70d70f90bff7a18462d06f5f82 | [
"MIT"
] | null | null | null | import torch
from . import _base
from . import utils
from .so2 import SO2Matrix
class SE2Matrix(_base.SEMatrixBase):
"""See :mod:`liegroups.SE2`"""
dim = 3
dof = 3
RotationType = SO2Matrix
def adjoint(self):
rot_part = self.rot.as_matrix()
if rot_part.dim() < 3:
rot_p... | 50.115226 | 589 | 0.629003 | import torch
from . import _base
from . import utils
from .so2 import SO2Matrix
class SE2Matrix(_base.SEMatrixBase):
dim = 3
dof = 3
RotationType = SO2Matrix
def adjoint(self):
rot_part = self.rot.as_matrix()
if rot_part.dim() < 3:
rot_part = rot_part.unsqueeze(dim=0)
... | true | true |
f7130f24fd401c265e56739ce8f20b9a6ec678b3 | 2,570 | py | Python | test/record/parser/test_response_whois_nic_net_ng_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_whois_nic_net_ng_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_whois_nic_net_ng_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.nic.net.ng/status_registered
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import pa... | 37.246377 | 87 | 0.682879 |
from nose.tools import *
from dateutil.parser import parse as time_parse
import yawhois
class TestWhoisNicNetNgStatusRegistered(object):
def setUp(self):
fixture_path = "spec/fixtures/responses/whois.nic.net.ng/status_registered.txt"
host = "whois.nic.net.ng"
part ... | true | true |
f713115af82b8a3380081f84bc46d6ef1f73dcd3 | 92,922 | py | Python | haros/extractor.py | git-afsantos/ecore | 39dc383741dc1d9ed33cb5dc41f94bd5ffd4d03d | [
"MIT"
] | null | null | null | haros/extractor.py | git-afsantos/ecore | 39dc383741dc1d9ed33cb5dc41f94bd5ffd4d03d | [
"MIT"
] | null | null | null | haros/extractor.py | git-afsantos/ecore | 39dc383741dc1d9ed33cb5dc41f94bd5ffd4d03d | [
"MIT"
] | null | null | null |
#Copyright (c) 2017 Andre Santos
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute... | 43.059314 | 170 | 0.549353 |
def _location_from_JSON(self, datum):
if datum is None:
return None
try:
pkg = self._get_package(datum["package"])
sf = None
filename = datum["file"]
if filename:
sf = self._get_files(pkg, [filename])[0]
... | true | true |
f71312233704eae50bc57397e9568504e17aef63 | 1,539 | py | Python | examples/node2vec_wiki.py | 1172939260/GE | df8bc2bb514b4f890764c26f3d36fad4c99de1cc | [
"MIT"
] | 3 | 2020-04-28T23:52:15.000Z | 2020-04-29T05:58:46.000Z | examples/node2vec_wiki.py | 1172939260/GE | df8bc2bb514b4f890764c26f3d36fad4c99de1cc | [
"MIT"
] | null | null | null | examples/node2vec_wiki.py | 1172939260/GE | df8bc2bb514b4f890764c26f3d36fad4c99de1cc | [
"MIT"
] | null | null | null |
import numpy as np
from ge.classify import read_node_label, Classifier
from ge import Node2Vec
from sklearn.linear_model import LogisticRegression
import matplotlib.pyplot as plt
import networkx as nx
from sklearn.manifold import TSNE
def evaluate_embeddings(embeddings):
X, Y = read_node_label('../data/wiki/wi... | 27.981818 | 96 | 0.658869 |
import numpy as np
from ge.classify import read_node_label, Classifier
from ge import Node2Vec
from sklearn.linear_model import LogisticRegression
import matplotlib.pyplot as plt
import networkx as nx
from sklearn.manifold import TSNE
def evaluate_embeddings(embeddings):
X, Y = read_node_label('../data/wiki/wi... | false | true |
f71312d595a0b97bd875bad604a1adfa9e461df1 | 652 | py | Python | runs/src2-tgt1/seq-bro-iter10000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/src2-tgt1/seq-bro-iter10000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/src2-tgt1/seq-bro-iter10000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null |
# Write results to this file
OUTFILE = 'runs/src2-tgt1/seq-bro-iter10000.result.csv'
# Source computers for the requests
SOURCE = ['10.0.0.1', '10.0.0.3']
# Should Bro be enabled on the source machines?
SOURCE_BRO = [True, True]
# Target machines for the requests (aka server)
TARGET = ['10.0.0.2']
# Should Bro be ... | 22.482759 | 68 | 0.716258 |
OUTFILE = 'runs/src2-tgt1/seq-bro-iter10000.result.csv'
SOURCE = ['10.0.0.1', '10.0.0.3']
SOURCE_BRO = [True, True]
TARGET = ['10.0.0.2']
TARGET_BRO = [True]
MODE = 'seq'
EPOCHS = 100
ITER = 10000
SIZE = 5
| true | true |
f713157fa8e0a5fb64ac7dc684b4acc75edad6c4 | 1,467 | py | Python | riptable/tests/test_scalar.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 307 | 2020-08-27T20:25:11.000Z | 2022-03-08T15:51:19.000Z | riptable/tests/test_scalar.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 206 | 2020-08-17T19:07:15.000Z | 2022-03-18T11:53:55.000Z | riptable/tests/test_scalar.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 10 | 2020-08-28T00:22:05.000Z | 2021-04-30T20:22:28.000Z | """Test around scalar constructors and scalar methods."""
import riptable as rt
import numpy as np
import pytest
from numpy.testing import assert_almost_equal, assert_warns
class TestScalarConstructor(object):
# Type-coercion from strings test cases adapted from numpy/core/tests/test_scalar_ctors.py.
... | 38.605263 | 121 | 0.630539 | import riptable as rt
import numpy as np
import pytest
from numpy.testing import assert_almost_equal, assert_warns
class TestScalarConstructor(object):
@pytest.mark.parametrize(
"scalar_ctor, numeric_string",
[
("single", "1.234"),
("doub... | true | true |
f71315f272ca0635af315b2525f676576c7255ad | 8,680 | py | Python | src/biokbase/narrative/jobs/specmanager.py | jmchandonia/narrative | 13895904956b31f2d51440d94473cd05ecca1e60 | [
"MIT"
] | null | null | null | src/biokbase/narrative/jobs/specmanager.py | jmchandonia/narrative | 13895904956b31f2d51440d94473cd05ecca1e60 | [
"MIT"
] | null | null | null | src/biokbase/narrative/jobs/specmanager.py | jmchandonia/narrative | 13895904956b31f2d51440d94473cd05ecca1e60 | [
"MIT"
] | null | null | null | import biokbase.narrative.clients as clients
from biokbase.narrative.app_util import (
app_version_tags,
check_tag,
app_param
)
import json
from jinja2 import Template
from IPython.display import HTML
class SpecManager(object):
__instance = None
app_specs = dict()
type_specs = dict()
def... | 33.003802 | 163 | 0.501152 | import biokbase.narrative.clients as clients
from biokbase.narrative.app_util import (
app_version_tags,
check_tag,
app_param
)
import json
from jinja2 import Template
from IPython.display import HTML
class SpecManager(object):
__instance = None
app_specs = dict()
type_specs = dict()
def... | true | true |
f713161df41c6eba642808b055946fa7241ef5ba | 397 | py | Python | digits/dataset/tasks/__init__.py | ojmakhura/DIGITS | f34e62c245054b51ea51fcb8949d2ca777f162d1 | [
"BSD-3-Clause"
] | null | null | null | digits/dataset/tasks/__init__.py | ojmakhura/DIGITS | f34e62c245054b51ea51fcb8949d2ca777f162d1 | [
"BSD-3-Clause"
] | null | null | null | digits/dataset/tasks/__init__.py | ojmakhura/DIGITS | f34e62c245054b51ea51fcb8949d2ca777f162d1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
from .analyze_db import AnalyzeDbTask
from .create_db import CreateDbTask
from .create_generic_db import CreateGenericDbTask
from .parse_folder import ParseFolderTask
from .parse_s3 import ParseS3Task
__all__ = [
'AnalyzeDbTask',
'CreateDbT... | 23.352941 | 68 | 0.768262 |
from .analyze_db import AnalyzeDbTask
from .create_db import CreateDbTask
from .create_generic_db import CreateGenericDbTask
from .parse_folder import ParseFolderTask
from .parse_s3 import ParseS3Task
__all__ = [
'AnalyzeDbTask',
'CreateDbTask',
'CreateGenericDbTask',
'ParseFolderTask',
'ParseS3... | true | true |
f713163dddd2cb0d284f77fcefb7c00d732eeea7 | 23,328 | py | Python | test/programytest/test_bot.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | null | null | null | test/programytest/test_bot.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | null | null | null | test/programytest/test_bot.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 4 | 2019-04-01T15:42:23.000Z | 2020-11-05T08:14:27.000Z | import unittest.mock
from programy.brain import Brain
from programy.bot import BrainFactory
from programy.bot import Bot
from programy.config.bot.bot import BotConfiguration
from programy.config.programy import ProgramyConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
from programy.... | 36.223602 | 136 | 0.70126 | import unittest.mock
from programy.brain import Brain
from programy.bot import BrainFactory
from programy.bot import Bot
from programy.config.bot.bot import BotConfiguration
from programy.config.programy import ProgramyConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
from programy.... | true | true |
f71319f1474558e7e18729692f7649c4143dd552 | 842 | py | Python | tsbot/exceptions.py | 0x4aK/TSBot | 21bee5e865d09f54907ab85092a632443d36c67d | [
"MIT"
] | null | null | null | tsbot/exceptions.py | 0x4aK/TSBot | 21bee5e865d09f54907ab85092a632443d36c67d | [
"MIT"
] | null | null | null | tsbot/exceptions.py | 0x4aK/TSBot | 21bee5e865d09f54907ab85092a632443d36c67d | [
"MIT"
] | null | null | null | class TSException(Exception):
"""Exception related to tsbot"""
class TSResponseError(TSException):
"""Raised when response from server has error_id set to other than 0."""
def __init__(self, message: str, error_id: int) -> None:
self.message = message
self.error_id = error_id
def __s... | 25.515152 | 76 | 0.693587 | class TSException(Exception):
class TSResponseError(TSException):
def __init__(self, message: str, error_id: int) -> None:
self.message = message
self.error_id = error_id
def __str__(self) -> str:
return f"Error {self.error_id}: {self.message}"
class TSCommandError(TSException):
... | true | true |
f7131aa149c22279c22f9be928455f06226e48b9 | 340 | py | Python | python/ray/tune/sklearn.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 3 | 2020-12-03T17:48:45.000Z | 2022-01-22T08:09:46.000Z | python/ray/tune/sklearn.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 84 | 2021-03-06T08:02:56.000Z | 2022-03-05T08:07:19.000Z | python/ray/tune/sklearn.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | import logging
logger = logging.getLogger(__name__)
TuneSearchCV = None
TuneGridSearchCV = None
try:
from tune_sklearn import TuneSearchCV, TuneGridSearchCV
except ImportError:
logger.info("tune_sklearn is not installed. Please run "
"`pip install tune-sklearn`.")
__all__ = ["TuneSearchCV", ... | 22.666667 | 60 | 0.735294 | import logging
logger = logging.getLogger(__name__)
TuneSearchCV = None
TuneGridSearchCV = None
try:
from tune_sklearn import TuneSearchCV, TuneGridSearchCV
except ImportError:
logger.info("tune_sklearn is not installed. Please run "
"`pip install tune-sklearn`.")
__all__ = ["TuneSearchCV", ... | true | true |
f7131bbbe72ac27eaf25a4616cb01b7766cbef5f | 384 | py | Python | code/pyorg/sub/__init__.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 12 | 2020-01-08T01:33:02.000Z | 2022-03-16T00:25:34.000Z | code/pyorg/sub/__init__.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 8 | 2019-12-19T19:34:56.000Z | 2022-03-10T10:11:28.000Z | code/pyorg/sub/__init__.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 2 | 2022-03-30T13:12:22.000Z | 2022-03-30T18:12:10.000Z | """
Set of specific utilities for combining PySeg with Subtomogram Averaging tools (PyTom)
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 1.06.16
"""
__author__ = 'Antonio Martinez-Sanchez'
from .plist import TomoPeaks, SetTomoPeaks, Score, SingleTiltWedge, Particle, ParticleList,... | 32 | 101 | 0.791667 |
__author__ = 'Antonio Martinez-Sanchez'
from .plist import TomoPeaks, SetTomoPeaks, Score, SingleTiltWedge, Particle, ParticleList, PK_COORDS
from .star import Star
from .fxml import XMLFilaments | true | true |
f7131bdfb085b62573918111bf7a6d147b3dfd6c | 41 | py | Python | scripts/portal/mayong.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/portal/mayong.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/portal/mayong.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Portal to Manon
sm.warp(240020401, 3)
| 10.25 | 21 | 0.707317 |
sm.warp(240020401, 3)
| true | true |
f7131beae338b89bfacfc9f18fedc0be60b81ab9 | 1,810 | py | Python | src/python/pants/backend/jvm/tasks/ivy_imports.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/ivy_imports.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/ivy_imports.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | 35.490196 | 98 | 0.722652 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.jvm.tasks.ivy_task_mixin import IvyTaskMixin
from pants.backend.jvm.tasks.nailgun_task import NailgunTask
class IvyImports(IvyTaskMixin, Nailg... | true | true |
f7131c248632a0b660c8fc2a29e3ea6a29d21a62 | 7,406 | py | Python | nodep-keytool.py | imaginal/dozorro-keytool | 863fc5c3d9cb2404ec0398e15bd041b2a5076126 | [
"Apache-2.0"
] | null | null | null | nodep-keytool.py | imaginal/dozorro-keytool | 863fc5c3d9cb2404ec0398e15bd041b2a5076126 | [
"Apache-2.0"
] | null | null | null | nodep-keytool.py | imaginal/dozorro-keytool | 863fc5c3d9cb2404ec0398e15bd041b2a5076126 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# pure python keytool
import os
import sys
import json
import base64
import hashlib
import datetime
assert sys.version_info < (3,0), "Python 2.7 required"
TZ = '+02:00'
b = 256
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493
def H(m):
return hashlib.sha512(m).digest()
def ... | 26.355872 | 92 | 0.569133 |
import os
import sys
import json
import base64
import hashlib
import datetime
assert sys.version_info < (3,0), "Python 2.7 required"
TZ = '+02:00'
b = 256
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493
def H(m):
return hashlib.sha512(m).digest()
def expmod(b,e,m):
if e == 0: return 1... | true | true |
f7131c47fe402b905f53f41cdbcbe559cb420314 | 756 | py | Python | src/scripts/eval/surface_distance/__init__.py | elitap/classimbalance | ae807ec533da5eef18f4180b29383399bc57696a | [
"Apache-2.0"
] | 1 | 2022-03-13T01:48:54.000Z | 2022-03-13T01:48:54.000Z | src/scripts/eval/surface_distance/__init__.py | elitap/classimbalance | ae807ec533da5eef18f4180b29383399bc57696a | [
"Apache-2.0"
] | null | null | null | src/scripts/eval/surface_distance/__init__.py | elitap/classimbalance | ae807ec533da5eef18f4180b29383399bc57696a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 42 | 77 | 0.753968 | true | true | |
f7131c78aa391ffbfd3f950556669abc142582fd | 2,062 | py | Python | Respaldo/package_robot/src/nodo_publisher.py | Tachuelin/RMA-Dedutel | 796add66dc20efe8205055a648c01a5a5de194ad | [
"MIT"
] | 1 | 2022-03-30T22:29:33.000Z | 2022-03-30T22:29:33.000Z | Respaldo/package_robot/src/nodo_publisher.py | Tachuelin/RMA-Dedutel | 796add66dc20efe8205055a648c01a5a5de194ad | [
"MIT"
] | null | null | null | Respaldo/package_robot/src/nodo_publisher.py | Tachuelin/RMA-Dedutel | 796add66dc20efe8205055a648c01a5a5de194ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
#Linea 1 - “Shebang”,le indicamos a la máquina con qué programa lo vamos a ejecutar.
#Linea 2 - Python 3 - asume que solo se utiliza ASCII en el código fuente
#para usar utf-8 hay que indicarlo al principio de nuestro script encoding: utf-8
... | 60.647059 | 132 | 0.509699 |
import rospy
from std_msgs.msg import String
def nodo():
rospy.init_node('nodo_publisher')
pub = rospy.Publisher('ex... | true | true |
f7131d94547f05290822d35deec65ccf383bab60 | 10,216 | py | Python | scripts/track_length_analysis_test.py | vik748/OpenSfM | bd949246e3e0d6d3a707a08224038034d27e3ee8 | [
"BSD-2-Clause"
] | null | null | null | scripts/track_length_analysis_test.py | vik748/OpenSfM | bd949246e3e0d6d3a707a08224038034d27e3ee8 | [
"BSD-2-Clause"
] | null | null | null | scripts/track_length_analysis_test.py | vik748/OpenSfM | bd949246e3e0d6d3a707a08224038034d27e3ee8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 19 08:11:51 2021
@author: vik748
"""
import json
import numpy as np
import matplotlib.pyplot as plt
import sys,os
import pandas as pd
def tracks_histogram(recon_file, tracks_file, ax, model_num=0, bins=np.linspace(2,15,14)):
'''
How the tra... | 38.844106 | 124 | 0.707224 |
import json
import numpy as np
import matplotlib.pyplot as plt
import sys,os
import pandas as pd
def tracks_histogram(recon_file, tracks_file, ax, model_num=0, bins=np.linspace(2,15,14)):
with open(recon_file) as f:
data = json.load(f)
if model_num == -1:
points_dict = {}
for d in da... | true | true |
f7131e8980207330c8d8d3873e5caa241cdfc2f1 | 770 | py | Python | ermaket/api/generation/templates/system_role.tmpl.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | ermaket/api/generation/templates/system_role.tmpl.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | ermaket/api/generation/templates/system_role.tmpl.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | import sqlalchemy as sa
from .base import Base
__all__ = ['Role']
class Role(Base):
__tablename__ = 'role'
__table_args__ = {'schema': 'system'}
name = sa.Column(sa.String(256), primary_key=True)
is_default = sa.Column(sa.Boolean(), default=False)
can_reset_password = sa.Column(sa.Boolean(), de... | 29.615385 | 73 | 0.698701 | import sqlalchemy as sa
from .base import Base
__all__ = ['Role']
class Role(Base):
__tablename__ = 'role'
__table_args__ = {'schema': 'system'}
name = sa.Column(sa.String(256), primary_key=True)
is_default = sa.Column(sa.Boolean(), default=False)
can_reset_password = sa.Column(sa.Boolean(), de... | true | true |
f7131eaf697fba50c2554c9390890aa774c78363 | 1,468 | py | Python | VrDemoServer/server.py | svdh2/SerceerVrDemo | 7ab3d5cfd5fc7d0bf51a281f51688b6ad5d273cb | [
"Apache-2.0"
] | null | null | null | VrDemoServer/server.py | svdh2/SerceerVrDemo | 7ab3d5cfd5fc7d0bf51a281f51688b6ad5d273cb | [
"Apache-2.0"
] | null | null | null | VrDemoServer/server.py | svdh2/SerceerVrDemo | 7ab3d5cfd5fc7d0bf51a281f51688b6ad5d273cb | [
"Apache-2.0"
] | null | null | null | from flask import Flask, send_from_directory
import os
import connexion
from connexion.resolver import RestyResolver
from flask_socketio import SocketIO, send, emit
# Constants
STATIC_FILES_DIR = 'static'
# The application server
app = connexion.FlaskApp(__name__, specification_dir='swagger/', resolver=RestyResolver(... | 28.784314 | 108 | 0.73297 | from flask import Flask, send_from_directory
import os
import connexion
from connexion.resolver import RestyResolver
from flask_socketio import SocketIO, send, emit
STATIC_FILES_DIR = 'static'
app = connexion.FlaskApp(__name__, specification_dir='swagger/', resolver=RestyResolver('VrDemoServer.api'))
flask_app = ap... | true | true |
f7131ec54add247122406a15a979f3b26c8c105a | 642 | py | Python | setup.py | adamzerella/is-natural-number | 584bc21a5d5d01ace31b9d94b44d32409dec233f | [
"MIT"
] | null | null | null | setup.py | adamzerella/is-natural-number | 584bc21a5d5d01ace31b9d94b44d32409dec233f | [
"MIT"
] | 2 | 2019-05-03T14:55:22.000Z | 2019-05-03T15:02:59.000Z | setup.py | adamzerella/is-natural-number | 584bc21a5d5d01ace31b9d94b44d32409dec233f | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="is-natural-number",
version="1.0.0",
author="Adam Zerella",
author_email="hello@adamzerella.com",
description="Check if a value is a natural number",
long_description=long_description,... | 30.571429 | 59 | 0.67134 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="is-natural-number",
version="1.0.0",
author="Adam Zerella",
author_email="hello@adamzerella.com",
description="Check if a value is a natural number",
long_description=long_description,... | true | true |
f7131f326b5d65183687dcd78a7d4976fa2b1ac7 | 37,927 | py | Python | Python/pywarpx/fields.py | prkkumar/WarpX | a83c9c03ecc9850cd724efc14075eb95ff8a6138 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-07-12T14:17:45.000Z | 2021-07-12T14:17:45.000Z | Python/pywarpx/fields.py | prkkumar/WarpX | a83c9c03ecc9850cd724efc14075eb95ff8a6138 | [
"BSD-3-Clause-LBNL"
] | null | null | null | Python/pywarpx/fields.py | prkkumar/WarpX | a83c9c03ecc9850cd724efc14075eb95ff8a6138 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-07-12T14:18:44.000Z | 2021-07-12T14:18:44.000Z | # Copyright 2017-2019 David Grote
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
"""Provides wrappers around field and current density on multiFABs
Available routines:
ExWrapper, EyWrapper, EzWrapper
BxWrapper, ByWrapper, BzWrapper
JxWrapper, JyWrapper, JzWrapper
"""
import numpy as np
try:
from... | 44.255543 | 102 | 0.580141 |
import numpy as np
try:
from mpi4py import MPI as mpi
comm_world = mpi.COMM_WORLD
npes = comm_world.Get_size()
except ImportError:
npes = 1
from . import _libwarpx
class _MultiFABWrapper(object):
def __init__(self, direction, get_lovects, get_fabs, get_nodal_flag, level, include_ghosts=Fals... | true | true |
f713205b80ac6e86e9fe43a9184bf463a0ecc8ca | 916 | py | Python | tests/memoize_test.py | silverbp/master-builder | 9a9a53f8286e31888aaaee0cf52b555f8d41ce41 | [
"Apache-2.0"
] | null | null | null | tests/memoize_test.py | silverbp/master-builder | 9a9a53f8286e31888aaaee0cf52b555f8d41ce41 | [
"Apache-2.0"
] | null | null | null | tests/memoize_test.py | silverbp/master-builder | 9a9a53f8286e31888aaaee0cf52b555f8d41ce41 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from mb.lib.memoize import memoize
class SomeClass:
def __init__(self):
self._x = 0
def _the_test(self, number):
self._x += 1
return number * self._x
@memoize
def TestCache1(self, number):
... | 25.444444 | 62 | 0.691048 | from __future__ import absolute_import
from __future__ import unicode_literals
from mb.lib.memoize import memoize
class SomeClass:
def __init__(self):
self._x = 0
def _the_test(self, number):
self._x += 1
return number * self._x
@memoize
def TestCache1(self, number):
... | true | true |
f71321067ba02bcf7949cc336b1f2f9ed37dd02d | 1,546 | py | Python | src/ssv/galah.py | einshoe/ssv-py | a13cdd05f695ec43cde4b4d2cbdaa2f97c98f497 | [
"MIT"
] | null | null | null | src/ssv/galah.py | einshoe/ssv-py | a13cdd05f695ec43cde4b4d2cbdaa2f97c98f497 | [
"MIT"
] | null | null | null | src/ssv/galah.py | einshoe/ssv-py | a13cdd05f695ec43cde4b4d2cbdaa2f97c98f497 | [
"MIT"
] | null | null | null | import astropy.io.fits as fits
from specutils import SpectrumList
from specutils.io.registers import data_loader
from .loaders import FITS_FILE_EXTS, SINGLE_SPLIT_LABEL
GALAH_CONFIG = {
"hdus": {
"0": {"purpose": "science"},
"1": {"purpose": "error_stdev"},
"2": {"purpose": "unreduced_scie... | 27.122807 | 65 | 0.635834 | import astropy.io.fits as fits
from specutils import SpectrumList
from specutils.io.registers import data_loader
from .loaders import FITS_FILE_EXTS, SINGLE_SPLIT_LABEL
GALAH_CONFIG = {
"hdus": {
"0": {"purpose": "science"},
"1": {"purpose": "error_stdev"},
"2": {"purpose": "unreduced_scie... | true | true |
f713218b3cfd005338a74b4f074bf114e52de19d | 1,732 | py | Python | python/dlbs/tests/test_config_caffe2.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | 123 | 2017-11-28T20:21:24.000Z | 2022-03-22T11:21:04.000Z | python/dlbs/tests/test_config_caffe2.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | 17 | 2018-01-05T00:05:13.000Z | 2020-09-18T05:12:45.000Z | python/dlbs/tests/test_config_caffe2.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | 48 | 2018-01-04T20:52:51.000Z | 2022-03-06T00:47:17.000Z | # (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# 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 appli... | 36.851064 | 89 | 0.714203 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import dlbs.tests.env
from dlbs.tests.test_config_base import ConfigTester
class TestConfigCaffe2(ConfigTester):
def __init__(self, *args, **kwargs):
ConfigTester._... | true | true |
f71321cb54f24fb37ffa31ae550fc9b5d0aa94b2 | 12,683 | py | Python | tensorflow_probability/python/distributions/skellam_test.py | brianwa84/probability | 6f8e78d859ac41170be5147c8c7bde54cc5aa83e | [
"Apache-2.0"
] | 1 | 2021-07-21T15:54:17.000Z | 2021-07-21T15:54:17.000Z | tensorflow_probability/python/distributions/skellam_test.py | brianwa84/probability | 6f8e78d859ac41170be5147c8c7bde54cc5aa83e | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/skellam_test.py | brianwa84/probability | 6f8e78d859ac41170be5147c8c7bde54cc5aa83e | [
"Apache-2.0"
] | 1 | 2020-10-19T11:24:40.000Z | 2020-10-19T11:24:40.000Z | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.883648 | 80 | 0.680754 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import stats
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import test_util
tfd = tfp.distribut... | true | true |
f713224a920d82d7746eced8e1f6f3c43bd3be3f | 4,883 | py | Python | app/main/views.py | hassan3111/Blog | 62c00a40b693e44f1c88369592172af5477dc50a | [
"MIT"
] | null | null | null | app/main/views.py | hassan3111/Blog | 62c00a40b693e44f1c88369592172af5477dc50a | [
"MIT"
] | null | null | null | app/main/views.py | hassan3111/Blog | 62c00a40b693e44f1c88369592172af5477dc50a | [
"MIT"
] | null | null | null | from flask import render_template,request,url_for,redirect,flash,abort
from . import main
from .forms import BlogForm, CommentForm, UpdateProfile
from ..models import User, Comment , Blog
from flask_login import login_required, current_user
from .. import db, photos
import datetime
from ..requests import getQuotes
@ma... | 30.329193 | 125 | 0.663936 | from flask import render_template,request,url_for,redirect,flash,abort
from . import main
from .forms import BlogForm, CommentForm, UpdateProfile
from ..models import User, Comment , Blog
from flask_login import login_required, current_user
from .. import db, photos
import datetime
from ..requests import getQuotes
@ma... | true | true |
f713226757312973811f9826adebc138f959eef3 | 18,112 | py | Python | __main__.py | ehrentim/Word-using-PySide2 | d1d7f3fb1113995c1ec7e05a9d9c17c5cc501efe | [
"MIT"
] | null | null | null | __main__.py | ehrentim/Word-using-PySide2 | d1d7f3fb1113995c1ec7e05a9d9c17c5cc501efe | [
"MIT"
] | null | null | null | __main__.py | ehrentim/Word-using-PySide2 | d1d7f3fb1113995c1ec7e05a9d9c17c5cc501efe | [
"MIT"
] | null | null | null | from PyQt5.QtGui import QImage, QTextDocument, QIcon, QKeySequence, QFont
from PyQt5.QtWidgets import QTextEdit, QApplication, QMainWindow, QAction, QMessageBox, QVBoxLayout, QWidget, \
QStatusBar, QToolBar, QFontComboBox, QComboBox, QActionGroup, QFileDialog, QColorDialog, QDialog, QStyle
from PyQt5.QtCore import ... | 40.701124 | 135 | 0.669943 | from PyQt5.QtGui import QImage, QTextDocument, QIcon, QKeySequence, QFont
from PyQt5.QtWidgets import QTextEdit, QApplication, QMainWindow, QAction, QMessageBox, QVBoxLayout, QWidget, \
QStatusBar, QToolBar, QFontComboBox, QComboBox, QActionGroup, QFileDialog, QColorDialog, QDialog, QStyle
from PyQt5.QtCore import ... | true | true |
f7132272a08ae3ff742cc72c8c3f38c04039858e | 16,593 | py | Python | tensorflow_model_optimization/python/core/quantization/keras/collaborative_optimizations/cluster_preserve/cluster_preserve_quantize_registry.py | Pandinosaurus/model-optimization | 12dc84dd34ee3c6eb08b381c0abcd65b31a42366 | [
"Apache-2.0"
] | 1,318 | 2018-10-31T23:57:52.000Z | 2022-03-30T11:07:40.000Z | tensorflow_model_optimization/python/core/quantization/keras/collaborative_optimizations/cluster_preserve/cluster_preserve_quantize_registry.py | Pandinosaurus/model-optimization | 12dc84dd34ee3c6eb08b381c0abcd65b31a42366 | [
"Apache-2.0"
] | 410 | 2019-05-15T14:11:13.000Z | 2022-03-31T07:27:07.000Z | tensorflow_model_optimization/python/core/quantization/keras/collaborative_optimizations/cluster_preserve/cluster_preserve_quantize_registry.py | Pandinosaurus/model-optimization | 12dc84dd34ee3c6eb08b381c0abcd65b31a42366 | [
"Apache-2.0"
] | 290 | 2019-05-14T17:42:49.000Z | 2022-03-28T02:21:45.000Z | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.760776 | 116 | 0.695474 |
import logging
import tensorflow as tf
from tensorflow_model_optimization.python.core.clustering.keras import clustering_registry
from tensorflow_model_optimization.python.core.quantization.keras import quant_ops
from tensorflow_model_optimization.python.core.quantization.keras import quantizers
from te... | true | true |
f71322a81de8147a42afd098b9ff1f141e46acd6 | 2,152 | py | Python | src/scs_psu/batt_pack/batt_pack_v1.py | south-coast-science/scs_psu | d8d5bf5b31833b33ae7d2aca268285f3cc2c6e62 | [
"MIT"
] | null | null | null | src/scs_psu/batt_pack/batt_pack_v1.py | south-coast-science/scs_psu | d8d5bf5b31833b33ae7d2aca268285f3cc2c6e62 | [
"MIT"
] | null | null | null | src/scs_psu/batt_pack/batt_pack_v1.py | south-coast-science/scs_psu | d8d5bf5b31833b33ae7d2aca268285f3cc2c6e62 | [
"MIT"
] | 1 | 2017-12-05T12:40:54.000Z | 2017-12-05T12:40:54.000Z | """
Created on 3 Oct 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
Used by version 1 Handhelds.
Tuned for 2 x Nitecore IMR 18650 (3.7 V, 3100 mAh)
https://www.nitecore.co.uk/Shop/Products/Batteries/13663-Nitecore-IMR-18650-Battery-for-TM28-Torch.html#Features
"""
import json
from scs_psu.batt_pac... | 29.479452 | 118 | 0.490706 |
import json
from scs_psu.batt_pack.batt_pack import BattPack
from scs_psu.batt_pack.fuel_gauge.max17055.max17055_config import Max17055Config
from scs_psu.batt_pack.fuel_gauge.max17055.max17055_params import Max17055Params
class BattPackV1(BattPack):
__CHARGE_MINIMUM = 1
__DEFAULT_PARAM... | true | true |
f71322b77a9edd885d7cb35ba9a4009a8a226f25 | 960 | py | Python | Playground3/src/playground/network/packet/encoders/PlaygroundFramingPacketEncoder.py | kandarpck/networksecurity2018 | dafe2ee8d39bd9596b1ce3fbc8b50ca645bcd626 | [
"MIT"
] | 3 | 2018-10-25T16:03:53.000Z | 2019-06-13T15:24:41.000Z | Playground3/src/playground/network/packet/encoders/PlaygroundFramingPacketEncoder.py | kandarpck/networksecurity2018 | dafe2ee8d39bd9596b1ce3fbc8b50ca645bcd626 | [
"MIT"
] | null | null | null | Playground3/src/playground/network/packet/encoders/PlaygroundFramingPacketEncoder.py | kandarpck/networksecurity2018 | dafe2ee8d39bd9596b1ce3fbc8b50ca645bcd626 | [
"MIT"
] | null | null | null | '''
Created on Oct 11, 2017
@author: seth_
'''
from .PlaygroundStandardPacketEncoder import PlaygroundStandardPacketEncoder, PacketEncoder
from .PacketFramingStream import PacketFramingStreamAdapter
class PlaygroundFramingPacketEncoder(PlaygroundStandardPacketEncoder):
def encode(self, stream, fieldType)... | 40 | 92 | 0.696875 | from .PlaygroundStandardPacketEncoder import PlaygroundStandardPacketEncoder, PacketEncoder
from .PacketFramingStream import PacketFramingStreamAdapter
class PlaygroundFramingPacketEncoder(PlaygroundStandardPacketEncoder):
def encode(self, stream, fieldType):
typeEncoder = self.GetTypeEncoder(fieldTyp... | true | true |
f71322f749c42287b9d7de83530abd932b395670 | 10,558 | py | Python | zerver/tornado/handlers.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | 1 | 2020-03-19T00:52:48.000Z | 2020-03-19T00:52:48.000Z | zerver/tornado/handlers.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/tornado/handlers.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | 1 | 2020-04-21T01:26:54.000Z | 2020-04-21T01:26:54.000Z | import logging
import urllib
from typing import Any, Dict, List
import tornado.web
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.handlers.wsgi import WSGIRequest, get_script_name
from django.urls import set_script_prefix
from django.http import HttpReque... | 43.093878 | 95 | 0.664709 | import logging
import urllib
from typing import Any, Dict, List
import tornado.web
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.handlers.wsgi import WSGIRequest, get_script_name
from django.urls import set_script_prefix
from django.http import HttpReque... | true | true |
f713234cf5323ddeca5b16c10a9bfe6c3782f073 | 627 | py | Python | backend/manage.py | crowdbotics-dev/adv-1-2 | 7aea5a8846c4b0ae9e6ba70313cb71a9df7b929f | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-dev/adv-1-2 | 7aea5a8846c4b0ae9e6ba70313cb71a9df7b929f | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-dev/adv-1-2 | 7aea5a8846c4b0ae9e6ba70313cb71a9df7b929f | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'adv_1_2.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'adv_1_2.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f713239c29f8472c0247eb27dc414179f318fc7c | 2,259 | py | Python | examples/batchMode/runBatchK6.py | lammySup/ncscli | 1758b7c894f2b890c7462d63a9c46ce47bf1262b | [
"MIT"
] | null | null | null | examples/batchMode/runBatchK6.py | lammySup/ncscli | 1758b7c894f2b890c7462d63a9c46ce47bf1262b | [
"MIT"
] | null | null | null | examples/batchMode/runBatchK6.py | lammySup/ncscli | 1758b7c894f2b890c7462d63a9c46ce47bf1262b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import datetime
import logging
import os
import subprocess
import sys
import ncscli.batchRunner as batchRunner
class k6FrameProcessor(batchRunner.frameProcessor):
'''defines details for using k6 for a simplistic load test'''
def installerCmd( self ):
return 'tar -vzxf k6Worker... | 32.73913 | 99 | 0.653829 |
import datetime
import logging
import os
import subprocess
import sys
import ncscli.batchRunner as batchRunner
class k6FrameProcessor(batchRunner.frameProcessor):
def installerCmd( self ):
return 'tar -vzxf k6Worker/k6.tar.gz; ls -al k6Worker'
def frameOutFileName( self, frameNum ):
return... | true | true |
f71324dfaa63416bbf64be7b19dd844864849f91 | 6,040 | py | Python | axi-graphics-core/cl_display_test_pattern.py | cospan/pynq-projects | cfa3c401673805beaa82cb94121a30d00e108e3e | [
"MIT"
] | null | null | null | axi-graphics-core/cl_display_test_pattern.py | cospan/pynq-projects | cfa3c401673805beaa82cb94121a30d00e108e3e | [
"MIT"
] | null | null | null | axi-graphics-core/cl_display_test_pattern.py | cospan/pynq-projects | cfa3c401673805beaa82cb94121a30d00e108e3e | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Copyright (c) 2021 Dave McCoy (dave.mccoy@cospandesign.com)
#
# NAME 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 License, or
# any later version.
#
# NAME... | 33.743017 | 98 | 0.664238 |
import sys
import os
import argparse
import warnings
import time
from pynq import PL
from pynq import Overlay
from pynq.lib.video import *
from pynq.lib.video.hierarchies import *
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
from drivers.video_mixer import VideoMixer
from drive... | true | true |
f71325a3ea894d6c864be41df09c1683f96d26f8 | 1,052 | py | Python | environments/template_test.py | lavanyashukla/ml-fairness-gym | fb68b379d4284b7af746b2a051d518b3bd45ab00 | [
"Apache-2.0"
] | null | null | null | environments/template_test.py | lavanyashukla/ml-fairness-gym | fb68b379d4284b7af746b2a051d518b3bd45ab00 | [
"Apache-2.0"
] | null | null | null | environments/template_test.py | lavanyashukla/ml-fairness-gym | fb68b379d4284b7af746b2a051d518b3bd45ab00 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The ML Fairness Gym Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.057143 | 74 | 0.78327 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
import test_util
from environments import template
class TemplateTest(absltest.TestCase):
def test_example_environment_can_run(self):
test_util.run_tes... | true | true |
f713270aa0014ff12f937841b5f52db6c244f221 | 3,484 | py | Python | djangocms_text_ckeditor/utils.py | ScholzVolkmer/djangocms-text-ckeditor | f904b09f5a0080458edc1f14de29d67f51d2e2c5 | [
"BSD-3-Clause"
] | 1 | 2017-05-12T06:24:24.000Z | 2017-05-12T06:24:24.000Z | djangocms_text_ckeditor/utils.py | timgraham/djangocms-text-ckeditor | c2fba71969ab12a521bf15af93035a1b13892191 | [
"BSD-3-Clause"
] | null | null | null | djangocms_text_ckeditor/utils.py | timgraham/djangocms-text-ckeditor | c2fba71969ab12a521bf15af93035a1b13892191 | [
"BSD-3-Clause"
] | null | null | null | import re
from django.template.defaultfilters import force_escape
import django
from cms.models import CMSPlugin
from cms.plugins.utils import downcast_plugins
from distutils.version import LooseVersion
from django.utils.functional import LazyObject
from django.core.files.storage import get_storage_class
import os
OB... | 37.462366 | 111 | 0.679392 | import re
from django.template.defaultfilters import force_escape
import django
from cms.models import CMSPlugin
from cms.plugins.utils import downcast_plugins
from distutils.version import LooseVersion
from django.utils.functional import LazyObject
from django.core.files.storage import get_storage_class
import os
OB... | true | true |
f713279f339de53315b9bedd03943a57f87d6559 | 1,537 | py | Python | nets/classifiernet.py | Luciano233/OCR_Japanease | 055bdd0cc8e4d053dfb471cd642b1616ba0938d1 | [
"MIT"
] | 1 | 2021-03-15T02:57:21.000Z | 2021-03-15T02:57:21.000Z | nets/classifiernet.py | Luciano233/OCR_Japanease | 055bdd0cc8e4d053dfb471cd642b1616ba0938d1 | [
"MIT"
] | null | null | null | nets/classifiernet.py | Luciano233/OCR_Japanease | 055bdd0cc8e4d053dfb471cd642b1616ba0938d1 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from .block import Mish, SeparableConv2d, Block
class WideTipXception(nn.Module):
def __init__(self, num_class):
super(WideTipXception, self).__init__()
self.conv1 = nn.Conv2d(1, 192, 3, 2, 1, bias=True)
self.bn1 = nn.Batc... | 26.5 | 78 | 0.570592 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .block import Mish, SeparableConv2d, Block
class WideTipXception(nn.Module):
def __init__(self, num_class):
super(WideTipXception, self).__init__()
self.conv1 = nn.Conv2d(1, 192, 3, 2, 1, bias=True)
self.bn1 = nn.Batc... | true | true |
f71327a3a8d91361d562cf3cb209adc3828acd01 | 122 | py | Python | sub_call/file_call.py | jyhh1992/test_algorithm | 1e6ec7dbdd6881f0c60fbf7c6d7d6f8f4a5b2168 | [
"Apache-2.0"
] | null | null | null | sub_call/file_call.py | jyhh1992/test_algorithm | 1e6ec7dbdd6881f0c60fbf7c6d7d6f8f4a5b2168 | [
"Apache-2.0"
] | null | null | null | sub_call/file_call.py | jyhh1992/test_algorithm | 1e6ec7dbdd6881f0c60fbf7c6d7d6f8f4a5b2168 | [
"Apache-2.0"
] | null | null | null | class response():
def __init__(self) -> None:
self.num = 5
def call_result(self):
return(self.num) | 24.4 | 31 | 0.581967 | class response():
def __init__(self) -> None:
self.num = 5
def call_result(self):
return(self.num) | true | true |
f71327e11b6b984a1e61a91092f5d829f200915d | 4,572 | py | Python | InLine_Implementation/Code/utils/fftutils.py | HMS-CardiacMR/MyoMapNet-Myocardial-Parametric-Mapping | 1e2dee8d6d1f97722eba91618462537faf9efba7 | [
"MIT"
] | 4 | 2021-12-15T22:57:44.000Z | 2022-03-18T14:02:15.000Z | InLine_Implementation/Code/utils/fftutils.py | HMS-CardiacMR/MyoMapNet | 1e2dee8d6d1f97722eba91618462537faf9efba7 | [
"MIT"
] | null | null | null | InLine_Implementation/Code/utils/fftutils.py | HMS-CardiacMR/MyoMapNet | 1e2dee8d6d1f97722eba91618462537faf9efba7 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
################################################################################
################################################################################
def roll_nn(X... | 36 | 105 | 0.506124 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
| true | true |
f71328387c1b0d3869902786c8e5c2618cf07880 | 30 | py | Python | mysql-utilities-1.6.0/mysql/utilities/command/__init__.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | 2 | 2018-03-20T07:42:58.000Z | 2018-03-20T07:43:49.000Z | mysql-utilities-1.6.0/mysql/utilities/command/__init__.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | null | null | null | mysql-utilities-1.6.0/mysql/utilities/command/__init__.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | 1 | 2020-07-23T23:07:08.000Z | 2020-07-23T23:07:08.000Z | """mysql.utilities.command"""
| 15 | 29 | 0.7 | true | true | |
f7132c280ff6ae8c29cb3a2ef4deefb0f5dd9c3c | 7,980 | py | Python | deep-coref/modified_keras/examples/babi_memnn.py | natemalek/molen-pater-nathan-rma-thesis-coreference-with-singletons | 3d2d6c751eadd6438a80b0c24f48b2635bc6acc7 | [
"MIT"
] | null | null | null | deep-coref/modified_keras/examples/babi_memnn.py | natemalek/molen-pater-nathan-rma-thesis-coreference-with-singletons | 3d2d6c751eadd6438a80b0c24f48b2635bc6acc7 | [
"MIT"
] | null | null | null | deep-coref/modified_keras/examples/babi_memnn.py | natemalek/molen-pater-nathan-rma-thesis-coreference-with-singletons | 3d2d6c751eadd6438a80b0c24f48b2635bc6acc7 | [
"MIT"
] | null | null | null | from __future__ import print_function
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers.core import Activation, Dense, Merge, Permute, Dropout
from keras.layers.recurrent import LSTM
from keras.datasets.data_utils import get_file
from keras.preprocessing.sequence import... | 39.310345 | 124 | 0.686967 | from __future__ import print_function
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers.core import Activation, Dense, Merge, Permute, Dropout
from keras.layers.recurrent import LSTM
from keras.datasets.data_utils import get_file
from keras.preprocessing.sequence import... | true | true |
f7132cb4f7b81dafa54bd9ae118292ec0f392074 | 4,254 | py | Python | scripts/poincare_embeddings.py | TatsuyaShirakawa/torchemb | b72912c7602537f368c16fdeb2bb6cf177b742be | [
"MIT"
] | null | null | null | scripts/poincare_embeddings.py | TatsuyaShirakawa/torchemb | b72912c7602537f368c16fdeb2bb6cf177b742be | [
"MIT"
] | null | null | null | scripts/poincare_embeddings.py | TatsuyaShirakawa/torchemb | b72912c7602537f368c16fdeb2bb6cf177b742be | [
"MIT"
] | null | null | null | '''
A rouch implementation of the following paper
M. Nickel+, "Poincaré Embeddings for Learning Hierarchical Representations", NeurIPS2017
https://arxiv.org/pdf/1705.08039.pdf
'''
import argparse
from pathlib import Path
import itertools
import math
import numpy as np
import torch
import torch.nn as nn
import torch.op... | 34.306452 | 96 | 0.665021 | import argparse
from pathlib import Path
import itertools
import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import (IterableDataset,
RandomSampler,
DataLoader)
from gensim.corpora import Diction... | true | true |
f7132ceacb5dfc263c1fab22584dd1657361891e | 1,945 | py | Python | setup.py | gaohao95/boxtree | eb98de195d013d0fb44a51f54440e410c6a5f28e | [
"MIT"
] | null | null | null | setup.py | gaohao95/boxtree | eb98de195d013d0fb44a51f54440e410c6a5f28e | [
"MIT"
] | null | null | null | setup.py | gaohao95/boxtree | eb98de195d013d0fb44a51f54440e410c6a5f28e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
from setuptools import setup
version_dict = {}
init_filename = "boxtree/version.py"
exec(compile(open(init_filename, "r").read(), init_filename, "exec"),
version_dict)
setup(name="boxtree",
version=version_dict["VERS... | 35.363636 | 75 | 0.524936 |
def main():
from setuptools import setup
version_dict = {}
init_filename = "boxtree/version.py"
exec(compile(open(init_filename, "r").read(), init_filename, "exec"),
version_dict)
setup(name="boxtree",
version=version_dict["VERSION_TEXT"],
description="Quadtree/... | true | true |
f7132d45a987ba9b8b9c96fec4b274ea0d56ed63 | 10,668 | py | Python | shamrock/full_node/coin_store.py | WarutaShinken/shamrock-blockchain | f457d5868f7cebfba08c63bd4a5b30c64d5400e2 | [
"Apache-2.0"
] | 3 | 2022-02-10T09:46:23.000Z | 2022-03-22T17:10:50.000Z | shamrock/full_node/coin_store.py | WarutaShinken/shamrock-blockchain | f457d5868f7cebfba08c63bd4a5b30c64d5400e2 | [
"Apache-2.0"
] | null | null | null | shamrock/full_node/coin_store.py | WarutaShinken/shamrock-blockchain | f457d5868f7cebfba08c63bd4a5b30c64d5400e2 | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional
import aiosqlite
from shamrock.types.blockchain_format.coin import Coin
from shamrock.types.blockchain_format.sized_bytes import bytes32
from shamrock.types.coin_record import CoinRecord
from shamrock.types.full_block import FullBlock
from shamrock.util.db_wrapper import DBWrapper
fr... | 40.256604 | 118 | 0.61033 | from typing import List, Optional
import aiosqlite
from shamrock.types.blockchain_format.coin import Coin
from shamrock.types.blockchain_format.sized_bytes import bytes32
from shamrock.types.coin_record import CoinRecord
from shamrock.types.full_block import FullBlock
from shamrock.util.db_wrapper import DBWrapper
fr... | true | true |
f7132de250a1f4a5553418e21c992ffefe85e308 | 2,512 | py | Python | app.py | kbots-dga/ml_classificator | 0163141de7389825787b9813019582be98d0f266 | [
"MIT"
] | null | null | null | app.py | kbots-dga/ml_classificator | 0163141de7389825787b9813019582be98d0f266 | [
"MIT"
] | null | null | null | app.py | kbots-dga/ml_classificator | 0163141de7389825787b9813019582be98d0f266 | [
"MIT"
] | null | null | null | import streamlit as st
import plotly.express as px
import pandas as pd
import pickle
import os
import base64
from io import BytesIO
from datetime import datetime
def to_excel(df):
output = BytesIO()
writer = pd.ExcelWriter(output, engine='xlsxwriter')
df.to_excel(writer, index=False, sheet_name='Sheet1')
... | 29.552941 | 136 | 0.624602 | import streamlit as st
import plotly.express as px
import pandas as pd
import pickle
import os
import base64
from io import BytesIO
from datetime import datetime
def to_excel(df):
output = BytesIO()
writer = pd.ExcelWriter(output, engine='xlsxwriter')
df.to_excel(writer, index=False, sheet_name='Sheet1')
... | true | true |
f7132e458a9d4d5d360b91406043e6027eff5c5e | 6,334 | py | Python | frameworks/cassandra/tests/test_toggle_tls.py | ankitcid/dcos-commons | 6804670110a9db01a7414f1c2abc2a35d9d7433d | [
"Apache-2.0"
] | 201 | 2016-06-02T21:07:21.000Z | 2021-03-31T06:15:37.000Z | frameworks/cassandra/tests/test_toggle_tls.py | ankitcid/dcos-commons | 6804670110a9db01a7414f1c2abc2a35d9d7433d | [
"Apache-2.0"
] | 1,679 | 2016-06-06T17:32:26.000Z | 2021-04-30T20:44:30.000Z | frameworks/cassandra/tests/test_toggle_tls.py | ankitcid/dcos-commons | 6804670110a9db01a7414f1c2abc2a35d9d7433d | [
"Apache-2.0"
] | 231 | 2016-06-09T21:40:22.000Z | 2022-02-14T13:41:44.000Z | import json
import logging
import pytest
import tempfile
from typing import Any, Dict, Iterator, Optional
import sdk_cmd
import sdk_install
import sdk_jobs
import sdk_plan
import sdk_utils
from security import transport_encryption
from tests import config
log = logging.getLogger(__name__)
@pytest.fixture(scope="m... | 31.829146 | 96 | 0.72324 | import json
import logging
import pytest
import tempfile
from typing import Any, Dict, Iterator, Optional
import sdk_cmd
import sdk_install
import sdk_jobs
import sdk_plan
import sdk_utils
from security import transport_encryption
from tests import config
log = logging.getLogger(__name__)
@pytest.fixture(scope="m... | true | true |
f7132e9e350404c280534cd2d05734b0b318e638 | 1,068 | py | Python | Python/FrequencyQueries.py | theolamide/Whiteboard | 46f31bdea99cacedf32e817cc281ce46be7993b1 | [
"MIT"
] | 1 | 2021-12-22T08:05:07.000Z | 2021-12-22T08:05:07.000Z | Python/FrequencyQueries.py | theolamide/Whiteboard | 46f31bdea99cacedf32e817cc281ce46be7993b1 | [
"MIT"
] | null | null | null | Python/FrequencyQueries.py | theolamide/Whiteboard | 46f31bdea99cacedf32e817cc281ce46be7993b1 | [
"MIT"
] | 1 | 2021-12-22T08:05:01.000Z | 2021-12-22T08:05:01.000Z |
def frequencyQueries(queries):
collection = {}
cumOperationThree = []
for i in range(0, len(queries)):
operation = queries[i][0]
numToAdd = queries[i][1]
if operation == 1:
if numToAdd in collection.keys():
collection[numToAdd] += 1
else:
... | 28.105263 | 74 | 0.495318 |
def frequencyQueries(queries):
collection = {}
cumOperationThree = []
for i in range(0, len(queries)):
operation = queries[i][0]
numToAdd = queries[i][1]
if operation == 1:
if numToAdd in collection.keys():
collection[numToAdd] += 1
else:
... | true | true |
f7132ed83fc85ba948e63176cacdb8b29b6e17be | 10,954 | py | Python | src/physlearn/apis/data.py | yyLabPhysAI/PhysioLearn | 673057a15397d7defaf55afd6e657418c314bf29 | [
"MIT"
] | null | null | null | src/physlearn/apis/data.py | yyLabPhysAI/PhysioLearn | 673057a15397d7defaf55afd6e657418c314bf29 | [
"MIT"
] | null | null | null | src/physlearn/apis/data.py | yyLabPhysAI/PhysioLearn | 673057a15397d7defaf55afd6e657418c314bf29 | [
"MIT"
] | null | null | null | from datetime import timedelta
from typing import Any, Dict, Optional, Sequence
from physlearn.names import DataBaseName, LabelType, NonSignalDataType, SignalType
from physlearn.typing import Array
class Signal:
"""A signal base class.
Args:
start_time: The time from the beginning of the record until ... | 31.297143 | 88 | 0.588643 | from datetime import timedelta
from typing import Any, Dict, Optional, Sequence
from physlearn.names import DataBaseName, LabelType, NonSignalDataType, SignalType
from physlearn.typing import Array
class Signal:
def __init__(
self,
start_time: timedelta,
end_time: timedelta,
time... | true | true |
f7132fcc5154c094edb08528aee9897931ed3af6 | 4,167 | py | Python | legacy/legacy_scripts/legacy/.ipynb_checkpoints/train_and_predict-checkpoint.py | tomkimpson/ML4L | ffa8360cb80df25bd6af4fa5cc39b42bd6f405cd | [
"MIT"
] | 1 | 2022-02-23T12:31:56.000Z | 2022-02-23T12:31:56.000Z | legacy/legacy_scripts/legacy/train_and_predict.py | tomkimpson/ML4L | ffa8360cb80df25bd6af4fa5cc39b42bd6f405cd | [
"MIT"
] | null | null | null | legacy/legacy_scripts/legacy/train_and_predict.py | tomkimpson/ML4L | ffa8360cb80df25bd6af4fa5cc39b42bd6f405cd | [
"MIT"
] | null | null | null |
import tensorflow as tf
import os
import time
import json
import pandas as pd
"""
Script to train a sequential NN.
Takes a df, filters based on `condition` (default None), and separates into test/train based on time
NN trains on training data, all results output to disk
"""
def train_test_split(df,filter_cond... | 24.511765 | 139 | 0.673146 |
import tensorflow as tf
import os
import time
import json
import pandas as pd
def train_test_split(df,filter_condition,train_condition, test_condition,features,targets):
if filter_condition is not None:
df_filtered = df.query(filter_condition)
else:
df_filtered = df... | true | true |
f713300b9992391c3e0a6ac558494cbba6e196e4 | 210 | py | Python | vmraid/patches/v11_0/set_allow_self_approval_in_workflow.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | vmraid/patches/v11_0/set_allow_self_approval_in_workflow.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | vmraid/patches/v11_0/set_allow_self_approval_in_workflow.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import vmraid
def execute():
vmraid.reload_doc("workflow", "doctype", "workflow_transition")
vmraid.db.sql("update `tabWorkflow Transition` set allow_self_approval=1") | 35 | 75 | 0.804762 | from __future__ import unicode_literals
import vmraid
def execute():
vmraid.reload_doc("workflow", "doctype", "workflow_transition")
vmraid.db.sql("update `tabWorkflow Transition` set allow_self_approval=1") | true | true |
f713308df62e103bc3e47579221d1124cb26c36b | 283 | py | Python | changelogs/custom/pypi/synapse.py | chris48s/changelogs | 0cdb929ac4546c766cd7eef9ae4eb4baaa08f452 | [
"MIT"
] | null | null | null | changelogs/custom/pypi/synapse.py | chris48s/changelogs | 0cdb929ac4546c766cd7eef9ae4eb4baaa08f452 | [
"MIT"
] | null | null | null | changelogs/custom/pypi/synapse.py | chris48s/changelogs | 0cdb929ac4546c766cd7eef9ae4eb4baaa08f452 | [
"MIT"
] | null | null | null |
def get_urls(releases, **kwargs):
# Pypi has a old bugtracker_url which points to a separate repo which causes invalid
# changelogs to be generated by this tool.
ret = {'https://raw.githubusercontent.com/vertexproject/synapse/master/CHANGELOG.md'}
return ret, set()
| 40.428571 | 89 | 0.731449 |
def get_urls(releases, **kwargs):
ret = {'https://raw.githubusercontent.com/vertexproject/synapse/master/CHANGELOG.md'}
return ret, set()
| true | true |
f7133143178ae049ac04338def1aceda35897e77 | 30,828 | py | Python | tornado/test/simple_httpclient_test.py | dylanninin/tornado | d4094a0c2a7cddc654381c162ee7786d4bf8453b | [
"Apache-2.0"
] | null | null | null | tornado/test/simple_httpclient_test.py | dylanninin/tornado | d4094a0c2a7cddc654381c162ee7786d4bf8453b | [
"Apache-2.0"
] | null | null | null | tornado/test/simple_httpclient_test.py | dylanninin/tornado | d4094a0c2a7cddc654381c162ee7786d4bf8453b | [
"Apache-2.0"
] | 1 | 2017-09-20T12:24:11.000Z | 2017-09-20T12:24:11.000Z | from __future__ import absolute_import, division, print_function
import collections
from contextlib import closing
import errno
import gzip
import logging
import os
import re
import socket
import ssl
import sys
from tornado.escape import to_unicode
from tornado import gen
from tornado.httpclient import AsyncHTTPClien... | 39.573813 | 107 | 0.628941 | from __future__ import absolute_import, division, print_function
import collections
from contextlib import closing
import errno
import gzip
import logging
import os
import re
import socket
import ssl
import sys
from tornado.escape import to_unicode
from tornado import gen
from tornado.httpclient import AsyncHTTPClien... | true | true |
f7133411d75ea8e033b78d05fd2b2299db201971 | 634 | py | Python | setup.py | infolabs/django-osme | c0cf7c15dee2b16454461a41316acae2f7c50004 | [
"MIT"
] | null | null | null | setup.py | infolabs/django-osme | c0cf7c15dee2b16454461a41316acae2f7c50004 | [
"MIT"
] | null | null | null | setup.py | infolabs/django-osme | c0cf7c15dee2b16454461a41316acae2f7c50004 | [
"MIT"
] | 1 | 2022-03-02T07:05:13.000Z | 2022-03-02T07:05:13.000Z | from setuptools import setup, find_packages
setup(
name='django-osme',
version=__import__('osme').__version__,
packages=find_packages(),
zip_safe=False,
install_requires=[
'Django>=1.9.8',
'requests>=2.23.0',
'jsonfield>=2.1.1',
],
package_data={
'osme': [
... | 22.642857 | 45 | 0.544164 | from setuptools import setup, find_packages
setup(
name='django-osme',
version=__import__('osme').__version__,
packages=find_packages(),
zip_safe=False,
install_requires=[
'Django>=1.9.8',
'requests>=2.23.0',
'jsonfield>=2.1.1',
],
package_data={
'osme': [
... | true | true |
f713341ad8ffade2c6c67269c5af51a3bcca148b | 2,431 | py | Python | database.py | wonabru/chainnet | f8ec1e2b580af837cba3322ffe69b95156b1b9a1 | [
"MIT"
] | 5 | 2019-04-20T18:54:55.000Z | 2019-08-23T09:17:20.000Z | database.py | wonabru/chainnet | f8ec1e2b580af837cba3322ffe69b95156b1b9a1 | [
"MIT"
] | null | null | null | database.py | wonabru/chainnet | f8ec1e2b580af837cba3322ffe69b95156b1b9a1 | [
"MIT"
] | null | null | null | from sqllite import CDataBase as sqllite
from kademliaGetSet import CDataBase
import socket
from isolated_functions import *
instance_kade = None
class CSQLLite():
def __init__(self):
global instance_kade
if instance_kade is None:
node_identifier = socket.gethostbyname(socket.gethostn... | 31.571429 | 128 | 0.570136 | from sqllite import CDataBase as sqllite
from kademliaGetSet import CDataBase
import socket
from isolated_functions import *
instance_kade = None
class CSQLLite():
def __init__(self):
global instance_kade
if instance_kade is None:
node_identifier = socket.gethostbyname(socket.gethostn... | true | true |
f713343ad94a8a8448103b68c5a6b512da27982a | 1,545 | py | Python | src/utils/solvers.py | paul-ang/nas-segm-pytorch | e83704b6cdac6426d6ee51059f82cf650238677c | [
"BSD-2-Clause"
] | 155 | 2019-06-16T03:30:49.000Z | 2022-03-17T06:07:33.000Z | src/utils/solvers.py | paul-ang/nas-segm-pytorch | e83704b6cdac6426d6ee51059f82cf650238677c | [
"BSD-2-Clause"
] | 7 | 2019-06-17T03:26:49.000Z | 2020-05-24T00:49:17.000Z | src/utils/solvers.py | paul-ang/nas-segm-pytorch | e83704b6cdac6426d6ee51059f82cf650238677c | [
"BSD-2-Clause"
] | 29 | 2019-06-23T07:18:44.000Z | 2022-03-17T06:07:34.000Z | """Initialising Optimisers"""
import torch
def create_optimisers(
optim_enc,
optim_dec,
lr_enc,
lr_dec,
mom_enc,
mom_dec,
wd_enc,
wd_dec,
param_enc,
param_dec,
):
"""Create optimisers for encoder, decoder
Args:
optim_enc (str) : type of optimiser for encoder
... | 29.150943 | 79 | 0.650485 |
import torch
def create_optimisers(
optim_enc,
optim_dec,
lr_enc,
lr_dec,
mom_enc,
mom_dec,
wd_enc,
wd_dec,
param_enc,
param_dec,
):
if optim_enc == "sgd":
optim_enc = torch.optim.SGD(
param_enc, lr=lr_enc, momentum=mom_enc, weight_decay=wd_enc
... | true | true |
f71334a6c255d3ef0f685aa8bc1c31bfe8861d8c | 4,301 | py | Python | IPython/frontend/qt/console/tests/test_ansi_code_processor.py | tinyclues/ipython | 71e32606b0242772b81c9be0d40751ba47d95f2c | [
"BSD-3-Clause-Clear"
] | 2 | 2015-04-21T12:12:43.000Z | 2015-04-21T12:12:54.000Z | IPython/frontend/qt/console/tests/test_ansi_code_processor.py | adgaudio/ipython | a924f50c0f7b84127391f1c396326258c2b303e2 | [
"BSD-3-Clause-Clear"
] | 1 | 2015-07-16T22:26:53.000Z | 2015-07-16T22:26:53.000Z | IPython/frontend/qt/console/tests/test_ansi_code_processor.py | adgaudio/ipython | a924f50c0f7b84127391f1c396326258c2b303e2 | [
"BSD-3-Clause-Clear"
] | null | null | null | # Standard library imports
import unittest
# Local imports
from IPython.frontend.qt.console.ansi_code_processor import AnsiCodeProcessor
class TestAnsiCodeProcessor(unittest.TestCase):
def setUp(self):
self.processor = AnsiCodeProcessor()
def test_clear(self):
""" Do control sequences for c... | 39.824074 | 77 | 0.581958 |
import unittest
from IPython.frontend.qt.console.ansi_code_processor import AnsiCodeProcessor
class TestAnsiCodeProcessor(unittest.TestCase):
def setUp(self):
self.processor = AnsiCodeProcessor()
def test_clear(self):
string = '\x1b[2J\x1b[K'
i = -1
for i, substring in enu... | true | true |
f7133538bfaf31e38373cd86c3401cac5bc8ab30 | 5,181 | py | Python | desktop/core/ext-py/ctypes-1.0.2/ctypes/util.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/ctypes-1.0.2/ctypes/util.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/ctypes-1.0.2/ctypes/util.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys, os
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
de... | 33.425806 | 79 | 0.498359 | false | true | |
f7133649eb9a45a5364a31adeffb80967133f93b | 12,144 | py | Python | sdk/python/pulumi_google_native/compute/v1/get_global_address.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/compute/v1/get_global_address.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/compute/v1/get_global_address.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 45.826415 | 1,108 | 0.670866 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = [
'GetGlobalAddressResult',
'AwaitableGetGlobalAddressResult',
'get_global_address',
'get_global_address_output',
]
@pulumi.output_type
clas... | true | true |
f713384b5e89b13964f1b7a6a23cfc6caab01cd7 | 6,903 | py | Python | deeppavlov_agent/http_api/handlers.py | deepmipt/dp-agent | 74b5b993a451ac54efd9a5086ff507a9520ad0c6 | [
"Apache-2.0"
] | 54 | 2019-05-16T12:58:54.000Z | 2022-01-09T06:09:01.000Z | deeppavlov_agent/http_api/handlers.py | deepmipt/dp-agent | 74b5b993a451ac54efd9a5086ff507a9520ad0c6 | [
"Apache-2.0"
] | 27 | 2019-06-13T12:31:42.000Z | 2021-09-10T16:37:59.000Z | deeppavlov_agent/http_api/handlers.py | deepmipt/dp-agent | 74b5b993a451ac54efd9a5086ff507a9520ad0c6 | [
"Apache-2.0"
] | 25 | 2019-06-08T03:30:48.000Z | 2022-03-17T15:47:27.000Z | import asyncio
from datetime import datetime
from string import hexdigits
from time import time
import aiohttp
import aiohttp_jinja2
from aiohttp import web
async def handle_command(payload, user_id, state_manager):
if payload in {'/start', '/close'} and state_manager:
await state_manager.drop_active_dia... | 38.564246 | 110 | 0.618282 | import asyncio
from datetime import datetime
from string import hexdigits
from time import time
import aiohttp
import aiohttp_jinja2
from aiohttp import web
async def handle_command(payload, user_id, state_manager):
if payload in {'/start', '/close'} and state_manager:
await state_manager.drop_active_dia... | true | true |
f713385808bf177da45209fad36598a397b9c0a6 | 1,161 | py | Python | ixian_docker/modules/python/__init__.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | ixian_docker/modules/python/__init__.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | ixian_docker/modules/python/__init__.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | # Copyright [2018-2020] Peter Krenesky
#
# 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... | 38.7 | 74 | 0.704565 |
OPTIONS = {
"name": "PYTHON",
"tasks": "ixian_docker.modules.python.tasks",
"config": "ixian_docker.modules.python.config.PythonConfig",
"dockerfile_template": "{PYTHON.MODULE_DIR}/Dockerfile.template",
"dev_volumes": [
"{PYTHON.VIRTUAL_ENV_VOLUME}:{PYTHON.VIRTUAL... | true | true |
f7133991f9d64a1c26537f8731343872af210587 | 4,373 | py | Python | vision/google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | vision/google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | vision/google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 1 | 2021-07-21T17:59:33.000Z | 2021-07-21T17:59:33.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 37.059322 | 88 | 0.655157 |
import google.api_core.grpc_helpers
from google.cloud.vision_v1p1beta1.proto import image_annotator_pb2_grpc
class ImageAnnotatorGrpcTransport(object):
_OAUTH_SCOPES = (
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-vision",
... | true | true |
f7133a11baac4ba39d89801689a8b42a671c52b0 | 19,617 | py | Python | aiida_yambo/calculations/yambo.py | qiaojunfeng/yambo-aiida | 1900f2a0932b7782759740e5835620dbfb897a76 | [
"MIT",
"BSD-3-Clause"
] | 3 | 2018-10-30T14:00:40.000Z | 2020-04-11T08:03:10.000Z | aiida_yambo/calculations/yambo.py | qiaojunfeng/yambo-aiida | 1900f2a0932b7782759740e5835620dbfb897a76 | [
"MIT",
"BSD-3-Clause"
] | 32 | 2017-10-23T17:11:35.000Z | 2022-03-28T10:04:23.000Z | aiida_yambo/calculations/yambo.py | qiaojunfeng/yambo-aiida | 1900f2a0932b7782759740e5835620dbfb897a76 | [
"MIT",
"BSD-3-Clause"
] | 6 | 2017-10-23T17:01:13.000Z | 2022-03-15T18:20:35.000Z | # -*- coding: utf-8 -*-
"""
Plugin to create a Yambo input file and run a calculation with the yambo executable.
"""
from __future__ import absolute_import
import os
import six
from aiida.engine import CalcJob
from aiida_quantumespresso.calculations import _lowercase_dict, _uppercase_dict
from aiida.common.datastruc... | 39.953157 | 152 | 0.5744 |
from __future__ import absolute_import
import os
import six
from aiida.engine import CalcJob
from aiida_quantumespresso.calculations import _lowercase_dict, _uppercase_dict
from aiida.common.datastructures import CalcInfo
from aiida.common.datastructures import CalcJobState
from aiida.common.exceptions import Uniqu... | true | true |
f7133c4cef8d53f6b9706fa1a69dcc17bde30732 | 1,116 | py | Python | users/migrations/0001_initial.py | Audio10/Django | c2cb09b95014b1213a073c055d3f0ef793ecf5bf | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | Audio10/Django | c2cb09b95014b1213a073c055d3f0ef793ecf5bf | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | Audio10/Django | c2cb09b95014b1213a073c055d3f0ef793ecf5bf | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-03-02 14:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 36 | 121 | 0.624552 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f7133c6d368df3e67e9493eaa4b25a9af6670a77 | 2,195 | py | Python | tests/unit/media/test_listener.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | 1,160 | 2019-06-13T11:51:40.000Z | 2022-03-31T01:55:32.000Z | tests/unit/media/test_listener.py | AaronCWacker/pyglet | 63b1ece7043133d47eb898857876e4927d9759b2 | [
"BSD-3-Clause"
] | 491 | 2019-07-14T16:13:11.000Z | 2022-03-31T08:04:32.000Z | tests/unit/media/test_listener.py | AaronCWacker/pyglet | 63b1ece7043133d47eb898857876e4927d9759b2 | [
"BSD-3-Clause"
] | 316 | 2019-06-14T13:56:48.000Z | 2022-03-30T19:26:58.000Z | import pytest
from ...annotations import skip_if_continuous_integration
try:
from pyglet.media.drivers import pulse
has_pulse = True
except ImportError:
has_pulse = False
try:
from pyglet.media.drivers import openal
has_openal = True
except ImportError:
has_openal = False
try:
from pygl... | 30.486111 | 83 | 0.74123 | import pytest
from ...annotations import skip_if_continuous_integration
try:
from pyglet.media.drivers import pulse
has_pulse = True
except ImportError:
has_pulse = False
try:
from pyglet.media.drivers import openal
has_openal = True
except ImportError:
has_openal = False
try:
from pygl... | true | true |
f7133e27fe238e02b6a98df99fb4c014baa87fa6 | 4,306 | py | Python | python_modules/libraries/dagster-airflow/dagster_airflow_tests/test_dagster_pipeline_factory/test_tags.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/libraries/dagster-airflow/dagster_airflow_tests/test_dagster_pipeline_factory/test_tags.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow_tests/test_dagster_pipeline_factory/test_tags.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | import datetime
import os
from airflow.models.dag import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
from dagster import DagsterEventType, execute_pipeline
from dagster.core.instance import AIRFLOW_EXECUTION_DATE_STR
from dagster.core.storage.compute_log_manage... | 32.37594 | 95 | 0.687877 | import datetime
import os
from airflow.models.dag import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
from dagster import DagsterEventType, execute_pipeline
from dagster.core.instance import AIRFLOW_EXECUTION_DATE_STR
from dagster.core.storage.compute_log_manage... | true | true |
f7133fc12ea31362ad4e7a9eba88862be68ffb9b | 4,821 | py | Python | tests/rest/client/v1/utils.py | Lrizika/synapse | 97174780ce726962ca1beb3788b62f16e9fad270 | [
"Apache-2.0"
] | 1 | 2019-06-22T04:17:50.000Z | 2019-06-22T04:17:50.000Z | tests/rest/client/v1/utils.py | fikalefaza/synapse | 4f68188d0bbdb1966250375d34125572eb82a117 | [
"Apache-2.0"
] | null | null | null | tests/rest/client/v1/utils.py | fikalefaza/synapse | 4f68188d0bbdb1966250375d34125572eb82a117 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... | 32.795918 | 88 | 0.598631 |
import json
import time
import attr
from synapse.api.constants import Membership
from tests.server import make_request, render
@attr.s
class RestHelper(object):
hs = attr.ib()
resource = attr.ib()
auth_user_id = attr.ib()
def create_room_as(self, room_creator, is_public=True, tok=N... | true | true |
f71341cf49fd61a79c72594e9e57b1e66d251847 | 491 | py | Python | recipes/migrations/0012_auto_20210327_1049.py | backdev96/foodgram-project | dbe7d9a1937bf1a66d9e48fee01009d33ec159e3 | [
"MIT"
] | null | null | null | recipes/migrations/0012_auto_20210327_1049.py | backdev96/foodgram-project | dbe7d9a1937bf1a66d9e48fee01009d33ec159e3 | [
"MIT"
] | null | null | null | recipes/migrations/0012_auto_20210327_1049.py | backdev96/foodgram-project | dbe7d9a1937bf1a66d9e48fee01009d33ec159e3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2021-03-27 10:49
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0011_auto_20210327_1046'),
]
operations = [
migrations.AlterField(
model_name='ingredie... | 24.55 | 115 | 0.655804 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0011_auto_20210327_1046'),
]
operations = [
migrations.AlterField(
model_name='ingredientrecipe',
name='amount',
... | true | true |
f713423abe187addd46650b41d58c5d3557bd4ed | 1,331 | py | Python | api/tests/opentrons/protocol_engine/commands/test_move_to_well.py | faliester/opentrons | e945d0f72fed39b0f68c0b30b7afd1981644184f | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocol_engine/commands/test_move_to_well.py | faliester/opentrons | e945d0f72fed39b0f68c0b30b7afd1981644184f | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocol_engine/commands/test_move_to_well.py | faliester/opentrons | e945d0f72fed39b0f68c0b30b7afd1981644184f | [
"Apache-2.0"
] | null | null | null | """Test move to well commands."""
from mock import AsyncMock # type: ignore[attr-defined]
from opentrons.protocol_engine.commands import (
MoveToWellRequest,
MoveToWellResult,
)
def test_move_to_well_request() -> None:
"""It should be able to create a MoveToWellRequest."""
request = MoveToWellReques... | 26.62 | 77 | 0.677686 | from mock import AsyncMock
from opentrons.protocol_engine.commands import (
MoveToWellRequest,
MoveToWellResult,
)
def test_move_to_well_request() -> None:
request = MoveToWellRequest(
pipetteId="abc",
labwareId="123",
wellName="A3",
)
assert request.pipetteId == "abc"
... | true | true |
f7134253219dda7a96ba9d674364c61f4ce448e8 | 1,370 | py | Python | Heron/Operations/Sources/Input/User_Input/user_input_com.py | Heron-Repositories/Heron | d63c907096fb00435a493cbfa5a5ad1a61f6cf2e | [
"MIT"
] | 1 | 2022-03-27T06:03:09.000Z | 2022-03-27T06:03:09.000Z | Heron/Operations/Sources/Input/User_Input/user_input_com.py | Heron-Repositories/Heron | d63c907096fb00435a493cbfa5a5ad1a61f6cf2e | [
"MIT"
] | null | null | null | Heron/Operations/Sources/Input/User_Input/user_input_com.py | Heron-Repositories/Heron | d63c907096fb00435a493cbfa5a5ad1a61f6cf2e | [
"MIT"
] | null | null | null |
import os
import sys
from os import path
current_dir = path.dirname(path.abspath(__file__))
while path.split(current_dir)[-1] != r'Heron':
current_dir = path.dirname(current_dir)
sys.path.insert(0, path.dirname(current_dir))
from Heron import general_utils as gu
Exec = os.path.abspath(__file__)
... | 34.25 | 110 | 0.727737 |
import os
import sys
from os import path
current_dir = path.dirname(path.abspath(__file__))
while path.split(current_dir)[-1] != r'Heron':
current_dir = path.dirname(current_dir)
sys.path.insert(0, path.dirname(current_dir))
from Heron import general_utils as gu
Exec = os.path.abspath(__file__)
... | true | true |
f7134319b026f17ce563d94428a6c60bc1549970 | 496 | py | Python | simply_block/sample/request_multi_form.py | simplyblock/sb-python-sdk | 9c951021ec64359e726dc9d4bb933109c9d4aced | [
"MIT"
] | null | null | null | simply_block/sample/request_multi_form.py | simplyblock/sb-python-sdk | 9c951021ec64359e726dc9d4bb933109c9d4aced | [
"MIT"
] | null | null | null | simply_block/sample/request_multi_form.py | simplyblock/sb-python-sdk | 9c951021ec64359e726dc9d4bb933109c9d4aced | [
"MIT"
] | null | null | null | from simply_block.simply_sign import SimplySign
# Token
public_key = "hmac_pub_1"
private_key = "hmac_priv_1"
# Required Params
url = "http://127.0.0.1:8000/v1/eth/contract/build/"
file_path = "/home/lenovo/Documents/simplyblock/ethereum-service/contracts/DappToken.sol"
data = {
'contract_name': 'contract_22'... | 23.619048 | 89 | 0.75 | from simply_block.simply_sign import SimplySign
public_key = "hmac_pub_1"
private_key = "hmac_priv_1"
url = "http://127.0.0.1:8000/v1/eth/contract/build/"
file_path = "/home/lenovo/Documents/simplyblock/ethereum-service/contracts/DappToken.sol"
data = {
'contract_name': 'contract_22'
}
files = {
'contra... | true | true |
f713446a1b0ac2f40a206550d7fd9db0889c46ab | 418 | py | Python | groups/urls.py | aryasadeghy/simpleSocial | 46c1f83a07817efbd095507303c66353fe1ae932 | [
"MIT"
] | null | null | null | groups/urls.py | aryasadeghy/simpleSocial | 46c1f83a07817efbd095507303c66353fe1ae932 | [
"MIT"
] | 6 | 2020-02-11T22:54:25.000Z | 2022-01-13T00:47:14.000Z | groups/urls.py | aryasadeghy/simpleSocial | 46c1f83a07817efbd095507303c66353fe1ae932 | [
"MIT"
] | null | null | null | from django.urls import path,re_path
from groups import views
app_name = 'groups'
urlpatterns = [
path('',views.ListGroup.as_view(), name= 'all'),
path('new/',views.CreateGroup.as_view(), name='create'),
path('posts/in/<slug>/',views.SingleGroup.as_view(),name='single'),
path('join/<slug>/',views.Join... | 34.833333 | 71 | 0.674641 | from django.urls import path,re_path
from groups import views
app_name = 'groups'
urlpatterns = [
path('',views.ListGroup.as_view(), name= 'all'),
path('new/',views.CreateGroup.as_view(), name='create'),
path('posts/in/<slug>/',views.SingleGroup.as_view(),name='single'),
path('join/<slug>/',views.Join... | true | true |
f71345bdd90d83927cff0f0a35d5e1680efb8975 | 2,769 | py | Python | src/raumfeldskill.py | THaeckel/PyHomeAutomate | b66715effa27533765a114b588ee6a93c37117aa | [
"MIT"
] | null | null | null | src/raumfeldskill.py | THaeckel/PyHomeAutomate | b66715effa27533765a114b588ee6a93c37117aa | [
"MIT"
] | null | null | null | src/raumfeldskill.py | THaeckel/PyHomeAutomate | b66715effa27533765a114b588ee6a93c37117aa | [
"MIT"
] | null | null | null | """
Skills to control teufel raumfeld streaming devices
RaumfeldTVWakeup is a Skill that wakes up a speaker when the TV is turned on.
Copyright (c) 2021 Timo Haeckel
"""
from skills import SkillWithState
import raumfeld
RAUMFELD_URI_PLACEHOLDER = "dlna-playcontainer://uuid%3Abd4f7f00-aa40-4e4a-a54e-ec64e9944e23?sid... | 35.050633 | 224 | 0.618996 |
from skills import SkillWithState
import raumfeld
RAUMFELD_URI_PLACEHOLDER = "dlna-playcontainer://uuid%3Abd4f7f00-aa40-4e4a-a54e-ec64e9944e23?sid=urn%3Aupnp-org%3AserviceId%3AContentDirectory&cid=0%2FTidal%2FDirectAccess%2FArtist%2F8372%2FTopTracks&fid=0&fii=0"
class RaumfeldTVWakeup(SkillWithState):
... | true | true |
f713479d7e86c1f3878f269fe0ca8474d445ef34 | 20,667 | py | Python | collector/example/rpcclient/netflowlib.py | codragonzuo/beats | b5a8449e21a038bc82dde6cac5fd4ec20df32b07 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | collector/example/rpcclient/netflowlib.py | codragonzuo/beats | b5a8449e21a038bc82dde6cac5fd4ec20df32b07 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | collector/example/rpcclient/netflowlib.py | codragonzuo/beats | b5a8449e21a038bc82dde6cac5fd4ec20df32b07 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
This file belongs to https://github.com/bitkeks/python-netflow-v9-softflowd.
The test packets (defined below as hex streams) were extracted from "real"
softflowd exports based on a sample PCAP capture file.
Copyright 2016-2020 Dominik Pataky <software+pynetflow@dpataky.eu>
Licensed under MIT License. See LICENSE.... | 67.760656 | 114 | 0.749504 |
import queue
import random
import socket
import time
PACKET_INVALID = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
CONNECTION = ('127.0.0.1', 1337)
NUM_PACKETS = 1000
def gen_pkts(n, idx):
for x in range(n):
if x == idx:
yield PACKET_V9_TEMPLATE
else:
yield random.ch... | true | true |
f71347c3a5a7c73ebffb636b8ab864f7bc6703ed | 30,444 | py | Python | toolz/functoolz.py | twoertwein/toolz | 4171cf00dae791cf3ec7d66ac49d59d3df7c1ea2 | [
"BSD-3-Clause"
] | null | null | null | toolz/functoolz.py | twoertwein/toolz | 4171cf00dae791cf3ec7d66ac49d59d3df7c1ea2 | [
"BSD-3-Clause"
] | null | null | null | toolz/functoolz.py | twoertwein/toolz | 4171cf00dae791cf3ec7d66ac49d59d3df7c1ea2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import inspect
import sys
from functools import partial, reduce
from importlib import import_module
from operator import attrgetter, not_
from textwrap import dedent
from types import MethodType
from typing import Any, Callable, Dict, Generic, TypeVar, Union, overload
from .utils im... | 28.802271 | 88 | 0.577914 | from __future__ import annotations
import inspect
import sys
from functools import partial, reduce
from importlib import import_module
from operator import attrgetter, not_
from textwrap import dedent
from types import MethodType
from typing import Any, Callable, Dict, Generic, TypeVar, Union, overload
from .utils im... | true | true |
f71347fe2477679277a83c7c8d547eb46223cf1f | 6,757 | py | Python | tests/gpu/test_torch.py | AkashNarayanan/pennylane | b855176ebd5c84a49f51babce0a6d5af1ef29142 | [
"Apache-2.0"
] | null | null | null | tests/gpu/test_torch.py | AkashNarayanan/pennylane | b855176ebd5c84a49f51babce0a6d5af1ef29142 | [
"Apache-2.0"
] | 1 | 2021-12-09T22:04:41.000Z | 2022-01-19T14:21:03.000Z | tests/gpu/test_torch.py | AkashNarayanan/pennylane | b855176ebd5c84a49f51babce0a6d5af1ef29142 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 33.122549 | 104 | 0.630309 |
import pytest
import pennylane as qml
from pennylane import numpy as np
pytestmark = pytest.mark.gpu
torch = pytest.importorskip("torch")
@pytest.mark.skipif(not torch.cuda.is_available(), reason="no cuda support")
class TestTorchDevice:
def test_device_to_cuda(self):
dev = qml.device("def... | true | true |
f71348bd486f0c866016007c0288d43d9925e4e2 | 531 | py | Python | RecoVertex/BeamSpotProducer/python/BeamSpotOnline_cfi.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoVertex/BeamSpotProducer/python/BeamSpotOnline_cfi.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoVertex/BeamSpotProducer/python/BeamSpotOnline_cfi.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import RecoVertex.BeamSpotProducer.beamSpotOnlineProducer_cfi as _mod
onlineBeamSpotProducer = _mod.beamSpotOnlineProducer.clone(
src = 'scalersRawToDigi',
setSigmaZ = -1, #negative value disables it... | 48.272727 | 84 | 0.65725 | import FWCore.ParameterSet.Config as cms
import RecoVertex.BeamSpotProducer.beamSpotOnlineProducer_cfi as _mod
onlineBeamSpotProducer = _mod.beamSpotOnlineProducer.clone(
src = 'scalersRawToDigi',
setSigmaZ = -1,
... | true | true |
f71349190ba9885865b0ec68a6c3596e268f4125 | 4,096 | py | Python | sib_api_v3_sdk/models/get_blocked_domains.py | alemangui/APIv3-python-library | 129dbee603ed91d756fdec3670c8f95be86cdd2c | [
"MIT"
] | 46 | 2018-12-18T21:37:18.000Z | 2022-03-30T20:38:29.000Z | sib_api_v3_sdk/models/get_blocked_domains.py | alemangui/APIv3-python-library | 129dbee603ed91d756fdec3670c8f95be86cdd2c | [
"MIT"
] | 41 | 2018-03-02T13:22:48.000Z | 2021-11-25T04:32:03.000Z | sib_api_v3_sdk/models/get_blocked_domains.py | alemangui/APIv3-python-library | 129dbee603ed91d756fdec3670c8f95be86cdd2c | [
"MIT"
] | 45 | 2018-01-22T14:42:32.000Z | 2021-12-16T19:58:45.000Z | # coding: utf-8
"""
SendinBlue API
SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at h... | 34.420168 | 856 | 0.575684 |
import pprint
import re
import six
class GetBlockedDomains(object):
swagger_types = {
'domains': 'list[str]'
}
attribute_map = {
'domains': 'domains'
}
def __init__(self, domains=None):
self._domains = None
self.discriminator = None
self.domain... | true | true |
f71349271ce549389e3aebe169cebe8b443a80be | 5,567 | py | Python | modules/SenseHatDisplay/app/DisplayManager.py | fiddi/Custom-vision-service-iot-edge-raspberry-pi | f0f0a0d2155692fc4caaa613e79d3ab30fc7dbf4 | [
"MIT"
] | null | null | null | modules/SenseHatDisplay/app/DisplayManager.py | fiddi/Custom-vision-service-iot-edge-raspberry-pi | f0f0a0d2155692fc4caaa613e79d3ab30fc7dbf4 | [
"MIT"
] | null | null | null | modules/SenseHatDisplay/app/DisplayManager.py | fiddi/Custom-vision-service-iot-edge-raspberry-pi | f0f0a0d2155692fc4caaa613e79d3ab30fc7dbf4 | [
"MIT"
] | null | null | null | import sense_hat
from sense_hat import SenseHat
import time
from enum import Enum
class Colors(Enum):
Green = (0, 255, 0)
Yellow = (255, 255, 0)
Blue = (0, 0, 255)
Red = (255, 0, 0)
White = (255,255,255)
Nothing = (0,0,0)
Pink = (255,105, 180)
Orange = (255,165, 0)
class DisplayManager... | 27.835 | 93 | 0.40794 | import sense_hat
from sense_hat import SenseHat
import time
from enum import Enum
class Colors(Enum):
Green = (0, 255, 0)
Yellow = (255, 255, 0)
Blue = (0, 0, 255)
Red = (255, 0, 0)
White = (255,255,255)
Nothing = (0,0,0)
Pink = (255,105, 180)
Orange = (255,165, 0)
class DisplayManager... | true | true |
f7134a2cdb66d523656539ca32e9257e50702023 | 1,706 | py | Python | test/python/test_15_fds.py | macneib/Discovery-Server | c499531422e671527f8676e3efba30015993b5d3 | [
"Apache-2.0"
] | null | null | null | test/python/test_15_fds.py | macneib/Discovery-Server | c499531422e671527f8676e3efba30015993b5d3 | [
"Apache-2.0"
] | null | null | null | test/python/test_15_fds.py | macneib/Discovery-Server | c499531422e671527f8676e3efba30015993b5d3 | [
"Apache-2.0"
] | 1 | 2021-06-02T11:16:26.000Z | 2021-06-02T11:16:26.000Z | # Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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... | 43.74359 | 113 | 0.732122 |
import subprocess, time, os, sys
fastserver_path = sys.argv[1]
server_listening_port = sys.argv[2]
discovery_path = sys.argv[3]
xml_config_path = sys.argv[4]
server = subprocess.Popen([fastserver_path, '-i', '5', '-l', '127.0.0.1', '-p', f'{server_listening_po... | true | true |
f7134b472b92121c2bb201a0a0fb36b28bf8499b | 33,495 | py | Python | methods.py | Vedurumudi-Priyanka/godot | 17d588f7b3acf292daeae88dd3d95fa2f6240349 | [
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | 1 | 2021-06-04T14:29:54.000Z | 2021-06-04T14:29:54.000Z | methods.py | 1502shivam-singh/godot | 4a4be06260085d7aad8c7082d6d59a14fcc279e8 | [
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | 6 | 2020-10-05T20:00:21.000Z | 2021-07-10T19:07:27.000Z | methods.py | 1502shivam-singh/godot | 4a4be06260085d7aad8c7082d6d59a14fcc279e8 | [
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-12-28T13:10:08.000Z | 2021-12-31T20:53:18.000Z | import os
import re
import glob
import subprocess
from collections import OrderedDict
# We need to define our own `Action` method to control the verbosity of output
# and whenever we need to run those commands in a subprocess on some platforms.
from SCons.Script import Action
from SCons import Node
from SCons.Script i... | 38.544304 | 126 | 0.607553 | import os
import re
import glob
import subprocess
from collections import OrderedDict
from SCons.Script import Action
from SCons import Node
from SCons.Script import Glob
from platform_methods import run_in_subprocess
def add_source_files(self, sources, files, warn_duplicates=True):
if isinstance(files, (... | true | true |
f7134bc3a14846ee6540a43af0958ad969f6b13e | 2,200 | py | Python | var/spack/repos/builtin/packages/r-rhtslib/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-rhtslib/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/r-rhtslib/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-05-06T00:17:46.000Z | 2021-05-06T00:17:46.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRhtslib(RPackage):
"""HTSlib high-throughput sequencing library as an R package.
... | 44 | 79 | 0.697727 |
from spack import *
class RRhtslib(RPackage):
homepage = "https://bioconductor.org/packages/Rhtslib"
git = "https://git.bioconductor.org/packages/Rhtslib.git"
version('1.18.1', commit='751a2ebaed43b7991204b27bd6c7870645001d82')
version('1.16.3', commit='3ed0b5db2ee3cf0df1c6096fde8855c8485e... | true | true |
f7134c6221b780e7e593abd9901e995324b0e639 | 1,533 | py | Python | examples/examples2.py | Maffblaster/pyrtf | b9483af08df4e15c7271ff3013cacf2f80c9a8de | [
"MIT"
] | 5 | 2015-01-27T08:08:08.000Z | 2022-03-30T10:43:31.000Z | examples/examples2.py | Maffblaster/pyrtf | b9483af08df4e15c7271ff3013cacf2f80c9a8de | [
"MIT"
] | null | null | null | examples/examples2.py | Maffblaster/pyrtf | b9483af08df4e15c7271ff3013cacf2f80c9a8de | [
"MIT"
] | 4 | 2015-12-11T07:41:24.000Z | 2022-03-30T09:48:55.000Z | import os
import sys
sys.path.append( '../' )
from rtfng import *
def MakeExample1() :
doc = Document()
ss = doc.StyleSheet
section = Section()
doc.Sections.append( section )
# text can be added directly to the section
# a paragraph object is create as needed
section.append... | 26.894737 | 84 | 0.605349 | import os
import sys
sys.path.append( '../' )
from rtfng import *
def MakeExample1() :
doc = Document()
ss = doc.StyleSheet
section = Section()
doc.Sections.append( section )
section.append( 'Image Example 1' )
section.append( 'You can add images in one of two ways, either... | false | true |
f7134ce3b382d03a111cc82338cf645898f111d2 | 10,824 | py | Python | Modules/FirstPythonProject/venv/Lib/site-packages/elasticsearch/client/ccr.py | Malligarjunan/MyLearning | 18fdf16b7473a1286b5023a19f3f9d42681c315b | [
"Unlicense"
] | 3 | 2022-02-15T08:18:28.000Z | 2022-02-15T10:31:14.000Z | Server/venv/lib/python3.8/site-packages/elasticsearch/client/ccr.py | MarikenvdVelden/living_hub | 24709071640ff05b3aa17d214ae4e49901d3e4c5 | [
"MIT"
] | null | null | null | Server/venv/lib/python3.8/site-packages/elasticsearch/client/ccr.py | MarikenvdVelden/living_hub | 24709071640ff05b3aa17d214ae4e49901d3e4c5 | [
"MIT"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 37.846154 | 109 | 0.632761 |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class CcrClient(NamespacedClient):
@query_params()
def delete_auto_follow_pattern(self, name, params=None, headers=None):
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a require... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.