hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c34f71509c416f907057a5acc2be974f7718754 | 233 | py | Python | napari/_qt/layers/qt_pyramid_layer.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/layers/qt_pyramid_layer.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | 1 | 2019-09-18T22:59:55.000Z | 2019-09-23T16:41:08.000Z | napari/_qt/layers/qt_pyramid_layer.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | null | null | null | from ...layers import Pyramid
from .qt_image_layer import QtImageControls, QtImageProperties
class QtPyramidControls(QtImageControls, layer=Pyramid):
pass
class QtPyramidProperties(QtImageProperties, layer=Pyramid):
pass
| 21.181818 | 62 | 0.811159 | from ...layers import Pyramid
from .qt_image_layer import QtImageControls, QtImageProperties
class QtPyramidControls(QtImageControls, layer=Pyramid):
pass
class QtPyramidProperties(QtImageProperties, layer=Pyramid):
pass
| true | true |
1c34f7365ae533c7a016c65aaf031f4281d86efd | 1,955 | py | Python | PyObjCTest/test_nsanimation.py | Khan/pyobjc-framework-Cocoa | f8b015ea2a72d8d78be6084fb12925c4785b8f1f | [
"MIT"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsanimation.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsanimation.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z |
from PyObjCTools.TestSupport import *
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSAnimationHelper (NSObject):
def animationShouldStart_(self, animation): return 1
def animation_valueForProgress_(self, a, b): return 1
def animation_didReachProgressMark_(self, a, b... | 38.333333 | 100 | 0.767263 |
from PyObjCTools.TestSupport import *
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSAnimationHelper (NSObject):
def animationShouldStart_(self, animation): return 1
def animation_valueForProgress_(self, a, b): return 1
def animation_didReachProgressMark_(self, a, b... | true | true |
1c34f80eecfcae2605ef92175008884d8d327424 | 7,303 | py | Python | research/slim/nets/nets_factory.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 153 | 2020-10-25T13:58:04.000Z | 2022-03-07T06:01:54.000Z | research/slim/nets/nets_factory.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 11 | 2020-07-13T08:29:00.000Z | 2022-03-24T07:21:09.000Z | research/slim/nets/nets_factory.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 23 | 2020-10-25T14:44:47.000Z | 2021-03-31T02:12:13.000Z | # Copyright 2017 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 applicable ... | 42.213873 | 80 | 0.751061 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
from tensorflow.contrib import slim as contrib_slim
from nets import alexnet
from nets import cifarnet
from nets import i3d
from nets import inception
from nets import lenet
from nets import m... | true | true |
1c34f8473405ca66b16aa4edaae04cd633afb328 | 8,327 | py | Python | bin/redsea/tidal_api.py | SultanSGillani/dotfiles | 17705501de7c72399656f909f06746700d5f04cd | [
"0BSD"
] | 7 | 2020-02-10T03:07:05.000Z | 2022-02-03T20:50:31.000Z | bin/redsea/tidal_api.py | SultanSGillani/dotfiles | 17705501de7c72399656f909f06746700d5f04cd | [
"0BSD"
] | 2 | 2020-07-18T14:42:36.000Z | 2022-01-20T14:41:03.000Z | bin/redsea/tidal_api.py | SultanSGillani/dotfiles | 17705501de7c72399656f909f06746700d5f04cd | [
"0BSD"
] | 1 | 2018-11-27T16:51:10.000Z | 2018-11-27T16:51:10.000Z | import pickle
import uuid
import os
import requests
class TidalRequestError(Exception):
def __init__(self, payload):
sf = '{subStatus}: {userMessage} (HTTP {status})'.format(**payload)
self.payload = payload
super(TidalRequestError, self).__init__(sf)
class TidalError(Exception):
d... | 33.175299 | 130 | 0.593491 | import pickle
import uuid
import os
import requests
class TidalRequestError(Exception):
def __init__(self, payload):
sf = '{subStatus}: {userMessage} (HTTP {status})'.format(**payload)
self.payload = payload
super(TidalRequestError, self).__init__(sf)
class TidalError(Exception):
d... | true | true |
1c34f8a2fde5ba30697a03d4b7f7701e4cce5000 | 455 | py | Python | beer/cli/subcommands/hmm/phonelist.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | 46 | 2018-02-27T18:15:08.000Z | 2022-02-16T22:10:55.000Z | beer/cli/subcommands/hmm/phonelist.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | 16 | 2018-01-26T14:18:51.000Z | 2021-02-05T09:34:00.000Z | beer/cli/subcommands/hmm/phonelist.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | 26 | 2018-03-12T14:03:26.000Z | 2021-05-24T21:15:01.000Z |
'print the list of phones from a set of phones\' HMM'
import argparse
import pickle
from natsort import natsorted
def setup(parser):
parser.add_argument('hmms', help='phones\' hmms')
def main(args, logger):
logger.debug('loading the HMMs...')
with open(args.hmms, 'rb') as f:
units, _ = pickle... | 17.5 | 64 | 0.643956 |
import argparse
import pickle
from natsort import natsorted
def setup(parser):
parser.add_argument('hmms', help='phones\' hmms')
def main(args, logger):
logger.debug('loading the HMMs...')
with open(args.hmms, 'rb') as f:
units, _ = pickle.load(f)
for key in natsorted(units.keys(), key=l... | true | true |
1c34f94acc478114b177c4f1e4daaf1402f8de8f | 27 | py | Python | testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py | markshao/pytest | 611b579d21f7e62b4c8ed54ab70fbfee7c6f5f64 | [
"MIT"
] | 9,225 | 2015-06-15T21:56:14.000Z | 2022-03-31T20:47:38.000Z | testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py | markshao/pytest | 611b579d21f7e62b4c8ed54ab70fbfee7c6f5f64 | [
"MIT"
] | 7,794 | 2015-06-15T21:06:34.000Z | 2022-03-31T10:56:54.000Z | testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py | markshao/pytest | 611b579d21f7e62b4c8ed54ab70fbfee7c6f5f64 | [
"MIT"
] | 2,598 | 2015-06-15T21:42:39.000Z | 2022-03-29T13:48:22.000Z | def test_2(arg2):
pass
| 9 | 17 | 0.62963 | def test_2(arg2):
pass
| true | true |
1c34fcb4d73d6021d2acb6af49703d7f1211b96d | 1,634 | py | Python | content/migrations/0046_auto_20210401_0016.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | content/migrations/0046_auto_20210401_0016.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | content/migrations/0046_auto_20210401_0016.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-01 00:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('country', '0030_auto_20210331_1526'),
('content', '0045_auto_20210331_1526'),
]
operations = [
migr... | 35.521739 | 125 | 0.617503 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('country', '0030_auto_20210331_1526'),
('content', '0045_auto_20210331_1526'),
]
operations = [
migrations.AlterField(
model_name='datai... | true | true |
1c34fce2b3dc9d70b87850dfff00fb1971f911c0 | 1,568 | py | Python | python/zenhub-backup.py | open-cluster-management/zenhub-backup | b6811cbb01879e9a5de6d1490ac25d2a3c734fea | [
"Apache-2.0"
] | 4 | 2021-05-21T22:06:50.000Z | 2021-06-21T14:43:32.000Z | python/zenhub-backup.py | open-cluster-management/zenhub-backup | b6811cbb01879e9a5de6d1490ac25d2a3c734fea | [
"Apache-2.0"
] | null | null | null | python/zenhub-backup.py | open-cluster-management/zenhub-backup | b6811cbb01879e9a5de6d1490ac25d2a3c734fea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from zenhub import Zenhub # the move issue API failed; fellback on requests library
import json
import os
# Update these variables with the project settings
ZENHUB_API = 'https://api.zenhub.com'
ZENHUB_API_TOKEN = os.getenv('ZENHUB_API_TOKEN')
GITHUB_REPO_ID = os.getenv('GITHUB_REPO_ID')
ZENHUB_... | 39.2 | 144 | 0.765306 |
from zenhub import Zenhub import json
import os
ZENHUB_API = 'https://api.zenhub.com'
ZENHUB_API_TOKEN = os.getenv('ZENHUB_API_TOKEN')
GITHUB_REPO_ID = os.getenv('GITHUB_REPO_ID')
ZENHUB_WORKSPACE_ID = os.getenv('ZENHUB_WORKSPACE_ID')
AUTH_HEADER = {'X-Authentication-Token': '%s' % ZENHUB_API_TOKEN}
ZENHUB_BOARD_JSON... | true | true |
1c34fcfaddccb2b4050adc99174f6ef631ed2ae8 | 26,232 | py | Python | pyclustering/nnet/hhn.py | JosephChataignon/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 1,013 | 2015-01-26T19:50:14.000Z | 2022-03-31T07:38:48.000Z | pyclustering/nnet/hhn.py | peterlau0626/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 542 | 2015-01-20T16:44:32.000Z | 2022-01-29T14:57:20.000Z | pyclustering/nnet/hhn.py | peterlau0626/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 262 | 2015-03-19T07:28:12.000Z | 2022-03-30T07:28:24.000Z | """!
@brief Oscillatory Neural Network based on Hodgkin-Huxley Neuron Model
@details Implementation based on paper @cite article::nnet::hnn::1.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from scipy.integrate import odeint
from pyclustering.core.wrapper... | 47.521739 | 231 | 0.617986 |
from scipy.integrate import odeint
from pyclustering.core.wrapper import ccore_library
import pyclustering.core.hhn_wrapper as wrapper
from pyclustering.nnet import *
from pyclustering.utils import allocate_sync_ensembles
import numpy
import random
class hhn_parameters:
def __init__(self... | true | true |
1c34ff459644f5dd3812472989b58fef5b5d706d | 4,744 | py | Python | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2020-03-05T18:10:35.000Z | 2020-03-05T18:10:35.000Z | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.754717 | 133 | 0.660835 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline ... | true | true |
1c34ff63a8b9e3f11d2b2c93327b77046e395fa0 | 2,579 | py | Python | chaosoci/core/networking/filters.py | LaudateCorpus1/chaostoolkit-oci | 36da01a47dd1b0881ec21cb70775fde5011b38ed | [
"Apache-2.0"
] | 15 | 2018-11-20T15:36:52.000Z | 2021-12-16T21:46:56.000Z | chaosoci/core/networking/filters.py | LaudateCorpus1/chaostoolkit-oci | 36da01a47dd1b0881ec21cb70775fde5011b38ed | [
"Apache-2.0"
] | 21 | 2018-11-26T19:11:52.000Z | 2021-12-15T19:38:37.000Z | chaosoci/core/networking/filters.py | LaudateCorpus1/chaostoolkit-oci | 36da01a47dd1b0881ec21cb70775fde5011b38ed | [
"Apache-2.0"
] | 8 | 2018-11-20T15:37:09.000Z | 2021-07-28T20:27:19.000Z | # coding: utf-8
# Copyright 2020, Oracle Corporation and/or its affiliates.
__all__ = ["filter_route_tables", "filter_nat_gateway", "filter_service_gateway", "filter_internet_gateway"]
from typing import Any, Dict, List
from chaoslib.exceptions import ActivityFailed
from chaosoci.util.constants import FILTER_ERR
fr... | 33.493506 | 108 | 0.691741 |
__all__ = ["filter_route_tables", "filter_nat_gateway", "filter_service_gateway", "filter_internet_gateway"]
from typing import Any, Dict, List
from chaoslib.exceptions import ActivityFailed
from chaosoci.util.constants import FILTER_ERR
from logzero import logger
from oci.core import VirtualNetworkClient
from oci... | true | true |
1c34ffd069311c30480e2a2287d5535272434e89 | 259 | py | Python | vr/server/templatetags/formfield.py | isabella232/vr.server | 705511f8176bda0627be1ae86a458178589ee3db | [
"MIT"
] | null | null | null | vr/server/templatetags/formfield.py | isabella232/vr.server | 705511f8176bda0627be1ae86a458178589ee3db | [
"MIT"
] | 3 | 2016-12-15T21:55:02.000Z | 2019-02-13T11:43:29.000Z | vr/server/templatetags/formfield.py | isabella232/vr.server | 705511f8176bda0627be1ae86a458178589ee3db | [
"MIT"
] | 2 | 2017-01-16T09:31:03.000Z | 2022-03-26T09:21:36.000Z | from django import template
register = template.Library()
# Allow rendering formfields with our custom template include by saying
# {% formfield form.somefield %}
@register.inclusion_tag('_formfield.html')
def formfield(field):
return {'field': field}
| 23.545455 | 71 | 0.760618 | from django import template
register = template.Library()
@register.inclusion_tag('_formfield.html')
def formfield(field):
return {'field': field}
| true | true |
1c34ffde69a6a33cef6377790d2deabc7d07eadf | 6,945 | py | Python | research/maskgan/models/rnn_zaremba.py | afish880/TensorTest | a41f00ac171cf53539b4e2de47f2e15ccb848c90 | [
"Apache-2.0"
] | 1 | 2019-02-04T02:44:37.000Z | 2019-02-04T02:44:37.000Z | research/maskgan/models/rnn_zaremba.py | afish880/TensorTest | a41f00ac171cf53539b4e2de47f2e15ccb848c90 | [
"Apache-2.0"
] | null | null | null | research/maskgan/models/rnn_zaremba.py | afish880/TensorTest | a41f00ac171cf53539b4e2de47f2e15ccb848c90 | [
"Apache-2.0"
] | 1 | 2021-05-08T11:27:53.000Z | 2021-05-08T11:27:53.000Z | # Copyright 2017 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 applicab... | 35.433673 | 80 | 0.624478 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def generator(hparams,
inputs,
targets,
targets_present,
is_training,
is_validating,... | true | true |
1c350009e0a7420971ced657135ace27ba273c39 | 7,212 | py | Python | lesson13/sunzhaohui/reboot/users/group/__init__.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson13/sunzhaohui/reboot/users/group/__init__.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson13/sunzhaohui/reboot/users/group/__init__.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | # _*_ encoding:utf-8 _*_
__author__ = 'sunzhaohui'
__date__ = '2019-08-05 17:20'
from django.shortcuts import render
from django.http import HttpResponse,QueryDict,HttpResponseRedirect,JsonResponse,Http404
from django.urls import reverse
from django.conf import settings
from users.models import UserProfile
from djan... | 37.5625 | 106 | 0.631725 | __author__ = 'sunzhaohui'
__date__ = '2019-08-05 17:20'
from django.shortcuts import render
from django.http import HttpResponse,QueryDict,HttpResponseRedirect,JsonResponse,Http404
from django.urls import reverse
from django.conf import settings
from users.models import UserProfile
from django.contrib.auth.models im... | true | true |
1c350203e6d8985a8b2b61ffaaafac8504e26b3e | 1,208 | py | Python | nipype/interfaces/tests/test_auto_SSHDataGrabber.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/tests/test_auto_SSHDataGrabber.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/tests/test_auto_SSHDataGrabber.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..io import SSHDataGrabber
def test_SSHDataGrabber_inputs():
input_map = dict(base_directory=dict(mandatory=True,
),
download_files=dict(usedefault=True,
),
hostname=dict(mandatory=True,
),
i... | 26.844444 | 67 | 0.672185 | from __future__ import unicode_literals
from ..io import SSHDataGrabber
def test_SSHDataGrabber_inputs():
input_map = dict(base_directory=dict(mandatory=True,
),
download_files=dict(usedefault=True,
),
hostname=dict(mandatory=True,
),
ignore_exception=dict(deprecated='1.0.0',
nohash=Tr... | true | true |
1c3502398c0fb7fe2dc6975eb1f77e0bbc5b81ed | 4,624 | py | Python | timesmoothing.py | Numlet/pgw-python | 1731fccdd0d3a3a199246fdc6dc04058273237ab | [
"MIT"
] | 2 | 2020-11-13T09:22:06.000Z | 2021-11-13T14:50:50.000Z | timesmoothing.py | Numlet/pgw-python | 1731fccdd0d3a3a199246fdc6dc04058273237ab | [
"MIT"
] | null | null | null | timesmoothing.py | Numlet/pgw-python | 1731fccdd0d3a3a199246fdc6dc04058273237ab | [
"MIT"
] | 2 | 2020-12-07T09:34:07.000Z | 2021-06-23T08:39:38.000Z | # -*- coding: utf-8 -*-
#from settings import annualcycleraw, variablename_to_smooth, outputpath
import xarray as xr
import numpy as np
import sys
import math
from pathlib import Path
def filterdata(annualcycleraw, variablename_to_smooth, outputpath):
"""
This function performs a temporal smoothing of an annual ti... | 35.030303 | 157 | 0.721453 |
import xarray as xr
import numpy as np
import sys
import math
from pathlib import Path
def filterdata(annualcycleraw, variablename_to_smooth, outputpath):
Diff = xr.open_dataset(annualcycleraw)[variablename_to_smooth].squeeze()
coords = Diff.coords
print('Dimension that is assumed to be time dimension is called... | true | true |
1c35024bbad0f44318da90414d0b5f6b0469348a | 5,416 | py | Python | tests/wallet/did_wallet/test_did_rpc.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 11 | 2021-11-10T19:30:12.000Z | 2022-02-09T04:30:29.000Z | tests/wallet/did_wallet/test_did_rpc.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 6 | 2021-11-16T17:11:03.000Z | 2021-12-28T17:11:20.000Z | tests/wallet/did_wallet/test_did_rpc.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 3 | 2021-11-21T02:27:10.000Z | 2022-03-15T08:34:47.000Z | import asyncio
import logging
import pytest
from ethgreen.rpc.rpc_server import start_rpc_server
from ethgreen.rpc.wallet_rpc_api import WalletRpcApi
from ethgreen.rpc.wallet_rpc_client import WalletRpcClient
from ethgreen.simulator.simulator_protocol import FarmNewBlockProtocol
from ethgreen.types.peer_info import Pe... | 40.41791 | 105 | 0.6887 | import asyncio
import logging
import pytest
from ethgreen.rpc.rpc_server import start_rpc_server
from ethgreen.rpc.wallet_rpc_api import WalletRpcApi
from ethgreen.rpc.wallet_rpc_client import WalletRpcClient
from ethgreen.simulator.simulator_protocol import FarmNewBlockProtocol
from ethgreen.types.peer_info import Pe... | true | true |
1c3502b00816b1391aa44c72e9fff9864542562e | 1,579 | py | Python | dfd/api.py | legnaleurc/dfd | 50f580c4cf2d6528a6df8310093aef2b0b7f2c08 | [
"MIT"
] | null | null | null | dfd/api.py | legnaleurc/dfd | 50f580c4cf2d6528a6df8310093aef2b0b7f2c08 | [
"MIT"
] | null | null | null | dfd/api.py | legnaleurc/dfd | 50f580c4cf2d6528a6df8310093aef2b0b7f2c08 | [
"MIT"
] | null | null | null | import json
from aiohttp import web as aw
from .database import InvalidFilterError
# NOTE we dont expect filters will be large text
class FiltersHandler(aw.View):
async def post(self):
filters = self.request.app['filters']
new_filter = await self.request.text()
try:
new_id =... | 28.709091 | 68 | 0.59658 | import json
from aiohttp import web as aw
from .database import InvalidFilterError
class FiltersHandler(aw.View):
async def post(self):
filters = self.request.app['filters']
new_filter = await self.request.text()
try:
new_id = await filters.add(new_filter)
except Inv... | true | true |
1c3503919c84d443d05169a5103bf543a789cea3 | 22,676 | py | Python | scripts/obtain_data.py | quimaguirre/NetworkAnalysis | c7a4da3ba5696800738b4767065ce29fa0020d79 | [
"MIT"
] | 1 | 2017-07-10T17:33:31.000Z | 2017-07-10T17:33:31.000Z | scripts/obtain_data.py | quimaguirre/NetworkAnalysis | c7a4da3ba5696800738b4767065ce29fa0020d79 | [
"MIT"
] | null | null | null | scripts/obtain_data.py | quimaguirre/NetworkAnalysis | c7a4da3ba5696800738b4767065ce29fa0020d79 | [
"MIT"
] | null | null | null | import argparse
import ConfigParser
import cPickle
import mysql.connector
import networkx as nx
import sys, os, re
from context import NetworkAnalysis
import NetworkAnalysis.drug as NA_drug
"""
NetworkAnalysis
2017 Joaquim Aguirre-Plans
Structural Bioinformatics Laboratory
Universitat Pompeu Fabra
""... | 37.480992 | 450 | 0.66233 | import argparse
import ConfigParser
import cPickle
import mysql.connector
import networkx as nx
import sys, os, re
from context import NetworkAnalysis
import NetworkAnalysis.drug as NA_drug
def main():
options = parse_user_arguments()
create_tissue_specific_network(options)
def parse_user_arguments(*args,... | true | true |
1c3504f81075d5cdf675fc34b13c33b452655f06 | 1,919 | py | Python | test_scripts/imutest.py | sofwerx/dataglove | e49d72bef23fcba840e67fabc2fb81ce9f91b775 | [
"MIT"
] | 5 | 2019-05-07T17:28:20.000Z | 2020-06-18T15:08:04.000Z | test_scripts/imutest.py | sofwerx/dataglove | e49d72bef23fcba840e67fabc2fb81ce9f91b775 | [
"MIT"
] | 1 | 2019-08-29T22:54:07.000Z | 2019-08-29T23:03:57.000Z | test_scripts/imutest.py | sofwerx/dataglove | e49d72bef23fcba840e67fabc2fb81ce9f91b775 | [
"MIT"
] | 2 | 2019-05-28T13:11:09.000Z | 2019-06-05T17:47:28.000Z | import serial
import time
import sys
import threading
import numpy as np
# © 2019 BeBop Sensors, Inc.
data = []
class GloveSerialListener(threading.Thread):
def __init__(self, port):
threading.Thread.__init__(self)
self.glove = serial.Serial()
self.glove.baudrate = 460800
self.glo... | 21.561798 | 59 | 0.5284 | import serial
import time
import sys
import threading
import numpy as np
data = []
class GloveSerialListener(threading.Thread):
def __init__(self, port):
threading.Thread.__init__(self)
self.glove = serial.Serial()
self.glove.baudrate = 460800
self.glove.port = '/dev/rfcomm0'
... | true | true |
1c35065379e7fecc69342e3601f2049d6fbe96f9 | 514 | py | Python | other/abnormal_sample_detection/scripts/calculate_sampleAB.py | fabiodepa/ForestQC | aba6d0f2f6925c62229bd01ace7370be314f5886 | [
"MIT"
] | 21 | 2018-10-18T08:56:04.000Z | 2022-01-15T10:18:52.000Z | other/abnormal_sample_detection/scripts/calculate_sampleAB.py | fabiodepa/ForestQC | aba6d0f2f6925c62229bd01ace7370be314f5886 | [
"MIT"
] | 7 | 2018-10-25T23:50:12.000Z | 2022-01-26T17:44:11.000Z | other/abnormal_sample_detection/scripts/calculate_sampleAB.py | fabiodepa/ForestQC | aba6d0f2f6925c62229bd01ace7370be314f5886 | [
"MIT"
] | 7 | 2018-11-21T10:32:56.000Z | 2021-09-16T05:26:08.000Z | from sample_level_vcf_stat import *
import os
import sys
import pandas as pd
# sample = os.listdir('/u/home/k/k8688933/Jaehoon/data')
# good_variants_rsid_file = '/u/scratch2/k/k8688933/stat_output/vqsr_qc4/good.all.clfB.rsid'
vcf_file = sys.argv[1]
outfile = sys.argv[2]
# list_ = []
# with open(good_variants_rsid_fi... | 25.7 | 92 | 0.719844 | from sample_level_vcf_stat import *
import os
import sys
import pandas as pd
vcf_file = sys.argv[1]
outfile = sys.argv[2]
sample_ab = sampleLevelAB([vcf_file])
ab = pd.DataFrame(sample_ab)
ab.to_csv(outfile)
| true | true |
1c35067aafd2936571b8659c35155dc178d8e7d5 | 815 | py | Python | app/models/loginUserSchema.py | SE-4398/Slither | 2d3a196329250cdd1f09e472b5b6de05de6c24cb | [
"Unlicense",
"MIT"
] | 1 | 2020-05-25T20:47:48.000Z | 2020-05-25T20:47:48.000Z | app/models/loginUserSchema.py | SE-4398/Slither | 2d3a196329250cdd1f09e472b5b6de05de6c24cb | [
"Unlicense",
"MIT"
] | 8 | 2020-04-16T01:50:47.000Z | 2020-10-22T14:51:32.000Z | app/models/loginUserSchema.py | SE-4398/Slither | 2d3a196329250cdd1f09e472b5b6de05de6c24cb | [
"Unlicense",
"MIT"
] | 1 | 2020-05-21T05:54:21.000Z | 2020-05-21T05:54:21.000Z | import datetime
from click import DateTime
from flask import Flask, render_template, request
# from flask_mysqldb import MySQL
# import pymysql
# import yaml
from flask_wtf import FlaskForm, RecaptchaField
from wtforms import StringField, IntegerField, DateField, DecimalField, SubmitField, PasswordField, BooleanField,... | 37.045455 | 115 | 0.788957 | import datetime
from click import DateTime
from flask import Flask, render_template, request
from flask_wtf import FlaskForm, RecaptchaField
from wtforms import StringField, IntegerField, DateField, DecimalField, SubmitField, PasswordField, BooleanField, \
DateTimeField
from datetime import datetime
from wtforms.v... | true | true |
1c3506c1d1436bd754bfb43ddce7129a383c968f | 928 | py | Python | src/ploomber/tasks/__init__.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 2,141 | 2020-02-14T02:34:34.000Z | 2022-03-31T22:43:20.000Z | src/ploomber/tasks/__init__.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 660 | 2020-02-06T16:15:57.000Z | 2022-03-31T22:55:01.000Z | src/ploomber/tasks/__init__.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 122 | 2020-02-14T18:53:05.000Z | 2022-03-27T22:33:24.000Z | from ploomber.tasks.tasks import (PythonCallable, ShellScript, DownloadFromURL,
Link, Input, task_factory)
from ploomber.tasks.taskfactory import TaskFactory
from ploomber.tasks.sql import (SQLScript, SQLDump, SQLTransfer, SQLUpload,
PostgresCopyFrom)
fr... | 29 | 79 | 0.6875 | from ploomber.tasks.tasks import (PythonCallable, ShellScript, DownloadFromURL,
Link, Input, task_factory)
from ploomber.tasks.taskfactory import TaskFactory
from ploomber.tasks.sql import (SQLScript, SQLDump, SQLTransfer, SQLUpload,
PostgresCopyFrom)
fr... | true | true |
1c3507a628143c1371019fd50632146e96f30fbd | 54,445 | py | Python | numpy/lib/tests/test_arraypad.py | jcw780/numpy | 1912db21e0f5e61739168864f6b1f37dff3b4006 | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/tests/test_arraypad.py | jcw780/numpy | 1912db21e0f5e61739168864f6b1f37dff3b4006 | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/tests/test_arraypad.py | jcw780/numpy | 1912db21e0f5e61739168864f6b1f37dff3b4006 | [
"BSD-3-Clause"
] | null | null | null | """Tests for the array padding functions.
"""
from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from numpy.lib.arraypad import _as_pairs
_numeric_dtypes = (
np.sctypes["uint"]
+ np.sc... | 39.828091 | 79 | 0.424502 | from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from numpy.lib.arraypad import _as_pairs
_numeric_dtypes = (
np.sctypes["uint"]
+ np.sctypes["int"]
+ np.sctypes["float"]
+ np... | true | true |
1c3508df5c374c4813d7bd926e4b8697e3ef238f | 998 | py | Python | layers/shortcuts.py | ultraglorious/cyclegan-learning | ed141e155d60cdfb1e2c14bdf64fc96fee0b5200 | [
"MIT"
] | null | null | null | layers/shortcuts.py | ultraglorious/cyclegan-learning | ed141e155d60cdfb1e2c14bdf64fc96fee0b5200 | [
"MIT"
] | null | null | null | layers/shortcuts.py | ultraglorious/cyclegan-learning | ed141e155d60cdfb1e2c14bdf64fc96fee0b5200 | [
"MIT"
] | null | null | null | import layers
def c7s1k(k: int, activation: str = "relu") -> layers.ConvolutionBlock:
"""Shortcut function to c7s1-k layer."""
return layers.ConvolutionBlock(7, 1, k, activation=activation)
def dk(k: int) -> layers.ConvolutionBlock:
"""Shortcut to dk layer. Reflection padding seems to have only been do... | 36.962963 | 107 | 0.713427 | import layers
def c7s1k(k: int, activation: str = "relu") -> layers.ConvolutionBlock:
return layers.ConvolutionBlock(7, 1, k, activation=activation)
def dk(k: int) -> layers.ConvolutionBlock:
return layers.ConvolutionBlock(3, 2, k, reflect_padding=True)
def uk(k: int) -> layers.ConvolutionBlock:
retur... | true | true |
1c350afe4ddd366b54a79a06bb6777bfe5eab20f | 4,532 | py | Python | dalle_pytorch/vae.py | haskie-lambda/DALLE-pytorch | 3c59dc9864cc900cefd656f73772e151af4fb97f | [
"MIT"
] | 2 | 2021-06-24T19:36:02.000Z | 2021-06-24T20:32:32.000Z | dalle_pytorch/vae.py | haskie-lambda/DALLE-pytorch | 3c59dc9864cc900cefd656f73772e151af4fb97f | [
"MIT"
] | null | null | null | dalle_pytorch/vae.py | haskie-lambda/DALLE-pytorch | 3c59dc9864cc900cefd656f73772e151af4fb97f | [
"MIT"
] | null | null | null | import io
import sys
import os, sys
import requests
import PIL
import warnings
import os
import hashlib
import urllib
import yaml
from pathlib import Path
from tqdm import tqdm
from math import sqrt
from omegaconf import OmegaConf
from taming.models.vqgan import VQModel
import torch
from torch import nn
import torch.n... | 29.23871 | 102 | 0.647176 | import io
import sys
import os, sys
import requests
import PIL
import warnings
import os
import hashlib
import urllib
import yaml
from pathlib import Path
from tqdm import tqdm
from math import sqrt
from omegaconf import OmegaConf
from taming.models.vqgan import VQModel
import torch
from torch import nn
import torch.n... | true | true |
1c350b4b10fd65ce70ca77ba9f9e4419bd36a485 | 1,215 | py | Python | app/users/models.py | onosendi/flask-boilerplate | 4e4734e2ac416c5ef6a82b2b36b2458de0463091 | [
"Unlicense"
] | 5 | 2020-05-25T02:06:50.000Z | 2021-05-03T22:37:12.000Z | app/users/models.py | onosendi/flask-boilerplate | 4e4734e2ac416c5ef6a82b2b36b2458de0463091 | [
"Unlicense"
] | null | null | null | app/users/models.py | onosendi/flask-boilerplate | 4e4734e2ac416c5ef6a82b2b36b2458de0463091 | [
"Unlicense"
] | 2 | 2020-07-18T13:01:29.000Z | 2020-11-26T16:43:56.000Z | from flask_login import UserMixin
from werkzeug.security import check_password_hash, generate_password_hash
from app.common.extensions import db, login
from app.common.models import BaseMixin, SoftDeleteMixin, TimestampMixin
class User(
UserMixin,
BaseMixin,
SoftDeleteMixin,
TimestampMixin,
db.Mo... | 31.153846 | 73 | 0.683951 | from flask_login import UserMixin
from werkzeug.security import check_password_hash, generate_password_hash
from app.common.extensions import db, login
from app.common.models import BaseMixin, SoftDeleteMixin, TimestampMixin
class User(
UserMixin,
BaseMixin,
SoftDeleteMixin,
TimestampMixin,
db.Mo... | true | true |
1c350bc3b76d57a7c99c9fd181d2b1de2a842cb7 | 5,185 | py | Python | groupdocs_signature_cloud/models/time_stamp.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python | 2b7f03b3d70f191dc1292f6221ed9301811681cf | [
"MIT"
] | null | null | null | groupdocs_signature_cloud/models/time_stamp.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python | 2b7f03b3d70f191dc1292f6221ed9301811681cf | [
"MIT"
] | null | null | null | groupdocs_signature_cloud/models/time_stamp.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python | 2b7f03b3d70f191dc1292f6221ed9301811681cf | [
"MIT"
] | 1 | 2021-02-03T00:18:17.000Z | 2021-02-03T00:18:17.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="TimeStamp.py">
# Copyright (c) 2003-2021 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of t... | 28.027027 | 85 | 0.543105 |
import pprint
import re
import six
class TimeStamp(object):
swagger_types = {
'url': 'str',
'user': 'str',
'password': 'str'
}
attribute_map = {
'url': 'Url',
'user': 'User',
'password': 'Password'
}
def __init__(self, url=None, user=None, pass... | true | true |
1c350cff265b3d8016a43c446d64999c2d32b3e3 | 6,479 | py | Python | tests/test_packages/test_skills/test_generic_seller/test_dialogues.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/test_packages/test_skills/test_generic_seller/test_dialogues.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/test_packages/test_skills/test_generic_seller/test_dialogues.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 38.337278 | 89 | 0.656428 |
from pathlib import Path
from typing import cast
import pytest
from aea.exceptions import AEAEnforceError
from aea.helpers.transaction.base import Terms
from aea.protocols.dialogue.base import DialogueLabel
from aea.test_tools.test_skill import BaseSkillTestCase, COUNTERPARTY_AGENT_ADDRESS
from packages.fetchai.pro... | true | true |
1c350d442c7d186deb105cfcbcba108ae69e92e0 | 2,660 | py | Python | Turla Group/Kopiluwak/kopiluwakUAShodanSearch.py | CharityW4CTI/Research | 75ef5dada737148bc105b2b0cc2f276cf35266d7 | [
"MIT"
] | null | null | null | Turla Group/Kopiluwak/kopiluwakUAShodanSearch.py | CharityW4CTI/Research | 75ef5dada737148bc105b2b0cc2f276cf35266d7 | [
"MIT"
] | null | null | null | Turla Group/Kopiluwak/kopiluwakUAShodanSearch.py | CharityW4CTI/Research | 75ef5dada737148bc105b2b0cc2f276cf35266d7 | [
"MIT"
] | null | null | null | import shodan
import re
import argparse
import textwrap
def kopiluwak_match(ua):
found = False
# get only the last 32 characters of the UA
ua_stripped = ua[-32:]
# see if the last 32 characters of the array match the Kopiluwak regex
matchObj = re.search("([0-9]{16}[a-zA-Z0-9]{16})", ua_stripped)
... | 29.88764 | 125 | 0.579323 | import shodan
import re
import argparse
import textwrap
def kopiluwak_match(ua):
found = False
ua_stripped = ua[-32:]
matchObj = re.search("([0-9]{16}[a-zA-Z0-9]{16})", ua_stripped)
if matchObj:
found = True
return found
def uaShodanCheck(ua, SHODAN_API_KEY):
api = shodan.Sho... | true | true |
1c350edcd8d3589e728d7f3781f5b74c4ada5167 | 82,249 | py | Python | PythonVirtEnv/Lib/site-packages/plotly/graph_objs/_pie.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 2 | 2021-07-18T11:39:56.000Z | 2021-11-06T17:13:05.000Z | venv/Lib/site-packages/plotly/graph_objs/_pie.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | null | null | null | venv/Lib/site-packages/plotly/graph_objs/_pie.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | null | null | null | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Pie(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "pie"
_valid_props = {
"automargin",
"customdata",
"customdatasrc",
"directi... | 34.500419 | 103 | 0.560566 | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Pie(_BaseTraceType):
_parent_path_str = ""
_path_str = "pie"
_valid_props = {
"automargin",
"customdata",
"customdatasrc",
"direction",
"dlabel",
"domain",
... | true | true |
1c351047d4d3a9a39b90f064887092fa28a80ef7 | 68,641 | py | Python | python/ccxt/kucoinfutures.py | mattepozz/ccxt | f60278e707af6f6baa55ee027a907bd72d852201 | [
"MIT"
] | null | null | null | python/ccxt/kucoinfutures.py | mattepozz/ccxt | f60278e707af6f6baa55ee027a907bd72d852201 | [
"MIT"
] | null | null | null | python/ccxt/kucoinfutures.py | mattepozz/ccxt | f60278e707af6f6baa55ee027a907bd72d852201 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.kucoin import kucoin
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.bas... | 45.010492 | 352 | 0.478271 |
from ccxt.kucoin import kucoin
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.ba... | true | true |
1c3511fecc84eb80bd643980e0e9ad5b84b0f0ed | 5,265 | py | Python | synaptic_fitting/Heatmap_3000-4000.py | danielmk/pyDentate | df8f67d4523ce463701c5e5675e74e309dd151e7 | [
"MIT"
] | 1 | 2022-02-24T20:39:46.000Z | 2022-02-24T20:39:46.000Z | synaptic_fitting/Heatmap_3000-4000.py | danielmk/pydentate | df8f67d4523ce463701c5e5675e74e309dd151e7 | [
"MIT"
] | null | null | null | synaptic_fitting/Heatmap_3000-4000.py | danielmk/pydentate | df8f67d4523ce463701c5e5675e74e309dd151e7 | [
"MIT"
] | 4 | 2021-11-02T07:47:42.000Z | 2021-11-30T09:07:35.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 21 15:36:56 2019
@author: barisckuru
"""
import numpy as np
import os
from tmgexp2_simulator import simulate
import matplotlib.pyplot as plt
import time
import seaborn as sns
import pandas as pd
import pickle
begin = time.time()
# PARAMETERS
fre... | 25.935961 | 80 | 0.640646 |
import numpy as np
import os
from tmgexp2_simulator import simulate
import matplotlib.pyplot as plt
import time
import seaborn as sns
import pandas as pd
import pickle
begin = time.time()
freq_1 = []
freq_10 = []
freq_30 = []
freq_50 = []
load_1 = []
peaks = []
taus = []
norm = []
data_path = "/home/can/Downloads... | true | true |
1c35124937409aabe6eca6f0ec63180114a253b1 | 1,431 | py | Python | kiss_cache/stores/django_cache.py | HiveTraum/KISSCache-Python | c6f601b3c510e0dd6f4340ea6c013267d8424643 | [
"MIT"
] | null | null | null | kiss_cache/stores/django_cache.py | HiveTraum/KISSCache-Python | c6f601b3c510e0dd6f4340ea6c013267d8424643 | [
"MIT"
] | null | null | null | kiss_cache/stores/django_cache.py | HiveTraum/KISSCache-Python | c6f601b3c510e0dd6f4340ea6c013267d8424643 | [
"MIT"
] | 1 | 2019-12-03T05:54:31.000Z | 2019-12-03T05:54:31.000Z | import logging
from typing import Callable, Any
from uuid import uuid4
logger = logging.getLogger(__name__)
def default_serialize(value: Any) -> str:
return value
def default_deserialize(value: str) -> Any:
return value
class DjangoCacheStore:
def __init__(self, cache_identifier='default',
... | 24.672414 | 74 | 0.60587 | import logging
from typing import Callable, Any
from uuid import uuid4
logger = logging.getLogger(__name__)
def default_serialize(value: Any) -> str:
return value
def default_deserialize(value: str) -> Any:
return value
class DjangoCacheStore:
def __init__(self, cache_identifier='default',
... | true | true |
1c35134960a8258bd7bd63f12ed1b98722ad5d7b | 1,130 | py | Python | cascad/agents/aritifcial_system/contracts/pm/MarketMaker.py | Will-Holden/cascadv2 | fd43d47d4be075d30e75053f9af3cd82c33b6623 | [
"Apache-2.0"
] | null | null | null | cascad/agents/aritifcial_system/contracts/pm/MarketMaker.py | Will-Holden/cascadv2 | fd43d47d4be075d30e75053f9af3cd82c33b6623 | [
"Apache-2.0"
] | null | null | null | cascad/agents/aritifcial_system/contracts/pm/MarketMaker.py | Will-Holden/cascadv2 | fd43d47d4be075d30e75053f9af3cd82c33b6623 | [
"Apache-2.0"
] | 1 | 2022-03-24T10:01:28.000Z | 2022-03-24T10:01:28.000Z | from cascad.agents.aritifcial_system.contracts.token.ERC20 import ERC20
class MarketMaker:
def __init__(self, pmSystem, collateralToken: ERC20, conditionIds, atomicOutcomeSlotCount, fee, funding, stage, whitelist, outcomeSlotCounts, collectionIds, positionIds, owner=None):
self.pmSystem = pmSystem
... | 29.736842 | 186 | 0.669027 | from cascad.agents.aritifcial_system.contracts.token.ERC20 import ERC20
class MarketMaker:
def __init__(self, pmSystem, collateralToken: ERC20, conditionIds, atomicOutcomeSlotCount, fee, funding, stage, whitelist, outcomeSlotCounts, collectionIds, positionIds, owner=None):
self.pmSystem = pmSystem
... | true | true |
1c351511f358442a292e6f21da74651a5abef80f | 9,844 | py | Python | src/schnetpack/representation/schnet.py | giadefa/schnetpack | 9dabc3b6e3b28deb2fb3743ea1857c46b055efbf | [
"MIT"
] | 2 | 2020-12-29T05:28:20.000Z | 2020-12-29T05:30:13.000Z | src/schnetpack/representation/schnet.py | giadefa/schnetpack | 9dabc3b6e3b28deb2fb3743ea1857c46b055efbf | [
"MIT"
] | null | null | null | src/schnetpack/representation/schnet.py | giadefa/schnetpack | 9dabc3b6e3b28deb2fb3743ea1857c46b055efbf | [
"MIT"
] | 1 | 2021-01-22T13:44:31.000Z | 2021-01-22T13:44:31.000Z | import torch
import torch.nn as nn
from schnetpack.nn.base import Dense
from schnetpack import Properties
from schnetpack.nn.cfconv import CFConv
from schnetpack.nn.cutoff import CosineCutoff
from schnetpack.nn.acsf import GaussianSmearing
from schnetpack.nn.neighbors import AtomDistances
from schnetpack.nn.activation... | 40.677686 | 90 | 0.636022 | import torch
import torch.nn as nn
from schnetpack.nn.base import Dense
from schnetpack import Properties
from schnetpack.nn.cfconv import CFConv
from schnetpack.nn.cutoff import CosineCutoff
from schnetpack.nn.acsf import GaussianSmearing
from schnetpack.nn.neighbors import AtomDistances
from schnetpack.nn.activation... | true | true |
1c35157c9fe7539f712f26bd3ec3763008713658 | 2,202 | py | Python | peer/models/person.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | peer/models/person.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | peer/models/person.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Person models
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Third-party modul... | 32.865672 | 83 | 0.556767 |
from django.db import models
from noc.core.model.base import NOCModel
from noc.core.gridvcs.manager import GridVCSField
from noc.core.rpsl import rpsl_format, rpsl_multiple
from noc.core.model.decorator import on_save
from .rir import RIR
@on_save
class Person(NOCModel):
class Meta(object):
verbose_name... | true | true |
1c351733324a5dc157de87d80d6cc8aecc3b785f | 13,804 | py | Python | src/main.py | kppw99/UG_FedAVG | 61f6fcfedfed1136b19c12a6603231cda884e22f | [
"MIT"
] | 3 | 2021-09-23T02:10:17.000Z | 2022-01-16T03:38:34.000Z | src/main.py | kppw99/Uncert_FedAVG | 61f6fcfedfed1136b19c12a6603231cda884e22f | [
"MIT"
] | 1 | 2022-02-25T08:03:34.000Z | 2022-02-25T08:03:34.000Z | src/main.py | kppw99/Uncert_FedAVG | 61f6fcfedfed1136b19c12a6603231cda884e22f | [
"MIT"
] | 1 | 2022-02-23T11:49:25.000Z | 2022-02-23T11:49:25.000Z | from util import *
from model import *
if __name__=='__main__':
# Parse arguments
DATASET, MODEL_LIST, IID_NON_COR, NON_IID_NON_COR = arg_parse()
if DATASET == 'mnist':
from mnist_config import *
elif DATASET == 'fmnist':
from fmnist_config import *
elif DATASET == 'cifar10':
... | 58.740426 | 121 | 0.407925 | from util import *
from model import *
if __name__=='__main__':
DATASET, MODEL_LIST, IID_NON_COR, NON_IID_NON_COR = arg_parse()
if DATASET == 'mnist':
from mnist_config import *
elif DATASET == 'fmnist':
from fmnist_config import *
elif DATASET == 'cifar10':
from cifar10_c... | true | true |
1c3517ba62458442d409f0861659c1c996a2b301 | 4,814 | py | Python | setup.py | minddistrict/zope.index | 7fd8bbad0584e21c0158e73681bcf99b6bacb699 | [
"ZPL-2.1"
] | null | null | null | setup.py | minddistrict/zope.index | 7fd8bbad0584e21c0158e73681bcf99b6bacb699 | [
"ZPL-2.1"
] | null | null | null | setup.py | minddistrict/zope.index | 7fd8bbad0584e21c0158e73681bcf99b6bacb699 | [
"ZPL-2.1"
] | 1 | 2021-09-29T19:54:14.000Z | 2021-09-29T19:54:14.000Z | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 36.195489 | 78 | 0.613004 | from __future__ import print_function
import sys
import os
from setuptools import setup, find_packages, Extension
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError
from distutils.errors import DistutilsExecError
from distutils.errors import DistutilsPlatformError
def read(*... | true | true |
1c35183f1cdcc7b0458bca42b837355b152e5542 | 443 | py | Python | libs/model/Num3.py | zyfccc/Spectral-Illumination-Correction-Achieving-Relative-Color-Constancy-Under-the-Spectral-Domain | 051af9662dbe53deaf2d493fe8dbf0c9adce7ccb | [
"MIT"
] | 8 | 2019-12-17T15:07:17.000Z | 2021-08-19T09:13:58.000Z | libs/model/Num3.py | zyfccc/Spectral-Illumination-Correction-Achieving-Relative-Color-Constancy-Under-the-Spectral-Domain | 051af9662dbe53deaf2d493fe8dbf0c9adce7ccb | [
"MIT"
] | null | null | null | libs/model/Num3.py | zyfccc/Spectral-Illumination-Correction-Achieving-Relative-Color-Constancy-Under-the-Spectral-Domain | 051af9662dbe53deaf2d493fe8dbf0c9adce7ccb | [
"MIT"
] | 3 | 2020-01-06T04:20:55.000Z | 2020-01-25T08:42:30.000Z |
class Num3:
def __init__(self, x=0, y=0, z=0, json=None):
if json is not None:
self.fromJson(json)
else:
self.x = x
self.y = y
self.z = z
def toJson(self):
return {
'x': self.x,
'y': self.y,
'z': self.z... | 20.136364 | 49 | 0.399549 |
class Num3:
def __init__(self, x=0, y=0, z=0, json=None):
if json is not None:
self.fromJson(json)
else:
self.x = x
self.y = y
self.z = z
def toJson(self):
return {
'x': self.x,
'y': self.y,
'z': self.z... | true | true |
1c3518a52d1603a28901baeebc4e463bea27365a | 407 | py | Python | IncludeVisitor.py | ArmindoFlores/MineScript | 347d7dd61ac1e39e4707210ede98e9c3ca44c891 | [
"MIT"
] | 5 | 2019-07-31T19:20:07.000Z | 2022-02-16T09:48:06.000Z | IncludeVisitor.py | ArmindoFlores/MineScript | 347d7dd61ac1e39e4707210ede98e9c3ca44c891 | [
"MIT"
] | null | null | null | IncludeVisitor.py | ArmindoFlores/MineScript | 347d7dd61ac1e39e4707210ede98e9c3ca44c891 | [
"MIT"
] | null | null | null | from MineScriptVisitor import MineScriptVisitor
class IncludeVisitor(MineScriptVisitor):
def __init__(self):
self.modules = []
def add_module(self, module, line):
if module not in self.modules:
self.modules.append((module, line))
def visitInclude(self, ctx):
... | 25.4375 | 48 | 0.619165 | from MineScriptVisitor import MineScriptVisitor
class IncludeVisitor(MineScriptVisitor):
def __init__(self):
self.modules = []
def add_module(self, module, line):
if module not in self.modules:
self.modules.append((module, line))
def visitInclude(self, ctx):
... | true | true |
1c3518d2f2a5ab734aa304864fde549bb568a3b1 | 1,262 | gyp | Python | binding.gyp | ismailrei/devisPattern | b20dd604dcfa609fec4dd1d4a14129f604b5870e | [
"MIT"
] | 1 | 2017-11-06T08:23:54.000Z | 2017-11-06T08:23:54.000Z | binding.gyp | ismailrei/devisPattern | b20dd604dcfa609fec4dd1d4a14129f604b5870e | [
"MIT"
] | null | null | null | binding.gyp | ismailrei/devisPattern | b20dd604dcfa609fec4dd1d4a14129f604b5870e | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "addon",
"sources": [
"addon.cpp",
"devisPattern.cpp"
],
"cflags" : [ "-std=c++11"],
"cflags!": [ '-fno-exceptions' ],
... | 42.066667 | 108 | 0.211569 | {
"targets": [
{
"target_name": "addon",
"sources": [
"addon.cpp",
"devisPattern.cpp"
],
"cflags" : [ "-std=c++11"],
"cflags!": [ '-fno-exceptions' ],
... | true | true |
1c3519e8931da5c128759a4b15790e3e7153cd00 | 11,342 | py | Python | src/microprobe/utils/objdump.py | TheArni/microprobe | 46d17a9744b943bb448fc5e2872f3521084d8bec | [
"Apache-2.0"
] | 13 | 2018-09-06T05:16:08.000Z | 2022-03-07T23:03:46.000Z | src/microprobe/utils/objdump.py | TheArni/microprobe | 46d17a9744b943bb448fc5e2872f3521084d8bec | [
"Apache-2.0"
] | 24 | 2018-07-10T01:56:10.000Z | 2022-02-22T22:38:25.000Z | src/microprobe/utils/objdump.py | TheArni/microprobe | 46d17a9744b943bb448fc5e2872f3521084d8bec | [
"Apache-2.0"
] | 12 | 2018-09-06T13:58:24.000Z | 2022-01-27T21:15:39.000Z | # Copyright 2011-2021 IBM 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 writ... | 28.21393 | 79 | 0.615059 |
from __future__ import absolute_import, print_function
import re
from six.moves import zip
from microprobe import MICROPROBE_RC
from microprobe.code.address import Address
from microprobe.code.ins import MicroprobeInstructionDefinition
from microprobe.exceptions import MicroprobeAsmError, \
MicroprobeBinaryErro... | true | true |
1c3519f6988a89d9216812d575f2b01c4a4a00ec | 3,246 | py | Python | sigmaproject/computer_vision/convolution.py | k-zen/SigmaProject | b844766d28d142ed1fb4d2e20f4e9dbad0ad90a6 | [
"BSD-2-Clause"
] | null | null | null | sigmaproject/computer_vision/convolution.py | k-zen/SigmaProject | b844766d28d142ed1fb4d2e20f4e9dbad0ad90a6 | [
"BSD-2-Clause"
] | 8 | 2020-04-27T19:31:23.000Z | 2021-08-06T19:43:46.000Z | sigmaproject/computer_vision/convolution.py | k-zen/SigmaProject | b844766d28d142ed1fb4d2e20f4e9dbad0ad90a6 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (c) 2019, Andreas Koenzen <akoenzen | uvic.ca>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright not... | 32.46 | 108 | 0.603204 |
import numpy as np
from .utilities import Utilities
from typing import Dict
class Convolution(object):
IDENTITY = 1
EDGES_1 = 2
EDGES_2 = 3
EDGES_3 = 4
KERNELS: Dict[int, np.array] = {
IDENTITY: np.array([
[+0, +0, +0],
[+0, +1, +0],
[+0, +0, +0]
... | true | true |
1c351ba2cb26f12b8aa12dea1aabed6bfb5db532 | 790 | py | Python | allennlp/data/tokenizers/whitespace_tokenizer.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2021-04-27T19:56:28.000Z | 2021-08-19T05:34:37.000Z | allennlp/data/tokenizers/whitespace_tokenizer.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 5 | 2021-05-03T14:40:33.000Z | 2021-05-03T14:40:34.000Z | allennlp/data/tokenizers/whitespace_tokenizer.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2019-12-21T05:58:44.000Z | 2021-08-16T07:41:21.000Z | from typing import List
from overrides import overrides
from allennlp.data.tokenizers.token import Token
from allennlp.data.tokenizers.tokenizer import Tokenizer
@Tokenizer.register("whitespace")
@Tokenizer.register("just_spaces")
class WhitespaceTokenizer(Tokenizer):
"""
A `Tokenizer` that assumes you've a... | 32.916667 | 96 | 0.743038 | from typing import List
from overrides import overrides
from allennlp.data.tokenizers.token import Token
from allennlp.data.tokenizers.tokenizer import Tokenizer
@Tokenizer.register("whitespace")
@Tokenizer.register("just_spaces")
class WhitespaceTokenizer(Tokenizer):
@overrides
def tokenize(self, text: st... | true | true |
1c351c9423d609c42c4be79fbf5316d3b85b0cc5 | 17,886 | py | Python | corehq/apps/accounting/migrations/0010_auto__chg_field_billingaccount_name.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/accounting/migrations/0010_auto__chg_field_billingaccount_name.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/accounting/migrations/0010_auto__chg_field_billingaccount_name.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'BillingAccount.name'
db.alter_column(u'accounting_billingaccount', 'name', self.gf('djan... | 81.3 | 198 | 0.570558 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.alter_column(u'accounting_billingaccount', 'name', self.gf('django.db.models.fields.CharField')(max_length=200))
de... | true | true |
1c351d62c4ba7e4ef4c5a90fea7c627e5ac13ffc | 1,096 | py | Python | sanaviron/src/3rd/pycha/tests/runner.py | StetHD/sanaviron | dcb5d3ac6725771942e669a29961ba3f811b7fd4 | [
"Apache-2.0"
] | null | null | null | sanaviron/src/3rd/pycha/tests/runner.py | StetHD/sanaviron | dcb5d3ac6725771942e669a29961ba3f811b7fd4 | [
"Apache-2.0"
] | null | null | null | sanaviron/src/3rd/pycha/tests/runner.py | StetHD/sanaviron | dcb5d3ac6725771942e669a29961ba3f811b7fd4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2007-2008 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is part of PyCha.
#
# PyCha is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License... | 29.621622 | 80 | 0.720803 |
import unittest
import bar
import chart
import color
import line
import pie
def test_suite():
return unittest.TestSuite((
bar.test_suite(),
chart.test_suite(),
color.test_suite(),
line.test_suite(),
pie.test_suite(),
))
if __name__ == '__main__':
unittest.main... | true | true |
1c351d91fd998c54cbe1f7db8cc1ef7c336525d6 | 1,633 | py | Python | month01/面向对象/类和对象/day02/homework01.py | chaofan-zheng/python_leanring_code | 0af44ff39b9ded2c1d2cc96c6d356d21170ac04d | [
"Apache-2.0"
] | 4 | 2021-01-07T14:25:10.000Z | 2021-02-01T10:36:01.000Z | month01/面向对象/类和对象/day02/homework01.py | chaofan-zheng/python_leanring_code | 0af44ff39b9ded2c1d2cc96c6d356d21170ac04d | [
"Apache-2.0"
] | null | null | null | month01/面向对象/类和对象/day02/homework01.py | chaofan-zheng/python_leanring_code | 0af44ff39b9ded2c1d2cc96c6d356d21170ac04d | [
"Apache-2.0"
] | null | null | null | """
以面向对象的思想,描述下列情景.
(1)需求:小明使用手机打电话
(2)小明一次请多个保洁打扫卫生
效果:调用一次小明通知方法,可以有多个保洁在打扫卫生.
(3)张无忌教赵敏九阳神功
赵敏教张无忌玉女心经
张无忌工作挣了5000元
赵敏工作挣了10000元
"""
class Person:
def __init__(self, name):
self.name = name
def use_phone(self, phone):
phone.call()
class Phone:
def call(self):... | 17.945055 | 52 | 0.629516 |
class Person:
def __init__(self, name):
self.name = name
def use_phone(self, phone):
phone.call()
class Phone:
def call(self):
print("打电话")
xiaoming = Person("小明")
phone = Phone()
xiaoming.use_phone(phone)
print()
class People:
def __init__(self, name):
self.nam... | true | true |
1c351dfa7f2fc57cc605e7d19dfea18fbc4b39ed | 748 | py | Python | var/spack/repos/builtin/packages/bc/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/bc/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/bc/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 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.package import *
class Bc(AutotoolsPackage, GNUMirrorPackage):
"""bc is an arbitrary precision numeric pr... | 32.521739 | 94 | 0.741979 |
from spack.package import *
class Bc(AutotoolsPackage, GNUMirrorPackage):
homepage = "https://www.gnu.org/software/bc"
gnu_mirror_path = "bc/bc-1.07.tar.gz"
version('1.07', sha256='55cf1fc33a728d7c3d386cc7b0cb556eb5bacf8e0cb5a3fcca7f109fc61205ad')
depends_on('ed', type='build')
depends_on('tex... | true | true |
1c3521323cf7d57dc8b2b240d95a181b90cc3144 | 1,188 | py | Python | src/recognizeDigit.py | RsTaK/Sudoku | 8daa0a06906ce61d9a71586a8d28a3931ca4e5e3 | [
"MIT"
] | 2 | 2020-01-22T14:32:40.000Z | 2021-12-23T20:42:52.000Z | src/recognizeDigit.py | RsTaK/Sudoku | 8daa0a06906ce61d9a71586a8d28a3931ca4e5e3 | [
"MIT"
] | 4 | 2020-11-13T18:54:24.000Z | 2022-02-10T02:10:00.000Z | src/recognizeDigit.py | RsTaK/Sudoku | 8daa0a06906ce61d9a71586a8d28a3931ca4e5e3 | [
"MIT"
] | 1 | 2020-01-22T14:02:50.000Z | 2020-01-22T14:02:50.000Z | from keras.models import load_model
import cv2
import pickle
import keras.backend as K
import numpy as np
from src.model_path import MODEL_PATH
'''def predict(self, cell):
model = load_model('./model/Model.h5')
f = K.function([model.layers[0].input, K.learning_phase()],[model.layers[-1].output])
rescaled_cell = ... | 27 | 87 | 0.705387 | from keras.models import load_model
import cv2
import pickle
import keras.backend as K
import numpy as np
from src.model_path import MODEL_PATH
class recognizeDigit:
def __init__(self, cell):
self._prediction = self.predict(cell)
def predict(self, cell):
model = load_model(MODEL_PATH)
rescaled_cell =... | true | true |
1c3521b67dec540553facf88ad2e9e97f1fee4e7 | 14,075 | py | Python | python/fate_test/fate_test/scripts/pipeline_conversion_cli.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 715 | 2019-01-24T10:52:03.000Z | 2019-10-31T12:19:22.000Z | python/fate_test/fate_test/scripts/pipeline_conversion_cli.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 270 | 2019-02-11T02:57:36.000Z | 2019-08-29T11:22:33.000Z | python/fate_test/fate_test/scripts/pipeline_conversion_cli.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 200 | 2019-01-26T14:21:35.000Z | 2019-11-01T01:14:36.000Z | import copy
import os
import shutil
import sys
import time
import uuid
import json
import click
import importlib
from fate_test._config import Config
from fate_test._io import LOGGER, echo
from fate_test.scripts._options import SharedOptions
@click.group(name="convert")
def convert_group():
"""
Converting pi... | 38.881215 | 120 | 0.601634 | import copy
import os
import shutil
import sys
import time
import uuid
import json
import click
import importlib
from fate_test._config import Config
from fate_test._io import LOGGER, echo
from fate_test.scripts._options import SharedOptions
@click.group(name="convert")
def convert_group():
...
@convert_group.... | true | true |
1c35235d2354af6cc9a378696a72c8e3440fb543 | 5,315 | py | Python | cnn_architectures/augmentation_4/eval_model_c10_leilaclip_aug4_560.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | 2 | 2019-10-29T03:26:20.000Z | 2021-03-07T10:02:39.000Z | cnn_architectures/augmentation_4/eval_model_c10_leilaclip_aug4_560.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | cnn_architectures/augmentation_4/eval_model_c10_leilaclip_aug4_560.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | # Load in model weights and evaluate its goodness (ECE, MCE, error) also saves logits.
# ResNet model from https://github.com/BIGBALLON/cifar-10-cnn/blob/master/4_Residual_Network/ResNet_keras.py
import keras
import numpy as np
from keras.datasets import cifar10, cifar100
from keras.preprocessing.image import ImageDat... | 38.23741 | 132 | 0.660207 |
import keras
import numpy as np
from keras.datasets import cifar10, cifar100
from keras.preprocessing.image import ImageDataGenerator
from keras.layers.normalization import BatchNormalization
from keras.layers import Conv2D, Dense, Input, add, Activation, GlobalAveragePooling2D
from keras.callbacks import LearningRate... | true | true |
1c35238991c89b2303596c6026d78ebc7dc792de | 155 | py | Python | libtcodpy.py | Rakaneth/python-tcod | 70ff1895fd7ae87bf66f16e388211db389d983fd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | libtcodpy.py | Rakaneth/python-tcod | 70ff1895fd7ae87bf66f16e388211db389d983fd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | libtcodpy.py | Rakaneth/python-tcod | 70ff1895fd7ae87bf66f16e388211db389d983fd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """This module just an alias for tcod"""
import warnings
warnings.warn("`import tcod` is preferred.", DeprecationWarning, stacklevel=2)
from tcod import *
| 31 | 78 | 0.76129 | import warnings
warnings.warn("`import tcod` is preferred.", DeprecationWarning, stacklevel=2)
from tcod import *
| true | true |
1c3523fd8d02a1516ef4dd75b146e5fa3c73adca | 5,803 | py | Python | Supermicro/benchmarks/maskrcnn/implementations/pytorch_SYS-420GP-TNAR/maskrcnn_benchmark/modeling/matcher.py | gglin001/training_results_v1.1 | 58fd4103f0f465bda6eb56a06a74b7bbccbbcf24 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | Supermicro/benchmarks/maskrcnn/implementations/pytorch_SYS-420GP-TNAR/maskrcnn_benchmark/modeling/matcher.py | gglin001/training_results_v1.1 | 58fd4103f0f465bda6eb56a06a74b7bbccbbcf24 | [
"Apache-2.0"
] | 21 | 2021-08-31T08:34:50.000Z | 2022-03-17T11:42:10.000Z | NVIDIA/benchmarks/maskrcnn/implementations/pytorch/maskrcnn_benchmark/modeling/matcher.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved.
import torch
from maskrcnn_benchmark import _C
class Matcher(object):
"""
This class assigns to each predicted "element" (e.g., a box) a ground-truth
element. Each pred... | 47.958678 | 161 | 0.639152 | import torch
from maskrcnn_benchmark import _C
class Matcher(object):
BELOW_LOW_THRESHOLD = -1
BETWEEN_THRESHOLDS = -2
def __init__(self, high_threshold, low_threshold, allow_low_quality_matches=False):
assert low_threshold <= high_threshold
self.high_threshold = high_threshold
se... | true | true |
1c3524bc34295eb32e34de4b5a895a6a729a82bc | 469 | py | Python | Algorithms/Implementation/Apple_and_Orange/main.py | ugurcan-sonmez-95/HackerRank_Problems | 187d83422128228c241f279096386df5493d539d | [
"MIT"
] | null | null | null | Algorithms/Implementation/Apple_and_Orange/main.py | ugurcan-sonmez-95/HackerRank_Problems | 187d83422128228c241f279096386df5493d539d | [
"MIT"
] | null | null | null | Algorithms/Implementation/Apple_and_Orange/main.py | ugurcan-sonmez-95/HackerRank_Problems | 187d83422128228c241f279096386df5493d539d | [
"MIT"
] | null | null | null | ### Apple and Orange - Solution
def countApplesAndOranges(*args):
count = (sum(s <= (a+i) <= t for i in list_apple), sum(s <= (b+j) <= t for j in list_orange))
print(*count, sep='\n')
s, t = map(int, input().split())
a, b = map(int, input().split())
apples, oranges = map(int, input().split())
list_apple = tup... | 39.083333 | 97 | 0.646055 |
def countApplesAndOranges(*args):
count = (sum(s <= (a+i) <= t for i in list_apple), sum(s <= (b+j) <= t for j in list_orange))
print(*count, sep='\n')
s, t = map(int, input().split())
a, b = map(int, input().split())
apples, oranges = map(int, input().split())
list_apple = tuple(map(int, input().split()[:app... | true | true |
1c3524d3b7d89fd9ea3d4786c0b184c1ef7629b3 | 598 | py | Python | pbx_gs_python_utils/utils/Process.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 3 | 2018-12-14T15:43:46.000Z | 2019-04-25T07:44:58.000Z | pbx_gs_python_utils/utils/Process.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 1 | 2019-05-11T14:19:37.000Z | 2019-05-11T14:51:04.000Z | pbx_gs_python_utils/utils/Process.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 4 | 2018-12-27T04:54:14.000Z | 2019-05-11T14:07:47.000Z | import os
import signal
import subprocess
class Process:
@staticmethod
def run(executable, params = [], cwd='.'):
run_params = [executable] + params
result = subprocess.run(run_params, cwd = cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return {
"runParams" : ... | 27.181818 | 107 | 0.593645 | import os
import signal
import subprocess
class Process:
@staticmethod
def run(executable, params = [], cwd='.'):
run_params = [executable] + params
result = subprocess.run(run_params, cwd = cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return {
"runParams" : ... | true | true |
1c35250043d955c5b423451551b1a24c66b4c5d2 | 24,594 | py | Python | unit_tests/test_charms_openstack_devices_pci.py | cloud-padawan/charms.openstack | 1fe4e411cf1ebc5b89e69af0cbac5e4045811ef8 | [
"Apache-2.0"
] | null | null | null | unit_tests/test_charms_openstack_devices_pci.py | cloud-padawan/charms.openstack | 1fe4e411cf1ebc5b89e69af0cbac5e4045811ef8 | [
"Apache-2.0"
] | null | null | null | unit_tests/test_charms_openstack_devices_pci.py | cloud-padawan/charms.openstack | 1fe4e411cf1ebc5b89e69af0cbac5e4045811ef8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 43.996422 | 77 | 0.65703 |
from __future__ import absolute_import
import mock
import charms_openstack.devices.pci as pci
import unit_tests.pci_responses as pci_responses
import unit_tests.utils as utils
def mocked_subprocess(subproc_map=None):
def _subproc(cmd, stdin=None):
for key in pci_responses.COMMANDS.keys():
... | true | true |
1c352504ad483c694312e26f2b9ee3495b840de3 | 450 | py | Python | cui/symbols.py | clandgraf/cui | 2073e56e6f0a6d1278207b583bfc3f15a08a5ca5 | [
"BSD-3-Clause"
] | null | null | null | cui/symbols.py | clandgraf/cui | 2073e56e6f0a6d1278207b583bfc3f15a08a5ca5 | [
"BSD-3-Clause"
] | null | null | null | cui/symbols.py | clandgraf/cui | 2073e56e6f0a6d1278207b583bfc3f15a08a5ca5 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017 Christoph Landgraf. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Symbol(object):
def __hash__(self):
return id(self)
def __eq__(self, other):
return id(self) == id(other)
SYM_VL... | 25 | 73 | 0.666667 |
class Symbol(object):
def __hash__(self):
return id(self)
def __eq__(self, other):
return id(self) == id(other)
SYM_VLINE = Symbol()
SYM_HLINE = Symbol()
SYM_LLCORNER = Symbol()
SYM_LTEE = Symbol()
SYM_RARROW = Symbol()
SYM_DARROW = Symbol()
| true | true |
1c352709362d8ae28f08359cb49eba77cb85c6cb | 4,638 | py | Python | auth-api/src/auth_api/__init__.py | thorwolpert/sbc-auth | 5da50cde2e5625d1b0ceea090c3656ee374c9b71 | [
"Apache-2.0"
] | 11 | 2019-09-26T06:58:25.000Z | 2022-01-26T06:19:39.000Z | auth-api/src/auth_api/__init__.py | thorwolpert/sbc-auth | 5da50cde2e5625d1b0ceea090c3656ee374c9b71 | [
"Apache-2.0"
] | 1,622 | 2019-05-07T21:08:38.000Z | 2022-03-28T17:07:15.000Z | auth-api/src/auth_api/__init__.py | thorwolpert/sbc-auth | 5da50cde2e5625d1b0ceea090c3656ee374c9b71 | [
"Apache-2.0"
] | 98 | 2019-03-01T21:36:15.000Z | 2021-12-01T22:11:25.000Z | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 35.136364 | 108 | 0.709142 |
import json
import os
import sentry_sdk from flask import Flask, g, request
from humps.main import camelize
from sbc_common_components.exception_handling.exception_handler import ExceptionHandler from sentry_sdk.integrations.flask import FlaskIntegration
import auth_api.config as config from auth_api import mode... | true | true |
1c35273f22524824a1badec9f7b8ab86d3ec0258 | 12,655 | py | Python | Staff.py | iGuan7u/HRScript | 53ac7b6865623713ffadb22ff0620d63f87c3313 | [
"MIT"
] | null | null | null | Staff.py | iGuan7u/HRScript | 53ac7b6865623713ffadb22ff0620d63f87c3313 | [
"MIT"
] | null | null | null | Staff.py | iGuan7u/HRScript | 53ac7b6865623713ffadb22ff0620d63f87c3313 | [
"MIT"
] | null | null | null | from SheetHelper import SheetHelper
class Staff:
# 姓名
name = ''
# 工作地点
workPlace = ''
# 中心
center = ''
# 部门
department = ''
# 科室
administration = ''
# 组
group = ''
# 一级主管
leader = ''
# 用户名
userName = ''
# OA
OAName = ''
# 英文名
englishName =... | 31.558603 | 149 | 0.616041 | from SheetHelper import SheetHelper
class Staff:
name = ''
workPlace = ''
center = ''
department = ''
administration = ''
group = ''
leader = ''
userName = ''
OAName = ''
englishName = ''
state = '在职'
nation = ''
po... | true | true |
1c3527b72a8c9842e102fa8eb962fbb3b769d1c1 | 3,224 | py | Python | pytmatrix/tmatrix_aux.py | DaveOri/pytmatrix | 0287a41d49ff3a34d5309f5f832183f37b24276d | [
"MIT"
] | 64 | 2015-03-09T18:35:52.000Z | 2022-02-28T22:01:40.000Z | pytmatrix/tmatrix_aux.py | DaveOri/pytmatrix | 0287a41d49ff3a34d5309f5f832183f37b24276d | [
"MIT"
] | 22 | 2015-03-09T19:08:47.000Z | 2022-01-19T08:10:10.000Z | pytmatrix/tmatrix_aux.py | DaveOri/pytmatrix | 0287a41d49ff3a34d5309f5f832183f37b24276d | [
"MIT"
] | 38 | 2015-01-29T13:22:32.000Z | 2022-02-17T07:47:06.000Z | """
Copyright (C) 2009-2015 Jussi Leinonen, Finnish Meteorological Institute,
California Institute of Technology
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 wit... | 34.297872 | 80 | 0.694479 |
VERSION = "0.3.2"
wl_S = 111.0
wl_C = 53.5
wl_X = 33.3
wl_Ku = 22.0
wl_Ka = 8.43
wl_W = 3.19
K_w_sqr = {wl_S: 0.93, wl_C: 0.93, wl_X: 0.93, wl_Ku: 0.93, wl_Ka: 0.92,
wl_W: 0.75}
geom_horiz_back = (90.0, 90.0, 0.0, 180.0, 0.0, 0.0) geom_horiz_forw = (90.0, 90.0, 0.0, 0.0, 0.0, 0.0) geom_vert_back = (0.0, 180.0, 0... | true | true |
1c3528b330d6d52f1eafee2cbedada808d989220 | 3,093 | py | Python | src/iago/Parser.py | ferchault/iago | fc853eab7820df18d20b653acdc09c156dc152e1 | [
"MIT"
] | null | null | null | src/iago/Parser.py | ferchault/iago | fc853eab7820df18d20b653acdc09c156dc152e1 | [
"MIT"
] | 18 | 2016-10-09T14:48:28.000Z | 2017-05-08T06:34:24.000Z | src/iago/Parser.py | ferchault/iago | fc853eab7820df18d20b653acdc09c156dc152e1 | [
"MIT"
] | null | null | null | # standard modules
import os
import re
# custom modules
import Reader
class Parser(object):
def __init__(self):
self._readers = dict()
self.path = None
self.runmatch = dict()
self._runcache = None
def get_atom_indices(self, selector):
"""
:param selector: Valid selection string.
:return: List of 0-b... | 29.457143 | 113 | 0.696088 | import os
import re
import Reader
class Parser(object):
def __init__(self):
self._readers = dict()
self.path = None
self.runmatch = dict()
self._runcache = None
def get_atom_indices(self, selector):
u = self._readers.itervalues().next().get_universe()
if isinstance(u, Reader.EmptyUniverse):
return ... | true | true |
1c3528b5e4cac10d724e001938a99d7a640d8dbd | 684 | py | Python | core/pages/header/header.py | mmihailicenko/selenium-pytest-framework | 9487ae4911e8ac7f6a69028603d31b347f182f47 | [
"MIT"
] | 1 | 2021-07-26T06:28:30.000Z | 2021-07-26T06:28:30.000Z | core/pages/header/header.py | mmihailicenko/selenium-pytest-framework | 9487ae4911e8ac7f6a69028603d31b347f182f47 | [
"MIT"
] | null | null | null | core/pages/header/header.py | mmihailicenko/selenium-pytest-framework | 9487ae4911e8ac7f6a69028603d31b347f182f47 | [
"MIT"
] | null | null | null | from selenium.webdriver.common.by import By
from core.pages.base_page import BasePage
from core.pages.main.main_page import MainPage
class Header(BasePage):
LOGO_TITLE = (By.CSS_SELECTOR, "#logo .title")
SEARCH_FIELD = (By.CSS_SELECTOR, ".search-field")
SEARCH_SUBMIT_BTN = (By.CSS_SELECTOR, ".search-sub... | 28.5 | 62 | 0.701754 | from selenium.webdriver.common.by import By
from core.pages.base_page import BasePage
from core.pages.main.main_page import MainPage
class Header(BasePage):
LOGO_TITLE = (By.CSS_SELECTOR, "#logo .title")
SEARCH_FIELD = (By.CSS_SELECTOR, ".search-field")
SEARCH_SUBMIT_BTN = (By.CSS_SELECTOR, ".search-sub... | true | true |
1c35292b72892e1eb6c4d0cd70aa67d1eef3aca7 | 3,085 | py | Python | Codes/recognition/lib/models/crnn.py | hsupengbo/201800130086_spring_NNML | c51d074c2d33650cc923ccc4297ecbce31c83df7 | [
"MIT"
] | 3 | 2021-12-15T06:57:46.000Z | 2022-03-16T06:26:16.000Z | Codes/recognition/lib/models/crnn.py | pengbohsu/201800130086_spring_NNML | c51d074c2d33650cc923ccc4297ecbce31c83df7 | [
"MIT"
] | 2 | 2021-12-15T07:34:34.000Z | 2022-03-16T06:24:21.000Z | Codes/recognition/lib/models/crnn.py | pengbohsu/201800130086_spring_NNML | c51d074c2d33650cc923ccc4297ecbce31c83df7 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
class BidirectionalLSTM(nn.Module):
# Inputs hidden units Out
def __init__(self, nIn, nHidden, nOut):
super(BidirectionalLSTM, self).__init__()
self.rnn = nn.LSTM(nIn, nHidden, bidirectional=True)
self.embedding = nn.Linear(nHidden... | 32.135417 | 101 | 0.540357 | import torch.nn as nn
import torch.nn.functional as F
class BidirectionalLSTM(nn.Module):
def __init__(self, nIn, nHidden, nOut):
super(BidirectionalLSTM, self).__init__()
self.rnn = nn.LSTM(nIn, nHidden, bidirectional=True)
self.embedding = nn.Linear(nHidden * 2, nOut)
def forwa... | true | true |
1c35298fcc6b85b9e74eaf2e56505004f4529ad7 | 14,679 | py | Python | pandas/core/arrays/numpy_.py | kadekillary/pandas | f6a5dd4b8c450d73f3bec964b05cca32cef4bb71 | [
"BSD-3-Clause"
] | 1 | 2019-12-27T01:54:53.000Z | 2019-12-27T01:54:53.000Z | pandas/core/arrays/numpy_.py | kadekillary/pandas | f6a5dd4b8c450d73f3bec964b05cca32cef4bb71 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/arrays/numpy_.py | kadekillary/pandas | f6a5dd4b8c450d73f3bec964b05cca32cef4bb71 | [
"BSD-3-Clause"
] | null | null | null | import numbers
import numpy as np
from numpy.lib.mixins import NDArrayOperatorsMixin
from pandas._libs import lib
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender
from pandas.util._validators import validate_fillna_kwargs
from pandas.core.dtypes.dtypes import ExtensionDtype... | 31.635776 | 88 | 0.592138 | import numbers
import numpy as np
from numpy.lib.mixins import NDArrayOperatorsMixin
from pandas._libs import lib
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender
from pandas.util._validators import validate_fillna_kwargs
from pandas.core.dtypes.dtypes import ExtensionDtype... | true | true |
1c352997b3488b4665bffd9224d7f607f1c9e05d | 8,158 | py | Python | lib/datasets/voc_eval.py | zyuerugou/tf-faster-rcnn | 6d1e3d9691ad3dd570e56a77304fc307969dc0f3 | [
"MIT"
] | null | null | null | lib/datasets/voc_eval.py | zyuerugou/tf-faster-rcnn | 6d1e3d9691ad3dd570e56a77304fc307969dc0f3 | [
"MIT"
] | null | null | null | lib/datasets/voc_eval.py | zyuerugou/tf-faster-rcnn | 6d1e3d9691ad3dd570e56a77304fc307969dc0f3 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import pr... | 33.02834 | 97 | 0.511522 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import xml.etree.ElementTree as ET
import os
import pickle
import numpy as np
def parse_rec(filename):
tree = ET.parse(filename)
objects = []
print('obj class:')
for obj in tree.findall('object'):... | true | true |
1c352997d01a22505572c0627be711f3de4d8a1d | 737 | py | Python | kubragen2/tests/test_options.py | RangelReale/kubragen2 | 2118f1429a9b9da937582db1f41d4f12b78773e2 | [
"MIT"
] | 1 | 2022-02-14T07:31:57.000Z | 2022-02-14T07:31:57.000Z | kubragen2/tests/test_options.py | RangelReale/kubragen2 | 2118f1429a9b9da937582db1f41d4f12b78773e2 | [
"MIT"
] | null | null | null | kubragen2/tests/test_options.py | RangelReale/kubragen2 | 2118f1429a9b9da937582db1f41d4f12b78773e2 | [
"MIT"
] | null | null | null | import copy
import unittest
from kubragen2.options import Options, OptionValue, OptionsBuildData
class TestUtil(unittest.TestCase):
def test_option_merge(self):
options = Options({
'x': {
'y': OptionValue('x.z'),
'z': 14,
}
}, {
... | 24.566667 | 72 | 0.466757 | import copy
import unittest
from kubragen2.options import Options, OptionValue, OptionsBuildData
class TestUtil(unittest.TestCase):
def test_option_merge(self):
options = Options({
'x': {
'y': OptionValue('x.z'),
'z': 14,
}
}, {
... | true | true |
1c352a37c5aeb60e9672cf6ce32cb450212169fe | 501 | py | Python | example/NaCl/NaCl-yaml.py | ladyteam/phonopy | 455ef61dfa15c01fb6b516461b52f15aefbf92b3 | [
"BSD-3-Clause"
] | 127 | 2015-01-21T17:50:58.000Z | 2020-02-04T13:46:13.000Z | example/NaCl/NaCl-yaml.py | ladyteam/phonopy | 455ef61dfa15c01fb6b516461b52f15aefbf92b3 | [
"BSD-3-Clause"
] | 100 | 2015-02-07T15:32:50.000Z | 2020-02-23T02:09:08.000Z | example/NaCl/NaCl-yaml.py | ladyteam/phonopy | 455ef61dfa15c01fb6b516461b52f15aefbf92b3 | [
"BSD-3-Clause"
] | 122 | 2015-02-07T15:39:28.000Z | 2020-02-10T22:33:16.000Z | """Example to obtain PhonopyYaml instance."""
import phonopy
from phonopy.interface.phonopy_yaml import PhonopyYaml
phonon = phonopy.load(
supercell_matrix=[[2, 0, 0], [0, 2, 0], [0, 0, 2]],
primitive_matrix=[[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]],
unitcell_filename="POSCAR-unitcell",
force_sets_... | 33.4 | 78 | 0.700599 | import phonopy
from phonopy.interface.phonopy_yaml import PhonopyYaml
phonon = phonopy.load(
supercell_matrix=[[2, 0, 0], [0, 2, 0], [0, 0, 2]],
primitive_matrix=[[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]],
unitcell_filename="POSCAR-unitcell",
force_sets_filename="FORCE_SETS",
born_filename="BORN... | true | true |
1c352afc280d330d2ed09810169d30a1a948c30d | 19,808 | py | Python | infra/bots/recipe_modules/flavor/gn_android_flavor.py | despairblue/esy-skia | 1c81aac298602f8e872c1079db92868199b6394f | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | infra/bots/recipe_modules/flavor/gn_android_flavor.py | despairblue/esy-skia | 1c81aac298602f8e872c1079db92868199b6394f | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | infra/bots/recipe_modules/flavor/gn_android_flavor.py | despairblue/esy-skia | 1c81aac298602f8e872c1079db92868199b6394f | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import recipe_api
import default_flavor
import re
import subprocess
"""GN Android flavor utils, used for building Skia for Android with... | 36.613678 | 82 | 0.632977 |
from recipe_engine import recipe_api
import default_flavor
import re
import subprocess
class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
def __init__(self, m):
super(GNAndroidFlavorUtils, self).__init__(m)
self._ever_ran_adb = False
self.ADB_BINARY = '/usr/bin/adb.1.0.35'
self.ADB_PUB... | true | true |
1c352b0a9797bacca4a2027a8e3d37c33bdafbd4 | 204 | py | Python | dicodile/data/tests/test_gait.py | hndgzkn/dicodile | 799f3fe244609d4699109a42956bf1ab97778e6c | [
"BSD-3-Clause"
] | 15 | 2019-02-04T19:55:41.000Z | 2021-12-28T14:27:42.000Z | dicodile/data/tests/test_gait.py | hndgzkn/dicodile | 799f3fe244609d4699109a42956bf1ab97778e6c | [
"BSD-3-Clause"
] | 47 | 2021-01-12T09:41:15.000Z | 2022-03-10T10:33:48.000Z | dicodile/data/tests/test_gait.py | hndgzkn/dicodile | 799f3fe244609d4699109a42956bf1ab97778e6c | [
"BSD-3-Clause"
] | 7 | 2019-05-06T15:21:55.000Z | 2021-04-22T09:53:45.000Z | from dicodile.data.gait import get_gait_data
def test_get_gait():
trial = get_gait_data()
assert trial['Subject'] == 1
assert trial['Trial'] == 1
assert len(trial['data'].columns) == 16
| 22.666667 | 44 | 0.666667 | from dicodile.data.gait import get_gait_data
def test_get_gait():
trial = get_gait_data()
assert trial['Subject'] == 1
assert trial['Trial'] == 1
assert len(trial['data'].columns) == 16
| true | true |
1c352b4e88322157cacafc5f554a325bea421e51 | 1,155 | py | Python | clients/client/python/test/test_submit_self_service_login_flow_with_lookup_secret_method_body.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_submit_self_service_login_flow_with_lookup_secret_method_body.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_submit_self_service_login_flow_with_lookup_secret_method_body.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.18
Contact: support@ory.sh
Generated by: htt... | 31.216216 | 194 | 0.769697 |
import sys
import unittest
import ory_client
from ory_client.model.submit_self_service_login_flow_with_lookup_secret_method_body import SubmitSelfServiceLoginFlowWithLookupSecretMethodBody
class TestSubmitSelfServiceLoginFlowWithLookupSecretMethodBody(unittest.TestCase):
def setUp(self):
pass
def... | true | true |
1c352be446d9cc123b14ae4b032878c1de524b88 | 3,665 | py | Python | pycaret/tests/test_time_series_tune_base.py | AJarman/pycaret | e96fefbf95c9e0195ec07ea63ebe25a8ce98baf3 | [
"MIT"
] | null | null | null | pycaret/tests/test_time_series_tune_base.py | AJarman/pycaret | e96fefbf95c9e0195ec07ea63ebe25a8ce98baf3 | [
"MIT"
] | null | null | null | pycaret/tests/test_time_series_tune_base.py | AJarman/pycaret | e96fefbf95c9e0195ec07ea63ebe25a8ce98baf3 | [
"MIT"
] | null | null | null | """Module to test time_series "tune_model" BASE functionality
"""
import pytest
import numpy as np
import pandas as pd
from pycaret.internal.pycaret_experiment import TimeSeriesExperiment
from .time_series_test_utils import _ALL_METRICS
##########################
#### Tests Start Here ####
########################... | 27.350746 | 102 | 0.655389 |
import pytest
import numpy as np
import pandas as pd
from pycaret.internal.pycaret_experiment import TimeSeriesExperiment
from .time_series_test_utils import _ALL_METRICS
def test_tune_custom_grid_and_choose_better(load_pos_and_neg_data):
exp = TimeSeriesExperiment()
fh = np.arange(1, 13)
fold = 2
... | true | true |
1c352bf374538b5e35d40deb826562eb2decc543 | 2,226 | py | Python | handlers/handlers.py | waleko/libreta | 323d20c52d676a36f47df70f0909eb2bbb7ab753 | [
"Apache-2.0"
] | null | null | null | handlers/handlers.py | waleko/libreta | 323d20c52d676a36f47df70f0909eb2bbb7ab753 | [
"Apache-2.0"
] | null | null | null | handlers/handlers.py | waleko/libreta | 323d20c52d676a36f47df70f0909eb2bbb7ab753 | [
"Apache-2.0"
] | null | null | null | from typing import List
from telegram import Update
from telegram.ext import Handler, CallbackContext, ConversationHandler
from strings import Strings
from utils.dao import Dao
handlers: List[Handler] = []
def register_unprotected_handler(handler: Handler):
"""
Adds given handler to `Bot`
"""
handl... | 30.493151 | 76 | 0.651842 | from typing import List
from telegram import Update
from telegram.ext import Handler, CallbackContext, ConversationHandler
from strings import Strings
from utils.dao import Dao
handlers: List[Handler] = []
def register_unprotected_handler(handler: Handler):
handlers.append(handler)
def add_authguard_to_handl... | true | true |
1c352bfb1e5e73fc26b875533846ebf2be26997b | 43 | py | Python | pipex/storages/h5storage/__init__.py | Algy/pipex | 02b958f67b32cad4a492d098a2ed73f971c6ac5f | [
"MIT"
] | 3 | 2018-12-24T03:48:40.000Z | 2018-12-24T04:07:36.000Z | pipex/storages/h5storage/__init__.py | Algy/pipex | 02b958f67b32cad4a492d098a2ed73f971c6ac5f | [
"MIT"
] | 2 | 2021-03-18T21:56:12.000Z | 2021-09-08T00:47:14.000Z | pipex/storages/h5storage/__init__.py | Algy/pipex | 02b958f67b32cad4a492d098a2ed73f971c6ac5f | [
"MIT"
] | null | null | null | from .h5storage import H5Storage, H5Bucket
| 21.5 | 42 | 0.837209 | from .h5storage import H5Storage, H5Bucket
| true | true |
1c352c2f63bd95f0122ababeaffcc414d0aab268 | 271 | py | Python | tests/test_signals.py | marazmiki/django-disguise | 35ee8f883d198292911a3e996d7920ab4faa3db8 | [
"MIT"
] | 1 | 2015-04-04T22:14:53.000Z | 2015-04-04T22:14:53.000Z | tests/test_signals.py | marazmiki/django-disguise | 35ee8f883d198292911a3e996d7920ab4faa3db8 | [
"MIT"
] | 2 | 2019-10-03T04:54:52.000Z | 2020-02-11T23:57:02.000Z | tests/test_signals.py | marazmiki/django-disguise | 35ee8f883d198292911a3e996d7920ab4faa3db8 | [
"MIT"
] | 1 | 2018-03-05T17:41:48.000Z | 2018-03-05T17:41:48.000Z | from django.contrib.auth.models import Permission
from django.db.models.signals import post_save
def test_permission():
qs = Permission.objects.filter(codename='can_disguise')
assert not qs.exists()
post_save.send(sender=Permission)
assert qs.exists()
| 24.636364 | 59 | 0.760148 | from django.contrib.auth.models import Permission
from django.db.models.signals import post_save
def test_permission():
qs = Permission.objects.filter(codename='can_disguise')
assert not qs.exists()
post_save.send(sender=Permission)
assert qs.exists()
| true | true |
1c352e16362790d4730bcd25c38138a601edc85d | 1,192 | py | Python | tests/utils/path.py | lise1020/pybinding | 921d5c2ac0ecc0ef317ba28b0bf68899ea30709a | [
"BSD-2-Clause"
] | 159 | 2016-01-20T17:40:48.000Z | 2022-03-24T06:08:55.000Z | tests/utils/path.py | deilynazar/pybinding | ec1128aaa84a1b43a74fb970479ce4544bd63179 | [
"BSD-2-Clause"
] | 36 | 2016-11-01T17:15:12.000Z | 2022-03-08T14:31:51.000Z | tests/utils/path.py | deilynazar/pybinding | ec1128aaa84a1b43a74fb970479ce4544bd63179 | [
"BSD-2-Clause"
] | 57 | 2016-04-23T22:12:01.000Z | 2022-03-08T12:33:04.000Z | import pathlib
def path_from_fixture(request, prefix, variant='', ext='', override_group=''):
"""Use a fixture's `request` argument to create a unique file path
The final return path will look like:
prefix/module_name/test_name[fixture_param]variant.ext
Parameters
----------
request
... | 32.216216 | 89 | 0.646812 | import pathlib
def path_from_fixture(request, prefix, variant='', ext='', override_group=''):
test_dir = pathlib.Path(str(request.fspath.join('..')))
module_name = request.module.__name__.split('.')[-1].replace('test_', '')
name = request.node.name.replace('test_', '') + variant
if override_group:
... | true | true |
1c35309bac56e128d6e052406d3a7d5cd066fd49 | 302 | py | Python | util/arrays.py | cassianobecker/dnn | bb2ea04f77733de9df10f795bb049ac3b9d30478 | [
"MIT"
] | 3 | 2020-02-21T21:35:07.000Z | 2020-09-29T15:20:00.000Z | util/arrays.py | cassianobecker/dnn | bb2ea04f77733de9df10f795bb049ac3b9d30478 | [
"MIT"
] | 27 | 2020-02-20T21:00:23.000Z | 2020-05-22T15:23:25.000Z | util/arrays.py | cassianobecker/dnn | bb2ea04f77733de9df10f795bb049ac3b9d30478 | [
"MIT"
] | null | null | null | def slice_from_list_of_pairs(pair_list, null_offset=None):
slice_list = []
if null_offset is not None:
for _ in range(null_offset):
slice_list.append(slice(None))
for pair in pair_list:
slice_list.append(slice(pair[0], pair[1]))
return tuple(slice_list)
| 23.230769 | 58 | 0.662252 | def slice_from_list_of_pairs(pair_list, null_offset=None):
slice_list = []
if null_offset is not None:
for _ in range(null_offset):
slice_list.append(slice(None))
for pair in pair_list:
slice_list.append(slice(pair[0], pair[1]))
return tuple(slice_list)
| true | true |
1c35321a8dd538f3952867cc9a3e9b9162013ea8 | 1,043 | py | Python | machine-learning-az/Part 1 - Data Preprocessing/Section 2 -------------------- Part 1 - Data Preprocessing --------------------/categorical_data.py | tapiwam/dataSciProjects | 55d6fb348bc63acacfa0510ffd9787ecf49e0495 | [
"MIT"
] | null | null | null | machine-learning-az/Part 1 - Data Preprocessing/Section 2 -------------------- Part 1 - Data Preprocessing --------------------/categorical_data.py | tapiwam/dataSciProjects | 55d6fb348bc63acacfa0510ffd9787ecf49e0495 | [
"MIT"
] | null | null | null | machine-learning-az/Part 1 - Data Preprocessing/Section 2 -------------------- Part 1 - Data Preprocessing --------------------/categorical_data.py | tapiwam/dataSciProjects | 55d6fb348bc63acacfa0510ffd9787ecf49e0495 | [
"MIT"
] | null | null | null | # Data Preprocessing
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Taking care of missing data
from sklearn.preprocessing import Imputer
imputer... | 29.8 | 84 | 0.746884 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis = 0)
imputer = imputer.fit(X[:, 1:3])
X[:,... | true | true |
1c35323ca460d4043b0045be8eb077516d2d70f2 | 1,658 | py | Python | src/config.py | shuu-tatsu/qagan | 15c76655cfecba4f6073940728d930b58a305eec | [
"MIT"
] | null | null | null | src/config.py | shuu-tatsu/qagan | 15c76655cfecba4f6073940728d930b58a305eec | [
"MIT"
] | 1 | 2019-04-02T06:13:33.000Z | 2019-04-02T06:13:33.000Z | src/config.py | shuu-tatsu/qagan | 15c76655cfecba4f6073940728d930b58a305eec | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import torch
parser = argparse.ArgumentParser()
# GPU
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# File
target_dir = '../data/'
train_file = target_dir + '/msmarco/train_v2.1.json'
dev_file = target_dir + '/msmarco/dev_v2.1.j... | 37.681818 | 88 | 0.749095 |
import argparse
import torch
parser = argparse.ArgumentParser()
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
target_dir = '../data/'
train_file = target_dir + '/msmarco/train_v2.1.json'
dev_file = target_dir + '/msmarco/dev_v2.1.json'
eval_file = target_dir + '/msmarco/eval_v2.1_public.jso... | true | true |
1c35325f170029556775761a4723544e43364755 | 18,617 | py | Python | analyzer/libs/pygments/pygments/lexers/html.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 23 | 2016-01-06T07:01:46.000Z | 2022-02-12T15:53:20.000Z | analyzer/libs/pygments/pygments/lexers/html.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 1 | 2019-04-02T00:42:29.000Z | 2019-04-02T00:42:29.000Z | analyzer/libs/pygments/pygments/lexers/html.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 16 | 2016-01-06T07:01:46.000Z | 2021-11-29T11:43:16.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.html
~~~~~~~~~~~~~~~~~~~~
Lexers for HTML, XML and related markup.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, inclu... | 31.554237 | 83 | 0.41258 |
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
default, using
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Punctuation
from pygments.util import looks_like_xml, html_doctype_matches
from pygments.lexers.javascript import JavascriptLex... | true | true |
1c3532f6e51f3e4e021302188e96be49eb686017 | 4,642 | py | Python | sdk/python/pulumi_aws/dynamodb/global_table.py | Dominik-K/pulumi-aws | efb5e2a48a86baba58e373ade5863c0f45389c29 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/dynamodb/global_table.py | Dominik-K/pulumi-aws | efb5e2a48a86baba58e373ade5863c0f45389c29 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/dynamodb/global_table.py | Dominik-K/pulumi-aws | efb5e2a48a86baba58e373ade5863c0f45389c29 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Global... | 45.067961 | 291 | 0.673847 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GlobalTable(pulumi.CustomResource):
arn: pulumi.Output[str]
name: pulumi.Output[str]
replicas: pulumi.Output[list]
def __init__(__self__, resource_name, opts=None, name=None,... | true | true |
1c3533381d19c145ed61b41772342c7e6675c738 | 5,199 | py | Python | tensorflow_datasets/image_classification/oxford_iiit_pet.py | daniel-trejobanos/tf-ds-321 | e3f5b1771a176dc552c3a99f51f3a5ffbe105852 | [
"Apache-2.0"
] | 2 | 2020-10-12T07:09:38.000Z | 2021-03-05T12:48:23.000Z | tensorflow_datasets/image_classification/oxford_iiit_pet.py | javierespinozat/datasets | 1465d97b2e8b2a030f5df7872e8390b90dba8926 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image_classification/oxford_iiit_pet.py | javierespinozat/datasets | 1465d97b2e8b2a030f5df7872e8390b90dba8926 | [
"Apache-2.0"
] | 1 | 2021-06-30T17:45:23.000Z | 2021-06-30T17:45:23.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 36.356643 | 86 | 0.655703 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow.compat.v2 as tf
import tensorflow_datasets.public_api as tfds
_DESCRIPTION = """\
The Oxford-IIIT pet dataset is a 37 category pet image dataset with roughly 200
images for eac... | true | true |
1c3533c7e05e40ac6b283f54f736a327f5fdab87 | 154 | py | Python | Leetcode/0914. X of a Kind in a Deck of Cards/0914.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0914. X of a Kind in a Deck of Cards/0914.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0914. X of a Kind in a Deck of Cards/0914.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | class Solution:
def hasGroupsSizeX(self, deck: List[int]) -> bool:
count = Counter(deck)
return functools.reduce(math.gcd, count.values()) >= 2
| 30.8 | 58 | 0.681818 | class Solution:
def hasGroupsSizeX(self, deck: List[int]) -> bool:
count = Counter(deck)
return functools.reduce(math.gcd, count.values()) >= 2
| true | true |
1c353430554f30c2e65b41c56de5fa9c108a644d | 853 | py | Python | selfservice-api/src/selfservice_api/services/external/models/__init__.py | bcgov/BCSC-BPS | 3bfe09c100a0f5b98d61228324336d5f45ad93ad | [
"Apache-2.0"
] | 2 | 2020-07-03T18:18:34.000Z | 2021-03-08T10:25:50.000Z | selfservice-api/src/selfservice_api/services/external/models/__init__.py | bcgov/BCSC-BPS | 3bfe09c100a0f5b98d61228324336d5f45ad93ad | [
"Apache-2.0"
] | 312 | 2020-01-10T23:00:08.000Z | 2022-03-29T22:07:00.000Z | selfservice-api/src/selfservice_api/services/external/models/__init__.py | bcgov/BCSC-BPS | 3bfe09c100a0f5b98d61228324336d5f45ad93ad | [
"Apache-2.0"
] | 2 | 2020-03-26T05:10:20.000Z | 2021-02-05T19:22:56.000Z | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 44.894737 | 74 | 0.793669 |
from .dynamic_client_create import CreateRequestModel, CreateResponseModel
from .dynamic_client_get import GetResponseModel
from .dynamic_client_update import UpdateRequestModel, UpdateResponseModel
| true | true |
1c3534e51791e7e9bbfa8e8618d8af7c902e6529 | 6,211 | py | Python | billy/tests/importers/test_utils.py | backwardn/billy | 07ac788d25a6c79d03dd0e3d55459bbb55e22439 | [
"BSD-3-Clause"
] | 33 | 2016-11-05T07:25:48.000Z | 2022-01-31T03:40:43.000Z | billy/tests/importers/test_utils.py | backwardn/billy | 07ac788d25a6c79d03dd0e3d55459bbb55e22439 | [
"BSD-3-Clause"
] | 16 | 2015-02-05T21:25:58.000Z | 2015-09-18T20:27:06.000Z | billy/tests/importers/test_utils.py | backwardn/billy | 07ac788d25a6c79d03dd0e3d55459bbb55e22439 | [
"BSD-3-Clause"
] | 22 | 2015-03-23T07:13:20.000Z | 2016-06-10T04:41:06.000Z | import re
import time
import datetime
from nose.tools import with_setup, assert_raises
from billy.core import db
from billy.importers import utils
def drop_everything():
db.metadata.drop()
db.legislators.drop()
db.bills.drop()
db.committees.drop()
def test_insert_with_id_duplicate_id():
obj = ... | 33.037234 | 79 | 0.603445 | import re
import time
import datetime
from nose.tools import with_setup, assert_raises
from billy.core import db
from billy.importers import utils
def drop_everything():
db.metadata.drop()
db.legislators.drop()
db.bills.drop()
db.committees.drop()
def test_insert_with_id_duplicate_id():
obj = ... | true | true |
1c353523dd72bb26442371df58b0ebb088eb80cd | 2,756 | py | Python | core/function.py | mc-nya/FedNest | 35405f4f9943488331eaada87bc9caf109ee6124 | [
"MIT"
] | null | null | null | core/function.py | mc-nya/FedNest | 35405f4f9943488331eaada87bc9caf109ee6124 | [
"MIT"
] | null | null | null | core/function.py | mc-nya/FedNest | 35405f4f9943488331eaada87bc9caf109ee6124 | [
"MIT"
] | 2 | 2022-02-23T10:46:28.000Z | 2022-02-24T16:19:50.000Z | from numpy import dtype
import torch.nn.functional as F
import torch
from torch.autograd import grad
def gather_flat_grad(loss_grad):
# convert the gradient output from list of tensors to to flat vector
return torch.cat([p.contiguous().view(-1) for p in loss_grad if not p is None])
def neumann_hyperstep_pr... | 37.243243 | 116 | 0.646589 | from numpy import dtype
import torch.nn.functional as F
import torch
from torch.autograd import grad
def gather_flat_grad(loss_grad):
return torch.cat([p.contiguous().view(-1) for p in loss_grad if not p is None])
def neumann_hyperstep_preconditioner(d_val_loss_d_theta, d_train_loss_d_w, elementary_lr, num_... | true | true |
1c35359516695468349b188bdbe2a5db70c4134c | 670 | py | Python | ProductService/manage.py | surajkendhey/Kart | 458bee955d1569372fc8b3facb2602063a6ec6f5 | [
"Apache-2.0"
] | null | null | null | ProductService/manage.py | surajkendhey/Kart | 458bee955d1569372fc8b3facb2602063a6ec6f5 | [
"Apache-2.0"
] | null | null | null | ProductService/manage.py | surajkendhey/Kart | 458bee955d1569372fc8b3facb2602063a6ec6f5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ProductService.settings')
try:
from django.core.management import execute_from_command_line
exce... | 29.130435 | 78 | 0.68209 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ProductService.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "... | true | true |
1c35364d7dc975462b487db0da5126d34f19d939 | 4,028 | py | Python | lib/surface/dataplex/lakes/create.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/dataplex/lakes/create.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/dataplex/lakes/create.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2021 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 39.490196 | 86 | 0.706554 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.dataplex import lake
from googlecloudsdk.api_lib.dataplex import util as dataplex_util
from googlecloudsdk.api_lib.util import exceptions as gcloud_exception
from googlecloudsdk.c... | true | true |
1c353653b40c7bfbb9044c05746afb39df3ff25f | 4,222 | py | Python | my_dlib/tsdlib.py | kiddkyd1412/find_av_by_face | e6071b9edbfb6a6ae1c833b13988b6262cc9aa55 | [
"Apache-2.0"
] | 4 | 2019-06-03T03:03:40.000Z | 2022-03-29T11:36:31.000Z | my_dlib/tsdlib.py | kiddkyd1412/find_av_by_face | e6071b9edbfb6a6ae1c833b13988b6262cc9aa55 | [
"Apache-2.0"
] | null | null | null | my_dlib/tsdlib.py | kiddkyd1412/find_av_by_face | e6071b9edbfb6a6ae1c833b13988b6262cc9aa55 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import json
import sys
import time
import warnings
from concurrent.futures import ThreadPoolExecutor, wait, as_completed
from operator import itemgetter
import dlib
import cv2
import os
import glob
import numpy as np
from iface import IFace
class FaceDlib(IFace):
def __ini... | 35.183333 | 120 | 0.623638 | import base64
import json
import sys
import time
import warnings
from concurrent.futures import ThreadPoolExecutor, wait, as_completed
from operator import itemgetter
import dlib
import cv2
import os
import glob
import numpy as np
from iface import IFace
class FaceDlib(IFace):
def __init__(self):
super... | true | true |
1c3536c1300674f74f83f7fe74d13104432a24e3 | 287 | py | Python | third_party_logistics/third_party_logistics/doctype/third_party_logistics_settings/third_party_logistics_settings.py | hafeesk/third_party_logistics | 6b97c5ad1bbb8386ca93e480bcb55ed3bc784ac4 | [
"MIT"
] | 1 | 2021-09-10T03:47:53.000Z | 2021-09-10T03:47:53.000Z | third_party_logistics/third_party_logistics/doctype/third_party_logistics_settings/third_party_logistics_settings.py | hafeesk/third_party_logistics | 6b97c5ad1bbb8386ca93e480bcb55ed3bc784ac4 | [
"MIT"
] | null | null | null | third_party_logistics/third_party_logistics/doctype/third_party_logistics_settings/third_party_logistics_settings.py | hafeesk/third_party_logistics | 6b97c5ad1bbb8386ca93e480bcb55ed3bc784ac4 | [
"MIT"
] | 1 | 2022-02-05T10:16:53.000Z | 2022-02-05T10:16:53.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, GreyCube Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class ThirdPartyLogisticsSettings(Document):
pass
| 26.090909 | 60 | 0.794425 |
from __future__ import unicode_literals
from frappe.model.document import Document
class ThirdPartyLogisticsSettings(Document):
pass
| true | true |
1c3536cd3198ab9694baf695fe2ae02d8f0eb8d2 | 5,751 | py | Python | Lista2.py | EnzoItaliano/calculoNumericoEmPython | be3161b823955620be71e0f94a3421288fd28ef0 | [
"MIT"
] | 1 | 2019-12-28T21:23:00.000Z | 2019-12-28T21:23:00.000Z | Lista2.py | EnzoItaliano/calculoNumericoEmPython | be3161b823955620be71e0f94a3421288fd28ef0 | [
"MIT"
] | null | null | null | Lista2.py | EnzoItaliano/calculoNumericoEmPython | be3161b823955620be71e0f94a3421288fd28ef0 | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
from prettytable import PrettyTable
from sympy import *
import numpy as np
x = symbols('x')
#Raízes de Equações
##Método da Bissecção
def plot2d(f, inicio, fim):
z = np.arange(inicio,fim,0.1)
y = []
for i in range(len(z)):
y.append(f.subs(x,z[i]))
... | 25.56 | 110 | 0.475569 | import math
import matplotlib.pyplot as plt
from prettytable import PrettyTable
from sympy import *
import numpy as np
x = symbols('x')
def plot2d(f, inicio, fim):
z = np.arange(inicio,fim,0.1)
y = []
for i in range(len(z)):
y.append(f.subs(x,z[i]))
fig, ax = plt.subplots()
ax.set(... | true | true |
1c35398eb40634581f7229ddd5711a7b1ff8f982 | 442 | py | Python | mainapp/migrations/0046_rescuecamp_total_people.py | reyasmohammed/rescuekerala | 68ee6cd4ea7b94e04fd32c4d488bcd7a8f2d371c | [
"MIT"
] | 1 | 2021-12-09T17:59:01.000Z | 2021-12-09T17:59:01.000Z | mainapp/migrations/0046_rescuecamp_total_people.py | reyasmohammed/rescuekerala | 68ee6cd4ea7b94e04fd32c4d488bcd7a8f2d371c | [
"MIT"
] | 1 | 2018-08-28T13:26:26.000Z | 2018-08-28T13:26:26.000Z | mainapp/migrations/0046_rescuecamp_total_people.py | reyasmohammed/rescuekerala | 68ee6cd4ea7b94e04fd32c4d488bcd7a8f2d371c | [
"MIT"
] | 5 | 2019-11-07T11:34:56.000Z | 2019-11-07T11:36:00.000Z | # Generated by Django 2.1 on 2018-08-18 13:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0045_auto_20180818_1827'),
]
operations = [
migrations.AddField(
model_name='rescuecamp',
name='total_peopl... | 23.263158 | 100 | 0.626697 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0045_auto_20180818_1827'),
]
operations = [
migrations.AddField(
model_name='rescuecamp',
name='total_people',
field=models.IntegerField(blan... | true | true |
1c353a370d3284471c6a5674ae1c783f7f93b99a | 506 | py | Python | pylearn2/compat.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 2,045 | 2015-01-01T14:07:52.000Z | 2022-03-08T08:56:41.000Z | pylearn2/compat.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 305 | 2015-01-02T13:18:24.000Z | 2021-08-20T18:03:28.000Z | pylearn2/compat.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 976 | 2015-01-01T17:08:51.000Z | 2022-03-25T19:53:17.000Z | """
Compatibility layer
"""
from theano.compat import six
__all__ = ('OrderedDict', )
if six.PY3:
from collections import OrderedDict
else:
from theano.compat import OrderedDict
def first_key(obj):
""" Return the first key
Parameters
----------
obj: dict-like object
"""
return six... | 14.882353 | 41 | 0.624506 | from theano.compat import six
__all__ = ('OrderedDict', )
if six.PY3:
from collections import OrderedDict
else:
from theano.compat import OrderedDict
def first_key(obj):
return six.next(six.iterkeys(obj))
def first_value(obj):
return six.next(six.itervalues(obj))
| true | true |
1c353af5f765e844e7a94e9172e7f1021fcced24 | 7,706 | py | Python | Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py | jbathmann/ogs | a79e95d7521a841ffebd441a6100562847e03ab5 | [
"BSD-4-Clause"
] | null | null | null | Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py | jbathmann/ogs | a79e95d7521a841ffebd441a6100562847e03ab5 | [
"BSD-4-Clause"
] | 1 | 2021-09-02T14:21:33.000Z | 2021-09-02T14:21:33.000Z | Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py | jbathmann/ogs | a79e95d7521a841ffebd441a6100562847e03ab5 | [
"BSD-4-Clause"
] | null | null | null | ###
# Copyright(c) 2012 - 2019, OpenGeoSys Community(http://www.opengeosys.org)
# Distributed under a Modified BSD License.
# See accompanying file LICENSE.txt or
# http://www.opengeosys.org/project/license
###
import sys
print(sys.version)
import os
import numpy as np
from pandas import read_csv
import OpenGeoSys
fro... | 34.711712 | 79 | 0.600831 |
import sys
print(sys.version)
import os
import numpy as np
from pandas import read_csv
import OpenGeoSys
from tespy import cmp, con, nwk, hlp, cmp_char
from tespy import nwkr
refrig_density = 992.92 switch_dyn_demand = 'on'
switch_dyn_frate = 'off'
def timerange(t):
timerange_nw_off_month = [-9999] nw... | true | true |
1c353b4617bac86fc2666653def4885a80fa9857 | 3,115 | py | Python | django_optimizer/conf.py | robertxsuchocki/django-optimizer | 032a860285faaaab419ce06c5f015f32f85adb56 | [
"MIT"
] | null | null | null | django_optimizer/conf.py | robertxsuchocki/django-optimizer | 032a860285faaaab419ce06c5f015f32f85adb56 | [
"MIT"
] | null | null | null | django_optimizer/conf.py | robertxsuchocki/django-optimizer | 032a860285faaaab419ce06c5f015f32f85adb56 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Conf module containing app settings
"""
import os
import django
class DjangoOptimizerSettings(object):
"""
Container for settings exclusive for an app, with possibility to replace any in project settings
"""
def __getattribute__(self, item):
try:
return... | 39.935897 | 119 | 0.739647 | import os
import django
class DjangoOptimizerSettings(object):
def __getattribute__(self, item):
try:
return getattr(django.conf.settings, item)
except AttributeError:
return super(DjangoOptimizerSettings, self).__getattribute__(item)
DJANGO_OPTIMIZER_FIELD_REGISTRY =... | true | true |
1c353b5ae4cc11c3f8e4c3d0a077e474e7b0bf43 | 2,385 | py | Python | assets/fonts/font.py | MilianoJunior/app_relatorios_EngeSEP | 9efb77a2e93f418f061c88f988a2c87971183708 | [
"MIT"
] | null | null | null | assets/fonts/font.py | MilianoJunior/app_relatorios_EngeSEP | 9efb77a2e93f418f061c88f988a2c87971183708 | [
"MIT"
] | null | null | null | assets/fonts/font.py | MilianoJunior/app_relatorios_EngeSEP | 9efb77a2e93f418f061c88f988a2c87971183708 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from controllers.excpetions.RootException import InterfaceException
def font_choice(name_font):
try:
const = -3
if name_font == None:
name_font = 'Roboto'
fonts = {'H1': [f'{name_font}Light', 96 + const, False, -1.5],
... | 54.204545 | 83 | 0.491405 | import os
from controllers.excpetions.RootException import InterfaceException
def font_choice(name_font):
try:
const = -3
if name_font == None:
name_font = 'Roboto'
fonts = {'H1': [f'{name_font}Light', 96 + const, False, -1.5],
'H2': [f'{name_font}Light', 60 + c... | true | true |
1c353d1e9561f6b6ea401312a6a5f248bfe40514 | 4,229 | py | Python | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Util/Padding.py | e11it/hue-1 | 436704c40b5fa6ffd30bd972bf50ffeec738d091 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Util/Padding.py | e11it/hue-1 | 436704c40b5fa6ffd30bd972bf50ffeec738d091 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Util/Padding.py | e11it/hue-1 | 436704c40b5fa6ffd30bd972bf50ffeec738d091 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | #
# Util/Padding.py : Functions to manage padding
#
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the... | 39.523364 | 84 | 0.661386 |
__all__ = [ 'pad', 'unpad' ]
from Cryptodome.Util.py3compat import *
def pad(data_to_pad, block_size, style='pkcs7'):
padding_len = block_size-len(data_to_pad)%block_size
if style == 'pkcs7':
padding = bchr(padding_len)*padding_len
elif style == 'x923':
padding = bchr(0)*(padding_len-1)... | true | true |
1c353d331a3c9af7cf0ecc5d525a68b4c13af975 | 1,945 | py | Python | cornac/models/global_avg/recom_global_avg.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 597 | 2018-07-17T10:59:56.000Z | 2022-03-31T07:59:36.000Z | cornac/models/global_avg/recom_global_avg.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 137 | 2018-10-12T10:52:11.000Z | 2022-03-04T15:26:49.000Z | cornac/models/global_avg/recom_global_avg.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 112 | 2018-07-26T04:36:34.000Z | 2022-03-31T02:29:34.000Z | # Copyright 2018 The Cornac Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.122807 | 96 | 0.649357 |
import numpy as np
from ..recommender import Recommender
from ...exception import ScoreException
class GlobalAvg(Recommender):
def __init__(self, name="GlobalAvg"):
super().__init__(name=name, trainable=False)
def score(self, user_idx, item_idx=None):
if item_idx is None:
retur... | true | true |
1c353ed3b527f763ce3fa8788d6e55789d200524 | 712 | py | Python | rocknext/compliance/doctype/quality_feedback/quality_feedback.py | mohsinalimat/rocknext | ff04c00e9ea7d9089921f7b41447b83dc9d78501 | [
"MIT"
] | 8 | 2021-09-26T08:22:57.000Z | 2021-11-30T09:35:55.000Z | rocknext/compliance/doctype/quality_feedback/quality_feedback.py | yrestom/rocknext | 551b2443a3eafade07f7e254f14e336d0f54bd70 | [
"MIT"
] | null | null | null | rocknext/compliance/doctype/quality_feedback/quality_feedback.py | yrestom/rocknext | 551b2443a3eafade07f7e254f14e336d0f54bd70 | [
"MIT"
] | 9 | 2021-09-26T08:23:05.000Z | 2022-01-15T15:12:27.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ComplianceFeedback(Document):
@frappe.whitelist()
def set_parameters... | 27.384615 | 85 | 0.734551 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ComplianceFeedback(Document):
@frappe.whitelist()
def set_parameters(self):
if self.template and not getattr(self, 'parameters', []):
for d in frappe.get_doc('Compliance Feedback Template', self.template).p... | true | true |
1c353f11b22a3afa0036fa7d5f43c1dd1bc8a9df | 7,451 | py | Python | model/vgg19/model19_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | 3 | 2018-05-06T15:15:21.000Z | 2018-05-13T12:31:42.000Z | model/vgg19/model19_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | model/vgg19/model19_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | """
以model 4为基础,新增real crop
"""
import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfig(k_fold_file="1... | 51.034247 | 125 | 0.504899 | import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfig(k_fold_file="1.txt",
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.