hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
62e32a872b8cb54d3852631650a22932f4eba9e4 | 3,917 | py | Python | tempodb/protocol/cursor.py | tempodb/tempodb-python | 8ce45231bd728c6c97ef799cf0f1513ea3a9a7d3 | [
"MIT"
] | 4 | 2015-02-04T14:05:37.000Z | 2018-03-01T09:46:34.000Z | tempodb/protocol/cursor.py | tempodb/tempodb-python | 8ce45231bd728c6c97ef799cf0f1513ea3a9a7d3 | [
"MIT"
] | 2 | 2022-01-30T22:45:34.000Z | 2022-01-30T22:45:42.000Z | tempodb/protocol/cursor.py | tempodb/tempodb-python | 8ce45231bd728c6c97ef799cf0f1513ea3a9a7d3 | [
"MIT"
] | 1 | 2018-04-16T13:55:50.000Z | 2018-04-16T13:55:50.000Z | import json
from tempodb.temporal.validate import convert_iso_stamp
def make_generator(d):
""""Utility function for converting a list to a generator.
:param list d: the list to convert
:rtype: generator"""
for i in d:
yield i
def check_response(resp):
"""Utility function for checking t... | 31.087302 | 78 | 0.636712 |
62e32f2490bace70bab080f538aee3dc5f8fa67d | 62,916 | py | Python | ch_util/tools.py | CHIMEFRB/ch_util | 37b2f2510ba39def44ecce0e8cb729e2ea108603 | [
"MIT"
] | 1 | 2021-02-16T15:59:08.000Z | 2021-02-16T15:59:08.000Z | ch_util/tools.py | CHIMEFRB/ch_util | 37b2f2510ba39def44ecce0e8cb729e2ea108603 | [
"MIT"
] | 20 | 2021-01-22T01:43:14.000Z | 2022-02-15T05:08:30.000Z | ch_util/tools.py | CHIMEFRB/ch_util | 37b2f2510ba39def44ecce0e8cb729e2ea108603 | [
"MIT"
] | 2 | 2021-03-10T00:47:09.000Z | 2021-06-03T18:51:23.000Z | """
Tools for CHIME analysis
A collection of miscellaneous utility routines.
Correlator Inputs
=================
Query the layout database to find out what is ultimately connected at the end
of correlator inputs. This is done by calling the routine
:func:`get_correlator_inputs`, which returns a list of the inputs. ... | 27.752978 | 172 | 0.599498 |
62e3313bdd22c9c272e7ea07534349bf1275daf3 | 3,606 | py | Python | survae/tests/transforms/bijections/autoregressive/autoregressive_mixtures_2d.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 262 | 2020-07-05T20:57:44.000Z | 2022-03-28T02:24:43.000Z | survae/tests/transforms/bijections/autoregressive/autoregressive_mixtures_2d.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 17 | 2020-08-15T05:43:34.000Z | 2022-01-31T12:24:21.000Z | survae/tests/transforms/bijections/autoregressive/autoregressive_mixtures_2d.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 35 | 2020-08-24T06:55:37.000Z | 2022-02-11T05:17:58.000Z | import numpy as np
import torch
import torch.nn as nn
import torchtestcase
import unittest
from survae.transforms.bijections.autoregressive import *
from survae.nn.layers.autoregressive import SpatialMaskedConv2d, MaskedConv2d
from survae.nn.layers import ElementwiseParams, ElementwiseParams2d
from survae.tests.transfo... | 48.72973 | 162 | 0.758181 |
62e331861f1f5917696775259bba1fbafa973191 | 62,013 | py | Python | src/sage/categories/finite_dimensional_algebras_with_basis.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/finite_dimensional_algebras_with_basis.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/finite_dimensional_algebras_with_basis.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
Finite dimensional algebras with basis
.. TODO::
Quotients of polynomial rings.
Quotients in general.
Matrix rings.
REFERENCES:
- [CR1962]_
"""
#*****************************************************************************
# Copyright (C) 2008 Teresa Gomez-Diaz (CNRS... | 40.584424 | 118 | 0.482205 |
62e333960b55b3df2fda7410a61df531f6185272 | 11,503 | py | Python | api/tests/opentrons/server/test_control_endpoints.py | rvinzent/opentrons | de1b7148983760d90a96642fe940878fb6658cf1 | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/server/test_control_endpoints.py | rvinzent/opentrons | de1b7148983760d90a96642fe940878fb6658cf1 | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/server/test_control_endpoints.py | rvinzent/opentrons | de1b7148983760d90a96642fe940878fb6658cf1 | [
"Apache-2.0"
] | null | null | null | import json
from copy import deepcopy
from opentrons import robot, modules
from opentrons.server.main import init
from opentrons.drivers.smoothie_drivers.driver_3_0 import SmoothieDriver_3_0_0
from opentrons import instruments
from opentrons.instruments import pipette_config
async def test_get_pipettes_uncommissioned... | 27.065882 | 79 | 0.604364 |
62e33f26b2188e5f00020d999649e4a221141f78 | 32,906 | py | Python | doll/db/model.py | badge/doll | 36d99d9dd8ab6ff2e155e8daa8dad28619e46ef7 | [
"Apache-2.0"
] | 2 | 2016-12-17T23:10:50.000Z | 2020-04-29T23:03:31.000Z | doll/db/model.py | badge/doll | 36d99d9dd8ab6ff2e155e8daa8dad28619e46ef7 | [
"Apache-2.0"
] | 3 | 2015-08-30T16:11:50.000Z | 2015-09-01T19:59:50.000Z | doll/db/model.py | badge/doll | 36d99d9dd8ab6ff2e155e8daa8dad28619e46ef7 | [
"Apache-2.0"
] | null | null | null | """Defines the model for the database.
This package defines the database model, which is in roughly three parts:
1. Type classes, linked with type_ tables in the database, which define
the basic elements of other classes, such as word age, or declension.
In general, these come from the inflections_package.ads f... | 41.918471 | 109 | 0.655656 |
62e35bc0a2ed860aa00cec6c327d59c4417bf48c | 11,244 | py | Python | CHAID/stats.py | dbaelipro/CHAID | 2f84e94c5bc1ed672ae0730e6e3477cb877acd2c | [
"Apache-2.0"
] | null | null | null | CHAID/stats.py | dbaelipro/CHAID | 2f84e94c5bc1ed672ae0730e6e3477cb877acd2c | [
"Apache-2.0"
] | null | null | null | CHAID/stats.py | dbaelipro/CHAID | 2f84e94c5bc1ed672ae0730e6e3477cb877acd2c | [
"Apache-2.0"
] | 1 | 2022-01-03T07:36:24.000Z | 2022-01-03T07:36:24.000Z | import collections as cl
from .column import NominalColumn, OrdinalColumn, ContinuousColumn
from .split import Split
import numpy as np
from scipy import stats
from .invalid_split_reason import InvalidSplitReason
from numpy import nan as NaN
def chisquare(n_ij, weighted):
"""
Calculates the chisquare for a mat... | 44.094118 | 121 | 0.557898 |
62e392d9347485ea4193ebe1a1e8036f09851567 | 53 | py | Python | Seeder/contracts/__init__.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 8 | 2017-08-16T19:18:57.000Z | 2022-01-24T10:08:19.000Z | Seeder/contracts/__init__.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 242 | 2017-02-03T19:15:52.000Z | 2022-03-25T08:02:52.000Z | Seeder/contracts/__init__.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 2 | 2019-03-06T12:36:29.000Z | 2019-07-08T12:52:20.000Z | default_app_config = 'contracts.apps.ContractConfig'
| 26.5 | 52 | 0.849057 |
62e3e0b8f25756a67fa3961414df22aa513eab9a | 5,010 | py | Python | annotation_scripts/process_entities.py | julietteBergoend/plumcot-prodigy | aaac14df24309e5b2064b213031d288d284a6747 | [
"MIT"
] | 1 | 2021-06-22T12:43:42.000Z | 2021-06-22T12:43:42.000Z | annotation_scripts/process_entities.py | julietteBergoend/plumcot-prodigy | aaac14df24309e5b2064b213031d288d284a6747 | [
"MIT"
] | null | null | null | annotation_scripts/process_entities.py | julietteBergoend/plumcot-prodigy | aaac14df24309e5b2064b213031d288d284a6747 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""Usage:
add_entity_linking.py <episode> <data_base_name> <path_to_corpora>
"""
### Adding Entity Linking annotations (3rd person & names) - fgyrom Prodi
# Arguments : episode to process, database
import os
import json
from forced_alignment import ForcedAlignment
from doco... | 31.708861 | 146 | 0.521557 |
62e3e4a7d2a503af019658fd88fffe99205bc740 | 990 | py | Python | Chapter25/12.4.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | 19 | 2018-06-28T15:48:47.000Z | 2022-01-08T12:40:52.000Z | Chapter25/12.4.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | null | null | null | Chapter25/12.4.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | 13 | 2018-06-30T10:33:52.000Z | 2021-12-29T11:31:31.000Z | import GPIO library
import RPi.GPIO as GPIO
import time
import time
import Adafruit_ADS1x15
adc0 = Adafruit_ADS1x15.ADS1115()
GAIN = 1
adc0.start_adc(0, gain=GAIN)
adc1.start_adc(1, gain=GAIN)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
PCount = 0
while True:
F_value = adc0.get_last_result()
F1... | 24.75 | 43 | 0.590909 |
62e3f0bfb7dd91d2db649925a8943af9b432a1ba | 4,879 | py | Python | pseudo_cl_likelihood/cf.py | robinupham/pseudo_cl_likelihood | 360a425d325ae4db509b1f960cbd3de1f1ffccdf | [
"MIT"
] | null | null | null | pseudo_cl_likelihood/cf.py | robinupham/pseudo_cl_likelihood | 360a425d325ae4db509b1f960cbd3de1f1ffccdf | [
"MIT"
] | null | null | null | pseudo_cl_likelihood/cf.py | robinupham/pseudo_cl_likelihood | 360a425d325ae4db509b1f960cbd3de1f1ffccdf | [
"MIT"
] | null | null | null | """
Functions to calculate the pseudo-Cl characteristic function in 1 or 3 dimensions,
implementing eqn 28 of arXiv:1908.00795.
"""
import multiprocessing as mp
import numpy as np
def cf_1d(l, alm_cov, steps=100000):
"""
Characteristic function for the marginal likelihood distribution of a single auto- pseud... | 34.118881 | 118 | 0.480221 |
62e40102c3c61ae67822995cd53c9ccdc2f5b1a2 | 2,624 | py | Python | tests/core/web3-module/test_keccak.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | tests/core/web3-module/test_keccak.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | tests/core/web3-module/test_keccak.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | # coding=utf-8
import pytest
from hexbytes import (
HexBytes,
)
from platon import Web3
@pytest.mark.parametrize(
'message, digest',
[
('cowmö', HexBytes('0x0f355f04c0a06eebac1d219b34c598f85a1169badee164be8a30345944885fe8')),
('', HexBytes('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82... | 24.523364 | 98 | 0.644436 |
62e411a616f47e3a153608cd1581cf953259467a | 958 | py | Python | tests/test_menger.py | InCogNiTo124/knarrow | b0a19273a27e68899d982bcc0bf0938c60d3ec26 | [
"Apache-2.0"
] | 2 | 2021-10-10T11:12:53.000Z | 2021-12-14T13:55:30.000Z | tests/test_menger.py | InCogNiTo124/knarrow | b0a19273a27e68899d982bcc0bf0938c60d3ec26 | [
"Apache-2.0"
] | 17 | 2021-09-30T21:51:28.000Z | 2022-03-27T23:33:17.000Z | tests/test_menger.py | InCogNiTo124/knarrow | b0a19273a27e68899d982bcc0bf0938c60d3ec26 | [
"Apache-2.0"
] | null | null | null | from knarrow.menger import double_triangle_area, get_squared_vector_lengths
import numpy as np
import pytest
@pytest.mark.parametrize(
"vertices,output",
[
(np.array([[1.0, 1], [2, 3], [5, 8]]), np.array([5.0, 34, 65])),
],
)
def test_get_squared_vector_lenghts(vertices, output):
result = get_... | 29.9375 | 75 | 0.628392 |
62e41633b836a83a2589a66db701f2d5e2515677 | 20,411 | py | Python | Recursive/model.py | simon2112/OCR | 506ec018dc67832b41979784bfc847e1c7d73480 | [
"MIT"
] | 5 | 2020-02-29T09:09:01.000Z | 2021-03-16T07:02:52.000Z | Recursive/model.py | simon2112/OCR | 506ec018dc67832b41979784bfc847e1c7d73480 | [
"MIT"
] | null | null | null | Recursive/model.py | simon2112/OCR | 506ec018dc67832b41979784bfc847e1c7d73480 | [
"MIT"
] | 1 | 2021-03-16T07:02:53.000Z | 2021-03-16T07:02:53.000Z | from __future__ import absolute_import
from __future__ import division
import time
import os
import math
import logging
import sys
import distance
import numpy as np
import tensorflow as tf
from six.moves import xrange # pylint: disable=redefined-builtin
from cnn import CNN
from seq2seq_model import Seq2SeqModel
fr... | 40.659363 | 100 | 0.542649 |
62e43108264edbbcefb41189c7f4a28f3eb86d90 | 522 | py | Python | terrascript/provider/opsgenie/opsgenie.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/provider/opsgenie/opsgenie.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/provider/opsgenie/opsgenie.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/provider/opsgenie/opsgenie.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:23:56 UTC)
import terrascript
class opsgenie(terrascript.Provider):
"""Terraform OpsGenie provider"""
__description__ = "Terraform OpsGenie provider"
__namespace__ = "opsgenie"
__name__ = "opsg... | 26.1 | 74 | 0.722222 |
62e4533f731bd7cc6771fa2d2ae76e57b18a82f6 | 2,479 | py | Python | listen/test/event_based_scan/test_port_update.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | listen/test/event_based_scan/test_port_update.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | listen/test/event_based_scan/test_port_update.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 45.072727 | 92 | 0.594595 |
62e46356fe04e6a2859fc2efdd126720692d11ee | 972 | py | Python | adrenaline/snaps_adrenaline/deployment/kubernetes/post_process.py | anniyanvr/snaps-kubernetes | 6114d15fdb476a2235cd73bd9118072c698ba045 | [
"Apache-2.0"
] | 20 | 2018-07-24T23:32:11.000Z | 2021-11-08T10:28:45.000Z | adrenaline/snaps_adrenaline/deployment/kubernetes/post_process.py | anniyanvr/snaps-kubernetes | 6114d15fdb476a2235cd73bd9118072c698ba045 | [
"Apache-2.0"
] | 195 | 2018-07-25T19:59:44.000Z | 2021-12-15T04:39:27.000Z | adrenaline/snaps_adrenaline/deployment/kubernetes/post_process.py | anniyanvr/snaps-kubernetes | 6114d15fdb476a2235cd73bd9118072c698ba045 | [
"Apache-2.0"
] | 7 | 2018-08-23T11:35:57.000Z | 2020-06-29T08:25:25.000Z | # Copyright 2018 ARICENT HOLDINGS LUXEMBOURG SARL and Cable Television
# Laboratories, 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
#
#... | 36 | 77 | 0.768519 |
62e471fcfd3664e6d05c98531692a8ceffea03a9 | 4,721 | py | Python | helmnet/source_module.py | sio13/helmnet | 514a2035b4e043825d444496eda375b3d954f853 | [
"MIT"
] | 5 | 2021-08-17T07:43:03.000Z | 2022-02-07T01:00:57.000Z | helmnet/source_module.py | sio13/helmnet | 514a2035b4e043825d444496eda375b3d954f853 | [
"MIT"
] | 9 | 2021-08-03T22:09:17.000Z | 2022-02-07T09:36:18.000Z | helmnet/source_module.py | sio13/helmnet | 514a2035b4e043825d444496eda375b3d954f853 | [
"MIT"
] | 5 | 2021-07-12T03:31:41.000Z | 2022-02-07T01:02:07.000Z | import torch
import torch.nn as nn
class SourceModule(nn.Module):
"""Defines a (complex) monochromatic source. This is made to work easily with
pytorch, so some outputs may have some extra dimension which appear counter-intuitive.
"""
def __init__(
self,
image_size: int,
omega... | 40.350427 | 99 | 0.600932 |
62e47c17c98c60f8d0c8ebdae3ee8c1daff27059 | 8,445 | py | Python | eisen/utils/workflows/workflows.py | dasturge/eisen-core | 09056f1e6aff450ef402b35b10ef96a7d4a3ff87 | [
"MIT"
] | null | null | null | eisen/utils/workflows/workflows.py | dasturge/eisen-core | 09056f1e6aff450ef402b35b10ef96a7d4a3ff87 | [
"MIT"
] | null | null | null | eisen/utils/workflows/workflows.py | dasturge/eisen-core | 09056f1e6aff450ef402b35b10ef96a7d4a3ff87 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import uuid
from eisen import EISEN_BEST_MODEL_LOSS, EISEN_BEST_MODEL_METRIC
from eisen.utils import merge_two_dicts
from pydispatch import dispatcher
def convert_output_dict_to_cpu(output_dict):
for typ in ['losses', 'metrics']:
for i in range(len(output_dict[typ])):
... | 37.039474 | 127 | 0.57537 |
62e4d9de9cc918c9cad4a3d94e285f5e0ad110d6 | 16,419 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_portalbase/__init__.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_portalbase/__init__.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_portalbase/__init__.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_portalbase`
================================================================================
Base ... | 36.085714 | 100 | 0.596991 |
62e4eb67d67b8d3a3f3a5e51f158003e3b029fc8 | 6,062 | py | Python | rlkit/samplers/rollout_functions.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | rlkit/samplers/rollout_functions.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | rlkit/samplers/rollout_functions.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | from functools import partial
import numpy as np
create_rollout_function = partial
def multitask_rollout(
env,
agent,
max_path_length=np.inf,
render=False,
render_kwargs=None,
observation_key=None,
desired_goal_key=None,
get_action_kwargs=None,
... | 27.0625 | 76 | 0.614979 |
62e4eee7ea0d62da44af40069d08bc1633b2b1c7 | 9,704 | py | Python | soinn/test_soinn.py | fukatani/soinn | 42273edee0a4f198ee08fe5df868d3346d7f3fac | [
"MIT"
] | 44 | 2016-10-03T02:03:33.000Z | 2022-03-31T01:57:14.000Z | soinn/test_soinn.py | fukatani/soinn | 42273edee0a4f198ee08fe5df868d3346d7f3fac | [
"MIT"
] | 2 | 2020-05-26T22:01:08.000Z | 2021-12-07T06:44:21.000Z | soinn/test_soinn.py | fukatani/soinn | 42273edee0a4f198ee08fe5df868d3346d7f3fac | [
"MIT"
] | 22 | 2016-09-17T05:24:48.000Z | 2021-04-30T08:16:40.000Z | import unittest
import numpy as np
from scipy.sparse import dok_matrix
from soinn import Soinn
class TestSoinn(unittest.TestCase):
def setUp(self):
self.soinn = Soinn()
self.soinn.nodes = np.array([[0, 0], [1, 0], [1, 1], [0, 1]], dtype=np.float64)
self.soinn.adjacent_mat = dok_matrix((4, ... | 48.039604 | 97 | 0.627267 |
62e4ff557806836c362bb1180b504769a00226ac | 1,678 | py | Python | conference/tickets.py | EuroPython/epcon | 346960c5ffebfdf33943c9aa0d98d047604f4638 | [
"BSD-2-Clause"
] | 40 | 2015-03-03T22:14:58.000Z | 2022-02-15T22:27:48.000Z | conference/tickets.py | EuroPython/epcon | 346960c5ffebfdf33943c9aa0d98d047604f4638 | [
"BSD-2-Clause"
] | 699 | 2015-01-21T10:13:29.000Z | 2022-02-08T09:26:36.000Z | conference/tickets.py | EuroPython/epcon | 346960c5ffebfdf33943c9aa0d98d047604f4638 | [
"BSD-2-Clause"
] | 96 | 2015-01-22T11:03:13.000Z | 2022-01-31T05:35:34.000Z | from django.db.models import Q
from p3.models import TicketConference
from conference.models import Ticket
from conference.fares import FARE_CODE_REGEXES, FARE_CODE_VARIANTS
def reset_ticket_settings(ticket):
tc = ticket.p3_conference
new_tc = TicketConference() # won't save this, created just to copy defau... | 27.508197 | 89 | 0.629917 |
62e5024f712f722610223080d3460d81d71d1980 | 12,975 | py | Python | tests/test_ms_data_structures.py | gitter-badger/SoCo | 65977466057748ea522a6d8b7f2a649091485a07 | [
"MIT"
] | 1 | 2019-02-07T19:57:30.000Z | 2019-02-07T19:57:30.000Z | tests/test_ms_data_structures.py | gitter-badger/SoCo | 65977466057748ea522a6d8b7f2a649091485a07 | [
"MIT"
] | null | null | null | tests/test_ms_data_structures.py | gitter-badger/SoCo | 65977466057748ea522a6d8b7f2a649091485a07 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=star-args,no-member
"""Unit tests for the music service data structures."""
from __future__ import unicode_literals
from xml.sax.saxutils import escape
import pytest
from soco.exceptions import DIDLMetadataError
from soco.ms_data_structures import (
MSAlbum, MSAlbumLis... | 37.938596 | 171 | 0.666898 |
62e50973f74859ca9bd45442015672da646d520b | 5,539 | py | Python | dataprep/clean/clean_pe_ruc.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 1,229 | 2019-12-21T02:58:59.000Z | 2022-03-30T08:12:33.000Z | dataprep/clean/clean_pe_ruc.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 680 | 2019-12-19T06:09:23.000Z | 2022-03-31T04:15:25.000Z | dataprep/clean/clean_pe_ruc.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 170 | 2020-01-08T03:27:26.000Z | 2022-03-20T20:42:55.000Z | """
Clean and validate a DataFrame column containing Peruvian fiscal numbers (RUCs).
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import pandas as pd
from stdnum.pe import ruc
fr... | 31.833333 | 98 | 0.610038 |
62e524aa19f60a56bcbae98b4429bc30ff313ae0 | 1,388 | py | Python | demisto_sdk/commands/format/update_classifier.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/format/update_classifier.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/format/update_classifier.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | from typing import Tuple
from demisto_sdk.commands.format.format_constants import (ERROR_RETURN_CODE,
SKIP_RETURN_CODE,
SUCCESS_RETURN_CODE)
from demisto_sdk.commands.format.update_generic_json import Ba... | 39.657143 | 125 | 0.618156 |
62e54e864b89e8c4dcb428efe0578ddc8aeb0186 | 11,403 | py | Python | lib/models/__init__.py | Mirofil/AutoDL-Projects | e7ee9fe27e5c5561a4b9fd1c1ee185677ef30893 | [
"MIT"
] | null | null | null | lib/models/__init__.py | Mirofil/AutoDL-Projects | e7ee9fe27e5c5561a4b9fd1c1ee185677ef30893 | [
"MIT"
] | null | null | null | lib/models/__init__.py | Mirofil/AutoDL-Projects | e7ee9fe27e5c5561a4b9fd1c1ee185677ef30893 | [
"MIT"
] | null | null | null | ##################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019 #
##################################################
from os import path as osp
from typing import List, Text
import torch
__all__ = ['change_key', 'get_cell_based_tiny_net', 'get_search_spaces', 'get_cifar_models', 'ge... | 49.150862 | 165 | 0.716829 |
62e5653e184ec913cb14efb26dbebd1111dda53c | 1,591 | py | Python | .travis/complementary/custom_configuration.py | NeolithEra/PyFunceble | 58db861d36224f279a460f4959aaa2e140ce749f | [
"MIT"
] | null | null | null | .travis/complementary/custom_configuration.py | NeolithEra/PyFunceble | 58db861d36224f279a460f4959aaa2e140ce749f | [
"MIT"
] | null | null | null | .travis/complementary/custom_configuration.py | NeolithEra/PyFunceble | 58db861d36224f279a460f4959aaa2e140ce749f | [
"MIT"
] | 1 | 2019-11-22T12:35:21.000Z | 2019-11-22T12:35:21.000Z | """
This is an example about how we can update the configuration while developping on top
of PyFunceble.
"""
import PyFunceble
from PyFunceble import test as PyFuncebleTest
# We preset the indexes (from .PyFunceble.yaml) that we want to update.
CUSTOM_CONFIGURATION_INDEX_VALUE_TO_SET = {"no_whois": True, "db_type": "j... | 34.586957 | 86 | 0.735387 |
62e57645d03d76711d0bb21790a503b907aad444 | 4,751 | py | Python | ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | 5 | 2018-06-03T05:19:40.000Z | 2021-04-16T17:10:49.000Z | ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | 6 | 2019-05-07T13:24:39.000Z | 2021-02-15T14:12:37.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 use this ... | 30.06962 | 133 | 0.671438 |
62e58e9fe358476bfad451c3d55c10a25a2dc0cc | 235 | py | Python | wimp/mc/__init__.py | lopez86/WimpSim | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | 2 | 2020-09-25T10:48:24.000Z | 2020-12-29T19:56:04.000Z | wimp/mc/__init__.py | lopez86/WimpSim | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | 1 | 2017-06-12T01:12:15.000Z | 2017-06-17T06:33:16.000Z | wimp/mc/__init__.py | lopez86/PyWIMPs | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | null | null | null | from .UniformWeightedSampler import UniformWeightedSampler
from .MaxwellWeightedSampler import MaxwellWeightedSampler
from .AcceptRejectSampler import AcceptRejectSampler
from .MCMCSampler import MCMCSampler
from .sample import Sample
| 39.166667 | 58 | 0.893617 |
62e5a0fe24f4b0e77aef7211aff045fe536e5ecc | 5,884 | py | Python | tests/_display/test_line_dot_setting_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | tests/_display/test_line_dot_setting_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | tests/_display/test_line_dot_setting_interface.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | import re
from random import randint
from typing import Match
from typing import Optional
from retrying import retry
import apysc as ap
from apysc._display.line_dot_setting_interface import LineDotSettingInterface
from apysc._expression import expression_data_util
from apysc._expression import var_names
fr... | 46.330709 | 78 | 0.720428 |
62e5a75d338c15fe7987d1c3245768c7eb5e34e7 | 130 | py | Python | tkinter/basic/test/test6.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | tkinter/basic/test/test6.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | tkinter/basic/test/test6.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/evn python
# -*- coding: utf-8 -*-
# python version 2.7.6
import easygui
print easygui.fileopenbox()
easygui.egdemo() | 16.25 | 27 | 0.692308 |
62e5b1194c087648fe129a2d001c6961bc2e2fa6 | 2,190 | py | Python | main.py | andela-bmosigisi/team-ngeuss | 5f68dde70d064547e094ef8218c6bb4bd9fa0f2e | [
"Apache-2.0"
] | null | null | null | main.py | andela-bmosigisi/team-ngeuss | 5f68dde70d064547e094ef8218c6bb4bd9fa0f2e | [
"Apache-2.0"
] | 2 | 2016-02-11T20:22:02.000Z | 2016-02-11T20:22:51.000Z | main.py | andela-bmosigisi/team-ngeuss | 5f68dde70d064547e094ef8218c6bb4bd9fa0f2e | [
"Apache-2.0"
] | null | null | null | from greedy.greedy import *
from generate_matrix import get_input_matrix
from serializer.command_generator import generate_command
import sys
import os
if __name__ == '__main__':
# Receive the filename from the console args.
filename = sys.argv[1]
matrix = get_input_matrix(filename)
line_1 = ''
wi... | 32.686567 | 72 | 0.548402 |
62e5c0ea191af37c10283e25aa77e29b1f62813b | 4,694 | py | Python | week3/hangman-game.py | donatasbimba/MITx | e915b2f7c26988867141b882ee126ef810919916 | [
"MIT"
] | null | null | null | week3/hangman-game.py | donatasbimba/MITx | e915b2f7c26988867141b882ee126ef810919916 | [
"MIT"
] | null | null | null | week3/hangman-game.py | donatasbimba/MITx | e915b2f7c26988867141b882ee126ef810919916 | [
"MIT"
] | null | null | null | # Hangman game
#
# -----------------------------------
# Helper code
# You don't need to understand this helper code,
# but you will have to know how to use the functions
# (so be sure to read the docstrings!)
import random
WORDLIST_FILENAME = "words.txt"
def loadWords():
"""
Returns a list of valid words. ... | 30.679739 | 82 | 0.621858 |
62e5cd67dd595d1c5a2a499d7d8727f9c49ecca3 | 2,154 | py | Python | alipay/aop/api/response/AlipayEbppIsvImportedbillQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayEbppIsvImportedbillQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayEbppIsvImportedbillQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayEbppIsvImportedbillQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayEbppIsvImportedbillQueryResponse, self).__init__()
self._analysis_fail_count =... | 32.636364 | 111 | 0.706592 |
62e5ce50d85403d3277cef2b36dcff1a02f415ad | 5,727 | py | Python | jawa/attribute.py | 4577/Jawa | 23f93020ef6687567e45a9afa09bfd6e0faf6f0a | [
"MIT"
] | null | null | null | jawa/attribute.py | 4577/Jawa | 23f93020ef6687567e45a9afa09bfd6e0faf6f0a | [
"MIT"
] | null | null | null | jawa/attribute.py | 4577/Jawa | 23f93020ef6687567e45a9afa09bfd6e0faf6f0a | [
"MIT"
] | 1 | 2021-01-21T12:17:39.000Z | 2021-01-21T12:17:39.000Z | import inspect
import pkgutil
import importlib
from typing import IO, Callable, Iterator, Union, Dict, Any, Tuple
from struct import unpack, pack
from itertools import repeat
from jawa.constants import UTF8
from jawa.util.stream import BufferStreamReader
class Attribute(object):
ADDED_IN: int = None
MINIMUM_... | 30.142105 | 79 | 0.587917 |
62e5dae95cebc4968c64766cce9d968b562e1941 | 14,869 | py | Python | dict_table.py | kangwonlee/reposetman | ca35026a37a9f60479bf19ad542761a56ecd0783 | [
"MIT"
] | null | null | null | dict_table.py | kangwonlee/reposetman | ca35026a37a9f60479bf19ad542761a56ecd0783 | [
"MIT"
] | 109 | 2018-09-18T05:50:02.000Z | 2020-03-19T04:55:35.000Z | dict_table.py | kangwonlee/reposetman | ca35026a37a9f60479bf19ad542761a56ecd0783 | [
"MIT"
] | 1 | 2018-09-17T15:39:21.000Z | 2018-09-17T15:39:21.000Z | import os
import unique_list
class RepoTable(object):
def __init__(self):
# header row
self.column = unique_list.unique_list()
# table body
self.index = {}
def __getitem__(self, item):
return self.index[item]
def __iter__(self):
for key in self.index:
... | 28.43021 | 117 | 0.558545 |
62e5e45f50e4de0fdf9bb07d11cd0ca458c1fd50 | 9,824 | py | Python | numerous/engine/variables.py | fossilfree/Numerous | 121cd00456f263cab9def10cb99a21655f5832c9 | [
"BSD-3-Clause"
] | null | null | null | numerous/engine/variables.py | fossilfree/Numerous | 121cd00456f263cab9def10cb99a21655f5832c9 | [
"BSD-3-Clause"
] | null | null | null | numerous/engine/variables.py | fossilfree/Numerous | 121cd00456f263cab9def10cb99a21655f5832c9 | [
"BSD-3-Clause"
] | null | null | null | from dataclasses import dataclass
from enum import Enum
from typing import Any
import uuid
from functools import reduce
from operator import add
from numerous.utils.logger_levels import LoggerLevel
class VariableBase:
pass
class VariableType(Enum):
CONSTANT = 0
PARAMETER = 1
STATE = 2
DERIVATIVE... | 34.470175 | 114 | 0.560057 |
62e634fd8d25e7a6c75902e832f869ed403bd9af | 3,991 | py | Python | alipay/aop/api/request/AlipayCommerceDataCampaignCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayCommerceDataCampaignCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayCommerceDataCampaignCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceDataCampaignCreateModel import AlipayCommerceDataCampaignCreateModel
class AlipayCommerceDataCampaignCreateRequest(obj... | 27.524138 | 148 | 0.646455 |
62e65b8aba4a1afb4053bae55a364154098ac331 | 14,281 | py | Python | configs/mvxnet/actr_v2/dv_parallel_mvx_actrv2_agg2_pgd_hybrid_kitti-3d-3class.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/actr_v2/dv_parallel_mvx_actrv2_agg2_pgd_hybrid_kitti-3d-3class.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/actr_v2/dv_parallel_mvx_actrv2_agg2_pgd_hybrid_kitti-3d-3class.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/schedules/cosine.py', '../../_base_/default_runtime.py'
]
# model settings
voxel_size = [0.05, 0.05, 0.1]
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='ParallelMVXMono3D',
loss_pts_w = 1.,
loss_img_w = 0.125,
use_li_fusion_layer=True,
pos_li_fusion_... | 32.829885 | 79 | 0.563406 |
62e65ca9d96ff6bfd14f71e3b7426b6470777c52 | 27,518 | py | Python | bonneville/modules/postgres.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/modules/postgres.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/modules/postgres.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | 3 | 2020-05-10T02:08:44.000Z | 2020-11-06T11:01:57.000Z | # -*- coding: utf-8 -*-
'''
Module to provide Postgres compatibility to bonneville.
:configuration: In order to connect to Postgres, certain configuration is
required in /etc/salt/minion on the relevant minions. Some sample configs
might look like::
postgres.host: 'localhost'
postgres.port: '5... | 30.473976 | 100 | 0.545497 |
62e67d9d364d9bf178623e1290fec2373d922eb5 | 7,377 | py | Python | clients/kratos/python/ory_kratos_client/model/port.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/port.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/port.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 40.756906 | 446 | 0.589399 |
62e6980ec5d1796c596f033edec3caeaf118f8e3 | 15,475 | py | Python | tests/test_tx_deserialization.py | LedgerHQ/ledger-app-neo3 | 48e1e0dec3e4801fc3ab1b07c4fe4ed86735a642 | [
"MIT"
] | null | null | null | tests/test_tx_deserialization.py | LedgerHQ/ledger-app-neo3 | 48e1e0dec3e4801fc3ab1b07c4fe4ed86735a642 | [
"MIT"
] | 5 | 2021-09-13T16:41:52.000Z | 2022-01-12T16:00:21.000Z | tests/test_tx_deserialization.py | isabella232/app-neo3 | c48ec5032143fe606d694372c2cfc02082b2ce03 | [
"MIT"
] | 3 | 2021-09-01T11:40:09.000Z | 2022-03-06T06:45:13.000Z | from typing import Union, cast, List, Tuple
import re
import enum
import struct
import logging
from neo3.network.payloads import WitnessScope, Transaction, Signer, HighPriorityAttribute, OracleResponse
from neo3.core import types, serialization
from pathlib import Path
from boilerplate_client.utils import bip44_path_... | 36.845238 | 125 | 0.675283 |
62e69e9c810b8b0d8e1fcbf27ccf08a81e91ddfa | 1,021 | py | Python | python_lib/create_watchmen_cf.py | adrianmkng/watchmen | 4be15ad64a5d54d4f546ca8c139fa41fd42dd6aa | [
"Apache-2.0"
] | 190 | 2017-12-13T05:01:42.000Z | 2021-11-15T23:35:54.000Z | python_lib/create_watchmen_cf.py | adrianmkng/watchmen | 4be15ad64a5d54d4f546ca8c139fa41fd42dd6aa | [
"Apache-2.0"
] | 2 | 2018-08-31T04:53:03.000Z | 2018-11-14T00:13:49.000Z | python_lib/create_watchmen_cf.py | adrianmkng/watchmen | 4be15ad64a5d54d4f546ca8c139fa41fd42dd6aa | [
"Apache-2.0"
] | 22 | 2017-12-13T04:36:46.000Z | 2021-07-29T07:37:41.000Z | # Copyright 2017 Insurance Australia Group Limited
#
# 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 ag... | 36.464286 | 103 | 0.783546 |
62e69fb89b71153125b4dce74b1e3cd5b4919ecd | 13,213 | py | Python | src/onevision/datasets/realblur/realblurj.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | 2 | 2022-03-28T09:46:38.000Z | 2022-03-28T14:12:32.000Z | src/onevision/datasets/realblur/realblurj.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | null | null | null | src/onevision/datasets/realblur/realblurj.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""RealBlur-J dataset and datamodule.
"""
from __future__ import annotations
import os
import random
from typing import Callable
from typing import Optional
import matplotlib.pyplot as plt
from torch.utils.data import random_split
from onevision.cv import show_images
f... | 38.634503 | 85 | 0.583289 |
62e6ac742109704e6e00dbea792cfa640fef2a47 | 20,425 | py | Python | source/yolov3/models.py | FrancescoSaverioZuppichini/Smash-Bros-Melee | 4ca6f67240bfe60e86a82409c4056aaa25a5a860 | [
"MIT"
] | null | null | null | source/yolov3/models.py | FrancescoSaverioZuppichini/Smash-Bros-Melee | 4ca6f67240bfe60e86a82409c4056aaa25a5a860 | [
"MIT"
] | null | null | null | source/yolov3/models.py | FrancescoSaverioZuppichini/Smash-Bros-Melee | 4ca6f67240bfe60e86a82409c4056aaa25a5a860 | [
"MIT"
] | null | null | null | import torch.nn.functional as F
from .utils.google_utils import *
from .utils.parse_config import *
from .utils.utils import *
ONNX_EXPORT = False
def create_modules(module_defs, img_size, arc):
# Constructs module list of layer blocks from module configuration in module_defs
hyperparams = module_defs.pop(... | 45.795964 | 120 | 0.550649 |
62e6c13e1e7e7fc14c02800010dd081984ec5a93 | 1,079 | py | Python | pywechat/main.py | OctavianLee/pywechat | d9ceae01c5da0c8341fa7b5a964f6e1f7a3a9c35 | [
"MIT"
] | 3 | 2015-05-29T15:13:32.000Z | 2016-04-12T10:46:48.000Z | pywechat/main.py | OctavianLee/Wechat | d9ceae01c5da0c8341fa7b5a964f6e1f7a3a9c35 | [
"MIT"
] | 2 | 2015-06-05T07:49:24.000Z | 2015-11-09T02:47:54.000Z | pywechat/main.py | OctavianLee/Wechat | d9ceae01c5da0c8341fa7b5a964f6e1f7a3a9c35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pywechat.services.wechat_shake import ShakeService
from pywechat.services.wechat_card import CardService
from pywechat.excepts import CodeBuildError
class WechatService(object):
"""This class is a role of factory.
Attributes:
app_id: the app id of a wechat account.
... | 25.690476 | 71 | 0.627433 |
62e6dff64d5d2b29d12abce1924468f14c331e3a | 18,163 | py | Python | starthinker/util/dbm/__init__.py | danieldjewell/starthinker | 3327d5874f01d7563603b8a82c1ecd6615b9768d | [
"Apache-2.0"
] | 1 | 2020-12-04T17:13:35.000Z | 2020-12-04T17:13:35.000Z | starthinker/util/dbm/__init__.py | hgrias/starthinker | b9ed33e23b4ffd72565a31ebb8a8041d346bfca2 | [
"Apache-2.0"
] | null | null | null | starthinker/util/dbm/__init__.py | hgrias/starthinker | b9ed33e23b4ffd72565a31ebb8a8041d346bfca2 | [
"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
#
# https://www.apache.org/l... | 29.0608 | 115 | 0.659142 |
62e6e747de8a9a94ecf06e9c9598885a08e8bc85 | 6,960 | py | Python | tests/end_to_end/examples/test/test_candidates_reader.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 5 | 2021-08-25T09:29:14.000Z | 2022-03-09T08:59:07.000Z | tests/end_to_end/examples/test/test_candidates_reader.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 251 | 2020-10-30T09:49:29.000Z | 2022-03-31T12:28:48.000Z | tests/end_to_end/examples/test/test_candidates_reader.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 5 | 2020-12-16T15:11:33.000Z | 2021-06-18T05:03:59.000Z | import os
from pathlib import Path
import numpy as np
import pytest
from ..candidates_reader import CandidatesReader, IniFileNotFound, CandidateNotFound
class TestCandidateReader:
def _create_reader(self, tmp_path, content):
file_path = tmp_path / 'test.ini'
file_path.write_text(content)
... | 49.361702 | 198 | 0.640805 |
62e70b12fea9577051e64fbf0d2633e17e93e3d8 | 11,322 | py | Python | python_modules/dagster/dagster/core/storage/schedules/sql_schedule_storage.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/schedules/sql_schedule_storage.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/schedules/sql_schedule_storage.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from abc import abstractmethod
from collections import defaultdict
from typing import Iterable, Mapping, Optional, Sequence, cast
import sqlalchemy as db
from dagster import check
from dagster.core.definitions.run_request import InstigatorType
from dagster.core.errors import DagsterInvariantViolationError
from dagste... | 37.490066 | 101 | 0.606872 |
62e70c161dd193cb40f064bbdedd57e6ab1cf225 | 986 | py | Python | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/systems/metric_container_crawler.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 108 | 2015-07-21T10:40:36.000Z | 2021-07-01T06:54:51.000Z | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/systems/metric_container_crawler.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 320 | 2015-07-21T01:33:20.000Z | 2020-07-21T15:57:02.000Z | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/systems/metric_container_crawler.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 61 | 2015-07-20T18:26:37.000Z | 2021-03-17T01:18:54.000Z | import logging
import utils.dockerutils
from icrawl_plugin import IContainerCrawler
from utils.metric_utils import crawl_metrics
from utils.namespace import run_as_another_namespace, ALL_NAMESPACES
logger = logging.getLogger('crawlutils')
class MetricContainerCrawler(IContainerCrawler):
def get_feature(self):
... | 32.866667 | 72 | 0.647059 |
62e724adb3c6defb99d3094683f539ec49cc3055 | 10,759 | py | Python | tree/regression.py | wwyf/pyml | 53ba894187a29823e7461aaae1d4cb35ecfd4386 | [
"MIT"
] | null | null | null | tree/regression.py | wwyf/pyml | 53ba894187a29823e7461aaae1d4cb35ecfd4386 | [
"MIT"
] | null | null | null | tree/regression.py | wwyf/pyml | 53ba894187a29823e7461aaae1d4cb35ecfd4386 | [
"MIT"
] | null | null | null | import numpy as np
from pydot import Dot, Edge, Node
from pyml.logger import logger
def generate_counter(counter=0):
while True:
yield counter
counter += 1
generate_id = generate_counter()
def square_error(l):
"""
计算一维数组的数据的方差
l : 1d array-like shpae(n_samples, )
"""
return ... | 39.266423 | 171 | 0.606562 |
62e72641520e0bb18936643c432a1f5fe0acb159 | 5,673 | py | Python | results.py | joaovitorblabres/sumo-rl | ec9d178cd0289366ba0a8648da52972d31d1026e | [
"MIT"
] | null | null | null | results.py | joaovitorblabres/sumo-rl | ec9d178cd0289366ba0a8648da52972d31d1026e | [
"MIT"
] | null | null | null | results.py | joaovitorblabres/sumo-rl | ec9d178cd0289366ba0a8648da52972d31d1026e | [
"MIT"
] | null | null | null | import statistics
import copy
import pandas as pd
import argparse
import glob
from matplotlib import pyplot as plt
import os
import numpy as np
def moving_average(interval, window_size):
if window_size == 1:
return interval
window = np.ones(int(window_size))/float(window_size)
return np.convolve(in... | 48.905172 | 240 | 0.540807 |
62e7560012e90343d4a70a110c8ea9feec27f089 | 20,223 | py | Python | classify.py | teanoice/RESEARCH-QD-ELECTRA | 4b5a6fb42fa41e866cf329f80c66e55f14f4fa79 | [
"Apache-2.0"
] | null | null | null | classify.py | teanoice/RESEARCH-QD-ELECTRA | 4b5a6fb42fa41e866cf329f80c66e55f14f4fa79 | [
"Apache-2.0"
] | null | null | null | classify.py | teanoice/RESEARCH-QD-ELECTRA | 4b5a6fb42fa41e866cf329f80c66e55f14f4fa79 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Dong-Hyun Lee, Kakao Brain.
# (Strongly inspired by original Google BERT code and Hugging Face's code)
""" Fine-tuning on A Classification Task with pretrained Transformer """
import itertools
import csv
import fire
import json
import numpy as np
from scipy.stats import pearsonr, spearmanr
... | 36.177102 | 113 | 0.610196 |
62e75aaffadc6186839a24a199106f4b3dc32bc2 | 19 | py | Python | blesuite/__init__.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 198 | 2016-08-04T05:45:38.000Z | 2022-02-17T08:30:58.000Z | blesuite/__init__.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 13 | 2018-02-04T14:16:16.000Z | 2020-10-09T02:16:24.000Z | blesuite/__init__.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 57 | 2016-08-08T04:24:04.000Z | 2022-01-24T08:43:02.000Z | __version__ = "2.0" | 19 | 19 | 0.684211 |
62e75c87e616639c7d605608cff98e74456de353 | 40,086 | py | Python | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/operations/_sql_virtual_machines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.215548 | 342 | 0.676121 |
62e76151f43eeddae755bd71619c662906a2815d | 2,272 | py | Python | General/botInfo.py | Aggis15/T4NK0R | 05d1791e51f50bcb44c56ca936e5a11b7de21fb1 | [
"MIT"
] | null | null | null | General/botInfo.py | Aggis15/T4NK0R | 05d1791e51f50bcb44c56ca936e5a11b7de21fb1 | [
"MIT"
] | null | null | null | General/botInfo.py | Aggis15/T4NK0R | 05d1791e51f50bcb44c56ca936e5a11b7de21fb1 | [
"MIT"
] | null | null | null | import discord
from discord.commands import slash_command
from discord.ext import commands
import logging
import json
import platform
import psutil
from psutil._common import bytes2human
import math
from datetime import datetime
# Logging
logging.basicConfig(
filename="./logs/discordlogs.log",
filemode="w",
... | 28.049383 | 83 | 0.602993 |
62e77a56843744dc3da0706de8896d5a493f0632 | 1,336 | py | Python | scripts/fb/partitionEqualSubsetSum.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/fb/partitionEqualSubsetSum.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/fb/partitionEqualSubsetSum.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Given a non-empty array nums containing only positive integers,
find if the array can be partitioned into two subsets such that
the sum of elements in both subsets is equal.
Example 1:
Input: nums = [1,5,11,5]
Output: true
Explanation: The array can be partitioned as [1, 5, 5] and [11].
Example 2:
Input: nums... | 25.207547 | 78 | 0.570359 |
62e7a9304a1b786b726d7e12c972f55e3d76c892 | 207 | py | Python | days/_template.py | Kurocon/AdventOfCode2016 | 357e55025c763baa9d838b70025f968ca5e92ed7 | [
"BSD-3-Clause"
] | 3 | 2018-12-02T22:12:23.000Z | 2020-02-17T14:42:17.000Z | days/_template.py | Kurocon/AdventOfCode2016 | 357e55025c763baa9d838b70025f968ca5e92ed7 | [
"BSD-3-Clause"
] | null | null | null | days/_template.py | Kurocon/AdventOfCode2016 | 357e55025c763baa9d838b70025f968ca5e92ed7 | [
"BSD-3-Clause"
] | 5 | 2018-12-10T08:39:00.000Z | 2019-11-14T22:19:51.000Z | from days import AOCDay, day
@day(0)
class DayTemplate(AOCDay):
def common(self, input_data):
pass
def part1(self, input_data):
pass
def part2(self, input_data):
pass
| 14.785714 | 33 | 0.618357 |
62e7b58b4c63cfa9f8f69977548eb13b6dca6747 | 782 | py | Python | validate/__init__.py | sleinen/backend | 6df1a8f399586ce19aa04b85b92b2c73d2d1d7d8 | [
"Apache-2.0"
] | null | null | null | validate/__init__.py | sleinen/backend | 6df1a8f399586ce19aa04b85b92b2c73d2d1d7d8 | [
"Apache-2.0"
] | null | null | null | validate/__init__.py | sleinen/backend | 6df1a8f399586ce19aa04b85b92b2c73d2d1d7d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Cisco and its affiliates
#
# 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 a... | 41.157895 | 75 | 0.750639 |
62e7d1170f0d0e9b174040aecf1e0baa6c598d2b | 13,565 | py | Python | master/searx-master/searx/engines/google.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | master/searx-master/searx/engines/google.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | master/searx-master/searx/engines/google.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | # Google (Web)
#
# @website https://www.google.com
# @provide-api yes (https://developers.google.com/custom-search/)
#
# @using-api no
# @results HTML
# @stable no (HTML can change)
# @parse url, title, content, suggestion
import re
from flask_babel import gettext
from lxml import html, etree
fro... | 34.693095 | 111 | 0.587689 |
62e7e2993f4a5d414fd50ef47f14d71e98cdfb33 | 904 | py | Python | examples/add_autoinject_example.py | tlainevool/autoinject | 58b195a4ca11d2e5001525578a4d22599aabd91f | [
"Unlicense"
] | null | null | null | examples/add_autoinject_example.py | tlainevool/autoinject | 58b195a4ca11d2e5001525578a4d22599aabd91f | [
"Unlicense"
] | null | null | null | examples/add_autoinject_example.py | tlainevool/autoinject | 58b195a4ca11d2e5001525578a4d22599aabd91f | [
"Unlicense"
] | null | null | null | from autoinject import components, add_autoinject
import examples.movie_components as my_components
#First do the assembly
components['mp_file_name'] = 'monty_python.txt'
add_autoinject(my_components.MontyPythonMovieFinder, 'file_name=mp_file_name')
components['finder'] = my_components.MontyPythonMovieFinder()
comp... | 33.481481 | 105 | 0.810841 |
62e832a2e15cc37f99f44e959a2ad50e7af51c2d | 3,387 | py | Python | dcal/utils/data_cube_utilities/dc_rgb.py | sarah-cheesbrough/odc-sandbox-notebooks | f8b37f2efad77a5acddb56dc4a4c93b4abffe6d0 | [
"Apache-2.0"
] | 7 | 2019-05-25T04:10:29.000Z | 2022-03-24T22:43:59.000Z | dcal/utils/data_cube_utilities/dc_rgb.py | sarah-cheesbrough/odc-sandbox-notebooks | f8b37f2efad77a5acddb56dc4a4c93b4abffe6d0 | [
"Apache-2.0"
] | 3 | 2019-04-16T00:50:04.000Z | 2019-07-10T06:24:51.000Z | dcal/utils/data_cube_utilities/dc_rgb.py | sarah-cheesbrough/odc-sandbox-notebooks | f8b37f2efad77a5acddb56dc4a4c93b4abffe6d0 | [
"Apache-2.0"
] | 6 | 2019-05-18T20:52:01.000Z | 2020-02-06T05:32:50.000Z | import matplotlib.pyplot as plt
from time import time
import numpy as np
from .plotter_utils import figure_ratio, xarray_set_axes_labels, retrieve_or_create_fig_ax
# Change the bands (RGB) here if you want other false color combinations
def rgb(dataset, at_index=0, x_coord='longitude', y_coord='latitude',
ban... | 43.423077 | 116 | 0.667257 |
62e83d751ac58652b0683d35075bd18863e79a32 | 913 | py | Python | src/olympia/reviewers/tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/reviewers/tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/reviewers/tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2021-11-24T07:29:55.000Z | 2021-11-24T07:29:55.000Z | import olympia.core.logger
from olympia.addons.models import Addon
from olympia.amo.celery import task
from olympia.amo.decorators import use_primary_db
from olympia.reviewers.models import AutoApprovalSummary
log = olympia.core.logger.getLogger('z.task')
@task
@use_primary_db
def recalculate_post_review_weight(id... | 31.482759 | 79 | 0.710843 |
62e84292224ad2937193c976446ced6751dbc445 | 8,359 | py | Python | sunpy/time/tests/test_timerange.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/time/tests/test_timerange.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/time/tests/test_timerange.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import datetime
import pytest
import astropy.units as u
import sunpy.time
from sunpy.extern.six.moves import zip
tbegin_str = '2012/1/1'
tfin_str = '2012/1/2'
dt = u.Quantity(24 * 60 * 60, 's')
start = sunpy.time.parse_time(t... | 30.507299 | 95 | 0.678789 |
62e84669799504841bc0d02b0e0fdb73989fc54f | 1,518 | py | Python | tests/telegram/commands/test_add_webhook.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | tests/telegram/commands/test_add_webhook.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | 1 | 2022-02-01T18:18:28.000Z | 2022-02-01T18:18:28.000Z | tests/telegram/commands/test_add_webhook.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | import json
from typing import Dict, List
from uuid import uuid4
from webhook_telegram_bot.telegram.commands import Command
from webhook_telegram_bot.telegram.commands.add_webhook import (
add_webhook_command_handler,
)
from webhook_telegram_bot.telegram.telegram_api import TelegramAPI
async def test_add_webhook... | 29.192308 | 77 | 0.692358 |
62e8795ebe61e0e05aa63cfcd0cae500f04efeb0 | 25,321 | py | Python | gluon/contrib/pysimplesoap/server.py | ngsimon/web2py | 93297fed8a3a916b45d17f5c4d5d2b80aaf92788 | [
"BSD-3-Clause"
] | 1,573 | 2015-01-01T07:19:06.000Z | 2022-03-30T09:06:06.000Z | gluon/contrib/pysimplesoap/server.py | ngsimon/web2py | 93297fed8a3a916b45d17f5c4d5d2b80aaf92788 | [
"BSD-3-Clause"
] | 1,691 | 2015-01-03T11:03:23.000Z | 2022-03-30T07:27:28.000Z | gluon/contrib/pysimplesoap/server.py | ngsimon/web2py | 93297fed8a3a916b45d17f5c4d5d2b80aaf92788 | [
"BSD-3-Clause"
] | 895 | 2015-01-03T19:56:15.000Z | 2022-03-18T18:30:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed in the... | 40.192063 | 127 | 0.557403 |
62e87a07d28529b5114792aafefa8d601f122e00 | 134 | py | Python | inheritance_super.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | inheritance_super.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | inheritance_super.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | class A:
def spam(self):
print(1)
class B(A):
def spam(self):
print(2)
super().spam()
B().spam()
| 9.571429 | 22 | 0.455224 |
62e88b9d622f68409d0a18ec198544858c308085 | 4,875 | py | Python | tests/evaluation/test_read_write_evaluation.py | cclauss/statue | ac582dcf1cbcb4379028ef15339ac400bfe8a642 | [
"Apache-2.0"
] | 8 | 2020-09-29T12:31:08.000Z | 2022-02-28T08:49:48.000Z | tests/evaluation/test_read_write_evaluation.py | cclauss/statue | ac582dcf1cbcb4379028ef15339ac400bfe8a642 | [
"Apache-2.0"
] | 20 | 2020-06-13T20:21:27.000Z | 2022-03-29T12:52:36.000Z | tests/evaluation/test_read_write_evaluation.py | saroad2/statue | ac582dcf1cbcb4379028ef15339ac400bfe8a642 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from unittest import mock
from pytest_cases import THIS_MODULE, parametrize_with_cases
from statue.command import Command
from statue.evaluation import CommandEvaluation, Evaluation, SourceEvaluation
from tests.constants import (
ARG1,
ARG2,
COMMAND1,
COMMAND2,
COMMAND_HEL... | 31.25 | 88 | 0.635692 |
62e89357aa50cc00bfb0e82101cecffb4e080af6 | 696 | py | Python | tests/utils.py | mc-gulu-forked/bitsv | 2f89cc1ad0f950231ff925b9aea06a3047a5a941 | [
"MIT"
] | 1 | 2019-08-31T14:14:23.000Z | 2019-08-31T14:14:23.000Z | tests/utils.py | mc-gulu-forked/bitsv | 2f89cc1ad0f950231ff925b9aea06a3047a5a941 | [
"MIT"
] | 1 | 2020-01-10T13:16:36.000Z | 2020-01-10T13:16:36.000Z | tests/utils.py | mc-gulu-forked/bitsv | 2f89cc1ad0f950231ff925b9aea06a3047a5a941 | [
"MIT"
] | null | null | null | import warnings
import requests
def raise_connection_error(*args, **kwargs):
raise requests.ConnectionError
def decorate_methods(decorator, *args, **kwargs):
def decorate(cls):
for attr in cls.__dict__:
if callable(getattr(cls, attr)):
setattr(cls, attr, decorator(getatt... | 25.777778 | 82 | 0.637931 |
62e8ed70af8896f18d38aebb85d2f043d40393cc | 2,732 | py | Python | src/ralph_assets/tests/unit/tests_models.py | andrzej-jankowski/ralph_assets | 20ed7ee9cf4dfa02c4b2195835b4f45196ad9bf3 | [
"Apache-2.0"
] | null | null | null | src/ralph_assets/tests/unit/tests_models.py | andrzej-jankowski/ralph_assets | 20ed7ee9cf4dfa02c4b2195835b4f45196ad9bf3 | [
"Apache-2.0"
] | null | null | null | src/ralph_assets/tests/unit/tests_models.py | andrzej-jankowski/ralph_assets | 20ed7ee9cf4dfa02c4b2195835b4f45196ad9bf3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from django.test import TestCase
from ralph_assets.api_pricing import get_assets, get_asset_parts
from ralph_assets.models_asset... | 35.025641 | 79 | 0.623353 |
62e8fba2bc7a7f4e76f046d213fe7fede6f9cad2 | 2,348 | py | Python | problem.py | TUD-RST/pyinduct_ackrep_example | 21295c40d7fdee97651ebd60fce6a0c06fa02fdc | [
"BSD-3-Clause"
] | null | null | null | problem.py | TUD-RST/pyinduct_ackrep_example | 21295c40d7fdee97651ebd60fce6a0c06fa02fdc | [
"BSD-3-Clause"
] | null | null | null | problem.py | TUD-RST/pyinduct_ackrep_example | 21295c40d7fdee97651ebd60fce6a0c06fa02fdc | [
"BSD-3-Clause"
] | null | null | null | """
Problem file for ackrep framework
"""
import numpy as np
import pyinduct as pi
from ackrep_core import ResultContainer
from matplotlib import pyplot as plt
from simulation import FEMApproximation, ModalApproximation
class ProblemSpecification:
"""
Stabilization of an unstable heat equation of the form
... | 32.611111 | 83 | 0.604344 |
62e908dd619cd5ec921dfa9482ef0757a03b5b7e | 3,676 | py | Python | azkaban_cli/tests/test_azkaban/test_login.py | destag/azkaban-cli | 845e23c2858684024fd0fd47c2201c1ee6f69952 | [
"MIT"
] | null | null | null | azkaban_cli/tests/test_azkaban/test_login.py | destag/azkaban-cli | 845e23c2858684024fd0fd47c2201c1ee6f69952 | [
"MIT"
] | null | null | null | azkaban_cli/tests/test_azkaban/test_login.py | destag/azkaban-cli | 845e23c2858684024fd0fd47c2201c1ee6f69952 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch, ANY
import requests
import responses
import azkaban_cli.azkaban
from azkaban_cli.exceptions import LoginError
class AzkabanLoginTest(TestCase):
def setUp(self):
"""
Creates an Azkaban instance for all login tests
"""
... | 33.418182 | 117 | 0.659412 |
62e95b5f7ddbf0ec2acace7193bb5143de87713f | 2,652 | py | Python | utils/models/create-sus.py | saridut/BROWNPAK | 8a3aef5f393826e8b5d8c374a190e6e6e1140221 | [
"MIT"
] | null | null | null | utils/models/create-sus.py | saridut/BROWNPAK | 8a3aef5f393826e8b5d8c374a190e6e6e1140221 | [
"MIT"
] | null | null | null | utils/models/create-sus.py | saridut/BROWNPAK | 8a3aef5f393826e8b5d8c374a190e6e6e1140221 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Creates initial configuration for a system containing unbranched linear chains.
'''
import sys
import math
import numpy as np
from configuration import Configuration
from config_io import *
#-------------------------------------------------------------------------------
config = Configurat... | 27.340206 | 89 | 0.641403 |
62e96ef03f775ccf556fac9b6904baacbbfbf7fc | 444 | py | Python | GenerateVideo.py | zhaoying9105/vid2vid-cn | 7bf0a7a7f8c56f45c8f8025125bacb391d75b016 | [
"BSD-3-Clause"
] | 43 | 2018-01-25T03:21:37.000Z | 2022-03-16T12:51:41.000Z | GenerateVideo.py | zmgood/vid2vid-cn | 7bf0a7a7f8c56f45c8f8025125bacb391d75b016 | [
"BSD-3-Clause"
] | 6 | 2017-12-27T04:04:49.000Z | 2018-02-06T14:07:22.000Z | GenerateVideo.py | zmgood/vid2vid-cn | 7bf0a7a7f8c56f45c8f8025125bacb391d75b016 | [
"BSD-3-Clause"
] | 23 | 2017-12-07T09:51:10.000Z | 2021-07-08T21:55:50.000Z | import glob
from moviepy.editor import ImageSequenceClip
images_dir = './results/baby30/train_latest/videos/7/'
## Change XX to be objective images name
v = 'g05_c02'
images_list = glob.glob(images_dir + "v_BabyCrawling_{}**.png".format(v))
images_list.sort()
ouput_file = './{}.mp4'.format(v)
fps = 1
if __name__ ==... | 24.666667 | 73 | 0.731982 |
62e990512fd0bae128df313c7c63d0eb03cc72da | 1,500 | py | Python | portal/apps/thedaily/email_logic.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/apps/thedaily/email_logic.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/apps/thedaily/email_logic.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | # -*- coding: utf-8 -*-
from django.utils import timezone
from thedaily.models import SentMail, SubscriberEvent
# WARNING: a change in this variables should be also made in database rows already inserted.
SUBJ_FREE_ARTICLES_LIMIT = u'Usuario alcanza limite de articulos gratis'
SUBJ_MAIL_FREE_ARTICLES_LIMIT = u'Corre... | 36.585366 | 96 | 0.700667 |
62e993ba416a97f257befb4f5f8c35cb4af27493 | 10,719 | py | Python | gui/qt/slp_history_list.py | pvyhnal-generalbytes/Electron-Cash-SLP | 0da284467e390ca92cd43c52d97cd0de5ad1292c | [
"MIT"
] | 1 | 2020-02-20T05:49:29.000Z | 2020-02-20T05:49:29.000Z | gui/qt/slp_history_list.py | tomasiCF/Electron-Cash-SLP | 0da284467e390ca92cd43c52d97cd0de5ad1292c | [
"MIT"
] | null | null | null | gui/qt/slp_history_list.py | tomasiCF/Electron-Cash-SLP | 0da284467e390ca92cd43c52d97cd0de5ad1292c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 40.449057 | 136 | 0.62823 |
62e9a5ad885596e607114bd996f7ee7f53b04ed6 | 10,708 | py | Python | src/quicknlp/data/hierarchical_model_data_loader.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | src/quicknlp/data/hierarchical_model_data_loader.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | src/quicknlp/data/hierarchical_model_data_loader.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | from functools import partial
from typing import List, Optional, Callable, Union
import pandas as pd
from fastai.core import to_gpu
from fastai.dataset import ModelData
from torch import optim
from torchtext.data import Dataset, Field
from quicknlp.data.s2s_model_data_loader import EncoderDecoderLearner
from quicknlp... | 56.062827 | 130 | 0.598524 |
62e9c9b7a78e92e126d46a912cb8d6c0a5d39645 | 419 | py | Python | test/mitmproxy/proxy/test_context.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | test/mitmproxy/proxy/test_context.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | test/mitmproxy/proxy/test_context.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | from mitmproxy.proxy import context
from mitmproxy.test import tflow, taddons
def test_context():
with taddons.context() as tctx:
c = context.Context(tflow.tclient_conn(), tctx.options)
assert repr(c)
c.layers.append(1)
assert repr(c)
c2 = c.fork()
c.layers.append(2... | 26.1875 | 63 | 0.599045 |
62e9d2ef9370f6b5f934cdbaaaedf192b988c8a7 | 961 | py | Python | setup.py | cmucgit/pam-ansible-plugin | c7f1448b6da42820f9ee8d357611952a015e3d97 | [
"Apache-2.0"
] | 2 | 2021-08-13T13:55:32.000Z | 2021-10-04T21:30:43.000Z | setup.py | cmucgit/pam-ansible-plugin | c7f1448b6da42820f9ee8d357611952a015e3d97 | [
"Apache-2.0"
] | null | null | null | setup.py | cmucgit/pam-ansible-plugin | c7f1448b6da42820f9ee8d357611952a015e3d97 | [
"Apache-2.0"
] | null | null | null | from distutils.core import setup
setup(
name = 'revbits_ansible',
packages = ['revbits_ansible'],
package_dir={'': 'pam'},
version = '1.3',
license='MIT',
description = 'The PAM Secret Server Python SDK',
author = 'RevBits',
author_email = 'info@revbits.com',
keywords = ['PAM', 'Secret', 'Security', ... | 31 | 153 | 0.609781 |
62ea27adae84cfaee8d36b4d98889fd272653c6c | 1,400 | py | Python | src/auth_api/oidc/session.py | RasmusGodske/eo-auth | b25d916f8b1bb23ec5ca40de907b038b21d17713 | [
"Apache-2.0"
] | null | null | null | src/auth_api/oidc/session.py | RasmusGodske/eo-auth | b25d916f8b1bb23ec5ca40de907b038b21d17713 | [
"Apache-2.0"
] | null | null | null | src/auth_api/oidc/session.py | RasmusGodske/eo-auth | b25d916f8b1bb23ec5ca40de907b038b21d17713 | [
"Apache-2.0"
] | null | null | null | import requests
from authlib.integrations.requests_client import \
OAuth2Session as _OAuth2Session
from auth_api.config import DEBUG
class OAuth2Session(_OAuth2Session):
"""
Adds a few useful methods to the default OAuth2Session from authlib.
"""
def __init__(
self,
jwk_en... | 27.45098 | 73 | 0.594286 |
62ea3b4762f992d60702cf62561fa98aaefc1ad4 | 484 | py | Python | tests/ipcollector/test_telemetry_send.py | logdna/k8s-egress-networkpolicy-manager | 3305ed30cbd07d1b549b743d02fde53a596780ca | [
"MIT"
] | null | null | null | tests/ipcollector/test_telemetry_send.py | logdna/k8s-egress-networkpolicy-manager | 3305ed30cbd07d1b549b743d02fde53a596780ca | [
"MIT"
] | null | null | null | tests/ipcollector/test_telemetry_send.py | logdna/k8s-egress-networkpolicy-manager | 3305ed30cbd07d1b549b743d02fde53a596780ca | [
"MIT"
] | 1 | 2021-09-26T00:06:52.000Z | 2021-09-26T00:06:52.000Z | #!/usr/bin/env python3
import pytest
import requests
from ipcollector.tooling import send_payload
import json
i_expect_this_telemetry = {
'ipaddr': {
'external': '8.8.8.8',
'host': '192.168.0.1'
}
}
def test_payload():
"""
see if payload function works using public utility
"""
... | 22 | 71 | 0.667355 |
62ea4151a4bca0a0d23f8022ddbc28cfadf68fbf | 11,427 | py | Python | regolith/main.py | MichaelTrumbull/regolith | 881f543cfa7bbf80b38ed2b357209c5bc009a6af | [
"CC0-1.0"
] | null | null | null | regolith/main.py | MichaelTrumbull/regolith | 881f543cfa7bbf80b38ed2b357209c5bc009a6af | [
"CC0-1.0"
] | null | null | null | regolith/main.py | MichaelTrumbull/regolith | 881f543cfa7bbf80b38ed2b357209c5bc009a6af | [
"CC0-1.0"
] | null | null | null | """The main CLI for regolith"""
from __future__ import print_function
import copy
import os
from argparse import ArgumentParser, RawTextHelpFormatter, Namespace
from regolith.database import connect
from regolith import commands
from regolith import storage
from regolith.builder import BUILDERS
from regolith.command... | 31.221311 | 120 | 0.595694 |
62ea42f502732110435580c3b6906945a4e056e1 | 3,053 | py | Python | cifar/test_calls/show_result.py | Meng-Lingjun-xjtu/ttt-plus-plus | 0f26c689fcaa666fa3524e7c5b6de0c1cb510e89 | [
"MIT"
] | 23 | 2021-11-21T10:50:49.000Z | 2022-03-14T09:34:10.000Z | cifar/test_calls/show_result.py | Meng-Lingjun-xjtu/ttt-plus-plus | 0f26c689fcaa666fa3524e7c5b6de0c1cb510e89 | [
"MIT"
] | 2 | 2022-01-06T01:19:24.000Z | 2022-03-03T15:39:23.000Z | cifar/test_calls/show_result.py | Meng-Lingjun-xjtu/ttt-plus-plus | 0f26c689fcaa666fa3524e7c5b6de0c1cb510e89 | [
"MIT"
] | 2 | 2021-12-14T22:34:55.000Z | 2022-01-23T10:49:14.000Z | import argparse
import numpy as np
import torch
from utils.misc import *
from utils.test_helpers import pair_buckets
def analyze(idx_tbd, idx_all, err):
new_tbd = np.logical_and(idx_all, idx_tbd).sum()
new_per = new_tbd.sum() / idx_tbd.sum()
if err:
print_color('RED', '%d\t%d\t%.2f' %(idx_tbd.sum(), idx_tbd.sum... | 39.141026 | 103 | 0.711759 |
62ea4fae8c1f307231656f66770784ddb9c11807 | 11,808 | py | Python | sid/mccs.py | andreww5au/PaSD-client | 5ed7ff3e8b529c440fbfecb8c3159516285496c4 | [
"MIT"
] | null | null | null | sid/mccs.py | andreww5au/PaSD-client | 5ed7ff3e8b529c440fbfecb8c3159516285496c4 | [
"MIT"
] | null | null | null | sid/mccs.py | andreww5au/PaSD-client | 5ed7ff3e8b529c440fbfecb8c3159516285496c4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Class to handle communication with the PaSD local MCCS, when it is acting as a Modbus slave. Used by SID device to
query the MCCS instead of the FNDH or a SMARTbox.
"""
import logging
logging.basicConfig()
from pasd import transport
MCCS_ADDRESS = 63
# Register numbers for when the MCCS ... | 45.415385 | 139 | 0.623814 |
62ea68481d25336f5a7dc978cb9d3a6b1b432533 | 130 | py | Python | microscoper/__init__.py | LeeKamentsky/microscoper | 74a488a33d4b971a0df8706400338cb969c2396b | [
"MIT"
] | 7 | 2019-01-11T21:18:09.000Z | 2021-10-12T08:04:31.000Z | microscoper/__init__.py | LeeKamentsky/microscoper | 74a488a33d4b971a0df8706400338cb969c2396b | [
"MIT"
] | 5 | 2017-07-25T23:09:12.000Z | 2020-07-22T13:46:41.000Z | microscoper/__init__.py | LeeKamentsky/microscoper | 74a488a33d4b971a0df8706400338cb969c2396b | [
"MIT"
] | 6 | 2018-01-23T10:33:44.000Z | 2021-03-16T20:36:38.000Z | from .io import run
__all__ = ["run"]
__version__ = "0.3.1"
__author__ = "Kesavan Subburam"
__email__ = "pskesavan@tifrh.res.in"
| 18.571429 | 36 | 0.707692 |
62ea9937b863bb1588420853b0f68171b3f776d4 | 970 | py | Python | grouper/fe/handlers/tag_view.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | null | null | null | grouper/fe/handlers/tag_view.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | 1 | 2016-02-18T18:55:29.000Z | 2016-02-18T18:55:29.000Z | grouper/fe/handlers/tag_view.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | null | null | null | from grouper.constants import TAG_EDIT
from grouper.fe.util import GrouperHandler
from grouper.model_soup import Permission
from grouper.models.public_key_tag import PublicKeyTag
from grouper.public_key import get_public_key_tag_permissions
from grouper.user_permissions import user_has_permission
class TagView(Groupe... | 38.8 | 91 | 0.729897 |
62ea9be7b07224a95bb3529953271f1303577c61 | 131,638 | py | Python | nova/tests/network/test_manager.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/tests/network/test_manager.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/tests/network/test_manager.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Rackspace
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2013 IBM Corp.
# 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
#
# ... | 45.43942 | 79 | 0.554954 |
62eab9efeca3a92043ccee369091f40684f47cce | 3,708 | py | Python | lib/function_network/func_network.py | ta-assistant/Admin-CLI | 1c03ede0e09d8ddc270646937aa7af463c55f1f5 | [
"MIT"
] | 1 | 2021-07-22T15:43:02.000Z | 2021-07-22T15:43:02.000Z | lib/function_network/func_network.py | ta-assistant/Admin-CLI | 1c03ede0e09d8ddc270646937aa7af463c55f1f5 | [
"MIT"
] | 28 | 2021-05-15T08:18:21.000Z | 2021-08-02T06:12:30.000Z | lib/function_network/func_network.py | ta-assistant/TA-CLI | 1c03ede0e09d8ddc270646937aa7af463c55f1f5 | [
"MIT"
] | null | null | null | import os, sys, inspect, json
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from file_management.createapikeyfile import SaveApiKey
from file_management.file_management_lib import WorkEditor
from file_manageme... | 38.625 | 137 | 0.610032 |
62eac27f500b442638560b4c7dccc9fa1a1ce9bf | 2,136 | py | Python | BitsBack/datasets.py | deepaks4077/bits-back | 0d4355302eb4c5a18a229fa15a0a1caf8fe529d4 | [
"MIT"
] | null | null | null | BitsBack/datasets.py | deepaks4077/bits-back | 0d4355302eb4c5a18a229fa15a0a1caf8fe529d4 | [
"MIT"
] | null | null | null | BitsBack/datasets.py | deepaks4077/bits-back | 0d4355302eb4c5a18a229fa15a0a1caf8fe529d4 | [
"MIT"
] | null | null | null | """
Obtain the MNIST and binarized MNIST datasets
"""
from torchvision import datasets, transforms
import numpy as np
from numpy.random import RandomState
def download_MNIST(use_training_set=False):
"""
Use Torchvision datasets and transform to a float WxHxD tensor.
In the case of MNIST, we have a 28x28x1... | 29.260274 | 140 | 0.700375 |
62eac5446ad23f16d36ee3d8bc06d92eac60c085 | 2,270 | py | Python | botoflow/workers/threaded_executor.py | boto/botoflow | 49d8ed3bc9c57294504be82e933a051e1901b76e | [
"Apache-2.0"
] | 13 | 2016-06-15T06:10:57.000Z | 2021-10-30T03:52:28.000Z | botoflow/workers/threaded_executor.py | DalavanCloud/botoflow | 49d8ed3bc9c57294504be82e933a051e1901b76e | [
"Apache-2.0"
] | 11 | 2016-09-15T01:48:08.000Z | 2019-01-09T06:11:44.000Z | botoflow/workers/threaded_executor.py | DalavanCloud/botoflow | 49d8ed3bc9c57294504be82e933a051e1901b76e | [
"Apache-2.0"
] | 16 | 2016-06-05T03:42:04.000Z | 2022-03-01T17:43:14.000Z | # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompa... | 29.102564 | 75 | 0.638326 |
62eac8b6b4b5a68e3a5b4f1e15db2cc9798ee4a8 | 12,392 | py | Python | src/logml/models/sklearn_model.py | AstraZeneca-NGS/LogMl | cf254b358150f0f96a9dd2ea50de56acdc15bd56 | [
"MIT"
] | null | null | null | src/logml/models/sklearn_model.py | AstraZeneca-NGS/LogMl | cf254b358150f0f96a9dd2ea50de56acdc15bd56 | [
"MIT"
] | 56 | 2019-09-10T19:00:38.000Z | 2022-02-10T00:35:57.000Z | src/logml/models/sklearn_model.py | AstraZeneca-NGS/LogMl | cf254b358150f0f96a9dd2ea50de56acdc15bd56 | [
"MIT"
] | null | null | null | import inspect
import sklearn
import traceback
from sklearn.base import clone
from sklearn.ensemble import ExtraTreesClassifier, ExtraTreesRegressor, GradientBoostingClassifier, GradientBoostingRegressor, RandomForestClassifier, RandomForestRegressor
from sklearn.linear_model import RidgeCV, LassoCV, LassoLarsCV, Lass... | 39.464968 | 193 | 0.673903 |
62eadea5a8324d039a8e67f2314ed1c70dd59810 | 13,666 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 44.083871 | 265 | 0.673496 |
62eae94851205050b97cfeb5c0e9f4197dd99675 | 759 | py | Python | test/llc/version-tolerant/Expected/AcceptanceTests/LLCServiceDrivenUpdateOneVersionTolerant/llcservicedrivenupdateoneversiontolerant/aio/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/llc/version-tolerant/Expected/AcceptanceTests/LLCServiceDrivenUpdateOneVersionTolerant/llcservicedrivenupdateoneversiontolerant/aio/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/llc/version-tolerant/Expected/AcceptanceTests/LLCServiceDrivenUpdateOneVersionTolerant/llcservicedrivenupdateoneversiontolerant/aio/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.166667 | 114 | 0.621871 |
62eaf0cd4096d310ffc7d4106fe5e62824e6fbbd | 6,525 | py | Python | backend/series/serializers.py | suzanpradhan/slicedtv | 0d78dae366cd50647d5c40ec921e97a7a03047b2 | [
"BSD-3-Clause"
] | 1 | 2020-11-22T11:10:31.000Z | 2020-11-22T11:10:31.000Z | backend/series/serializers.py | suzanpradhan/slicedtv | 0d78dae366cd50647d5c40ec921e97a7a03047b2 | [
"BSD-3-Clause"
] | 1 | 2020-12-08T05:25:54.000Z | 2020-12-08T05:42:40.000Z | backend/series/serializers.py | suzanpradhan/slicedtv | 0d78dae366cd50647d5c40ec921e97a7a03047b2 | [
"BSD-3-Clause"
] | null | null | null | # External Import
from rest_framework import serializers
# Internal Import
from .models import Series
from slice.models import Genre, Language, Gallery, Cast
class GenreSerializer(serializers.ModelSerializer):
class Meta:
model = Genre
fields = ('genre',)
class LanguageSerializer(serializers.Mo... | 35.080645 | 111 | 0.585747 |
62eb0fdd3e65eeab9b5d357ac34dcba15ddbe40c | 3,756 | py | Python | intersight/models/compute_operation_result_handler_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/compute_operation_result_handler_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/compute_operation_result_handler_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ComputeOperationResultHandlerRef(object):
"""
... | 25.04 | 85 | 0.559372 |
62eb149bcf7d57f84cb1a05641b5c65f49f8c8bf | 8,507 | py | Python | two1/commands/util/decorators.py | febuiles/two1-python | 88704487dba7715f97a0980781d4c0efb2ea7fc4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2016-09-10T18:14:33.000Z | 2016-09-10T18:14:33.000Z | two1/commands/util/decorators.py | febuiles/two1-python | 88704487dba7715f97a0980781d4c0efb2ea7fc4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | two1/commands/util/decorators.py | febuiles/two1-python | 88704487dba7715f97a0980781d4c0efb2ea7fc4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-11-04T05:01:17.000Z | 2020-11-04T05:01:17.000Z | """ All two1 command line related decorators """
# standard python imports
import json as jsonlib
import functools
import platform
import traceback
import logging
# 3rd party imports
import requests
import click
# two1 imports
import two1
import two1.commands.util.uxstring as uxstring
import two1.commands.util.except... | 34.164659 | 98 | 0.612907 |
62eb200b8b288695ad00ecedaa7644c051c7be0f | 8,647 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 62.208633 | 485 | 0.771828 |
62eba0cc705f856d9608c216e1b5c7f853e3bd57 | 981 | py | Python | tests/test_filters.py | develtech/django-slugify-processor | 2aeb6ced004ed60e5bf8a9cb087b8a813617e765 | [
"MIT"
] | 14 | 2017-12-10T01:39:13.000Z | 2021-09-28T19:24:27.000Z | tests/test_filters.py | develtech/django-slugify-processor | 2aeb6ced004ed60e5bf8a9cb087b8a813617e765 | [
"MIT"
] | 304 | 2017-12-01T01:47:41.000Z | 2022-02-10T10:53:46.000Z | tests/test_filters.py | develtech/django-slugify-processor | 2aeb6ced004ed60e5bf8a9cb087b8a813617e765 | [
"MIT"
] | 1 | 2017-12-10T10:42:17.000Z | 2017-12-10T10:42:17.000Z | from django.template import Context, Template
def test_slugify_via_builtin_override(settings):
settings.SLUGIFY_PROCESSORS = ['test_app.coding.slugify_programming']
settings.TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
... | 33.827586 | 88 | 0.659531 |
62ebd743c96a429a5fdfddc3299800dbcdf09b33 | 2,318 | py | Python | alipay/aop/api/domain/AnttechAiCvOcrBusinesslicenseIdentifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AnttechAiCvOcrBusinesslicenseIdentifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AnttechAiCvOcrBusinesslicenseIdentifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AnttechAiCvOcrBusinesslicenseIdentifyModel(object):
def __init__(self):
self._image_raw = None
self._image_url = None
self._source = None
self._trace_id = None
... | 26.953488 | 69 | 0.574633 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.