hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b11deac5da9eefb744eefe58f9e242d6b3092af3 | 1,228 | py | Python | xmitgcm/test/test_file_utils.py | fraserwg/xmitgcm | 177a7e62630a1552f5402ab51ba28dbcf802b5dd | [
"MIT"
] | 28 | 2016-10-17T07:23:39.000Z | 2019-08-29T06:38:50.000Z | xmitgcm/test/test_file_utils.py | fraserwg/xmitgcm | 177a7e62630a1552f5402ab51ba28dbcf802b5dd | [
"MIT"
] | 160 | 2016-10-12T03:04:23.000Z | 2019-09-23T22:28:21.000Z | xmitgcm/test/test_file_utils.py | fraserwg/xmitgcm | 177a7e62630a1552f5402ab51ba28dbcf802b5dd | [
"MIT"
] | 53 | 2016-10-12T01:27:07.000Z | 2019-08-06T18:35:39.000Z | import pytest
from xmitgcm import file_utils
@pytest.fixture(scope="session")
def directory_with_files(tmpdir_factory):
temppath = tmpdir_factory.mktemp("xmitgcm_test_data")
temppath.join('bar.0000000001.meta').ensure(file=True)
temppath.join('baz.data').ensure(file=True)
return temppath
def test_lis... | 36.117647 | 96 | 0.753257 |
f07376c24b718a99fc05884460a46e8c64477121 | 3,836 | py | Python | huaweicloud-sdk-lts/huaweicloudsdklts/v2/model/update_log_group_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-lts/huaweicloudsdklts/v2/model/update_log_group_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-lts/huaweicloudsdklts/v2/model/update_log_group_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UpdateLogGroupRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The ... | 27.597122 | 104 | 0.574035 |
14c3d25400be2cdd7f67fc6b09caa02e6180cfa5 | 4,795 | py | Python | pycity_resilience/ga/parser/parse_city_to_ind.py | RWTH-EBC/pyCity_resilience | e0ff1e137adb0edec0509b8b50ca0931e761a9b4 | [
"MIT"
] | 3 | 2020-06-18T02:01:09.000Z | 2020-10-20T13:57:10.000Z | pycity_resilience/ga/parser/parse_city_to_ind.py | RWTH-EBC/pyCity_resilience | e0ff1e137adb0edec0509b8b50ca0931e761a9b4 | [
"MIT"
] | null | null | null | pycity_resilience/ga/parser/parse_city_to_ind.py | RWTH-EBC/pyCity_resilience | e0ff1e137adb0edec0509b8b50ca0931e761a9b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Parse city information to individuum of GA run
"""
from __future__ import division
import pycity_calc.toolbox.networks.network_ops as netop
import pycity_resilience.ga.verify.check_validity as checkval
def parse_city_to_ind_dict(city, list_build_ids=None,
... | 31.754967 | 78 | 0.594995 |
49640a36511038cfe83285c33da019bd628d3ae3 | 1,061 | py | Python | {{cookiecutter.project_slug}}/tests/locustfile.py | Steamboat/cookiecutter-devops | 6f07329c9e54b76e671a0308d343d2d9ebff5343 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/tests/locustfile.py | Steamboat/cookiecutter-devops | 6f07329c9e54b76e671a0308d343d2d9ebff5343 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/tests/locustfile.py | Steamboat/cookiecutter-devops | 6f07329c9e54b76e671a0308d343d2d9ebff5343 | [
"BSD-3-Clause"
] | null | null | null | """
Locust is used for load testing services with fake users.
We configure different behaviors for users and then flood the server with an increasing number of these
artificial users to look at the performance impact of different behaviors.
"""
import time
import random
from locust import HttpUser, task, between
fro... | 29.472222 | 103 | 0.705938 |
141d7378cc582163ff86a24b798297394d55b3f7 | 8,048 | py | Python | designate/tests/test_notification_handler/test_nova.py | cleosson-daitan/designate | 37b3fa2ea454183e4a5c6a099eca5129959d10e1 | [
"Apache-2.0"
] | 1 | 2022-02-18T11:19:35.000Z | 2022-02-18T11:19:35.000Z | designate/tests/test_notification_handler/test_nova.py | sapcc/designate | c3f084751006a2fe7562f137930542c4759d6fd9 | [
"Apache-2.0"
] | null | null | null | designate/tests/test_notification_handler/test_nova.py | sapcc/designate | c3f084751006a2fe7562f137930542c4759d6fd9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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/... | 41.271795 | 79 | 0.608598 |
127030d5bf2be4ba3616374738a20df04623e082 | 2,936 | py | Python | codebleu/graph_generator/typeparsing/inheritancerewrite.py | JetBrains-Research/metrics-evaluation | 6e3696d11b9efcc7b4403f94b84651caed247649 | [
"Apache-2.0"
] | 2 | 2020-07-14T17:00:28.000Z | 2020-08-13T10:19:52.000Z | codebleu/graph_generator/typeparsing/inheritancerewrite.py | JetBrains-Research/metrics-evaluation | 6e3696d11b9efcc7b4403f94b84651caed247649 | [
"Apache-2.0"
] | 3 | 2020-07-24T12:29:24.000Z | 2021-06-28T17:07:45.000Z | codebleu/graph_generator/typeparsing/inheritancerewrite.py | JetBrains-Research/metrics-evaluation | 6e3696d11b9efcc7b4403f94b84651caed247649 | [
"Apache-2.0"
] | null | null | null | from itertools import product
from typing import Callable, Iterator, Set
import random
from codebleu.graph_generator.typeparsing.nodes import TypeAnnotationNode, SubscriptAnnotationNode, TupleAnnotationNode, \
ListAnnotationNode, AttributeAnnotationNode, IndexAnnotationNode, ElipsisAnnotationNode
from codebl... | 40.219178 | 123 | 0.688692 |
823691ea75deef3597541b930e5ca63bb9944bb2 | 18,474 | py | Python | accel/cuda/ops_cuda.py | dandycheung/tinygrad | c8b569a8c74ffc1e3fd21cda2bca04749e7c500a | [
"MIT"
] | null | null | null | accel/cuda/ops_cuda.py | dandycheung/tinygrad | c8b569a8c74ffc1e3fd21cda2bca04749e7c500a | [
"MIT"
] | null | null | null | accel/cuda/ops_cuda.py | dandycheung/tinygrad | c8b569a8c74ffc1e3fd21cda2bca04749e7c500a | [
"MIT"
] | null | null | null | import numpy as np
from functools import lru_cache
from tinygrad.tensor import Function
from tinygrad.helpers import binary_broadcast
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
import pycuda.autoinit
dev = cuda.Context.get_device()
MAX_THREADS_BLOCK = dev.get_attribute(cuda.device_attribute... | 32.813499 | 135 | 0.598733 |
069daccf9b6e57b2c71a629321c344a5d9cc5a79 | 13,770 | py | Python | aries_cloudagent/core/tests/test_dispatcher.py | ldej/aries-cloudagent-python | 25b7a9c08921e67b0962c434102489884ac403b2 | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/core/tests/test_dispatcher.py | ldej/aries-cloudagent-python | 25b7a9c08921e67b0962c434102489884ac403b2 | [
"Apache-2.0"
] | 1 | 2020-03-06T12:11:29.000Z | 2020-03-06T12:11:29.000Z | aries_cloudagent/core/tests/test_dispatcher.py | ldej/aries-cloudagent-python | 25b7a9c08921e67b0962c434102489884ac403b2 | [
"Apache-2.0"
] | null | null | null | import asyncio
import json
from asynctest import TestCase as AsyncTestCase, mock as async_mock
from marshmallow import EXCLUDE
from ...config.injection_context import InjectionContext
from ...connections.models.connection_record import ConnectionRecord
from ...core.protocol_registry import ProtocolRegistry
from ...m... | 36.62234 | 86 | 0.627596 |
77eb95970e197bf9037c938536f534a47d58cec2 | 434 | py | Python | taggit/migrations/0004_taggeditem_add_unique_index.py | texastribune/django-taggit | 3b57f28b2c67886632a6737f39dfe0f08dca101e | [
"BSD-3-Clause"
] | null | null | null | taggit/migrations/0004_taggeditem_add_unique_index.py | texastribune/django-taggit | 3b57f28b2c67886632a6737f39dfe0f08dca101e | [
"BSD-3-Clause"
] | null | null | null | taggit/migrations/0004_taggeditem_add_unique_index.py | texastribune/django-taggit | 3b57f28b2c67886632a6737f39dfe0f08dca101e | [
"BSD-3-Clause"
] | 1 | 2018-03-15T22:52:09.000Z | 2018-03-15T22:52:09.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("taggit", "0003_rm_unique_tagname"),
]
operations = [
migrations.AlterUniq... | 22.842105 | 85 | 0.645161 |
0300d0c0835aec715e1a6d74d6c3b0b24378d7f7 | 2,291 | py | Python | dkron/migrations/0001_initial_20210729.py | surface-security/django-dkron | e85810cfebfc51ad6143befebf758b000662494e | [
"MIT"
] | 1 | 2022-01-24T10:29:14.000Z | 2022-01-24T10:29:14.000Z | dkron/migrations/0001_initial_20210729.py | surface-security/django-dkron | e85810cfebfc51ad6143befebf758b000662494e | [
"MIT"
] | 6 | 2022-01-17T16:50:38.000Z | 2022-03-23T17:46:33.000Z | dkron/migrations/0001_initial_20210729.py | surface-security/django-dkron | e85810cfebfc51ad6143befebf758b000662494e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-07-29 08:53
from django.db import migrations, models
def data_fix(apps, schema_editor):
apps.get_model("notifications", "Event").objects.update_or_create(name='dkron_failed_job')
class Migration(migrations.Migration):
initial = True
replaces = [
('dkron', '... | 37.557377 | 114 | 0.566565 |
d36282fa3954ceab125882e1f061b4281e15c49b | 3,844 | py | Python | venv/lib/python3.8/site-packages/pyqtgraph/SignalProxy.py | willBear/willBear-Fundamental_Analysis | bc67eb1e69dcf6765c0b77314d37f7f165a7318f | [
"MIT"
] | 150 | 2018-03-27T16:45:37.000Z | 2022-03-30T03:47:56.000Z | venv/lib/python3.8/site-packages/pyqtgraph/SignalProxy.py | willBear/willBear-Fundamental_Analysis | bc67eb1e69dcf6765c0b77314d37f7f165a7318f | [
"MIT"
] | 34 | 2018-09-28T00:01:59.000Z | 2022-03-21T15:40:02.000Z | venv/lib/python3.8/site-packages/pyqtgraph/SignalProxy.py | willBear/willBear-Fundamental_Analysis | bc67eb1e69dcf6765c0b77314d37f7f165a7318f | [
"MIT"
] | 40 | 2018-04-06T19:42:21.000Z | 2022-01-11T00:34:17.000Z | # -*- coding: utf-8 -*-
from .Qt import QtCore
from .ptime import time
from . import ThreadsafeTimer
import weakref
__all__ = ['SignalProxy']
class SignalProxy(QtCore.QObject):
"""Object which collects rapid-fire signals and condenses them
into a single signal or a rate-limited stream of signals.
Used, f... | 32.302521 | 92 | 0.593913 |
906195b9188fbe70fb6cd70ea3b28e5efe8c015e | 6,570 | py | Python | nobos_commons/feature_preparations/feature_vec_producers/from_skeleton_joints/potion/color_joint_heatmap_builder_full_img.py | noboevbo/nobos_commons | 471e52e10fd2228c106777c72d8439e58b047003 | [
"MIT"
] | 2 | 2020-06-03T16:28:44.000Z | 2020-10-10T03:07:23.000Z | nobos_commons/feature_preparations/feature_vec_producers/from_skeleton_joints/potion/color_joint_heatmap_builder_full_img.py | noboevbo/nobos_commons | 471e52e10fd2228c106777c72d8439e58b047003 | [
"MIT"
] | null | null | null | nobos_commons/feature_preparations/feature_vec_producers/from_skeleton_joints/potion/color_joint_heatmap_builder_full_img.py | noboevbo/nobos_commons | 471e52e10fd2228c106777c72d8439e58b047003 | [
"MIT"
] | 4 | 2020-10-10T03:07:25.000Z | 2021-09-30T01:11:02.000Z | from typing import List, Dict
import numpy as np
from nobos_commons.augmentations.joint_augmenter import JointAugmenter
from nobos_commons.data_structures.dimension import ImageSize
from nobos_commons.data_structures.human import Human
class JointColorHeatmapResult(object):
__slots__ = ['human_id', 'joint_color_... | 53.852459 | 138 | 0.62618 |
af56d9e1bd403187039f03a0491d80dfcd4c7497 | 7,276 | py | Python | model/models/saq.py | Xiatian-Zhu/FEAT | 48331e00dec8b1aa20f6cd7c397cef16f06ea2f6 | [
"MIT"
] | null | null | null | model/models/saq.py | Xiatian-Zhu/FEAT | 48331e00dec8b1aa20f6cd7c397cef16f06ea2f6 | [
"MIT"
] | null | null | null | model/models/saq.py | Xiatian-Zhu/FEAT | 48331e00dec8b1aa20f6cd7c397cef16f06ea2f6 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from model.models import FewShotModel
# No-Reg for FEAT-STAR here
class ScaledDotProductAttention(nn.Module):
''' Scaled Dot-Product Attention '''
def __init__(self, temperature, attn_dropout=0.1):
super().__init__... | 39.759563 | 114 | 0.584112 |
c314f9e21920c8aa41e3c64699cd92ed48a64a0f | 6,933 | py | Python | nni/tools/nnictl/tensorboard_utils.py | HarshCasper/nni | 291bbbba9f296382015a77b2c88eb5db5b44bf94 | [
"MIT"
] | 1 | 2022-03-03T06:04:34.000Z | 2022-03-03T06:04:34.000Z | nni/tools/nnictl/tensorboard_utils.py | HarshCasper/nni | 291bbbba9f296382015a77b2c88eb5db5b44bf94 | [
"MIT"
] | null | null | null | nni/tools/nnictl/tensorboard_utils.py | HarshCasper/nni | 291bbbba9f296382015a77b2c88eb5db5b44bf94 | [
"MIT"
] | 1 | 2020-11-15T20:10:26.000Z | 2020-11-15T20:10:26.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import json
import re
import tempfile
from subprocess import call, Popen
from .rest_utils import rest_get, check_rest_server_quick, check_response
from .config_utils import Config, Experiments
from .url_utils import trial_jobs_url, get_... | 46.844595 | 133 | 0.700274 |
5d88e6c923c61ec1483db058ca39378d23885408 | 8,258 | py | Python | google/cloud/forseti/services/inventory/base/cloudasset.py | ogreface/forseti-security | a7a3573183fa1416c605dad683587717795fe13b | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/services/inventory/base/cloudasset.py | ogreface/forseti-security | a7a3573183fa1416c605dad683587717795fe13b | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/services/inventory/base/cloudasset.py | ogreface/forseti-security | a7a3573183fa1416c605dad683587717795fe13b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Forseti Security 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 ap... | 36.866071 | 80 | 0.634052 |
731c8c2828977381819ed54fe4242b428e4487c2 | 5,821 | py | Python | tests/nlu/test_components.py | ektai/rasa | 0d02ad952b8c42187155fed82083cc8e60d9d064 | [
"Apache-2.0"
] | 1 | 2020-10-14T18:09:10.000Z | 2020-10-14T18:09:10.000Z | tests/nlu/test_components.py | gokulsg/rasa | 3868797ecd785970c2eaeced71911de1d54a2cbe | [
"Apache-2.0"
] | 187 | 2020-02-25T16:07:06.000Z | 2022-03-01T13:42:41.000Z | tests/nlu/test_components.py | gokulsg/rasa | 3868797ecd785970c2eaeced71911de1d54a2cbe | [
"Apache-2.0"
] | null | null | null | import pytest
from rasa.nlu import registry, train
from rasa.nlu.components import find_unavailable_packages
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.model import Interpreter, Metadata
@pytest.mark.parametrize("component_class", registry.component_classes)
def test_no_components_with_same_name(co... | 33.262857 | 87 | 0.675485 |
28a802054ba1634de60aac01a13100d865762c8a | 22 | py | Python | venv/Lib/site-packages/folium/_version.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 4 | 2015-02-03T06:48:43.000Z | 2015-05-27T15:31:56.000Z | venv/Lib/site-packages/folium/_version.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 13 | 2015-01-08T14:12:38.000Z | 2021-06-10T17:44:37.000Z | venv/Lib/site-packages/folium/_version.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 1 | 2018-02-25T17:50:55.000Z | 2018-02-25T17:50:55.000Z | __version__ = "0.12.1" | 22 | 22 | 0.681818 |
b7c5f6d810a4377c4d3d325bb5ccc2b618107486 | 10,732 | py | Python | ports/tm4c123/board/make-pins.py | JohKiener/micropython | 96af9ce5ac35a7026ed4e92272694eb35c5e7f32 | [
"MIT"
] | 6 | 2019-07-23T04:18:43.000Z | 2022-03-26T12:03:08.000Z | ports/tm4c123/board/make-pins.py | JohKiener/micropython | 96af9ce5ac35a7026ed4e92272694eb35c5e7f32 | [
"MIT"
] | 5 | 2019-07-26T09:06:38.000Z | 2022-02-07T16:43:52.000Z | ports/tm4c123/board/make-pins.py | JohKiener/micropython | 96af9ce5ac35a7026ed4e92272694eb35c5e7f32 | [
"MIT"
] | 13 | 2019-07-30T10:17:10.000Z | 2022-02-08T08:04:52.000Z | #!/usr/bin/env python
"""Generates the pins file for the TM4C123."""
from __future__ import print_function
import argparse
import sys
import csv
SUPPORTED_AFS = {
'UART' : ('TX', 'RX', 'RTS', 'CTS'), #UART
'SSI' : ('CLK', 'TX', 'RX', 'FSS'), #SPI
'I2C' : ('SDA', 'SCL'),
'TIM' : ('CCP0', 'CCP1'), #16... | 37.393728 | 188 | 0.53196 |
2e75eaad1eeceadc338fcc59970801a09b2cea5c | 5,117 | py | Python | bin/metrics-netscaler.py | sensu-plugins/sensu-plugins-netscaler | 6c11db7ca98657013bc01964dd8a432f9f15c4c2 | [
"MIT"
] | null | null | null | bin/metrics-netscaler.py | sensu-plugins/sensu-plugins-netscaler | 6c11db7ca98657013bc01964dd8a432f9f15c4c2 | [
"MIT"
] | 2 | 2018-11-01T16:00:05.000Z | 2021-06-25T15:16:40.000Z | bin/metrics-netscaler.py | sensu-plugins/sensu-plugins-netscaler | 6c11db7ca98657013bc01964dd8a432f9f15c4c2 | [
"MIT"
] | 2 | 2015-08-11T22:48:16.000Z | 2018-04-10T22:05:40.000Z | #!/usr/bin/env python
#
# DESCRIPTION:
# Grabs stats from a netscaler appliance via the Nitro REST API.
# Prints to STDOUT in graphite format thus meant for a TCP handler
# To find out what each stat means download the Nitro SDK
# http://support.citrix.com/proddocs/topic/netscaler-main-api-10-map/ns-nitro-rest-feat-sta... | 29.073864 | 105 | 0.688098 |
6a682c53c2b7b045ae5a8a20260721ecc46889ea | 4,278 | py | Python | src/mobile.py | mjvakili/footprinter | 60f36a05c136f5635be287c452d6bf590fe5c961 | [
"MIT"
] | null | null | null | src/mobile.py | mjvakili/footprinter | 60f36a05c136f5635be287c452d6bf590fe5c961 | [
"MIT"
] | null | null | null | src/mobile.py | mjvakili/footprinter | 60f36a05c136f5635be287c452d6bf590fe5c961 | [
"MIT"
] | 2 | 2020-05-23T04:43:22.000Z | 2020-07-21T09:59:10.000Z | import tensorflow as tf
from tensorflow.keras import Model, Sequential
from tensorflow.keras.layers import Input, ReLU, Conv2DTranspose, BatchNormalization, Dropout, Concatenate
from tensorflow.keras.activations import relu
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.models import load_m... | 43.212121 | 121 | 0.634409 |
cc6743d3f9b4baeec14de8d86477361a18c93f76 | 13,805 | py | Python | testing_CLSA.py | cacoool/CLSA-Retina | 0001cf38bc5984d742c1093a718a279738aefa4b | [
"MIT"
] | 1 | 2021-09-19T08:31:20.000Z | 2021-09-19T08:31:20.000Z | testing_CLSA.py | cacoool/CLSA-Retina | 0001cf38bc5984d742c1093a718a279738aefa4b | [
"MIT"
] | null | null | null | testing_CLSA.py | cacoool/CLSA-Retina | 0001cf38bc5984d742c1093a718a279738aefa4b | [
"MIT"
] | null | null | null | ###################################################
#
# Script to
# - Calculate prediction of the test datasets
# - Calculate the parameters to evaluate the prediction
#
##################################################
#Python
import numpy as np
import torch
import os
import h5py
import cv2 as cv
import pandas... | 38.561453 | 167 | 0.596378 |
b4c7cc19c3dfc52fe47020b4d3b337f1204c0d43 | 4,803 | py | Python | tensorflow_datasets/core/features/dataset_feature.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | 1 | 2021-05-10T10:41:27.000Z | 2021-05-10T10:41:27.000Z | tensorflow_datasets/core/features/dataset_feature.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/features/dataset_feature.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | 1 | 2021-07-04T11:07:35.000Z | 2021-07-04T11:07:35.000Z | # coding=utf-8
# Copyright 2021 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... | 31.392157 | 80 | 0.693317 |
d641e75afc77d99f8f3e2ad8403c651859e795d6 | 723 | py | Python | src/backend/common/queries/subscription_query.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | null | null | null | src/backend/common/queries/subscription_query.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | null | null | null | src/backend/common/queries/subscription_query.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | null | null | null | from typing import List
from backend.common.models.account import Account
from backend.common.models.subscription import Subscription
from backend.common.queries.database_query import DatabaseQuery
from backend.common.tasklets import typed_tasklet
class SubscriptionQuery(DatabaseQuery[List[Subscription]]):
def _... | 38.052632 | 76 | 0.767635 |
2315615ca540ba823ced82ab8e74ef2bb041be03 | 3,138 | py | Python | homeassistant/components/sensor/neurio_energy.py | TastyPi/home-assistant | aa1e4c564cb8660bf6b7637bc25317ee58869214 | [
"MIT"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | homeassistant/components/sensor/neurio_energy.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | homeassistant/components/sensor/neurio_energy.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """
Support for monitoring an Neurio hub.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.neurio_energy/
"""
import logging
import requests.exceptions
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from home... | 31.69697 | 76 | 0.680688 |
553da1dc6640940fadd1eb5860d056fb848515ec | 1,506 | py | Python | test/SCONS_LIB_DIR.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 3 | 2017-01-06T09:26:23.000Z | 2017-03-04T04:13:20.000Z | test/SCONS_LIB_DIR.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 2 | 2015-10-27T20:17:24.000Z | 2016-08-04T21:49:56.000Z | test/SCONS_LIB_DIR.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 4 | 2015-03-31T16:09:15.000Z | 2021-08-04T12:41:47.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 29.529412 | 73 | 0.75166 |
ef0f90b13f7f863df4d4c2b1f7542f313aad1515 | 864 | py | Python | cvdd/preprocessors/stopwords.py | altescy/cvdd | 57e4fe0fd30a6d2b67651ce076b63a9a8a6e7c7a | [
"MIT"
] | 5 | 2021-07-11T08:40:43.000Z | 2021-07-19T05:08:11.000Z | cvdd/preprocessors/stopwords.py | altescy/cvdd | 57e4fe0fd30a6d2b67651ce076b63a9a8a6e7c7a | [
"MIT"
] | null | null | null | cvdd/preprocessors/stopwords.py | altescy/cvdd | 57e4fe0fd30a6d2b67651ce076b63a9a8a6e7c7a | [
"MIT"
] | null | null | null | from typing import List, Optional
import nltk
from allennlp.data.tokenizers import Tokenizer, WhitespaceTokenizer
from xallennlp.data.preprocessors import Preprocessor
@Preprocessor.register("stopwords")
class Stopwords(Preprocessor[str, str]): # type: ignore[misc]
def __init__(
self,
stopwords:... | 32 | 82 | 0.658565 |
5ba45c7fc60aed8a9c89b679aa7452368a3b98a9 | 5,855 | py | Python | libcloud/common/osc.py | bopopescu/libcloud-bak | ead66a1e0e49bb70cbaa9ad335885cad3e82fe47 | [
"Apache-2.0"
] | null | null | null | libcloud/common/osc.py | bopopescu/libcloud-bak | ead66a1e0e49bb70cbaa9ad335885cad3e82fe47 | [
"Apache-2.0"
] | null | null | null | libcloud/common/osc.py | bopopescu/libcloud-bak | ead66a1e0e49bb70cbaa9ad335885cad3e82fe47 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 38.267974 | 85 | 0.574722 |
385a609fbfbc9ac89da769b434eca2f5ad6c7156 | 4,085 | py | Python | catalog/views.py | jaimish11/django_locallibrary | f3f4364a41f0a20f47e865dd89947f90aad5172c | [
"MIT"
] | null | null | null | catalog/views.py | jaimish11/django_locallibrary | f3f4364a41f0a20f47e865dd89947f90aad5172c | [
"MIT"
] | null | null | null | catalog/views.py | jaimish11/django_locallibrary | f3f4364a41f0a20f47e865dd89947f90aad5172c | [
"MIT"
] | null | null | null | from django.shortcuts import render
from catalog.models import Book, Author, BookInstance, Genre
from django.views import generic
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import PermissionRequiredMixin
import datetime
from django.contrib.auth.decorators import permission... | 30.94697 | 115 | 0.778703 |
d9102105fa7e10822e94dad7462837dbcdbf11b0 | 1,492 | py | Python | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_validators.py | enterstudio/azure-cli | b0504c3b634e17f1afc944a9572864a40da6bc18 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_validators.py | enterstudio/azure-cli | b0504c3b634e17f1afc944a9572864a40da6bc18 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_validators.py | enterstudio/azure-cli | b0504c3b634e17f1afc944a9572864a40da6bc18 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 40.324324 | 94 | 0.632038 |
f63b3b0278eecbd9acba83718f4efb242847bc36 | 63,836 | py | Python | src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py | qedhandle/sage | 8453ffb849b047893b6c61dd09176a84c9133342 | [
"BSL-1.0"
] | null | null | null | src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py | qedhandle/sage | 8453ffb849b047893b6c61dd09176a84c9133342 | [
"BSL-1.0"
] | null | null | null | src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py | qedhandle/sage | 8453ffb849b047893b6c61dd09176a84c9133342 | [
"BSL-1.0"
] | null | null | null | """
Differential Geometry of Parametrized Surfaces
AUTHORS:
- Mikhail Malakhaltsev (2010-09-25): initial version
- Joris Vankerschaver (2010-10-25): implementation, doctests
"""
# ****************************************************************************
# Copyright (C) 2010 Mikhail Malakhaltsev <mikarm@gm... | 37.222157 | 211 | 0.562676 |
79ca4318625bec7cf7dba96845318180110b7df1 | 13,108 | py | Python | test/test_keypair.py | nathanwhit/py-substrate-interface | 285fdb5e87f580157913398ea19c807abb1cde07 | [
"Apache-2.0"
] | null | null | null | test/test_keypair.py | nathanwhit/py-substrate-interface | 285fdb5e87f580157913398ea19c807abb1cde07 | [
"Apache-2.0"
] | null | null | null | test/test_keypair.py | nathanwhit/py-substrate-interface | 285fdb5e87f580157913398ea19c807abb1cde07 | [
"Apache-2.0"
] | null | null | null | # Python Substrate Interface Library
#
# Copyright 2018-2020 Stichting Polkascan (Polkascan Foundation).
#
# 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/LIC... | 44.283784 | 157 | 0.763198 |
ef40c0fcb0e8fff7c25f9d5a4fb738962a87d58b | 6,253 | py | Python | cloudify_azure/resources/storage/disk.py | marrowne/cloudify-azure-plugin | 26b7794149f0b0586a06411abc7c64a13fd8c7eb | [
"Apache-2.0"
] | 2 | 2016-07-25T14:21:27.000Z | 2016-10-26T19:47:23.000Z | cloudify_azure/resources/storage/disk.py | marrowne/cloudify-azure-plugin | 26b7794149f0b0586a06411abc7c64a13fd8c7eb | [
"Apache-2.0"
] | 43 | 2017-05-18T12:31:42.000Z | 2019-01-08T09:20:42.000Z | cloudify_azure/resources/storage/disk.py | marrowne/cloudify-azure-plugin | 26b7794149f0b0586a06411abc7c64a13fd8c7eb | [
"Apache-2.0"
] | 13 | 2015-07-09T10:49:55.000Z | 2021-05-06T09:24:30.000Z | # #######
# Copyright (c) 2016-2020 Cloudify Platform Ltd. 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... | 39.327044 | 79 | 0.674556 |
774b1a3a7184242a08a7d55360058e8edd2a8ebf | 480 | py | Python | modules/attention.py | yd1996/PartialComparison | 0e5765de001134ea61696393b2eff4b65eaaf733 | [
"MIT"
] | 4 | 2019-08-16T08:54:57.000Z | 2020-07-22T09:11:37.000Z | modules/attention.py | yd1996/PartialComparison | 0e5765de001134ea61696393b2eff4b65eaaf733 | [
"MIT"
] | 1 | 2020-11-16T10:51:05.000Z | 2020-11-16T10:51:05.000Z | modules/attention.py | yd1996/PartialComparison | 0e5765de001134ea61696393b2eff4b65eaaf733 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class AttentionBase(nn.Module):
def __init__(self, dim):
super(AttentionBase, self).__init__()
self.dim = dim
def calcuate_attention_weight(self, query, key):
raise NotImplementedError
def forward(self, query, memory):
attention_weight... | 26.666667 | 80 | 0.69375 |
7a9c51bf1a27870e4f880b3c5d697d5831473eaa | 11,315 | py | Python | cello/scanpy_cello.py | Ann-Holmes/CellO | bc2192a2d27e0859f6df885a6fc246e26e54a7b0 | [
"MIT"
] | 42 | 2019-05-14T19:04:38.000Z | 2022-03-06T12:57:00.000Z | cello/scanpy_cello.py | Ann-Holmes/CellO | bc2192a2d27e0859f6df885a6fc246e26e54a7b0 | [
"MIT"
] | 16 | 2020-08-04T12:34:08.000Z | 2022-03-31T22:30:48.000Z | cello/scanpy_cello.py | Ann-Holmes/CellO | bc2192a2d27e0859f6df885a6fc246e26e54a7b0 | [
"MIT"
] | 6 | 2019-05-13T15:57:03.000Z | 2022-03-18T02:17:05.000Z | """\
Classify human cell against the Cell Ontology using CellO.
Here we implement a function for running CellO following the conventions
in Scanpy's external API (https://scanpy.readthedocs.io/en/stable/external/).
Author: Matthew Bernstein
Email: mbernstein@morgridge.org
"""
from anndata import AnnData
import dill
... | 35.806962 | 143 | 0.632965 |
e9928d00c97cf1f0de98100477e574f1b78a874a | 13,272 | py | Python | log_mito_act/model_631.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_631.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_631.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'X... | 79.473054 | 614 | 0.80975 |
03f5487645815406e5d8a6e27ee372c27f52e316 | 14,090 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/plugins/connection/kubectl.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | null | null | null | ansible/venv/lib/python2.7/site-packages/ansible/plugins/connection/kubectl.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | null | null | null | ansible/venv/lib/python2.7/site-packages/ansible/plugins/connection/kubectl.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | null | null | null | # Based on the docker connection plugin
#
# Connection plugin for configuring kubernetes containers with kubectl
# (c) 2017, XuXinkun <xuxinkun@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | 38.922652 | 127 | 0.634918 |
9961d010cfa91fcfa280ba946beb8aad37feb79f | 21,357 | py | Python | DFND_DeiT-imagenet.py | IIGROUP/AttentionProbe | b2c88b064452741a7ccc6660a4b090743013cc73 | [
"MIT"
] | 11 | 2022-01-23T15:09:09.000Z | 2022-03-18T10:27:04.000Z | DFND_DeiT-imagenet.py | Wang-jiahao/AttentionProbe | 41a3cc0d5454ec5bba78c3dace9cded00da8cff9 | [
"MIT"
] | null | null | null | DFND_DeiT-imagenet.py | Wang-jiahao/AttentionProbe | 41a3cc0d5454ec5bba78c3dace9cded00da8cff9 | [
"MIT"
] | null | null | null | #Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 3-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ... | 41.958743 | 240 | 0.67472 |
d6dd7b41e29df538c719fa74798776e4c68a1f00 | 19,166 | py | Python | py/desispec/workflow/proctable.py | desihub/desispec | 22b84030c9c4f87080cb09900456bd0db0f6b4f0 | [
"BSD-3-Clause"
] | 24 | 2015-09-29T06:06:29.000Z | 2022-01-14T07:31:45.000Z | py/desispec/workflow/proctable.py | desihub/desispec | 22b84030c9c4f87080cb09900456bd0db0f6b4f0 | [
"BSD-3-Clause"
] | 1,452 | 2015-02-26T00:14:23.000Z | 2022-03-31T23:35:10.000Z | py/desispec/workflow/proctable.py | desihub/desispec | 22b84030c9c4f87080cb09900456bd0db0f6b4f0 | [
"BSD-3-Clause"
] | 25 | 2015-02-06T21:39:13.000Z | 2022-02-22T14:16:31.000Z | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import os
from astropy.table import Table, vstack
from collections import OrderedDict
## Import some helper functions, you can see their definitions by uncomenting the bash shell command
from desispec.workflow.exptable import default_obstypes_for_exptable
fr... | 51.8 | 129 | 0.630596 |
b383b2828ba05c95ace2da8c52a020e73d856776 | 5,299 | py | Python | src/compas_rcf/docker/docker_cmds.py | feihln/compas_rcf | 90d25dbc1fd8aa30c67a2888ef8896bc27add23e | [
"MIT"
] | null | null | null | src/compas_rcf/docker/docker_cmds.py | feihln/compas_rcf | 90d25dbc1fd8aa30c67a2888ef8896bc27add23e | [
"MIT"
] | 21 | 2020-04-01T10:00:59.000Z | 2020-04-23T14:08:05.000Z | src/compas_rcf/docker/docker_cmds.py | feihln/compas_rcf | 90d25dbc1fd8aa30c67a2888ef8896bc27add23e | [
"MIT"
] | null | null | null | """Docker compose commands to be used from python scripts."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
import shlex
import subprocess
import sys
log = logging.getLogger(__name__)
def _setup_env_vars(env_vars):
list_vars... | 31.541667 | 95 | 0.645594 |
5c033ec80d31f669ceddc8ec7b383568424e1081 | 207 | py | Python | kvdroid/jclass/android/webkit.py | wilsenmuts/Kvdroid | 9ab29c54e761ce4cfaa9d8f847257c4a975fbe0f | [
"MIT"
] | 27 | 2021-03-09T21:39:43.000Z | 2022-01-25T22:55:34.000Z | kvdroid/jclass/android/webkit.py | wilsenmuts/Kvdroid | 9ab29c54e761ce4cfaa9d8f847257c4a975fbe0f | [
"MIT"
] | 10 | 2021-03-22T20:38:17.000Z | 2021-12-23T21:06:40.000Z | kvdroid/jclass/android/webkit.py | wilsenmuts/Kvdroid | 9ab29c54e761ce4cfaa9d8f847257c4a975fbe0f | [
"MIT"
] | 7 | 2021-03-23T07:55:47.000Z | 2021-12-17T09:32:35.000Z | from jnius import autoclass
from kvdroid.jclass import _class_call
def CookieManager(*args, instantiate: bool = False):
return _class_call(autoclass("android.webkit.CookieManager"), args, instantiate)
| 29.571429 | 84 | 0.797101 |
befff23a9189022295a078385c6c901ba9789d20 | 16,019 | py | Python | tests/test_x_provider.py | Swapnilr1/pyoidc | 2feb099f4f4e26047888437aea1226237d05ebba | [
"Apache-2.0"
] | null | null | null | tests/test_x_provider.py | Swapnilr1/pyoidc | 2feb099f4f4e26047888437aea1226237d05ebba | [
"Apache-2.0"
] | null | null | null | tests/test_x_provider.py | Swapnilr1/pyoidc | 2feb099f4f4e26047888437aea1226237d05ebba | [
"Apache-2.0"
] | null | null | null | from future.backports.urllib.parse import parse_qs
from future.backports.urllib.parse import urlparse
import json
import time
import pytest
from oic import rndstr
from oic.extension.client import Client
from oic.extension.message import TokenIntrospectionRequest
from oic.extension.message import TokenIntrospectionRe... | 41.392765 | 119 | 0.584493 |
34fb61e982f4f68ff9f8443e070a44b09d46beaa | 2,852 | py | Python | tests/test_utils.py | Rails-on-HPC/subway | bacdc387fce66aab78753aa48f36ec1a79d9d64b | [
"MIT"
] | 4 | 2020-03-02T01:34:28.000Z | 2021-02-22T07:55:28.000Z | tests/test_utils.py | Rails-on-HPC/subway | bacdc387fce66aab78753aa48f36ec1a79d9d64b | [
"MIT"
] | null | null | null | tests/test_utils.py | Rails-on-HPC/subway | bacdc387fce66aab78753aa48f36ec1a79d9d64b | [
"MIT"
] | 1 | 2020-09-23T01:55:15.000Z | 2020-09-23T01:55:15.000Z | import sys
import os
import pytest
from functools import partial
from datetime import datetime
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
from subway.utils import (
replace_wildcard,
simple_template_render,
statement_parser,
md5file,
flatten_dict,
editor,
)
def test_replac... | 28.237624 | 88 | 0.538569 |
652b64a7eb9cefde1b5de55ef1bab9f60952c0c4 | 1,456 | py | Python | app/core/tests/test_admin.py | sfbattles/recipe-app-api | 7c2e893e91e4165cdd7294db71f74196ca299e7b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | sfbattles/recipe-app-api | 7c2e893e91e4165cdd7294db71f74196ca299e7b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | sfbattles/recipe-app-api | 7c2e893e91e4165cdd7294db71f74196ca299e7b | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
"""Setup function get testcase for testing """
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_super... | 33.860465 | 68 | 0.64217 |
b21b2edb482cf990bd44696f19ad7272f1a0c0de | 11,180 | py | Python | seqGAN-tensorflow-master/discriminator.py | pwnsauce8/kiv-bpini-web | 2572ffd5b8fdd49944dd84faf9fa689ed1d13018 | [
"MIT"
] | null | null | null | seqGAN-tensorflow-master/discriminator.py | pwnsauce8/kiv-bpini-web | 2572ffd5b8fdd49944dd84faf9fa689ed1d13018 | [
"MIT"
] | 4 | 2020-09-26T01:05:08.000Z | 2022-02-10T02:03:29.000Z | seqGAN-tensorflow-master/discriminator.py | pwnsauce8/kiv-bpini-web | 2572ffd5b8fdd49944dd84faf9fa689ed1d13018 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import time
from utils import SummaryHelper
# An alternative to tf.nn.rnn_cell._linear function, which has been removed in Tensorfow 1.0.1
# The highway layer is borrowed from https://github.com/mkroutikov/tf-lstm-char-cnn
def linear(input_, output_size, scope=None):
'''
... | 47.982833 | 161 | 0.613953 |
4846a9a99a1ae6987e3846e0d58c8f742772c07c | 209 | py | Python | xls2csv.py | thcrock/school-report-cards | 46eab255d65fb37d3216e387ac324edae530bc9e | [
"MIT"
] | 12 | 2016-05-09T20:00:39.000Z | 2021-09-09T00:07:53.000Z | xls2csv.py | thcrock/school-report-cards | 46eab255d65fb37d3216e387ac324edae530bc9e | [
"MIT"
] | 7 | 2016-01-11T14:30:03.000Z | 2018-06-12T14:52:13.000Z | xls2csv.py | thcrock/school-report-cards | 46eab255d65fb37d3216e387ac324edae530bc9e | [
"MIT"
] | 2 | 2016-06-18T08:53:02.000Z | 2017-04-01T16:44:35.000Z | import xlrd
import csv
import sys
with xlrd.open_workbook(sys.argv[1]) as wb:
sh = wb.sheet_by_index(0)
c = csv.writer(sys.stdout)
for r in range(sh.nrows):
c.writerow(sh.row_values(r))
| 20.9 | 43 | 0.665072 |
7da7bc269c7a0c47aa900a11781abdbe49ecd3fc | 6,176 | py | Python | manim_sandbox/utils/mobjects/MyTest.py | pu17/manim_sandor | 1dc213db45e85df9d56de800c59f56388d5d1742 | [
"MIT"
] | null | null | null | manim_sandbox/utils/mobjects/MyTest.py | pu17/manim_sandor | 1dc213db45e85df9d56de800c59f56388d5d1742 | [
"MIT"
] | null | null | null | manim_sandbox/utils/mobjects/MyTest.py | pu17/manim_sandor | 1dc213db45e85df9d56de800c59f56388d5d1742 | [
"MIT"
] | null | null | null | from manimlib import *
class MyText_old(Tex):
CONFIG = {
'default_font': '思源黑体',
}
def __init__(self, *tex_strings, **kwargs):
self.tex_list = tex_strings
TexMobject.__init__(self, *tex_strings, **kwargs)
self.not_replace_texs = ['\\over', ]
self.new_font_texs = VG... | 37.889571 | 115 | 0.552623 |
b409ad97f3135c9ef3cd088addfcbe02b5fc3e0d | 8,856 | py | Python | GAN/ebgan64.py | prannayk/thedeeplearning | c5c45c17edb36b31fe25461850974d8310350d80 | [
"MIT"
] | 4 | 2017-08-23T19:28:41.000Z | 2020-02-13T19:04:28.000Z | GAN/ebgan64.py | prannayk/thedeeplearning | c5c45c17edb36b31fe25461850974d8310350d80 | [
"MIT"
] | null | null | null | GAN/ebgan64.py | prannayk/thedeeplearning | c5c45c17edb36b31fe25461850974d8310350d80 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import scipy.misc
import sys
import time
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/",one_hot=True)
class EBGAN():
def __init__ (self, batch_size = 50, image_shape = [28,28,1], embedding_size = 128, frames=8, num... | 47.106383 | 134 | 0.715221 |
30113453fe86b1af4400f65820ff4eb1e84b466b | 235,109 | py | Python | cpplint.py | michalliu/chromium-depot_tools | 43e9158650446b1153cb7ac119f6e6d95bf5c0c3 | [
"BSD-3-Clause"
] | null | null | null | cpplint.py | michalliu/chromium-depot_tools | 43e9158650446b1153cb7ac119f6e6d95bf5c0c3 | [
"BSD-3-Clause"
] | null | null | null | cpplint.py | michalliu/chromium-depot_tools | 43e9158650446b1153cb7ac119f6e6d95bf5c0c3 | [
"BSD-3-Clause"
] | 1 | 2019-05-07T22:56:00.000Z | 2019-05-07T22:56:00.000Z | #!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. 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
# notice, this list... | 38.260212 | 97 | 0.651523 |
6f6071f661c49cc7cb44af8605a59d851154e2f2 | 850 | py | Python | taotao-cloud-python/taotao-cloud-oldboy/day77-cmdb/day75/day75/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 47 | 2021-04-13T10:32:13.000Z | 2022-03-31T10:30:30.000Z | taotao-cloud-python/taotao-cloud-oldboy/day77-cmdb/day75/day75/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:41:04.000Z | 2021-11-01T07:41:10.000Z | taotao-cloud-python/taotao-cloud-oldboy/day77-cmdb/day75/day75/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 21 | 2021-04-13T10:32:17.000Z | 2022-03-26T07:43:22.000Z | """day75 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | 35.416667 | 79 | 0.688235 |
4941827248bd34624b6b5e4ee31e2475a1375098 | 14,029 | py | Python | Cython/Utils.py | mbuesch/cython | 14acda8e7e0b4246ef80331146e66d4f5b70c4e8 | [
"Apache-2.0"
] | 1 | 2020-12-22T08:51:20.000Z | 2020-12-22T08:51:20.000Z | Cython/Utils.py | mbuesch/cython | 14acda8e7e0b4246ef80331146e66d4f5b70c4e8 | [
"Apache-2.0"
] | null | null | null | Cython/Utils.py | mbuesch/cython | 14acda8e7e0b4246ef80331146e66d4f5b70c4e8 | [
"Apache-2.0"
] | null | null | null | """
Cython -- Things that don't belong
anywhere else in particular
"""
from __future__ import absolute_import
try:
from __builtin__ import basestring
except ImportError:
basestring = str
try:
FileNotFoundError
except NameError:
FileNotFoundError = OSError
import os
import sys
import re
imp... | 28.227364 | 104 | 0.599045 |
ba28543c6baa617d8dbe73478e807a0dbf9fdea5 | 677 | py | Python | Lib/compiler/consts.py | diogommartins/cinder | 79103e9119cbecef3b085ccf2878f00c26e1d175 | [
"CNRI-Python-GPL-Compatible"
] | 278 | 2021-08-31T00:46:51.000Z | 2022-02-13T19:43:28.000Z | Lib/compiler/consts.py | diogommartins/cinder | 79103e9119cbecef3b085ccf2878f00c26e1d175 | [
"CNRI-Python-GPL-Compatible"
] | 9 | 2021-11-05T22:28:43.000Z | 2021-11-23T08:39:04.000Z | Lib/compiler/consts.py | diogommartins/cinder | 79103e9119cbecef3b085ccf2878f00c26e1d175 | [
"CNRI-Python-GPL-Compatible"
] | 12 | 2021-08-31T07:49:54.000Z | 2021-10-08T01:09:01.000Z | # Portions copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
# operation flags
OP_ASSIGN = "OP_ASSIGN"
OP_DELETE = "OP_DELETE"
OP_APPLY = "OP_APPLY"
SC_LOCAL = 1
SC_GLOBAL_IMPLICIT = 2
SC_GLOBAL_EXPLICIT = 3
SC_FREE = 4
SC_CELL = 5
SC_UNKNOWN = 6
CO_OPTIMIZED = 0x0001
CO_NEWLOCALS = 0x0002
CO... | 21.83871 | 85 | 0.79616 |
0c155c03d121177e7a3af30a6d1561b8fa064fad | 315 | py | Python | routers.py | v0tti/looking-glass | 3ddfcf1f82491fa09598234d3c981c020c7b0725 | [
"MIT"
] | null | null | null | routers.py | v0tti/looking-glass | 3ddfcf1f82491fa09598234d3c981c020c7b0725 | [
"MIT"
] | null | null | null | routers.py | v0tti/looking-glass | 3ddfcf1f82491fa09598234d3c981c020c7b0725 | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
import os
load_dotenv()
## Example routers, please edit and add yours
routers_list = [
dict(address=('dn42.v0tti.com', 22),
usern=os.getenv('USERN'),
passw=os.getenv('PASSW'),
type='bird',
asn='4242423929',
location='dn42.v0tti.com',
jumpserver=False
)
] | 19.6875 | 45 | 0.666667 |
05d9d3c04198f3de7a79f1b77cf8d1dd0b2dfe52 | 10,508 | py | Python | models/base_model.py | XLEric/CycleGAN | a75a50fb3cc6a8d5caf584f091fefc40851dc538 | [
"MIT"
] | null | null | null | models/base_model.py | XLEric/CycleGAN | a75a50fb3cc6a8d5caf584f091fefc40851dc538 | [
"MIT"
] | null | null | null | models/base_model.py | XLEric/CycleGAN | a75a50fb3cc6a8d5caf584f091fefc40851dc538 | [
"MIT"
] | null | null | null | import os
import torch
from collections import OrderedDict
from abc import ABC, abstractmethod
from . import networks
class BaseModel(ABC):
"""This class is an abstract base class (ABC) for models.
To create a subclass, you need to implement the following five functions:
-- <__init__>: ... | 44.714894 | 260 | 0.59745 |
052800f83af9c7ea94b0d3a251e484b8ca6d2711 | 3,894 | py | Python | esmvalcore/preprocessor/_derive/co2s.py | markelg/ESMValCore | b2f7ffc3232f174dd5ebc50ad20b4a02d3517c2c | [
"Apache-2.0"
] | 26 | 2019-06-07T07:50:07.000Z | 2022-03-22T21:04:01.000Z | esmvalcore/preprocessor/_derive/co2s.py | markelg/ESMValCore | b2f7ffc3232f174dd5ebc50ad20b4a02d3517c2c | [
"Apache-2.0"
] | 1,370 | 2019-06-06T09:03:07.000Z | 2022-03-31T04:37:20.000Z | esmvalcore/preprocessor/_derive/co2s.py | zklaus/ESMValCore | 5656fb8b546eeb4d750a424de7ed56a237edfabb | [
"Apache-2.0"
] | 26 | 2019-07-03T13:08:48.000Z | 2022-03-02T16:08:47.000Z | """Derivation of variable ``co2s``."""
import dask.array as da
import iris
import numpy as np
import stratify
from ._baseclass import DerivedVariableBase
def _get_first_unmasked_data(array, axis):
"""Get first unmasked value of an array along an axis."""
mask = da.ma.getmaskarray(array)
numerical_mask = ... | 40.14433 | 79 | 0.625064 |
d81f5dc9cf42fa425b024efedb9919bae073ae6a | 5,000 | py | Python | predefined_functions/algo_doing_simple_tasks.py | g-make-it/IG_Trading_Algo_Scripts_Python | 931f1d568f8e89fbaac56aa5ec58473bbed606f6 | [
"BSD-3-Clause"
] | 186 | 2021-09-05T10:03:01.000Z | 2022-03-08T05:47:04.000Z | predefined_functions/algo_doing_simple_tasks.py | g-make-it/IG_Trading_Algo_Scripts_Python | 931f1d568f8e89fbaac56aa5ec58473bbed606f6 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T21:56:55.000Z | 2021-12-29T18:21:29.000Z | predefined_functions/algo_doing_simple_tasks.py | g-make-it/IG_Trading_Algo_Scripts_Python | 931f1d568f8e89fbaac56aa5ec58473bbed606f6 | [
"BSD-3-Clause"
] | 32 | 2021-09-05T11:46:32.000Z | 2022-03-22T08:23:38.000Z | from trading_ig.config import config
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# if you need to cache to DB your requests
from datetime import timedelta
import requests_cache
from getting_realtime_data.data_retrieval import Data_Retrieval
from sending_orders.order_management i... | 31.64557 | 105 | 0.6146 |
3708ca56ede14f4cf9d89c7778808bdc32067bd1 | 4,576 | py | Python | TEditor/TEditor/settings.py | josevictorp81/TEditor | d05fd61a730dd2aac63221c9011deac789c3cc68 | [
"MIT"
] | 1 | 2021-12-30T01:13:41.000Z | 2021-12-30T01:13:41.000Z | TEditor/TEditor/settings.py | josevictorp81/TEditor | d05fd61a730dd2aac63221c9011deac789c3cc68 | [
"MIT"
] | null | null | null | TEditor/TEditor/settings.py | josevictorp81/TEditor | d05fd61a730dd2aac63221c9011deac789c3cc68 | [
"MIT"
] | null | null | null | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the... | 28.07362 | 117 | 0.600743 |
3455383c4666cd0da34da81a5f7a6b2e329b59d0 | 343 | py | Python | generator/generators/ping.py | ionut-arm/parsec-mock | 9bf0f4b24e046865d30513490ec20c4e94ef0a7f | [
"Apache-2.0"
] | 3 | 2021-03-19T17:25:00.000Z | 2021-03-24T23:38:28.000Z | generator/generators/ping.py | ionut-arm/parsec-mock | 9bf0f4b24e046865d30513490ec20c4e94ef0a7f | [
"Apache-2.0"
] | 4 | 2021-04-21T16:23:04.000Z | 2021-12-08T15:24:02.000Z | generator/generators/ping.py | ionut-arm/parsec-mock | 9bf0f4b24e046865d30513490ec20c4e94ef0a7f | [
"Apache-2.0"
] | 3 | 2021-03-23T20:41:48.000Z | 2022-03-25T10:19:37.000Z | # Copyright 2021 Contributors to the Parsec project.
# SPDX-License-Identifier: Apache-2.0
from .protobuf import ping_pb2
def gen():
op = ping_pb2.Operation()
result = ping_pb2.Result()
result.wire_protocol_version_maj = 1
result.wire_protocol_version_min = 0
return (op.SerializeToString(), resul... | 26.384615 | 63 | 0.74344 |
2e5aa13a921a5d00fafc8bd4a83511bcc9dfc6b6 | 2,959 | py | Python | pyferm/actions/ramp.py | viyh/pyferm | 39becd72e8918a0cfa56942b646288b081bc4300 | [
"MIT"
] | null | null | null | pyferm/actions/ramp.py | viyh/pyferm | 39becd72e8918a0cfa56942b646288b081bc4300 | [
"MIT"
] | null | null | null | pyferm/actions/ramp.py | viyh/pyferm | 39becd72e8918a0cfa56942b646288b081bc4300 | [
"MIT"
] | null | null | null | import time
import datetime
from pyferm.actions import action
class ramp(action):
def __init__(self, name, parent, **kwargs):
super().__init__(name, parent, **kwargs)
def run(self):
self.start_value = self.params["start_value"]
self.end_value = self.params["end_value"]
self.st... | 42.271429 | 86 | 0.515715 |
f128626436e773e1eb1e89a3c742f9ee2bc992a7 | 7,010 | py | Python | fantasycreator/welcomeWindow.py | peterg7/Fantasy_Creator | ee4d6a3d4559f649bbe2f5d8c3f76dc41c94d414 | [
"MIT"
] | null | null | null | fantasycreator/welcomeWindow.py | peterg7/Fantasy_Creator | ee4d6a3d4559f649bbe2f5d8c3f76dc41c94d414 | [
"MIT"
] | null | null | null | fantasycreator/welcomeWindow.py | peterg7/Fantasy_Creator | ee4d6a3d4559f649bbe2f5d8c3f76dc41c94d414 | [
"MIT"
] | null | null | null |
# PyQt
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtCore as qtc
from PyQt5 import QtGui as qtg
# Built-in Modules
import sys
import time
# External resources
import resources
# Opening window
class WelcomeWindow(qtw.QDialog):
new_book = qtc.pyqtSignal()
open_existing = qtc.pyqtSignal(str)
ope... | 34.70297 | 107 | 0.637233 |
e9e4db76ff5a2d02343a47b5ec50de06fd40a7bb | 120 | py | Python | recommender/redis_connection.py | mbruty/COMP2003-2020-O | 9bfbc312ec45be288d96e4640f8195444e0c63cc | [
"Apache-2.0"
] | null | null | null | recommender/redis_connection.py | mbruty/COMP2003-2020-O | 9bfbc312ec45be288d96e4640f8195444e0c63cc | [
"Apache-2.0"
] | 6 | 2021-09-21T17:27:50.000Z | 2022-02-27T13:01:23.000Z | recommender/redis_connection.py | mbruty/COMP2003-2020-O | 9bfbc312ec45be288d96e4640f8195444e0c63cc | [
"Apache-2.0"
] | null | null | null | import redis
def get_connection():
# See teams for the connection details
return redis.Redis(host="", password="") | 24 | 42 | 0.725 |
03b4f7e1e9e3fce55fa610863bf00a70b6344e20 | 77,880 | py | Python | sdks/python/apache_beam/runners/portability/fn_api_runner/translations.py | jzju/beam | d9876ea6bdef22b959ded2c16751057a418468bb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/runners/portability/fn_api_runner/translations.py | jzju/beam | d9876ea6bdef22b959ded2c16751057a418468bb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/runners/portability/fn_api_runner/translations.py | damondouglas/beam | 4774ac713f427fefb38114f661516faef26d8207 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 38.38344 | 109 | 0.681844 |
1528d431cb7141581dbfd850ea6e2caf695338ae | 1,700 | py | Python | profiles/models.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | profiles/models.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | profiles/models.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from ledger.models import Account
class Profile(models.Model):
# The user that this profile is associated with
# Since each profile is associated with exactly one user, the user is the profiles primary key
user = models.OneToOneFiel... | 36.956522 | 98 | 0.741176 |
af6bd9e285cce4290cbba8dde349ae74c6a5c5ce | 12,026 | py | Python | official/nlp/bert/input_pipeline.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | 1 | 2021-05-22T12:50:50.000Z | 2021-05-22T12:50:50.000Z | official/nlp/bert/input_pipeline.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | official/nlp/bert/input_pipeline.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.689769 | 81 | 0.652337 |
695be577288270bc4e8aa88bea40fe63a526ac38 | 13,023 | py | Python | src/spencer_people_tracking/utils/spencer_bagfile_tools/scripts/reconstruct_odometry.py | CodeToPoem/HumanAwareRobotNavigation | d44eb7e5acd73a5a7bf8bf1cd88c23d6a4a3c330 | [
"BSD-3-Clause"
] | 20 | 2017-10-26T05:58:24.000Z | 2021-06-13T11:18:54.000Z | src/spencer_people_tracking/utils/spencer_bagfile_tools/scripts/reconstruct_odometry.py | dmr-goncalves/HumanAwareRobotNavigation | d44eb7e5acd73a5a7bf8bf1cd88c23d6a4a3c330 | [
"BSD-3-Clause"
] | null | null | null | src/spencer_people_tracking/utils/spencer_bagfile_tools/scripts/reconstruct_odometry.py | dmr-goncalves/HumanAwareRobotNavigation | d44eb7e5acd73a5a7bf8bf1cd88c23d6a4a3c330 | [
"BSD-3-Clause"
] | 6 | 2018-02-05T09:31:42.000Z | 2022-02-07T22:05:57.000Z | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Timm Linder, Social Robotics Lab, University of Freiburg
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:... | 43.701342 | 191 | 0.67496 |
135c0a51e66c50de5ee427243dcfedf9907cee20 | 48,414 | py | Python | rollbar/__init__.py | mike9005/pyrollbar | 487a78c427c8021d46f2d211e34c500593bcb706 | [
"MIT"
] | null | null | null | rollbar/__init__.py | mike9005/pyrollbar | 487a78c427c8021d46f2d211e34c500593bcb706 | [
"MIT"
] | null | null | null | rollbar/__init__.py | mike9005/pyrollbar | 487a78c427c8021d46f2d211e34c500593bcb706 | [
"MIT"
] | null | null | null | """
Plugin for Pyramid apps to submit errors to Rollbar
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import functools
import inspect
import json
import logging
import os
import socket
import sys
import threading
import time
import traceback
import types
import uuid
imp... | 30.758577 | 126 | 0.625955 |
bcc8c5f0cdcc0646686c4ce1b96328c8f07cac26 | 2,910 | py | Python | okonomiyaki/versions/enpkg.py | enthought/okonomiyaki | 51b8b4fa8d17255e13c097402691726545cf5b4c | [
"BSD-3-Clause"
] | 1 | 2021-06-01T16:35:00.000Z | 2021-06-01T16:35:00.000Z | okonomiyaki/versions/enpkg.py | enthought/okonomiyaki | 51b8b4fa8d17255e13c097402691726545cf5b4c | [
"BSD-3-Clause"
] | 249 | 2015-02-24T19:06:53.000Z | 2021-07-30T09:01:53.000Z | okonomiyaki/versions/enpkg.py | enthought/okonomiyaki | 51b8b4fa8d17255e13c097402691726545cf5b4c | [
"BSD-3-Clause"
] | 4 | 2015-02-19T21:29:12.000Z | 2016-01-14T21:02:39.000Z | from okonomiyaki.errors import InvalidEnpkgVersion
from .pep386_workaround import IrrationalVersionError, PEP386WorkaroundVersion
class EnpkgVersion(object):
@classmethod
def from_upstream_and_build(cls, upstream, build):
""" Creates a new EnpkgVersion from the upstream string and the
build nu... | 29.1 | 78 | 0.579038 |
6e207da8caa3aa42f113363ef0d8d98e40992e91 | 6,604 | py | Python | manim/animation/composition.py | Hari-07/manim | bbe113e7d33636c8901d6c7cee81cb2f4b69cc8b | [
"MIT"
] | 1 | 2020-04-29T19:55:50.000Z | 2020-04-29T19:55:50.000Z | manim/animation/composition.py | Hari-07/manim | bbe113e7d33636c8901d6c7cee81cb2f4b69cc8b | [
"MIT"
] | null | null | null | manim/animation/composition.py | Hari-07/manim | bbe113e7d33636c8901d6c7cee81cb2f4b69cc8b | [
"MIT"
] | null | null | null | """Tools for displaying multiple animations at once."""
from typing import TYPE_CHECKING, Callable, Optional, Union
import numpy as np
from .._config import config
from ..animation.animation import Animation, prepare_animation
from ..mobject.mobject import Group, Mobject
from ..mobject.opengl_mobject import OpenGLG... | 36.688889 | 88 | 0.639612 |
88177a019fffd8f080e38e3816cc41d048987b23 | 1,227 | py | Python | test_ServiceGame.py | pauloeduard0/CI-List-L3 | 9263e456d6d5e07e1e1c238042ea64f81b11eb3c | [
"MIT"
] | null | null | null | test_ServiceGame.py | pauloeduard0/CI-List-L3 | 9263e456d6d5e07e1e1c238042ea64f81b11eb3c | [
"MIT"
] | null | null | null | test_ServiceGame.py | pauloeduard0/CI-List-L3 | 9263e456d6d5e07e1e1c238042ea64f81b11eb3c | [
"MIT"
] | null | null | null | import unittest
import ServiceGame
from model.Platform import platform
from model.Publishers import publisher
class TestServiceGame(unittest.TestCase):
def test_games_Wii(self):
wiigames = ServiceGame.platz(platform('Wii'))
self.assertEqual(15, len(wiigames))
def test_games_PC(self):
... | 30.675 | 72 | 0.682967 |
0dc9335f1048d0ab2877a860af9f4a47a9a63480 | 16,369 | py | Python | tests/mock_dbus.py | harisokanovic/pyconnman | 8876f3dbf3a25a2a65d2d81e7b0bdd8068839173 | [
"Apache-2.0"
] | null | null | null | tests/mock_dbus.py | harisokanovic/pyconnman | 8876f3dbf3a25a2a65d2d81e7b0bdd8068839173 | [
"Apache-2.0"
] | null | null | null | tests/mock_dbus.py | harisokanovic/pyconnman | 8876f3dbf3a25a2a65d2d81e7b0bdd8068839173 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import dbus
class MockDBusInterface:
"""Mock dbus.Interface implementation for purpose of testing"""
def __init__(self, obj, addr):
self.addr = addr
self.agent = None
if (self.addr == 'net.connman.Manager'):
self._props = dbus.Dictio... | 244.313433 | 10,535 | 0.731077 |
ff7d1faee41844c4a031aeb65e3bb642410913ab | 546 | py | Python | ExpenseProject/manage.py | cs-fullstack-fall-2018/project3-django-psanon19 | 4df4459265c5d0b560dc4fa26b7da2c1b3bf9cff | [
"Apache-2.0"
] | null | null | null | ExpenseProject/manage.py | cs-fullstack-fall-2018/project3-django-psanon19 | 4df4459265c5d0b560dc4fa26b7da2c1b3bf9cff | [
"Apache-2.0"
] | null | null | null | ExpenseProject/manage.py | cs-fullstack-fall-2018/project3-django-psanon19 | 4df4459265c5d0b560dc4fa26b7da2c1b3bf9cff | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ExpenseProject.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Djang... | 34.125 | 78 | 0.690476 |
171d6f674cb892de4ba3579a86563297bbfed6cc | 1,202 | py | Python | ggplot/scales/scale_y_continuous.py | ouseful-backup/ggplot | b5872f04f4e6ee47874eb66676b1d44375d005ef | [
"BSD-2-Clause"
] | 6 | 2016-10-06T08:37:45.000Z | 2019-12-09T06:52:28.000Z | ggplot/scales/scale_y_continuous.py | vannem/ggplot | 0f3774e6a645796b843d3ce77fb388958773338e | [
"BSD-2-Clause"
] | null | null | null | ggplot/scales/scale_y_continuous.py | vannem/ggplot | 0f3774e6a645796b843d3ce77fb388958773338e | [
"BSD-2-Clause"
] | 15 | 2015-12-15T05:49:39.000Z | 2021-04-17T09:47:48.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .scale import scale
from copy import deepcopy
from matplotlib.pyplot import FuncFormatter
dollar = lambda x, pos: '$%1.2f' % x
currency = dollar
comma = lambda x, pos: '{:0,d}'.format(int(x))
millions... | 30.820513 | 66 | 0.595674 |
0840b817e6f37617897789199c37b59ec75db6f2 | 2,849 | py | Python | Object_Classification/DFAENT/DFAENT_Home/eval.py | lindagaw/Emotion-Detection | 7431984fb5ab45abe3b793e314c3c15b747d2226 | [
"MIT"
] | 121 | 2020-06-25T02:50:03.000Z | 2022-03-17T07:19:21.000Z | Object_Classification/DFAENT/DFAENT_Home/eval.py | lindagaw/Emotion-Detection | 7431984fb5ab45abe3b793e314c3c15b747d2226 | [
"MIT"
] | 2 | 2020-07-03T04:37:32.000Z | 2020-12-25T04:31:38.000Z | Object_Classification/DFAENT/DFAENT_Home/eval.py | lindagaw/Emotion-Detection | 7431984fb5ab45abe3b793e314c3c15b747d2226 | [
"MIT"
] | 9 | 2020-06-25T02:50:04.000Z | 2022-03-17T07:19:22.000Z | # run: python eval.py --task CP --target Product
import os
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
from torch.autograd import Variable
from utils import CLEFImage, print_args
from model.net import ResNet50_mod_name, ResCla... | 40.126761 | 168 | 0.693226 |
929641458ccd44318c1d4b321b5b5bcae93d7f29 | 301 | py | Python | Basic Python Theory/Part 4 (Classess & Objects)/main.py | Randula98/Python-For-Beginners | e41a6014be882f01c6ccdcbe2167e2b581646eee | [
"MIT"
] | 6 | 2021-12-14T17:52:11.000Z | 2021-12-19T20:22:44.000Z | Basic Python Theory/Part 4 (Classess & Objects)/main.py | GIHAA/Python-For-Beginners | e41a6014be882f01c6ccdcbe2167e2b581646eee | [
"MIT"
] | null | null | null | Basic Python Theory/Part 4 (Classess & Objects)/main.py | GIHAA/Python-For-Beginners | e41a6014be882f01c6ccdcbe2167e2b581646eee | [
"MIT"
] | 2 | 2021-12-19T18:50:30.000Z | 2022-01-01T23:05:18.000Z | #import file
from student import Student
#create object
student1 = Student("John" , "Software Engineer" , 3.8 , 3 , 1)
student2 = Student("Shyla" , "Graphic Designer" , 3.2 , 2 , 2)
print(student1.name)
print(student1.on_deans_list())
print()
print(student2.name)
print(student2.on_deans_list())
| 18.8125 | 62 | 0.714286 |
606304bdd6f6de96e11d09bad62adaec10cb76c0 | 3,234 | py | Python | usaspending_api/references/tests/integration/test_load_gtas_mgmt_cmd.py | beboplove/usaspending-api | ee4fb35e2d5bcdc68f6c0d4240871ea298e532d9 | [
"CC0-1.0"
] | null | null | null | usaspending_api/references/tests/integration/test_load_gtas_mgmt_cmd.py | beboplove/usaspending-api | ee4fb35e2d5bcdc68f6c0d4240871ea298e532d9 | [
"CC0-1.0"
] | null | null | null | usaspending_api/references/tests/integration/test_load_gtas_mgmt_cmd.py | beboplove/usaspending-api | ee4fb35e2d5bcdc68f6c0d4240871ea298e532d9 | [
"CC0-1.0"
] | null | null | null | import pytest
from django.core.management import call_command
from django.db import DEFAULT_DB_ALIAS
from unittest.mock import MagicMock
from usaspending_api.etl.broker_etl_helpers import PhonyCursor
from usaspending_api.references.models import GTASSF133Balances
@pytest.mark.django_db
def test_program_activity_fres... | 28.875 | 113 | 0.480829 |
25ab24da59d0d6e2e4e9cde9eff54210fc486bab | 2,983 | py | Python | services/contrib/KafkaAgent/setup.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 1 | 2020-05-26T01:29:50.000Z | 2020-05-26T01:29:50.000Z | services/contrib/KafkaAgent/setup.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | services/contrib/KafkaAgent/setup.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | 40.863014 | 79 | 0.732149 |
947bb5005c7fa9ef33b1c9c994568207b0c69cc6 | 961 | py | Python | backend/authentication/admin.py | gorkemarslan/react-django-ecommerce | 86ca776f0f45f0b959b910116803686523632810 | [
"MIT"
] | null | null | null | backend/authentication/admin.py | gorkemarslan/react-django-ecommerce | 86ca776f0f45f0b959b910116803686523632810 | [
"MIT"
] | null | null | null | backend/authentication/admin.py | gorkemarslan/react-django-ecommerce | 86ca776f0f45f0b959b910116803686523632810 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import CustomUserChangeForm, CustomUserCreationForm
from .models import CustomUser
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = Cus... | 32.033333 | 83 | 0.640999 |
b432fde1b4dd03535e2a5fc7fe15ed1663895bbb | 730 | py | Python | selfdrive/controls/lib/latcontrol_angle.py | jamcar23/openpilot | 8a609b73710f723686c1a944770c5b19f209a0ca | [
"MIT"
] | 5 | 2020-12-23T01:49:04.000Z | 2021-08-28T23:42:52.000Z | selfdrive/controls/lib/latcontrol_angle.py | jamcar23/openpilot | 8a609b73710f723686c1a944770c5b19f209a0ca | [
"MIT"
] | 60 | 2020-09-03T15:23:38.000Z | 2021-12-17T12:39:50.000Z | selfdrive/controls/lib/latcontrol_angle.py | jamcar23/openpilot | 8a609b73710f723686c1a944770c5b19f209a0ca | [
"MIT"
] | 2 | 2020-12-07T20:04:19.000Z | 2022-03-05T08:00:03.000Z | import math
from cereal import log
class LatControlAngle():
def __init__(self, CP):
pass
def reset(self):
pass
def update(self, active, CS, CP, VM, params, desired_curvature, desired_curvature_rate, lat_plan):
angle_log = log.ControlsState.LateralAngleState.new_message()
if CS.vEgo < 0.3 or n... | 28.076923 | 100 | 0.730137 |
4376f050dde173802dab8cadd6b2463b6127ea73 | 495 | py | Python | backend/util/crypto_hash.py | wagnerperin/Python-Blockchain | 5e066ab17839db33bb9cfc841d25680e9c73f535 | [
"MIT"
] | null | null | null | backend/util/crypto_hash.py | wagnerperin/Python-Blockchain | 5e066ab17839db33bb9cfc841d25680e9c73f535 | [
"MIT"
] | null | null | null | backend/util/crypto_hash.py | wagnerperin/Python-Blockchain | 5e066ab17839db33bb9cfc841d25680e9c73f535 | [
"MIT"
] | null | null | null | import hashlib
import json
def crypto_hash(*args):
""""
Return a sha-256 hash of the given arguments.
"""
stringfied_args = sorted(map(lambda data: json.dumps(data), args))
joined_data = ''.join(stringfied_args)
return hashlib.sha256(joined_data.encode('utf-8')).hexdigest()
def main():
pr... | 27.5 | 70 | 0.630303 |
a4dc931674291a1b958af7ec11fec1a4ee591c7b | 22,191 | py | Python | evennia/contrib/rplanguage.py | Jaykingamez/evennia | cf7cab1fea99ede3efecb70a65c3eb0fba1d3745 | [
"BSD-3-Clause"
] | 1,544 | 2015-01-01T22:16:31.000Z | 2022-03-31T19:17:45.000Z | evennia/contrib/rplanguage.py | Jaykingamez/evennia | cf7cab1fea99ede3efecb70a65c3eb0fba1d3745 | [
"BSD-3-Clause"
] | 1,686 | 2015-01-02T18:26:31.000Z | 2022-03-31T20:12:03.000Z | evennia/contrib/rplanguage.py | Jaykingamez/evennia | cf7cab1fea99ede3efecb70a65c3eb0fba1d3745 | [
"BSD-3-Clause"
] | 867 | 2015-01-02T21:01:54.000Z | 2022-03-29T00:28:27.000Z | """
Language and whisper obfuscation system
Evennia contrib - Griatch 2015
This module is intented to be used with an emoting system (such as
contrib/rpsystem.py). It offers the ability to obfuscate spoken words
in the game in various ways:
- Language: The language functionality defines a pseudo-language map
to... | 40.642857 | 103 | 0.594836 |
15645d0085d408beedc517051027729a3e5d9f00 | 10,235 | py | Python | python/pyspark/sql/utils.py | amwufiv/spark | b50d4507f52315d5f6d75c617e845248a1c828a9 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2022-02-10T11:30:07.000Z | 2022-02-14T18:26:30.000Z | python/pyspark/sql/utils.py | amwufiv/spark | b50d4507f52315d5f6d75c617e845248a1c828a9 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 10 | 2021-06-23T21:23:30.000Z | 2022-02-16T01:19:37.000Z | python/pyspark/sql/utils.py | amwufiv/spark | b50d4507f52315d5f6d75c617e845248a1c828a9 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2022-01-24T20:07:59.000Z | 2022-01-25T16:11:34.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 33.667763 | 100 | 0.668197 |
e12262bdab851c1c662182f5d1041d745812f5e1 | 661 | py | Python | Ago-Dic-2018/Orlando Martinez/practica 2/UnchangedMagicians.py | angelicardz/DAS_Sistemas | e2a69fec358f0fad4fe05c39ea6168c89eed41ac | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2018/Orlando Martinez/practica 2/UnchangedMagicians.py | angelicardz/DAS_Sistemas | e2a69fec358f0fad4fe05c39ea6168c89eed41ac | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2018/Orlando Martinez/practica 2/UnchangedMagicians.py | angelicardz/DAS_Sistemas | e2a69fec358f0fad4fe05c39ea6168c89eed41ac | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | def show_magicians(nombres_magos):
for magician in nombres_magos:
print(magician)
def make_great(nombres_magos):
great_magicians = []
while nombres_magos:
mago = nombres_magos.pop()
great_magician = mago + ' the Great'
great_magicians.append(great_magician)
for great_m... | 24.481481 | 46 | 0.732224 |
79c233760e728d70bb06241f8d99ebf8b0088364 | 2,299 | py | Python | bayescache/api/data/loaders.py | jacobhinkle/bayescache | 1728aaaec112a375a7341776ccb5c2d4b67242d6 | [
"MIT"
] | null | null | null | bayescache/api/data/loaders.py | jacobhinkle/bayescache | 1728aaaec112a375a7341776ccb5c2d4b67242d6 | [
"MIT"
] | null | null | null | bayescache/api/data/loaders.py | jacobhinkle/bayescache | 1728aaaec112a375a7341776ccb5c2d4b67242d6 | [
"MIT"
] | null | null | null | import numpy as np
from math import floor
from torch.utils import data
class DataSplitter(data.Dataset):
"""
Subset dataset by index.
Helper class to be used with `train_valid_splitter`.
Parameters
----------
data : torch.utils.data.Dataset instance
length : int
Number of sampl... | 25.831461 | 79 | 0.652893 |
17ba1de65741e8b57c3e0d3cdb737c5838d5e327 | 1,461 | py | Python | setup.py | remusao/httpsig | 8712e9b026eb6053d42bc52612a3cc42380829df | [
"MIT"
] | 36 | 2015-02-12T02:45:23.000Z | 2021-03-02T21:16:11.000Z | setup.py | remusao/httpsig | 8712e9b026eb6053d42bc52612a3cc42380829df | [
"MIT"
] | 18 | 2015-01-16T15:15:11.000Z | 2022-03-01T09:30:19.000Z | setup.py | remusao/httpsig | 8712e9b026eb6053d42bc52612a3cc42380829df | [
"MIT"
] | 18 | 2016-04-28T22:59:38.000Z | 2021-09-27T19:15:41.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
# create long description
with open('README.rst') as file:
long_description = file.read()
with open('CHANGELOG.rst') as file:
long_description += '\n\n' + file.read()
setup(
name='httpsig',
description="Secure HTTP request signing using... | 34.785714 | 91 | 0.645448 |
45fd8c1ac7696b7b22685fbb82ba5ec1ab24d59c | 4,226 | py | Python | Contents/Code/localmedia.py | littleneko/LocalSubs.bundle | a29a85119d69e12858fc1c605af82c8c29cef21c | [
"MIT"
] | 2 | 2021-09-27T13:54:31.000Z | 2021-12-25T16:58:03.000Z | Contents/Code/localmedia.py | littleneko/LocalSubs.bundle | a29a85119d69e12858fc1c605af82c8c29cef21c | [
"MIT"
] | null | null | null | Contents/Code/localmedia.py | littleneko/LocalSubs.bundle | a29a85119d69e12858fc1c605af82c8c29cef21c | [
"MIT"
] | null | null | null | import os
import re
import config
import helpers
import subtitlehelpers
def findSubtitles(part):
RE_METAFILES = re.compile(r'^[\.~]')
lang_sub_map = {}
part_filename = helpers.unicodize(part.file)
part_basename = os.path.splitext(os.path.basename(part_filename))[0]
paths = [os.path.dirname(part_f... | 45.934783 | 135 | 0.677473 |
df175d06aa43f0cf2371afcc091ece0d44569936 | 9,919 | py | Python | lib/modeling/mask_rcnn_heads.py | Juggernaut93/Detectron | 727b1f2291edf07cf9d20b6a869d5ad1307f0ffc | [
"Apache-2.0"
] | 3 | 2018-03-22T02:59:02.000Z | 2018-08-12T12:12:01.000Z | lib/modeling/mask_rcnn_heads.py | Juggernaut93/Detectron | 727b1f2291edf07cf9d20b6a869d5ad1307f0ffc | [
"Apache-2.0"
] | null | null | null | lib/modeling/mask_rcnn_heads.py | Juggernaut93/Detectron | 727b1f2291edf07cf9d20b6a869d5ad1307f0ffc | [
"Apache-2.0"
] | 1 | 2019-12-21T01:59:34.000Z | 2019-12-21T01:59:34.000Z | # Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 30.240854 | 80 | 0.607017 |
03d712c3f7e24c3457c09d28e088b692006ad9c0 | 1,612 | py | Python | scrapy_statsd_extension/__init__.py | edison7500/scrapy-statsd | 8fd4e77fef675ecd3c788dc036840a9759ba9b12 | [
"BSD-3-Clause"
] | null | null | null | scrapy_statsd_extension/__init__.py | edison7500/scrapy-statsd | 8fd4e77fef675ecd3c788dc036840a9759ba9b12 | [
"BSD-3-Clause"
] | null | null | null | scrapy_statsd_extension/__init__.py | edison7500/scrapy-statsd | 8fd4e77fef675ecd3c788dc036840a9759ba9b12 | [
"BSD-3-Clause"
] | null | null | null | from scrapy import signals
from scrapy.exceptions import NotConfigured
from scrapy.utils.misc import load_object
from twisted.internet.task import LoopingCall
from scrapy_statsd_extension import utils, defaults
class StatsdExtension(object):
def __init__(self, crawler):
if not crawler.settings.getbool("S... | 33.583333 | 83 | 0.691067 |
6b7dbdd19527b4d42da3b48fc2423060847b4831 | 1,549 | py | Python | samples/snippets/import_data_text_classification_single_label_sample_test.py | telpirion/python-aiplatform | 5155dee5edd86fb700a91dfca01bddd4d6393410 | [
"Apache-2.0"
] | null | null | null | samples/snippets/import_data_text_classification_single_label_sample_test.py | telpirion/python-aiplatform | 5155dee5edd86fb700a91dfca01bddd4d6393410 | [
"Apache-2.0"
] | null | null | null | samples/snippets/import_data_text_classification_single_label_sample_test.py | telpirion/python-aiplatform | 5155dee5edd86fb700a91dfca01bddd4d6393410 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 38.725 | 112 | 0.768883 |
d1b0033a45df29a2f73a5aad0eb2132447ad9992 | 2,734 | py | Python | marshmallow_peewee/fields.py | iBelieve/marshmallow-peewee | d9ff33039592ad1a8b1a95c9e16fd806b694858d | [
"MIT"
] | null | null | null | marshmallow_peewee/fields.py | iBelieve/marshmallow-peewee | d9ff33039592ad1a8b1a95c9e16fd806b694858d | [
"MIT"
] | null | null | null | marshmallow_peewee/fields.py | iBelieve/marshmallow-peewee | d9ff33039592ad1a8b1a95c9e16fd806b694858d | [
"MIT"
] | null | null | null | import datetime as dt
from marshmallow import fields
from marshmallow.compat import PY2, string_types
class Timestamp(fields.Field):
default_error_messages = {
'invalid': 'Not a valid timestamp.'
}
def _serialize(self, value, attr, obj):
"""Serialize given datetime to timestamp."""
... | 28.778947 | 75 | 0.61229 |
729409c1df5887ae4070dd3d20323f8c6fa3b527 | 119 | py | Python | bspider/master/__init__.py | littlebai3618/bspider | ff4d003cd0825247db4efe62db95f9245c0a303c | [
"BSD-3-Clause"
] | 3 | 2020-06-19T03:52:29.000Z | 2021-05-21T05:50:46.000Z | bspider/master/__init__.py | littlebai3618/bspider | ff4d003cd0825247db4efe62db95f9245c0a303c | [
"BSD-3-Clause"
] | 2 | 2021-03-31T19:39:03.000Z | 2021-05-12T02:10:26.000Z | bspider/master/__init__.py | littlebai3618/bspider | ff4d003cd0825247db4efe62db95f9245c0a303c | [
"BSD-3-Clause"
] | null | null | null | from bspider.utils.logger import LoggerPool
log = LoggerPool().get_logger(key='master', fn='master', module='master')
| 29.75 | 73 | 0.756303 |
ad32f157d0e694477e009b5a9e3650701787d79e | 13,330 | py | Python | python/paddle/fluid/parallel_executor.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/parallel_executor.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/parallel_executor.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 45.80756 | 99 | 0.611028 |
2f8b0339e49cef0c9aa1ead3b927ea369e81898f | 3,641 | py | Python | Wellcheck/Webapps/api.wellcheck/Object/mail.py | SCcagg5/WellcheckV2 | 5c96a577f460e1f0dee8d3b3c3efc8217d1a2f5b | [
"MIT"
] | 3 | 2020-05-16T19:24:42.000Z | 2020-09-26T17:05:19.000Z | Wellcheck/Webapps/api.wellcheck/Object/mail.py | SCcagg5/WellcheckV2 | 5c96a577f460e1f0dee8d3b3c3efc8217d1a2f5b | [
"MIT"
] | 30 | 2020-05-16T16:01:17.000Z | 2020-10-08T23:05:08.000Z | Wellcheck/Webapps/api.wellcheck/Object/mail.py | WellCheck-Co/WellCheck-Web-App | afa076e6451ebbb055d06f938bb2ecc511cf9b6f | [
"MIT"
] | null | null | null | from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import os
from datetime import datetime
from Source.email.heb_report import *
from Source.email.alerte import *
from Source.email.new_user import *
smtp_user = str(os.getenv('MAILER_USER', None))
smtp_pass ... | 47.285714 | 184 | 0.553694 |
3a286d103a3c363185db3241b5ae7f47200ad1ff | 15,915 | py | Python | colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py | sobotka/colour | aa3fe95fba83ffc0f3ce1eb6aca85e6d8f3bde51 | [
"Cube",
"BSD-3-Clause"
] | 2 | 2020-05-03T20:15:42.000Z | 2021-04-09T18:19:06.000Z | colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py | sobotka/colour | aa3fe95fba83ffc0f3ce1eb6aca85e6d8f3bde51 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py | sobotka/colour | aa3fe95fba83ffc0f3ce1eb6aca85e6d8f3bde51 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ColourCheckers Chromaticity Coordinates
=======================================
Defines *ColourCheckers* chromaticity coordinates in *CIE xyY* colourspace.
Each *ColourChecker* data is in the form of a list of an :class:`OrderedDict`
class instance of 24 samples as follows::
{'name': ... | 39.7875 | 79 | 0.650958 |
c6e8ba5c114096412e99e495ac1f996a6927627c | 6,556 | py | Python | main.py | Starfunk/Climate-Game-Genetic-Algorithm | 89b4f9d4e3b612c589abc3317779a7144fa32c0b | [
"MIT"
] | null | null | null | main.py | Starfunk/Climate-Game-Genetic-Algorithm | 89b4f9d4e3b612c589abc3317779a7144fa32c0b | [
"MIT"
] | null | null | null | main.py | Starfunk/Climate-Game-Genetic-Algorithm | 89b4f9d4e3b612c589abc3317779a7144fa32c0b | [
"MIT"
] | null | null | null | #I employ a genetic algorithm to try to find the collective optimal outcome of the climate game. The climate game is based on
#the paper: "The collective-risk social dilemma and the prevention of simulated dangerous climate change" written by
#Milinski et al. - http://www.pnas.org/content/105/7/2291. I also drew insp... | 33.44898 | 126 | 0.78432 |
788e2a246645ea24b4c95c7c190c73a91412bc41 | 19,746 | py | Python | opm/patch_manager.py | joseagraz/OPM | efb680528f3a3dbf570f4fb12571ed0bc78b4fa9 | [
"BSD-3-Clause"
] | null | null | null | opm/patch_manager.py | joseagraz/OPM | efb680528f3a3dbf570f4fb12571ed0bc78b4fa9 | [
"BSD-3-Clause"
] | null | null | null | opm/patch_manager.py | joseagraz/OPM | efb680528f3a3dbf570f4fb12571ed0bc78b4fa9 | [
"BSD-3-Clause"
] | null | null | null | import concurrent.futures
import os
from functools import partial
from .patch import Patch
from .utils import get_patch_class_proportions
import numpy as np
import openslide
from tqdm import tqdm
class PatchManager:
def __init__(self, filename):
"""
Initialization for PatchManager
@param f... | 46.461176 | 120 | 0.560822 |
e47f1a28b591d5fb5182f565e761df72734131f8 | 8,408 | py | Python | utils/caffe_layers/proposal_target_layer.py | cgiliberto/RESDOG | 5e2603251d8673a9360211b57a51177af63def17 | [
"MIT"
] | 1 | 2020-04-03T09:14:48.000Z | 2020-04-03T09:14:48.000Z | utils/caffe_layers/proposal_target_layer.py | cgiliberto/RESDOG | 5e2603251d8673a9360211b57a51177af63def17 | [
"MIT"
] | 15 | 2020-01-28T21:50:59.000Z | 2022-03-11T23:19:14.000Z | utils/caffe_layers/proposal_target_layer.py | cgiliberto/RESDOG | 5e2603251d8673a9360211b57a51177af63def17 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
#import caffe
import yaml
import numpy as np
... | 39.660377 | 107 | 0.633801 |
727cafedc80ae8e7e6968b8bdb44de73247b7015 | 11,032 | py | Python | tests/validation/test_known_directives.py | patrys/graphql-core-next | f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b | [
"MIT"
] | null | null | null | tests/validation/test_known_directives.py | patrys/graphql-core-next | f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b | [
"MIT"
] | 3 | 2021-03-20T05:19:34.000Z | 2021-06-02T03:27:28.000Z | tests/validation/test_known_directives.py | patrys/graphql-core-next | f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b | [
"MIT"
] | null | null | null | from functools import partial
from graphql.utilities import build_schema
from graphql.validation import KnownDirectivesRule
from graphql.validation.rules.known_directives import (
unknown_directive_message,
misplaced_directive_message,
)
from .harness import expect_fails_rule, expect_passes_rule, expect_sdl_e... | 29.340426 | 97 | 0.443709 |
1bdc1d9af32c53f78e07571fd585d68115870d8d | 2,226 | py | Python | venv/lib/python3.6/site-packages/bioblend/_tests/TestGalaxyQuotas.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 51 | 2015-01-23T20:45:01.000Z | 2022-01-31T10:46:31.000Z | bioblend/_tests/TestGalaxyQuotas.py | violethaze74/galaxy | 18ac5bdba333810fb10972daf60c9543e26aa236 | [
"MIT"
] | 288 | 2015-01-22T21:01:31.000Z | 2022-03-14T09:09:25.000Z | bioblend/_tests/TestGalaxyQuotas.py | violethaze74/galaxy | 18ac5bdba333810fb10972daf60c9543e26aa236 | [
"MIT"
] | 87 | 2015-02-02T06:31:54.000Z | 2022-03-31T02:39:31.000Z | import uuid
from . import GalaxyTestBase
class TestGalaxyQuotas(GalaxyTestBase.GalaxyTestBase):
def setUp(self):
super().setUp()
# Quota names must be unique, and they're impossible to delete
# without accessing the database.
self.quota_name = f"BioBlend-Test-Quota-{uuid.uuid4().... | 39.75 | 109 | 0.632075 |
3348223f02520d1576aa534204cbe038ba6570fa | 221 | py | Python | src/dftinputgen/qe/settings/__init__.py | aced-differentiate/dft-input-gen | 14bee323517714c433682bad2dcb897b223dd5ec | [
"Apache-2.0"
] | 1 | 2021-04-15T09:54:52.000Z | 2021-04-15T09:54:52.000Z | src/dftinputgen/qe/settings/__init__.py | CitrineInformatics/dft-input-gen | 14bee323517714c433682bad2dcb897b223dd5ec | [
"Apache-2.0"
] | 1 | 2021-01-28T22:12:07.000Z | 2021-01-28T22:12:07.000Z | src/dftinputgen/qe/settings/__init__.py | aced-differentiate/dft-input-gen | 14bee323517714c433682bad2dcb897b223dd5ec | [
"Apache-2.0"
] | 2 | 2020-12-08T18:14:13.000Z | 2020-12-18T19:01:11.000Z | import json
import pkg_resources
__all__ = ["QE_TAGS"]
tags_file = pkg_resources.resource_filename(
"dftinputgen.qe.settings", "tags_and_groups.json"
)
with open(tags_file, "r") as fr:
QE_TAGS = json.load(fr)
| 17 | 53 | 0.728507 |
1fc28604e4b5c97c362311883c99e39f2c8f4b5e | 248 | py | Python | prog 47.py | shailaja0221/gethub | 883a1c96ee5d5d09224b4736fb2e1378c80c5dae | [
"MIT"
] | null | null | null | prog 47.py | shailaja0221/gethub | 883a1c96ee5d5d09224b4736fb2e1378c80c5dae | [
"MIT"
] | null | null | null | prog 47.py | shailaja0221/gethub | 883a1c96ee5d5d09224b4736fb2e1378c80c5dae | [
"MIT"
] | null | null | null |
m=int(input())
l=list(map(int,input().split()))
b=l[0]
for i in range(m):
for j in range(i+1,m):
if(b<l[j]):
b=l[j]
c=l[0]
for i in range(m):
for j in range(i+1,m):
if(c>l[j]):
c=l[j]
print(c,b)
| 16.533333 | 32 | 0.447581 |
46a7c6488427e0c8475c76f58b5db2846948ea79 | 650 | py | Python | photos/admin.py | kmollee/gallery | cb54d8bddb184b35f6d62c17b44b311617b76b4f | [
"MIT"
] | 2 | 2018-05-04T06:18:37.000Z | 2021-01-12T13:16:08.000Z | photos/admin.py | kmollee/gallery | cb54d8bddb184b35f6d62c17b44b311617b76b4f | [
"MIT"
] | null | null | null | photos/admin.py | kmollee/gallery | cb54d8bddb184b35f6d62c17b44b311617b76b4f | [
"MIT"
] | null | null | null | from django.contrib import admin
from photos.models import Person, Location, Album, Photo, Thumbnail
class NameOnlyAdmin(admin.ModelAdmin):
list_display = ['name', ]
class AlbumAdmin(admin.ModelAdmin):
list_display = ['name', 'month', 'year', 'location', ]
class ThumbnailInline(admin.TabularInline):
... | 23.214286 | 67 | 0.733846 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.