hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a4590b8ade146a3172823cb334cb4ab14d8475d4 | 2,156 | py | Python | vspk/v6/fetchers/nuredundancygroups_fetcher.py | axxyhtrx/vspk-python | 4495882c6bcbb1ef51b14b9f4dc7efe46476ff50 | [
"BSD-3-Clause"
] | 19 | 2016-03-07T12:34:22.000Z | 2020-06-11T11:09:02.000Z | vspk/v6/fetchers/nuredundancygroups_fetcher.py | axxyhtrx/vspk-python | 4495882c6bcbb1ef51b14b9f4dc7efe46476ff50 | [
"BSD-3-Clause"
] | 40 | 2016-06-13T15:36:54.000Z | 2020-11-10T18:14:43.000Z | vspk/v6/fetchers/nuredundancygroups_fetcher.py | axxyhtrx/vspk-python | 4495882c6bcbb1ef51b14b9f4dc7efe46476ff50 | [
"BSD-3-Clause"
] | 15 | 2016-06-10T22:06:01.000Z | 2020-12-15T18:37:42.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | 40.679245 | 86 | 0.731447 |
0855d5ac1e109e95464507e215c8de1992bce1b0 | 3,763 | py | Python | fHDHR/device/tuners/tuner.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | 2 | 2021-11-21T18:45:35.000Z | 2022-01-11T16:11:48.000Z | fHDHR/device/tuners/tuner.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | null | null | null | fHDHR/device/tuners/tuner.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | null | null | null | import threading
import datetime
from fHDHR.exceptions import TunerError
from fHDHR.tools import humanized_time
from .stream import Stream
class Tuner():
def __init__(self, fhdhr, inum, epg):
self.fhdhr = fhdhr
self.number = inum
self.epg = epg
self.tuner_lock = threading.Lock(... | 38.010101 | 102 | 0.575605 |
375bf492e8e99ca5c8ace7c2685d72abbd9f5518 | 1,444 | py | Python | autogram/pictures/management/commands/scrapmedia.py | ohduran/autogram | e24c7ff40c44cd0eabf8018e61ad5fe0b422a6a1 | [
"MIT"
] | null | null | null | autogram/pictures/management/commands/scrapmedia.py | ohduran/autogram | e24c7ff40c44cd0eabf8018e61ad5fe0b422a6a1 | [
"MIT"
] | null | null | null | autogram/pictures/management/commands/scrapmedia.py | ohduran/autogram | e24c7ff40c44cd0eabf8018e61ad5fe0b422a6a1 | [
"MIT"
] | null | null | null | import subprocess
from django.contrib.auth import get_user_model
from django.core.management import call_command
from django.core.management.base import BaseCommand
User = get_user_model()
class Command(BaseCommand):
help = 'Pulls media from instagram into the scraped_media folder'
requires_migrations_check... | 41.257143 | 121 | 0.682133 |
498f6c43452c82854226b265a24fc1c03e2bb2aa | 1,049 | py | Python | test/errortest.py | AntonYamkovoy/convolutional_NN | 2d5aab86880c11f74abd7671083f44eee8a36458 | [
"MIT"
] | 1 | 2020-02-25T15:21:15.000Z | 2020-02-25T15:21:15.000Z | test/errortest.py | AntonYamkovoy/convolutional_NN | 2d5aab86880c11f74abd7671083f44eee8a36458 | [
"MIT"
] | null | null | null | test/errortest.py | AntonYamkovoy/convolutional_NN | 2d5aab86880c11f74abd7671083f44eee8a36458 | [
"MIT"
] | null | null | null | import numpy as np
import numpy.linalg as la
import scipy.signal as scisig
from func import *
B23 = np.asarray([
[1, 0,-1, 0],
[0, 1, 1, 0],
[0,-1, 1, 0],
[0, 1, 0,-1]
]).T
G23 = np.asarray([
[ 1, 0, 0],
[.5, .5,.5],
[.5,-.5,.5],
[ 0, 0, 1]
])
A23 = np.asarray([
[1,1,1,0],
... | 19.792453 | 72 | 0.581506 |
2e2855c8ccdec04b5000aeff9a7a56c901c44440 | 6,381 | py | Python | userbot/plugins/afk.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | """AFK Plugin for @UniBorg
Syntax: .afk REASON"""
import asyncio
import datetime
from datetime import datetime
from telethon import events
from telethon.tl import functions, types
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global last_afk_message # pylint:disable=E0602
global afk... | 40.643312 | 189 | 0.608212 |
5da0043977c725a2f1f0fb4fdc05242250aa1168 | 3,543 | py | Python | dit/algorithms/prune_expand.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | 1 | 2020-03-13T10:30:11.000Z | 2020-03-13T10:30:11.000Z | dit/algorithms/prune_expand.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | null | null | null | dit/algorithms/prune_expand.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | null | null | null | """
Functions for pruning or expanding the sample space of a distribution.
This can be important when calculating meet and join random variables. It
is also important for the calculations of various PID quantities.
"""
from dit.samplespace import ScalarSampleSpace, SampleSpace, CartesianProduct
__all__ = (
'exp... | 30.282051 | 77 | 0.661586 |
ee55d72ccce61398f79bfd69b9fbc88e9af21d45 | 2,324 | py | Python | account/types.py | TravelChain/golos-ql | a2acad0b56d349f3811b2bd0fc8ec1ce3257156c | [
"MIT"
] | 5 | 2018-08-28T20:54:54.000Z | 2022-02-09T21:21:53.000Z | account/types.py | TravelChain/golos-ql | a2acad0b56d349f3811b2bd0fc8ec1ce3257156c | [
"MIT"
] | null | null | null | account/types.py | TravelChain/golos-ql | a2acad0b56d349f3811b2bd0fc8ec1ce3257156c | [
"MIT"
] | 2 | 2018-09-26T06:28:34.000Z | 2018-11-20T20:14:00.000Z | from contextlib import suppress
from mongoengine.base.datastructures import BaseDict
import graphene
from graphene.relay import Node
from graphene_mongo import MongoengineObjectType
from graphene.types.generic import GenericScalar
from account.models import (
AccountModel,
AccountAuthorityModel
)
from common... | 25.538462 | 52 | 0.699656 |
0fcf8f922461d77dfda43ee8ee05275c8a55f75c | 3,245 | py | Python | tests/test_elbv2_actions.py | awslabs/aws-az-failure-chaostoolkit | 95f682ce3e96efbf8c6aee58123b5dbbdfd441ee | [
"Apache-2.0"
] | 6 | 2021-10-20T13:01:00.000Z | 2022-02-23T12:32:31.000Z | tests/test_elbv2_actions.py | awslabs/aws-az-failure-chaostoolkit | 95f682ce3e96efbf8c6aee58123b5dbbdfd441ee | [
"Apache-2.0"
] | 1 | 2022-02-09T09:33:02.000Z | 2022-03-03T14:03:09.000Z | tests/test_elbv2_actions.py | awslabs/aws-az-failure-chaostoolkit | 95f682ce3e96efbf8c6aee58123b5dbbdfd441ee | [
"Apache-2.0"
] | null | null | null | import os
from unittest.mock import MagicMock, patch
from azchaosaws.elbv2.actions import fail_az
@patch("azchaosaws.elbv2.actions.client", autospec=True)
def test_fail_az_alb(client):
mock_client = MagicMock()
client.return_value = mock_client
az = "ap-southeast-1a"
dry_run = False
state_path = ... | 36.460674 | 161 | 0.465639 |
bca830b79db5f37ebf95e675900cffc6ef211b57 | 88 | py | Python | static/apps.py | tututou/reportonlie_os | 527a0325ef8b5a555566a1ca55414f88e9831884 | [
"Apache-2.0"
] | null | null | null | static/apps.py | tututou/reportonlie_os | 527a0325ef8b5a555566a1ca55414f88e9831884 | [
"Apache-2.0"
] | null | null | null | static/apps.py | tututou/reportonlie_os | 527a0325ef8b5a555566a1ca55414f88e9831884 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class StaticsConfig(AppConfig):
name = 'static'
| 14.666667 | 33 | 0.75 |
1da118faf46370f16834d57b394dfdae5a572ff2 | 1,051 | py | Python | 01-december/depth_rate.py | acatovic/AoC2021 | aae151c73ab9c21c69e39d95126b9ffdd98e462e | [
"MIT"
] | null | null | null | 01-december/depth_rate.py | acatovic/AoC2021 | aae151c73ab9c21c69e39d95126b9ffdd98e462e | [
"MIT"
] | null | null | null | 01-december/depth_rate.py | acatovic/AoC2021 | aae151c73ab9c21c69e39d95126b9ffdd98e462e | [
"MIT"
] | null | null | null | from pathlib import Path
import sys
from typing import List
def count_num_depth_increases(data: List[int]) -> int:
curr_depth = data[0]
num_increases = 0
for i in range(1, len(data)):
if data[i] > curr_depth:
num_increases += 1
curr_depth = data[i]
return num_increases
def ... | 28.405405 | 83 | 0.646051 |
ce002eed526bfbbd57021cdab0466d3dff9d8512 | 279 | py | Python | src/flow.py | rodnover55/ha-flow-automation | 66ada606720030020ab51c73ed70cb8d94659644 | [
"MIT"
] | null | null | null | src/flow.py | rodnover55/ha-flow-automation | 66ada606720030020ab51c73ed70cb8d94659644 | [
"MIT"
] | null | null | null | src/flow.py | rodnover55/ha-flow-automation | 66ada606720030020ab51c73ed70cb8d94659644 | [
"MIT"
] | null | null | null | class Flow:
def __init__(self, data, key):
self.__data = data
self.__key = key
def id(self) -> str:
return self.__data["flow_id"]
def validate_step(self, step) -> bool:
return True
def key(self) -> str:
return self.__key | 21.461538 | 42 | 0.566308 |
ef04d6a54b381d0ad91f5f6f1fec9c494e0577df | 16,695 | py | Python | bin/parse_annotation.py | brianlee99/UVP | 5b7ff26c09d84760d4220268f34fb4814848eb4a | [
"MIT"
] | null | null | null | bin/parse_annotation.py | brianlee99/UVP | 5b7ff26c09d84760d4220268f34fb4814848eb4a | [
"MIT"
] | null | null | null | bin/parse_annotation.py | brianlee99/UVP | 5b7ff26c09d84760d4220268f34fb4814848eb4a | [
"MIT"
] | null | null | null | #! /usr/bin/python
import sys
import re
from string import join
""" The script accepts a SnpEff annotated VCF file and the sample ID name (string) as input options """
""" it parses files and creates a final annotation file that is in a ReseqTB mappable format """
"""
Author: Matthew Ezewudo
CPTR ReSeqTB Project - ... | 49.835821 | 460 | 0.493741 |
b78806120f3d3a17a6938e0fdb5c05e41ac0f7d6 | 693 | py | Python | src/captureImage.py | CquKeith/FFMPEG | e2d8a2415f6b08ad400bf3e7cd3386b8dce51b06 | [
"MIT"
] | 2 | 2020-12-10T10:27:19.000Z | 2021-04-19T07:13:07.000Z | src/captureImage.py | CquKeith/FFMPEG | e2d8a2415f6b08ad400bf3e7cd3386b8dce51b06 | [
"MIT"
] | null | null | null | src/captureImage.py | CquKeith/FFMPEG | e2d8a2415f6b08ad400bf3e7cd3386b8dce51b06 | [
"MIT"
] | null | null | null | # -- coding: utf-8 --
# 捕获视频帧
from FFmpegUtil import *
chunk_file_name = '118-120.avi'
def capture_image(input_file, out_file_dir):
'''
截取input_file的[start,end]的每一帧,存储到out_file_dir中
:param input_file: 要capture的视频文件
:param start: 从第几帧开始截取
:param end :到这一帧结束
:param out_file_dir: 输出的文件夹
:ret... | 23.1 | 82 | 0.649351 |
eba2a97e4f097939b6a864f5dab119da48af3131 | 4,087 | py | Python | Assignment 3/perceptron.py | vamsi3/IITB-Machine-Learning-AI | f09f12a89658a746bbe8753e9ed3ed10b1a0e3cd | [
"MIT"
] | 3 | 2020-11-04T15:12:32.000Z | 2022-01-28T12:21:38.000Z | Assignment 3/perceptron.py | vamsi3/CS335-IIT-Bombay | f09f12a89658a746bbe8753e9ed3ed10b1a0e3cd | [
"MIT"
] | null | null | null | Assignment 3/perceptron.py | vamsi3/CS335-IIT-Bombay | f09f12a89658a746bbe8753e9ed3ed10b1a0e3cd | [
"MIT"
] | 2 | 2020-09-02T03:23:21.000Z | 2022-02-07T05:52:52.000Z | # perceptron.py
# -------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu... | 38.196262 | 105 | 0.643993 |
f573ab151673acdfd6c7c5e63bc88f63e0974aca | 762 | py | Python | desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/plurals.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/plurals.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/plurals.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... | 29.307692 | 68 | 0.724409 |
9b03b182cf05795cdf9c33a51ba752c1baaead91 | 943 | py | Python | modin/core/dataframe/base/exchange/dataframe_protocol/__init__.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/dataframe/base/exchange/dataframe_protocol/__init__.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/dataframe/base/exchange/dataframe_protocol/__init__.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 49.631579 | 87 | 0.783669 |
cbb95119c268180b522de3c2afda1d836e78e7dc | 4,275 | py | Python | src/vws/exceptions/vws_exceptions.py | admdev8/vws-python | 1ef2492e3e9f860fe42768898cc69390bd295d06 | [
"MIT"
] | 7 | 2017-01-05T09:05:44.000Z | 2020-05-14T06:41:47.000Z | src/vws/exceptions/vws_exceptions.py | adamtheturtle/vws-python | 1afcba0ed46c0e82b2d80d5fe06781d909b468a4 | [
"MIT"
] | 665 | 2016-12-14T23:03:53.000Z | 2020-05-14T21:22:39.000Z | src/vws/exceptions/vws_exceptions.py | Smirenost/vws-python | 1ef2492e3e9f860fe42768898cc69390bd295d06 | [
"MIT"
] | 5 | 2020-08-17T15:18:35.000Z | 2021-05-21T08:50:41.000Z | """
Exception raised when Vuforia returns a response with a result code matching
one of those documented at
https://library.vuforia.com/articles/Solution/How-To-Use-the-Vuforia-Web-Services-API#How-To-Interperete-VWS-API-Result-Codes.
"""
import json
from urllib.parse import urlparse
from vws.exceptions.base_exceptio... | 25.598802 | 126 | 0.670175 |
f2f00b1aa5be124e00cf8b63decffae15a057450 | 5,257 | py | Python | tests/persistence/person_dao_spark_test.py | pydev-bootcamp/python-etl | 5db16bdf653861e14e6b30359622d83e45ca4f88 | [
"Unlicense"
] | null | null | null | tests/persistence/person_dao_spark_test.py | pydev-bootcamp/python-etl | 5db16bdf653861e14e6b30359622d83e45ca4f88 | [
"Unlicense"
] | null | null | null | tests/persistence/person_dao_spark_test.py | pydev-bootcamp/python-etl | 5db16bdf653861e14e6b30359622d83e45ca4f88 | [
"Unlicense"
] | null | null | null | """
Unit tests for PersonDao
"""
from datetime import datetime
import os
from os.path import dirname, abspath, join
from pytest import raises
from tempfile import mkstemp
from typing import List, Optional, TextIO
from textwrap import dedent
from manage_accounts.model.person import Person
from manage_accounts.persisten... | 29.700565 | 106 | 0.658551 |
8975c9a3ae3517b87a267340eadcfc7964ebcb7b | 10,805 | py | Python | examples/models.py | smit14/SentEval | bbf74ee8b918bc359d9494021a737229116cb8f0 | [
"BSD-3-Clause"
] | null | null | null | examples/models.py | smit14/SentEval | bbf74ee8b918bc359d9494021a737229116cb8f0 | [
"BSD-3-Clause"
] | null | null | null | examples/models.py | smit14/SentEval | bbf74ee8b918bc359d9494021a737229116cb8f0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
"""
This file contains the definition of encoders used in https://arxiv.org/pdf/1705.02364.pdf
"""
import numpy as np
import t... | 37.77972 | 98 | 0.547802 |
c8265dc035ba352b92fe2f6338520b5f85cff6b3 | 6,788 | py | Python | oneflow/compatible_single_client_python/test/ops/test_argwhere.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | oneflow/compatible_single_client_python/test/ops/test_argwhere.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | oneflow/compatible_single_client_python/test/ops/test_argwhere.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 32.792271 | 87 | 0.669564 |
ae53f0b78e8ec3aec388c4db65c0cbc1238d5b12 | 9,235 | py | Python | client_sdk_python/providers/eth_tester/middleware.py | awake006/client-sdk-python | 34393e417f74a65f04b643b26d8f9d2ccb0c886e | [
"MIT"
] | null | null | null | client_sdk_python/providers/eth_tester/middleware.py | awake006/client-sdk-python | 34393e417f74a65f04b643b26d8f9d2ccb0c886e | [
"MIT"
] | null | null | null | client_sdk_python/providers/eth_tester/middleware.py | awake006/client-sdk-python | 34393e417f74a65f04b643b26d8f9d2ccb0c886e | [
"MIT"
] | null | null | null | import operator
from eth_utils import (
is_dict,
is_hex,
is_string,
)
from client_sdk_python.middleware import (
construct_fixture_middleware,
construct_formatting_middleware,
)
from client_sdk_python.utils.formatters import (
apply_formatter_if,
apply_formatter_to_array,
apply_formatt... | 28.155488 | 99 | 0.682079 |
b543ed1bb9d58647000b7519ed6039bb76415ad2 | 48,824 | py | Python | tests/syft/lib/python/dict/dict_test.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | tests/syft/lib/python/dict/dict_test.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | tests/syft/lib/python/dict/dict_test.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | """
Tests copied from cpython test suite:
https://github.com/python/cpython/blob/3.8/Lib/test/test_dict.py
"""
# stdlib
import collections
import collections.abc
import gc
import pickle
import random
import string
import sys
from test import support
import unittest
# third party
import pytest
# syft absolute
from sy... | 32.078844 | 91 | 0.516017 |
ad9ad171195c61fce9d311a4ba2ac3865b799746 | 15,756 | py | Python | segmentation/builders/preprocessor_builder.py | deltaautonomy/delta_perception | 7b40f005b9753464016207d142969890ff6ec031 | [
"BSD-3-Clause"
] | 1 | 2021-05-15T13:05:09.000Z | 2021-05-15T13:05:09.000Z | segmentation/builders/preprocessor_builder.py | deltaautonomy/delta_perception | 7b40f005b9753464016207d142969890ff6ec031 | [
"BSD-3-Clause"
] | null | null | null | segmentation/builders/preprocessor_builder.py | deltaautonomy/delta_perception | 7b40f005b9753464016207d142969890ff6ec031 | [
"BSD-3-Clause"
] | 3 | 2020-02-20T21:59:02.000Z | 2021-05-15T13:05:10.000Z | r"""Preprocessing step for inptut images"""
import functools
import tensorflow as tf
from protos import preprocessor_pb2
from builders import dataset_builder
RESIZE_METHOD_MAP = {
preprocessor_pb2.BICUBIC: tf.image.ResizeMethod.BICUBIC,
preprocessor_pb2.BILINEAR: tf.image.ResizeMethod.BILINEAR,
preprocess... | 42.128342 | 93 | 0.644326 |
412321471beba6aebbfbaa4089d47449594401ee | 10,421 | py | Python | preprocessor/vctk.py | mbarnig/Comprehensive-Tacotron2 | f7604058af5f0112106fa2cf489caef94dd1b6f5 | [
"MIT"
] | 25 | 2021-07-24T06:31:15.000Z | 2022-03-29T03:20:47.000Z | preprocessor/vctk.py | mbarnig/Comprehensive-Tacotron2 | f7604058af5f0112106fa2cf489caef94dd1b6f5 | [
"MIT"
] | 5 | 2021-07-25T08:07:02.000Z | 2022-03-19T16:47:45.000Z | preprocessor/vctk.py | mbarnig/Comprehensive-Tacotron2 | f7604058af5f0112106fa2cf489caef94dd1b6f5 | [
"MIT"
] | 8 | 2021-07-24T07:18:11.000Z | 2021-12-14T12:56:13.000Z | import os
import random
import json
import re
import tgt
import librosa
import numpy as np
from tqdm import tqdm
from pathlib import Path
import audio as Audio
from text import text_to_sequence
from model import PreDefinedEmbedder
from utils.tools import save_mel_and_audio, plot_embedding
random.seed(1234)
class P... | 40.080769 | 128 | 0.571058 |
2604a019cd2415bfa579202eb1e4e992e8b6a276 | 7,718 | py | Python | sdk/python/pulumi_aws/elasticache/outputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/elasticache/outputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/elasticache/outputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 37.466019 | 271 | 0.64965 |
7500a33b1f097b45715714c5050361c34ab4a675 | 8,262 | py | Python | pandas/io/excel/_xlsxwriter.py | KneeShard/pandas | ce3bac9af43838c7d690ee86e9bec4976a3303e3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-08-06T14:27:43.000Z | 2021-08-06T14:27:56.000Z | pandas/io/excel/_xlsxwriter.py | ra1nty/pandas | 0b68d87a4438a13f14a2ed5af2e432df02eb0b2c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/io/excel/_xlsxwriter.py | ra1nty/pandas | 0b68d87a4438a13f14a2ed5af2e432df02eb0b2c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-06-22T14:36:40.000Z | 2021-06-22T14:36:40.000Z | from __future__ import annotations
from typing import Any
import pandas._libs.json as json
from pandas._typing import StorageOptions
from pandas.io.excel._base import ExcelWriter
from pandas.io.excel._util import validate_freeze_panes
class _XlsxStyler:
# Map from openpyxl-oriented styles to flatter xlsxwriter... | 33.449393 | 82 | 0.469257 |
68ecec98fa4cfb37d6997d4f3527ccc57b100d80 | 6,076 | py | Python | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/relink.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/relink.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/relink.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2021-12-16T23:31:37.000Z | 2021-12-16T23:31:37.000Z | # Mercurial extension to provide 'hg relink' command
#
# Copyright (C) 2007 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""recreates hardlinks between repository clones"""
from mercurial imp... | 32.843243 | 80 | 0.589862 |
60b6ed4146c56c34e2877f45f081aa182cac66d0 | 301 | py | Python | data/multilingual/Latn.ENG/Sans_8/pdf_to_json_test_Latn.ENG_Sans_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.ENG/Sans_8/pdf_to_json_test_Latn.ENG_Sans_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.ENG/Sans_8/pdf_to_json_test_Latn.ENG_Sans_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.ENG/Sans_8/udhr_Latn.ENG_Sans_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 30.1 | 71 | 0.810631 |
f7d3765f3e2ed7efc7d6d9a598112c01dd0c633e | 7,630 | py | Python | openai/baselines/baselines/deepq/experiments_real/experiments_real_300_normal/train_real_cloud.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | 7 | 2018-01-23T05:17:50.000Z | 2020-10-30T02:29:59.000Z | openai/baselines/baselines/deepq/experiments_17_balanced_alpha09beta_reward_large_shorter/experiments_real_300_normal/train_real_cloud.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | null | null | null | openai/baselines/baselines/deepq/experiments_17_balanced_alpha09beta_reward_large_shorter/experiments_real_300_normal/train_real_cloud.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | 2 | 2018-01-23T05:17:58.000Z | 2018-07-02T00:13:34.000Z | import gym
from baselines import deepq
from baselines.common.atari_wrappers_deprecated import wrap_dqn, ScaledFloatFrame
from cloud_environment_real import RealCloudEnvironment
import numpy as np
import collections
import os
import csv
import random
#NUR EINE EPISODE
#Bilder normalisieren? Brightness change jan => H... | 37.401961 | 203 | 0.648493 |
61b5468ed2c70fded55fcd518503b8fe50c9f240 | 55,173 | py | Python | digesters/confluence/test_confluence_notifications.py | paul-hammant/imapdigester | 7d2d9525d39b1f3f839a219061180971404e4bb8 | [
"MIT"
] | 25 | 2016-04-04T17:32:47.000Z | 2022-03-08T02:18:07.000Z | digesters/confluence/test_confluence_notifications.py | paul-hammant/imapslurper | 7d2d9525d39b1f3f839a219061180971404e4bb8 | [
"MIT"
] | null | null | null | digesters/confluence/test_confluence_notifications.py | paul-hammant/imapslurper | 7d2d9525d39b1f3f839a219061180971404e4bb8 | [
"MIT"
] | 4 | 2017-01-02T21:03:28.000Z | 2022-02-22T18:38:44.000Z | import sys
from unittest import TestCase
import unittest
import os
from importlib import reload
from mock import Mock, call
from mockextras import stub
sys.path = [os.path.abspath(os.path.join('..', os.pardir))] + sys.path
from digesters.confluence.confluence_notification_digester import ConfluenceNotificationDigeste... | 49.52693 | 196 | 0.726587 |
ec8898c4aac40337edcfc977a0a6bfbf011ed9bb | 1,858 | py | Python | reconstruct.py | robclouth/RAVE | a09dec0370b776038a001d8b03944181a20047d3 | [
"MIT"
] | 2 | 2022-01-29T20:09:19.000Z | 2022-01-31T22:50:42.000Z | reconstruct.py | gnhdnb/RAVE | 4cf6cbd8706a7acbb0882be09d2a2d5539cf713b | [
"MIT"
] | null | null | null | reconstruct.py | gnhdnb/RAVE | 4cf6cbd8706a7acbb0882be09d2a2d5539cf713b | [
"MIT"
] | null | null | null | import torch
torch.set_grad_enabled(False)
from tqdm import tqdm
from rave import RAVE
from rave.core import search_for_run
from effortless_config import Config
from os import path, makedirs, environ
from pathlib import Path
import librosa as li
import GPUtil as gpu
import soundfile as sf
class args(Config):
... | 23.518987 | 76 | 0.68676 |
a0d234386d182fd417ef1d4ddb5f2b61358e5f3e | 216 | py | Python | packageName/module.py | GaetanDesrues/EmptyPythonPackage | 35caa1430666f1368c0f3d8f7945370c093b9b50 | [
"MIT"
] | null | null | null | packageName/module.py | GaetanDesrues/EmptyPythonPackage | 35caa1430666f1368c0f3d8f7945370c093b9b50 | [
"MIT"
] | null | null | null | packageName/module.py | GaetanDesrues/EmptyPythonPackage | 35caa1430666f1368c0f3d8f7945370c093b9b50 | [
"MIT"
] | null | null | null | class Class:
""" Documentation
"""
def __init__(self):
pass
def function(self, arg: int):
""" Simple function
:param int arg: Function argument
"""
pass
| 15.428571 | 45 | 0.5 |
64022e6fe5fd9c5a7bf48e48e5b0fc7d6562eb96 | 2,856 | py | Python | connect_four/evaluation/incremental_victor/incremental_victor_evaluator.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/incremental_victor/incremental_victor_evaluator.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/incremental_victor/incremental_victor_evaluator.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | from connect_four.envs import ConnectFourEnv
from connect_four.evaluation import ProofStatus, NodeType
from connect_four.evaluation.simple_evaluator import SimpleEvaluator
from connect_four.evaluation.board import Board
from connect_four.evaluation.incremental_victor.graph.graph_manager import GraphManager
from connect... | 38.594595 | 115 | 0.667017 |
1f92fd5433c046e175cf44e37cbe1bb6608ecb0e | 10,497 | py | Python | saleor/dashboard/drawercash/views.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/dashboard/drawercash/views.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/dashboard/drawercash/views.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import get_object_or_404, redirect, render_to_response
from django.template.response import TemplateResponse
from django.http import HttpResponse
from django.core.paginator import Paginator, PageNotAnInteger, InvalidPage, EmptyPage
from django.db.models import Q
from ..views import staff_member_re... | 38.032609 | 136 | 0.742403 |
327549749a37a7a84bbd437ac70096d14037e18d | 299 | py | Python | ESP32S/workSpace/WS2812.py | hu-tianyi/AuTrix | 4058cfba6d2d96b6a3f6b6564c0a85c855e57fa9 | [
"MIT"
] | null | null | null | ESP32S/workSpace/WS2812.py | hu-tianyi/AuTrix | 4058cfba6d2d96b6a3f6b6564c0a85c855e57fa9 | [
"MIT"
] | null | null | null | ESP32S/workSpace/WS2812.py | hu-tianyi/AuTrix | 4058cfba6d2d96b6a3f6b6564c0a85c855e57fa9 | [
"MIT"
] | null | null | null | import machine, time, neopixel
print("aaaaaaaaaaaaa")
n = 256
p = 5
np = neopixel.NeoPixel(machine.Pin(p), n)
for index in range (256):
np[index] = (20,0,0)
np.write()
time.sleep_ms(500)
for index in range (256):
np[index] = (0,0,0)
np.write()
print("Executed WS2812 Command")
| 10.678571 | 41 | 0.638796 |
880055672d39f68bb8acb9f92ed8e5e1a7a151f5 | 1,572 | py | Python | 123/chessman/Pao.py | chenhongyan950312/xiangqidaima | 159a814f86c10d8fceaead68dca8286ea41727fa | [
"MIT"
] | null | null | null | 123/chessman/Pao.py | chenhongyan950312/xiangqidaima | 159a814f86c10d8fceaead68dca8286ea41727fa | [
"MIT"
] | null | null | null | 123/chessman/Pao.py | chenhongyan950312/xiangqidaima | 159a814f86c10d8fceaead68dca8286ea41727fa | [
"MIT"
] | null | null | null |
from ChessPiece import ChessPiece
class Pao(ChessPiece):
def get_image_file_name(self):
if self.selected:
if self.is_red:
return "/home/chy/cchess-zero-master/images/RCS.GIF"
else:
return "/home/chy/cchess-zero-master/images/BCS.GIF"
else:
... | 30.823529 | 68 | 0.521628 |
2337239a22ce53b8393e898c9d5c10391830e810 | 10,842 | py | Python | CAIL2020/znwd/dumpes.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 71 | 2020-07-16T01:49:27.000Z | 2022-03-27T16:55:00.000Z | CAIL2020/znwd/dumpes.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 11 | 2020-09-18T14:26:25.000Z | 2022-02-09T23:49:33.000Z | CAIL2020/znwd/dumpes.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 16 | 2020-07-15T07:24:30.000Z | 2022-03-19T05:41:11.000Z | import os
import os.path
import time
import json
import codecs
import elasticsearch
import progressbar
from backports import csv
from functools import wraps
from zipfile import ZipFile, ZIP_DEFLATED
FLUSH_BUFFER = 1000 # Chunk of docs to flush in temp file
CONNECTION_TIMEOUT = 120
TIMES_TO_TRY = 3
RETRY_DELAY = 60
ME... | 38.176056 | 113 | 0.533758 |
49b671f59e9c39669b90a36f09980c98c15bcd3b | 442 | py | Python | docker-deploy/web-app/Ride_Share/migrations/0025_auto_20200203_1931.py | universebh/ride_share | f5426b13ed256c6d6a0e966e2306da0f5fce8235 | [
"MIT"
] | null | null | null | docker-deploy/web-app/Ride_Share/migrations/0025_auto_20200203_1931.py | universebh/ride_share | f5426b13ed256c6d6a0e966e2306da0f5fce8235 | [
"MIT"
] | null | null | null | docker-deploy/web-app/Ride_Share/migrations/0025_auto_20200203_1931.py | universebh/ride_share | f5426b13ed256c6d6a0e966e2306da0f5fce8235 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2020-02-04 00:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Ride_Share', '0024_auto_20200203_1929'),
]
operations = [
migrations.AlterField(
model_name='myuser',
name='email',
... | 23.263158 | 104 | 0.624434 |
e7a5b22d59e2cfa4f723314eefc955e28c4a849a | 630 | py | Python | api/schemas/schemas.py | JackyCJ/flask-restful-login | 1bd31ee3da8ca667dc7592123ad5ee700dcb2595 | [
"MIT"
] | 76 | 2017-07-15T15:52:51.000Z | 2022-03-30T04:45:05.000Z | api/schemas/schemas.py | JackyCJ/flask-restful-login | 1bd31ee3da8ca667dc7592123ad5ee700dcb2595 | [
"MIT"
] | 83 | 2019-08-10T06:58:11.000Z | 2022-03-31T16:29:37.000Z | api/schemas/schemas.py | JackyCJ/flask-restful-login | 1bd31ee3da8ca667dc7592123ad5ee700dcb2595 | [
"MIT"
] | 23 | 2016-07-14T09:06:51.000Z | 2022-03-28T07:54:39.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from marshmallow import Schema, fields
class BaseUserSchema(Schema):
"""
Base user schema returns all fields but this was not used in user handlers.
"""
# Schema parameters.
id = fields.Int(dump_only=True)
username = fields.Str()
email = fields... | 19.090909 | 95 | 0.639683 |
e2fdedd0e2c60b0ecc6c71da7e65a08d5de439b2 | 10,821 | py | Python | dqn/dueling_network_old.py | 20chase/cartpole_rl | 687fc30f7e69f4850c545dce74f4e844d75fd732 | [
"MIT"
] | 3 | 2019-07-18T09:09:47.000Z | 2021-11-17T11:05:12.000Z | dqn/dueling_network_old.py | 20chase/cartpole_rl | 687fc30f7e69f4850c545dce74f4e844d75fd732 | [
"MIT"
] | null | null | null | dqn/dueling_network_old.py | 20chase/cartpole_rl | 687fc30f7e69f4850c545dce74f4e844d75fd732 | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorlayer as tl
import gym
import numpy as np
import random
import os
from gym import wrappers
from collections import deque
# Hyper Parameters for DQN
GAMMA = 0.99 # discount factor for target Q
INITIAL_EPSILON = 1 # starting value of epsilon
FINAL_EPSILON = 0.01 # final value of eps... | 37.442907 | 170 | 0.712503 |
69ad7163f8d258608d0f58bb9ccc2e396ca4ee6f | 2,325 | py | Python | setup.py | Wi11iamDing/toad | 3b22cc9a5d83255d394da483ec47b0de5f862c07 | [
"MIT"
] | 1 | 2021-04-29T08:59:26.000Z | 2021-04-29T08:59:26.000Z | setup.py | lijihong111/toad | 3b22cc9a5d83255d394da483ec47b0de5f862c07 | [
"MIT"
] | null | null | null | setup.py | lijihong111/toad | 3b22cc9a5d83255d394da483ec47b0de5f862c07 | [
"MIT"
] | null | null | null | import os
import numpy as np
from setuptools import setup, find_packages, Extension
NAME = 'toad'
CURRENT_PATH = os.path.abspath(os.path.dirname(__file__))
VERSION_FILE = os.path.join(CURRENT_PATH, NAME, 'version.py')
def get_version():
ns = {}
with open(VERSION_FILE) as f:
exec(f.read(), ns)
r... | 28.012048 | 109 | 0.610753 |
f161be15510630801958c75c71e0feeccffe4eeb | 2,551 | py | Python | train.py | x052/proxy-detector | bcd1fca7c11d784364197ff240dbfbe4bca9f895 | [
"MIT"
] | null | null | null | train.py | x052/proxy-detector | bcd1fca7c11d784364197ff240dbfbe4bca9f895 | [
"MIT"
] | 1 | 2018-04-16T20:07:35.000Z | 2018-04-17T17:27:55.000Z | train.py | x052/proxy-detector | bcd1fca7c11d784364197ff240dbfbe4bca9f895 | [
"MIT"
] | 1 | 2019-11-18T15:30:35.000Z | 2019-11-18T15:30:35.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import tempfile
import itertools
import pandas as pd
from six.moves import urllib
import tensorflow as tf
CSV_COLUMNS = [
"isProxy",
"org",
"continentCode",
"countr... | 28.032967 | 106 | 0.713838 |
70d1f37da66e7f76b41422793c0a4900d1874961 | 94 | py | Python | p.py | usha324/python | 7aa967b8dac8cd0c466652db448cb7e405821389 | [
"bzip2-1.0.6"
] | null | null | null | p.py | usha324/python | 7aa967b8dac8cd0c466652db448cb7e405821389 | [
"bzip2-1.0.6"
] | null | null | null | p.py | usha324/python | 7aa967b8dac8cd0c466652db448cb7e405821389 | [
"bzip2-1.0.6"
] | null | null | null | str = "this is string example....programmer!!!";
print "Length of the string: ", len(str)
| 23.5 | 49 | 0.638298 |
b3480a956cd92e53b52bc9c62f69424a36d09e42 | 7,012 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/spbsimedgeisidlist_cfeb124762b8e4653da4ea2e084e78c8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/topology/spbsimedgeisidlist_cfeb124762b8e4653da4ea2e084e78c8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/topology/spbsimedgeisidlist_cfeb124762b8e4653da4ea2e084e78c8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 36.520833 | 162 | 0.637336 |
0028cfd79b75082400e237f04c54f4139d91ab07 | 1,789 | py | Python | integrations-and-supported-tools/kedro/scripts/kedro_neptune_quickstart/src/kedro_neptune_quickstart/__main__.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 15 | 2021-06-11T16:35:15.000Z | 2022-03-29T15:53:59.000Z | integrations-and-supported-tools/kedro/scripts/kedro_neptune_quickstart/src/kedro_neptune_quickstart/__main__.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 12 | 2021-04-26T13:07:50.000Z | 2021-11-15T10:50:03.000Z | integrations-and-supported-tools/kedro/scripts/kedro_neptune_quickstart/src/kedro_neptune_quickstart/__main__.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 10 | 2021-05-07T16:28:18.000Z | 2022-02-28T21:47:11.000Z | # Copyright 2021 QuantumBlack Visual Analytics 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 39.755556 | 77 | 0.775852 |
708305e655c9814e0319c7708eaf79d265c68a16 | 474 | py | Python | Task/Handle-a-signal/Python/handle-a-signal-4.py | LaudateCorpus1/RosettaCodeData | 9ad63ea473a958506c041077f1d810c0c7c8c18d | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Handle-a-signal/Python/handle-a-signal-4.py | seanwallawalla-forks/RosettaCodeData | 9ad63ea473a958506c041077f1d810c0c7c8c18d | [
"Info-ZIP"
] | null | null | null | Task/Handle-a-signal/Python/handle-a-signal-4.py | seanwallawalla-forks/RosettaCodeData | 9ad63ea473a958506c041077f1d810c0c7c8c18d | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | import time, signal
class WeAreDoneException(Exception):
pass
def sigIntHandler(signum, frame):
signal.signal(signal.SIGINT, signal.SIG_DFL) # resets to default handler
raise WeAreDoneException
t1 = time.time()
try:
signal.signal(signal.SIGINT, sigIntHandler)
n = 0
while True:
time.s... | 19.75 | 76 | 0.675105 |
4655d4443673503005f8afcf41532854bee0b229 | 2,533 | py | Python | tests/test_response.py | XiaoMutt/palpable | 4c7f6352b1731c86e93232e2cc5fca63f440be19 | [
"MIT"
] | null | null | null | tests/test_response.py | XiaoMutt/palpable | 4c7f6352b1731c86e93232e2cc5fca63f440be19 | [
"MIT"
] | null | null | null | tests/test_response.py | XiaoMutt/palpable | 4c7f6352b1731c86e93232e2cc5fca63f440be19 | [
"MIT"
] | null | null | null | from math import sqrt
from time import sleep
from src.palpable.procedures.map_function import MapFunction
from src.palpable.procedures.procedure import Procedure
from src.palpable.procedures.run_function import RunFunction
from src.palpable.units.task import Task
from src.palpable.units.task_response import TaskRespon... | 40.206349 | 104 | 0.680616 |
bb042d37ef8b7a2a287a7b72062d2223db1a6c13 | 648 | py | Python | tests/test_matrix_props/test_is_square.py | paniash/toqito | ab67c2a3fca77b3827be11d1e79531042ea62b82 | [
"MIT"
] | 76 | 2020-01-28T17:02:01.000Z | 2022-02-14T18:02:15.000Z | tests/test_matrix_props/test_is_square.py | paniash/toqito | ab67c2a3fca77b3827be11d1e79531042ea62b82 | [
"MIT"
] | 82 | 2020-05-31T20:09:38.000Z | 2022-03-28T17:13:59.000Z | tests/test_matrix_props/test_is_square.py | paniash/toqito | ab67c2a3fca77b3827be11d1e79531042ea62b82 | [
"MIT"
] | 30 | 2020-04-02T16:07:11.000Z | 2022-02-05T13:39:22.000Z | """Test is_square."""
import numpy as np
from toqito.matrix_props import is_square
def test_is_square():
"""Test that square matrix returns True."""
mat = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
np.testing.assert_equal(is_square(mat), True)
def test_is_not_square():
"""Test that non-square matr... | 24 | 53 | 0.646605 |
a8f1282c0a6fcfcdfa7a8e6bff3047858fa43481 | 739 | py | Python | pytezos/__init__.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2021-05-20T16:52:08.000Z | 2021-05-20T16:52:08.000Z | pytezos/__init__.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | pytezos/__init__.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | null | null | null | """
Welcome to PyTezos!
To start playing with the Tezos blockchain you need to get a PyTezosClient instance.
Just type:
>>> from pytezos import pytezos
>>> pytezos
And follow the interactive documentation.
"""
from pytezos.rpc import RpcProvider, localhost, mainnet, babylonnet, zeronet
from pytezos.rpc.errors impor... | 29.56 | 84 | 0.830853 |
e7b2cffc2ff4cdac6e2211ed91b629da048220ec | 4,501 | py | Python | scripts/utils/HashPath.py | irblsensitivity/irblsensitivity | 6ee1038d3daefdabc29c60a37dac627bc98498f9 | [
"Apache-2.0"
] | 2 | 2019-06-08T14:19:55.000Z | 2021-07-06T04:02:05.000Z | scripts/utils/HashPath.py | irblsensitivity/irblsensitivity | 6ee1038d3daefdabc29c60a37dac627bc98498f9 | [
"Apache-2.0"
] | null | null | null | scripts/utils/HashPath.py | irblsensitivity/irblsensitivity | 6ee1038d3daefdabc29c60a37dac627bc98498f9 | [
"Apache-2.0"
] | 1 | 2017-05-29T14:03:20.000Z | 2017-05-29T14:03:20.000Z | #-*- coding: utf-8 -*-
from __future__ import print_function
import urllib2
import hashlib
import os
###############################################################################################################
class HashPath(object):
@staticmethod
def sequence(_name, _name_size, _level):
'''
:param _path:
:... | 24.069519 | 111 | 0.567207 |
dceaf7acc91f910adc48b28e57882b6570097f42 | 1,253 | py | Python | domain/sportPlan.py | zhuxiyulu/sugar | c780618aa6493779cc869e984f8e38be9314e1b8 | [
"Apache-2.0"
] | 2 | 2018-06-14T15:28:10.000Z | 2019-01-11T07:11:32.000Z | domain/sportPlan.py | zhuxiyulu/sugar | c780618aa6493779cc869e984f8e38be9314e1b8 | [
"Apache-2.0"
] | null | null | null | domain/sportPlan.py | zhuxiyulu/sugar | c780618aa6493779cc869e984f8e38be9314e1b8 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import Column, Integer, String, DATETIME
from domain.database import Base
# SportPlan 运动方案
class SportPlan(Base):
# 表的名字
__tablename__ = 'sportplan'
# 表的结构
userId = Column(Integer(), primary_key=True)
sport1 = Column(String())
sport2 = Column(String())
sport3 = ... | 29.833333 | 209 | 0.526736 |
8093b50db93868f19e02455b11df94d64fdd5155 | 1,225 | py | Python | var/spack/repos/builtin/packages/r-conquer/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-conquer/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-conquer/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RConquer(RPackage):
"""Convolution-Type Smoothed Quantile Regression.
Fast an... | 40.833333 | 95 | 0.729796 |
03785f02832c9d201cd5e3ca4f50b84d58353a90 | 835 | py | Python | src/oci/object_storage/transfer/internal/file_read_callback_stream.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/object_storage/transfer/internal/file_read_callback_stream.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/object_storage/transfer/internal/file_read_callback_stream.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 37.954545 | 245 | 0.700599 |
a28bde0354ec2d1170984ce309d743dcd8ecb851 | 10,101 | py | Python | packages/python-packages/doc-warden/warden/enforce_readme_content.py | scbedd/azure-sdk-tools | dcbe480642d53ea524438da39a3af758646b5bd3 | [
"MIT"
] | 84 | 2015-01-01T23:40:15.000Z | 2022-03-10T20:20:40.000Z | packages/python-packages/doc-warden/warden/enforce_readme_content.py | scbedd/azure-sdk-tools | dcbe480642d53ea524438da39a3af758646b5bd3 | [
"MIT"
] | 2,219 | 2015-01-06T20:35:05.000Z | 2022-03-31T23:36:52.000Z | packages/python-packages/doc-warden/warden/enforce_readme_content.py | scbedd/azure-sdk-tools | dcbe480642d53ea524438da39a3af758646b5bd3 | [
"MIT"
] | 127 | 2015-01-02T01:43:51.000Z | 2022-03-24T20:02:13.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from __future__ import print_function
import os
import markdown2
import bs4
import re
from .warden_common import check_match, walk_directory_for_pattern, get_omitted_files
from .HeaderConstruct import HeaderConstruct
from doc... | 39 | 124 | 0.711019 |
2a526c6d5f2afce2e736b2be4c2b36c36e364d12 | 238 | py | Python | Desafio 96.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 96.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 96.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | def area(l, c):
print(f"A área de um terreno é {l} x {c} é de {l * c}m².")
print(f'Controle de Terreno.')
print(f'-' * 25)
larg = float(input('Largura (m): '))
comprimento = float(input('Comprimento (m): '))
area(larg, comprimento)
| 23.8 | 62 | 0.617647 |
72122ee5b599f9314849065e33f841c9cb092330 | 1,546 | py | Python | ht/ht/urls.py | caoxuCarlos/htyw_ecust | 90277333510de14d936153fa2b164efbc5d068b8 | [
"MIT"
] | null | null | null | ht/ht/urls.py | caoxuCarlos/htyw_ecust | 90277333510de14d936153fa2b164efbc5d068b8 | [
"MIT"
] | null | null | null | ht/ht/urls.py | caoxuCarlos/htyw_ecust | 90277333510de14d936153fa2b164efbc5d068b8 | [
"MIT"
] | null | null | null | """ht URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based view... | 42.944444 | 80 | 0.718629 |
258f401238607a4b40a55c85c25ac5aa91257ebb | 430 | py | Python | tests/data/workflow-tests/actors/notscheduledfourthactor/actor.py | dhodovsk/leapp | bcd6580a19dabd132b3da8bcf2ed61fa8864ef18 | [
"Apache-2.0"
] | 29 | 2019-05-29T05:34:52.000Z | 2022-03-14T19:09:34.000Z | tests/data/workflow-tests/actors/notscheduledfourthactor/actor.py | dhodovsk/leapp | bcd6580a19dabd132b3da8bcf2ed61fa8864ef18 | [
"Apache-2.0"
] | 373 | 2018-11-21T11:41:49.000Z | 2022-03-31T11:40:56.000Z | tests/data/workflow-tests/actors/notscheduledfourthactor/actor.py | dhodovsk/leapp | bcd6580a19dabd132b3da8bcf2ed61fa8864ef18 | [
"Apache-2.0"
] | 27 | 2018-11-26T17:14:15.000Z | 2022-03-10T13:30:50.000Z | from leapp.actors import Actor
from leapp.tags import FourthPhaseTag
class NotScheduledFourthActor(Actor):
name = 'not_scheduled_fourth_actor'
description = 'No description has been provided for the not_scheduled_fourth_actor actor.'
consumes = ()
produces = ()
tags = (FourthPhaseTag,)
def pr... | 28.666667 | 94 | 0.737209 |
65d20f2e9e1cbd4698cbacb2989d58fb47e5cc0f | 8,169 | py | Python | salt/modules/solaris_shadow.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | salt/modules/solaris_shadow.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | salt/modules/solaris_shadow.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
Manage the password database on Solaris systems
.. important::
If you feel that Salt should be using this module to manage passwords on a
minion, and it is using a different module (or gives an error similar to
*'shadow.info' is not available*), see :ref:`here
<module-provider-override>`.
"""
impo... | 24.981651 | 92 | 0.56543 |
126f0d2031e1c77d504842b2d3bead682c8382cf | 1,885 | py | Python | emannotationschemas/schemas/functional_coregistration.py | seung-lab/EMAnnotationSchemas | ef1061ca78860d53f1cd180496e87ad685a32ffe | [
"MIT"
] | null | null | null | emannotationschemas/schemas/functional_coregistration.py | seung-lab/EMAnnotationSchemas | ef1061ca78860d53f1cd180496e87ad685a32ffe | [
"MIT"
] | 18 | 2018-08-15T17:38:04.000Z | 2022-02-18T02:08:28.000Z | emannotationschemas/schemas/functional_coregistration.py | fcollman/EMAnnotationSchemas | bcc9f308868b2ea3e1504089d9cbab878b626acc | [
"MIT"
] | 5 | 2018-08-14T22:39:49.000Z | 2021-10-05T16:36:07.000Z | import marshmallow as mm
from emannotationschemas.schemas.base import AnnotationSchema, BoundSpatialPoint
class FunctionalCoregistration(AnnotationSchema):
pt = mm.fields.Nested(
BoundSpatialPoint,
required=True,
description="location of cell body of functional cell",
)
func_id = m... | 35.566038 | 101 | 0.698674 |
3b9a0a328abdc6a69c0a4982c8e0b17d67fab54e | 162 | py | Python | data/groups.py | melipharo/stru-python19 | 6df494f6812e96d87bdfffdcbd3602e764a893c9 | [
"BSD-2-Clause"
] | null | null | null | data/groups.py | melipharo/stru-python19 | 6df494f6812e96d87bdfffdcbd3602e764a893c9 | [
"BSD-2-Clause"
] | null | null | null | data/groups.py | melipharo/stru-python19 | 6df494f6812e96d87bdfffdcbd3602e764a893c9 | [
"BSD-2-Clause"
] | null | null | null | from model import Group
test_data = [
Group(name="name1", header="header1", footer="footer1"),
Group(name="name2", header="header2", footer="footer2")
]
| 23.142857 | 60 | 0.67284 |
13da69071d7265dafb926eeee478ce2441ffa08f | 3,179 | py | Python | Multidimentional Lists Exerscise/08. Miner.py | nrgxtra/advanced | 89f713419102c64a04b495f717cdb51bbf94213c | [
"MIT"
] | null | null | null | Multidimentional Lists Exerscise/08. Miner.py | nrgxtra/advanced | 89f713419102c64a04b495f717cdb51bbf94213c | [
"MIT"
] | null | null | null | Multidimentional Lists Exerscise/08. Miner.py | nrgxtra/advanced | 89f713419102c64a04b495f717cdb51bbf94213c | [
"MIT"
] | null | null | null | rows_count = int(input())
field = []
commands = []
[commands.append(x) for x in input().split(' ')]
for _ in range(rows_count):
field.append([])
[field[-1].append(x) for x in input().split()]
coals = 0
current_coal = 0
for row in field:
sub_sum = row.count('c')
coals += sub_sum
initial_sta... | 34.554348 | 73 | 0.459578 |
dfaf92562fae8edd342d6c523f9f3fc00f6fcea5 | 921 | py | Python | src/app/api/crud.py | khemx3/esdapi | e5bfbef0c5884761887c27c94934495e33be6283 | [
"MIT"
] | null | null | null | src/app/api/crud.py | khemx3/esdapi | e5bfbef0c5884761887c27c94934495e33be6283 | [
"MIT"
] | null | null | null | src/app/api/crud.py | khemx3/esdapi | e5bfbef0c5884761887c27c94934495e33be6283 | [
"MIT"
] | null | null | null | from app.api.models import BookSchema
from app.db import books, database
async def post(payload: BookSchema):
query = books.insert().values(title=payload.title, description=payload.description, price=payload.price)
return await database.execute(query=query)
async def get(id: int):
query = books.select()... | 27.088235 | 108 | 0.690554 |
f80464b6cf8c4b85731c80081eea878f076601ba | 1,603 | py | Python | website/utils/ml_utils.py | TOXiNdeep2503/makeabilitylabwebsite | 6e57ee4f928742b30f1e933166dc8fa2b6b11d05 | [
"MIT"
] | 3 | 2020-10-01T20:44:24.000Z | 2022-01-20T05:51:24.000Z | website/utils/ml_utils.py | TOXiNdeep2503/makeabilitylabwebsite | 6e57ee4f928742b30f1e933166dc8fa2b6b11d05 | [
"MIT"
] | 76 | 2020-07-17T18:23:29.000Z | 2022-03-18T12:16:56.000Z | website/utils/ml_utils.py | TOXiNdeep2503/makeabilitylabwebsite | 6e57ee4f928742b30f1e933166dc8fa2b6b11d05 | [
"MIT"
] | 99 | 2020-09-30T13:32:25.000Z | 2022-03-07T07:51:54.000Z | """
Hosts general utility functions for Makeability Lab Django website
"""
import re
# helper function to correctly capitalize a string, specify words to not capitalize in the articles list
# from: https://stackoverflow.com/a/3729957
# Note: this code written by J. Gilkeson and needs to be cleaned up (and/or removed i... | 45.8 | 126 | 0.672489 |
06568f074a993b42a33371e64e2104c70b9987c2 | 6,947 | py | Python | keystone/controllers.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/controllers.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/controllers.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 31.721461 | 79 | 0.594933 |
edc439c62c137d285f73e4a09a0e203c8fad3aeb | 839 | py | Python | tests/test_robotFinder.py | JDownloader/GEL-3014_Design3 | dea01245592c97f73e6a78426270d91ade5e25c7 | [
"MIT"
] | null | null | null | tests/test_robotFinder.py | JDownloader/GEL-3014_Design3 | dea01245592c97f73e6a78426270d91ade5e25c7 | [
"MIT"
] | null | null | null | tests/test_robotFinder.py | JDownloader/GEL-3014_Design3 | dea01245592c97f73e6a78426270d91ade5e25c7 | [
"MIT"
] | null | null | null | from unittest import TestCase
from baseStation.robotIPFinder import RobotFinder
class TestRobotFinder(TestCase):
ROBOT_MAC = RobotFinder.ROBOT_MAC
FAKE_ROBOT_IP = "192.168.0.10"
lines_of_arp_exit = "? (10.248.0.1) at 0:0:c:7:ac:a on en1 ifscope [ethernet]\n"+ \
"? (" + FAKE_ROBOT_I... | 34.958333 | 104 | 0.644815 |
bbe02cd48b72926242ced350bafa69474c2fbd21 | 1,631 | py | Python | igrfcoord/plots.py | scivision/igrfcoord | f50946eccbd4ab587ea7182d521d1ebd1f2cb229 | [
"BSD-2-Clause"
] | 2 | 2016-04-01T18:03:13.000Z | 2016-04-02T19:35:32.000Z | igrfcoord/plots.py | scivision/igrfcoord | f50946eccbd4ab587ea7182d521d1ebd1f2cb229 | [
"BSD-2-Clause"
] | null | null | null | igrfcoord/plots.py | scivision/igrfcoord | f50946eccbd4ab587ea7182d521d1ebd1f2cb229 | [
"BSD-2-Clause"
] | 3 | 2020-08-04T12:51:11.000Z | 2021-11-01T09:19:45.000Z | import logging
import pandas
try:
from matplotlib.pyplot import figure
import cartopy.crs as ccrs
except (ImportError, RuntimeError) as e:
logging.error(f"plotting disabled {e}")
figure = None
def _sitecol(line: pandas.Series) -> str:
if line.name == "HST":
c = "red"
elif line.name... | 25.484375 | 124 | 0.556714 |
5ea0c76e88ae91603a3e4c900c085fbf5fa94716 | 8,857 | py | Python | act/plotting/WindRoseDisplay.py | ajsockol/ACT | 976002b50bade6cf1ad3d86ffabe3aed9d6e0bbb | [
"BSD-3-Clause"
] | null | null | null | act/plotting/WindRoseDisplay.py | ajsockol/ACT | 976002b50bade6cf1ad3d86ffabe3aed9d6e0bbb | [
"BSD-3-Clause"
] | null | null | null | act/plotting/WindRoseDisplay.py | ajsockol/ACT | 976002b50bade6cf1ad3d86ffabe3aed9d6e0bbb | [
"BSD-3-Clause"
] | null | null | null | """
act.plotting.WindRoseDisplay
----------------------------
Stores the class for WindRoseDisplay.
"""
import matplotlib.pyplot as plt
import numpy as np
import warnings
from .plot import Display
# Import Local Libs
from ..utils import datetime_utils as dt_utils
class WindRoseDisplay(Display):
"""
A clas... | 39.190265 | 110 | 0.557638 |
b5b58b1d72358047f66d72c261487ded7e143d68 | 283 | py | Python | template/{{cookiecutter.pkg_name}}/setup.py | azazdeaz/ros-grpc-wrapper | 8438ed371630294f3845cd238958103041f233de | [
"MIT"
] | 18 | 2020-09-10T06:03:32.000Z | 2022-03-14T14:05:17.000Z | template/{{cookiecutter.pkg_name}}/setup.py | azazdeaz/ros-grpc-wrapper | 8438ed371630294f3845cd238958103041f233de | [
"MIT"
] | 1 | 2021-08-24T09:41:42.000Z | 2021-08-24T09:41:42.000Z | template/{{cookiecutter.pkg_name}}/setup.py | azazdeaz/ros-grpc-wrapper | 8438ed371630294f3845cd238958103041f233de | [
"MIT"
] | 3 | 2021-02-21T04:19:21.000Z | 2021-11-12T06:24:37.000Z | from setuptools import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ros_pb2', 'ros_pb2_grpc', '{{cookiecutter.pkg_name}}'],
package_dir={'': 'src'})
setup(**setup_args)
| 28.3 | 70 | 0.763251 |
92baa11d0b9d0dc768f74909952c316cc3314100 | 308 | py | Python | leetcode/medium/top-k-frequent-elements.py | vtemian/interviews-prep | ddef96b5ecc699a590376a892a804c143fe18034 | [
"Apache-2.0"
] | 8 | 2019-05-14T12:50:29.000Z | 2022-03-01T09:08:27.000Z | leetcode/medium/top-k-frequent-elements.py | vtemian/interviews-prep | ddef96b5ecc699a590376a892a804c143fe18034 | [
"Apache-2.0"
] | 46 | 2019-03-24T20:59:29.000Z | 2019-04-09T16:28:43.000Z | leetcode/medium/top-k-frequent-elements.py | vtemian/interviews-prep | ddef96b5ecc699a590376a892a804c143fe18034 | [
"Apache-2.0"
] | 1 | 2022-01-28T12:46:29.000Z | 2022-01-28T12:46:29.000Z | import heapq
from collections import Counter
class Solution:
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
nums = Counter(nums)
return [
x[0]
for x in heapq.nlargest(k, [(nr, value) for nr, value in nums.items()], key=lambda nr: nr[1])
]
| 25.666667 | 105 | 0.577922 |
52582496addf1038f8f747b268df5c1077cc6d66 | 252 | py | Python | manage.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | 3 | 2015-05-25T07:41:42.000Z | 2020-05-18T05:50:40.000Z | manage.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | null | null | null | manage.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openwater.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.909091 | 73 | 0.77381 |
a1f08465cddd3aa48517bd3532a1ab111ba0d0be | 50 | py | Python | kolga/plugins/exception.py | Hi-Fi/kolga | 821169fc24eb7e3883e6b4993ac75117a0c59766 | [
"MIT"
] | null | null | null | kolga/plugins/exception.py | Hi-Fi/kolga | 821169fc24eb7e3883e6b4993ac75117a0c59766 | [
"MIT"
] | null | null | null | kolga/plugins/exception.py | Hi-Fi/kolga | 821169fc24eb7e3883e6b4993ac75117a0c59766 | [
"MIT"
] | null | null | null | class TestCouldNotLoadPlugin(Exception):
pass
| 16.666667 | 40 | 0.8 |
8f088e8f72f684f3807e6c50987f9c23cb262889 | 957 | py | Python | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 34.178571 | 141 | 0.583072 |
57bcbfb0954db2c91ec2ed22506d36d008fe3876 | 29,958 | py | Python | cdpcli/clidriver.py | anuragpatro/cdpcli | fe2b78308e4f8c09aa9609a43a646f314fa20327 | [
"Apache-2.0"
] | 7 | 2020-10-01T14:03:57.000Z | 2022-02-23T17:47:08.000Z | cdpcli/clidriver.py | anuragpatro/cdpcli | fe2b78308e4f8c09aa9609a43a646f314fa20327 | [
"Apache-2.0"
] | 1 | 2020-11-30T08:00:50.000Z | 2020-12-01T08:00:20.000Z | cdpcli/clidriver.py | anuragpatro/cdpcli | fe2b78308e4f8c09aa9609a43a646f314fa20327 | [
"Apache-2.0"
] | 7 | 2020-11-07T20:55:47.000Z | 2021-11-09T18:45:33.000Z | # Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Modifications made by Cloudera are:
# Copyright (c) 2016 Cloudera, 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. A cop... | 41.899301 | 90 | 0.639095 |
cba2c2d7ab58347d99533c90c4f4701c1db568b3 | 8,834 | py | Python | docs/source/conf.py | bhumikapahariapuresoftware/django-otp | 462908b0e5a930a9b1a7227b1410cfa0e70b2194 | [
"BSD-2-Clause"
] | null | null | null | docs/source/conf.py | bhumikapahariapuresoftware/django-otp | 462908b0e5a930a9b1a7227b1410cfa0e70b2194 | [
"BSD-2-Clause"
] | null | null | null | docs/source/conf.py | bhumikapahariapuresoftware/django-otp | 462908b0e5a930a9b1a7227b1410cfa0e70b2194 | [
"BSD-2-Clause"
] | null | null | null | # django-otp documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 13 09:48:33 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... | 31.105634 | 80 | 0.696966 |
fb20f279cc5b89c2e208647f19bcd16143c30ac0 | 1,051 | py | Python | jesse/models/Ticker.py | clarkandrew/jesse | 169f3c85c465ef6604d42bd27c28612365309b4a | [
"MIT"
] | 3,999 | 2018-11-09T10:38:51.000Z | 2022-03-31T12:29:12.000Z | jesse/models/Ticker.py | clarkandrew/jesse | 169f3c85c465ef6604d42bd27c28612365309b4a | [
"MIT"
] | 172 | 2020-04-16T16:19:08.000Z | 2022-03-28T13:28:55.000Z | jesse/models/Ticker.py | pmondal08/jesse | 527952a74bc76f76cf3a2d25755386f8db285885 | [
"MIT"
] | 495 | 2019-03-01T21:48:53.000Z | 2022-03-30T15:35:19.000Z | import peewee
import jesse.helpers as jh
from jesse.services.db import db
class Ticker(peewee.Model):
id = peewee.UUIDField(primary_key=True)
# timestamp in milliseconds
timestamp = peewee.BigIntegerField()
# the latest trades price
last_price = peewee.FloatField()
# the trading volume in the... | 26.948718 | 68 | 0.656518 |
b9a1baf1762d57ebf63d69df413c59d1f4e182e2 | 16,983 | py | Python | scripts/artifacts/powerlogGZ.py | xperylabhub/iLEAPP | fd1b301bf2094387f51ccdbd10ed233ce9abd687 | [
"MIT"
] | null | null | null | scripts/artifacts/powerlogGZ.py | xperylabhub/iLEAPP | fd1b301bf2094387f51ccdbd10ed233ce9abd687 | [
"MIT"
] | 1 | 2021-01-16T05:32:40.000Z | 2021-01-16T05:32:40.000Z | scripts/artifacts/powerlogGZ.py | xperylabhub/iLEAPP | fd1b301bf2094387f51ccdbd10ed233ce9abd687 | [
"MIT"
] | null | null | null | import gzip
import re
import os
import shutil
import sqlite3
from pathlib import Path
import scripts.artifacts.artGlobals
from packaging import version
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, logdevinfo, timeline, tsv, is_platform_windows, open_sqlite_db_readonly
... | 32.534483 | 158 | 0.711653 |
0bc277fbc08e131a42fccbc4b12394fd98250999 | 177 | py | Python | conftest.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 19 | 2015-01-28T08:40:20.000Z | 2021-12-18T11:55:58.000Z | conftest.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 2 | 2015-02-09T17:03:24.000Z | 2015-04-22T17:57:45.000Z | conftest.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 4 | 2015-02-02T14:05:08.000Z | 2016-09-14T00:44:55.000Z | import os
from django.conf import settings
def pytest_configure():
if not settings.configured:
os.environ['DJANGO_SETTINGS_MODULE'] = 'multimedia.tests.settings'
| 19.666667 | 74 | 0.745763 |
8d3ec2c684e9d42d64acae2e20c08ca54aa8fccf | 5,600 | py | Python | unpythonic/tests/test_lispylet.py | Technologicat/unpythonic | 7d99d50c5d1c3151fb822491167a7008024d97a5 | [
"BSD-2-Clause"
] | 55 | 2018-07-26T15:52:22.000Z | 2022-01-28T00:53:59.000Z | unpythonic/tests/test_lispylet.py | Technologicat/unpythonic | 7d99d50c5d1c3151fb822491167a7008024d97a5 | [
"BSD-2-Clause"
] | 85 | 2019-07-24T11:02:45.000Z | 2022-01-31T22:00:23.000Z | unpythonic/tests/test_lispylet.py | Technologicat/unpythonic | 7d99d50c5d1c3151fb822491167a7008024d97a5 | [
"BSD-2-Clause"
] | 2 | 2020-09-04T21:39:19.000Z | 2022-01-12T03:41:50.000Z | # -*- coding: utf-8 -*-
from ..syntax import macros, test, test_raises # noqa: F401
from ..test.fixtures import session, testset
from functools import partial
from ..lispylet import let, letrec, dlet, dletrec, blet, bletrec
from ..seq import begin
def runtests():
with testset("basic usage"):
x = let((... | 35.220126 | 146 | 0.392679 |
718ccb944448b1b47b2251896d6c608af7787bc7 | 1,190 | py | Python | files/nginx.facts.py | Turgon37/ansible-nginx | bb3e5d6a18546b09f61e45b5066161e4683c7733 | [
"MIT"
] | null | null | null | files/nginx.facts.py | Turgon37/ansible-nginx | bb3e5d6a18546b09f61e45b5066161e4683c7733 | [
"MIT"
] | null | null | null | files/nginx.facts.py | Turgon37/ansible-nginx | bb3e5d6a18546b09f61e45b5066161e4683c7733 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json
import re
import subprocess
import sys
content = dict()
version_re = re.compile('nginx/(?P<version>(?P<major>[0-9]+)\.(?P<branch>[0-9]+)\.[0-9]+)')
stdout = None
try:
result = subprocess.Popen(['/usr/bin/env', 'nginx', '-v'],
stdout=subprocess.PIPE,... | 27.045455 | 91 | 0.570588 |
409e61fe8b01e55f20af6c15b7fa510ecf89bb20 | 641 | py | Python | day25.py | p88h/aoc2017 | a929a8c0894559b0d7dd3d0b58c076295087f4c8 | [
"Unlicense"
] | 1 | 2021-12-26T21:28:47.000Z | 2021-12-26T21:28:47.000Z | day25.py | p88h/aoc2017 | a929a8c0894559b0d7dd3d0b58c076295087f4c8 | [
"Unlicense"
] | null | null | null | day25.py | p88h/aoc2017 | a929a8c0894559b0d7dd3d0b58c076295087f4c8 | [
"Unlicense"
] | null | null | null | import io
lines = io.open("day25.in").read().splitlines()
state = lines[0][15]
steps = int(lines[1].split()[5])
program = {}
curs = 0
tape = {}
def parse_op(stmt):
val = int(stmt[0][22])
dir = 1 if 'right' in stmt[1] else -1
nxt = stmt[2][26]
return (val, dir, nxt)
for blk in range(len(lines) // 10):
... | 25.64 | 96 | 0.606864 |
00e5fe1a58ef056c96202320d14c085552f15c71 | 4,284 | py | Python | openshift/test/test_v1_cluster_resource_quota_selector.py | flaper87/openshift-restclient-python | 13d5d86ca89035b9f596032e7a34f3cc33bf8f18 | [
"Apache-2.0"
] | null | null | null | openshift/test/test_v1_cluster_resource_quota_selector.py | flaper87/openshift-restclient-python | 13d5d86ca89035b9f596032e7a34f3cc33bf8f18 | [
"Apache-2.0"
] | null | null | null | openshift/test/test_v1_cluster_resource_quota_selector.py | flaper87/openshift-restclient-python | 13d5d86ca89035b9f596032e7a34f3cc33bf8f18 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | 99.627907 | 3,380 | 0.794818 |
c8076782efa55c054dacb71f7dac4093480cbdc5 | 1,019 | py | Python | src/xgboost_distribution/distributions/base.py | thomasaarholt/xgboost-distribution | 8ee00f7f0dcaadcb345ebcb15534287081aa987b | [
"MIT"
] | null | null | null | src/xgboost_distribution/distributions/base.py | thomasaarholt/xgboost-distribution | 8ee00f7f0dcaadcb345ebcb15534287081aa987b | [
"MIT"
] | null | null | null | src/xgboost_distribution/distributions/base.py | thomasaarholt/xgboost-distribution | 8ee00f7f0dcaadcb345ebcb15534287081aa987b | [
"MIT"
] | null | null | null | """Distribution base class
"""
from abc import ABC, abstractmethod
from collections import namedtuple
class BaseDistribution(ABC):
"""Base class distribution for XGBDistribution.
Note that distributions are stateless, hence a distribution is just a collection of
functions that operate on the data (`y`) a... | 24.261905 | 87 | 0.671246 |
520fb62e620e06929db16f63c783a0ef42413d8e | 4,739 | py | Python | test/python/createForestDatafile.py | hpcc-systems/LearningTrees | 386e8f84ca102d9f87a002c05032830ebd4b8c90 | [
"Apache-2.0"
] | 2 | 2017-12-11T09:55:35.000Z | 2017-12-20T18:37:21.000Z | test/python/createForestDatafile.py | hpcc-systems/LearningTrees | 386e8f84ca102d9f87a002c05032830ebd4b8c90 | [
"Apache-2.0"
] | 5 | 2017-11-16T09:41:52.000Z | 2018-10-04T18:18:56.000Z | test/python/createForestDatafile.py | hpcc-systems/LearningTrees | 386e8f84ca102d9f87a002c05032830ebd4b8c90 | [
"Apache-2.0"
] | 2 | 2017-06-23T13:35:05.000Z | 2022-01-01T12:11:37.000Z | # Build an ecl version of the Cover Type Database:
# http://archive.ics.uci.edu/ml/datasets/Covertype
# for testing purposes.
# To run: python createForestDatafile.py > ..\datasets\CovTypeDS.ecl
import sklearn.datasets
trainSamples = 1000
testSamples = 500
covtype = sklearn.datasets.fetch_covtype()
data = covtype.dat... | 34.34058 | 96 | 0.618485 |
c43d26d22339caef8366ae2bd3c4b4bef2f3c398 | 453 | py | Python | data/scripts/templates/object/tangible/wearables/skirt/shared_skirt_s11.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/wearables/skirt/shared_skirt_s11.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/wearables/skirt/shared_skirt_s11.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/skirt/shared_skirt_s11.iff"
result.attribute_template_id ... | 26.647059 | 73 | 0.730684 |
ba3f4177034512de79905dbcb167395b0ff8e593 | 1,015 | py | Python | app/app/urls.py | godomainz/recipe-app-api | ac3315ee44974c75de0c0dde95ae701549c3a8ae | [
"MIT"
] | null | null | null | app/app/urls.py | godomainz/recipe-app-api | ac3315ee44974c75de0c0dde95ae701549c3a8ae | [
"MIT"
] | 7 | 2021-03-30T13:53:36.000Z | 2022-01-13T03:15:17.000Z | app/app/urls.py | godomainz/recipe-app-api | ac3315ee44974c75de0c0dde95ae701549c3a8ae | [
"MIT"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 37.592593 | 78 | 0.697537 |
306eb717fcb12e5a68cc2966f5b6a82fc062c208 | 3,105 | py | Python | tabnine-vim/third_party/ycmd/third_party/bottle/plugins/werkzeug/bottle_werkzeug.py | MrMonk3y/vimrc | 950230fb3fd7991d1234c2ab516ec03245945677 | [
"MIT"
] | 239 | 2018-04-20T06:58:32.000Z | 2022-03-22T18:06:08.000Z | plugins/werkzeug/bottle_werkzeug.py | alisaifee/bottle | 2d38ec9b52cc0e8445b6e38e07c8b5a2711335fb | [
"MIT"
] | 10 | 2018-12-09T13:49:06.000Z | 2021-07-03T00:38:53.000Z | plugins/werkzeug/bottle_werkzeug.py | alisaifee/bottle | 2d38ec9b52cc0e8445b6e38e07c8b5a2711335fb | [
"MIT"
] | 99 | 2018-07-20T09:16:13.000Z | 2022-03-20T11:58:56.000Z | """
This plugin adds support for :class:`werkzeug.Response`, all kinds of
:exc:`werkzeug.exceptions` and provides a thread-local instance of
:class:`werkzeug.Request`. It basically turns Bottle into Flask.
The plugin instance doubles as a werkzeug module object, so you don't need to
import werkzeug in your application... | 31.05 | 91 | 0.652496 |
895e5aa9f5f569c946e5743174fa5c0336a90f3b | 61,360 | py | Python | metalibm_core/core/ml_formats.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | metalibm_core/core/ml_formats.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | metalibm_core/core/ml_formats.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
## @package ml_formats
# Metalibm Formats node precision
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT L... | 39.740933 | 166 | 0.669003 |
e2e6b3a7df083bc5d048f422539e2cd1ee15dddd | 5,893 | py | Python | src/reducer/testing.py | fritzo/pomagma | 224bb6adab3fc68e2d853e6365b4b86a8f7f468f | [
"Apache-2.0"
] | 10 | 2015-06-09T00:25:01.000Z | 2019-06-11T16:07:31.000Z | src/reducer/testing.py | fritzo/pomagma | 224bb6adab3fc68e2d853e6365b4b86a8f7f468f | [
"Apache-2.0"
] | 25 | 2015-03-23T23:16:01.000Z | 2017-08-29T03:35:59.000Z | src/reducer/testing.py | fritzo/pomagma | 224bb6adab3fc68e2d853e6365b4b86a8f7f468f | [
"Apache-2.0"
] | null | null | null | """Tools for testing implementations of reduce() and simplify()."""
import os
from importlib import import_module
import hypothesis.strategies as s
import pytest
from parsable import parsable
from pomagma.reducer import bohm
from pomagma.reducer.linker import link
from pomagma.reducer.syntax import (APP, BOOL, BOT, ... | 28.746341 | 79 | 0.53029 |
fd8f924a012561f87eb0cdddbe741ff8d7b0151d | 8,525 | py | Python | examples/tests/test_example_aircraft.py | GodotMisogi/openconcept | 8206cb2d4303cb83e89d4075649bf69118384486 | [
"MIT"
] | 22 | 2018-09-11T16:40:23.000Z | 2022-03-22T09:45:53.000Z | examples/tests/test_example_aircraft.py | GodotMisogi/openconcept | 8206cb2d4303cb83e89d4075649bf69118384486 | [
"MIT"
] | 25 | 2018-12-16T20:32:17.000Z | 2022-03-16T14:53:07.000Z | examples/tests/test_example_aircraft.py | GodotMisogi/openconcept | 8206cb2d4303cb83e89d4075649bf69118384486 | [
"MIT"
] | 24 | 2018-07-27T06:31:01.000Z | 2022-03-13T15:27:07.000Z |
from __future__ import division
import unittest
import numpy as np
from openmdao.utils.assert_utils import assert_near_equal, assert_check_partials
from openmdao.api import IndepVarComp, Group, Problem
from examples.B738 import run_738_analysis
from examples.TBM850 import run_tbm_analysis
from examples.HybridTwin_ther... | 58.793103 | 132 | 0.723988 |
400e45d208b03f3a8b991a2a7396c8f55cb3163d | 833 | py | Python | pyspedas/particles/spd_part_products/spd_pgs_make_e_spec.py | pulupa/pyspedas | 7228199cf16eca2a27d130f1e4985ef1e69462ea | [
"MIT"
] | 75 | 2019-02-22T12:59:33.000Z | 2022-02-26T15:33:20.000Z | pyspedas/particles/spd_part_products/spd_pgs_make_e_spec.py | pulupa/pyspedas | 7228199cf16eca2a27d130f1e4985ef1e69462ea | [
"MIT"
] | 40 | 2019-07-02T07:46:34.000Z | 2022-02-23T21:48:50.000Z | pyspedas/particles/spd_part_products/spd_pgs_make_e_spec.py | pulupa/pyspedas | 7228199cf16eca2a27d130f1e4985ef1e69462ea | [
"MIT"
] | 43 | 2019-02-22T13:03:41.000Z | 2022-01-24T19:26:59.000Z |
import numpy as np
# use nanmean from bottleneck if it's installed, otherwise use the numpy one
try:
import bottleneck as bn
nanmean = bn.nanmean
except ImportError:
nanmean = np.nanmean
def spd_pgs_make_e_spec(data_in):
"""
Builds energy spectrogram from the particle data structure
Inpu... | 22.513514 | 76 | 0.632653 |
75846b7ecb6fcac2b940d28dd52eff4993076e88 | 15,593 | py | Python | tests/models/test_cpu.py | ameliatqy/pytorch-lightning | ca18e11f6efe822098c79e7d9124b08a55bcd908 | [
"Apache-2.0"
] | null | null | null | tests/models/test_cpu.py | ameliatqy/pytorch-lightning | ca18e11f6efe822098c79e7d9124b08a55bcd908 | [
"Apache-2.0"
] | null | null | null | tests/models/test_cpu.py | ameliatqy/pytorch-lightning | ca18e11f6efe822098c79e7d9124b08a55bcd908 | [
"Apache-2.0"
] | null | null | null | import os
import platform
import pytest
import torch
from packaging.version import parse as version_parse
import tests.base.develop_pipelines as tpipes
import tests.base.develop_utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping
from pytorch_lightning.callbacks... | 30.57451 | 97 | 0.660104 |
c15715e95a2874c6fd7c0b9e56e193c99a46dcdb | 1,744 | py | Python | src/lib/network.py | Darksider3/monitorNet | 1c0419ee6cb3191c5aaa347ffe0fcffc4992f391 | [
"BSD-2-Clause"
] | null | null | null | src/lib/network.py | Darksider3/monitorNet | 1c0419ee6cb3191c5aaa347ffe0fcffc4992f391 | [
"BSD-2-Clause"
] | 6 | 2017-02-18T22:25:56.000Z | 2017-03-08T10:30:34.000Z | src/lib/network.py | Darksider3/monitorNet | 1c0419ee6cb3191c5aaa347ffe0fcffc4992f391 | [
"BSD-2-Clause"
] | null | null | null | import requests
import time
import os
import colors
class network:
def __init__(self, host, httpTimeout=3, pingTimeout=1000, sleepTimer=10, httpExceptionTimer=2, defaultProt="https://"):
self.httpTimeout = httpTimeout
self.pingTimeout = pingTimeout
self.sleepTimer = sleepTimer
... | 29.559322 | 124 | 0.563647 |
cd6d3d2e70f1916d306543fe3214c8476a9f1558 | 15,185 | py | Python | python/mxnet/image.py | bill-teng/mxnet-test | 39a2c0cff1be8b8277b2e0a8c55214acc186a49c | [
"Apache-2.0"
] | 2 | 2017-05-31T02:18:53.000Z | 2021-04-08T04:50:32.000Z | python/mxnet/image.py | bill-teng/mxnet-test | 39a2c0cff1be8b8277b2e0a8c55214acc186a49c | [
"Apache-2.0"
] | null | null | null | python/mxnet/image.py | bill-teng/mxnet-test | 39a2c0cff1be8b8277b2e0a8c55214acc186a49c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# pylint: disable=no-member, too-many-lines, redefined-builtin, protected-access, unused-import, invalid-name
# pylint: disable=too-many-arguments, too-many-locals, no-name-in-module, too-many-branches, too-many-statements
"""Image IO API of mxnet."""
from __future__ import absolute_import, print_functi... | 33.300439 | 112 | 0.57537 |
166ae17b118a69d45a11a46724665edcf584fc34 | 4,219 | py | Python | tests/python/small/test_glm_ipums.py | pnijhara/h2o4gpu | 6257112c134136471420b68241f57190a445b67d | [
"Apache-2.0"
] | 458 | 2017-09-20T08:32:10.000Z | 2022-02-28T18:40:57.000Z | tests/python/small/test_glm_ipums.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | 461 | 2017-09-20T11:39:04.000Z | 2021-11-21T15:51:42.000Z | tests/python/small/test_glm_ipums.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | 114 | 2017-09-20T12:08:07.000Z | 2021-11-29T14:15:40.000Z | # -*- encoding: utf-8 -*-
"""
GLM solver tests using Kaggle datasets.
:copyright: 2017-2018 H2O.ai, Inc.
:license: Apache License Version 2.0 (see LICENSE for details)
"""
import time
import sys
import os
import numpy as np
import pandas as pd
import logging
print(sys.path)
from h2o4gpu.util.testing_utils import f... | 30.352518 | 178 | 0.666983 |
319c2468ccc4037debd01f5ab609db0f96c15c14 | 1,331 | py | Python | tests/ens/test_get_registry.py | DanielVF/web3.py | c25be34450c5003d16a937e27c1d5a26187985f1 | [
"MIT"
] | null | null | null | tests/ens/test_get_registry.py | DanielVF/web3.py | c25be34450c5003d16a937e27c1d5a26187985f1 | [
"MIT"
] | null | null | null | tests/ens/test_get_registry.py | DanielVF/web3.py | c25be34450c5003d16a937e27c1d5a26187985f1 | [
"MIT"
] | null | null | null |
import pytest
from unittest.mock import (
patch,
)
from ens import ENS
from web3 import Web3
def test_resolver_empty(ens):
with patch.object(ens.ens, 'resolver', return_value=None):
assert ens.resolver('') is None
@pytest.mark.parametrize(
'address, expected_reverse',
[
(
... | 26.62 | 86 | 0.677686 |
45d8db48d9a1a3869d35a01ee1289d4411ddc079 | 2,174 | py | Python | py/g1/bases/g1/bases/datetimes.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/g1/bases/g1/bases/datetimes.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/g1/bases/g1/bases/datetimes.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | """Extension of standard library's datetime.
A common pitfall of using datetime to store a timestamps is not setting
timezone to UTC, which is then default to the local timezone. This
produces wrong results when converting datetime-represented timestamp
to/from a number-represented timestamp. Specifically, when the ... | 27.871795 | 76 | 0.688132 |
286dc54d6aac3a474ccde85c06db526d22ae222b | 1,061 | py | Python | koans/about_triangle_project.py | shibamirai/python_koans | c1eba327dbe9534042e510dfce4e0c49c853255e | [
"MIT"
] | null | null | null | koans/about_triangle_project.py | shibamirai/python_koans | c1eba327dbe9534042e510dfce4e0c49c853255e | [
"MIT"
] | null | null | null | koans/about_triangle_project.py | shibamirai/python_koans | c1eba327dbe9534042e510dfce4e0c49c853255e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
# この問題は、triangle.py の triangle 関数を修正してください
# You need to write the triangle method in the file 'triangle.py'
from .triangle import *
class AboutTriangleProject(Koan):
"三角形プロジェクト"
def test_equilateral_triangles_have_equal_sides(self):
... | 35.366667 | 68 | 0.683318 |
667ee1028ad4f21a2d52a2c78280cd9fba1ce378 | 5,561 | py | Python | tests/cephfs/cephfs_basic_tests.py | anrao19/cephci | 0ec20acc108750f44a66dcf1c512922a91570f3e | [
"MIT"
] | null | null | null | tests/cephfs/cephfs_basic_tests.py | anrao19/cephci | 0ec20acc108750f44a66dcf1c512922a91570f3e | [
"MIT"
] | null | null | null | tests/cephfs/cephfs_basic_tests.py | anrao19/cephci | 0ec20acc108750f44a66dcf1c512922a91570f3e | [
"MIT"
] | null | null | null | import logging
import random
import string
import traceback
from ceph.ceph import CommandFailed
from tests.cephfs.cephfs_utilsV1 import FsUtils
logger = logging.getLogger(__name__)
log = logger
def run(ceph_cluster, **kw):
try:
fs_util = FsUtils(ceph_cluster)
config = kw.get("config")
b... | 37.073333 | 119 | 0.539112 |
7730d329469516456bde3b089f06bd36ccc0d19f | 66,320 | py | Python | src/oic/oic/__init__.py | Swapnilr1/pyoidc | 2feb099f4f4e26047888437aea1226237d05ebba | [
"Apache-2.0"
] | null | null | null | src/oic/oic/__init__.py | Swapnilr1/pyoidc | 2feb099f4f4e26047888437aea1226237d05ebba | [
"Apache-2.0"
] | null | null | null | src/oic/oic/__init__.py | Swapnilr1/pyoidc | 2feb099f4f4e26047888437aea1226237d05ebba | [
"Apache-2.0"
] | null | null | null | import hashlib
import logging
import os
from oic.utils.http_util import Response
try:
from json import JSONDecodeError
except ImportError: # Only works for >= 3.5
_decode_err = ValueError
else:
_decode_err = JSONDecodeError
import six
from future.backports.urllib.parse import urlparse
from future.moves... | 36.844444 | 89 | 0.540048 |
49c2d3c26e92401f8d5782ff1dcb394c5547403f | 26,140 | py | Python | src/sage/monoids/string_monoid.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/monoids/string_monoid.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/monoids/string_monoid.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | r"""
Free String Monoids
AUTHORS:
- David Kohel <kohel@maths.usyd.edu.au>, 2007-01
Sage supports a wide range of specific free string monoids.
"""
#*****************************************************************************
# Copyright (C) 2007 David Kohel <kohel@maths.usyd.edu.au>
#
# This program is free ... | 32.593516 | 126 | 0.524254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.