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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7326090f8bedc0b5a1973fcdc6eeb702c6723dc | 4,197 | py | Python | adeft/tests/test_disambiguate.py | johnbachman/deft | 3643dd33ba4cb548f7622f24a3b87fbe48e38050 | [
"BSD-2-Clause"
] | null | null | null | adeft/tests/test_disambiguate.py | johnbachman/deft | 3643dd33ba4cb548f7622f24a3b87fbe48e38050 | [
"BSD-2-Clause"
] | null | null | null | adeft/tests/test_disambiguate.py | johnbachman/deft | 3643dd33ba4cb548f7622f24a3b87fbe48e38050 | [
"BSD-2-Clause"
] | null | null | null | import os
import uuid
import json
import shutil
import logging
from nose.tools import raises
from numpy import array_equal
from adeft.modeling.classify import load_model
from adeft.locations import TEST_RESOURCES_PATH
from adeft.disambiguate import AdeftDisambiguator, load_disambiguator
logger = logging.getLogger(__... | 38.154545 | 78 | 0.679295 | import os
import uuid
import json
import shutil
import logging
from nose.tools import raises
from numpy import array_equal
from adeft.modeling.classify import load_model
from adeft.locations import TEST_RESOURCES_PATH
from adeft.disambiguate import AdeftDisambiguator, load_disambiguator
logger = logging.getLogger(__... | true | true |
f73260e91d1ae454fee4867788ff917e7a7743be | 22,733 | py | Python | python/venv/lib/python2.7/site-packages/openstackclient/tests/volume/v1/test_volume.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstackclient/tests/volume/v1/test_volume.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstackclient/tests/volume/v1/test_volume.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | # Copyright 2013 Nebula 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 agreed to... | 32.01831 | 78 | 0.5397 |
import copy
from openstackclient.tests import fakes
from openstackclient.tests.identity.v2_0 import fakes as identity_fakes
from openstackclient.tests.volume.v1 import fakes as volume_fakes
from openstackclient.volume.v1 import volume
class TestVolume(volume_fakes.TestVolumev1):
def setUp(self):
... | true | true |
f732611a1a2ab486119fd62c51262868f3c65886 | 920 | py | Python | isi_sdk_8_1_1/test/test_hdfs_racks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_hdfs_racks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_hdfs_racks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 22.439024 | 92 | 0.71087 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from isi_sdk_8_1_1.models.hdfs_racks_extended import HdfsRacksExtended
from isi_sdk_8_1_1.rest import ApiException
class TestHdfsRacksExtended(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pas... | true | true |
f73261dcada28847fe886f6d9f0b31bf935869e2 | 723 | py | Python | ckanext/example_iconfigurer/controller.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 2 | 2015-07-17T19:09:52.000Z | 2017-08-30T20:23:44.000Z | ckanext/example_iconfigurer/controller.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 12 | 2015-01-19T18:03:56.000Z | 2016-04-11T16:40:33.000Z | ckanext/example_iconfigurer/controller.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 3 | 2015-03-31T06:19:42.000Z | 2016-06-27T15:32:28.000Z | import ckan.lib.base as base
import ckan.lib.helpers as helpers
render = base.render
class MyExtController(base.BaseController):
def config_one(self):
'''Render the config template with the first custom title.'''
return render('admin/myext_config.html',
extra_vars={'title'... | 31.434783 | 74 | 0.662517 | import ckan.lib.base as base
import ckan.lib.helpers as helpers
render = base.render
class MyExtController(base.BaseController):
def config_one(self):
return render('admin/myext_config.html',
extra_vars={'title': 'My First Config Page'})
def config_two(self):
return r... | true | true |
f73261fd8815ad358fea1b0a2e1346d8c7efae13 | 4,929 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/lacp/get.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/lacp/get.py | patrickboertje/genielibs | 61c37aacf3dd0f499944555e4ff940f92f53dacb | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/lacp/get.py | patrickboertje/genielibs | 61c37aacf3dd0f499944555e4ff940f92f53dacb | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | # Python
import logging
# Genie
from genie.metaparser.util.exceptions import SchemaEmptyParserError
log = logging.getLogger(__name__)
def get_lacp_member(device, port_channel, count, member, intf_list, internal=False):
""" This API parse's 'show lacp internal/neighbor' commands and return requested member
... | 37.625954 | 109 | 0.571313 |
import logging
from genie.metaparser.util.exceptions import SchemaEmptyParserError
log = logging.getLogger(__name__)
def get_lacp_member(device, port_channel, count, member, intf_list, internal=False):
if (internal == True):
out = device.parse("show lacp internal")
else:
out = device.parse(... | true | true |
f7326241d185da508ae499d8b06d8fa4296a28b9 | 1,626 | py | Python | lite/tests/unittest_py/op/backends/x86/test_gelu_op.py | laiou/Paddle-Lite | a99080a48186ec7df546d77d39db58d84d1dda3e | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/op/backends/x86/test_gelu_op.py | laiou/Paddle-Lite | a99080a48186ec7df546d77d39db58d84d1dda3e | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/op/backends/x86/test_gelu_op.py | laiou/Paddle-Lite | a99080a48186ec7df546d77d39db58d84d1dda3e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 appli... | 33.875 | 125 | 0.741697 |
import sys
sys.path.append('../../common')
sys.path.append('../../../')
import test_gelu_op_base
from auto_scan_test import AutoScanTest, IgnoreReasons
from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place
import unittest
import hyp... | true | true |
f7326364052f70b968fe2f687a12024f1f20264d | 1,057 | py | Python | agent/indy_catalyst_agent/messaging/connections/messages/connection_response.py | mikelodder7/indy-catalyst | 5e80d8d6764144303b7ef1851aee32291bcb2d98 | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/messaging/connections/messages/connection_response.py | mikelodder7/indy-catalyst | 5e80d8d6764144303b7ef1851aee32291bcb2d98 | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/messaging/connections/messages/connection_response.py | mikelodder7/indy-catalyst | 5e80d8d6764144303b7ef1851aee32291bcb2d98 | [
"Apache-2.0"
] | null | null | null | """
Represents a connection response message
"""
from marshmallow import fields
from ...agent_message import AgentMessage, AgentMessageSchema
from ..message_types import CONNECTION_RESPONSE
from ....models.connection_detail import ConnectionDetail, ConnectionDetailSchema
HANDLER_CLASS = (
"indy_catalyst_agent.me... | 25.166667 | 81 | 0.717124 |
from marshmallow import fields
from ...agent_message import AgentMessage, AgentMessageSchema
from ..message_types import CONNECTION_RESPONSE
from ....models.connection_detail import ConnectionDetail, ConnectionDetailSchema
HANDLER_CLASS = (
"indy_catalyst_agent.messaging.connections.handlers."
+ "connection_... | true | true |
f73263c4c1df5dfb8107b488aaa76084d7b77bb6 | 1,842 | py | Python | loadgen/setup.py | sf-wind/inference | ae7fa59ce55cd68dfd474149df417557a69704a9 | [
"Apache-2.0"
] | null | null | null | loadgen/setup.py | sf-wind/inference | ae7fa59ce55cd68dfd474149df417557a69704a9 | [
"Apache-2.0"
] | null | null | null | loadgen/setup.py | sf-wind/inference | ae7fa59ce55cd68dfd474149df417557a69704a9 | [
"Apache-2.0"
] | null | null | null | """MLPerf Inference LoadGen python bindings.
Creates a module that python can import.
All source files are compiled by python's C++ toolchain without depending
on a loadgen lib.
This setup.py can be used stand-alone, without the use of an external
build system. This will polute your source tree with output files
and... | 28.78125 | 76 | 0.698697 |
from setuptools import setup, Extension
from version_generator import generate_loadgen_version_definitions
generated_version_source_filename = "generated/version.cc"
generate_loadgen_version_definitions(generated_version_source_filename)
public_headers = [
"loadgen.h",
"query_sample.h",
"query_sample_library.h... | true | true |
f732658d5a149ab114e15ead4d028cafb022c2a4 | 18,700 | py | Python | models.py | zedian/esm | 9d2b50cd96753e8a703ca810e875c9e887047ed9 | [
"MIT"
] | null | null | null | models.py | zedian/esm | 9d2b50cd96753e8a703ca810e875c9e887047ed9 | [
"MIT"
] | null | null | null | models.py | zedian/esm | 9d2b50cd96753e8a703ca810e875c9e887047ed9 | [
"MIT"
] | null | null | null | from __future__ import print_function
import torch
from torch import nn
import torch.utils.data as Data
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import collections
import math
import copy
torch.manual_seed(1)
np.random.seed(1)
class BIN_Interaction_Flat(nn.Sequential):... | 42.596811 | 199 | 0.669144 | from __future__ import print_function
import torch
from torch import nn
import torch.utils.data as Data
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import collections
import math
import copy
torch.manual_seed(1)
np.random.seed(1)
class BIN_Interaction_Flat(nn.Sequential):... | true | true |
f73265c9edaae6ec1281e7f5b9116e4c14930790 | 3,488 | py | Python | oxasl/mask.py | ibme-qubic/oxasl | 8a0c055752d6e10cd932336ae6916f0c4fc0a2e9 | [
"Apache-2.0"
] | 1 | 2020-11-02T13:01:47.000Z | 2020-11-02T13:01:47.000Z | oxasl/mask.py | ibme-qubic/oxasl | 8a0c055752d6e10cd932336ae6916f0c4fc0a2e9 | [
"Apache-2.0"
] | 13 | 2019-01-14T13:22:00.000Z | 2020-09-12T20:34:20.000Z | oxasl/mask.py | physimals/oxasl | e583103f3313aed2890b60190b6ca7b265a46e3c | [
"Apache-2.0"
] | 3 | 2019-03-19T15:46:48.000Z | 2020-03-13T16:55:48.000Z | """
OXASL - Module to generate a suitable mask for ASL data
Copyright (c) 2008-2020 Univerisity of Oxford
"""
import numpy as np
import scipy as sp
import fsl.wrappers as fsl
from fsl.data.image import Image
from oxasl import reg
from oxasl.reporting import LightboxImage
def generate_mask(wsp):
"""
For comp... | 39.191011 | 151 | 0.675745 | import numpy as np
import scipy as sp
import fsl.wrappers as fsl
from fsl.data.image import Image
from oxasl import reg
from oxasl.reporting import LightboxImage
def generate_mask(wsp):
run(wsp)
def run(wsp):
if wsp.rois is not None and wsp.rois.mask is not None:
return
wsp.sub("rois")
wsp.... | true | true |
f7326634ece2f34cc1465b450f8505c188b6eaa4 | 1,769 | py | Python | src/gtk/toga_gtk/widgets/splitcontainer.py | saluk/toga | f8bea583c87642ad102776e1b58fd8bb9265b135 | [
"BSD-3-Clause"
] | null | null | null | src/gtk/toga_gtk/widgets/splitcontainer.py | saluk/toga | f8bea583c87642ad102776e1b58fd8bb9265b135 | [
"BSD-3-Clause"
] | null | null | null | src/gtk/toga_gtk/widgets/splitcontainer.py | saluk/toga | f8bea583c87642ad102776e1b58fd8bb9265b135 | [
"BSD-3-Clause"
] | null | null | null | from ..libs import Gtk
from ..window import GtkViewport
from .base import Widget
class SplitContainer(Widget):
def create(self):
# Use Paned widget rather than VPaned and HPaned deprecated widgets
# Note that orientation in toga behave unlike Gtk
if self.interface.VERTICAL:
sel... | 36.102041 | 80 | 0.654607 | from ..libs import Gtk
from ..window import GtkViewport
from .base import Widget
class SplitContainer(Widget):
def create(self):
if self.interface.VERTICAL:
self.native = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
elif self.interface.HORIZONTAL:
self.native... | true | true |
f732667678fe56d63a50d6cdfc0a2bcc6b9ff02f | 5,812 | py | Python | lh/DecisionTree2.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | 3 | 2019-03-25T14:15:30.000Z | 2019-08-29T15:02:47.000Z | lh/DecisionTree2.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | null | null | null | lh/DecisionTree2.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-02-03 15:17:08
# @Author : Vophan Lee (vophanlee@gmail.com)
# @Link : https://www.jianshu.com/u/3e6114e983ad
from sklearn.datasets import make_classification
import numpy as np
import math
class Decision_Tree(object):
"""
this i... | 41.219858 | 147 | 0.567275 |
from sklearn.datasets import make_classification
import numpy as np
import math
class Decision_Tree(object):
feature_list = []
gain_list = []
dim_list = []
index = 0
def __init__(self):
super(Decision_Tree, self).__init__()
self.features = 5
self.sam... | true | true |
f7326756f8ad7832b4a6f8c87d9131cd0c7553a9 | 721 | py | Python | Bugscan_exploits-master/exp_list/exp-1063.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-1063.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-1063.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
#from:http://www.wooyun.org/bugs/wooyun-2010-093049
import re,time
def assign(service, arg):
if service == "umail":
return True, arg
def audit(arg):
url = arg + '/webmail/fast/index.php?module=operate&action=login'
postdata = 'mailbox=test@domain.com&link=?'
... | 34.333333 | 132 | 0.651872 |
import re,time
def assign(service, arg):
if service == "umail":
return True, arg
def audit(arg):
url = arg + '/webmail/fast/index.php?module=operate&action=login'
postdata = 'mailbox=test@domain.com&link=?'
code, head, res, errcode, _ = curl.curl2(url,post=postdata)
if code... | true | true |
f73267d55ff079ff1596cde36652108c05688ded | 2,752 | py | Python | DNN_HW5/main.py | jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring | 95bc0f3a7042debbc388c76d9bd43ad24aba2c88 | [
"MIT"
] | null | null | null | DNN_HW5/main.py | jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring | 95bc0f3a7042debbc388c76d9bd43ad24aba2c88 | [
"MIT"
] | null | null | null | DNN_HW5/main.py | jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring | 95bc0f3a7042debbc388c76d9bd43ad24aba2c88 | [
"MIT"
] | null | null | null | # %% [markdown]
# [](https://colab.research.google.com/github/jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring/blob/main/DNN_HW5/main.ipynb)
# %% [markdown]
# # DNN HW5 : #9
#
# 2022.03.23
# 박준혁
# %%
import numpy as np
import torch
import t... | 26.461538 | 202 | 0.579215 |
py as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
x = torch.FloatTensor([[0, 0], [0, 1], [1, 0], [1, 1]])
y = torch.FloatTensor([[0], [1], [1], [0]])
class NN10(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Line... | true | true |
f732682b1cfe1fafeaca346811b06f346f04b564 | 22,189 | py | Python | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 90 | 2017-08-24T18:57:21.000Z | 2022-03-04T01:58:56.000Z | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 27 | 2017-04-01T15:06:36.000Z | 2021-02-08T20:19:58.000Z | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | 11 | 2019-02-26T14:30:28.000Z | 2021-12-31T05:04:08.000Z | # -*- coding: utf-8 -*-
"""
Default Django settings. Override these with settings in the module pointed to
by the DJANGO_SETTINGS_MODULE environment variable.
"""
from __future__ import unicode_literals
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module d... | 34.454969 | 103 | 0.703006 |
from __future__ import unicode_literals
# django.utils.translation -- that module depends on the settings.
def gettext_noop(s):
return s
####################
# CORE #
####################
DEBUG = False
# Whether the framework should propagate raw exceptions rather than catching
# them. This is u... | true | true |
f732689a19695848c73536abbc88f78ed5fd6d88 | 8,182 | py | Python | tests/test_run.py | martinxyz/sacred | fa452e4eacf29caa59fb46c274a519669d6b4790 | [
"MIT"
] | 2 | 2016-10-24T10:26:03.000Z | 2016-10-31T15:22:13.000Z | tests/test_run.py | martinxyz/sacred | fa452e4eacf29caa59fb46c274a519669d6b4790 | [
"MIT"
] | 5 | 2016-10-22T15:46:11.000Z | 2017-06-29T11:19:11.000Z | tests/test_run.py | martinxyz/sacred | fa452e4eacf29caa59fb46c274a519669d6b4790 | [
"MIT"
] | 1 | 2020-04-11T14:44:42.000Z | 2020-04-11T14:44:42.000Z | #!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import mock
import os
import pytest
import tempfile
import sys
from sacred.run import Run
from sacred.config.config_summary import ConfigSummary
from sacred.utils import (ObserverError, ... | 29.861314 | 97 | 0.712173 |
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import mock
import os
import pytest
import tempfile
import sys
from sacred.run import Run
from sacred.config.config_summary import ConfigSummary
from sacred.utils import (ObserverError, SacredInterrupt, TimeoutInterrupt,
... | true | true |
f73269981546a570cb9a309603dd8f27856144f3 | 9,873 | py | Python | benchmarks/distributed/ddp/compare/compare_ddp.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | benchmarks/distributed/ddp/compare/compare_ddp.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | benchmarks/distributed/ddp/compare/compare_ddp.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | """
A simple tool to compare the performance of different impls of
DistributedDataParallel on resnet50, three flavors:
1. DistributedDataParallel, which has a python wrapper and C++ core to do
gradient distribution and reduction. It's current production version.
2. PythonDDP with async gradient reduction.
3. Pyth... | 38.416342 | 118 | 0.637395 |
import numpy as np
import os
import pickle
import glob
import python_ddp
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import torch.nn as nn
import torch.optim as optim
import torchvision.models as models
from collections import OrderedDict
from enum import Enum
from tabulate import... | true | true |
f7326999dc24482830c16aa9561534ecbfcf6ab2 | 9,195 | py | Python | tests/chainer_tests/functions_tests/connection_tests/test_n_step_lstm.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | tests/chainer_tests/functions_tests/connection_tests/test_n_step_lstm.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | tests/chainer_tests/functions_tests/connection_tests/test_n_step_lstm.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def sigmoid(x):
return numpy.tanh(x * 0.5) * 0.5 + 0.5
def _split(inputs, pos):
return inputs[:pos]... | 36.78 | 79 | 0.531485 | import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def sigmoid(x):
return numpy.tanh(x * 0.5) * 0.5 + 0.5
def _split(inputs, pos):
return inputs[:pos]... | true | true |
f7326a11d6895ddea9102d2cf1365d083cdc73a6 | 4,758 | py | Python | main_live.py | WuYff/ggnn.pytorch | 795bc7fb51876231406d71610aa5ec7ed29865c0 | [
"MIT"
] | null | null | null | main_live.py | WuYff/ggnn.pytorch | 795bc7fb51876231406d71610aa5ec7ed29865c0 | [
"MIT"
] | null | null | null | main_live.py | WuYff/ggnn.pytorch | 795bc7fb51876231406d71610aa5ec7ed29865c0 | [
"MIT"
] | null | null | null | import argparse
import random
import torch
import torch.nn as nn
import torch.optim as optim
from model_live import GGNN
from utils.train_live import train
from utils.test_live import test
from utils.validation_live import validation
from utils.data.wy_dataset_live import bAbIDataset
from utils.data.dataloader import... | 39.983193 | 107 | 0.696511 | import argparse
import random
import torch
import torch.nn as nn
import torch.optim as optim
from model_live import GGNN
from utils.train_live import train
from utils.test_live import test
from utils.validation_live import validation
from utils.data.wy_dataset_live import bAbIDataset
from utils.data.dataloader import... | true | true |
f7326a1f506ca5fb7b3e97b0d077dc016e7eb7c7 | 2,147 | py | Python | ppstructure/table/table_metric/parallel.py | nan-wang/PaddleOCR | 31b06a2fd19f877a09acaf658387bd919c289b8e | [
"Apache-2.0"
] | 20,401 | 2020-05-08T10:56:13.000Z | 2022-03-31T23:34:38.000Z | ppstructure/table/table_metric/parallel.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,988 | 2020-05-10T08:19:41.000Z | 2022-03-31T17:57:11.000Z | ppstructure/table/table_metric/parallel.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,479 | 2020-05-08T11:12:13.000Z | 2022-03-31T11:55:28.000Z | from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, as_completed
def parallel_process(array, function, n_jobs=16, use_kwargs=False, front_num=0):
"""
A parallel version of the map function with a progress bar.
Args:
array (array-like): An array to iterate over.
... | 41.288462 | 117 | 0.610154 | from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, as_completed
def parallel_process(array, function, n_jobs=16, use_kwargs=False, front_num=0):
if front_num > 0:
front = [function(**a) if use_kwargs else function(a)
for a in array[:front_num]]
else:
... | true | true |
f7326b3311cb80454a1fb34edc479c00815ea490 | 6,749 | py | Python | lib/kubernetes/client/models/v1_storage_class_list.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_storage_class_list.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_storage_class_list.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 31.834906 | 282 | 0.588532 |
from pprint import pformat
from six import iteritems
import re
class V1StorageClassList(object):
swagger_types = {
'api_version': 'str',
'items': 'list[V1StorageClass]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'api_versi... | true | true |
f7326b67d5c5ac6986506ec83002312b5a289cdd | 7,366 | py | Python | Test/label_image_openCV_gui__041315.py | sarunya-w/cs402_project | d49b26cf33da2c3a6d8f61b08630e224fe9a3598 | [
"MIT"
] | 1 | 2015-05-29T14:38:16.000Z | 2015-05-29T14:38:16.000Z | Test/label_image_openCV_gui__041315.py | sarunya-w/CS402-PROJECT | d49b26cf33da2c3a6d8f61b08630e224fe9a3598 | [
"MIT"
] | null | null | null | Test/label_image_openCV_gui__041315.py | sarunya-w/CS402-PROJECT | d49b26cf33da2c3a6d8f61b08630e224fe9a3598 | [
"MIT"
] | null | null | null | import cv2
import os
import numpy as np
import copy
WINDOW_NAME = "Label image"
WINDOW2_NAME = "Class image"
all_img = []
rootdir = './dataset'
drawing = False # true if mouse is pressed
Cnow = -1
ix,iy = -1,-1
i = 0
type_name = ".bmp"
def nothing(x):
pass
def draw_null(event,x,y,flags,param):
pass
def color(... | 26.401434 | 168 | 0.475292 | import cv2
import os
import numpy as np
import copy
WINDOW_NAME = "Label image"
WINDOW2_NAME = "Class image"
all_img = []
rootdir = './dataset'
drawing = False
Cnow = -1
ix,iy = -1,-1
i = 0
type_name = ".bmp"
def nothing(x):
pass
def draw_null(event,x,y,flags,param):
pass
def color(Cnow):
if Cnow == 0 :
r... | false | true |
f7326c132616d2be4a3970c75e1ba25cc38dc29b | 980 | py | Python | baselines/ppo1/test_env/__init__.py | ByzanTine/baselines | 69432726b689c555cdf118ad0dcf9665abbc4b9d | [
"MIT"
] | null | null | null | baselines/ppo1/test_env/__init__.py | ByzanTine/baselines | 69432726b689c555cdf118ad0dcf9665abbc4b9d | [
"MIT"
] | null | null | null | baselines/ppo1/test_env/__init__.py | ByzanTine/baselines | 69432726b689c555cdf118ad0dcf9665abbc4b9d | [
"MIT"
] | null | null | null | from gym.envs.registration import register
import gym
from test_env.envs import *
register(
id='Fourrooms-v1',
entry_point='test_env.envs.fourrooms:Fourrooms',
kwargs={
'map_name': '9x9',
})
register(
id='Fourroomssto-v1',
entry_point='test_env.envs.fourroom_sto:Fourroomssto',
)
regi... | 20 | 69 | 0.687755 | from gym.envs.registration import register
import gym
from test_env.envs import *
register(
id='Fourrooms-v1',
entry_point='test_env.envs.fourrooms:Fourrooms',
kwargs={
'map_name': '9x9',
})
register(
id='Fourroomssto-v1',
entry_point='test_env.envs.fourroom_sto:Fourroomssto',
)
regi... | true | true |
f7326c428c5b6a9d336ebdb571cfc85e2104fd66 | 14,664 | py | Python | horch/legacy/models/detection/enhance.py | sbl1996/pytorch-hrvvi-ext | f19abcbedd844a700b2e2596dd817ea80cbb6287 | [
"MIT"
] | 17 | 2019-05-14T10:47:25.000Z | 2021-06-09T05:39:47.000Z | horch/legacy/models/detection/enhance.py | sbl1996/pytorch-hrvvi-ext | f19abcbedd844a700b2e2596dd817ea80cbb6287 | [
"MIT"
] | null | null | null | horch/legacy/models/detection/enhance.py | sbl1996/pytorch-hrvvi-ext | f19abcbedd844a700b2e2596dd817ea80cbb6287 | [
"MIT"
] | 5 | 2019-08-08T07:04:38.000Z | 2020-07-04T08:58:32.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from horch.common import tuplify
from horch.models.block import mb_conv_block, MBConv
from horch.models.detection.nasfpn import ReLUConvBN
from horch.models.modules import upsample_add, Conv2d, Sequential, Pool2d, upsample_concat
from horch.models.dete... | 36.477612 | 136 | 0.598472 | import torch
import torch.nn as nn
import torch.nn.functional as F
from horch.common import tuplify
from horch.models.block import mb_conv_block, MBConv
from horch.models.detection.nasfpn import ReLUConvBN
from horch.models.modules import upsample_add, Conv2d, Sequential, Pool2d, upsample_concat
from horch.models.dete... | true | true |
f7326c61039f4f44e5db64824c415f984f9b2d6c | 8,034 | py | Python | nnef_tools/io/tf/graphdef/reader.py | dvorotnev/NNEF-Tools | 0219a509c34bb5b291bee497cbd658d6a5922171 | [
"Apache-2.0"
] | null | null | null | nnef_tools/io/tf/graphdef/reader.py | dvorotnev/NNEF-Tools | 0219a509c34bb5b291bee497cbd658d6a5922171 | [
"Apache-2.0"
] | null | null | null | nnef_tools/io/tf/graphdef/reader.py | dvorotnev/NNEF-Tools | 0219a509c34bb5b291bee497cbd658d6a5922171 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 The Khronos Group 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 agreed ... | 32.136 | 128 | 0.647747 |
from __future__ import division, print_function, absolute_import
from collections import namedtuple
from ....model import *
from ....utils.types import as_str
from .protobuf import *
import numpy as np
import six
Function = namedtuple('Function', ['name', 'attrs'])
_DtypeToNumpy = {
'DT_INVALID':... | true | true |
f7326cbc92b19dd088c0d4b5e17acb19500de1d9 | 4,740 | py | Python | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 43 | 2015-09-25T19:46:04.000Z | 2022-01-25T22:38:39.000Z | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 21 | 2015-09-10T15:40:26.000Z | 2021-08-31T15:17:25.000Z | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 16 | 2015-09-09T02:32:35.000Z | 2022-03-17T02:51:26.000Z | from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.decorators im... | 31.184211 | 100 | 0.665401 | from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.decorators im... | true | true |
f7326d7f452791ff8fb5bc06a352c3c3fbb10c38 | 23,224 | py | Python | test/functional/test_framework/mininode.py | minblock/lockely | 6bc00e80efdf563b52555bc2f547f271f399b03a | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | minblock/lockely | 6bc00e80efdf563b52555bc2f547f271f399b03a | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | minblock/lockely | 6bc00e80efdf563b52555bc2f547f271f399b03a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Lockelycoin ... | 39.362712 | 182 | 0.645065 |
import asyncio
from collections import defaultdict
from io import BytesIO
import logging
import struct
import sys
import threading
from test_framework.messages import (
CBlockHeader,
MIN_VERSION_SUPPORTED,
msg_addr,
msg_block,
MSG_BLOCK,
msg_blocktxn,
msg_cmpctblock,
msg_feefilter... | true | true |
f7326e08422672f437abdf740d0fd756aaca9b7e | 2,935 | py | Python | two_factor/views/mixins.py | Bassel2387/django-two-factor-auth | e69d9a7fa289a0289e6fc42f4f9cea632e01132d | [
"MIT"
] | 65 | 2021-12-30T16:58:11.000Z | 2022-03-28T21:36:51.000Z | two_factor/views/mixins.py | Bassel2387/django-two-factor-auth | e69d9a7fa289a0289e6fc42f4f9cea632e01132d | [
"MIT"
] | 68 | 2021-12-29T19:48:40.000Z | 2022-03-31T10:51:12.000Z | two_factor/views/mixins.py | Bassel2387/django-two-factor-auth | e69d9a7fa289a0289e6fc42f4f9cea632e01132d | [
"MIT"
] | 21 | 2021-12-30T16:58:14.000Z | 2022-03-30T07:10:23.000Z | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.urls import reverse
from ..utils import default_device
class OTPRequiredMixin:
"""
... | 35.361446 | 94 | 0.639864 | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.urls import reverse
from ..utils import default_device
class OTPRequiredMixin:
raise_an... | true | true |
f7326f3839bbb8c4d87f6e6f1636403646f0f7c4 | 6,253 | py | Python | integration-test/992-boundaries-min_zoom-and-name.py | nzjony/vector-datasource | 926555904cf44da06380d808fdc16f4b992bde1f | [
"MIT"
] | null | null | null | integration-test/992-boundaries-min_zoom-and-name.py | nzjony/vector-datasource | 926555904cf44da06380d808fdc16f4b992bde1f | [
"MIT"
] | null | null | null | integration-test/992-boundaries-min_zoom-and-name.py | nzjony/vector-datasource | 926555904cf44da06380d808fdc16f4b992bde1f | [
"MIT"
] | null | null | null | from . import FixtureTest
class BoundariesMinZoomAndNameNe(FixtureTest):
# global:
# # NOTE: Natural Earth 1:50 million used zooms 0,1,2,3,4
# # and only has USA, Canada, Brazil, and Australia
# # all with scalerank of 2 (a documented NE omission).
# # Then 1:10 million N... | 37.89697 | 75 | 0.565009 | from . import FixtureTest
class BoundariesMinZoomAndNameNe(FixtureTest):
'min_zoom': 5, 'sort_rank': 258})
def test_usa_region(self):
self.load_fixtures([
'file://integration-test/fixtures/'
'ne_10m_admin_1_states_provinces_lines/'
'992-ne_1... | true | true |
f7326f9a88e0ca06be5f06f02185b9b5198aa58c | 1,631 | py | Python | aiida_abinit/cli.py | gpetretto/aiida-abinit | bdbfd770eecb44a0b864bdee1d282eab92f7913d | [
"MIT"
] | null | null | null | aiida_abinit/cli.py | gpetretto/aiida-abinit | bdbfd770eecb44a0b864bdee1d282eab92f7913d | [
"MIT"
] | null | null | null | aiida_abinit/cli.py | gpetretto/aiida-abinit | bdbfd770eecb44a0b864bdee1d282eab92f7913d | [
"MIT"
] | null | null | null | """
Command line interface (cli) for aiida_abinit.
Register new commands either via the "console_scripts" entry point or plug them
directly into the 'verdi' command by using AiiDA-specific entry points like
"aiida.cmdline.data" (both in the setup.json file).
"""
import sys
import click
from aiida.cmdline.utils import... | 27.644068 | 87 | 0.676885 |
import sys
import click
from aiida.cmdline.utils import decorators
from aiida.cmdline.commands.cmd_data import verdi_data
from aiida.cmdline.params.types import DataParamType
@verdi_data.group('abinit')
def data_cli():
@data_cli.command('list')
@decorators.with_dbenv()
def list_():
from aiida.orm import Que... | true | true |
f73270246396d797d875be406506d2f9147d1917 | 390 | py | Python | src/CursoEmvideo/ex052.py | kessiarodrigues/Python-Course | 2e6097af4475d826c2b242d4699aec72301060f7 | [
"MIT"
] | null | null | null | src/CursoEmvideo/ex052.py | kessiarodrigues/Python-Course | 2e6097af4475d826c2b242d4699aec72301060f7 | [
"MIT"
] | null | null | null | src/CursoEmvideo/ex052.py | kessiarodrigues/Python-Course | 2e6097af4475d826c2b242d4699aec72301060f7 | [
"MIT"
] | null | null | null | num = int(input('Digite um número: '))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\33[33m', end='')
tot += 1
else:
print('\33[31m', end='')
print('{} '.format(c), end='')
print('\n\033[mO número {} foi divisível {} vezes'.format(num, tot))
if tot == 2:
print('E p... | 26 | 68 | 0.523077 | num = int(input('Digite um número: '))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\33[33m', end='')
tot += 1
else:
print('\33[31m', end='')
print('{} '.format(c), end='')
print('\n\033[mO número {} foi divisível {} vezes'.format(num, tot))
if tot == 2:
print('E p... | true | true |
f732708b48f8553877cd926c4f63a2d192d32cb7 | 5,209 | py | Python | groceries.py | ktg269/groceries-home | 338c40c6b7ad513bb8dd2a07d14133e7bac3427d | [
"MIT"
] | 1 | 2019-06-11T03:06:38.000Z | 2019-06-11T03:06:38.000Z | groceries.py | ktg269/groceries-home | 338c40c6b7ad513bb8dd2a07d14133e7bac3427d | [
"MIT"
] | null | null | null | groceries.py | ktg269/groceries-home | 338c40c6b7ad513bb8dd2a07d14133e7bac3427d | [
"MIT"
] | null | null | null | # groceries.py
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings", "price": 4.99},
{"id":3, "name": "Robust Golden Unsweetened Oolong Tea", "d... | 41.672 | 158 | 0.623344 |
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings", "price": 4.99},
{"id":3, "name": "Robust Golden Unsweetened Oolong Tea", "department": "b... | true | true |
f73270dce64166830a82286e79f9f4a512fe8e73 | 889 | py | Python | gamelib/main.py | trascen/u2665 | 95eef1e225a8618eab7c1c5d839329b9df31dc9e | [
"Unlicense"
] | 2 | 2017-10-16T15:27:42.000Z | 2017-10-17T17:13:29.000Z | gamelib/main.py | trascen/u2665 | 95eef1e225a8618eab7c1c5d839329b9df31dc9e | [
"Unlicense"
] | null | null | null | gamelib/main.py | trascen/u2665 | 95eef1e225a8618eab7c1c5d839329b9df31dc9e | [
"Unlicense"
] | null | null | null | '''Game main module.
Contains the entry point used by the run_game.py script.
Feel free to put all your game code here, or in other modules in this "gamelib"
package.
'''
import pygame
import pygame.display
import pygame.surface
import pygame.event
import pygame.image
import pygame.transform
from gamelib.scene impor... | 22.794872 | 101 | 0.655793 |
import pygame
import pygame.display
import pygame.surface
import pygame.event
import pygame.image
import pygame.transform
from gamelib.scene import MainScene
from gamelib.sprite import Spritey
def main():
pygame.init()
real_screen = pygame.display.set_mode([640*2, 480*2])
clock = pygame.time.Clock()
... | true | true |
f7327108494348874c7a463c5e8d80166a93299e | 1,203 | py | Python | manager/director/apps/users/migrations/0004_massemail.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 7 | 2020-08-23T23:08:34.000Z | 2021-12-02T04:17:37.000Z | manager/director/apps/users/migrations/0004_massemail.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 43 | 2020-08-24T16:48:29.000Z | 2022-03-02T19:45:54.000Z | manager/director/apps/users/migrations/0004_massemail.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 10 | 2020-08-17T20:42:52.000Z | 2021-07-16T03:46:51.000Z | # Generated by Django 2.2.12 on 2020-04-07 14:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_accepted_guidelines'),
]
operations = [
migrations.Cre... | 41.482759 | 194 | 0.637573 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_accepted_guidelines'),
]
operations = [
migrations.CreateModel(
name='MassEmail',
... | true | true |
f732712de1cc15b3e1d91ae8e6631e12c2ea6874 | 6,412 | py | Python | src/signal_processing_algorithms/gesd.py | dbradf/signal-processing-algorithms | 75312e873543f0f89aace75f43ded783395425c5 | [
"Apache-2.0"
] | 19 | 2020-04-13T11:26:50.000Z | 2022-03-28T12:43:04.000Z | src/signal_processing_algorithms/gesd.py | dbradf/signal-processing-algorithms | 75312e873543f0f89aace75f43ded783395425c5 | [
"Apache-2.0"
] | 11 | 2020-03-17T19:20:21.000Z | 2022-01-27T22:27:25.000Z | src/signal_processing_algorithms/gesd.py | dbradf/signal-processing-algorithms | 75312e873543f0f89aace75f43ded783395425c5 | [
"Apache-2.0"
] | 5 | 2020-05-13T16:53:40.000Z | 2022-01-26T23:11:45.000Z | # -*- coding: utf-8 -*-
"""
GESD based Detect outliers.
Generalized ESD Test for Outliers
see 'GESD<https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h3.htm>'
"""
import collections
from typing import List
import numpy as np
import numpy.ma as ma
import structlog
from scipy.stats import t
LOG = structlog.... | 34.473118 | 100 | 0.629757 |
import collections
from typing import List
import numpy as np
import numpy.ma as ma
import structlog
from scipy.stats import t
LOG = structlog.get_logger()
GesdResult = collections.namedtuple(
"GesdResult",
["count", "suspicious_indexes", "test_statistics", "critical_values", "all_z_scores"],
)
def gesd... | true | true |
f7327283137a8089ad6e5e8c1b25b9b0b020b6c1 | 3,502 | py | Python | salt/states/mdadm.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 1 | 2018-02-03T17:30:56.000Z | 2018-02-03T17:30:56.000Z | salt/states/mdadm.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/states/mdadm.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Managing software RAID with mdadm
==================================
A state module for creating or destroying software RAID devices.
.. code-block:: yaml
/dev/md0:
raid.present:
- opts: level=1 chunk=256 raid-devices=2 /dev/xvdd /dev/xvde
'''
# Import python libs
impor... | 23.823129 | 76 | 0.540548 |
import logging
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'raid'
def __virtual__():
if __grains__['kernel'] != 'Linux':
return False
if not salt.utils.which('mdadm'):
return False
return __virtualname__
def present(name, opts=None):
ret = {'changes... | true | true |
f732748fba75152d0b629d1da48031db0f795dd7 | 6,566 | py | Python | 02-am/08-Multuple Classifier Systems/ds_example_1.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | 02-am/08-Multuple Classifier Systems/ds_example_1.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | 02-am/08-Multuple Classifier Systems/ds_example_1.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DS_Example_1
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/19yTJF6zhM4FxOeKo726e-irJ-BXNoR3t
"""
# coding=utf-8
# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>
#
# License: BSD 3 clause
"""
=============... | 38.623529 | 81 | 0.683673 |
"""DS_Example_1
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/19yTJF6zhM4FxOeKo726e-irJ-BXNoR3t
"""
"""
====================================================================
Comparing dynamic selection with baseline static methods
==============... | false | true |
f73274ca464f6c55696bccac5f5bb1b094e363e5 | 2,916 | py | Python | var/spack/repos/builtin/packages/eospac/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2021-02-22T18:04:31.000Z | 2021-02-22T18:04:31.000Z | var/spack/repos/builtin/packages/eospac/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-04-24T13:30:08.000Z | 2020-04-24T13:40:08.000Z | var/spack/repos/builtin/packages/eospac/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 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 Eospac(Package):
"""A collection of C routines that can be used to access the Sesame data... | 57.176471 | 159 | 0.698903 |
from spack import *
class Eospac(Package):
homepage = "http://laws.lanl.gov/projects/data/eos.html"
list_url = "http://laws.lanl.gov/projects/data/eos/eospacReleases.php"
version('6.4.0', sha256='15a953beac735c68431afe86ffe33323d540d0fbbbec03ba79438dd29736051d',
url="http://laws.... | true | true |
f73274e98631a7c59fbcf53f1b533864bc4b4c67 | 6,295 | py | Python | Functions/FormFactors/SphericalShell_expDecay.py | prjemian/XAnoS | 8a70380a88421042feff6f4aa9f5cf1f79ab4efc | [
"MIT"
] | null | null | null | Functions/FormFactors/SphericalShell_expDecay.py | prjemian/XAnoS | 8a70380a88421042feff6f4aa9f5cf1f79ab4efc | [
"MIT"
] | null | null | null | Functions/FormFactors/SphericalShell_expDecay.py | prjemian/XAnoS | 8a70380a88421042feff6f4aa9f5cf1f79ab4efc | [
"MIT"
] | null | null | null | ####Please do not remove lines below####
from lmfit import Parameters
import numpy as np
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./Functions'))
sys.path.append(os.path.abspath('./Fortran_rountines'))
####Please do not remove lines above####
####Import your modules b... | 46.62963 | 177 | 0.624305 | os.path.abspath('./Functions'))
sys.path.append(os.path.abspath('./Fortran_rountines'))
if type(x)==list:
self.x=np.array(x)
else:
self.x=x
self.rmin=rmin
self.rmax=rmax
self.Nr=Nr
self.Rc=Rc
self.strho=strho
self.tst=tst
sel... | true | true |
f7327574c3e9432aac029aee865c8a55bab5ede4 | 282 | py | Python | hexa/core/migrations/0008_ci_text.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 4 | 2021-07-19T12:53:21.000Z | 2022-01-26T17:45:02.000Z | hexa/core/migrations/0008_ci_text.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 20 | 2021-05-17T12:27:06.000Z | 2022-03-30T11:35:26.000Z | hexa/core/migrations/0008_ci_text.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 2 | 2021-09-07T04:19:59.000Z | 2022-02-08T15:33:29.000Z | # Generated by Django 4.0 on 2022-01-10 15:42
from django.contrib.postgres.operations import CITextExtension
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("core", "0007_ltree"),
]
operations = [CITextExtension()]
| 20.142857 | 62 | 0.712766 |
from django.contrib.postgres.operations import CITextExtension
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("core", "0007_ltree"),
]
operations = [CITextExtension()]
| true | true |
f7327641ba028e0a7583ec0d94fadffc14edd2ba | 3,143 | py | Python | prml/linear/_bayesian_regression.py | alexandru-dinu/PRML | acd823e098df67abe0306a70225e7539f8edda40 | [
"MIT"
] | null | null | null | prml/linear/_bayesian_regression.py | alexandru-dinu/PRML | acd823e098df67abe0306a70225e7539f8edda40 | [
"MIT"
] | null | null | null | prml/linear/_bayesian_regression.py | alexandru-dinu/PRML | acd823e098df67abe0306a70225e7539f8edda40 | [
"MIT"
] | 1 | 2019-06-22T20:56:02.000Z | 2019-06-22T20:56:02.000Z | import numpy as np
from prml.linear._regression import Regression
class BayesianRegression(Regression):
"""Bayesian regression model.
w ~ N(w|0, alpha^(-1)I)
y = X @ w
t ~ N(t|X @ w, beta^(-1))
"""
def __init__(self, alpha: float = 1.0, beta: float = 1.0):
"""Initialize bayesian lin... | 31.43 | 75 | 0.570474 | import numpy as np
from prml.linear._regression import Regression
class BayesianRegression(Regression):
def __init__(self, alpha: float = 1.0, beta: float = 1.0):
self.alpha = alpha
self.beta = beta
self.w_mean = None
self.w_precision = None
def _is_prior_defined(self) -> bo... | true | true |
f73276b8fb36b5de1ebbd4da742bc1622708cb89 | 3,072 | py | Python | py/kubeflow/testing/py_lint_test.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | null | null | null | py/kubeflow/testing/py_lint_test.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | 451 | 2021-01-22T12:27:17.000Z | 2022-03-30T02:08:22.000Z | py/kubeflow/testing/py_lint_test.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | null | null | null | import fnmatch
import logging
import os
import subprocess
from kubeflow.testing import util
import pytest
logging.basicConfig(
level=logging.INFO,
format=('%(levelname)s|%(asctime)s'
'|%(pathname)s|%(lineno)d| %(message)s'),
datefmt='%Y-%m-%dT%H:%M:%S',
)
logging.getLogger().setLevel(logging.... | 30.72 | 92 | 0.675456 | import fnmatch
import logging
import os
import subprocess
from kubeflow.testing import util
import pytest
logging.basicConfig(
level=logging.INFO,
format=('%(levelname)s|%(asctime)s'
'|%(pathname)s|%(lineno)d| %(message)s'),
datefmt='%Y-%m-%dT%H:%M:%S',
)
logging.getLogger().setLevel(logging.... | true | true |
f73276ff40784e608204573966e21fed99f4909c | 38,349 | py | Python | tensorflow/python/saved_model/save.py | jnorwood/tensorflow | 67ab6c9cebc4cbb2103246a1523d04261bef22d2 | [
"Apache-2.0"
] | 2 | 2019-06-01T08:12:42.000Z | 2019-06-01T08:13:22.000Z | tensorflow/python/saved_model/save.py | jnorwood/tensorflow | 67ab6c9cebc4cbb2103246a1523d04261bef22d2 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/saved_model/save.py | jnorwood/tensorflow | 67ab6c9cebc4cbb2103246a1523d04261bef22d2 | [
"Apache-2.0"
] | 1 | 2019-05-25T17:45:38.000Z | 2019-05-25T17:45:38.000Z | # Copyright 2018 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... | 46.092548 | 157 | 0.755535 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
from tensorflow.core.framework import versions_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.core.protobuf import saved_model_pb2
from tens... | true | true |
f73278f35cc7eb414b5cff724f44716c77daceda | 74,836 | py | Python | samples/openapi3/client/petstore/python/petstore_api/model_utils.py | mabhijith95a10/openapi-generator | 0f5e7d1e3cb9642bd46ec89ffe0bf66a922029f2 | [
"Apache-2.0"
] | 1 | 2021-04-16T03:59:56.000Z | 2021-04-16T03:59:56.000Z | samples/openapi3/client/petstore/python/petstore_api/model_utils.py | mabhijith95a10/openapi-generator | 0f5e7d1e3cb9642bd46ec89ffe0bf66a922029f2 | [
"Apache-2.0"
] | 26 | 2021-03-19T20:50:29.000Z | 2022-03-21T11:32:33.000Z | samples/openapi3/client/petstore/python/petstore_api/model_utils.py | mabhijith95a10/openapi-generator | 0f5e7d1e3cb9642bd46ec89ffe0bf66a922029f2 | [
"Apache-2.0"
] | 2 | 2021-06-11T15:24:43.000Z | 2021-06-13T12:20:31.000Z | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from datetime im... | 39.449657 | 174 | 0.628721 |
from datetime import date, datetime
import inspect
import io
import os
import pprint
import re
import tempfile
from dateutil.parser import parse
from petstore_api.exceptions import (
ApiKeyError,
ApiAttributeError,
ApiTypeError,
ApiValueError,
)
none_type = type(None)
file_type = io.IOBase
clas... | true | true |
f73279dc5fe54fd731c68c1129c641f01a89beae | 596 | py | Python | Exercises/Exercises Chapter 08/8.1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 2 | 2021-09-23T19:17:24.000Z | 2021-11-29T09:03:56.000Z | Exercises/Exercises Chapter 08/8.1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | null | null | null | Exercises/Exercises Chapter 08/8.1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 1 | 2020-10-25T13:03:18.000Z | 2020-10-25T13:03:18.000Z | #definition for music_func goes here
def music_func(music, group, singer):
print("The best kind of music is", music)
print("The best music group is", group)
print("The best lead vocalist is", singer)
def main():
music, group, singer = '', '', ''
while music != 'quit':
try:
music... | 33.111111 | 83 | 0.590604 |
def music_func(music, group, singer):
print("The best kind of music is", music)
print("The best music group is", group)
print("The best lead vocalist is", singer)
def main():
music, group, singer = '', '', ''
while music != 'quit':
try:
music, group, singer = input().split(',')... | true | true |
f7327a79deea631d212afcb19ff20ebec7be7258 | 7,139 | py | Python | pybind/slxos/v16r_1_00b/vrf/address_family/ip/unicast/ip/import_/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/vrf/address_family/ip/unicast/ip/import_/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/vrf/address_family/ip/unicast/ip/import_/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 55.773438 | 779 | 0.713966 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f7327aa07b2ff6ab2654821bbe8ee0851143350f | 121,870 | py | Python | monai/transforms/spatial/array.py | Jianrong-Lu/MONAI | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | [
"Apache-2.0"
] | 1 | 2022-03-16T01:18:43.000Z | 2022-03-16T01:18:43.000Z | monai/transforms/spatial/array.py | Jianrong-Lu/MONAI | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | [
"Apache-2.0"
] | null | null | null | monai/transforms/spatial/array.py | Jianrong-Lu/MONAI | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 49.480309 | 129 | 0.622951 |
import warnings
from copy import deepcopy
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import numpy as np
import torch
from monai.config import USE_COMPILED, DtypeLike
from monai.config.type_definitions import NdarrayOrTensor
from monai.data.utils import AFFINE_TOL, compute... | true | true |
f7327b0acca1ec68ef13a676068181bf6461221b | 43 | py | Python | passbook/audit/urls.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | passbook/audit/urls.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | passbook/audit/urls.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | """passbook audit urls"""
urlpatterns = []
| 14.333333 | 25 | 0.651163 | urlpatterns = []
| true | true |
f7327ef8305d5caec9af3eb2d964b224057a2427 | 1,539 | py | Python | AI/others/aws_rekognition/test_compare_faces/main.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | null | null | null | AI/others/aws_rekognition/test_compare_faces/main.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | 3 | 2020-03-24T16:26:35.000Z | 2020-04-15T19:40:41.000Z | AI/others/aws_rekognition/test_compare_faces/main.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
import os
import boto3
# Define constants
load_dotenv()
AWS_USERNAME = os.environ['aws_username']
AWS_BUCKET = os.environ['aws_bucket']
AWS_REGION = os.environ['aws_region']
AWS_ACCESS_KEY_ID = os.environ['aws_access_key_id']
AWS_SECRET_ACCESS_KEY = os.environ['aws_secret_access_key']
... | 27.482143 | 110 | 0.747238 | from dotenv import load_dotenv
import os
import boto3
load_dotenv()
AWS_USERNAME = os.environ['aws_username']
AWS_BUCKET = os.environ['aws_bucket']
AWS_REGION = os.environ['aws_region']
AWS_ACCESS_KEY_ID = os.environ['aws_access_key_id']
AWS_SECRET_ACCESS_KEY = os.environ['aws_secret_access_key']
aws_rekognition_... | true | true |
f7327eff75f87ec7bbe56c0c96e4299744d97d89 | 22,181 | py | Python | compass/embedding.py | seitalab/compass | b08b0b711875e8e049ff07793ffe1446a6c3f144 | [
"MIT"
] | null | null | null | compass/embedding.py | seitalab/compass | b08b0b711875e8e049ff07793ffe1446a6c3f144 | [
"MIT"
] | null | null | null | compass/embedding.py | seitalab/compass | b08b0b711875e8e049ff07793ffe1446a6c3f144 | [
"MIT"
] | null | null | null | from sklearn.metrics.pairwise import cosine_similarity
from sklearn.manifold import TSNE
from sklearn.cluster import AgglomerativeClustering, KMeans
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pandas
import matplotlib.cm as cm
import umap... | 41.693609 | 237 | 0.581939 | from sklearn.metrics.pairwise import cosine_similarity
from sklearn.manifold import TSNE
from sklearn.cluster import AgglomerativeClustering, KMeans
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pandas
import matplotlib.cm as cm
import umap... | true | true |
f7327fac62add1269af1efbeb3c9b14e1e8be449 | 92 | py | Python | scraper/__main__.py | isareds/Ateco-Codes-Scraper | 9b1e714c2e0ebaa9f2a3ca563099bc739c9d7ac5 | [
"BSD-2-Clause"
] | null | null | null | scraper/__main__.py | isareds/Ateco-Codes-Scraper | 9b1e714c2e0ebaa9f2a3ca563099bc739c9d7ac5 | [
"BSD-2-Clause"
] | null | null | null | scraper/__main__.py | isareds/Ateco-Codes-Scraper | 9b1e714c2e0ebaa9f2a3ca563099bc739c9d7ac5 | [
"BSD-2-Clause"
] | null | null | null | from scraper import scrape
def main():
scrape()
if __name__ == '__main__':
main()
| 11.5 | 26 | 0.630435 | from scraper import scrape
def main():
scrape()
if __name__ == '__main__':
main()
| true | true |
f73280206473ac837a3d58a42ed24f01587f8ee6 | 9,301 | py | Python | workbench/workers/pcap_graph.py | Ayub-Khan/workbench | 710232756dd717f734253315e3d0b33c9628dafb | [
"MIT"
] | 61 | 2015-01-04T01:23:49.000Z | 2021-06-22T14:41:10.000Z | workbench/workers/pcap_graph.py | Ayub-Khan/workbench | 710232756dd717f734253315e3d0b33c9628dafb | [
"MIT"
] | 3 | 2015-01-02T23:26:59.000Z | 2015-01-03T19:28:36.000Z | workbench/workers/pcap_graph.py | Ayub-Khan/workbench | 710232756dd717f734253315e3d0b33c9628dafb | [
"MIT"
] | 17 | 2015-08-25T23:57:22.000Z | 2020-05-30T02:36:05.000Z | ''' pcap_graph worker '''
import zerorpc
import os
import pprint
import gevent
def gsleep():
''' Convenience method for gevent.sleep '''
print '*** Gevent Sleep ***'
gevent.sleep(0)
class PcapGraph(object):
''' This worker generates a graph from a PCAP (depends on Bro) '''
dependencies = ['pcap_br... | 37.353414 | 154 | 0.567681 | ''' pcap_graph worker '''
import zerorpc
import os
import pprint
import gevent
def gsleep():
''' Convenience method for gevent.sleep '''
print '*** Gevent Sleep ***'
gevent.sleep(0)
class PcapGraph(object):
''' This worker generates a graph from a PCAP (depends on Bro) '''
dependencies = ['pcap_br... | false | true |
f7328057087962ad9e6c08863139837e1f659948 | 5,366 | py | Python | docker/files/j2-filters.py | bihealth/irods-docker | 7f02be3f027e4606de56a85bc27d05b11bac736c | [
"MIT"
] | null | null | null | docker/files/j2-filters.py | bihealth/irods-docker | 7f02be3f027e4606de56a85bc27d05b11bac736c | [
"MIT"
] | 7 | 2021-10-08T09:19:12.000Z | 2022-03-29T15:22:06.000Z | docker/files/j2-filters.py | bihealth/irods-docker | 7f02be3f027e4606de56a85bc27d05b11bac736c | [
"MIT"
] | null | null | null | # NOTE: These are taken from the jinja2-ansible-filters package:
# NOTE: https://pypi.org/project/jinja2-ansible-filters
# NOTE: The installer has a problem in its egg-info preventing a regular pip install.
# NOTE: If we do not need the b64encode filter, we can omit this file and the filter setup.
# (c) 2012, Jeroen H... | 32.521212 | 91 | 0.62691 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64
import codecs
try:
string_types = basestring,
integer_types = (int, long)
class_types = (type, types.ClassType)
text_type = unicode
binary_type = str
from collections im... | true | true |
f7328081f748a48e3cf5d90ec0297525e64a80a6 | 15,124 | py | Python | flair/trainers/language_model_trainer.py | azawalich/flair | f0101ab25381aefa586ecb688d4f412d5fab5de3 | [
"MIT"
] | null | null | null | flair/trainers/language_model_trainer.py | azawalich/flair | f0101ab25381aefa586ecb688d4f412d5fab5de3 | [
"MIT"
] | null | null | null | flair/trainers/language_model_trainer.py | azawalich/flair | f0101ab25381aefa586ecb688d4f412d5fab5de3 | [
"MIT"
] | null | null | null |
import time
import datetime
import random
import sys
import logging
from pathlib import Path
from typing import Union
from torch import cuda
from torch.utils.data import Dataset, DataLoader
from torch.optim.sgd import SGD
try:
from apex import amp
except ImportError:
amp = None
import flair
from flair.data imp... | 46.250765 | 253 | 0.540796 |
import time
import datetime
import random
import sys
import logging
from pathlib import Path
from typing import Union
from torch import cuda
from torch.utils.data import Dataset, DataLoader
from torch.optim.sgd import SGD
try:
from apex import amp
except ImportError:
amp = None
import flair
from flair.data imp... | true | true |
f732816fcf0c052b8864c70a21b2d1c1057d92db | 14,981 | py | Python | airflow/providers/google/suite/hooks/sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | airflow/providers/google/suite/hooks/sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | airflow/providers/google/suite/hooks/sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 40.489189 | 103 | 0.660437 |
from typing import Any, Dict, List, Optional
from googleapiclient.discovery import build
from airflow.exceptions import AirflowException
from airflow.providers.google.cloud.hooks.base import CloudBaseHook
class GSheetsHook(CloudBaseHook):
def __init__(
self,
spreadsheet_id: s... | true | true |
f73281be9ced4bbfcc2aa580105b37462d473a71 | 5,152 | py | Python | vespa/pulse/auto_gui/manage_pulse_designs.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | null | null | null | vespa/pulse/auto_gui/manage_pulse_designs.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 4 | 2021-04-17T13:58:31.000Z | 2022-01-20T14:19:57.000Z | vespa/pulse/auto_gui/manage_pulse_designs.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 3 | 2021-06-05T16:34:57.000Z | 2022-01-19T16:13:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.5 on Mon Jul 27 15:21:25 2015
import wx
# begin wxGlade: extracode
# end wxGlade
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: MyDialog.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEF... | 42.578512 | 100 | 0.65528 |
import wx
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
wx.Dialog.__init__(self, *args, **kwds)
self.label_2 = wx.StaticText(self, wx.ID_ANY, "")
self.label_1 = wx.Stat... | true | true |
f73281d82427249aef51b7db781136ffb89a9860 | 1,042 | py | Python | isi_sdk_8_1_1/test/test_providers_summary_provider_instance.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_providers_summary_provider_instance.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_providers_summary_provider_instance.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 25.414634 | 123 | 0.744722 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from isi_sdk_8_1_1.models.providers_summary_provider_instance import ProvidersSummaryProviderInstance
from isi_sdk_8_1_1.rest import ApiException
class TestProvidersSummaryProviderInstance(unittest.TestCase):
def setUp(self):
... | true | true |
f732826458cc6b350d8bd7d018b41884c4e3e17e | 50 | py | Python | ineuron/Python_Assignment_2/reverse.py | niraj-kale/ineuron | f1ee3df4e666b0579a6aaec409c0557650c338da | [
"MIT"
] | null | null | null | ineuron/Python_Assignment_2/reverse.py | niraj-kale/ineuron | f1ee3df4e666b0579a6aaec409c0557650c338da | [
"MIT"
] | null | null | null | ineuron/Python_Assignment_2/reverse.py | niraj-kale/ineuron | f1ee3df4e666b0579a6aaec409c0557650c338da | [
"MIT"
] | null | null | null | word = input("Input a word : ")
print(word[::-1]) | 16.666667 | 31 | 0.58 | word = input("Input a word : ")
print(word[::-1]) | true | true |
f73283321fed4349be2b954e61d0cbe802264e78 | 3,075 | py | Python | cellpack/mgl_tools/mglutil/web/Tests/test_htmlparser.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | cellpack/mgl_tools/mglutil/web/Tests/test_htmlparser.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | 21 | 2021-10-02T00:07:05.000Z | 2022-03-30T00:02:10.000Z | cellpack/mgl_tools/mglutil/web/Tests/test_htmlparser.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | #########################################################################
#
# Date: Nov. 2002 Author: Daniel Stoffler
#
# Copyright: Daniel Stoffler and TSRI
#
#########################################################################
import sys
from mglutil.regression import testplus
from mglutil.web import HTMLParse... | 34.550562 | 83 | 0.556748 | true | true | |
f73283969bf30cb0fc5192375960b26d761e5a1f | 3,088 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/TableLayoutCellPaintEventHandler.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/TableLayoutCellPaintEventHandler.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/TableLayoutCellPaintEventHandler.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class TableLayoutCellPaintEventHandler(MulticastDelegate, ICloneable, ISerializable):
"""
Represents the method that will handle the System.Windows.Forms.TableLayoutPanel.CellPaint event.
TableLayoutCellPaintEventHandler(object: object,method: IntPtr)
"""
def BeginInvoke(self, sender, e, callba... | 29.409524 | 221 | 0.680376 | class TableLayoutCellPaintEventHandler(MulticastDelegate, ICloneable, ISerializable):
def BeginInvoke(self, sender, e, callback, object):
pass
def CombineImpl(self, *args):
pass
def DynamicInvokeImpl(self, *args):
pass
def EndInvoke(self, result):
pass
... | true | true |
f73283aa4b808065d101ef22fa6cf7432a504266 | 1,531 | py | Python | test/autests/gold_tests/http2/http2.test.py | dragon512/proxy-verifier | d48d680bb5a2540af3c2cdc2968a4c1bef7546e1 | [
"Apache-2.0"
] | null | null | null | test/autests/gold_tests/http2/http2.test.py | dragon512/proxy-verifier | d48d680bb5a2540af3c2cdc2968a4c1bef7546e1 | [
"Apache-2.0"
] | null | null | null | test/autests/gold_tests/http2/http2.test.py | dragon512/proxy-verifier | d48d680bb5a2540af3c2cdc2968a4c1bef7546e1 | [
"Apache-2.0"
] | null | null | null | '''
Verify basic HTTP/2 functionality.
'''
# @file
#
# Copyright 2020, Verizon Media
# SPDX-License-Identifier: Apache-2.0
#
Test.Summary = '''
Verify basic HTTP/2 functionality.
'''
#
# Test 1: Verify correct behavior of a single HTTP/2 transaction.
#
r = Test.AddTestRun("Verify HTTP/2 processing of a single HTTP tr... | 37.341463 | 79 | 0.713912 |
Test.Summary = '''
Verify basic HTTP/2 functionality.
'''
r = Test.AddTestRun("Verify HTTP/2 processing of a single HTTP transaction")
client = r.AddClientProcess("client1", "replay_files/single_transaction",
https_ports=[4443], other_args="--verbose diag")
server = r.AddServerProc... | true | true |
f73284f41fb12e4db4f2efa82ea93234487e746d | 7,389 | py | Python | lib/rucio/daemons/judge/cleaner.py | nataliaratnikova/rucio | 4c7789bb9cdb824cc90b91fa0b66acf1b0fac128 | [
"Apache-2.0"
] | 1 | 2018-02-27T08:03:41.000Z | 2018-02-27T08:03:41.000Z | lib/rucio/daemons/judge/cleaner.py | greed2411/rucio | 3e9a50ce1c3b062a0d048e7aa125ca8ce36fe78e | [
"Apache-2.0"
] | null | null | null | lib/rucio/daemons/judge/cleaner.py | greed2411/rucio | 3e9a50ce1c3b062a0d048e7aa125ca8ce36fe78e | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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.464706 | 178 | 0.611043 |
"""
Judge-Cleaner is a daemon to clean expired replication rules.
"""
import logging
import os
import socket
import sys
import threading
import time
import traceback
from copy import deepcopy
from datetime import datetime, timedelta
from re import match
from random import randint
from sqlalchemy... | false | true |
f73284f572868ccb38a791c5403e5082b6b22e6b | 1,386 | py | Python | 17abriledp.py | mecanimatico/codigo_edp | 42080a4eb0f604873f9743ff0d0b8afde0735181 | [
"MIT"
] | null | null | null | 17abriledp.py | mecanimatico/codigo_edp | 42080a4eb0f604873f9743ff0d0b8afde0735181 | [
"MIT"
] | null | null | null | 17abriledp.py | mecanimatico/codigo_edp | 42080a4eb0f604873f9743ff0d0b8afde0735181 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 17 09:57:12 2020
@author: Heber
"""
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
#%% valor exacto d ela derivada
up = np.cos(1.0)
h = 0.1
up_aprox = (np.sin(1+h)-np.sin(1))/h
error = up - up_aprox
print ("Valor aproximado: ",up_aprox)... | 21.323077 | 66 | 0.626984 |
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
up = np.cos(1.0)
h = 0.1
up_aprox = (np.sin(1+h)-np.sin(1))/h
error = up - up_aprox
print ("Valor aproximado: ",up_aprox)
print ("Valor del error: ",error)
list = [0.1, 0.01, 0.001, 0.0001, 0.00001]
aprox_values = []
errores_values... | true | true |
f7328648318dc515b6598a87c836b978e51bb37d | 845 | py | Python | learning-py/level0/exam_stats.py | b-ak/fluffy-engine | 3bd1ac9b5ebd3f46bd4efd08443dbc22159453f6 | [
"MIT"
] | null | null | null | learning-py/level0/exam_stats.py | b-ak/fluffy-engine | 3bd1ac9b5ebd3f46bd4efd08443dbc22159453f6 | [
"MIT"
] | null | null | null | learning-py/level0/exam_stats.py | b-ak/fluffy-engine | 3bd1ac9b5ebd3f46bd4efd08443dbc22159453f6 | [
"MIT"
] | null | null | null | grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def print_grades(grades):
for grade in grades:
print grade
def grades_sum(grades):
total = 0
for grade in grades:
total += grade
return total
def grades_average(grades):
sum_of_grades = grades_sum(grades)
avera... | 22.236842 | 66 | 0.686391 | grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def print_grades(grades):
for grade in grades:
print grade
def grades_sum(grades):
total = 0
for grade in grades:
total += grade
return total
def grades_average(grades):
sum_of_grades = grades_sum(grades)
avera... | false | true |
f73287eee23516b86d7a58a9027c13d6bae3f980 | 993 | py | Python | doc/sphinxext/setup.py | celiafish/scikit-xray | 660a37821d58544b6443c5b8cd9c96daef577ed2 | [
"BSD-3-Clause"
] | 71 | 2016-01-04T22:32:27.000Z | 2022-03-25T07:57:54.000Z | doc/sphinxext/setup.py | celiafish/scikit-xray | 660a37821d58544b6443c5b8cd9c96daef577ed2 | [
"BSD-3-Clause"
] | 288 | 2015-12-09T23:40:31.000Z | 2021-02-02T00:32:00.000Z | doc/sphinxext/setup.py | celiafish/scikit-xray | 660a37821d58544b6443c5b8cd9c96daef577ed2 | [
"BSD-3-Clause"
] | 53 | 2015-12-10T14:35:17.000Z | 2021-06-24T13:36:00.000Z | from distutils.core import setup
import setuptools
import sys
import os
version = "0.3.dev"
setup(
name="numpydoc",
packages=["numpydoc"],
package_dir={"numpydoc": ""},
version=version,
description="Sphinx extension to support docstrings in Numpy format",
# classifiers from http://pypi.python.... | 30.090909 | 77 | 0.629406 | from distutils.core import setup
import setuptools
import sys
import os
version = "0.3.dev"
setup(
name="numpydoc",
packages=["numpydoc"],
package_dir={"numpydoc": ""},
version=version,
description="Sphinx extension to support docstrings in Numpy format",
classifiers=["Development Status ... | true | true |
f73289685bd37aa689ba66d97e917694c4fc2fa7 | 1,147 | py | Python | remake/examples/ex8.py | markmuetz/remake | a3c5098be57b60b01ffaa4a7fcb937f9337dcdea | [
"Apache-2.0"
] | null | null | null | remake/examples/ex8.py | markmuetz/remake | a3c5098be57b60b01ffaa4a7fcb937f9337dcdea | [
"Apache-2.0"
] | 35 | 2020-12-22T11:36:46.000Z | 2021-12-03T15:49:41.000Z | remake/examples/ex8.py | markmuetz/remake | a3c5098be57b60b01ffaa4a7fcb937f9337dcdea | [
"Apache-2.0"
] | null | null | null | """Demonstrates partial run when some input data not there.
"""
from remake import Remake, TaskRule
ex8 = Remake()
class CannotRun(TaskRule):
rule_inputs = {'in1': 'data/inputs/input_not_there.txt'}
rule_outputs = {'out': 'data/inputs/ex8_in1.txt'}
def rule_run(self):
input_text = self.inputs['i... | 28.675 | 101 | 0.617262 | from remake import Remake, TaskRule
ex8 = Remake()
class CannotRun(TaskRule):
rule_inputs = {'in1': 'data/inputs/input_not_there.txt'}
rule_outputs = {'out': 'data/inputs/ex8_in1.txt'}
def rule_run(self):
input_text = self.inputs['in1'].read_text()
self.outputs['out'].write_text(input_te... | true | true |
f73289beadbbd779b42062ae2dd20756a3a1975e | 18,377 | py | Python | python_modules/dagster/dagster/core/types/runtime.py | cclauss/dagster | 6494edbfd52526812aadf941bf90edf3ade1d912 | [
"Apache-2.0"
] | 1 | 2019-07-15T17:34:04.000Z | 2019-07-15T17:34:04.000Z | python_modules/dagster/dagster/core/types/runtime.py | stevencasey/dagster | 1881f67f55725c40432dbc1ed99b8cfbd9629600 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/types/runtime.py | stevencasey/dagster | 1881f67f55725c40432dbc1ed99b8cfbd9629600 | [
"Apache-2.0"
] | null | null | null | from functools import partial
import six
from dagster import check
from dagster.core.storage.type_storage import TypeStoragePlugin
from .builtin_enum import BuiltinEnum
from .builtin_config_schemas import BuiltinSchemas
from .config import ConfigType
from .config import List as ConfigList
from .config import Nullab... | 31.467466 | 100 | 0.681885 | from functools import partial
import six
from dagster import check
from dagster.core.storage.type_storage import TypeStoragePlugin
from .builtin_enum import BuiltinEnum
from .builtin_config_schemas import BuiltinSchemas
from .config import ConfigType
from .config import List as ConfigList
from .config import Nullab... | true | true |
f7328a99195b9c2f34557772f93a23c78d7e72a9 | 43,541 | py | Python | pandas/tests/indexes/test_category.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/test_category.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/test_category.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | 1 | 2019-03-31T13:46:57.000Z | 2019-03-31T13:46:57.000Z | # -*- coding: utf-8 -*-
import pytest
import pandas.util.testing as tm
from pandas.core.indexes.api import Index, CategoricalIndex
from pandas.core.dtypes.dtypes import CategoricalDtype
from .common import Base
from pandas.compat import range, PY3
import numpy as np
from pandas import Categorical, IntervalIndex, c... | 40.883568 | 148 | 0.538757 |
import pytest
import pandas.util.testing as tm
from pandas.core.indexes.api import Index, CategoricalIndex
from pandas.core.dtypes.dtypes import CategoricalDtype
from .common import Base
from pandas.compat import range, PY3
import numpy as np
from pandas import Categorical, IntervalIndex, compat
from pandas.util.... | true | true |
f7328ae4cc169670c4d9df3cd477025254fdd601 | 1,362 | py | Python | python/dazl/prim/map.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/prim/map.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/prim/map.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
__all__ = ["FrozenDict", "to_hashable"]
class FrozenDict(dict):
"""
A special subclass of `dict` that is immutable and hashable. Instances of this "dict" can be
use... | 27.795918 | 102 | 0.666667 |
__all__ = ["FrozenDict", "to_hashable"]
class FrozenDict(dict):
def __hash__(self):
return 0
def __delitem__(self, *args, **kwargs):
raise RuntimeError("frozendicts are immutable")
def __setitem__(self, key, value):
raise RuntimeError("frozendicts are immutable")
def pop... | true | true |
f7328b27c5d39fc42635191efb78c9f2abcabf91 | 824 | py | Python | core/queue.py | Kaneki1416/kenKaneki | cdd59c18b74d559d277b736e5e536884ce4e9499 | [
"MIT"
] | 1 | 2022-01-11T21:59:34.000Z | 2022-01-11T21:59:34.000Z | core/queue.py | Kaneki1416/kenKaneki | cdd59c18b74d559d277b736e5e536884ce4e9499 | [
"MIT"
] | 1 | 2022-01-22T14:40:01.000Z | 2022-01-22T14:40:59.000Z | core/queue.py | Kaneki1416/kenKaneki | cdd59c18b74d559d277b736e5e536884ce4e9499 | [
"MIT"
] | 4 | 2021-11-19T12:45:56.000Z | 2022-02-12T03:28:44.000Z | from typing import Dict, List
class Playlist:
def __init__(self):
self.__queue: Dict[int, List[Dict[str, str]]] = {}
def insert_one(self, chat_id: int, data: Dict[str, str]):
if chat_id not in self.__queue:
self.__queue[chat_id] = [data]
else:
queue = self.__qu... | 25.75 | 94 | 0.618932 | from typing import Dict, List
class Playlist:
def __init__(self):
self.__queue: Dict[int, List[Dict[str, str]]] = {}
def insert_one(self, chat_id: int, data: Dict[str, str]):
if chat_id not in self.__queue:
self.__queue[chat_id] = [data]
else:
queue = self.__qu... | true | true |
f7328c285019752a361691904a430d2add9f3a79 | 7,933 | py | Python | smellCatalog/HtmlGenerator.py | neilernst/smells | c093ee72a12f62693d8635359b7ca4958ecba0e0 | [
"MIT"
] | null | null | null | smellCatalog/HtmlGenerator.py | neilernst/smells | c093ee72a12f62693d8635359b7ca4958ecba0e0 | [
"MIT"
] | null | null | null | smellCatalog/HtmlGenerator.py | neilernst/smells | c093ee72a12f62693d8635359b7ca4958ecba0e0 | [
"MIT"
] | 1 | 2019-07-15T14:16:37.000Z | 2019-07-15T14:16:37.000Z | import os
import datetime
import FixedText
class HtmlGenerator(object):
def __init__(self, output_path, smell_list, category_list):
self.smell_list = smell_list
self.out_path = output_path
self.category_list = category_list
def generate(self):
self.generate_index()
self... | 46.122093 | 134 | 0.576201 | import os
import datetime
import FixedText
class HtmlGenerator(object):
def __init__(self, output_path, smell_list, category_list):
self.smell_list = smell_list
self.out_path = output_path
self.category_list = category_list
def generate(self):
self.generate_index()
self... | true | true |
f7328d27708be173337c84cd136370e78d9f3791 | 1,827 | py | Python | controller/test5_hw_test/rotate_axis.py | drummonds/od-robot | a74954aefecb49654686dc0539ea23cb915c6f4d | [
"MIT"
] | null | null | null | controller/test5_hw_test/rotate_axis.py | drummonds/od-robot | a74954aefecb49654686dc0539ea23cb915c6f4d | [
"MIT"
] | null | null | null | controller/test5_hw_test/rotate_axis.py | drummonds/od-robot | a74954aefecb49654686dc0539ea23cb915c6f4d | [
"MIT"
] | null | null | null | from machine import Pin, PWM
import pycom
import time
class Rotate:
# Servo to fixed position
def __init__(self, pwm):
# Assum 50ms timer already set up and going to reuse
self.pwm = pwm
self.is_active = False
self.at_position = 50
def run(self):
pass
def state... | 30.966102 | 81 | 0.621237 | from machine import Pin, PWM
import pycom
import time
class Rotate:
def __init__(self, pwm):
self.pwm = pwm
self.is_active = False
self.at_position = 50
def run(self):
pass
def state_text(self):
return 'Rotate position = {}'.format(self.at_position)
... | true | true |
f7328dcbb442c75712e43ef7b1e1e4a6045a4a4e | 18,431 | py | Python | megatron/checkpointing.py | adammoody/Megatron-DeepSpeed | 972211163608818fe9e5ba821246f18d0a5dc264 | [
"MIT"
] | null | null | null | megatron/checkpointing.py | adammoody/Megatron-DeepSpeed | 972211163608818fe9e5ba821246f18d0a5dc264 | [
"MIT"
] | null | null | null | megatron/checkpointing.py | adammoody/Megatron-DeepSpeed | 972211163608818fe9e5ba821246f18d0a5dc264 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | 39.980477 | 95 | 0.629646 |
import os
import random
import sys
import numpy as np
import torch
from megatron.global_vars import codecarbon_tracker_flush
from megatron import (get_args,
mpu,
print_rank_0,
update_num_microbatches,
utils)
_CHEC... | true | true |
f7328e07aa94a65699960aed21b01b92175dfc88 | 1,011 | py | Python | random_stuff/telnetlib_logging.py | adw1n/competitive-programming | b28a166e7c93d7b239c0a6b09eafd6020685afdf | [
"WTFPL"
] | null | null | null | random_stuff/telnetlib_logging.py | adw1n/competitive-programming | b28a166e7c93d7b239c0a6b09eafd6020685afdf | [
"WTFPL"
] | null | null | null | random_stuff/telnetlib_logging.py | adw1n/competitive-programming | b28a166e7c93d7b239c0a6b09eafd6020685afdf | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
import telnetlib
import struct
import logging
HOST="localhost"
#while true; do nc -l -p 1111 -e /tmp/vuln; done
old_write=telnetlib.Telnet.write
def write(self, str_: bytes):
try:
print("w: ",str_.decode("utf-8"))
except UnicodeDecodeError:
print("w: ",str_)
old_writ... | 23.511628 | 61 | 0.67458 |
import telnetlib
import struct
import logging
HOST="localhost"
old_write=telnetlib.Telnet.write
def write(self, str_: bytes):
try:
print("w: ",str_.decode("utf-8"))
except UnicodeDecodeError:
print("w: ",str_)
old_write(self,str_)
telnetlib.Telnet.write=write
old_read_until=telnetlib.Tel... | true | true |
f7328e156f28c6f0afe95eec86b2d14e86dd4c08 | 33,157 | py | Python | custom_components/enerpi.py | azogue/hass_config | 86113e4f1db0e785fa9a095add241f423efb8403 | [
"MIT"
] | 21 | 2017-01-22T13:12:07.000Z | 2020-12-22T13:46:45.000Z | custom_components/enerpi.py | azogue/hass_config | 86113e4f1db0e785fa9a095add241f423efb8403 | [
"MIT"
] | 1 | 2017-06-26T22:26:15.000Z | 2017-07-05T19:36:29.000Z | custom_components/enerpi.py | azogue/hass_config | 86113e4f1db0e785fa9a095add241f423efb8403 | [
"MIT"
] | 4 | 2017-07-07T04:21:39.000Z | 2020-04-10T13:16:08.000Z | # -*- coding: utf-8 -*-
"""
# Home Assistant Custom Component supporting [enerPI sensors](https://github.com/azogue/enerpi)
running *enerpi* + *enerpiweb* in some local host.
Derived from the general REST sensor (https://home-assistant.io/components/sensor.rest/), it connects via GET requests
to the local working ener... | 41.498123 | 118 | 0.565612 |
"""
# Home Assistant Custom Component supporting [enerPI sensors](https://github.com/azogue/enerpi)
running *enerpi* + *enerpiweb* in some local host.
Derived from the general REST sensor (https://home-assistant.io/components/sensor.rest/), it connects via GET requests
to the local working enerpi web server and popul... | false | true |
f7328e7d8e965d4fc8718dd18bf2b119145af16a | 9,759 | py | Python | platform/gsutil/third_party/boto/tests/unit/utils/test_utils.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 1 | 2021-04-30T05:26:20.000Z | 2021-04-30T05:26:20.000Z | platform/gsutil/third_party/boto/tests/unit/utils/test_utils.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | platform/gsutil/third_party/boto/tests/unit/utils/test_utils.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | # Copyright (c) 2010 Robert Mela
#
# 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, dis-
# ... | 33.307167 | 81 | 0.650579 |
try:
import unittest2 as unittest
except ImportError:
import unittest
import datetime
import hashlib
import hmac
import locale
import mock
import thread
import time
import boto.utils
from boto.utils import Password
from boto.utils import pythonize_name
from boto.utils import _build_instan... | true | true |
f7328f2ec786dc897da0bb3735ef8a755cd94bc3 | 772 | py | Python | Armadillo-IoT_GW/modules/reporters/temperature_reporter.py | naomitodori/Azure-IoT-samples | f98ad55eaab0d3fe52a5ff17a8d312aa69df0cce | [
"MIT"
] | 3 | 2021-08-01T00:31:50.000Z | 2021-12-15T23:42:52.000Z | Armadillo-IoT_GW/modules/reporters/temperature_reporter.py | naomitodori/Azure-IoT-samples | f98ad55eaab0d3fe52a5ff17a8d312aa69df0cce | [
"MIT"
] | null | null | null | Armadillo-IoT_GW/modules/reporters/temperature_reporter.py | naomitodori/Azure-IoT-samples | f98ad55eaab0d3fe52a5ff17a8d312aa69df0cce | [
"MIT"
] | 3 | 2021-12-07T13:18:44.000Z | 2022-01-28T00:41:46.000Z | from modules.lib.reporter import Reporter
from modules.lib.report import Report
from modules.lib.alarm_machine import AlarmMachine
class TemperatureReporter(Reporter):
def data_type(self):
return 'temperature'
def report(self):
with open('/sys/class/thermal/thermal_zone0/temp') as file:
... | 29.692308 | 67 | 0.576425 | from modules.lib.reporter import Reporter
from modules.lib.report import Report
from modules.lib.alarm_machine import AlarmMachine
class TemperatureReporter(Reporter):
def data_type(self):
return 'temperature'
def report(self):
with open('/sys/class/thermal/thermal_zone0/temp') as file:
... | true | true |
f73290c0fd0677b07fe0cd79a344a6e52fbf148d | 733 | py | Python | setup.py | consideRatio/the-littlest-jupyterhub | 9179365a4ff9d5642a12df09b6d0b4271097fed6 | [
"BSD-3-Clause"
] | null | null | null | setup.py | consideRatio/the-littlest-jupyterhub | 9179365a4ff9d5642a12df09b6d0b4271097fed6 | [
"BSD-3-Clause"
] | 1 | 2021-04-07T13:16:00.000Z | 2021-04-07T13:16:00.000Z | setup.py | consideRatio/the-littlest-jupyterhub | 9179365a4ff9d5642a12df09b6d0b4271097fed6 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='the-littlest-jupyterhub',
version='0.1',
description='A small JupyterHub distribution',
url='https://github.com/jupyterhub/the-littlest-jupyterhub',
author='Jupyter Development Team',
author_email='jupyter@googlegroups.com',
license='... | 25.275862 | 64 | 0.594816 | from setuptools import setup, find_packages
setup(
name='the-littlest-jupyterhub',
version='0.1',
description='A small JupyterHub distribution',
url='https://github.com/jupyterhub/the-littlest-jupyterhub',
author='Jupyter Development Team',
author_email='jupyter@googlegroups.com',
license='... | true | true |
f73290d84c37138805df43d4dc3c217150c2e691 | 11,133 | py | Python | brain.py | hugodemenez/HistoricalMemoryTradingAlgorithm | d51d14632d0ffade27383bb8672c2ece450665a2 | [
"MIT"
] | null | null | null | brain.py | hugodemenez/HistoricalMemoryTradingAlgorithm | d51d14632d0ffade27383bb8672c2ece450665a2 | [
"MIT"
] | null | null | null | brain.py | hugodemenez/HistoricalMemoryTradingAlgorithm | d51d14632d0ffade27383bb8672c2ece450665a2 | [
"MIT"
] | null | null | null | r"""
Ce programme sert à ouvrir, gérer et fermer les positions.
Enregistre les positions dans la base de données et dans un fichier excel,
les affiches dans le terminal puis envoie une notification au groupe telegram
"""
import time,datetime,os,sys,requests
from brokerconnection import realcommands
from prediction im... | 34.790625 | 223 | 0.633971 | import time,datetime,os,sys,requests
from brokerconnection import realcommands
from prediction import Prediction
from settings import Settings
from database import Database
from position import Position
from csv_generator import csv_generator
Position=Position()
Settings=Settings()
Database=Database()
def current_... | true | true |
f73291c826cb60dbd0831bf1e0263014829f7443 | 1,399 | py | Python | fastreid/layers/cos_softmax.py | tycallen/fast-reid | 66683fa95bc7d7222659e8db3ac04e5b8e366190 | [
"Apache-2.0"
] | 19 | 2021-09-10T02:16:29.000Z | 2022-03-27T12:47:46.000Z | fastreid/layers/cos_softmax.py | tycallen/fast-reid | 66683fa95bc7d7222659e8db3ac04e5b8e366190 | [
"Apache-2.0"
] | 5 | 2021-09-27T03:52:12.000Z | 2021-12-29T09:13:40.000Z | fastreid/layers/cos_softmax.py | tycallen/fast-reid | 66683fa95bc7d7222659e8db3ac04e5b8e366190 | [
"Apache-2.0"
] | 3 | 2021-12-23T16:44:44.000Z | 2022-03-27T12:47:47.000Z | # encoding: utf-8
"""
@author: xingyu liao
@contact: sherlockliao01@gmail.com
"""
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Parameter
class CosSoftmax(nn.Module):
r"""Implement of large margin cosine distance:
Args:
in_feat: size of each input sample
... | 31.795455 | 90 | 0.584703 |
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Parameter
class CosSoftmax(nn.Module):
def __init__(self, cfg, in_feat, num_classes):
super().__init__()
self.in_features = in_feat
self._num_classes = num_classes
self.s = cfg.MODEL.HEADS.SCA... | true | true |
f732945508b4f5b0ce0dabe10f16e4ac669fd278 | 92 | py | Python | myapp/app.py | cwg83/cgoodale.com-flask | 50a18585e8d0e2ae31bfb12ed552e1c5089094c2 | [
"CC0-1.0"
] | null | null | null | myapp/app.py | cwg83/cgoodale.com-flask | 50a18585e8d0e2ae31bfb12ed552e1c5089094c2 | [
"CC0-1.0"
] | null | null | null | myapp/app.py | cwg83/cgoodale.com-flask | 50a18585e8d0e2ae31bfb12ed552e1c5089094c2 | [
"CC0-1.0"
] | null | null | null | from calblog import app
if __name__ == '__main__':
app.run(port=34630, debug=True)
| 10.222222 | 35 | 0.673913 | from calblog import app
if __name__ == '__main__':
app.run(port=34630, debug=True)
| true | true |
f73294872a3d8143e1add44fe880ba57f1fac308 | 2,252 | py | Python | mlapp/integrations/aml/scripts/publish_multisteps_pipeline.py | nbk905/mlapp | af650a8a302959674dd5a1bc6d15e30e90abf227 | [
"Apache-2.0"
] | null | null | null | mlapp/integrations/aml/scripts/publish_multisteps_pipeline.py | nbk905/mlapp | af650a8a302959674dd5a1bc6d15e30e90abf227 | [
"Apache-2.0"
] | null | null | null | mlapp/integrations/aml/scripts/publish_multisteps_pipeline.py | nbk905/mlapp | af650a8a302959674dd5a1bc6d15e30e90abf227 | [
"Apache-2.0"
] | null | null | null | from azureml.data.data_reference import DataReference
from azureml.pipeline.core import PipelineData
from mlapp.integrations.aml.utils.compute import get_or_create_compute_target
from mlapp.integrations.aml.utils.constants import OUTPUT_PATH_ON_COMPUTE, DATA_REFERENCE_NAME
from mlapp.integrations.aml.utils.pipeline im... | 35.1875 | 103 | 0.654085 | from azureml.data.data_reference import DataReference
from azureml.pipeline.core import PipelineData
from mlapp.integrations.aml.utils.compute import get_or_create_compute_target
from mlapp.integrations.aml.utils.constants import OUTPUT_PATH_ON_COMPUTE, DATA_REFERENCE_NAME
from mlapp.integrations.aml.utils.pipeline im... | true | true |
f732951c2a10f606835e6edf4dd28492d430def9 | 4,455 | py | Python | aggregator.py | lorrainewongmw/synthetic-data-showcase | c686478e5b58e3a2bc0e3bdd6d6f5c7a8378ff5d | [
"MIT"
] | null | null | null | aggregator.py | lorrainewongmw/synthetic-data-showcase | c686478e5b58e3a2bc0e3bdd6d6f5c7a8378ff5d | [
"MIT"
] | null | null | null | aggregator.py | lorrainewongmw/synthetic-data-showcase | c686478e5b58e3a2bc0e3bdd6d6f5c7a8378ff5d | [
"MIT"
] | null | null | null | import time
import datetime
import logging
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from os import path
import util as util
def aggregate(config):
"""Aggregates the sensitive microdata at sensitive_microdata_path.
Produces the reportable_agg... | 47.903226 | 180 | 0.700561 | import time
import datetime
import logging
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from os import path
import util as util
def aggregate(config):
use_columns = config['use_columns']
reporting_length = config['reporting_length']
reportin... | true | true |
f73295e0bdf841a082ee62af3dfeefbf417d5f78 | 2,131 | py | Python | src/wormhole/server/cmd_server.py | LeastAuthority/magic-wormhole | 2fadadc4dba78f167cfc1295bbea7ee778d22dd5 | [
"MIT"
] | null | null | null | src/wormhole/server/cmd_server.py | LeastAuthority/magic-wormhole | 2fadadc4dba78f167cfc1295bbea7ee778d22dd5 | [
"MIT"
] | null | null | null | src/wormhole/server/cmd_server.py | LeastAuthority/magic-wormhole | 2fadadc4dba78f167cfc1295bbea7ee778d22dd5 | [
"MIT"
] | null | null | null | from __future__ import print_function, unicode_literals
import os, time
from twisted.python import usage
from twisted.scripts import twistd
class MyPlugin(object):
tapname = "xyznode"
def __init__(self, args):
self.args = args
def makeService(self, so):
# delay this import as late as poss... | 29.191781 | 78 | 0.632098 | from __future__ import print_function, unicode_literals
import os, time
from twisted.python import usage
from twisted.scripts import twistd
class MyPlugin(object):
tapname = "xyznode"
def __init__(self, args):
self.args = args
def makeService(self, so):
# accept --reactor= select... | true | true |
f7329645c63bbeced2675087da6bdc4f97ad2b38 | 14,433 | py | Python | src/spaceone/inventory/libs/schema/dynamic_field.py | xellos00/plugin-aws-cloud-services | 56ac9d6f2edafc5abcd236c046726f169a72e1f6 | [
"Apache-2.0"
] | 2 | 2020-06-22T09:49:22.000Z | 2021-01-03T22:21:27.000Z | src/spaceone/inventory/libs/schema/dynamic_field.py | xellos00/plugin-aws-cloud-services | 56ac9d6f2edafc5abcd236c046726f169a72e1f6 | [
"Apache-2.0"
] | 2 | 2020-07-20T01:58:32.000Z | 2020-08-04T07:41:37.000Z | src/spaceone/inventory/libs/schema/dynamic_field.py | xellos00/plugin-aws-cloud-services | 56ac9d6f2edafc5abcd236c046726f169a72e1f6 | [
"Apache-2.0"
] | 5 | 2020-10-13T15:05:12.000Z | 2021-04-19T10:25:24.000Z | import math
from schematics import Model
from schematics.types import ModelType, StringType, PolyModelType, DictType, ListType, BooleanType
from .dynamic_search import BaseDynamicSearch
BACKGROUND_COLORS = [
'black', 'white',
'gray', 'gray.100', 'gray.200', 'gray.300', 'gray.400', 'gray.500', 'gray.600', 'gra... | 36.355164 | 149 | 0.655304 | import math
from schematics import Model
from schematics.types import ModelType, StringType, PolyModelType, DictType, ListType, BooleanType
from .dynamic_search import BaseDynamicSearch
BACKGROUND_COLORS = [
'black', 'white',
'gray', 'gray.100', 'gray.200', 'gray.300', 'gray.400', 'gray.500', 'gray.600', 'gra... | true | true |
f732973606615a3331fc3a1c31ad6b4ec5b373d0 | 17,786 | py | Python | pyon/core/governance/policy/policy_decision.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | 2 | 2015-06-09T16:07:09.000Z | 2015-07-28T10:06:31.000Z | pyon/core/governance/policy/policy_decision.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | 3 | 2020-07-22T15:14:55.000Z | 2021-12-13T19:35:06.000Z | pyon/core/governance/policy/policy_decision.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
__author__ = 'Stephen P. Henrie'
from os import path
from StringIO import StringIO
from ndg.xacml.parsers.etree.factory import ReaderFactory
from ndg.xacml.core import Identifiers, XACML_1_0_PREFIX
from ndg.xacml.core.attribute import Attribute
from ndg.xacml.core.attributevalue import... | 42.550239 | 197 | 0.720173 |
__author__ = 'Stephen P. Henrie'
from os import path
from StringIO import StringIO
from ndg.xacml.parsers.etree.factory import ReaderFactory
from ndg.xacml.core import Identifiers, XACML_1_0_PREFIX
from ndg.xacml.core.attribute import Attribute
from ndg.xacml.core.attributevalue import (AttributeValue,
... | false | true |
f732973ab5e14dcb0ef39a1adb7dc2e525a39b6e | 3,963 | py | Python | tests/sentry/manager/tests.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/manager/tests.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/manager/tests.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.models import Group, Project, Team, User
from sentry.testutils import TestCase
class SentryManagerTest(TestCase):
def test_valid_only_message(self):
event = Group.objects.from_kwargs(1, message="foo")
self.assertEquals(event.group.last_seen, even... | 41.28125 | 93 | 0.671209 | from __future__ import absolute_import
from sentry.models import Group, Project, Team, User
from sentry.testutils import TestCase
class SentryManagerTest(TestCase):
def test_valid_only_message(self):
event = Group.objects.from_kwargs(1, message="foo")
self.assertEquals(event.group.last_seen, even... | true | true |
f732974670da14d5adf61de60ba71cb11ddc2b88 | 1,814 | py | Python | pytorch_toolkit/face_recognition/model/blocks/mobilenet_v2_blocks.py | JinYAnGHe/openvino_training_extensions | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | [
"Apache-2.0"
] | null | null | null | pytorch_toolkit/face_recognition/model/blocks/mobilenet_v2_blocks.py | JinYAnGHe/openvino_training_extensions | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | [
"Apache-2.0"
] | null | null | null | pytorch_toolkit/face_recognition/model/blocks/mobilenet_v2_blocks.py | JinYAnGHe/openvino_training_extensions | a0b4456a3c9fe6c1b7eabc9d5eb4e74d01453dee | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 37.791667 | 91 | 0.677508 |
import torch.nn as nn
from model.blocks.shared_blocks import SELayer
class InvertedResidual(nn.Module):
def __init__(self, in_channels, out_channels, stride, expand_ratio, outp_size=None):
super(InvertedResidual, self).__init__()
self.stride = stride
assert stride in [1, 2]
self... | true | true |
f7329a426ce773a89f30ada3b70a80dfca316c23 | 809 | py | Python | setup.py | psawa/gecko-api | e1342b931cb49ce0135d9fd5a77aca6cb087f398 | [
"Apache-2.0"
] | 1 | 2021-08-12T09:13:51.000Z | 2021-08-12T09:13:51.000Z | setup.py | psawa/gecko | e1342b931cb49ce0135d9fd5a77aca6cb087f398 | [
"Apache-2.0"
] | null | null | null | setup.py | psawa/gecko | e1342b931cb49ce0135d9fd5a77aca6cb087f398 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='gecko',
version='0.1',
description='Gecko, a library implementing multiple GEC systems.',
url='http://github.com/psawa/gecko',
author='thibo rosemplatt',
author_email='thibo.rosemplatt@gmail.com',
license='apache 2.0',
packages=[... | 33.708333 | 140 | 0.578492 | from setuptools import setup
setup(
name='gecko',
version='0.1',
description='Gecko, a library implementing multiple GEC systems.',
url='http://github.com/psawa/gecko',
author='thibo rosemplatt',
author_email='thibo.rosemplatt@gmail.com',
license='apache 2.0',
packages=[... | true | true |
f7329aca67e5680b7316ea2075ecde20e8a7be1e | 14,127 | py | Python | hsp/booking.py | JulianFlesch/hsp | 17abe5a63a15cc4dbf753f8fe3d1808814363f6f | [
"MIT"
] | 5 | 2019-10-25T18:20:53.000Z | 2021-10-13T22:14:18.000Z | hsp/booking.py | JulianFlesch/hsp | 17abe5a63a15cc4dbf753f8fe3d1808814363f6f | [
"MIT"
] | 3 | 2019-10-07T18:03:26.000Z | 2020-12-15T15:19:32.000Z | hsp/booking.py | JulianFlesch/hsp | 17abe5a63a15cc4dbf753f8fe3d1808814363f6f | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.... | 35.3175 | 101 | 0.649819 | from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.... | true | true |
f7329afae635d026dd93b95f99e82bc6d87bbe1b | 1,481 | py | Python | setup.py | psass-edfsf/centralized-pre-commit-conf | 49ae2cf524dc90f55dfffc2c38ece3e1a2365c5f | [
"MIT"
] | null | null | null | setup.py | psass-edfsf/centralized-pre-commit-conf | 49ae2cf524dc90f55dfffc2c38ece3e1a2365c5f | [
"MIT"
] | null | null | null | setup.py | psass-edfsf/centralized-pre-commit-conf | 49ae2cf524dc90f55dfffc2c38ece3e1a2365c5f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import find_namespace_packages, setup
with open("README.md", "r", encoding="utf-8") as r:
README = r.read()
TEST_REQUIRES = ["pytest-cov", "pytest-vcr", "python-coveralls"]
setup(
author="Pierre Sassoulas",
author_email="pierre.sassoulas@gmail.com",
long_desc... | 37.974359 | 119 | 0.667792 |
from setuptools import find_namespace_packages, setup
with open("README.md", "r", encoding="utf-8") as r:
README = r.read()
TEST_REQUIRES = ["pytest-cov", "pytest-vcr", "python-coveralls"]
setup(
author="Pierre Sassoulas",
author_email="pierre.sassoulas@gmail.com",
long_description=README,
lon... | true | true |
f7329b2e2e56139338f235c1765ad338c14eb242 | 36 | py | Python | data/studio21_generated/interview/1721/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/1721/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/1721/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | def create_number_class(alphabet):
| 18 | 34 | 0.833333 | def create_number_class(alphabet):
| false | true |
f7329b61ce18e3c7386bd29579f14e0a410cad5c | 8,856 | py | Python | tests/unit/test_amazon_estimator.py | jaipradeesh/sagemaker-python-sdk | ef842108ccaa324d2be15978aa678926dd1c21ea | [
"Apache-2.0"
] | 3 | 2020-04-18T15:25:28.000Z | 2020-04-21T08:30:59.000Z | tests/unit/test_amazon_estimator.py | jaipradeesh/sagemaker-python-sdk | ef842108ccaa324d2be15978aa678926dd1c21ea | [
"Apache-2.0"
] | 4 | 2019-11-02T16:19:14.000Z | 2019-11-02T21:31:30.000Z | tests/unit/test_amazon_estimator.py | jaipradeesh/sagemaker-python-sdk | ef842108ccaa324d2be15978aa678926dd1c21ea | [
"Apache-2.0"
] | 2 | 2019-05-30T08:47:34.000Z | 2020-04-08T09:42:01.000Z | # Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 45.649485 | 112 | 0.6486 |
from __future__ import absolute_import
import numpy as np
import pytest
from mock import Mock, patch, call
from sagemaker.amazon.pca import PCA
from sagemaker.amazon.amazon_estimator import upload_numpy_to_s3_shards, _build_shards, registry, get_image_uri
COMMON_ARGS = {'role': 'myrole', 'train_instance... | true | true |
f7329b72c380683c5a8d5148e83479335f69c65b | 3,889 | py | Python | starry/compat.py | rodluger/starry | da7fee48c5ef94278f0047be0579e2f13492cdd5 | [
"MIT"
] | 116 | 2018-02-23T19:47:15.000Z | 2022-02-21T04:43:46.000Z | starry/compat.py | rodluger/starry | da7fee48c5ef94278f0047be0579e2f13492cdd5 | [
"MIT"
] | 224 | 2018-02-26T00:41:51.000Z | 2022-03-29T10:38:16.000Z | starry/compat.py | rodluger/starry | da7fee48c5ef94278f0047be0579e2f13492cdd5 | [
"MIT"
] | 25 | 2018-02-26T18:14:36.000Z | 2021-11-30T01:00:56.000Z | # -*- coding: utf-8 -*-
import warnings
import aesara_theano_fallback
from aesara_theano_fallback import aesara as theano
import aesara_theano_fallback.tensor as tt
from aesara_theano_fallback import sparse as ts
from aesara_theano_fallback import change_flags, ifelse, USE_AESARA
from aesara_theano_fallback.tensor impo... | 25.926667 | 94 | 0.578812 |
import warnings
import aesara_theano_fallback
from aesara_theano_fallback import aesara as theano
import aesara_theano_fallback.tensor as tt
from aesara_theano_fallback import sparse as ts
from aesara_theano_fallback import change_flags, ifelse, USE_AESARA
from aesara_theano_fallback.tensor import slinalg
from aesara_... | true | true |
f7329c71f34366ec3044004d9d5ac67f51cb5dd3 | 9,231 | py | Python | paoding/utility/simulated_propagation.py | mark-h-meng/nnprune | 544a56a19382bde984c0e52d164eab278e0cd9ae | [
"MIT"
] | null | null | null | paoding/utility/simulated_propagation.py | mark-h-meng/nnprune | 544a56a19382bde984c0e52d164eab278e0cd9ae | [
"MIT"
] | null | null | null | paoding/utility/simulated_propagation.py | mark-h-meng/nnprune | 544a56a19382bde984c0e52d164eab278e0cd9ae | [
"MIT"
] | null | null | null | #!/usr/bin/python3
__author__ = "Mark H. Meng"
__copyright__ = "Copyright 2021, National University of S'pore and A*STAR"
__credits__ = ["G. Bai", "H. Guo", "S. G. Teo", "J. S. Dong"]
__license__ = "MIT"
import paoding.utility.interval_arithmetic as ia
import paoding.utility.utils as utils
import math
def calculate_... | 43.748815 | 129 | 0.591702 |
__author__ = "Mark H. Meng"
__copyright__ = "Copyright 2021, National University of S'pore and A*STAR"
__credits__ = ["G. Bai", "H. Guo", "S. G. Teo", "J. S. Dong"]
__license__ = "MIT"
import paoding.utility.interval_arithmetic as ia
import paoding.utility.utils as utils
import math
def calculate_bounds_of_output(m... | true | true |
f7329cbecdc258302fcfe226d9b98c2ca57d946c | 1,709 | py | Python | app.py | stefanorosss/pytorch-CycleGAN-and-pix2pix | 88c3f3f729ebef6fac5ddf8c60a21cf51e6402f4 | [
"BSD-3-Clause"
] | null | null | null | app.py | stefanorosss/pytorch-CycleGAN-and-pix2pix | 88c3f3f729ebef6fac5ddf8c60a21cf51e6402f4 | [
"BSD-3-Clause"
] | null | null | null | app.py | stefanorosss/pytorch-CycleGAN-and-pix2pix | 88c3f3f729ebef6fac5ddf8c60a21cf51e6402f4 | [
"BSD-3-Clause"
] | null | null | null | import json
import sagemaker
import os
from s3_conx import *
from sagemaker.pytorch import PyTorch
def iterate_to_s3(path):
if os.path.isdir(path):
for _dir in os.listdir(path):
iterate_to_s3(path+_dir)
else:
s3.upload_file_to_s3(path)
return
if __name__ == '__main__':
# In... | 32.245283 | 77 | 0.634874 | import json
import sagemaker
import os
from s3_conx import *
from sagemaker.pytorch import PyTorch
def iterate_to_s3(path):
if os.path.isdir(path):
for _dir in os.listdir(path):
iterate_to_s3(path+_dir)
else:
s3.upload_file_to_s3(path)
return
if __name__ == '__main__':
... | true | true |
f7329cd096d6de00876f35b4117e0443fc4744af | 71,542 | py | Python | nexus/library/sqd_input.py | bwvdg/qmcpack | cd09fc54b36de2579c9802f5e64b7ec15506f3c3 | [
"NCSA"
] | null | null | null | nexus/library/sqd_input.py | bwvdg/qmcpack | cd09fc54b36de2579c9802f5e64b7ec15506f3c3 | [
"NCSA"
] | 1 | 2020-04-10T15:33:28.000Z | 2020-04-10T15:35:59.000Z | nexus/library/sqd_input.py | bwvdg/qmcpack | cd09fc54b36de2579c9802f5e64b7ec15506f3c3 | [
"NCSA"
] | null | null | null | ##################################################################
## (c) Copyright 2015- by Jaron T. Krogel ##
##################################################################
#====================================================================#
# sqd_input.py ... | 32.067234 | 279 | 0.474602 | ,'scale',
'series','simulation','type'])
bools = dict()
condensed_names = obj()
expanded_names = None
escape_names = set(keyword.kwlist)
escaped_names = list(escape_names)
for i in range(len(escaped_names)):
escaped_names[i]+='_'
escaped_names = set(escaped_names)... | false | true |
f7329cdf3349fca6215dae51ac706c10f91549e5 | 11,991 | py | Python | fattureincloud_python_sdk/model/client_type.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | 2 | 2022-02-17T08:33:17.000Z | 2022-03-22T09:27:00.000Z | fattureincloud_python_sdk/model/client_type.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | fattureincloud_python_sdk/model/client_type.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | """
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noq... | 41.780488 | 278 | 0.558836 |
import re
import sys
from fattureincloud_python_sdk.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_... | true | true |
f7329d67eaf90a21108de20975c0953c9d7739a7 | 451 | py | Python | yt_dlp/__main__.py | RobinD42/yt-dlc | aae273ded871caac1995381033a5b7ecaf4a526b | [
"Unlicense"
] | 1 | 2021-02-24T00:07:32.000Z | 2021-02-24T00:07:32.000Z | yt_dlp/__main__.py | RobinD42/yt-dlc | aae273ded871caac1995381033a5b7ecaf4a526b | [
"Unlicense"
] | null | null | null | yt_dlp/__main__.py | RobinD42/yt-dlc | aae273ded871caac1995381033a5b7ecaf4a526b | [
"Unlicense"
] | 1 | 2021-09-10T18:22:00.000Z | 2021-09-10T18:22:00.000Z | #!/usr/bin/env python
from __future__ import unicode_literals
# Execute with
# $ python yt_dlp/__main__.py (2.6+)
# $ python -m yt_dlp (2.7+)
import sys
if __package__ is None and not hasattr(sys, 'frozen'):
# direct call of __main__.py
import os.path
path = os.path.realpath(os.path.abspath(__fi... | 22.55 | 62 | 0.682927 |
from __future__ import unicode_literals
import sys
if __package__ is None and not hasattr(sys, 'frozen'):
import os.path
path = os.path.realpath(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(os.path.dirname(path)))
import yt_dlp
if __name__ == '__main__':
yt_dlp.main()
| true | true |
f7329fb55bc1abb42bae44f1178eb576c6e018e7 | 1,686 | py | Python | adventofcode2017/08.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | 2 | 2016-12-28T09:40:07.000Z | 2020-12-08T13:58:15.000Z | adventofcode2017/08.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | null | null | null | adventofcode2017/08.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | null | null | null | import operator
def execute(program):
registers = {}
m = 0
for instr in program:
if instr['reg_check'] not in registers:
registers[instr['reg_check']] = 0
if instr['reg'] not in registers:
registers[instr['reg']] = 0
if instr['op_check'](registers[instr['... | 23.746479 | 88 | 0.570581 | import operator
def execute(program):
registers = {}
m = 0
for instr in program:
if instr['reg_check'] not in registers:
registers[instr['reg_check']] = 0
if instr['reg'] not in registers:
registers[instr['reg']] = 0
if instr['op_check'](registers[instr['... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.