hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a1fc681e95aa865f1229d3b611a0ed6145ffd67 | 481 | py | Python | assets/Poser/Reality/Runtime/Libraries/light/Reality/SingleIBLs/LineSingleH/Large/LineSingleH_Large_00.py | Red54/reality | 510d4f5fde2f4c5535482f1ea199f914102b8a2a | [
"BSD-3-Clause"
] | null | null | null | assets/Poser/Reality/Runtime/Libraries/light/Reality/SingleIBLs/LineSingleH/Large/LineSingleH_Large_00.py | Red54/reality | 510d4f5fde2f4c5535482f1ea199f914102b8a2a | [
"BSD-3-Clause"
] | null | null | null | assets/Poser/Reality/Runtime/Libraries/light/Reality/SingleIBLs/LineSingleH/Large/LineSingleH_Large_00.py | Red54/reality | 510d4f5fde2f4c5535482f1ea199f914102b8a2a | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) Pret-a-3D/Paolo Ciccone. All rights reserved.
# Modified by Fuzzy70/Lee Furssedonn with kind permission from Paolo Ciccone
#
from Reality_services import *
from Reality import *
# To customize this script all you need to do is to
# change the following variable
Re_sIBL_Map = ":Runtime:Text... | 32.066667 | 90 | 0.767152 |
4a1fc6e90cc453bd214d46a4ad82a8f7d553f191 | 786 | py | Python | electrum/scripts/get_history.py | asuka431/electrum | 144b19660451bbbdc8314ac8fccd6e79fdf3a4b1 | [
"MIT"
] | null | null | null | electrum/scripts/get_history.py | asuka431/electrum | 144b19660451bbbdc8314ac8fccd6e79fdf3a4b1 | [
"MIT"
] | null | null | null | electrum/scripts/get_history.py | asuka431/electrum | 144b19660451bbbdc8314ac8fccd6e79fdf3a4b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import asyncio
from electrum import bitcoin
from electrum.network import Network
from electrum.util import json_encode, print_msg, create_and_start_event_loop, log_exceptions
from electrum.simple_config import SimpleConfig
try:
addr = sys.argv[1]
except Exception:
print("us... | 23.117647 | 93 | 0.755725 |
4a1fc78bc864df2911f9bb2226904ef8c569a363 | 31,257 | py | Python | tools/space.py | zjy8006/MonthlyRunoffForecastByAutoReg | 661fcb5dcdfbbb2ec6861e1668a035b50e69f7c2 | [
"MIT"
] | 2 | 2020-05-18T06:45:04.000Z | 2021-05-18T06:38:23.000Z | tools/space.py | zjy8006/MonthlyRunoffForecastByAutoReg | 661fcb5dcdfbbb2ec6861e1668a035b50e69f7c2 | [
"MIT"
] | null | null | null | tools/space.py | zjy8006/MonthlyRunoffForecastByAutoReg | 661fcb5dcdfbbb2ec6861e1668a035b50e69f7c2 | [
"MIT"
] | 1 | 2020-01-17T02:56:18.000Z | 2020-01-17T02:56:18.000Z | import numbers
import numpy as np
import yaml
from scipy.stats.distributions import randint
from scipy.stats.distributions import rv_discrete
from scipy.stats.distributions import uniform
from sklearn.utils import check_random_state
from sklearn.utils.fixes import sp_version
from .transformers import CategoricalEnco... | 35.886338 | 79 | 0.566657 |
4a1fc7d60f3ddb63481c3d7e849e37f2277cb291 | 16,338 | py | Python | sympy/functions/elementary/tests/test_exponential.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/tests/test_exponential.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/tests/test_exponential.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | from sympy import (
symbols, log, ln, Float, nan, oo, zoo, I, pi, E, exp, Symbol,
LambertW, sqrt, Rational, expand_log, S, sign, conjugate, refine,
sin, cos, sinh, cosh, tanh, exp_polar, re, Function, simplify,
AccumBounds, MatrixSymbol, Pow)
from sympy.abc import x, y, z
from sympy.core.expr import unc... | 31.724272 | 96 | 0.579753 |
4a1fcaf2f4742b4421b03272125e622a9e9c5fe6 | 8,128 | py | Python | tests/test_grammar.py | rium9/mlangpy | 75821306b15d72278220d2a1a403daa36f60cc4a | [
"MIT"
] | 1 | 2020-04-20T20:23:31.000Z | 2020-04-20T20:23:31.000Z | tests/test_grammar.py | rium9/mlangpy | 75821306b15d72278220d2a1a403daa36f60cc4a | [
"MIT"
] | null | null | null | tests/test_grammar.py | rium9/mlangpy | 75821306b15d72278220d2a1a403daa36f60cc4a | [
"MIT"
] | null | null | null | from unittest import TestCase
from mlangpy.grammar import *
class TestSymbol(TestCase):
def setUp(self):
class TSym(Symbol):
pass
class NSym(Symbol):
def __init__(self, subject):
super().__init__(subject, left_bound='/', right_bound='/')
self.TSym... | 28.027586 | 93 | 0.551796 |
4a1fcb0a26d4e858532b033f5f5cd22ff55f149f | 307 | py | Python | contrib_lib/settings.py | DHI/ifm_contrib | 443c3a86960990115887855a2f4adac07797fc35 | [
"MIT"
] | 9 | 2018-09-28T12:01:24.000Z | 2021-10-07T15:17:51.000Z | contrib_lib/settings.py | DHI/ifm_contrib | 443c3a86960990115887855a2f4adac07797fc35 | [
"MIT"
] | 11 | 2019-10-23T13:25:07.000Z | 2022-03-21T21:11:42.000Z | contrib_lib/settings.py | DHI/ifm_contrib | 443c3a86960990115887855a2f4adac07797fc35 | [
"MIT"
] | 7 | 2019-04-23T11:01:51.000Z | 2021-08-24T13:33:06.000Z | from ifm import Enum
from .settings_pandas import SettingsPd
class Settings:
"""
Functions for reading and writing global settings
"""
def __init__(self, doc):
self.doc = doc
# add custom child-classes here
self.df = SettingsPd(doc)
# add custom methods here
| 19.1875 | 53 | 0.651466 |
4a1fcbab1c56d6fd714abd8de8dea57f24de3de2 | 2,069 | py | Python | run_video.py | macropusgiganteus/neph_pose_estimation | aecb8a932248181ade1c7e5b2f3b2d668def327a | [
"Apache-2.0"
] | null | null | null | run_video.py | macropusgiganteus/neph_pose_estimation | aecb8a932248181ade1c7e5b2f3b2d668def327a | [
"Apache-2.0"
] | null | null | null | run_video.py | macropusgiganteus/neph_pose_estimation | aecb8a932248181ade1c7e5b2f3b2d668def327a | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import time
import cv2
import numpy as np
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
logger = logging.getLogger('TfPoseEstimator-Video')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
forma... | 36.298246 | 141 | 0.685355 |
4a1fcd41466300627710edd4bcd5a6aa297521ae | 3,296 | py | Python | doc/source/conf.py | munnaeebd/openstack-helm | 0a1d6aeb94937a4be49b29b5387c4ad7791eecfd | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | munnaeebd/openstack-helm | 0a1d6aeb94937a4be49b29b5387c4ad7791eecfd | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | munnaeebd/openstack-helm | 0a1d6aeb94937a4be49b29b5387c4ad7791eecfd | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 34.333333 | 79 | 0.718447 |
4a1fcfc7645d735e9fa6ae12e244df026f025358 | 1,950 | py | Python | tools/cli_usage.py | mtag-dev/esg | f01e8caef23abb54ebc0db5279cbee3006dffa05 | [
"BSD-3-Clause"
] | 3 | 2022-01-11T19:04:37.000Z | 2022-01-12T16:03:10.000Z | tools/cli_usage.py | mtag-dev/esg | f01e8caef23abb54ebc0db5279cbee3006dffa05 | [
"BSD-3-Clause"
] | 4 | 2022-01-07T11:46:36.000Z | 2022-01-31T00:23:41.000Z | tools/cli_usage.py | mtag-dev/esg | f01e8caef23abb54ebc0db5279cbee3006dffa05 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T19:07:17.000Z | 2022-01-11T19:07:17.000Z | """
Look for a marker comment in docs pages, and place the output of
`$ esg --help` there. Pass `--check` to ensure the content is in sync.
"""
import argparse
import subprocess
import sys
import typing
from pathlib import Path
def _get_usage_lines() -> typing.List[str]:
res = subprocess.run(["esg", "--help"], st... | 27.464789 | 86 | 0.607692 |
4a1fcff2e3f524fbe92cf616797fb7b3c219dda7 | 352 | py | Python | docs/examples/sentinel.py | laggardkernel/aioredis-py | 9d71774d7fa5864160f0f3824feda154b2cc0e0e | [
"MIT"
] | 1,777 | 2015-01-25T17:26:56.000Z | 2021-03-18T08:39:55.000Z | docs/examples/sentinel.py | laggardkernel/aioredis-py | 9d71774d7fa5864160f0f3824feda154b2cc0e0e | [
"MIT"
] | 754 | 2015-02-22T13:36:08.000Z | 2021-03-18T23:11:21.000Z | docs/examples/sentinel.py | seedofjoy/aioredis | 2f217e114a395b73d77952172eab4abeaa0dd2ff | [
"MIT"
] | 314 | 2015-02-24T20:18:46.000Z | 2021-03-13T01:47:06.000Z | import asyncio
import aioredis.sentinel
async def main():
sentinel_client = aioredis.sentinel.Sentinel([("localhost", 26379)])
master_redis: aioredis.Redis = sentinel_client.master_for("mymaster")
info = await master_redis.sentinel_master("mymaster")
print("Master role:", info)
if __name__ == "__m... | 22 | 73 | 0.71875 |
4a1fcffc310ca5b692fa89d8b5ae81bbbfb80447 | 3,447 | py | Python | certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy/_internal/dns_dnsmadeeasy.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | 5 | 2021-01-26T08:47:29.000Z | 2021-01-30T00:42:12.000Z | certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy/_internal/dns_dnsmadeeasy.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | 2 | 2019-11-20T07:08:26.000Z | 2020-11-05T23:31:48.000Z | certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy/_internal/dns_dnsmadeeasy.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | 1 | 2021-09-24T22:22:11.000Z | 2021-09-24T22:22:11.000Z | """DNS Authenticator for DNS Made Easy DNS."""
import logging
from lexicon.providers import dnsmadeeasy
import zope.interface
from certbot import errors
from certbot import interfaces
from certbot.plugins import dns_common
from certbot.plugins import dns_common_lexicon
logger = logging.getLogger(__name__)
ACCOUNT_U... | 37.064516 | 100 | 0.64984 |
4a1fd0270d01f795724e8ea0f47bd48c033d8777 | 9,801 | py | Python | models/base_model.py | matansudry/DL_hw2 | 20f776cb6e41768e167d9d21af9afbd50cab60e6 | [
"MIT"
] | null | null | null | models/base_model.py | matansudry/DL_hw2 | 20f776cb6e41768e167d9d21af9afbd50cab60e6 | [
"MIT"
] | null | null | null | models/base_model.py | matansudry/DL_hw2 | 20f776cb6e41768e167d9d21af9afbd50cab60e6 | [
"MIT"
] | null | null | null | from abc import ABCMeta
import torch
from torch import nn, Tensor
import itertools as it
from torch.nn.utils.rnn import pack_padded_sequence
import torch.nn.init as init
import torch.nn.functional as F
class ResidualBlock(nn.Module):
"""
"""
def __init__(
self,
in_channels: int,
cha... | 37.408397 | 133 | 0.59851 |
4a1fd0cdf84ad40719b58c62c0b99b82b790cb89 | 4,141 | py | Python | examples/classify/semi_supervised/img/scripts/create_split.py | parmarsuraj99/objax | 111cd78960f5812885505b5ec02552b98a789973 | [
"Apache-2.0"
] | 2 | 2021-02-23T18:23:40.000Z | 2022-03-09T09:38:37.000Z | examples/classify/semi_supervised/img/scripts/create_split.py | parmarsuraj99/objax | 111cd78960f5812885505b5ec02552b98a789973 | [
"Apache-2.0"
] | null | null | null | examples/classify/semi_supervised/img/scripts/create_split.py | parmarsuraj99/objax | 111cd78960f5812885505b5ec02552b98a789973 | [
"Apache-2.0"
] | 1 | 2020-09-20T23:56:29.000Z | 2020-09-20T23:56:29.000Z | #!/usr/bin/env python
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.973214 | 120 | 0.64453 |
4a1fd20afc0cf18c151b13e5309a361277d12563 | 64,318 | py | Python | python/paddle/fluid/incubate/fleet/utils/fleet_util.py | pyqt1/MyPaddle | 72ef733ad58b958c519b9db9a44e8716a82401d9 | [
"Apache-2.0"
] | 1 | 2020-02-21T02:26:47.000Z | 2020-02-21T02:26:47.000Z | python/paddle/fluid/incubate/fleet/utils/fleet_util.py | pyqt1/MyPaddle | 72ef733ad58b958c519b9db9a44e8716a82401d9 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/incubate/fleet/utils/fleet_util.py | pyqt1/MyPaddle | 72ef733ad58b958c519b9db9a44e8716a82401d9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 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... | 39.751545 | 104 | 0.520181 |
4a1fd20d8cbbf1ad85e8e5520c666ed5ab06702e | 6,774 | py | Python | deprecated/examples/dist_test/train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/examples/dist_test/train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/examples/dist_test/train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import numpy as np
import argparse
import paddle
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy
from paddle.fluid.incubate.fleet.base import role_maker
import model
import utils
parser ... | 36.616216 | 95 | 0.711544 |
4a1fd244add56d18910e3cc58aa40a55350395d3 | 2,427 | py | Python | ext/ws/rs/core/__init__.py | mariano-git/plugin.video.flow | a63362f308c1e67ba532acf9ba4eced95a243f49 | [
"MIT"
] | 3 | 2022-01-19T00:27:24.000Z | 2022-03-24T15:15:24.000Z | ext/ws/rs/core/__init__.py | mariano-git/plugin.video.flow | a63362f308c1e67ba532acf9ba4eced95a243f49 | [
"MIT"
] | 3 | 2021-12-30T06:05:30.000Z | 2022-01-19T02:52:21.000Z | ext/ws/rs/core/__init__.py | mariano-git/plugin.video.flow | a63362f308c1e67ba532acf9ba4eced95a243f49 | [
"MIT"
] | null | null | null | from enum import Enum
class MediaType:
APPLICATION_JSON = 'application/json'
TEXT_PLAIN = 'text/plain'
class Status(Enum):
def __init__(self, code, reason):
self.code = code
self.reason = reason
OK = (200, "OK")
CREATED = (201, "Created")
ACCEPTED = (202, "Accepted")
... | 23.114286 | 78 | 0.65925 |
4a1fd3302e80b14efcffbfe59178228748d3e466 | 2,666 | py | Python | neutron/plugins/ml2/extensions/qos.py | rolaya/neutron | 49f6773998ce8e8c68197a853d7f12e5e9dc6df5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/extensions/qos.py | rolaya/neutron | 49f6773998ce8e8c68197a853d7f12e5e9dc6df5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/extensions/qos.py | rolaya/neutron | 49f6773998ce8e8c68197a853d7f12e5e9dc6df5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Red Hat Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 42.31746 | 86 | 0.705551 |
4a1fd371969f4c33eb7efa3a6ea0a91abab62491 | 837 | py | Python | tests/test_md5.py | petitnau/crypy | 05bacef2cc169359c2a957bb4964f0f0416e2ead | [
"MIT"
] | null | null | null | tests/test_md5.py | petitnau/crypy | 05bacef2cc169359c2a957bb4964f0f0416e2ead | [
"MIT"
] | null | null | null | tests/test_md5.py | petitnau/crypy | 05bacef2cc169359c2a957bb4964f0f0416e2ead | [
"MIT"
] | null | null | null | from crypy.hash.md5 import MD5
def test_md5_extend():
secret = b"123SECRET"
msg = b"messaggio normale"
h = MD5(secret+msg)
h.test()
dig = h.digest()
base, h_clone = MD5.clone(len(secret), msg, dig)
extension = b"extended"
h_clone.update(extension)
tot_msg = base+extension
ass... | 25.363636 | 99 | 0.628435 |
4a1fd37ec8d6a8a7f1afd1d8410741b53083b5d0 | 655,663 | py | Python | Python36_x86_Template/Lib/pydoc_data/topics.py | iveskim/cloudbase-init-installer | bc7630a7fb7dd527618dac3938147e2d9439c285 | [
"Apache-2.0"
] | null | null | null | Python36_x86_Template/Lib/pydoc_data/topics.py | iveskim/cloudbase-init-installer | bc7630a7fb7dd527618dac3938147e2d9439c285 | [
"Apache-2.0"
] | null | null | null | Python36_x86_Template/Lib/pydoc_data/topics.py | iveskim/cloudbase-init-installer | bc7630a7fb7dd527618dac3938147e2d9439c285 | [
"Apache-2.0"
] | 4 | 2019-12-11T18:50:22.000Z | 2020-08-10T19:25:11.000Z | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Tue Jun 12 00:16:23 2018
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
'Assert statements are a convenient way to insert debugging '
'assertions\n'
'into a program:\n'
... | 50.180851 | 119 | 0.429521 |
4a1fd5da9f04dda336f8393060407a6bfe2b31c3 | 14,136 | py | Python | cirq-core/cirq/sim/sparse_simulator.py | Zshan0/Cirq | 93bbaa853305faa65117bcbdc2063f741cb2977c | [
"Apache-2.0"
] | 1 | 2020-06-11T19:31:25.000Z | 2020-06-11T19:31:25.000Z | cirq-core/cirq/sim/sparse_simulator.py | Zshan0/Cirq | 93bbaa853305faa65117bcbdc2063f741cb2977c | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/sim/sparse_simulator.py | Zshan0/Cirq | 93bbaa853305faa65117bcbdc2063f741cb2977c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 41.576471 | 98 | 0.653509 |
4a1fd610012ad54cce222cd1775448a1288cd4fc | 377 | py | Python | RiskQuantLib/Property/average.py | SyuyaMurakami/RiskQuantLib-Doc | 2503befc24c2e422e51f8b9f468c8d8439e11c65 | [
"MIT"
] | 1 | 2021-12-29T12:18:45.000Z | 2021-12-29T12:18:45.000Z | RiskQuantLib/Property/average.py | SyuyaMurakami/RiskQuantLib-Doc | 2503befc24c2e422e51f8b9f468c8d8439e11c65 | [
"MIT"
] | null | null | null | RiskQuantLib/Property/average.py | SyuyaMurakami/RiskQuantLib-Doc | 2503befc24c2e422e51f8b9f468c8d8439e11c65 | [
"MIT"
] | 1 | 2021-12-08T02:14:34.000Z | 2021-12-08T02:14:34.000Z | #!/usr/bin/python
#coding = utf-8
class average:
"""
This is the base class of average. Inherit from this class will make
attribute into the average version.
"""
def __init__(self,numberOfSamplesNum):
self.numberOfSamples = numberOfSamplesNum
def setNumberOfSamples(self,numberOfSamples... | 25.133333 | 72 | 0.713528 |
4a1fd6204590cd10b6faa498624ae943476c1b47 | 14,632 | py | Python | pysat/pb.py | mvcisback/pysat | 5326a96af2bac1804c7e173f6d7d01f42e86ab4f | [
"MIT"
] | null | null | null | pysat/pb.py | mvcisback/pysat | 5326a96af2bac1804c7e173f6d7d01f42e86ab4f | [
"MIT"
] | null | null | null | pysat/pb.py | mvcisback/pysat | 5326a96af2bac1804c7e173f6d7d01f42e86ab4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## pb.py
##
## Created on: Mar 13, 2019
## Author: Alexey S. Ignatiev
## E-mail: aignatiev@ciencias.ulisboa.pt
##
"""
===============
List of classes
===============
.. autosummary::
:nosignatures:
EncType
PBEnc
==... | 38.104167 | 132 | 0.576886 |
4a1fd6abc4048fe2ccb81204b575ac88467742d3 | 2,116 | py | Python | yql/api/_api_request.py | sourcepirate/yql | 16ebf3674cef74e0b15e026dbcb69d500e3cafd9 | [
"MIT"
] | 1 | 2015-10-26T09:26:14.000Z | 2015-10-26T09:26:14.000Z | yql/api/_api_request.py | plasmashadow/yql | 16ebf3674cef74e0b15e026dbcb69d500e3cafd9 | [
"MIT"
] | 2 | 2015-09-17T03:04:42.000Z | 2016-11-27T03:34:31.000Z | yql/api/_api_request.py | sourcepirate/yql | 16ebf3674cef74e0b15e026dbcb69d500e3cafd9 | [
"MIT"
] | 4 | 2015-08-24T11:25:14.000Z | 2016-11-10T04:30:29.000Z |
from requests import Session
from yql._builder import _YQLBuilder
from ._api_response import _Api_Response
from six.moves.urllib.parse import urlencode
import json
_yahoo_api = 'https://query.yahooapis.com/v1/public/yql'
class _Api_Request(Session):
'''
A new Request of object for creating a
new api ses... | 25.804878 | 82 | 0.61673 |
4a1fd761923dcb78f9dbc0ca829482151609465b | 3,371 | py | Python | skl2onnx/operator_converters/decision_tree.py | vinitra-zz/sklearn-onnx | a8f2657525d0b4dd279bcd1a971397d002929a77 | [
"MIT"
] | null | null | null | skl2onnx/operator_converters/decision_tree.py | vinitra-zz/sklearn-onnx | a8f2657525d0b4dd279bcd1a971397d002929a77 | [
"MIT"
] | null | null | null | skl2onnx/operator_converters/decision_tree.py | vinitra-zz/sklearn-onnx | a8f2657525d0b4dd279bcd1a971397d002929a77 | [
"MIT"
] | 1 | 2020-10-01T09:26:27.000Z | 2020-10-01T09:26:27.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import nu... | 41.617284 | 78 | 0.690003 |
4a1fd989d452e7603a30dba0225b62e0c2311340 | 11,304 | py | Python | Char5 PPO/PPO_agent.py | rh01/Deep-reinforcement-learning-with-pytorch | fd1853495b885514927c82834f562d2a4df06b28 | [
"MIT"
] | null | null | null | Char5 PPO/PPO_agent.py | rh01/Deep-reinforcement-learning-with-pytorch | fd1853495b885514927c82834f562d2a4df06b28 | [
"MIT"
] | null | null | null | Char5 PPO/PPO_agent.py | rh01/Deep-reinforcement-learning-with-pytorch | fd1853495b885514927c82834f562d2a4df06b28 | [
"MIT"
] | 2 | 2021-05-25T06:40:50.000Z | 2021-09-20T12:38:55.000Z | # coding:utf-8
# PPO implement for war_game
import torch
import torch.nn as nn
from torch import optim
from torch.optim import Adam
from torch.nn import functional as F
from tensorboardX import SummaryWriter
from torch.distributions import Categorical
from torch.nn.functional import smooth_l1_loss
import sys,os,sc... | 48.307692 | 144 | 0.570152 |
4a1fda74c03e3193b2cba3e5d7aef1e654406dff | 4,622 | py | Python | ait/core/server/stream.py | robschneider16/AIT-Core | 628e7f60041c4929b82e55dad1a576fc1e8e5e9f | [
"MIT"
] | 1 | 2019-07-29T20:18:34.000Z | 2019-07-29T20:18:34.000Z | ait/core/server/stream.py | seanlu99/AIT-Core | d746079bcff574d930f633bee59337eabf54e99c | [
"MIT"
] | null | null | null | ait/core/server/stream.py | seanlu99/AIT-Core | d746079bcff574d930f633bee59337eabf54e99c | [
"MIT"
] | null | null | null | import ait.core.log
from client import ZMQInputClient, PortInputClient, PortOutputClient
class Stream(object):
"""
This is the base Stream class that all streams will inherit from.
It calls its handlers to execute on all input messages sequentially,
and validates the handler workflow if handler input ... | 37.577236 | 106 | 0.581783 |
4a1fdb331c580272aad28db8a7894ac35a049dc5 | 3,191 | py | Python | deeppavlov/models/morpho_tagger/common.py | khakhulin/DeepPavlov | 5f631cc887aa935f2e67b7c65a19c7e777cf7db7 | [
"Apache-2.0"
] | null | null | null | deeppavlov/models/morpho_tagger/common.py | khakhulin/DeepPavlov | 5f631cc887aa935f2e67b7c65a19c7e777cf7db7 | [
"Apache-2.0"
] | null | null | null | deeppavlov/models/morpho_tagger/common.py | khakhulin/DeepPavlov | 5f631cc887aa935f2e67b7c65a19c7e777cf7db7 | [
"Apache-2.0"
] | null | null | null | import re
from pathlib import Path
from deeppavlov.core.commands.infer import build_model_from_config
from deeppavlov.core.commands.utils import set_deeppavlov_root, expand_path
from deeppavlov.core.common.file import read_json
from deeppavlov.core.common.params import from_params
from deeppavlov.core.common.registry ... | 34.311828 | 92 | 0.648073 |
4a1fdc9493cfd33f29d0593636d5d83b9585d5a1 | 1,558 | py | Python | pubgate/utils/cached.py | autogestion/pubgate | e9a1850a60bb34aac59542b97f730c08dc8d46fa | [
"BSD-3-Clause"
] | 79 | 2018-06-23T23:20:20.000Z | 2022-03-22T18:33:37.000Z | pubgate/utils/cached.py | autogestion/pubgate | e9a1850a60bb34aac59542b97f730c08dc8d46fa | [
"BSD-3-Clause"
] | 25 | 2018-11-03T10:14:06.000Z | 2021-01-20T22:33:14.000Z | pubgate/utils/cached.py | autogestion/pubgate | e9a1850a60bb34aac59542b97f730c08dc8d46fa | [
"BSD-3-Clause"
] | 5 | 2018-11-03T10:11:36.000Z | 2020-03-19T14:34:05.000Z | from pubgate import BaseUrl
from pubgate.db import Inbox, User, Outbox
from pubgate.utils.networking import fetch
def cached_mode(request):
if (request.args.get('cached')
and request.app.config.get('APPLY_CASHING')):
return True
async def ensure_inbox(object_id):
# TODO also fetch and ca... | 31.16 | 78 | 0.658537 |
4a1fdc96f0a826d83b1f5b838320fe1bfec7b5f1 | 1,879 | py | Python | limacharlie/__init__.py | macdaliot/python-limacharlie | dc8011418f09d3acc0ebce5ea3afb98e4b7f600f | [
"Apache-2.0"
] | null | null | null | limacharlie/__init__.py | macdaliot/python-limacharlie | dc8011418f09d3acc0ebce5ea3afb98e4b7f600f | [
"Apache-2.0"
] | null | null | null | limacharlie/__init__.py | macdaliot/python-limacharlie | dc8011418f09d3acc0ebce5ea3afb98e4b7f600f | [
"Apache-2.0"
] | null | null | null | """limacharlie API for limacharlie.io"""
__version__ = "2.4.0"
__author__ = "Maxime Lamothe-Brassard ( Refraction Point, Inc )"
__author_email__ = "maxime@refractionpoint.com"
__license__ = "Apache v2"
__copyright__ = "Copyright (c) 2018 Refraction Point, Inc"
# Global API Credentials
import os
import yaml
# Global ... | 41.755556 | 148 | 0.657265 |
4a1fdcac9a0c46350cd16ea5b93621177365317d | 1,085 | py | Python | update_scripts/regression.py | Gaurang484/COVID-19-DataVisualization | 88d4b68fce589d004f3e01602b30cfc46ac97753 | [
"MIT"
] | null | null | null | update_scripts/regression.py | Gaurang484/COVID-19-DataVisualization | 88d4b68fce589d004f3e01602b30cfc46ac97753 | [
"MIT"
] | null | null | null | update_scripts/regression.py | Gaurang484/COVID-19-DataVisualization | 88d4b68fce589d004f3e01602b30cfc46ac97753 | [
"MIT"
] | null | null | null | import numpy as maths
def lin_reg(*series):
'''Fits the data (x, y) to the equation y = ax + b and returns (a, b)'''
if(len(series)) == 1:
y = series[0]
x = [index for index in range(len(y))]
else:
x, y = series
x_ = maths.sum(x) / len(x)
y_ = maths.sum(y) / len(y)
xy_ = maths.dot(x - x_, y - y_)
xx_ = ... | 29.324324 | 118 | 0.590783 |
4a1fdf14f0be3c8a41dfed3ca95901c4b395fea7 | 6,254 | py | Python | test/functional/rpc_spentindex.py | valuero-org/valuero | c0a8d40d377c39792e5a79d4a67f00bc592aef87 | [
"MIT"
] | null | null | null | test/functional/rpc_spentindex.py | valuero-org/valuero | c0a8d40d377c39792e5a79d4a67f00bc592aef87 | [
"MIT"
] | null | null | null | test/functional/rpc_spentindex.py | valuero-org/valuero | c0a8d40d377c39792e5a79d4a67f00bc592aef87 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Copyright (c) 2018-2019 The Rito Core developers
# Copyright (c) 2019 The Valuero developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.... | 42.544218 | 104 | 0.644867 |
4a1fdf8524c34406cd29ab3eddcaa86b41059938 | 474 | py | Python | ignition/script-python/pidbotscripts/utils/data_mapping/code.py | jlbcontrols/pidbot-manager | 42dbc4487120aa7ea4405aec023b79955683ba31 | [
"MIT"
] | 3 | 2020-10-17T02:47:34.000Z | 2021-10-31T08:14:39.000Z | ignition/script-python/pidbotscripts/utils/data_mapping/code.py | jlbcontrols/pidbot-manager | 42dbc4487120aa7ea4405aec023b79955683ba31 | [
"MIT"
] | 2 | 2020-11-11T19:13:51.000Z | 2020-11-11T19:14:54.000Z | ignition/script-python/pidbotscripts/utils/data_mapping/code.py | jlbcontrols/pidbot-manager | 42dbc4487120aa7ea4405aec023b79955683ba31 | [
"MIT"
] | null | null | null | def listToColumnDs(list,header="values"):
headers = [header]
data = [[item] for item in list]
return system.dataset.toDataSet(headers,data)
def dictToRowDs(dict):
row = []
headers = []
for key, value in dict.items():
headers.append(key)
row.append(value)
return system.dataset.toDataSet(headers,[row])
def r... | 26.333333 | 62 | 0.721519 |
4a1fdf9357fe73f62e5e7f64d0f47ce820cbef3c | 5,700 | py | Python | src/schemathesis/specs/graphql/schemas.py | schemathesis/schemathesis | 5684c826fc16cefed956a30ec587b7271da86381 | [
"MIT"
] | 659 | 2020-09-03T13:27:50.000Z | 2022-03-31T17:07:16.000Z | src/schemathesis/specs/graphql/schemas.py | schemathesis/schemathesis | 5684c826fc16cefed956a30ec587b7271da86381 | [
"MIT"
] | 570 | 2020-09-03T15:57:43.000Z | 2022-03-31T17:13:52.000Z | src/schemathesis/specs/graphql/schemas.py | schemathesis/schemathesis | 5684c826fc16cefed956a30ec587b7271da86381 | [
"MIT"
] | 66 | 2020-09-05T07:09:03.000Z | 2022-03-17T08:17:55.000Z | from functools import partial
from typing import Any, Dict, Generator, List, Optional, Sequence, Tuple, Type, TypeVar, Union, cast
from urllib.parse import urlsplit
import attr
import graphql
import requests
from hypothesis import strategies as st
from hypothesis.strategies import SearchStrategy
from hypothesis_graphq... | 37.012987 | 113 | 0.640175 |
4a1fe0dccad6101273e473887ee5da60e271907f | 12,571 | py | Python | lxmls/readers/galton.py | SimonSuster/lxmls-toolkit | 6a57884f8b7c98da816a60eb88593e0a1585d434 | [
"MIT"
] | 1 | 2015-09-20T05:16:38.000Z | 2015-09-20T05:16:38.000Z | lxmls/readers/galton.py | daviddao/LxMLS-labs-solution | 78413c1ee61752ca33988c454e3b2c27326e7063 | [
"MIT"
] | null | null | null | lxmls/readers/galton.py | daviddao/LxMLS-labs-solution | 78413c1ee61752ca33988c454e3b2c27326e7063 | [
"MIT"
] | null | null | null | import numpy as np
_data = np.array([
[70.5,61.7], [68.5,61.7], [65.5,61.7], [64.5,61.7], [64,61.7], [67.5,62.2], [67.5,62.2], [67.5,62.2],
[66.5,62.2], [66.5,62.2], [66.5,62.2], [64.5,62.2], [70.5,63.2], [69.5,63.2], [68.5,63.2], [68.5,63.2],
[68.5,63.2], [68.5,63.2], [68.5,63.2], [68.5,63.2], [68.5,63.2]... | 102.203252 | 107 | 0.44539 |
4a1fe1400573df712ec090123aeeee923bb4cc82 | 6,212 | py | Python | thonny/plugins/misc_analyzers.py | webduino-cn/thonny | 74da2278aa018eafec697c2b92e2355237669ecd | [
"MIT"
] | 1 | 2021-06-12T22:24:40.000Z | 2021-06-12T22:24:40.000Z | Thonny/Lib/site-packages/thonny/plugins/misc_analyzers.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 30 | 2019-01-04T10:14:56.000Z | 2020-10-12T14:00:31.000Z | Thonny/Lib/site-packages/thonny/plugins/misc_analyzers.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 3 | 2018-11-24T14:00:30.000Z | 2019-07-02T02:32:26.000Z | from thonny.assistance import ProgramAnalyzer, add_program_analyzer
from thonny import get_runner, rst_utils
from thonny.running import CPythonProxy
import logging
import os
from thonny.common import is_same_path
known_stdlib_modules = {
# Compiled from https://docs.python.org/3.7/py-modindex.html
"__future__... | 20.915825 | 109 | 0.506439 |
4a1fe1cdd5a05698d7597e42d78a64f0ba1a20da | 19,877 | py | Python | code/environment.py | caipeide/drift_drl | 9f3a125f76ac2c0415014a761a514a511553322c | [
"MIT"
] | 45 | 2020-05-25T06:56:29.000Z | 2022-02-20T02:29:23.000Z | code/environment.py | caipeide/drift_drl | 9f3a125f76ac2c0415014a761a514a511553322c | [
"MIT"
] | 6 | 2021-03-07T04:34:24.000Z | 2021-11-06T04:11:43.000Z | code/environment.py | caipeide/drift_drl | 9f3a125f76ac2c0415014a761a514a511553322c | [
"MIT"
] | 9 | 2020-07-21T04:55:37.000Z | 2021-12-24T07:46:13.000Z |
from __future__ import print_function
import time
import collections
import datetime
import glob
import logging
import math
import os
import random
import re
import sys
import weakref
try:
import pygame
except ImportError:
raise RuntimeError('cannot import pygame, make sure pygame package is installed')
try:
... | 29.755988 | 136 | 0.687478 |
4a1fe3860432b735234ddd4ad45ca1cc532908ed | 8,184 | py | Python | pymongo/server_description.py | nloadholtes/mongo-python-driver | 2818a32855a53799b58343bff0a46c5227057b19 | [
"Apache-2.0"
] | 9 | 2021-02-15T05:53:17.000Z | 2022-02-25T01:47:09.000Z | pymongo/server_description.py | nloadholtes/mongo-python-driver | 2818a32855a53799b58343bff0a46c5227057b19 | [
"Apache-2.0"
] | 5 | 2022-02-04T13:00:12.000Z | 2022-02-24T18:13:24.000Z | pymongo/server_description.py | nloadholtes/mongo-python-driver | 2818a32855a53799b58343bff0a46c5227057b19 | [
"Apache-2.0"
] | 7 | 2022-02-05T20:29:14.000Z | 2022-03-26T13:16:44.000Z | # Copyright 2014-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 31.96875 | 79 | 0.649804 |
4a1fe38f40b1bbe57bde3fa5b5f9b5019e9f0902 | 643 | py | Python | sp_tst_button.py | jbarry1506/jcbhub | d7fa7a5a58903eed2393eaa17c89d56d2b68151b | [
"Apache-2.0"
] | null | null | null | sp_tst_button.py | jbarry1506/jcbhub | d7fa7a5a58903eed2393eaa17c89d56d2b68151b | [
"Apache-2.0"
] | null | null | null | sp_tst_button.py | jbarry1506/jcbhub | d7fa7a5a58903eed2393eaa17c89d56d2b68151b | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO
from time import sleep
# Sets pin numbering scheme to BCM
GPIO.setmode(GPIO.BCM)
# Logic output pin for the power strip (positive). Other power strip wire will go to GND.
GPIO.setup(16, GPIO.OUT)
# Input from pushbutton, using internal pulldown resistor. Other button wire will connect to 5V pin... | 29.227273 | 101 | 0.671851 |
4a1fe3e2d4b012c4327325fc92e5352de8bb4465 | 7,218 | py | Python | src/testingSimulatedEyeBlinking.py | AndileNdlovu96/faceswapping-2d-image-in-3d-space- | 2ba0fbafeb3ec41ca6ef27ef5aaab67fc117c7e0 | [
"MIT"
] | 2 | 2021-06-14T06:15:22.000Z | 2021-11-01T02:59:35.000Z | src/testingSimulatedEyeBlinking.py | AndileNdlovu96/faceswapping-2d-image-in-3d-space- | 2ba0fbafeb3ec41ca6ef27ef5aaab67fc117c7e0 | [
"MIT"
] | null | null | null | src/testingSimulatedEyeBlinking.py | AndileNdlovu96/faceswapping-2d-image-in-3d-space- | 2ba0fbafeb3ec41ca6ef27ef5aaab67fc117c7e0 | [
"MIT"
] | null | null | null | import dlib
import cv2
import numpy as np
from dlib import rectangle
predictorPath = "../faceModels/shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(predictorPath)
def extractFacialLandmarks(faceROI, img, imgScale, predictor):
upscaledFaceROI = re... | 46.87013 | 103 | 0.656137 |
4a1fe49cc44947da06e2df0dba0e2905f7ef2553 | 39,846 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_dlp_fp_doc_source.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_dlp_fp_doc_source.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_dlp_fp_doc_source.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 33.371859 | 157 | 0.381393 |
4a1fe4a0856f48bcbbdf5278266f9db81b036ec0 | 14,339 | py | Python | models/account.py | rocketgithub/fel_ecofactura | f95982b0c4adb66332e1df71d7b3a403c2d34362 | [
"BSD-3-Clause"
] | null | null | null | models/account.py | rocketgithub/fel_ecofactura | f95982b0c4adb66332e1df71d7b3a403c2d34362 | [
"BSD-3-Clause"
] | null | null | null | models/account.py | rocketgithub/fel_ecofactura | f95982b0c4adb66332e1df71d7b3a403c2d34362 | [
"BSD-3-Clause"
] | 2 | 2020-06-15T16:45:21.000Z | 2020-07-03T04:07:33.000Z | # -*- encoding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import Warning
from datetime import datetime
from lxml import etree
import base64
import logging
import zeep
class AccountInvoice(models.Model):
_inherit = "account.invoice"
firma_fel = fields.Char('Firma FEL', copy... | 59.252066 | 249 | 0.610015 |
4a1fe4dcab60dcd91c85a1b5ae83ce7af99fad3c | 5,695 | py | Python | sgx/utils/logging.py | squillero/sgx-devel | 6227364a2cfef9680826daa103d9d9de50487164 | [
"Apache-2.0"
] | null | null | null | sgx/utils/logging.py | squillero/sgx-devel | 6227364a2cfef9680826daa103d9d9de50487164 | [
"Apache-2.0"
] | 4 | 2020-11-21T09:41:50.000Z | 2021-04-22T09:37:41.000Z | sgx/utils/logging.py | squillero/sgx-devel | 6227364a2cfef9680826daa103d9d9de50487164 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#############################################################################
# _________ ____________ ___ #
# / _____// _____/\ \/ / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# \_____ \/ \ ___ \ / THE E(X)TENDED (S)ELFISH (G)E... | 40.105634 | 105 | 0.509043 |
4a1fe5b0e230ed7f071fd1692d7d5ea85b09e2d1 | 3,565 | py | Python | tests/unit/test_model.py | r-peschke/openslides-backend | 83d0dab68bb914f06a0f50cffe23fc10ca45376f | [
"MIT"
] | null | null | null | tests/unit/test_model.py | r-peschke/openslides-backend | 83d0dab68bb914f06a0f50cffe23fc10ca45376f | [
"MIT"
] | null | null | null | tests/unit/test_model.py | r-peschke/openslides-backend | 83d0dab68bb914f06a0f50cffe23fc10ca45376f | [
"MIT"
] | null | null | null | from typing import cast
from unittest import TestCase
from openslides_backend.models import fields
from openslides_backend.models.base import Model
from openslides_backend.shared.patterns import Collection
class FakeModel(Model):
"""
Fake Model for testing purposes.
"""
collection = Collection("fake... | 33.009259 | 82 | 0.643198 |
4a1fe6d73b925e34a7e9e2f5737baea23f2ab282 | 5,461 | py | Python | py2/testdir_single_jvm/test_uncompleted_frame.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2018-09-20T03:28:46.000Z | 2018-12-06T21:39:29.000Z | py2/testdir_single_jvm/test_uncompleted_frame.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2021-06-02T02:24:03.000Z | 2021-11-15T17:51:49.000Z | py2/testdir_single_jvm/test_uncompleted_frame.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | import unittest, sys
sys.path.extend(['.','..','../..','py'])
import string
print "This test looks more complicated than it is, only because it's a parameterized version of something else"
print "look at sandbox/commands.log for the sequence to h2o (pretty simple)"
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i... | 39.572464 | 112 | 0.614539 |
4a1fe6f7900dfa3b351aff7e3109dedb44c900bc | 5,966 | py | Python | heat/tests/api/middleware/test_version_negotiation_middleware.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 265 | 2015-01-02T09:33:22.000Z | 2022-03-26T23:19:54.000Z | heat/tests/api/middleware/test_version_negotiation_middleware.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 8 | 2015-09-01T15:43:19.000Z | 2021-12-14T05:18:23.000Z | heat/tests/api/middleware/test_version_negotiation_middleware.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 295 | 2015-01-06T07:00:40.000Z | 2021-09-06T08:05:06.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 40.310811 | 78 | 0.700302 |
4a1fe788af068733f2a1306019f96737aa2e1644 | 446 | py | Python | files/rtorrent.py | rullmann/bundlewrap-telegraf | ab08f3b0f4a534821ba3dbcb14ce2f72ca708153 | [
"MIT"
] | null | null | null | files/rtorrent.py | rullmann/bundlewrap-telegraf | ab08f3b0f4a534821ba3dbcb14ce2f72ca708153 | [
"MIT"
] | null | null | null | files/rtorrent.py | rullmann/bundlewrap-telegraf | ab08f3b0f4a534821ba3dbcb14ce2f72ca708153 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import xmlrpc.client
import json
rtorrent = xmlrpc.client.ServerProxy('${node.metadata['telegraf']['rtorrent']['url']}')
data = {}
for datapoint in ['get_memory_usage', 'get_max_memory_usage', 'get_upload_rate', 'get_up_rate', 'get_download_rate', 'get_down_rate', 'get_up_total', 'get_down_total']... | 29.733333 | 168 | 0.735426 |
4a1fe848a1a7f7f07f72726e7866d0e93692cf63 | 610 | py | Python | leetcode/logger_rate_limiter.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | leetcode/logger_rate_limiter.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | leetcode/logger_rate_limiter.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | """
https://leetcode.com/problems/logger-rate-limiter/
Tags: Google; Easy
"""
class Logger:
def __init__(self):
self.last_printed = {}
def shouldPrintMessage(self, timestamp: int, message: str) -> bool:
if (message not in self.last_printed) or (
message in self.last_... | 25.416667 | 95 | 0.65082 |
4a1fe8fb84858b19adb303e0fcc82e2f1e8f957f | 116 | py | Python | frappe/query_builder/__init__.py | mokhito/frappe | ebc29efae568a91e52237c134e031f77185fe36d | [
"MIT"
] | 1 | 2020-08-26T22:19:30.000Z | 2020-08-26T22:19:30.000Z | frappe/query_builder/__init__.py | mokhito/frappe | ebc29efae568a91e52237c134e031f77185fe36d | [
"MIT"
] | 1 | 2021-05-11T23:42:56.000Z | 2021-05-11T23:42:56.000Z | frappe/query_builder/__init__.py | mokhito/frappe | ebc29efae568a91e52237c134e031f77185fe36d | [
"MIT"
] | 2 | 2021-08-24T00:57:20.000Z | 2021-08-24T01:30:40.000Z | from pypika import *
from frappe.query_builder.utils import Column, DocType, get_query_builder, patch_query_execute
| 38.666667 | 94 | 0.853448 |
4a1fe9fe18fd1b5ec6fa6bde1c7c5de70cdf833a | 1,711 | py | Python | acct_mgr/opt/tests/__init__.py | t-kenji/trac-account-manager-plugin | 5c89401b4deea1cabc2fa10dc1c43964a3dd26da | [
"Beerware"
] | null | null | null | acct_mgr/opt/tests/__init__.py | t-kenji/trac-account-manager-plugin | 5c89401b4deea1cabc2fa10dc1c43964a3dd26da | [
"Beerware"
] | null | null | null | acct_mgr/opt/tests/__init__.py | t-kenji/trac-account-manager-plugin | 5c89401b4deea1cabc2fa10dc1c43964a3dd26da | [
"Beerware"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013-2015 Steffen Hoffmann
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import unittest
def test_suite():
msg_fail = 'Issue with %s (%s): skipping acct_mgr.opt.tests.%s'
suite = unit... | 29 | 75 | 0.659848 |
4a1fea403583e70b2453dfd737b720bb6eb98110 | 1,865 | py | Python | setup.py | timgates42/python-sanitize | 01fbdccffb194f7969d4a6ec0da0007bc8cc6124 | [
"BSD-2-Clause"
] | 65 | 2015-01-31T07:23:16.000Z | 2020-08-02T05:32:38.000Z | setup.py | timgates42/python-sanitize | 01fbdccffb194f7969d4a6ec0da0007bc8cc6124 | [
"BSD-2-Clause"
] | null | null | null | setup.py | timgates42/python-sanitize | 01fbdccffb194f7969d4a6ec0da0007bc8cc6124 | [
"BSD-2-Clause"
] | 8 | 2016-02-19T08:32:40.000Z | 2021-12-25T11:44:59.000Z | import unittest
import sys
from setuptools import setup, find_packages, Command
PKG_NAME = 'sanitize'
class RunTests(Command):
"""
New setup.py command to run all tests for the package.
"""
description = "run all tests for {0}".format(PKG_NAME)
user_options = []
def initialize_options(sel... | 29.603175 | 71 | 0.636997 |
4a1feb4e54795de25a4348ae7be6d11b52f5f344 | 3,807 | py | Python | panamap_proto/panamap_proto.py | kirillsulim/panamap-proto | 430bfbba022300b7166351682d99f38b097719c4 | [
"MIT"
] | 1 | 2022-01-20T06:49:23.000Z | 2022-01-20T06:49:23.000Z | panamap_proto/panamap_proto.py | kirillsulim/panamap-proto | 430bfbba022300b7166351682d99f38b097719c4 | [
"MIT"
] | null | null | null | panamap_proto/panamap_proto.py | kirillsulim/panamap-proto | 430bfbba022300b7166351682d99f38b097719c4 | [
"MIT"
] | null | null | null | from typing import Type, Any, Set, Callable, Dict, List, Optional
from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper
from google.protobuf.message import Message
from google.protobuf.descriptor import FieldDescriptor, EnumDescriptor
from google.protobuf.pyext._message import RepeatedCompositeContain... | 34.297297 | 105 | 0.648542 |
4a1fec4d174ad23bfda4674e8f2f0928011dc51a | 5,468 | py | Python | entity_gym/entity_gym/examples/minefield.py | batu/incubator | 11f0f60de24102af4356c9738cbb9793ea6aa334 | [
"Apache-2.0",
"MIT"
] | null | null | null | entity_gym/entity_gym/examples/minefield.py | batu/incubator | 11f0f60de24102af4356c9738cbb9793ea6aa334 | [
"Apache-2.0",
"MIT"
] | null | null | null | entity_gym/entity_gym/examples/minefield.py | batu/incubator | 11f0f60de24102af4356c9738cbb9793ea6aa334 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-30T14:40:03.000Z | 2022-03-30T14:40:03.000Z | from dataclasses import dataclass, field
import numpy as np
import random
from typing import Dict, List, Mapping, Tuple
from entity_gym.environment import (
CategoricalAction,
DenseCategoricalActionMask,
Entity,
Environment,
CategoricalActionSpace,
ActionSpace,
EpisodeStats,
ObsSpace,
... | 31.606936 | 99 | 0.537857 |
4a1fed3e70c7fe0afb3cf1195010dd522bbaaf81 | 15,718 | py | Python | uncertainty_baselines/models/efficientnet.py | elisim/uncertainty-baselines | ba92f46114d6c49039f8150c142927cf9cba7a9e | [
"Apache-2.0"
] | null | null | null | uncertainty_baselines/models/efficientnet.py | elisim/uncertainty-baselines | ba92f46114d6c49039f8150c142927cf9cba7a9e | [
"Apache-2.0"
] | null | null | null | uncertainty_baselines/models/efficientnet.py | elisim/uncertainty-baselines | ba92f46114d6c49039f8150c142927cf9cba7a9e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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 ap... | 35.722727 | 78 | 0.631314 |
4a1fef034429ec4838eddb32ea986dd396b6ed92 | 6,703 | py | Python | tests/unit_tests/test_crypto/test_crypto.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | null | null | null | tests/unit_tests/test_crypto/test_crypto.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | null | null | null | tests/unit_tests/test_crypto/test_crypto.py | konchunas/pytezos | 65576d18bdf1956fae8ea21241b6c43a38921b83 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
from parameterized import parameterized
from pytezos.crypto.key import Key
class TestCrypto(TestCase):
"""
Test data generation:
./tezos-client gen keys test_ed25519 -s ed25519 --force (--encrypted)
./tezos-client gen keys test_secp256k1 -... | 51.561538 | 112 | 0.75414 |
4a1fef8a5c440e057ef938ed0f0d7f7ccf3d781f | 4,572 | py | Python | pysnmp/CXLANIOGEN-PORT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CXLANIOGEN-PORT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CXLANIOGEN-PORT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CXLANIOGEN-PORT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CXLANIOGEN-PORT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:17:23 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 117.230769 | 477 | 0.76881 |
4a1ff12a2ac4869f32f8c00e57168a64ca8236a8 | 8,946 | py | Python | tensor2tensor/envs/trajectory.py | shankharaj29/tensor2tensor | b89ba51a6fa9e0c20009cfb57ee8de04f7138392 | [
"Apache-2.0"
] | 1 | 2019-02-16T10:39:45.000Z | 2019-02-16T10:39:45.000Z | tensor2tensor/envs/trajectory.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/envs/trajectory.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 36.663934 | 80 | 0.708138 |
4a1ff17aeaa5f8eaaaf5fd08242924058f96b020 | 965 | py | Python | unittest_reinvent/library_design/__init__.py | MolecularAI/reinvent-chemistry | bf0235bc2b1168b1db54c1e04bdba04b166ab7bf | [
"MIT"
] | null | null | null | unittest_reinvent/library_design/__init__.py | MolecularAI/reinvent-chemistry | bf0235bc2b1168b1db54c1e04bdba04b166ab7bf | [
"MIT"
] | null | null | null | unittest_reinvent/library_design/__init__.py | MolecularAI/reinvent-chemistry | bf0235bc2b1168b1db54c1e04bdba04b166ab7bf | [
"MIT"
] | 1 | 2022-03-22T15:24:13.000Z | 2022-03-22T15:24:13.000Z | from unittest_reinvent.library_design.aizynth import TestAiZynthClient
from unittest_reinvent.library_design.reaction_definitions import TestStandardDefinitions, TestBuildingBlocks
from unittest_reinvent.library_design.reaction_filters import *
from unittest_reinvent.library_design.test_attachment_points import TestAtt... | 68.928571 | 112 | 0.915026 |
4a1ff39fdac153038308cf02fdf0eabd46d85a63 | 11,680 | py | Python | gooddata-metadata-client/gooddata_metadata_client/model/inline_response200_options.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-24T16:27:06.000Z | 2022-02-25T10:18:49.000Z | gooddata-metadata-client/gooddata_metadata_client/model/inline_response200_options.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 29 | 2022-01-20T15:45:38.000Z | 2022-03-31T09:39:25.000Z | gooddata-metadata-client/gooddata_metadata_client/model/inline_response200_options.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-20T07:11:15.000Z | 2022-03-09T14:50:17.000Z | """
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Contact: support@gooddata.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sy... | 43.745318 | 124 | 0.579195 |
4a1ff3c784d0b482fa31ae2221cacc2626124244 | 10,333 | py | Python | baselines/baselines_keras_rnn.py | dainis-boumber/amamda | 6690c96b883815db5c1cb00ddac756e075c119aa | [
"MIT"
] | 2 | 2018-02-17T17:18:52.000Z | 2019-11-24T09:37:50.000Z | baselines/baselines_keras_rnn.py | dainis-boumber/amamda | 6690c96b883815db5c1cb00ddac756e075c119aa | [
"MIT"
] | null | null | null | baselines/baselines_keras_rnn.py | dainis-boumber/amamda | 6690c96b883815db5c1cb00ddac756e075c119aa | [
"MIT"
] | null | null | null | import logging
from pathlib import Path
import numpy as np
np.random.seed(1337)
import keras
from keras import backend as K
from keras import regularizers
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_auc_score
from keras.layers import Input
from keras.layers import Embedding
from keras.... | 36.383803 | 113 | 0.61802 |
4a1ff3f1b5234065676cc5404ef7fa6e951183de | 1,397 | py | Python | day01/test/test_main.py | JoseTomasTocino/AdventOfCode2020 | 19b22c3f9ef2331f08c2ad78f49f200a5f4adfc9 | [
"MIT"
] | null | null | null | day01/test/test_main.py | JoseTomasTocino/AdventOfCode2020 | 19b22c3f9ef2331f08c2ad78f49f200a5f4adfc9 | [
"MIT"
] | null | null | null | day01/test/test_main.py | JoseTomasTocino/AdventOfCode2020 | 19b22c3f9ef2331f08c2ad78f49f200a5f4adfc9 | [
"MIT"
] | null | null | null | import logging
import os
from day01.code.main import process_input, get_number_group
logger = logging.getLogger(__name__)
local_path = os.path.abspath(os.path.dirname(__file__))
def test_case_1():
input_str = """1721
979
366
299
675
1456"""
assert process_input(input_str) == 514579
def test_case_2():
... | 22.532258 | 74 | 0.651396 |
4a1ff42d0271009f819271ad7a38e1f4ceb8e91c | 3,241 | py | Python | MCTS/MCS.py | hojunkim13/master2048 | 2ef6c4674197f8a38853195307b50b6e964f4284 | [
"MIT"
] | null | null | null | MCTS/MCS.py | hojunkim13/master2048 | 2ef6c4674197f8a38853195307b50b6e964f4284 | [
"MIT"
] | null | null | null | MCTS/MCS.py | hojunkim13/master2048 | 2ef6c4674197f8a38853195307b50b6e964f4284 | [
"MIT"
] | null | null | null | import os, sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
import numpy as np
import time
from Environment.BitEnv import *
from Environment.BitEnv import _2048
from multiprocessing import Pool
class MCTS:
def __init__(self):
pass
def heuristic(self, grid):
""... | 29.733945 | 114 | 0.556001 |
4a1ff47dc7c0628e78cbf9e9df1c53cb13a43bbd | 631 | py | Python | utils/voice_analyser.py | roi3363/music-pytheory | 53cc3c4f0025acef75411ff85e1ce365912267be | [
"MIT"
] | 2 | 2019-09-24T09:41:37.000Z | 2020-07-26T20:21:05.000Z | utils/voice_analyser.py | roi3363/music-pytheory | 53cc3c4f0025acef75411ff85e1ce365912267be | [
"MIT"
] | null | null | null | utils/voice_analyser.py | roi3363/music-pytheory | 53cc3c4f0025acef75411ff85e1ce365912267be | [
"MIT"
] | null | null | null | # import os
# import struct
# import sys
# import time
#
# import pyaudio
# import numpy as np
# from matplotlib import pyplot as plt
# from matplotlib.animation import FuncAnimation
#
# CHUNK = 1024 * 4
# RATE = 44100
# FORMAT = pyaudio.paInt16
# CHANNELS = 1
#
# p = pyaudio.PyAudio()
#
# stream = p.open(
# format... | 12.877551 | 62 | 0.597464 |
4a1ff4e261ed68eb06f290a33a07b37453b27739 | 1,548 | py | Python | blending.py | RachitB11/dual-fisheye-video-stitching | 36eac03132531f3e3141a67f994997cccb78e5ef | [
"MIT"
] | null | null | null | blending.py | RachitB11/dual-fisheye-video-stitching | 36eac03132531f3e3141a67f994997cccb78e5ef | [
"MIT"
] | null | null | null | blending.py | RachitB11/dual-fisheye-video-stitching | 36eac03132531f3e3141a67f994997cccb78e5ef | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy as np
import cv2
def GaussianPyramid(img, leveln):
GP = [img]
for i in range(leveln - 1):
GP.append(cv2.pyrDown(GP[i]))
return GP
def LaplacianPyramid(img, leveln):
LP = []
for i in range(leveln - 1):
next_img = cv2.pyrDown(img)
LP.append(im... | 25.8 | 74 | 0.609173 |
4a1ff5046131d48c9a8d56c8878f771328daf972 | 6,940 | py | Python | accelbyte_py_sdk/api/dslogmanager/operations/terminated_servers/download_server_logs.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/dslogmanager/operations/terminated_servers/download_server_logs.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/dslogmanager/operations/terminated_servers/download_server_logs.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 28.326531 | 151 | 0.628098 |
4a1ff5b45714e6068518d7e8c4c6462a36d5a3bf | 636 | py | Python | LISTS2/NUMBER9.py | MakarFadeev/PythonTasks | 2ae18c3c6a50808f985966d3304a6af6824ce686 | [
"Apache-2.0"
] | 2 | 2020-11-13T05:59:45.000Z | 2020-11-29T09:26:20.000Z | LISTS2/NUMBER9.py | MakarFadeev/PythonTasks | 2ae18c3c6a50808f985966d3304a6af6824ce686 | [
"Apache-2.0"
] | 1 | 2020-10-29T18:14:10.000Z | 2020-10-29T18:14:10.000Z | LISTS2/NUMBER9.py | MakarFadeev/PythonTasks | 2ae18c3c6a50808f985966d3304a6af6824ce686 | [
"Apache-2.0"
] | null | null | null | howMany = int(input('Сколько чисел вы хотите ввести? '))
array = []
better = 9999999999999
betterLength = 99999999999999
n = int(input('Введите главное число: '))
for i in range(0, howMany):
array.append(int(input('Введите число: ')))
if (array[i] > n):
if (array[i] - n < betterLength):
bett... | 28.909091 | 56 | 0.564465 |
4a1ff5ef55166327c66925bb0715d0566a66ef62 | 120 | py | Python | crawler/gather/pipelines/__init__.py | shifei123/test | 26611d8f63957a6e3899ecb56ede3e1bed260105 | [
"Apache-2.0"
] | 283 | 2016-04-07T15:51:01.000Z | 2022-02-17T15:50:25.000Z | crawler/gather/pipelines/__init__.py | taogeT/flask_livetv | 26611d8f63957a6e3899ecb56ede3e1bed260105 | [
"Apache-2.0"
] | 2 | 2017-03-15T07:56:49.000Z | 2018-09-20T05:56:23.000Z | crawler/gather/pipelines/__init__.py | taogeT/flask_livetv | 26611d8f63957a6e3899ecb56ede3e1bed260105 | [
"Apache-2.0"
] | 127 | 2016-04-15T14:40:45.000Z | 2021-04-07T07:57:02.000Z | # -*- coding: utf-8 -*-
from .database import CurrentPipeline, StatisticPipeline
from .harddisk import HardDiskPipeline
| 30 | 56 | 0.783333 |
4a1ff7bbd3375bdda5ee7647898aaf160ce9135c | 9,379 | py | Python | tests/test_pipeline.py | lucianolorenti/Temporis | 90004e28beb3d1bbec474c262f92ed042045e556 | [
"MIT"
] | null | null | null | tests/test_pipeline.py | lucianolorenti/Temporis | 90004e28beb3d1bbec474c262f92ed042045e556 | [
"MIT"
] | null | null | null | tests/test_pipeline.py | lucianolorenti/Temporis | 90004e28beb3d1bbec474c262f92ed042045e556 | [
"MIT"
] | null | null | null |
import numpy as np
import pandas as pd
from scipy.stats import entropy
from temporis.dataset.ts_dataset import AbstractTimeSeriesDataset
from temporis.transformation import Concatenate as TransformationConcatenate
from temporis.transformation import Transformer
from temporis.transformation.features.imputers import Pe... | 32.230241 | 106 | 0.611686 |
4a1ff89d74cc656266e22d473f036b397e0105a4 | 37,103 | py | Python | tests/unit_tests/sql_parse_tests.py | navono/superset | 2daa07163326b8555488dab523c5479cf92821cf | [
"Apache-2.0"
] | 1 | 2022-02-10T11:30:05.000Z | 2022-02-10T11:30:05.000Z | tests/unit_tests/sql_parse_tests.py | navono/superset | 2daa07163326b8555488dab523c5479cf92821cf | [
"Apache-2.0"
] | 10 | 2022-01-05T01:31:07.000Z | 2022-03-16T01:09:46.000Z | tests/unit_tests/sql_parse_tests.py | navono/superset | 2daa07163326b8555488dab523c5479cf92821cf | [
"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 u... | 25.222978 | 103 | 0.575398 |
4a1ffe00c929573ecdd02eb026c0124963f91ff0 | 14,978 | py | Python | intro_tab_functions.py | StineGustavsen/Fidora | 005afc4ce1c4980c772b52ab6db13172048ac622 | [
"MIT"
] | null | null | null | intro_tab_functions.py | StineGustavsen/Fidora | 005afc4ce1c4980c772b52ab6db13172048ac622 | [
"MIT"
] | null | null | null | intro_tab_functions.py | StineGustavsen/Fidora | 005afc4ce1c4980c772b52ab6db13172048ac622 | [
"MIT"
] | null | null | null | import Globals
import tkinter as tk
import tkinter.ttk
from tkinter import filedialog, INSERT, DISABLED, messagebox, NORMAL, simpledialog, \
PhotoImage, BOTH, Toplevel, GROOVE, ACTIVE, FLAT, N, S, W, E, ALL, ttk, LEFT, RIGHT, Y,\
Label, X, END, Button, StringVar, PhotoImage
#import sympy as sp
#from ... | 46.086154 | 138 | 0.697022 |
4a1ffedd020c5c84c407c83387b5e7c141fc7dde | 602 | py | Python | original_files/boot_original.py | lemariva/uPyMaixYoloV2 | 0140c13cbffef780cd06fd4206926a9d46ee8da8 | [
"Apache-2.0"
] | 5 | 2020-01-17T09:03:52.000Z | 2022-03-21T10:34:23.000Z | original_files/boot_original.py | lemariva/uPyMaixYoloV2 | 0140c13cbffef780cd06fd4206926a9d46ee8da8 | [
"Apache-2.0"
] | null | null | null | original_files/boot_original.py | lemariva/uPyMaixYoloV2 | 0140c13cbffef780cd06fd4206926a9d46ee8da8 | [
"Apache-2.0"
] | 3 | 2020-07-07T14:41:41.000Z | 2022-03-21T10:34:27.000Z |
from fpioa_manager import *
import os, Maix, lcd, image
from Maix import FPIOA, GPIO
test_pin=16
fpioa = FPIOA()
fpioa.set_function(test_pin,FPIOA.GPIO7)
test_gpio=GPIO(GPIO.GPIO7,GPIO.IN)
lcd.init(color=(255,0,0))
lcd.draw_string(100,120, "Welcome to MaixPy", lcd.WHITE, lcd.RED)
if test_gpio.value() == 0:
print(... | 26.173913 | 65 | 0.702658 |
4a2001c5491746735d896b80b3536eecb2a7fae8 | 26,205 | py | Python | ipsframework/taskManager.py | rosswhitfield/IPS-framework | c10e1e8a75157a79324ea6a061a3e89fb8f33cb6 | [
"BSD-3-Clause"
] | null | null | null | ipsframework/taskManager.py | rosswhitfield/IPS-framework | c10e1e8a75157a79324ea6a061a3e89fb8f33cb6 | [
"BSD-3-Clause"
] | null | null | null | ipsframework/taskManager.py | rosswhitfield/IPS-framework | c10e1e8a75157a79324ea6a061a3e89fb8f33cb6 | [
"BSD-3-Clause"
] | null | null | null | # -------------------------------------------------------------------------------
# Copyright 2006-2021 UT-Battelle, LLC. See LICENSE for more information.
# -------------------------------------------------------------------------------
import os
from math import ceil
from . import messages, configurationManager
from ... | 43.82107 | 154 | 0.493074 |
4a2001d32c01a9e5a23ee7d8658449ed7028a8c5 | 6,856 | py | Python | data/aligned_dataset.py | MTKSHU/cloth-segmentation | 241c6dfd51d89aedb02b67f48d296efe09698ddd | [
"MIT"
] | null | null | null | data/aligned_dataset.py | MTKSHU/cloth-segmentation | 241c6dfd51d89aedb02b67f48d296efe09698ddd | [
"MIT"
] | null | null | null | data/aligned_dataset.py | MTKSHU/cloth-segmentation | 241c6dfd51d89aedb02b67f48d296efe09698ddd | [
"MIT"
] | null | null | null | from data.base_dataset import BaseDataset, Rescale_fixed, Normalize_image
from data.image_folder import make_dataset, make_dataset_test
import os
import cv2
import json
import itertools
import collections
from tqdm import tqdm
import pandas as pd
import numpy as np
from PIL import Image
import torch
i... | 38.301676 | 102 | 0.563886 |
4a20032042177bb606f86a8f6a421e5a8b565506 | 9,817 | py | Python | history_generator/civil/treaty.py | ReedOei/History-Generator | 5c1c5df89d355736173cddf9c373b761fa4d1c3b | [
"MIT"
] | 19 | 2017-10-26T17:52:57.000Z | 2022-01-17T11:04:46.000Z | history_generator/civil/treaty.py | Kytuzian/History-Generator | 5c1c5df89d355736173cddf9c373b761fa4d1c3b | [
"MIT"
] | 4 | 2017-11-13T15:54:53.000Z | 2021-02-27T08:02:41.000Z | history_generator/civil/treaty.py | Kytuzian/History-Generator | 5c1c5df89d355736173cddf9c373b761fa4d1c3b | [
"MIT"
] | 5 | 2017-10-30T05:49:43.000Z | 2020-10-06T18:29:42.000Z | import math
import random
from civil.diplomacy import TRADE_CARAVAN_MULTIPLIER, WAR_CITY_MULTIPLIER, TRADE_END_DIVISOR, TREATY_NAMES
import internal.utility as utility
import internal.events as events
from culture.form import Form
class Treaty:
def __init__(self, parent, starting_date, nation_a, nation_b, treat... | 43.057018 | 162 | 0.598452 |
4a2003d53498da6fc8d24a553566ec98f6280f53 | 2,197 | py | Python | Neural-Networks/oo_run_singles.py | rupertsmall/machine-learning | 999d2afb1e7409f4221b89f48a5ff60d50bbcb0a | [
"MIT"
] | null | null | null | Neural-Networks/oo_run_singles.py | rupertsmall/machine-learning | 999d2afb1e7409f4221b89f48a5ff60d50bbcb0a | [
"MIT"
] | 3 | 2015-06-29T20:31:46.000Z | 2015-09-02T21:04:23.000Z | Neural-Networks/oo_run_singles.py | rupertsmall/machine-learning | 999d2afb1e7409f4221b89f48a5ff60d50bbcb0a | [
"MIT"
] | null | null | null | #
# optimise a neural network for image recognition
# rupert small, august 2015
#
from numpy import genfromtxt
from oo_dr_singles import *
import threading
# initiate data
data = genfromtxt('train2.csv', delimiter=',')
num_cpus = 30 # multi-threading
y_vals = data[:,0] # outputs
x_vals = data[:,1:].T # inputs
alpha ... | 36.616667 | 80 | 0.756031 |
4a200499daa0622b79529e1646e15da7da115a61 | 10,017 | py | Python | lib/datasets/imdb.py | pprp/faster-rcnn.Supernova | 583bc9f6efd80d5a7fa88189a1c817d92d6018a6 | [
"MIT"
] | 15 | 2019-04-19T12:40:09.000Z | 2020-06-03T07:56:37.000Z | lib/datasets/imdb.py | Zxl19990529/faster-rcnn.Supernova | 583bc9f6efd80d5a7fa88189a1c817d92d6018a6 | [
"MIT"
] | 2 | 2019-04-19T13:21:44.000Z | 2020-06-03T07:49:31.000Z | lib/datasets/imdb.py | Zxl19990529/faster-rcnn.Supernova | 583bc9f6efd80d5a7fa88189a1c817d92d6018a6 | [
"MIT"
] | 5 | 2019-04-19T13:06:22.000Z | 2021-01-19T03:31:58.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ i... | 35.271127 | 81 | 0.5881 |
4a2006ccc75ffc2e814775ea21ecb159568abea9 | 92 | py | Python | peakingduck/__init__.py | fispact/peakingduck | 748cfa2341710d99083db950a2d66ffb139eecf2 | [
"MIT"
] | 5 | 2020-12-26T17:49:24.000Z | 2021-05-21T03:10:45.000Z | peakingduck/__init__.py | fispact/peakingduck | 748cfa2341710d99083db950a2d66ffb139eecf2 | [
"MIT"
] | 18 | 2020-01-28T20:38:48.000Z | 2020-03-06T16:34:48.000Z | peakingduck/__init__.py | thomasms/peakingduck | 748cfa2341710d99083db950a2d66ffb139eecf2 | [
"MIT"
] | 5 | 2020-03-16T16:21:35.000Z | 2022-02-13T09:09:40.000Z | import peakingduck.util as util
import peakingduck.core as core
import peakingduck.io as io
| 23 | 31 | 0.836957 |
4a20079426360beaaa90f313d0215afb2699ed16 | 3,726 | py | Python | rllib/examples/custom_input_api.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | rllib/examples/custom_input_api.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | 41 | 2021-09-21T01:13:48.000Z | 2022-03-19T07:12:22.000Z | rllib/examples/custom_input_api.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | 1 | 2019-09-24T16:24:49.000Z | 2019-09-24T16:24:49.000Z | """Example of creating a custom input api
Custom input apis are useful when your data source is in a custom format or
when it is necessary to use an external data loading mechanism.
In this example, we train an rl agent on user specified input data.
Instead of using the built in JsonReader, we will create our own cust... | 31.576271 | 87 | 0.671229 |
4a2007c12ab2a02692e3171472cf6397eb33257b | 7,334 | py | Python | gencapdefs.py | erincerys/ergo | 0aeedcdcccb5348d8eedb5faa6a0536d93ca3ae3 | [
"MIT"
] | 1,122 | 2017-06-15T05:44:52.000Z | 2021-05-26T16:27:43.000Z | gencapdefs.py | erincerys/ergo | 0aeedcdcccb5348d8eedb5faa6a0536d93ca3ae3 | [
"MIT"
] | 1,031 | 2017-06-18T13:57:51.000Z | 2021-05-26T19:51:37.000Z | gencapdefs.py | erincerys/ergo | 0aeedcdcccb5348d8eedb5faa6a0536d93ca3ae3 | [
"MIT"
] | 113 | 2017-06-21T18:32:53.000Z | 2021-05-26T13:12:46.000Z | #!/usr/bin/env python3
"""
Updates the capability definitions at irc/caps/defs.go
To add a capability, add it to the CAPDEFS list below,
then run `make capdefs` from the project root.
"""
import io
import subprocess
import sys
from collections import namedtuple
CapDef = namedtuple("CapDef", ['identifier', 'name', '... | 29.336 | 122 | 0.600082 |
4a20094ae3d7323c4517e1044da5cf25ac752cd0 | 3,379 | py | Python | render_road_multi.py | benchoi93/AdvSpdRL | 2cf6ac7934ad48b85f1e90df1d5015853a09ac5c | [
"MIT"
] | null | null | null | render_road_multi.py | benchoi93/AdvSpdRL | 2cf6ac7934ad48b85f1e90df1d5015853a09ac5c | [
"MIT"
] | null | null | null | render_road_multi.py | benchoi93/AdvSpdRL | 2cf6ac7934ad48b85f1e90df1d5015853a09ac5c | [
"MIT"
] | null | null | null | from pathlib import Path
from util.plotutil import info_graph, info_graph_separate, info_graph_detail, make_gif
from stable_baselines3.common.callbacks import CheckpointCallback
from stable_baselines3 import PPO, SAC, DDPG, A2C, DQN, TD3
import numpy as np
from PIL import Image
from rl_env.adv_spd_env_road_multi import... | 33.455446 | 172 | 0.666765 |
4a2009fd16d6c0c196e1a8739c25ff6d5b6536e4 | 723 | py | Python | pyfr/plugins/base.py | tjcorona/PyFR | a72b41580043bb001e5a9e6bb79a0e305d48e052 | [
"BSD-3-Clause"
] | null | null | null | pyfr/plugins/base.py | tjcorona/PyFR | a72b41580043bb001e5a9e6bb79a0e305d48e052 | [
"BSD-3-Clause"
] | null | null | null | pyfr/plugins/base.py | tjcorona/PyFR | a72b41580043bb001e5a9e6bb79a0e305d48e052 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
class BasePlugin(object, metaclass=ABCMeta):
name = None
systems = None
@abstractmethod
def __init__(self, intg, cfgsect, suffix=None):
self.cfg = intg.cfg
self.cfgsect = cfgsect
self.suffix = suffix
se... | 25.821429 | 73 | 0.609959 |
4a200b1882a662996aef50799aea64cc6cae0379 | 2,077 | py | Python | Linux-Operation0605/app/core/constants.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | null | null | null | Linux-Operation0605/app/core/constants.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | 18 | 2020-06-05T18:17:40.000Z | 2022-03-11T23:25:21.000Z | Linux-Operation0605/app/core/constants.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
常量
'''
USER_TYPE = (
('systemadmin', u'系统管理员'),
('superadmin', u'超管'),
('deptadmin', u'部门管理员'),
('domainadmin', u'域名管理员'),
)
PROXY_CONFIG_DISABLED = (
("-1", u'启用'),
("1", u'禁用'),
)
DISABLED_STATUS = (
("-1", u'启用'),
("1", u'禁用'),
)
PROXY_SERVER_STATUS = (... | 15.854962 | 35 | 0.466057 |
4a200b3d26120d30cf8f8e36c20af5d92049a97e | 109 | py | Python | transcription_analysis/apps.py | dighr/AudioAnalysis | b22d1afd00a1834dbd5e2a87418e8299a4fdd29d | [
"MIT"
] | 4 | 2018-12-13T04:36:40.000Z | 2022-02-27T23:52:37.000Z | transcription_analysis/apps.py | dighr/AudioAnalysis | b22d1afd00a1834dbd5e2a87418e8299a4fdd29d | [
"MIT"
] | 40 | 2018-11-07T19:46:34.000Z | 2020-04-04T16:42:48.000Z | transcription_analysis/apps.py | dighr/AudioAnalysis | b22d1afd00a1834dbd5e2a87418e8299a4fdd29d | [
"MIT"
] | 1 | 2020-09-12T14:49:01.000Z | 2020-09-12T14:49:01.000Z | from django.apps import AppConfig
class TextAnalysisConfig(AppConfig):
name = 'transcription_analysis'
| 18.166667 | 36 | 0.798165 |
4a200b76c351d447ff67ed7ae25acad3e9743083 | 1,324 | py | Python | gui/_load_weights.py | parot-99/COVID-19-Warning-System | 41c53f41db3a0e3b78c6b934c2964a96c4c2f635 | [
"BSD-3-Clause"
] | 2 | 2020-08-17T19:33:38.000Z | 2020-08-26T18:39:03.000Z | gui/_load_weights.py | parot-99/COVID-19-Warning-System | 41c53f41db3a0e3b78c6b934c2964a96c4c2f635 | [
"BSD-3-Clause"
] | null | null | null | gui/_load_weights.py | parot-99/COVID-19-Warning-System | 41c53f41db3a0e3b78c6b934c2964a96c4c2f635 | [
"BSD-3-Clause"
] | 1 | 2021-01-04T17:47:22.000Z | 2021-01-04T17:47:22.000Z | from PyQt5.QtWidgets import QFileDialog
from yolo.model.yolo import Yolo
def load_mask_weights(self):
model = (
Yolo(2)
if self.detection_model == "yolo"
else Yolo(2, tiny=True)
)
mask_weights_path = QFileDialog.getOpenFileName()[0]
if mask_weights_path == "":
return
... | 30.090909 | 68 | 0.679758 |
4a200b7dd4aea2426357ae1d333d95acef61b318 | 71,499 | py | Python | rowboat/plugins/admin.py | elderlabs/jetski | aa04d09fa41ec924eea5e2aee57135c2b7384a83 | [
"MIT"
] | null | null | null | rowboat/plugins/admin.py | elderlabs/jetski | aa04d09fa41ec924eea5e2aee57135c2b7384a83 | [
"MIT"
] | null | null | null | rowboat/plugins/admin.py | elderlabs/jetski | aa04d09fa41ec924eea5e2aee57135c2b7384a83 | [
"MIT"
] | null | null | null | import re
import csv
import time
import gevent
import humanize
import operator
from io import StringIO
from peewee import fn
from holster.emitter import Priority
from functools import reduce
from fuzzywuzzy import fuzz
from datetime import datetime, timedelta
from disco.bot import CommandLevels
from disco.types.user... | 37.810153 | 141 | 0.561239 |
4a200b90748ab89ef42e8e3370c5727282883ea7 | 9,609 | py | Python | onmt/modules/layer_norm.py | mullovc/NMTGMinor | b1b7b1e018eaa0d99a43449655937cc050a29987 | [
"MIT"
] | null | null | null | onmt/modules/layer_norm.py | mullovc/NMTGMinor | b1b7b1e018eaa0d99a43449655937cc050a29987 | [
"MIT"
] | null | null | null | onmt/modules/layer_norm.py | mullovc/NMTGMinor | b1b7b1e018eaa0d99a43449655937cc050a29987 | [
"MIT"
] | null | null | null | import math
import torch
import numbers
from torch.nn.parameter import Parameter
from torch.nn import init
from torch.nn import functional as F
import importlib
try:
import apex.amp as amp
from apex.amp import half_function
except (ModuleNotFoundError, ImportError) as e:
amp = None
from .optimized.comp... | 33.954064 | 106 | 0.667811 |
4a200bd41d7cc425acc216a441f9d73f86c776b7 | 7,657 | py | Python | test/python/WMComponent_t/JobSubmitter_t/JobSubmitterCaching_t.py | phenomax/WMCore | 7c464735d1434558a7f525081fcc7fda7c2c5fc0 | [
"Apache-2.0"
] | null | null | null | test/python/WMComponent_t/JobSubmitter_t/JobSubmitterCaching_t.py | phenomax/WMCore | 7c464735d1434558a7f525081fcc7fda7c2c5fc0 | [
"Apache-2.0"
] | null | null | null | test/python/WMComponent_t/JobSubmitter_t/JobSubmitterCaching_t.py | phenomax/WMCore | 7c464735d1434558a7f525081fcc7fda7c2c5fc0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
_JobSubmitterCaching_t_
Verify that the caching of jobs and white/black lists works correctly.
"""
import os
import pickle
import unittest
from WMComponent.JobSubmitter.JobSubmitterPoller import JobSubmitterPoller
from WMCore.JobStateMachine.ChangeState import ChangeState
from WMCore.Resour... | 36.117925 | 117 | 0.619956 |
4a200d1d3149a3b6490f9e716d01cc433de06f5a | 3,525 | py | Python | bindings/python/ensmallen/datasets/string/mucilaginibactersppamc26640.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/mucilaginibactersppamc26640.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/mucilaginibactersppamc26640.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Mucilaginibacter sp. PAMC 26640.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein... | 33.571429 | 223 | 0.68 |
4a200d28494e2fdb7d6aba04382a1367bbf79faa | 11,248 | py | Python | neutron/services/metering/drivers/iptables/iptables_driver.py | gampel/neutron | 51a6260266dc59c066072ca890ad9c40b1aad6cf | [
"Apache-2.0"
] | 10 | 2015-09-22T10:22:53.000Z | 2016-02-25T06:12:05.000Z | neutron/services/metering/drivers/iptables/iptables_driver.py | gampel/neutron | 51a6260266dc59c066072ca890ad9c40b1aad6cf | [
"Apache-2.0"
] | 12 | 2015-01-08T18:30:45.000Z | 2015-03-13T21:04:15.000Z | neutron/services/metering/drivers/iptables/iptables_driver.py | gampel/neutron | 51a6260266dc59c066072ca890ad9c40b1aad6cf | [
"Apache-2.0"
] | 7 | 2015-02-05T10:23:52.000Z | 2019-05-18T17:11:19.000Z | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | 38.920415 | 79 | 0.53494 |
4a200d785348e7c96857a2e1e4ce1ae4a441a70b | 490 | py | Python | apps/api/urls.py | abdurraufraihan/ecomcore | 689c20c30e43369b27b7efe02e5e809975de0a4f | [
"MIT"
] | 2 | 2021-11-12T15:51:55.000Z | 2021-12-28T05:34:55.000Z | apps/api/urls.py | abdurraufraihan/ecomcore | 689c20c30e43369b27b7efe02e5e809975de0a4f | [
"MIT"
] | 9 | 2021-03-19T09:09:55.000Z | 2022-03-12T00:38:39.000Z | apps/api/urls.py | abdurraufraihan/ecomcore | 689c20c30e43369b27b7efe02e5e809975de0a4f | [
"MIT"
] | 1 | 2021-12-28T05:34:56.000Z | 2021-12-28T05:34:56.000Z | from django.urls import path
from lib import apiendpoints
from apps.api.views.productviews import ProductListView, ProductDetailView
from apps.api.views.categoryviews import CategoryListView
urlpatterns = [
path(
apiendpoints.PRODUCT_URL,
ProductListView.as_view(),
name='productList'
),
path(
apiendpoints.P... | 21.304348 | 74 | 0.781633 |
4a200d91c9340f59ffed41b3bdaf9890aae75755 | 2,038 | py | Python | code/apps/Managed Software Center/Managed Software Center/CocoaWrapper.py | dderusha/munki | ad3dd1673fc6544770e561b52000371113cd5294 | [
"Apache-2.0"
] | 1 | 2019-01-13T22:36:59.000Z | 2019-01-13T22:36:59.000Z | code/apps/Managed Software Center/Managed Software Center/CocoaWrapper.py | MarcelRaschke/munki | 5ab55e81934cf081d369ab11df70d2ee215df33e | [
"Apache-2.0"
] | null | null | null | code/apps/Managed Software Center/Managed Software Center/CocoaWrapper.py | MarcelRaschke/munki | 5ab55e81934cf081d369ab11df70d2ee215df33e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# CocoaWrapper.py
# MunkiStatus
#
# Created by Greg Neagle on 6/26/17.
# Copyright (c) 2018 The Munki Project. All rights reserved.
#
"""Selectively import Cocoa symbols to speed up app launch.
Idea from Per Olofsson's AutoDMG"""
# PyLint cannot properly find names inside Cocoa libraries... | 22.395604 | 75 | 0.720805 |
4a200dc11039f316e0431c7a22b363c82cbb0b55 | 4,196 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/job_statistics_job_node_io.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/job_statistics_job_node_io.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/job_statistics_job_node_io.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_9_0_0.models.job_st... | 28.351351 | 112 | 0.585558 |
4a200e3f584f09ca7446db45059a206903d5fa39 | 1,094 | py | Python | tensorflow/contrib/keras/api/keras/preprocessing/__init__.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/contrib/keras/api/keras/preprocessing/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/contrib/keras/api/keras/preprocessing/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.071429 | 80 | 0.74223 |
4a200f6b112697fc12dd7c6263413bb939e9cf5c | 4,205 | py | Python | benchmark/startQiskit_Class2751.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class2751.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class2751.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=38
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.467213 | 140 | 0.647087 |
4a20103ca0aeef4873ed96eb468af463fd7d2a19 | 4,647 | py | Python | Configuration/DataProcessing/python/Utils.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | Configuration/DataProcessing/python/Utils.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | Configuration/DataProcessing/python/Utils.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | #!/usr/bin/env python
"""
_Utils_
Module containing some utility tools
"""
def stepALCAPRODUCER(skims):
"""
_stepALCAPRODUCER_
Creates and returns the configuration string for the ALCAPRODUCER step
starting from the list of AlcaReco path to be run.
"""
step = ''
if len(skims) >0:
... | 33.192857 | 115 | 0.616312 |
4a20107cb606d45d157489b7249da46faafa2f7a | 3,270 | py | Python | test/functional/test_framework/ucacoin_node.py | ucacoin/Ucacoin2 | bc39105adbf648114f55f9f90976af2d2b7cd087 | [
"MIT"
] | 4 | 2020-07-31T12:27:23.000Z | 2021-06-05T23:07:37.000Z | test/functional/test_framework/ucacoin_node.py | ucacoin/Ucacoin2 | bc39105adbf648114f55f9f90976af2d2b7cd087 | [
"MIT"
] | 3 | 2020-08-02T10:47:08.000Z | 2021-07-07T06:41:54.000Z | test/functional/test_framework/ucacoin_node.py | ucacoin/Ucacoin2 | bc39105adbf648114f55f9f90976af2d2b7cd087 | [
"MIT"
] | 3 | 2020-08-24T15:36:47.000Z | 2020-10-13T15:51:47.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from .messages import msg_getheaders, msg_headers, CBlockHeader
from .mininode import P2PInterface, minin... | 39.39759 | 105 | 0.693884 |
4a20133bd20931a5b5c6d193d609ce9e45ee1366 | 3,582 | py | Python | tests/test_dense_model.py | r-o-s-h-a-n/semisupervisedFL | 4c568b4a9cead5aa57f403c1e1bc10e2eaac07e3 | [
"MIT"
] | 5 | 2020-02-25T00:24:11.000Z | 2021-03-19T12:28:14.000Z | tests/test_dense_model.py | r-o-s-h-a-n/semisupervisedFL | 4c568b4a9cead5aa57f403c1e1bc10e2eaac07e3 | [
"MIT"
] | 9 | 2020-02-11T02:33:56.000Z | 2021-11-10T19:54:17.000Z | tests/test_dense_model.py | r-o-s-h-a-n/semisupervisedFL | 4c568b4a9cead5aa57f403c1e1bc10e2eaac07e3 | [
"MIT"
] | 2 | 2020-02-13T15:12:02.000Z | 2020-05-28T18:23:17.000Z | import os
import shutil
import numpy as np
import functools
import unittest
import warnings
import pickle
import csv
import tensorflow as tf
import tensorflow_federated as tff
import dataloader as dta
import models as mdl
warnings.simplefilter('ignore')
class TestDenseAutoencoderModel(unittest.TestCase):
def se... | 36.181818 | 109 | 0.592686 |
4a201406709034e28be9affe189767c934b67020 | 6,008 | py | Python | stubs.min/Autodesk/Revit/DB/__init___parts/UV.py | denfromufa/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2017-07-07T11:15:45.000Z | 2017-07-07T11:15:45.000Z | stubs.min/Autodesk/Revit/DB/__init___parts/UV.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Autodesk/Revit/DB/__init___parts/UV.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class UV(object):
"""
Object representing coordinates in 2-dimensional space.
UV(u: float,v: float)
UV()
"""
def Add(self,source):
"""
Add(self: UV,source: UV) -> UV
Adds the specified 2-D vector to this 2-D vector and returns the result.
source: The vector to add to this vec... | 26.008658 | 92 | 0.627497 |
4a2014aca544c5cb9053ea9e1081e4de1955297b | 5,968 | py | Python | test/functional/rpc_users.py | Game-Frag/game-frag-coin | 87577eb3427c897525d6e833e403588c147a4d87 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | Game-Frag/game-frag-coin | 87577eb3427c897525d6e833e403588c147a4d87 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | Game-Frag/game-frag-coin | 87577eb3427c897525d6e833e403588c147a4d87 | [
"MIT"
] | 1 | 2021-06-05T01:09:23.000Z | 2021-06-05T01:09:23.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import GamefragTestFramework
from test_... | 38.753247 | 129 | 0.614444 |
4a20158135ccd710c61ab02431f2ca513a9e965e | 1,176 | py | Python | examples/ge2e/random_cycle.py | yt605155624/Parakeet | 8ce8254adad55df07288df86cecdbf0f608b73fb | [
"Apache-2.0"
] | 501 | 2020-02-28T12:46:59.000Z | 2022-03-29T19:49:52.000Z | examples/ge2e/random_cycle.py | yt605155624/Parakeet | 8ce8254adad55df07288df86cecdbf0f608b73fb | [
"Apache-2.0"
] | 75 | 2020-03-24T04:40:41.000Z | 2021-11-19T02:18:30.000Z | examples/ge2e/random_cycle.py | yt605155624/Parakeet | 8ce8254adad55df07288df86cecdbf0f608b73fb | [
"Apache-2.0"
] | 79 | 2020-03-11T01:50:26.000Z | 2022-03-20T09:37:07.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 29.4 | 74 | 0.665816 |
4a2015b690b03f4e22a3949fcb021e015ecbe6b1 | 284 | py | Python | src/anicloud/util/button_in_text.py | Nanashisa/anicloud-api | 5a8f6cf8e991274d3f4185a3b836caf1501cdb81 | [
"MIT"
] | null | null | null | src/anicloud/util/button_in_text.py | Nanashisa/anicloud-api | 5a8f6cf8e991274d3f4185a3b836caf1501cdb81 | [
"MIT"
] | null | null | null | src/anicloud/util/button_in_text.py | Nanashisa/anicloud-api | 5a8f6cf8e991274d3f4185a3b836caf1501cdb81 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
def parse_url_button_in_text(s: str):
html = BeautifulSoup(s, features="html.parser")
data = []
for a in html.select("a"):
data.append((a.attrs["href"], a.text.strip()))
a.replace_with("")
return html.text.strip(), data
| 25.818182 | 54 | 0.633803 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.