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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36d644e053fd2ad6ef0433da41ef25ac92c0b66b | 4,481 | py | Python | dp/cloud/python/magma/radio_controller/tests/test_utils/active_mode_cbsd_builder.py | priya-wavelabs/magma | 6385bd05f3e81b04492ec6065f0d19597b0d4ab8 | [
"BSD-3-Clause"
] | null | null | null | dp/cloud/python/magma/radio_controller/tests/test_utils/active_mode_cbsd_builder.py | priya-wavelabs/magma | 6385bd05f3e81b04492ec6065f0d19597b0d4ab8 | [
"BSD-3-Clause"
] | null | null | null | dp/cloud/python/magma/radio_controller/tests/test_utils/active_mode_cbsd_builder.py | priya-wavelabs/magma | 6385bd05f3e81b04492ec6065f0d19597b0d4ab8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from typing import List, Optional
from dp.protos.active_mode_pb2 import (
Cbsd,
CbsdState,
Channel,
DatabaseCbsd,
EirpCapabilities,
FrequencyPreferences,
Grant,
GrantState,
)
from google.protobuf.wrappers_pb2 import FloatValue
class ActiveModeCbsdBu... | 30.073826 | 104 | 0.625976 |
97819e6f3ab21636d427e924e969d2ef4cba12e5 | 6,417 | py | Python | Project/train/train.py | helgeanl/sagemaker-deployment | 24e947b20f2c8a9fb4bfaa6f02fdf43254ab9091 | [
"MIT"
] | null | null | null | Project/train/train.py | helgeanl/sagemaker-deployment | 24e947b20f2c8a9fb4bfaa6f02fdf43254ab9091 | [
"MIT"
] | null | null | null | Project/train/train.py | helgeanl/sagemaker-deployment | 24e947b20f2c8a9fb4bfaa6f02fdf43254ab9091 | [
"MIT"
] | null | null | null | import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import torch
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
def model_fn(model_dir):
"""Load the PyTorch model from the `model_dir` directory."""
print("Loading ... | 37.526316 | 107 | 0.653421 |
162451a77d5d08fac51354b4d86df361338d5742 | 6,990 | py | Python | env/lib/python3.7/site-packages/sklearn/utils/tests/test_cython_blas.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 25 | 2019-03-08T01:03:03.000Z | 2022-02-14T17:38:32.000Z | env/lib/python3.7/site-packages/sklearn/utils/tests/test_cython_blas.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 9 | 2020-09-25T22:32:02.000Z | 2022-02-09T23:45:10.000Z | env/lib/python3.7/site-packages/sklearn/utils/tests/test_cython_blas.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 31 | 2019-01-15T20:16:50.000Z | 2022-03-01T05:47:38.000Z | import pytest
import numpy as np
from sklearn.utils.testing import assert_allclose
from sklearn.utils._cython_blas import _dot_memview
from sklearn.utils._cython_blas import _asum_memview
from sklearn.utils._cython_blas import _axpy_memview
from sklearn.utils._cython_blas import _nrm2_memview
from sklearn.utils._cyth... | 31.066667 | 78 | 0.648641 |
58f118ebabc477d412d43ca8194cd41cb6769bed | 346 | py | Python | pdc/apps/package/apps.py | tzhaoredhat/automation | a1867dc2d3591fdae1fa7f80d457c25f9705070e | [
"MIT"
] | null | null | null | pdc/apps/package/apps.py | tzhaoredhat/automation | a1867dc2d3591fdae1fa7f80d457c25f9705070e | [
"MIT"
] | null | null | null | pdc/apps/package/apps.py | tzhaoredhat/automation | a1867dc2d3591fdae1fa7f80d457c25f9705070e | [
"MIT"
] | null | null | null | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from django.apps import AppConfig
from pdc.apps.utils.utils import connect_app_models_pre_save_signal
class PackageConfig(AppConfig):
name = 'pdc.apps.package'
def ready(self):
connect_app_mod... | 23.066667 | 67 | 0.757225 |
72fd52767e0056f0163fa0e85c0b53a4abac35b0 | 3,590 | py | Python | tests/test_subtyping_processing.py | peterk87/biohansel | b65f9499e2c5f7d5891f1dfc0b71ba46140410a7 | [
"Apache-2.0"
] | null | null | null | tests/test_subtyping_processing.py | peterk87/biohansel | b65f9499e2c5f7d5891f1dfc0b71ba46140410a7 | [
"Apache-2.0"
] | null | null | null | tests/test_subtyping_processing.py | peterk87/biohansel | b65f9499e2c5f7d5891f1dfc0b71ba46140410a7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas as pd
from bio_hansel.qc import QC
from bio_hansel.subtype import Subtype
from bio_hansel.subtyper import absent_downstream_subtypes, sorted_subtype_ints, count_periods, empty_results
from bio_hansel.utils import find_inconsistent_subtypes
def test_count_periods():
assert c... | 36.632653 | 120 | 0.56156 |
dd0bac5d9b3709c0527b50234a2345152e8fe6d8 | 78,333 | py | Python | lib/galaxy/webapps/galaxy/controllers/workflow.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/controllers/workflow.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/controllers/workflow.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | import base64
import httplib
import json
import os
import sgmllib
import urllib2
from sqlalchemy import and_
from tool_shed.util import common_util
from tool_shed.util import encoding_util
from galaxy import model
from galaxy import util
from galaxy import web
from galaxy.datatypes.data import Data
from galaxy.model.... | 48.836035 | 199 | 0.58882 |
57b034a143f47ec7f901453c4abd16ba2dc06b49 | 865 | py | Python | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/__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 ... | 43.25 | 114 | 0.657803 |
76a531949487e6446c3cae6fe643b4714317a58b | 250 | py | Python | modules/analysis-of-algorithms/modules/worst-average-and-best-cases/src/LinearSearch.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | 1 | 2020-09-06T22:17:19.000Z | 2020-09-06T22:17:19.000Z | modules/analysis-of-algorithms/modules/worst-average-and-best-cases/src/LinearSearch.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | modules/analysis-of-algorithms/modules/worst-average-and-best-cases/src/LinearSearch.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | def search(arr, element):
for index, value in enumerate(arr):
if value == element:
return index
return -1
if __name__ =="__main__":
arr = [1, 10, 30, 15]
element = 30
print(element, "is present at index ", search(arr, element))
| 20.833333 | 62 | 0.636 |
1ba855af1ba5a7ec57bd67e4fcd2f54ba0467aab | 5,371 | py | Python | git/test/test_util.py | ifwe/GitPython | 2752f7068fb6fc160f63eabec3964263171593e3 | [
"BSD-3-Clause"
] | null | null | null | git/test/test_util.py | ifwe/GitPython | 2752f7068fb6fc160f63eabec3964263171593e3 | [
"BSD-3-Clause"
] | null | null | null | git/test/test_util.py | ifwe/GitPython | 2752f7068fb6fc160f63eabec3964263171593e3 | [
"BSD-3-Clause"
] | null | null | null | # test_utils.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
import tempfile
from git.util import *
from git.test.lib import *
from git.objects.uti... | 32.161677 | 92 | 0.60324 |
a735f4b64bd053a678ca9aab00a56bb10d89ca06 | 946 | py | Python | openpype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | null | null | null | openpype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | null | null | null | openpype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | null | null | null | import pyblish.api
import openpype.api
class ValidateIntermediateDirectoriesChecked(pyblish.api.InstancePlugin):
"""Validate Create Intermediate Directories is enabled on ROP node."""
order = openpype.api.ValidateContentsOrder
families = ['pointcache',
'camera',
'vdbcache'... | 28.666667 | 77 | 0.603594 |
0cc7168c30d3fdc31e68516b4e7b7f80e7f07775 | 1,223 | py | Python | spikesorters/tests/test_tridesclous.py | manimoh/spikesorters | b5ea81a316f6caeacf5be587561804ef99807d76 | [
"MIT"
] | null | null | null | spikesorters/tests/test_tridesclous.py | manimoh/spikesorters | b5ea81a316f6caeacf5be587561804ef99807d76 | [
"MIT"
] | null | null | null | spikesorters/tests/test_tridesclous.py | manimoh/spikesorters | b5ea81a316f6caeacf5be587561804ef99807d76 | [
"MIT"
] | null | null | null | import unittest
import pytest
import spikeextractors as se
from spikesorters import TridesclousSorter, run_tridesclous
from spikesorters.tests.common_tests import SorterCommonTestSuite
# This run several tests
@pytest.mark.skipif(not TridesclousSorter.installed, reason='tridesclous not installed')
class TridesclousC... | 34.942857 | 96 | 0.782502 |
bf29292211a0107032b00f83c8d1abaf952f333a | 2,261 | py | Python | Chapter04/chapter4/q_learning.py | CrazyNicolas/PyTorch-1.x-Reinforcement-Learning-Cookbook | 614ee6055039e2b4f91fc762c6bc5c92aee3ee83 | [
"MIT"
] | 1 | 2020-06-11T07:41:35.000Z | 2020-06-11T07:41:35.000Z | Chapter04/chapter4/q_learning.py | AmazingDD/PyTorch-1.x-Reinforcement-Learning-Cookbook | 1cca7e0218c2683a730b1c4a66681e68023657ef | [
"MIT"
] | null | null | null | Chapter04/chapter4/q_learning.py | AmazingDD/PyTorch-1.x-Reinforcement-Learning-Cookbook | 1cca7e0218c2683a730b1c4a66681e68023657ef | [
"MIT"
] | 1 | 2020-07-20T16:20:41.000Z | 2020-07-20T16:20:41.000Z | '''
Source codes for PyTorch 1.0 Reinforcement Learning (Packt Publishing)
Chapter 4: Temporal Difference and Q-Learning
Author: Yuxi (Hayden) Liu
'''
import torch
import gym
env = gym.make('CliffWalking-v0')
def gen_epsilon_greedy_policy(n_action, epsilon):
def policy_function(state, Q):
probs = torch.... | 23.8 | 83 | 0.674038 |
8833ff0be93d9b608c40cc1463769c86e9b4a4b0 | 2,912 | py | Python | moderation.py | MelihAlniacik/amethyst-discord-bot | e2fe4facca3fdc70855db37cb2c2e4595761a784 | [
"MIT"
] | null | null | null | moderation.py | MelihAlniacik/amethyst-discord-bot | e2fe4facca3fdc70855db37cb2c2e4595761a784 | [
"MIT"
] | null | null | null | moderation.py | MelihAlniacik/amethyst-discord-bot | e2fe4facca3fdc70855db37cb2c2e4595761a784 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import random
colors=[0xeb4034,0x31e2e8,0x3e32e3,0xe332dd,0xe3e332]
@commands.command()#mute
@commands.has_permissions(manage_messages=True)
async def mute(ctx,member: discord.Member,*,reason=None):
"""mutes the user"""
guild= ctx.guild
muted... | 31.652174 | 135 | 0.678915 |
b613e809be249c6a60e037eaf1b4d4e24443ce5a | 5,587 | py | Python | var/spack/repos/builtin/packages/tk/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2021-09-29T02:14:40.000Z | 2022-01-27T20:50:36.000Z | var/spack/repos/builtin/packages/tk/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/tk/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # 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)
import os
from spack import *
class Tk(AutotoolsPackage, SourceforgePackage):
"""Tk is a graphical user interface t... | 42.648855 | 128 | 0.670306 |
079f91dee37aebedc0d0ed6a42c0fc6af0bcafa6 | 9,244 | py | Python | test/distributed/_shard/sharding_spec/test_sharding_spec.py | eddieluo01/pytorch | e19f2e52adebd9ce36b8ac5302a9036662446d7f | [
"Intel"
] | 1 | 2022-02-02T11:58:26.000Z | 2022-02-02T11:58:26.000Z | test/distributed/_shard/sharding_spec/test_sharding_spec.py | eddieluo01/pytorch | e19f2e52adebd9ce36b8ac5302a9036662446d7f | [
"Intel"
] | null | null | null | test/distributed/_shard/sharding_spec/test_sharding_spec.py | eddieluo01/pytorch | e19f2e52adebd9ce36b8ac5302a9036662446d7f | [
"Intel"
] | null | null | null | # Owner(s): ["oncall: distributed"]
import torch
from torch.testing._internal.common_utils import TestCase
from torch.distributed._shard.sharding_spec import (
ChunkShardingSpec,
DevicePlacementSpec,
EnumerableShardingSpec,
ShardMetadata,
)
from torch.distributed._shard.sharding_spec._internals import ... | 36.537549 | 88 | 0.550736 |
54bcf7aabf58f829ad7bd0cd3874ab0b1568ed6c | 1,679 | py | Python | test/functional/p2p_i2p_ports.py | j2ibeo/askalcoin | 56cbf4ad39e8b43c65dad647531b5e573584ac91 | [
"MIT"
] | null | null | null | test/functional/p2p_i2p_ports.py | j2ibeo/askalcoin | 56cbf4ad39e8b43c65dad647531b5e573584ac91 | [
"MIT"
] | null | null | null | test/functional/p2p_i2p_ports.py | j2ibeo/askalcoin | 56cbf4ad39e8b43c65dad647531b5e573584ac91 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2021-2021 The Askalcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test ports handling for I2P hosts
"""
import re
from test_framework.test_framework import Askalcoi... | 38.159091 | 111 | 0.677784 |
d22ead8fa1c20191d1be922e87442ff680ad6c17 | 6,419 | py | Python | deeppavlov/models/classifiers/ru_obscenity_classifier.py | alexeyyakimovich/DeepPavlov | a95149294bc7fa30baaa15c629adad4c1cba264e | [
"Apache-2.0"
] | 3 | 2020-04-16T04:25:10.000Z | 2021-05-07T23:04:43.000Z | deeppavlov/models/classifiers/ru_obscenity_classifier.py | alexeyyakimovich/DeepPavlov | a95149294bc7fa30baaa15c629adad4c1cba264e | [
"Apache-2.0"
] | 9 | 2020-01-28T22:15:08.000Z | 2022-02-10T00:12:35.000Z | deeppavlov/models/classifiers/ru_obscenity_classifier.py | alexeyyakimovich/DeepPavlov | a95149294bc7fa30baaa15c629adad4c1cba264e | [
"Apache-2.0"
] | 1 | 2021-02-05T13:01:48.000Z | 2021-02-05T13:01:48.000Z | from typing import List, Union
from pathlib import Path
from logging import getLogger
import errno
import json
import re
import os
import pymorphy2
from deeppavlov.core.common.registry import register
from deeppavlov.core.models.estimator import Component
from deeppavlov.core.commands.utils import expand_path
log = ... | 48.263158 | 157 | 0.510827 |
4b1ed1241665b7f8b641b48eea69fbddff349786 | 7,107 | py | Python | v6.0.6/ips/test_fortios_ips_decoder.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 14 | 2018-09-25T20:35:25.000Z | 2021-07-14T04:30:54.000Z | v6.0.6/ips/test_fortios_ips_decoder.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 32 | 2018-10-09T04:13:42.000Z | 2020-05-11T07:20:28.000Z | v6.0.6/ips/test_fortios_ips_decoder.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 11 | 2018-10-09T00:14:53.000Z | 2021-11-03T10:54:09.000Z | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | 33.842857 | 142 | 0.707049 |
fd85d1320a00d605b94f30a484f7763b8f1a99fd | 56,237 | py | Python | networkx/readwrite/tests/test_graphml.py | ErikBrendel/networkx | 8f36023a8c97c9ab659cb8a956a4c0cdb0089b8e | [
"BSD-3-Clause"
] | 2 | 2020-09-24T07:31:50.000Z | 2020-09-24T07:31:53.000Z | networkx/readwrite/tests/test_graphml.py | ErikBrendel/networkx | 8f36023a8c97c9ab659cb8a956a4c0cdb0089b8e | [
"BSD-3-Clause"
] | null | null | null | networkx/readwrite/tests/test_graphml.py | ErikBrendel/networkx | 8f36023a8c97c9ab659cb8a956a4c0cdb0089b8e | [
"BSD-3-Clause"
] | 1 | 2020-12-03T05:51:32.000Z | 2020-12-03T05:51:32.000Z | import pytest
import networkx as nx
from networkx.testing.utils import assert_edges_equal, assert_nodes_equal
import io
import tempfile
import os
from networkx.testing import almost_equal
class BaseGraphML:
@classmethod
def setup_class(cls):
cls.simple_directed_data = """<?xml version="1.0" encoding="... | 44.003912 | 511 | 0.589043 |
8f097613cb72663402968e7654d66b7c3acc3e22 | 18,629 | py | Python | bin/awscli/customizations/cloudformation/artifact_exporter.py | broadly/bash-lambda-layer | 607b1ed15308914295992e8514b90e65308324aa | [
"MIT"
] | null | null | null | bin/awscli/customizations/cloudformation/artifact_exporter.py | broadly/bash-lambda-layer | 607b1ed15308914295992e8514b90e65308324aa | [
"MIT"
] | 1 | 2019-05-07T00:12:29.000Z | 2019-05-07T00:12:29.000Z | bin/awscli/customizations/cloudformation/artifact_exporter.py | broadly/bash-lambda-layer | 607b1ed15308914295992e8514b90e65308324aa | [
"MIT"
] | null | null | null | # Copyright 2012-2015 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 ac... | 33.994526 | 94 | 0.669172 |
71b6ae1c0843d2c06ece7d4ee54e994bccb998ae | 394 | py | Python | zeus/settings_default.py | iticus/zeus | f44b51a201743cb5d199879a525f15cfe9f01ff8 | [
"MIT"
] | null | null | null | zeus/settings_default.py | iticus/zeus | f44b51a201743cb5d199879a525f15cfe9f01ff8 | [
"MIT"
] | null | null | null | zeus/settings_default.py | iticus/zeus | f44b51a201743cb5d199879a525f15cfe9f01ff8 | [
"MIT"
] | null | null | null | """
Created on May 29, 2019
@author: ionut
"""
import logging
# Logging config
logging.basicConfig(level=logging.INFO, datefmt="%Y-%m-%d %H:%M:%S",
format="[%(asctime)s] - %(levelname)s - %(message)s")
# aiohttp settings
ADDRESS = "127.0.0.1"
PORT = 8000
TEMPLATE_PATH = "templates"
STATIC_PATH =... | 17.909091 | 73 | 0.639594 |
655a9a0e27031769c9787692249eb92ed509aa70 | 10,252 | py | Python | challenges/binarytree_test.py | Sukhrobjon/CS-1.3-Challenges | 53c906affef7bac91be95ffce9ff23cd1a6a505e | [
"MIT"
] | null | null | null | challenges/binarytree_test.py | Sukhrobjon/CS-1.3-Challenges | 53c906affef7bac91be95ffce9ff23cd1a6a505e | [
"MIT"
] | 3 | 2019-04-21T13:11:06.000Z | 2020-02-16T16:16:14.000Z | challenges/binarytree_test.py | Sukhrobjon/CS-1.3-Challenges | 53c906affef7bac91be95ffce9ff23cd1a6a505e | [
"MIT"
] | 1 | 2020-11-05T04:05:53.000Z | 2020-11-05T04:05:53.000Z | #!python
from binarytree import BinarySearchTree, BinaryTreeNode
import unittest
class BinaryTreeNodeTest(unittest.TestCase):
def test_init(self):
data = 123
node = BinaryTreeNode(data)
assert node.data is data
assert node.left is None
assert node.right is None
def t... | 36.483986 | 77 | 0.597835 |
959f88de24a529a6005e19e9f3a68842519cdb55 | 930 | py | Python | slackbot/admin.py | surface-security/django-slackbot | 8d22fb922cf5365284d7a4836bb095eeeb8c7e90 | [
"MIT"
] | 1 | 2022-01-24T10:29:09.000Z | 2022-01-24T10:29:09.000Z | slackbot/admin.py | surface-security/django-slack-processor | 8d22fb922cf5365284d7a4836bb095eeeb8c7e90 | [
"MIT"
] | 4 | 2022-02-21T15:59:08.000Z | 2022-03-26T00:33:13.000Z | slackbot/admin.py | surface-security/django-slack-processor | 8d22fb922cf5365284d7a4836bb095eeeb8c7e90 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.utils.html import format_html
from . import get_user_model
@admin.register(get_user_model())
class UserAdmin(admin.ModelAdmin):
list_display = ['ext_id', 'username', 'name', 'email', 'active', 'is_bot', 'is_admin', 'get_photo', 'last_seen']
list_filter = ('active'... | 34.444444 | 119 | 0.634409 |
620bae7c93a630e0c50c383efec03e2d42eb5892 | 1,855 | py | Python | var/spack/repos/builtin/packages/nasm/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/nasm/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | var/spack/repos/builtin/packages/nasm/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 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 import *
class Nasm(AutotoolsPackage):
"""NASM (Netwide Assembler) is an 80x86 assembler designed for
... | 50.135135 | 255 | 0.719137 |
f567714b1e703a1c6f73cc6f8a0c1b0b55b7fbfa | 460 | py | Python | Wavelet/HaarWaveletTransform.py | AndreyBuyanov/ImageProcessing.Lb3.Wavelet | 57cd4fdcb4ee3e66365eb8c7b5b2354198ad0f36 | [
"MIT"
] | null | null | null | Wavelet/HaarWaveletTransform.py | AndreyBuyanov/ImageProcessing.Lb3.Wavelet | 57cd4fdcb4ee3e66365eb8c7b5b2354198ad0f36 | [
"MIT"
] | null | null | null | Wavelet/HaarWaveletTransform.py | AndreyBuyanov/ImageProcessing.Lb3.Wavelet | 57cd4fdcb4ee3e66365eb8c7b5b2354198ad0f36 | [
"MIT"
] | null | null | null | import numpy as np
from .AbstractWaveletTransform import AbstractWaveletTransform
from .WaveletHelper import build_haar_matrix
class HaarWaveletTransform(AbstractWaveletTransform):
def __init__(self,
input_image: np.array):
super().__init__(
input_image=input_image)
def _... | 27.058824 | 62 | 0.669565 |
42f377a5f7f663434013975527b88a022800e805 | 654 | py | Python | microservices/tools/s3.py | clodonil/pipeline_aws_custom | 8ca517d0bad48fe528461260093f0035f606f9be | [
"Apache-2.0"
] | null | null | null | microservices/tools/s3.py | clodonil/pipeline_aws_custom | 8ca517d0bad48fe528461260093f0035f606f9be | [
"Apache-2.0"
] | null | null | null | microservices/tools/s3.py | clodonil/pipeline_aws_custom | 8ca517d0bad48fe528461260093f0035f606f9be | [
"Apache-2.0"
] | null | null | null | """
Tools para upload de arquivo no S3
"""
import boto3
import json
from botocore.exceptions import ClientError
def upload_file_s3(bucket, filename):
object_name = filename.split('/')[-1]
s3_client = boto3.client('s3')
try:
response = s3_client.upload_file(filename, bucket, object_name)
excep... | 27.25 | 83 | 0.717125 |
9ae60c3772ec6d80910ed48655be00403f5e5f4d | 1,806 | py | Python | var/spack/repos/builtin/packages/xfsdump/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/xfsdump/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/xfsdump/package.py | Kerilk/spack | e027942b55407a4a5fe323b93d8e57200c873a43 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-04-06T09:04:11.000Z | 2020-01-24T12:52:12.000Z | # Copyright 2013-2021 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 import *
class Xfsdump(MakefilePackage):
"""XFS Dump Tools."""
homepage = "http://oss.sgi.com/projec... | 39.26087 | 95 | 0.666667 |
e06178d99d069b15b4db4e9881c6fc3c1f332afa | 4,784 | py | Python | src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | null | null | null | src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/ssh/azext_ssh/vendored_sdks/hybridconnectivity/aio/operations/_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.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 ... | 45.132075 | 133 | 0.664507 |
33bd386214f9b9142d8bda8b3d5a6b84b9bd20ba | 8,033 | py | Python | mobilefacenet.py | delldu/MobileFaceNet | a10b30eb707de0875b732a7158c3635abc090549 | [
"Apache-2.0"
] | 1 | 2022-01-15T21:36:57.000Z | 2022-01-15T21:36:57.000Z | mobilefacenet.py | delldu/MobileFaceNet | a10b30eb707de0875b732a7158c3635abc090549 | [
"Apache-2.0"
] | null | null | null | mobilefacenet.py | delldu/MobileFaceNet | a10b30eb707de0875b732a7158c3635abc090549 | [
"Apache-2.0"
] | null | null | null | import math
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn import Parameter
from config import device, num_classes, emb_size
import pdb
def _make_divisible(v, divisor, min_value=None):
"""
This function is taken from the original tf repo.
It ensures that all layers have... | 34.926087 | 107 | 0.593303 |
2268b664d98f7955ab80821143b91c3dd7851a68 | 2,257 | py | Python | data/migrations/versions/be8d1c402ce0_add_teamsync_table.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | data/migrations/versions/be8d1c402ce0_add_teamsync_table.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | data/migrations/versions/be8d1c402ce0_add_teamsync_table.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | """Add TeamSync table
Revision ID: be8d1c402ce0
Revises: a6c463dfb9fe
Create Date: 2017-02-23 13:34:52.356812
"""
# revision identifiers, used by Alembic.
revision = "be8d1c402ce0"
down_revision = "a6c463dfb9fe"
from alembic import op as original_op
from data.migrations.progress import ProgressWrapper
import sqlalc... | 37.616667 | 97 | 0.6677 |
1fc8a3fd13ed43ab5f51789393ccb941076ee577 | 10,132 | py | Python | software/mesa/scons/llvm.py | dhanna11/OpenGPU | ab2f01253bba311e082dfae695b9e70138de75d4 | [
"Apache-2.0"
] | 7 | 2019-09-04T03:44:26.000Z | 2022-01-06T02:54:24.000Z | software/mesa/scons/llvm.py | dhanna11/OpenGPU | ab2f01253bba311e082dfae695b9e70138de75d4 | [
"Apache-2.0"
] | null | null | null | software/mesa/scons/llvm.py | dhanna11/OpenGPU | ab2f01253bba311e082dfae695b9e70138de75d4 | [
"Apache-2.0"
] | 3 | 2021-06-11T23:53:38.000Z | 2021-08-31T03:18:34.000Z | """llvm
Tool-specific initialization for LLVM
"""
#
# Copyright (c) 2009 VMware, Inc.
#
# 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 ... | 43.484979 | 128 | 0.61439 |
a86d6c104ab7430778f4210ac50638f388a1e080 | 7,408 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/statistics/view/layer23trafficflowdetectivefilter/statisticfilter/statisticfilter.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/statistics/view/layer23trafficflowdetectivefilter/statisticfilter/statisticfilter.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/statistics/view/layer23trafficflowdetectivefilter/statisticfilter/statisticfilter.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, ... | 45.170732 | 181 | 0.676566 |
258ef00e27ff710b82bc0b01a2185acee035c622 | 1,891 | py | Python | ProofOfConcepts/Vision/OpenMvMaskDefaults/pytorch_to_keras.py | WoodData/EndpointAI | 8e4d145ff45cf5559ab009eba4f423e944dc6975 | [
"Apache-2.0"
] | 190 | 2020-09-22T02:14:29.000Z | 2022-03-28T02:35:57.000Z | ProofOfConcepts/Vision/OpenMvMaskDefaults/pytorch_to_keras.py | chuancqc/EndpointAI | ab67cefeae3c06f1c93f66812bcf988c14e72ff1 | [
"Apache-2.0"
] | 2 | 2021-08-30T10:06:22.000Z | 2021-11-05T20:37:58.000Z | ProofOfConcepts/Vision/OpenMvMaskDefaults/pytorch_to_keras.py | chuancqc/EndpointAI | ab67cefeae3c06f1c93f66812bcf988c14e72ff1 | [
"Apache-2.0"
] | 80 | 2020-09-13T17:48:56.000Z | 2022-03-19T10:45:05.000Z | import argparse
import lightly.models as models
import torch
import torch.nn as nn
from classifier import Classifier
from pytorch2keras import pytorch_to_keras
parser = argparse.ArgumentParser()
parser.add_argument('--finetuned', type=str, default='checkpoints/finetuned.pt',
help='Path to the fin... | 32.050847 | 84 | 0.711793 |
27b51b953055ea40a5da7013161381fe829c9284 | 1,130 | py | Python | config/factories.py | craigderington/serviceauto | 28958e3cb82431151c02c4bd600cf887c54d2866 | [
"MIT"
] | null | null | null | config/factories.py | craigderington/serviceauto | 28958e3cb82431151c02c4bd600cf887c54d2866 | [
"MIT"
] | null | null | null | config/factories.py | craigderington/serviceauto | 28958e3cb82431151c02c4bd600cf887c54d2866 | [
"MIT"
] | null | null | null | from orator.orm import Factory
from app.User import User
from app.Car import Car
from app.Customer import Customer
from app.Engine import Engine
from app.ServiceHistory import ServiceHistory
factory = Factory()
def users_factory(faker):
return {
"name": faker.name(),
"email": faker.email(),
... | 23.061224 | 98 | 0.682301 |
0e86468a835302905bc06a166127f21a489fe3e0 | 13,824 | py | Python | falkon/hopt/benchmarking/benchmark_cli.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | 130 | 2020-06-18T08:30:30.000Z | 2022-03-21T15:43:17.000Z | falkon/hopt/benchmarking/benchmark_cli.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | 32 | 2020-06-26T09:24:45.000Z | 2022-03-20T10:37:36.000Z | falkon/hopt/benchmarking/benchmark_cli.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | 17 | 2020-07-13T17:28:02.000Z | 2022-02-15T19:55:40.000Z | import argparse
import datetime
import math
import os
import pickle
import warnings
from functools import partial
from typing import Any, List, Optional, Union, Tuple
import numpy as np
import pandas as pd
import torch
from falkon.center_selection import UniformSelector
from falkon.benchmarks.common.benchmark_utils i... | 44.883117 | 105 | 0.59932 |
c1c16ccd73093b46d126b2176b6286c76261c84a | 1,773 | py | Python | system_tests/system_tests_async/test_service_account.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 348 | 2018-10-14T17:48:33.000Z | 2022-03-22T06:53:03.000Z | system_tests/system_tests_async/test_service_account.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 485 | 2018-10-23T19:07:47.000Z | 2022-03-31T13:59:03.000Z | system_tests/system_tests_async/test_service_account.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 229 | 2018-10-17T20:10:03.000Z | 2022-02-25T22:47:49.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.833333 | 92 | 0.751269 |
a2f5beec2ec0fcd82d03ad4ac1ff86f2621ae9b5 | 1,028 | py | Python | app.py | Danboruya/electron-python-desktop-app-practice | f4384fd711d3ff2fca2fdae023c5c6eb2f985c7f | [
"Apache-2.0"
] | null | null | null | app.py | Danboruya/electron-python-desktop-app-practice | f4384fd711d3ff2fca2fdae023c5c6eb2f985c7f | [
"Apache-2.0"
] | null | null | null | app.py | Danboruya/electron-python-desktop-app-practice | f4384fd711d3ff2fca2fdae023c5c6eb2f985c7f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2018 Mitsuhiro Komuro
#
# 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
#
# Unle... | 25.7 | 74 | 0.719844 |
2181e9da3919c03cb327a0b80a0eb8194f16a3a9 | 6,938 | py | Python | wagtail-repository/wagtail/users/views/users.py | TobiasSkovgaardJepsen/wagtail-on-heroku | 17e4720f86023225e0704890688998a80bb87a17 | [
"BSD-3-Clause"
] | null | null | null | wagtail-repository/wagtail/users/views/users.py | TobiasSkovgaardJepsen/wagtail-on-heroku | 17e4720f86023225e0704890688998a80bb87a17 | [
"BSD-3-Clause"
] | 4 | 2020-06-05T17:00:01.000Z | 2021-06-17T20:15:01.000Z | wagtail-repository/wagtail/users/views/users.py | TobiasSkovgaardJepsen/wagtail-on-heroku | 17e4720f86023225e0704890688998a80bb87a17 | [
"BSD-3-Clause"
] | 1 | 2019-04-16T14:14:55.000Z | 2019-04-16T14:14:55.000Z | from django.conf import settings
from django.contrib.auth import get_user_model
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
fro... | 35.397959 | 106 | 0.648025 |
d7376fee9ee3d90ff57bf4b5d86101e011a99092 | 2,524 | py | Python | utils/data_utils.py | sg130/hindi-htr | ca3258f4dcf14dd1670fa32d40d1d0567a622cbf | [
"MIT"
] | null | null | null | utils/data_utils.py | sg130/hindi-htr | ca3258f4dcf14dd1670fa32d40d1d0567a622cbf | [
"MIT"
] | null | null | null | utils/data_utils.py | sg130/hindi-htr | ca3258f4dcf14dd1670fa32d40d1d0567a622cbf | [
"MIT"
] | null | null | null | import random, cv2
import numpy as np
seed = 13
random.seed(seed)
np.random.seed(seed)
def truncateLabel(text, maxStringLen = 32):
cost = 0
for i in range(len(text)):
if i!=0 and text[i] == text[i-1]:
cost+=2
else:
cost+=1
if cost > maxStringLen:
return text[:i]
return text
def textToLabels(text, u... | 29.011494 | 136 | 0.554279 |
29dba9562ecebde47a4e833e91145be38b5b4754 | 1,818 | py | Python | snmp/setup.py | glasser/integrations-core | 1dd515d49b1690a1369ee5195713605b1b072b1f | [
"BSD-3-Clause"
] | 2 | 2019-05-28T03:48:29.000Z | 2019-07-05T07:05:58.000Z | snmp/setup.py | glasser/integrations-core | 1dd515d49b1690a1369ee5195713605b1b072b1f | [
"BSD-3-Clause"
] | 4 | 2019-07-03T02:53:19.000Z | 2019-07-10T14:52:14.000Z | snmp/setup.py | glasser/integrations-core | 1dd515d49b1690a1369ee5195713605b1b072b1f | [
"BSD-3-Clause"
] | 1 | 2019-12-23T13:35:17.000Z | 2019-12-23T13:35:17.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HERE, 'data... | 30.3 | 74 | 0.681518 |
e8b4b9961e5203c28440766b1550231cdf47f156 | 5,070 | py | Python | userbot/modules/torrentsearch.py | kikoyaja69/PocongUserbot | 21fbd648349dd5cf4e2adabedb384a0c77226671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2021-12-25T06:23:41.000Z | 2022-03-25T23:12:37.000Z | userbot/modules/torrentsearch.py | kikoyaja69/PocongUserbot | 21fbd648349dd5cf4e2adabedb384a0c77226671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/torrentsearch.py | kikoyaja69/PocongUserbot | 21fbd648349dd5cf4e2adabedb384a0c77226671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 51 | 2022-01-09T11:19:37.000Z | 2022-03-30T17:15:02.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for filter commands """
import codecs
import json
import os
import requests
from bs4 import Beaut... | 30.359281 | 129 | 0.558383 |
c6b93049ddbae563027e2baa9f8d868d85360d5c | 2,914 | py | Python | tests/test_jobaction.py | hadren/mrq | 9851294b04ddb5071e9e366bc6b71b3e1d4a98e8 | [
"MIT"
] | null | null | null | tests/test_jobaction.py | hadren/mrq | 9851294b04ddb5071e9e366bc6b71b3e1d4a98e8 | [
"MIT"
] | null | null | null | tests/test_jobaction.py | hadren/mrq | 9851294b04ddb5071e9e366bc6b71b3e1d4a98e8 | [
"MIT"
] | null | null | null | from mrq.job import Job
from mrq.queue import Queue
import time
import pytest
OPTS = []
for p_query in [
# Query, number_matching
({"path": "tests.tasks.general.MongoInsert"}, 3),
({"queue": "q1"}, 2),
({"params": "{\"a\": 44}"}, 1)
]:
OPTS.append([p_query])
@pytest.mark.parametrize(["p_query"],... | 30.041237 | 85 | 0.638984 |
edf84736f522795faa0b8a9a74e18c092d583cc6 | 5,084 | py | Python | tests/unit/test_api.py | nforro/packit | 1c48e21a53117811a2ebedbe80e4b17be852a6e2 | [
"MIT"
] | null | null | null | tests/unit/test_api.py | nforro/packit | 1c48e21a53117811a2ebedbe80e4b17be852a6e2 | [
"MIT"
] | 1 | 2020-07-10T10:13:44.000Z | 2020-07-10T10:16:41.000Z | tests/unit/test_api.py | nforro/packit | 1c48e21a53117811a2ebedbe80e4b17be852a6e2 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | 35.552448 | 82 | 0.65952 |
8b07897e1e263a747b22685cd2a26798cde19383 | 1,340 | py | Python | tests/test_contains.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | tests/test_contains.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | tests/test_contains.py | sweersr/visions | 1af04235cb77bec52e4923627dfbf968ed1a584d | [
"BSD-4-Clause"
] | null | null | null | import pytest
from tests.series import get_series, get_contains_map
def all_series_included(series_list, series_map):
"""Check that all names are indeed used"""
used_names = set([name for names in series_map.values() for name in names])
names = set([series.name for series in series_list])
if not name... | 31.904762 | 80 | 0.620149 |
c39e0dd2a7869e856c11cb7df10cebe054c530cb | 633 | py | Python | static/brythonlib/cs1graphics/fillable_shape.py | pythonpad/vue-pythonpad-runner | 52decba9607b3b7b050ee0bf6dd4ef07ae644587 | [
"MIT"
] | 3 | 2021-01-26T16:18:45.000Z | 2021-09-15T00:57:12.000Z | static/brythonlib/cs1graphics/fillable_shape.py | pythonpad/vue-pythonpad-runner | 52decba9607b3b7b050ee0bf6dd4ef07ae644587 | [
"MIT"
] | null | null | null | static/brythonlib/cs1graphics/fillable_shape.py | pythonpad/vue-pythonpad-runner | 52decba9607b3b7b050ee0bf6dd4ef07ae644587 | [
"MIT"
] | 2 | 2021-01-26T16:18:47.000Z | 2021-10-21T20:45:20.000Z | from .shape import Shape
class FillableShape(Shape):
def __init__(self, reference=None):
Shape.__init__(self, reference)
self.fillColor = 'transparent'
def __deepcopy__(self, memo={}):
drawable = super().__deepcopy__()
drawable.fillColor = self.fillColor
return drawable... | 23.444444 | 43 | 0.619273 |
71b68eaa07b42e3558739052e8578b497b237d67 | 15,916 | py | Python | stargazer/simulator/views.py | martynvdijke/Stargazer | de53813bbc75e4cd1273738a9490598e13609825 | [
"MIT"
] | 11 | 2017-07-12T03:02:08.000Z | 2022-03-27T09:44:38.000Z | stargazer/simulator/views.py | martynvdijke/Stargazer | de53813bbc75e4cd1273738a9490598e13609825 | [
"MIT"
] | 1 | 2019-06-22T19:00:45.000Z | 2019-06-22T19:00:45.000Z | stargazer/simulator/views.py | martynvdijke/Stargazer | de53813bbc75e4cd1273738a9490598e13609825 | [
"MIT"
] | null | null | null | from django.shortcuts import render, render_to_response
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from . import EconomicDispatcher
import json
from django.utils.safestring import SafeString
import pandas as pd
from io import StringIO
import io
from pandas.io... | 33.158333 | 214 | 0.624906 |
626e1306d367b3a7f65ebb6d4e3585f447f495b9 | 237 | py | Python | lambdata_soycode/__init__.py | Higgins2718/lambdata | a4c3d97eaa865dcfc9ad7f7e5f6232e5acaf9935 | [
"MIT"
] | null | null | null | lambdata_soycode/__init__.py | Higgins2718/lambdata | a4c3d97eaa865dcfc9ad7f7e5f6232e5acaf9935 | [
"MIT"
] | 4 | 2020-03-24T17:10:38.000Z | 2021-06-02T00:11:23.000Z | lambdata_soycode/__init__.py | Higgins2718/lambdata | a4c3d97eaa865dcfc9ad7f7e5f6232e5acaf9935 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
lambdata - a collection of Data Science helper functions
"""
import pandas as pd
import numpy as np
from . import example_module
Y = example_module.increment(example_module.x)
TEST = pd.DataFrame(np.ones(10))
| 19.75 | 56 | 0.755274 |
7411b5a526c160f7ac4d48ed5bc2da6f8cbae417 | 1,693 | py | Python | task_manage_zfb/tests/test_main.py | pirtim/zfb-task-manage | df54f38e14bbee9213bad76fd8f56faf1618447e | [
"MIT"
] | null | null | null | task_manage_zfb/tests/test_main.py | pirtim/zfb-task-manage | df54f38e14bbee9213bad76fd8f56faf1618447e | [
"MIT"
] | null | null | null | task_manage_zfb/tests/test_main.py | pirtim/zfb-task-manage | df54f38e14bbee9213bad76fd8f56faf1618447e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import os
import logging
from task_manage_zfb.tests.helper_test import *
from task_manage_zfb.config import Config, MasterConfig, WorkerConfig, ConfigParserWithComments
from task_manage_zfb.errors import ConfigParserLackOfStartCommentError, ConfigParserBadCommentError, ConfigNo... | 35.270833 | 125 | 0.757236 |
3320b240e56155f8bfc2f6d8e43306f36e651869 | 3,095 | py | Python | python/paddle/fluid/tests/unittests/test_trace_op.py | ZibinGuo/Paddle | 6e0892312de5e4ba76d980ff0e4322ac55ca0d07 | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/test_trace_op.py | ZibinGuo/Paddle | 6e0892312de5e4ba76d980ff0e4322ac55ca0d07 | [
"Apache-2.0"
] | 1 | 2022-01-28T07:23:22.000Z | 2022-01-28T07:23:22.000Z | python/paddle/fluid/tests/unittests/test_trace_op.py | ZibinGuo/Paddle | 6e0892312de5e4ba76d980ff0e4322ac55ca0d07 | [
"Apache-2.0"
] | 1 | 2022-03-02T11:36:03.000Z | 2022-03-02T11:36:03.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.641304 | 78 | 0.626494 |
5225a00be87b3057ff040ff41f0120eb33f77c74 | 9,112 | py | Python | tests/hazmat/primitives/test_hash_vectors.py | khadas/android_external_python_cryptography | 5039a1c7df356db2877ae4ecc44a28d32a9466a7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/primitives/test_hash_vectors.py | khadas/android_external_python_cryptography | 5039a1c7df356db2877ae4ecc44a28d32a9466a7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/primitives/test_hash_vectors.py | khadas/android_external_python_cryptography | 5039a1c7df356db2877ae4ecc44a28d32a9466a7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-09-09T09:30:34.000Z | 2021-09-12T15:58:33.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import binascii
import os
import pytest
from cryptography.hazmat.backen... | 27.95092 | 79 | 0.649034 |
787a3f5656f5c111b7ac1a318e472e8a0c99b6f3 | 3,559 | py | Python | oidc_provider/tests/cases/test_utils.py | jbking/django-oidc-provider | f0daed07b2ac7608565b80d4c80ccf04d8c416a8 | [
"MIT"
] | 370 | 2015-03-10T03:12:53.000Z | 2022-03-13T05:49:40.000Z | oidc_provider/tests/cases/test_utils.py | jbking/django-oidc-provider | f0daed07b2ac7608565b80d4c80ccf04d8c416a8 | [
"MIT"
] | 305 | 2015-02-12T17:58:26.000Z | 2022-02-25T19:48:41.000Z | oidc_provider/tests/cases/test_utils.py | jbking/django-oidc-provider | f0daed07b2ac7608565b80d4c80ccf04d8c416a8 | [
"MIT"
] | 271 | 2015-03-17T00:57:22.000Z | 2022-02-17T11:21:22.000Z | import time
from datetime import datetime
from hashlib import sha224
from django.http import HttpRequest
from django.test import TestCase, override_settings
from django.utils import timezone
from mock import mock
from oidc_provider.lib.utils.common import get_issuer, get_browser_state_or_default
from oidc_provider.li... | 35.237624 | 94 | 0.658612 |
e302c58c22a3f41ad2882dbbd4a84f5d7ff0dd37 | 2,636 | py | Python | examples/shouldi/shouldi/rust/cargo_audit.py | SGeetansh/dffml | 04647bdcadef2f7e7b59cdd8ac1e89f17ef1095b | [
"MIT"
] | 3 | 2021-03-08T18:41:21.000Z | 2021-06-05T20:15:14.000Z | examples/shouldi/shouldi/rust/cargo_audit.py | yashlamba/dffml | d309db8503ab3c29fcd99b96479c24b2fdd4d200 | [
"MIT"
] | 24 | 2020-05-20T23:29:57.000Z | 2021-04-14T04:18:21.000Z | examples/shouldi/shouldi/rust/cargo_audit.py | yashlamba/dffml | d309db8503ab3c29fcd99b96479c24b2fdd4d200 | [
"MIT"
] | 1 | 2021-04-19T23:58:26.000Z | 2021-04-19T23:58:26.000Z | import os
import json
import asyncio
import itertools
import contextlib
from typing import Dict, Any
from dffml import op, Definition, traverse_get
package_src_dir = Definition(name="package_src_dir", primitive="str")
cargo_audit_output = Definition(
name="cargo_audit_output", primitive="Dict[str, Any]"
)
class... | 26.36 | 90 | 0.556146 |
d1366003e9a7f066341cb13ef1686833a0481c25 | 1,141 | py | Python | src/por/sphinx_extensions/__init__.py | the-scouts/por | 3bd67f0739664b7e2629aa45fdbde0cd1508b630 | [
"MIT"
] | null | null | null | src/por/sphinx_extensions/__init__.py | the-scouts/por | 3bd67f0739664b7e2629aa45fdbde0cd1508b630 | [
"MIT"
] | null | null | null | src/por/sphinx_extensions/__init__.py | the-scouts/por | 3bd67f0739664b7e2629aa45fdbde0cd1508b630 | [
"MIT"
] | null | null | null | """Sphinx extensions for performant POR processing"""
from __future__ import annotations
from typing import TYPE_CHECKING
from sphinx.environment import BuildEnvironment
from por.sphinx_extensions.processor import html_translator
from por.sphinx_extensions.processor import parser
from por.sphinx_extensions.processo... | 36.806452 | 111 | 0.787905 |
1d6ddda153acb12d78ce7c528a89b5e873fcff4a | 1,004 | py | Python | tests/functional/test_delete_service.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | tests/functional/test_delete_service.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | tests/functional/test_delete_service.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 38.615385 | 75 | 0.758964 |
7814fa5aefe8715cfe4b3f07375785707e6dcb55 | 331 | py | Python | tests/urls.py | softformance/django-twitter-photo-api | 0475d6a061e10643c90959253e557f0016ae9ade | [
"MIT"
] | null | null | null | tests/urls.py | softformance/django-twitter-photo-api | 0475d6a061e10643c90959253e557f0016ae9ade | [
"MIT"
] | null | null | null | tests/urls.py | softformance/django-twitter-photo-api | 0475d6a061e10643c90959253e557f0016ae9ade | [
"MIT"
] | null | null | null | # -*- coding: utf-8
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django_twitter_photo_api.urls import urlpatterns as django_twitter_photo_api_urls
urlpatterns = [
url(r'^twitter_app', include(django_twitter_photo_api_urls, namespace='django_twitter_photo... | 30.090909 | 103 | 0.81571 |
cab375e067758dd0d0938e807d89e819edebe93c | 2,532 | py | Python | 3-semester/programming/indepworkinvar2.py | Rakleed/rgpu | 47ab2a05a8398c15be7e41e9e98fafe5c2a36627 | [
"MIT"
] | null | null | null | 3-semester/programming/indepworkinvar2.py | Rakleed/rgpu | 47ab2a05a8398c15be7e41e9e98fafe5c2a36627 | [
"MIT"
] | null | null | null | 3-semester/programming/indepworkinvar2.py | Rakleed/rgpu | 47ab2a05a8398c15be7e41e9e98fafe5c2a36627 | [
"MIT"
] | null | null | null | """
Автор: Моисеенко Павел, группа № 1, подгруппа № 2.
Задание 1: напишите код на языке Python, позволяющий вычислить
логические операции, с помощью конкатенации строк, умножения строки
на число или как-то иначе создайте таблицу и выведите её.
Задание 2: для данного списка, используя слайсы, обра... | 27.521739 | 77 | 0.520142 |
ff239e578ff4bc2bf5a318e241cb8cb817d65f39 | 1,306 | py | Python | src/cambiopy/vcfio.py | CNuge/CamBioPy | 3a9081f7884734ec15e352376779383bc23bcbd9 | [
"MIT"
] | null | null | null | src/cambiopy/vcfio.py | CNuge/CamBioPy | 3a9081f7884734ec15e352376779383bc23bcbd9 | [
"MIT"
] | null | null | null | src/cambiopy/vcfio.py | CNuge/CamBioPy | 3a9081f7884734ec15e352376779383bc23bcbd9 | [
"MIT"
] | null | null | null | from ast import Raise
from allel import read_vcf
""" This is a wrapper for using some of the functions in the scikit-allel api
Ways to grab key things out of a vcf, or hopefully write them in.
Currently a work in process
code source: https://scikit-allel.readthedocs.io/en/stable/
"""
def ch... | 23.321429 | 117 | 0.655436 |
04cc994180b6f63765367fd8295c50489bef07f5 | 494 | py | Python | Data Analytics/Naive Bayes/GNB.py | Harjiwan/Python | 5f8e0b7f4f2323c64161541075636eefc41043b9 | [
"MIT"
] | 17 | 2019-03-23T03:14:10.000Z | 2021-12-08T12:58:40.000Z | Data Analytics/Naive Bayes/GNB.py | Harjiwan/Python | 5f8e0b7f4f2323c64161541075636eefc41043b9 | [
"MIT"
] | 1 | 2021-01-20T02:53:33.000Z | 2021-01-20T02:53:33.000Z | Data Analytics/Naive Bayes/GNB.py | Harjiwan/Python | 5f8e0b7f4f2323c64161541075636eefc41043b9 | [
"MIT"
] | 41 | 2019-02-07T19:22:04.000Z | 2022-03-18T22:17:19.000Z | from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.metrics import confusion_matrix
data = pd.read_csv('diabetes.csv')
X = data.iloc[:,:-1]
y = data.iloc[:,-1]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_st... | 27.444444 | 89 | 0.757085 |
72a3a55f15e61ba965841f35cf02dd0835006943 | 19,268 | py | Python | script.py | HouTiger/informarket | 26825f6a8cabca347c4b1c54924a73eec9527784 | [
"MIT"
] | 2 | 2019-11-04T12:17:41.000Z | 2019-11-04T14:38:22.000Z | script.py | HouTiger/informarket | 26825f6a8cabca347c4b1c54924a73eec9527784 | [
"MIT"
] | null | null | null | script.py | HouTiger/informarket | 26825f6a8cabca347c4b1c54924a73eec9527784 | [
"MIT"
] | null | null | null | from flask import Flask, request, render_template
import time
myWeb = Flask(__name__)
user_pwd = {} # user-password dictionary
readin = open('user_pwd.txt', "r", encoding="UTF-8")
s = readin.read()
readin.close()
s = s.split('\n')
del s[-1]
for line in s:
l = line.split()
user_pwd[l[0]] = l[1]
... | 29.826625 | 163 | 0.493824 |
8dccc764133d70c2bfb5065dfe37aa64028c9d0d | 1,458 | py | Python | tests/validation_policy_test.py | wvengen/scylla | 8e86597a32d9be2216221cd6f18fd3dcf1d23432 | [
"Apache-2.0"
] | null | null | null | tests/validation_policy_test.py | wvengen/scylla | 8e86597a32d9be2216221cd6f18fd3dcf1d23432 | [
"Apache-2.0"
] | null | null | null | tests/validation_policy_test.py | wvengen/scylla | 8e86597a32d9be2216221cd6f18fd3dcf1d23432 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
import pytest
from scylla.database import ProxyIP
from scylla.validation_policy import ValidationPolicy
@pytest.fixture
def p():
return ProxyIP(ip='127.0.0.1', port=3306, provider='Foo', is_valid=False)
@pytest.fixture
def valid_http_proxy():
return ProxyIP(ip='127... | 26.509091 | 77 | 0.769547 |
6702f7b2bb3a40efd9d216c5e25f3694c8de28b0 | 862 | py | Python | cyclegan2/model/model_utils.py | NNDEV1/CycleGANs | 73025f05f037f4b9e28d2c1c3d74444dd6b95801 | [
"MIT"
] | 3 | 2021-08-07T15:36:13.000Z | 2021-08-15T22:04:12.000Z | cyclegan2/model/model_utils.py | NNDEV1/CycleGANs | 73025f05f037f4b9e28d2c1c3d74444dd6b95801 | [
"MIT"
] | null | null | null | cyclegan2/model/model_utils.py | NNDEV1/CycleGANs | 73025f05f037f4b9e28d2c1c3d74444dd6b95801 | [
"MIT"
] | 1 | 2021-10-05T10:59:09.000Z | 2021-10-05T10:59:09.000Z | import tensorflow as tf
import numpy as np
import os
import sys
import numpy as np
from PIL import Image, ImageOps
import sys
import matplotlib.pyplot as plt
#Utilities
def get_shape(tensor):
return tensor.get_shape().as_list()
def inst_norm(tensor): # Instance Normalization custom layer
epsilon = 1e-5
w... | 33.153846 | 139 | 0.719258 |
3ed41c31cd65d5bf85192c3842cfbfc2cdd46aa3 | 571 | py | Python | WaterWatch/waterwatchapp/migrations/0006_auto_20180729_0646.py | ksopan/Water_Consumption_dashboard | c72805e4c9ae5448d0ffabfa9eafd244563e2bf5 | [
"MIT"
] | null | null | null | WaterWatch/waterwatchapp/migrations/0006_auto_20180729_0646.py | ksopan/Water_Consumption_dashboard | c72805e4c9ae5448d0ffabfa9eafd244563e2bf5 | [
"MIT"
] | null | null | null | WaterWatch/waterwatchapp/migrations/0006_auto_20180729_0646.py | ksopan/Water_Consumption_dashboard | c72805e4c9ae5448d0ffabfa9eafd244563e2bf5 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.5 on 2018-07-29 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waterwatchapp', '0005_waterconsumption'),
]
operations = [
migrations.RemoveField(
model_name='waterconsumption',
na... | 23.791667 | 51 | 0.604203 |
9f1688359883c41fc57ea26179c8302368c00e66 | 5,613 | py | Python | tests/acceptance/test_inventory.py | clementperon/meta-mender | cd74c50e1cc1485b10c94f5f10a9dc238029db51 | [
"Apache-2.0"
] | null | null | null | tests/acceptance/test_inventory.py | clementperon/meta-mender | cd74c50e1cc1485b10c94f5f10a9dc238029db51 | [
"Apache-2.0"
] | 74 | 2018-01-02T19:55:07.000Z | 2022-03-28T07:03:13.000Z | tests/acceptance/test_inventory.py | clementperon/meta-mender | cd74c50e1cc1485b10c94f5f10a9dc238029db51 | [
"Apache-2.0"
] | 1 | 2022-03-26T00:10:53.000Z | 2022-03-26T00:10:53.000Z | #!/usr/bin/python
# Copyright 2020 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 37.172185 | 102 | 0.540887 |
024bbaaafe004a891ac46f36c6ccd7d6e84d9deb | 3,915 | py | Python | openGaussBase/testcase/GUC/LOAD_MANAGEMENT/Opengauss_Function_Guc_Load_Management_Case0005.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/LOAD_MANAGEMENT/Opengauss_Function_Guc_Load_Management_Case0005.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/LOAD_MANAGEMENT/Opengauss_Function_Guc_Load_Management_Case0005.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 36.588785 | 84 | 0.634227 |
f29061bd5f8928f19e6a3536ab1f98e8a8caffe6 | 1,226 | py | Python | blog/models.py | kevgathuku/kevgathuku | 3b0bd1ebea010d178b86355efffb055658f8f5da | [
"MIT"
] | null | null | null | blog/models.py | kevgathuku/kevgathuku | 3b0bd1ebea010d178b86355efffb055658f8f5da | [
"MIT"
] | 1 | 2016-11-02T07:32:23.000Z | 2016-11-02T07:32:23.000Z | blog/models.py | kevgathuku/kevgathuku | 3b0bd1ebea010d178b86355efffb055658f8f5da | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from taggit.managers import TaggableManager
class Post(models.Model):
title = models.CharField(max_length=200, unique=True)
slug = models.SlugField(max_length=100, unique=True)
subtitle =... | 30.65 | 68 | 0.714519 |
673d333deabdce70f26ae7ee1a09e7d97b8d6a2e | 7,043 | py | Python | python/GafferSceneTest/AttributeVisualiserTest.py | ivanimanishi/gaffer | 7cfd79d2f20c25ed1d680730de9d6a2ee356dd4c | [
"BSD-3-Clause"
] | 1 | 2019-08-02T16:49:59.000Z | 2019-08-02T16:49:59.000Z | python/GafferSceneTest/AttributeVisualiserTest.py | rkoschmitzky/gaffer | ec6262ae1292767bdeb9520d1447d65a4a511884 | [
"BSD-3-Clause"
] | 2 | 2017-08-23T21:35:45.000Z | 2018-01-29T08:59:33.000Z | python/GafferSceneTest/AttributeVisualiserTest.py | rkoschmitzky/gaffer | ec6262ae1292767bdeb9520d1447d65a4a511884 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | 42.945122 | 90 | 0.6953 |
2b5e60980e2b435fbe190cf7ce982db23c5be172 | 11,987 | py | Python | bokeh/core/property/container.py | kinghows/bokeh | aeb7abc1dbe2b67ce0f4422838a96fb8362c52c7 | [
"BSD-3-Clause"
] | 1 | 2018-11-14T19:08:18.000Z | 2018-11-14T19:08:18.000Z | bokeh/core/property/container.py | kinghows/bokeh | aeb7abc1dbe2b67ce0f4422838a96fb8362c52c7 | [
"BSD-3-Clause"
] | 1 | 2021-05-09T02:45:17.000Z | 2021-05-09T02:45:17.000Z | bokeh/core/property/container.py | kinghows/bokeh | aeb7abc1dbe2b67ce0f4422838a96fb8362c52c7 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 35.78209 | 137 | 0.556853 |
5e6aa0ef7b0bc1668833c72fe8fc9a120b182c04 | 13,956 | py | Python | cookietemple/bump_version/bump_version.py | e2jk/cookietemple | 86af5622cdabe9ae446048536571898716939f29 | [
"Apache-2.0"
] | 117 | 2020-11-23T02:07:23.000Z | 2022-03-21T16:14:53.000Z | cookietemple/bump_version/bump_version.py | e2jk/cookietemple | 86af5622cdabe9ae446048536571898716939f29 | [
"Apache-2.0"
] | 226 | 2020-10-19T19:58:13.000Z | 2022-03-27T18:54:30.000Z | cookietemple/bump_version/bump_version.py | e2jk/cookietemple | 86af5622cdabe9ae446048536571898716939f29 | [
"Apache-2.0"
] | 9 | 2020-11-24T12:45:10.000Z | 2022-03-13T15:58:23.000Z | import logging
import os
import re
import sys
from configparser import ConfigParser, NoSectionError
from os import fdopen, remove
from pathlib import Path
from shutil import copymode, move
from tempfile import mkstemp
from typing import Tuple
from git import Repo # type: ignore
from packaging import version
from rich... | 49.314488 | 159 | 0.617369 |
66d38cd72da4411b6137063f30f1756f555d1c04 | 27,440 | py | Python | tests/test_iam.py | rentacenter/cloud-custodian | 8d581193f851be3e9d988f2ace2cb4061a13417a | [
"Apache-2.0"
] | null | null | null | tests/test_iam.py | rentacenter/cloud-custodian | 8d581193f851be3e9d988f2ace2cb4061a13417a | [
"Apache-2.0"
] | null | null | null | tests/test_iam.py | rentacenter/cloud-custodian | 8d581193f851be3e9d988f2ace2cb4061a13417a | [
"Apache-2.0"
] | 1 | 2021-02-16T21:24:09.000Z | 2021-02-16T21:24:09.000Z | # Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 36.733601 | 84 | 0.582362 |
004ccb38383fee099506dac60188da28180f8ad9 | 897 | py | Python | CreateEffekseerFiles_v4.py | chao19973/EffekseerForCocos2d-x | f9eff96ec8220e2cfe862e088634d4059f2b781c | [
"MIT"
] | null | null | null | CreateEffekseerFiles_v4.py | chao19973/EffekseerForCocos2d-x | f9eff96ec8220e2cfe862e088634d4059f2b781c | [
"MIT"
] | null | null | null | CreateEffekseerFiles_v4.py | chao19973/EffekseerForCocos2d-x | f9eff96ec8220e2cfe862e088634d4059f2b781c | [
"MIT"
] | null | null | null | import shutil
import os
from distutils.dir_util import copy_tree
copy_tree("../Effekseer/Dev/Cpp/Effekseer", "./Players/Cocos2d-x_v4/Effekseer")
copy_tree("../Effekseer/Dev/Cpp/EffekseerMaterialCompiler", "./Players/Cocos2d-x_v4/EffekseerMaterialCompiler")
copy_tree("../Effekseer/Dev/Cpp/EffekseerRendererCommon", "./P... | 56.0625 | 111 | 0.789298 |
e5dc0fc7edc33b229c6c2b440ab57880907879b5 | 2,794 | py | Python | data/bot.py | d4rkm0nkey/TrainingChatbotGui | 9e972ff3b8529b80a3a8c85c0e43acd77735c394 | [
"MIT"
] | 1 | 2021-02-28T22:46:29.000Z | 2021-02-28T22:46:29.000Z | data/bot.py | d4rkm0nkey/TrainingChatbotGui | 9e972ff3b8529b80a3a8c85c0e43acd77735c394 | [
"MIT"
] | null | null | null | data/bot.py | d4rkm0nkey/TrainingChatbotGui | 9e972ff3b8529b80a3a8c85c0e43acd77735c394 | [
"MIT"
] | null | null | null | from data import Database
class Bot():
def __init__(self, name=""):
self.name = name
def setName(self, name):
self.name = name
def load(self, doc):
self._id = doc["_id"]
def save(self):
if(self.name is not None):
if hasattr(self, "_id"):
Da... | 24.508772 | 83 | 0.559771 |
fe757e9e185d4ab745a9e701e17069d9e97be304 | 182 | py | Python | BDJ/views.py | kmkolasinski/BDJ | b531be5f9bdef66f5a8fa3a27aaa06c1ac75b7c0 | [
"MIT"
] | null | null | null | BDJ/views.py | kmkolasinski/BDJ | b531be5f9bdef66f5a8fa3a27aaa06c1ac75b7c0 | [
"MIT"
] | null | null | null | BDJ/views.py | kmkolasinski/BDJ | b531be5f9bdef66f5a8fa3a27aaa06c1ac75b7c0 | [
"MIT"
] | null | null | null | import requests
from django.http import HttpResponse
def index(request):
r = requests.get('http://httpbin.org/status/418')
return HttpResponse('<pre>' + r.text + '</pre>')
| 22.75 | 53 | 0.686813 |
4386eeee5e595999f74da0bb44a2cdd9acb8cebb | 20,072 | py | Python | alpha_pipe/scripts/dump_bin.py | gayhub-wpp/alpha_pipe_oldversion | 877047442ae939df3f15611d48ea2df1476a940c | [
"MIT"
] | 1 | 2022-02-24T09:39:07.000Z | 2022-02-24T09:39:07.000Z | alpha_pipe/scripts/dump_bin.py | gayhub-wpp/alpha_pipe_oldversion | 877047442ae939df3f15611d48ea2df1476a940c | [
"MIT"
] | null | null | null | alpha_pipe/scripts/dump_bin.py | gayhub-wpp/alpha_pipe_oldversion | 877047442ae939df3f15611d48ea2df1476a940c | [
"MIT"
] | 1 | 2021-11-10T22:28:20.000Z | 2021-11-10T22:28:20.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import abc
import shutil
import traceback
from pathlib import Path
from typing import Iterable, List, Union
from functools import partial
from concurrent.futures import ThreadPoolExecutor, as_completed, ProcessPoolExecutor
import fire
import num... | 40.631579 | 116 | 0.622459 |
1c8923cf936f4010abc4a03ad373c53118e1068f | 6,239 | py | Python | sopel/cli/config.py | eliocamp/sopel | 6c142b13723289680b332f4f316fff63bfacf915 | [
"EFL-2.0"
] | null | null | null | sopel/cli/config.py | eliocamp/sopel | 6c142b13723289680b332f4f316fff63bfacf915 | [
"EFL-2.0"
] | 1 | 2018-05-04T03:11:23.000Z | 2018-05-04T07:24:58.000Z | sopel/cli/config.py | dgw/sopel | 16f26e6e5047bbdad44c45670611a06d3f93c698 | [
"EFL-2.0"
] | null | null | null | # coding=utf-8
"""Sopel Config Command Line Interface (CLI): ``sopel-config``"""
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import os
from sopel import tools
from . import utils
def build_parser():
"""Build and configure an argument parser for ``sopel-conf... | 30.886139 | 82 | 0.646738 |
b48fe07b7dc942eed33a15022c1116367280b255 | 219 | py | Python | ex11.py | hectoregm/lphw | 1c4b0ce6cffa685499b9ffa5cae1a37a28e19005 | [
"MIT"
] | null | null | null | ex11.py | hectoregm/lphw | 1c4b0ce6cffa685499b9ffa5cae1a37a28e19005 | [
"MIT"
] | null | null | null | ex11.py | hectoregm/lphw | 1c4b0ce6cffa685499b9ffa5cae1a37a28e19005 | [
"MIT"
] | null | null | null | print "How old are you?",
age = raw_input()
print "How tall are you?",
height = raw_input()
print "How much do you weigh?",
weight = raw_input()
print "So, you're %r old, %r tall and %r heavy." % (age, height, weight)
| 24.333333 | 72 | 0.657534 |
3213014abc88504366cf4aff35c16083a4ff3b03 | 761 | py | Python | src/core/metrics/BinaryConfusionMatrix.py | uab-projects/bayesian-tweets | e207e84fdc1e16b13c71a24bc754e39fa04b48cf | [
"Apache-2.0"
] | 1 | 2018-01-10T05:46:16.000Z | 2018-01-10T05:46:16.000Z | src/core/metrics/BinaryConfusionMatrix.py | uab-projects/bayesian-tweets | e207e84fdc1e16b13c71a24bc754e39fa04b48cf | [
"Apache-2.0"
] | null | null | null | src/core/metrics/BinaryConfusionMatrix.py | uab-projects/bayesian-tweets | e207e84fdc1e16b13c71a24bc754e39fa04b48cf | [
"Apache-2.0"
] | null | null | null | # Libraries
import numpy as np
from .ConfusionMatrix import ConfusionMatrix
class BinaryConfusionMatrix(ConfusionMatrix):
"""
Represents a Confusion Matrix for a target feature with two possible values,
with the methods to add and finally calculate metrics
@attr _matrix matrix where matches will be saved
"""
... | 31.708333 | 77 | 0.763469 |
da0e03992de6acc20dc39e512bda567f89289f88 | 927 | py | Python | modules/ravestate_tts_watson/text_to_speech.py | HackRoboy/dialogic | 0c0b766409aeb2b717e4c396000d79909658cbb2 | [
"MIT"
] | null | null | null | modules/ravestate_tts_watson/text_to_speech.py | HackRoboy/dialogic | 0c0b766409aeb2b717e4c396000d79909658cbb2 | [
"MIT"
] | null | null | null | modules/ravestate_tts_watson/text_to_speech.py | HackRoboy/dialogic | 0c0b766409aeb2b717e4c396000d79909658cbb2 | [
"MIT"
] | 1 | 2018-10-20T20:44:32.000Z | 2018-10-20T20:44:32.000Z | from watson_developer_cloud import TextToSpeechV1
from watson_developer_cloud import WatsonApiException
class Text2Speech:
"""
Synthesize speech from text
"""
text_to_speech = None
def __init__(self, **kwargs):
self.text_to_speech = TextToSpeechV1(
username=kwargs["t2s_usernam... | 30.9 | 87 | 0.556634 |
ec70c84298637555bc80542e3be414815ab8b970 | 4,358 | py | Python | cliauto/bin/testscripts/splunk_kvstore_tester.py | Trek333/CLI-Auto-for-Splunk | f79f74dc95bda651a2892efa879605bf313a190a | [
"MIT"
] | 1 | 2022-01-10T19:46:24.000Z | 2022-01-10T19:46:24.000Z | cliauto/bin/testscripts/splunk_kvstore_tester.py | Trek333/CLI-Auto-for-Splunk | f79f74dc95bda651a2892efa879605bf313a190a | [
"MIT"
] | null | null | null | cliauto/bin/testscripts/splunk_kvstore_tester.py | Trek333/CLI-Auto-for-Splunk | f79f74dc95bda651a2892efa879605bf313a190a | [
"MIT"
] | null | null | null | import os
import sys
import json
import logging
from logging.config import fileConfig
import time
import errno
from datetime import datetime
import pdb
#pdb.set_trace()
# Setup logging
os.environ['SPLUNK_HOME'] = '/opt/splunk'
os.environ['PYTHONHTTPSVERIFY'] = '0'
#logfile = os.sep.join([os.environ['SPLUNK_HOME'], 'va... | 43.58 | 340 | 0.659477 |
bba3c1ad5ac394561bea014cad17f3698b75cd1b | 5,996 | py | Python | crawler/main.py | sanger/crawler | d309a8454af1bbe6cd48a40b2aa3bdf7be675d3b | [
"MIT"
] | 3 | 2021-03-11T08:53:24.000Z | 2022-02-07T14:04:23.000Z | crawler/main.py | sanger/crawler | d309a8454af1bbe6cd48a40b2aa3bdf7be675d3b | [
"MIT"
] | 464 | 2020-04-17T15:30:13.000Z | 2022-03-31T06:19:58.000Z | crawler/main.py | sanger/crawler | d309a8454af1bbe6cd48a40b2aa3bdf7be675d3b | [
"MIT"
] | 3 | 2020-05-19T12:04:34.000Z | 2021-03-02T11:25:44.000Z | import logging
import logging.config
import time
import pymongo
from crawler.config.centres import CENTRE_KEY_INCLUDE_IN_SCHEDULED_RUNS
from crawler.constants import (
COLLECTION_CENTRES,
COLLECTION_SAMPLES,
COLLECTION_SOURCE_PLATES,
FIELD_BARCODE,
FIELD_CENTRE_NAME,
FIELD_LAB_ID,
FIELD_LH... | 44.088235 | 117 | 0.637759 |
4410a3f65f7420a95cb989b2a7930cc1137bb1e2 | 82,181 | py | Python | source/browseMode.py | Oreonan/nvda | 975d39d1708d4a159cdcf8528dacc6d0c3156385 | [
"bzip2-1.0.6"
] | 1 | 2020-08-24T17:18:33.000Z | 2020-08-24T17:18:33.000Z | source/browseMode.py | ShubhamJain7/nvda | f4cb08475b870467f21db238c3e613898addc3fc | [
"bzip2-1.0.6"
] | null | null | null | source/browseMode.py | ShubhamJain7/nvda | f4cb08475b870467f21db238c3e613898addc3fc | [
"bzip2-1.0.6"
] | null | null | null | #browseMode.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2007-2018 NV Access Limited, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import itertools
import collections
import winsound
import time
import weakref
import wx
impo... | 44.858624 | 265 | 0.744272 |
2440050a189aefc11fd3baa69af4b2aeb9a33570 | 2,123 | py | Python | ckan/tests/legacy/lib/test_cli.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 1 | 2020-01-16T10:46:18.000Z | 2020-01-16T10:46:18.000Z | ckan/tests/legacy/lib/test_cli.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | null | null | null | ckan/tests/legacy/lib/test_cli.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from ckan import model
from ckan.lib.cli import SearchIndexCommand
from ckan.lib.create_test_data import CreateTestData
import pytest
from ckan.lib.search import index_for, query_for
class FakeOptions:
def __init__(self, **kwargs):
for key in kwargs:
setattr(self, key, kwarg... | 26.5375 | 77 | 0.585021 |
4273bffc88a78f6154c8a4dbd5c178a2f1b1f86c | 2,432 | py | Python | itez/beneficiary/migrations/0012_auto_20211105_1300.py | sonlinux/itez | 0982c19763207e211e06b4e50a5a955f3de1693e | [
"MIT"
] | null | null | null | itez/beneficiary/migrations/0012_auto_20211105_1300.py | sonlinux/itez | 0982c19763207e211e06b4e50a5a955f3de1693e | [
"MIT"
] | null | null | null | itez/beneficiary/migrations/0012_auto_20211105_1300.py | sonlinux/itez | 0982c19763207e211e06b4e50a5a955f3de1693e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-11-05 13:00
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('beneficiary', '0011_auto_20211105_1131'),
]
operations = [
migrations.RenameField(
model_name='beneficiaryparent',
... | 38.603175 | 326 | 0.60074 |
0aafd99eed5ad1cafd13c6c5f175ba5bb7adef79 | 21,794 | py | Python | electrum_audax/plugins/safe_t/safe_t.py | enkrypter/audax-polaris | 62a337bdf51c1276cd00a8b59f3ef61ff3b4b72b | [
"MIT"
] | null | null | null | electrum_audax/plugins/safe_t/safe_t.py | enkrypter/audax-polaris | 62a337bdf51c1276cd00a8b59f3ef61ff3b4b72b | [
"MIT"
] | null | null | null | electrum_audax/plugins/safe_t/safe_t.py | enkrypter/audax-polaris | 62a337bdf51c1276cd00a8b59f3ef61ff3b4b72b | [
"MIT"
] | 2 | 2019-10-08T06:52:54.000Z | 2019-10-24T03:33:20.000Z | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_audax.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_audax.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum_audax.bip32 import BIP32Node
from electrum_audax import constants
from electrum_auda... | 42.566406 | 111 | 0.58461 |
61aaf8a53664fa3370790551520048bc5b67ee0c | 4,704 | py | Python | misc/deep_learning_notes/Ch3 Advanced Tensorflow/tensorflow_cifar10/cifar10_train.py | tmjnow/MoocX | 52c8450ff7ecc8450a8adc2457233d5777a3d5bb | [
"MIT"
] | 7 | 2017-06-13T05:24:15.000Z | 2022-01-09T01:10:28.000Z | misc/deep_learning_notes/Ch3 Advanced Tensorflow/tensorflow_cifar10/cifar10_train.py | tmjnow/MoocX | 52c8450ff7ecc8450a8adc2457233d5777a3d5bb | [
"MIT"
] | 11 | 2017-05-08T23:30:50.000Z | 2017-06-24T21:57:42.000Z | misc/deep_learning_notes/Ch3 Advanced Tensorflow/tensorflow_cifar10/cifar10_train.py | kinshuk4/MoocX | 52c8450ff7ecc8450a8adc2457233d5777a3d5bb | [
"MIT"
] | 4 | 2017-10-05T12:56:53.000Z | 2020-06-14T17:01:32.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.361702 | 80 | 0.665604 |
89a6f18ed51dbdbd9cb7cb14c295edd4c9bd8f9f | 2,646 | py | Python | src/views/widgets/form.py | abelfodil/inf1900-grader | bc3522eb8bf03ce08914c6988e43cdff919fe352 | [
"MIT"
] | 1 | 2022-03-22T07:10:52.000Z | 2022-03-22T07:10:52.000Z | src/views/widgets/form.py | abelfodil/inf1900-grader | bc3522eb8bf03ce08914c6988e43cdff919fe352 | [
"MIT"
] | 11 | 2019-01-05T02:07:29.000Z | 2021-04-21T06:17:31.000Z | src/views/widgets/form.py | abelfodil/inf1900-grader | bc3522eb8bf03ce08914c6988e43cdff919fe352 | [
"MIT"
] | 5 | 2018-12-24T17:56:18.000Z | 2021-03-13T05:44:46.000Z | from collections import Callable
from urwid import AttrWrap, CheckBox, Edit, Filler, IntEdit, Overlay, Text, WidgetDecoration, \
WidgetPlaceholder, emit_signal
from src.models.state import state
from src.views.widgets.button import Button
from src.views.widgets.grid import Grid
WidgetDecoration.get_data = lambda... | 33.493671 | 96 | 0.676115 |
9ba1b52f136a26710248cd782f8b61021964f594 | 3,846 | py | Python | src/DynamixelSDK/python/tests/protocol2_0/reboot.py | ERP1234/5DOF_Robot_arm | 5dbb9b3374aea32ef38882d2fcc3cd253d49bef5 | [
"MIT"
] | 361 | 2016-04-15T05:42:26.000Z | 2022-03-26T22:25:47.000Z | src/DynamixelSDK/python/tests/protocol2_0/reboot.py | ERP1234/5DOF_Robot_arm | 5dbb9b3374aea32ef38882d2fcc3cd253d49bef5 | [
"MIT"
] | 419 | 2016-05-07T01:39:51.000Z | 2022-03-31T16:55:55.000Z | src/DynamixelSDK/python/tests/protocol2_0/reboot.py | ERP1234/5DOF_Robot_arm | 5dbb9b3374aea32ef38882d2fcc3cd253d49bef5 | [
"MIT"
] | 326 | 2016-05-03T14:09:08.000Z | 2022-03-24T10:11:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
# Copyright 2017 ROBOTIS CO., LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 33.155172 | 92 | 0.628965 |
524f571b62d043e855b5ca71d6bb8f80b8ee6201 | 797 | py | Python | forms_api/validators/regex_validator.py | ponomar/forms_api | fac06b63a97378abd98f0c203a4a70b7291ad51b | [
"BSD-3-Clause"
] | null | null | null | forms_api/validators/regex_validator.py | ponomar/forms_api | fac06b63a97378abd98f0c203a4a70b7291ad51b | [
"BSD-3-Clause"
] | null | null | null | forms_api/validators/regex_validator.py | ponomar/forms_api | fac06b63a97378abd98f0c203a4a70b7291ad51b | [
"BSD-3-Clause"
] | null | null | null | import re
from forms_api.validators.base_validator import Validator
class RegexValidator(Validator):
def __init__(self, regex, flags=0, error=None, regex_js=None):
if isinstance(regex, str):
regex = re.compile(regex, flags)
self.regex = regex
self.regex_js = regex_js
... | 24.90625 | 66 | 0.590966 |
59b36b66aaf2948c67180695f0679beca9cb5475 | 24,145 | py | Python | tf_quant_finance/models/sabr/approximations/calibration.py | sdban/tf-quant-finance | dfe6b80d7c1146ae51ceb3ced92a83d1d4520697 | [
"Apache-2.0"
] | 3,138 | 2019-07-24T21:43:17.000Z | 2022-03-30T12:11:09.000Z | tf_quant_finance/models/sabr/approximations/calibration.py | sdban/tf-quant-finance | dfe6b80d7c1146ae51ceb3ced92a83d1d4520697 | [
"Apache-2.0"
] | 63 | 2019-09-07T19:16:03.000Z | 2022-03-29T19:29:40.000Z | tf_quant_finance/models/sabr/approximations/calibration.py | sdban/tf-quant-finance | dfe6b80d7c1146ae51ceb3ced92a83d1d4520697 | [
"Apache-2.0"
] | 423 | 2019-07-26T21:28:05.000Z | 2022-03-26T13:07:44.000Z | # Lint as: python3
# Copyright 2021 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 41.273504 | 100 | 0.703955 |
0bdd78b4de389f97c17d545760d4414fa09913b2 | 812 | py | Python | astr-119-hw-2/data_types_continued.py | cnojiri/astr-119 | e4fae90e75276c1800fda5bb559f988767c0d870 | [
"MIT"
] | 1 | 2021-12-07T07:41:33.000Z | 2021-12-07T07:41:33.000Z | astr-119-hw-2/data_types_continued.py | cnojiri/astr-119 | e4fae90e75276c1800fda5bb559f988767c0d870 | [
"MIT"
] | 6 | 2021-09-29T22:13:31.000Z | 2021-11-24T16:00:50.000Z | astr-119-hw-2/data_types_continued.py | cnojiri/astr-119 | e4fae90e75276c1800fda5bb559f988767c0d870 | [
"MIT"
] | null | null | null | #string
s = "I am a string."
print(type(s)) #will say str
#boolean
yes = True #boolean true
print(type(yes))
no = False #boolean false
print(type(no))
# List -- ordered and changeable
alpha_list = ["a", "b", "c"] #list initializaiton
print(type(alpha_list)) #will say tuple
print(type(alpha_list[0... | 26.193548 | 62 | 0.685961 |
df21505e01997bfbc933e309e8bff81c2ee8a21e | 1,163 | py | Python | examples/integriot_test/testnode1/files/autostart.py | ulno/iot-devkit | 6e90c1c207f23c4b5bf374f58d3701550e6c70ca | [
"MIT"
] | null | null | null | examples/integriot_test/testnode1/files/autostart.py | ulno/iot-devkit | 6e90c1c207f23c4b5bf374f58d3701550e6c70ca | [
"MIT"
] | null | null | null | examples/integriot_test/testnode1/files/autostart.py | ulno/iot-devkit | 6e90c1c207f23c4b5bf374f58d3701550e6c70ca | [
"MIT"
] | 1 | 2020-07-23T03:03:38.000Z | 2020-07-23T03:03:38.000Z | # user.py is the autostart code for a ulnoiot node.
# Configure your devices, sensors and local interaction here.
# Always start with this to make everything from ulnoiot available.
# Therefore, do not delete the following line.
from ulnoiot import *
# The following is just example code, adjust to your needs accordin... | 34.205882 | 74 | 0.756664 |
bef743bf7292f187565b9b90773f19639d63b55c | 1,784 | py | Python | fuelmenu/fuelmenu/modules/shell.py | Zipfer/fuel-web | c6c4032eb6e29474e2be0318349265bdb566454c | [
"Apache-2.0"
] | 1 | 2021-04-06T16:13:35.000Z | 2021-04-06T16:13:35.000Z | fuelmenu/fuelmenu/modules/shell.py | Zipfer/fuel-web | c6c4032eb6e29474e2be0318349265bdb566454c | [
"Apache-2.0"
] | null | null | null | fuelmenu/fuelmenu/modules/shell.py | Zipfer/fuel-web | c6c4032eb6e29474e2be0318349265bdb566454c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.857143 | 79 | 0.679933 |
0a842caaf70906bbc1cf4b3a4ba3ba9841f2aa9c | 1,172 | py | Python | setup.py | fonar/paypalhttp_python | 218136324c3dc6d4021db907c94cb6ac30cb1060 | [
"MIT"
] | null | null | null | setup.py | fonar/paypalhttp_python | 218136324c3dc6d4021db907c94cb6ac30cb1060 | [
"MIT"
] | null | null | null | setup.py | fonar/paypalhttp_python | 218136324c3dc6d4021db907c94cb6ac30cb1060 | [
"MIT"
] | null | null | null | from setuptools import setup
version = "1.0.0"
long_description = """
PayPalHttp is a generic http client designed to be used with code-generated projects.
"""
setup(
name="paypalhttp",
long_description=long_description,
version=version,
author="PayPal",
packages=["paypalhttp", "paypalhttp/testu... | 34.470588 | 86 | 0.620307 |
c0fe03e387133ad69642c61b5f3512cd0a326d97 | 2,776 | py | Python | mantle/lattice/mantle40/arith.py | splhack/mantle | 42fe81df22f4556f891f77b9c9acfd7e8bbe648b | [
"MIT"
] | null | null | null | mantle/lattice/mantle40/arith.py | splhack/mantle | 42fe81df22f4556f891f77b9c9acfd7e8bbe648b | [
"MIT"
] | null | null | null | mantle/lattice/mantle40/arith.py | splhack/mantle | 42fe81df22f4556f891f77b9c9acfd7e8bbe648b | [
"MIT"
] | null | null | null | from magma import *
from .logic import DefineInvert, Not
from .fulladder import FullAdder
__all__ = ['DefineAdd']
__all__ += ['DefineSub']
__all__ += ['DefineNegate']
def _AdderName(basename, n, cin, cout):
name = f"{basename}{n}"
if cin: name += '_CIN'
if cout: name += '_COUT'
return name
def _Add... | 23.931034 | 76 | 0.517291 |
97e5122e46539f6892a6c67a6bbdac67207610e3 | 1,842 | py | Python | tests/integration/test_repos_invitation.py | staticdev/github3.py | b9af598dcf1771c083dcc512a2aa8e5008bf4ea8 | [
"MIT"
] | null | null | null | tests/integration/test_repos_invitation.py | staticdev/github3.py | b9af598dcf1771c083dcc512a2aa8e5008bf4ea8 | [
"MIT"
] | 32 | 2021-02-17T19:46:21.000Z | 2021-05-12T05:56:03.000Z | tests/integration/test_repos_invitation.py | staticdev/github3.py | b9af598dcf1771c083dcc512a2aa8e5008bf4ea8 | [
"MIT"
] | null | null | null | """Integration tests for Repository Invitation objects."""
import github4
from . import helper
class TestInvitation(helper.IntegrationHelper):
"""Integration tests for the Invitation object."""
def test_accept(self):
"""Test the ability to accept an invitation."""
self.token_login()
c... | 40.933333 | 79 | 0.649837 |
5081886276d7ef490b2daa2735d9c967424474ac | 2,074 | py | Python | Section 5/5.2 Start/application/routes.py | chenjianAgain/Full-Stack-Web-Development-with-Flask | e110b0b649c19a9fd11ae70311cbf03727640921 | [
"MIT"
] | 14 | 2019-10-24T16:14:29.000Z | 2021-12-29T16:44:21.000Z | Section 5/5.2 Start/application/routes.py | chenjianAgain/Full-Stack-Web-Development-with-Flask | e110b0b649c19a9fd11ae70311cbf03727640921 | [
"MIT"
] | 6 | 2019-10-03T08:03:00.000Z | 2021-08-14T12:36:11.000Z | Section 5/5.2 Start/application/routes.py | chenjianAgain/Full-Stack-Web-Development-with-Flask | e110b0b649c19a9fd11ae70311cbf03727640921 | [
"MIT"
] | 29 | 2019-03-31T00:19:44.000Z | 2022-02-07T11:12:24.000Z | from application import app, db
from flask import render_template, request, json, Response
from application.models import User, Course, Enrollment
courseData = [{"courseID":"1111","title":"PHP 111","description":"Intro to PHP","credits":"3","term":"Fall, Spring"}, {"courseID":"2222","title":"Java 1","description":"Int... | 42.326531 | 557 | 0.673095 |
5671dc71ad0a9f5a2ee0523b8e43d09e53d04876 | 659 | py | Python | monolith/models/operator.py | Squad002/GoOutSafe-Monolith | 4ee5a32668730626ee5bd314c98515e7d7253e13 | [
"MIT"
] | null | null | null | monolith/models/operator.py | Squad002/GoOutSafe-Monolith | 4ee5a32668730626ee5bd314c98515e7d7253e13 | [
"MIT"
] | null | null | null | monolith/models/operator.py | Squad002/GoOutSafe-Monolith | 4ee5a32668730626ee5bd314c98515e7d7253e13 | [
"MIT"
] | null | null | null | from monolith import db
from .abstract_user import AbstractUser
class Operator(AbstractUser):
__tablename__ = "operator"
restaurants = db.relationship("Restaurant", backref="operator")
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.Unicode(128), nullable=False)
... | 32.95 | 68 | 0.699545 |
060826966cfd3bc1278ff694a125c5247c95272e | 214,970 | py | Python | src/bitmessageqt/__init__.py | GONQ/PyBitmessage | b2af007280a41c61498626077a08985d5d7df957 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 1 | 2018-12-18T21:56:15.000Z | 2018-12-18T21:56:15.000Z | src/bitmessageqt/__init__.py | GONQ/PyBitmessage | b2af007280a41c61498626077a08985d5d7df957 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/bitmessageqt/__init__.py | GONQ/PyBitmessage | b2af007280a41c61498626077a08985d5d7df957 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | null | null | null | """
PyQt based UI for bitmessage, the main module
"""
import hashlib
import locale
import os
import random
import string
import sys
import textwrap
import time
from datetime import datetime, timedelta
from sqlite3 import register_adapter
from PyQt4 import QtCore, QtGui
from PyQt4.QtNetwork import QLocalSocket, QLocal... | 47.995088 | 450 | 0.613239 |
797c94e02227dd775a48d5905b9aaff0330874ce | 2,712 | py | Python | UMD/AST615/HW6_2/N.py | justincely/classwork | 2d2b1882f9141bc5776977a5c7c6a4788ea7bc4f | [
"BSD-3-Clause"
] | 1 | 2021-02-16T03:17:26.000Z | 2021-02-16T03:17:26.000Z | UMD/AST615/HW6_2/N.py | justincely/classwork | 2d2b1882f9141bc5776977a5c7c6a4788ea7bc4f | [
"BSD-3-Clause"
] | null | null | null | UMD/AST615/HW6_2/N.py | justincely/classwork | 2d2b1882f9141bc5776977a5c7c6a4788ea7bc4f | [
"BSD-3-Clause"
] | 11 | 2017-06-13T13:11:27.000Z | 2021-10-04T17:04:32.000Z | #!/usr/bin/python
# Usage:
#
# jdsbabel.py [inputfile]
from __future__ import with_statement
import sys
import numpy
from itertools import combinations
class Particle(object):
"""
A Particle has mass, position, velocity and acceleration.
"""
def __init__(self, mass, x, y, z, vx, vy, vz):
s... | 30.47191 | 87 | 0.571903 |
48cd5d45a3a3886ec231a7daf07063ac1a3972cb | 596 | py | Python | articles/migrations/0009_auto_20201102_1835.py | LucaCeccagnoli/PoggersHEMA | 4c35749750a9cb75024487b3f44bc2506df2a338 | [
"MIT"
] | null | null | null | articles/migrations/0009_auto_20201102_1835.py | LucaCeccagnoli/PoggersHEMA | 4c35749750a9cb75024487b3f44bc2506df2a338 | [
"MIT"
] | null | null | null | articles/migrations/0009_auto_20201102_1835.py | LucaCeccagnoli/PoggersHEMA | 4c35749750a9cb75024487b3f44bc2506df2a338 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-02 17:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0008_auto_20201102_1820'),
]
operations = [
migrations.RemoveField(
model_name='orderitem',
name='item_i... | 24.833333 | 119 | 0.597315 |
0dbf425b58e97c79d42d99d46838ce48f5897830 | 6,175 | py | Python | src/unv/deploy/components/postgres/__init__.py | c137digital/unv_deploy | 7cb8e6902f4b3eff7e095f83e71d10582f023ab9 | [
"MIT"
] | null | null | null | src/unv/deploy/components/postgres/__init__.py | c137digital/unv_deploy | 7cb8e6902f4b3eff7e095f83e71d10582f023ab9 | [
"MIT"
] | null | null | null | src/unv/deploy/components/postgres/__init__.py | c137digital/unv_deploy | 7cb8e6902f4b3eff7e095f83e71d10582f023ab9 | [
"MIT"
] | null | null | null | from pathlib import Path
from unv.utils.tasks import TaskRunError
from unv.deploy.tasks import (
DeployComponentSettings, DeployTasks, register
)
from unv.deploy.components.systemd import SystemdTasksMixin
class PostgresSettings(DeployComponentSettings):
NAME = 'postgres'
SCHEMA = {
'user': {'ty... | 31.030151 | 81 | 0.536194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.