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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f9018d542882a2b4348b7736cc1deaa344619663 | 9,971 | py | Python | hybridbackend/tensorflow/distribute/nccl.py | fuhailin/HybridBackend | 113383c5870b7180fa67c194208a27f76bdbf3f0 | [
"Apache-2.0"
] | 38 | 2021-12-01T06:54:36.000Z | 2022-03-23T11:23:21.000Z | hybridbackend/tensorflow/distribute/nccl.py | fuhailin/HybridBackend | 113383c5870b7180fa67c194208a27f76bdbf3f0 | [
"Apache-2.0"
] | 15 | 2021-12-01T09:15:26.000Z | 2022-03-28T02:49:21.000Z | hybridbackend/tensorflow/distribute/nccl.py | fuhailin/HybridBackend | 113383c5870b7180fa67c194208a27f76bdbf3f0 | [
"Apache-2.0"
] | 8 | 2021-12-02T01:16:14.000Z | 2022-01-28T04:51:16.000Z | # Copyright 2021 Alibaba Group Holding Limited. 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 ... | 31.454259 | 79 | 0.726407 |
3bd87e222b8002bf3226dc2bc73851c0a32da605 | 3,066 | py | Python | train_dynamics_prediction.py | SrikarValluri/hidden-state-rrl-sl | 80c90ce3e07fc61e6b910a763b9608debeb1e5c4 | [
"MIT"
] | null | null | null | train_dynamics_prediction.py | SrikarValluri/hidden-state-rrl-sl | 80c90ce3e07fc61e6b910a763b9608debeb1e5c4 | [
"MIT"
] | null | null | null | train_dynamics_prediction.py | SrikarValluri/hidden-state-rrl-sl | 80c90ce3e07fc61e6b910a763b9608debeb1e5c4 | [
"MIT"
] | 1 | 2021-12-07T13:45:33.000Z | 2021-12-07T13:45:33.000Z | import numpy as np
import gym
import torch
import torch.nn as nn
import argparse
import pickle
from functools import partial
state_vector = pickle.load(open("./data/state_vector_ccadea_forward.p", "rb"))
state_labels = pickle.load(open("./data/state_labels_ccadea_forward.p", "rb"))
state_vector_train = state_vector[... | 32.967742 | 170 | 0.701892 |
52b286c51738be5d2a00709ba3092a0153a976a1 | 1,782 | py | Python | ietf/stats/management/commands/fetch_meeting_attendance.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/stats/management/commands/fetch_meeting_attendance.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/stats/management/commands/fetch_meeting_attendance.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 IETF Trust
import syslog
from django.core.management.base import BaseCommand, CommandError
import debug # pyflakes:ignore
from ietf.meeting.models import Meeting
from ietf.stats.utils import get_meeting_registration_data
logtag = __name__.split('.')[-1]
logname = "user.l... | 39.6 | 132 | 0.647587 |
d83b2e21d87473bd59a44ed13c3d5b10d184d269 | 2,513 | py | Python | model_runner/validator/_tests/test_validator_utils.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | null | null | null | model_runner/validator/_tests/test_validator_utils.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | 5 | 2021-09-27T14:43:39.000Z | 2022-02-23T14:18:00.000Z | model_runner/validator/_tests/test_validator_utils.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | null | null | null | import copy
import os
import pytest
from pydantic import ValidationError
from model_runner.validator.validator_utils import ConfigModel
def test_good_config(base_config):
# test gpu config
config = ConfigModel(**base_config)
# test some specific parameters
assert (
type(config.dict()["job_p... | 29.564706 | 86 | 0.675686 |
158ed1bc20e2db4a2fb193cec6eee5f41e903de1 | 921 | py | Python | setup.py | xdusongwei/rdict | ab275a9db079b18cd4da17110441d3407bdb106a | [
"MIT"
] | null | null | null | setup.py | xdusongwei/rdict | ab275a9db079b18cd4da17110441d3407bdb106a | [
"MIT"
] | null | null | null | setup.py | xdusongwei/rdict | ab275a9db079b18cd4da17110441d3407bdb106a | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='rdict',
version='0.1.1',
author='songwei',
author_email='songwei@songwei.io',
description='A Pythonic tool is used for operating redis commands.',
long_description='',
url='https://github.com/xdusongwei/rdict',
python_requires='>=3',
package... | 30.7 | 72 | 0.59392 |
bf410a88d2495134f82303f4978fb96616ea723f | 323 | py | Python | dcbase/decorator/profileModel.py | tctimmeh/dc-django-base | 08e444387c7ce4896343ac7e61444bbd7f98b4a6 | [
"MIT"
] | null | null | null | dcbase/decorator/profileModel.py | tctimmeh/dc-django-base | 08e444387c7ce4896343ac7e61444bbd7f98b4a6 | [
"MIT"
] | 13 | 2015-02-16T17:13:34.000Z | 2015-03-07T04:59:28.000Z | dcbase/decorator/profileModel.py | tctimmeh/dc-django-base | 08e444387c7ce4896343ac7e61444bbd7f98b4a6 | [
"MIT"
] | null | null | null | from dcbase.lib.profileEditor import ProfileEditor
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse_lazy
def profile_model():
def _wrapper(profile_class):
ProfileEditor.register_profile_model(profile_class)
return profile_class
return _wrappe... | 26.916667 | 59 | 0.804954 |
ec53b8808748eae28af8a4692972d70adf01df26 | 8,011 | py | Python | tests/validation/tests/v3_api/test_rke2_airgap.py | rand4711/rancher | e6c4492dfb2fab813ca9f6443df393b89f1e3431 | [
"Apache-2.0"
] | 18,697 | 2015-07-09T17:56:35.000Z | 2022-03-31T21:10:25.000Z | tests/validation/tests/v3_api/test_rke2_airgap.py | rand4711/rancher | e6c4492dfb2fab813ca9f6443df393b89f1e3431 | [
"Apache-2.0"
] | 31,132 | 2015-07-09T17:28:32.000Z | 2022-03-31T23:31:26.000Z | tests/validation/tests/v3_api/test_rke2_airgap.py | rand4711/rancher | e6c4492dfb2fab813ca9f6443df393b89f1e3431 | [
"Apache-2.0"
] | 2,979 | 2015-07-12T02:48:07.000Z | 2022-03-31T13:35:39.000Z | import os
from lib.aws import AWS_USER
from .common import AmazonWebServices
from .test_airgap import (AG_HOST_NAME, NUMBER_OF_INSTANCES, TARBALL_TYPE,
get_bastion_node, prepare_registries_mirror_on_node,
run_command_on_airgap_node, deploy_airgap_cluster,
... | 48.259036 | 79 | 0.65073 |
1ab94fb2beeaec990377af5a4232c5418546845b | 1,571 | py | Python | lib/score_util.py | alisure-ml/Semantic-Segmentation-clockwork-fcn | 2a870feb5339068a283d106ff2d6b4c5a20ab966 | [
"BSD-4-Clause-UC"
] | 2 | 2021-01-15T19:13:19.000Z | 2021-11-17T11:37:56.000Z | lib/score_util.py | alisure-ml/Semantic-Segmentation-clockwork-fcn | 2a870feb5339068a283d106ff2d6b4c5a20ab966 | [
"BSD-4-Clause-UC"
] | null | null | null | lib/score_util.py | alisure-ml/Semantic-Segmentation-clockwork-fcn | 2a870feb5339068a283d106ff2d6b4c5a20ab966 | [
"BSD-4-Clause-UC"
] | 1 | 2021-01-15T19:14:13.000Z | 2021-01-15T19:14:13.000Z | from __future__ import division
import numpy as np
def fast_hist(a, b, n):
k = np.where((a >= 0) & (a < n))[0]
return np.bincount(n * a[k].astype(int) + b[k], minlength=n ** 2).reshape(n, n)
def report_scores(meta, hist):
print('>>>', meta)
# overall accuracy
acc = np.diag(hist).sum() / hist.sum... | 27.086207 | 83 | 0.598345 |
ba115f68731f83789c5de04edf5ced708d6f38f8 | 361 | py | Python | retrievalaccuracy/__init__.py | joshjchayes/RetrievalAccuracy | 85c7cb0c90ddf7512dcf3aec7c5fc1a9d9f9d9c7 | [
"MIT"
] | null | null | null | retrievalaccuracy/__init__.py | joshjchayes/RetrievalAccuracy | 85c7cb0c90ddf7512dcf3aec7c5fc1a9d9f9d9c7 | [
"MIT"
] | null | null | null | retrievalaccuracy/__init__.py | joshjchayes/RetrievalAccuracy | 85c7cb0c90ddf7512dcf3aec7c5fc1a9d9f9d9c7 | [
"MIT"
] | null | null | null | '''
RetrievalAccuracy is a Python 3 package designed to provide a consistent method
for assigning accuracy metrics to different retrieval results when the true
result is known. This can be used for testing and comparing retrieval
algorithms.
'''
from .metric_calculator import MetricCalculator
#from .metric_plotter i... | 25.785714 | 79 | 0.814404 |
fa08daca8a4122cfd5e82cf3feffb67564e7aadc | 2,400 | py | Python | doc/test_directive3.py | tmarktaylor/phmdoctest | 6974c95f8019aeea7e99a0cd7cafb06846291a35 | [
"MIT"
] | 16 | 2020-06-01T21:50:04.000Z | 2022-03-10T00:47:47.000Z | doc/test_directive3.py | Borda/phmdoctest | 36b657fae364b5a6dcf59f8b4d92e5fb6dd713bd | [
"MIT"
] | 18 | 2020-06-01T22:08:59.000Z | 2022-03-30T15:26:10.000Z | doc/test_directive3.py | Borda/phmdoctest | 36b657fae364b5a6dcf59f8b4d92e5fb6dd713bd | [
"MIT"
] | 3 | 2020-06-23T02:04:25.000Z | 2022-02-10T21:32:19.000Z | """pytest file built from doc/directive3.md"""
import pytest
from phmdoctest.fixture import managenamespace
from phmdoctest.functions import _phm_compare_exact
def test_code_13_output_17(capsys):
not_shared = "Hello World!"
print(not_shared)
_phm_expected_str = """\
Hello World!
"""
_phm_compare_exa... | 21.238938 | 70 | 0.676667 |
b3bb758d3270602debdda62f12e6279f9c48d534 | 2,594 | py | Python | test/core/sampler/pymc3_test.py | deepchatterjeeligo/bilby | 6532c63d0d970ad33478ae0b1c28d4c570b74047 | [
"MIT"
] | null | null | null | test/core/sampler/pymc3_test.py | deepchatterjeeligo/bilby | 6532c63d0d970ad33478ae0b1c28d4c570b74047 | [
"MIT"
] | null | null | null | test/core/sampler/pymc3_test.py | deepchatterjeeligo/bilby | 6532c63d0d970ad33478ae0b1c28d4c570b74047 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import MagicMock
import pytest
import bilby
@pytest.mark.xfail(
raises=AttributeError,
reason="Dependency issue with pymc3 causes attribute error on import",
)
class TestPyMC3(unittest.TestCase):
def setUp(self):
self.likelihood = MagicMock()
self.prior... | 28.505495 | 88 | 0.569391 |
281469fa0208e12441ccfe297f5a7d2d661ae868 | 1,836 | py | Python | pluto/setup/directory_setup.py | chalant/zipline-lib | 836473160f369165132f009bfe620b5d5ca5c946 | [
"Apache-2.0"
] | null | null | null | pluto/setup/directory_setup.py | chalant/zipline-lib | 836473160f369165132f009bfe620b5d5ca5c946 | [
"Apache-2.0"
] | null | null | null | pluto/setup/directory_setup.py | chalant/zipline-lib | 836473160f369165132f009bfe620b5d5ca5c946 | [
"Apache-2.0"
] | null | null | null | from os import path
from sqlalchemy import create_engine
from directory import directory as dr
from directory import utils as du
# root_dir = dr.create_directory(path.expanduser('~./pluto'), 'root')
# root_dir.add_file('setup', 'yaml')
#
# setup_dir = root_dir.add_directory('setup')
# setup_dir.add_file('run_setup',... | 30.6 | 102 | 0.736928 |
369ea0fd139adee70540bb8c6183630bdb73ad50 | 680 | py | Python | apps/mappings/migrations/0008_auto_20210908_0617.py | fylein/fyle-qbo-api | 627339ddbab37cafc8aa419a757d826759d86778 | [
"MIT"
] | null | null | null | apps/mappings/migrations/0008_auto_20210908_0617.py | fylein/fyle-qbo-api | 627339ddbab37cafc8aa419a757d826759d86778 | [
"MIT"
] | 22 | 2020-01-03T11:00:00.000Z | 2022-03-22T11:12:35.000Z | apps/mappings/migrations/0008_auto_20210908_0617.py | fylein/fyle-qbo-api | 627339ddbab37cafc8aa419a757d826759d86778 | [
"MIT"
] | 3 | 2020-03-09T12:56:31.000Z | 2020-06-10T07:55:47.000Z | # Generated by Django 3.0.3 on 2021-09-08 06:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mappings', '0007_auto_20210722_1446'),
]
operations = [
migrations.AddField(
model_name='generalmapping',
name='defa... | 28.333333 | 101 | 0.626471 |
e0f9bbef3355f18ea62be91313835da5ed7ecd0b | 717 | py | Python | examples/run_dfwa.py | rhododendrom/NiaPy | 873037e4337474bb75714f1c2be273c97de3eded | [
"MIT"
] | 1 | 2020-03-16T11:15:43.000Z | 2020-03-16T11:15:43.000Z | examples/run_dfwa.py | rhododendrom/NiaPy | 873037e4337474bb75714f1c2be273c97de3eded | [
"MIT"
] | null | null | null | examples/run_dfwa.py | rhododendrom/NiaPy | 873037e4337474bb75714f1c2be273c97de3eded | [
"MIT"
] | null | null | null | # encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys
sys.path.append('../')
# End of fix
from NiaPy.algorithms.basic import DynamicFireworksAlgorithm
from NiaPy.util import StoppingTask
from NiaPy.task.task import OptimizationType... | 34.142857 | 94 | 0.767085 |
35be45e9594b061820cb74b528e17fbea090c7c8 | 2,139 | py | Python | Controllers/MatchupDisplay.py | fefelson/MLBProjections | 444a1c071cb7b1e21eedc49cf63ae91e80d37978 | [
"MIT"
] | null | null | null | Controllers/MatchupDisplay.py | fefelson/MLBProjections | 444a1c071cb7b1e21eedc49cf63ae91e80d37978 | [
"MIT"
] | null | null | null | Controllers/MatchupDisplay.py | fefelson/MLBProjections | 444a1c071cb7b1e21eedc49cf63ae91e80d37978 | [
"MIT"
] | null | null | null | import wx
from MLBProjections.MLBProjections.Views.MatchupDisplay import MatchupDisplay, MatchupPanel
from MLBProjections.MLBProjections.LineupSetter import LineupSetter
from MLBProjections.MLBProjections.SimulationSetter import SimulationSetter
########################################################################... | 38.196429 | 91 | 0.542777 |
dd643434701dcd41a6b997bdb173b8e66a4492c4 | 565 | py | Python | Python Tkinter How To Use HTML In Your Tkinter App/HowToUseHTMLInYourTkinterApp.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 20 | 2020-08-19T23:27:01.000Z | 2022-02-03T12:02:17.000Z | Python Tkinter How To Use HTML In Your Tkinter App/HowToUseHTMLInYourTkinterApp.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 1 | 2021-04-10T18:06:05.000Z | 2021-04-10T18:06:05.000Z | Python Tkinter How To Use HTML In Your Tkinter App/HowToUseHTMLInYourTkinterApp.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 2 | 2020-12-03T19:35:36.000Z | 2021-11-10T14:58:39.000Z | from tkinter import *
from tkhtmlview import HTMLLabel
root = Tk()
root.title("Python Tkinter How To Use HTML In Your Tkinter App")
root.geometry("500x600")
my_label = HTMLLabel(root, html="\
<h1>\
<a href='https://www.python.org/'>Download Python</a>\
</h1>\
<ul>\
<li>One </li>\
<li>Two </li... | 20.925926 | 118 | 0.638938 |
dd47f0427921e5f9cf6263f043f88af4a089d5b2 | 1,751 | py | Python | misc/doc/sources/interception/sc_custom_message_id.py | 2naive/jasmin | 7609a50ded4ebf5873b607cb4a500be4b1be6be1 | [
"Apache-2.0"
] | null | null | null | misc/doc/sources/interception/sc_custom_message_id.py | 2naive/jasmin | 7609a50ded4ebf5873b607cb4a500be4b1be6be1 | [
"Apache-2.0"
] | null | null | null | misc/doc/sources/interception/sc_custom_message_id.py | 2naive/jasmin | 7609a50ded4ebf5873b607cb4a500be4b1be6be1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"External URL controlled routing and custom message_id"
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import logging
import requests
import urllib
import json
# Set logger
logger = logging.getLogger('logging-example')
if len(logger.handlers) != 1:
hdlr = logging.FileHandler('/var/l... | 38.065217 | 164 | 0.741862 |
2f701918514c565a5de504d86f6d6520039298ed | 1,204 | py | Python | ch04/q4-05.py | iamnicoj/ctci | f71f995cb3d3257d3d58f1f167fcab8eaf84d457 | [
"MIT"
] | null | null | null | ch04/q4-05.py | iamnicoj/ctci | f71f995cb3d3257d3d58f1f167fcab8eaf84d457 | [
"MIT"
] | 3 | 2021-03-19T14:35:27.000Z | 2021-03-20T16:12:34.000Z | ch04/q4-05.py | iamnicoj/ctci | f71f995cb3d3257d3d58f1f167fcab8eaf84d457 | [
"MIT"
] | null | null | null | from avl_tree import avl_tree
from random import randint
def validate_bst(tree):
if tree.head is None:
return True
return _recursive_validate(tree.head.left, tree.head.data, True) and _recursive_validate(tree.head.right, tree.head.data, False)
def _recursive_validate(node, parent_value, is_left):
... | 24.08 | 133 | 0.668605 |
c0020a5c48f2c2c3f5b6f0d2ae2d3b3f3f939485 | 10,005 | py | Python | test/test_export.py | GillesBouissac/blender-amf | 3a729b60dec7b7d0ab08ce82cadafd3c7f370e31 | [
"MIT"
] | 3 | 2021-06-16T07:54:50.000Z | 2022-03-31T09:44:30.000Z | test/test_export.py | GillesBouissac/blender-amf | 3a729b60dec7b7d0ab08ce82cadafd3c7f370e31 | [
"MIT"
] | null | null | null | test/test_export.py | GillesBouissac/blender-amf | 3a729b60dec7b7d0ab08ce82cadafd3c7f370e31 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Gilles Bouissac
#
# 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, mer... | 34.860627 | 79 | 0.605097 |
2794dafc4e3855f316b0ef087b4a3d850b3fc805 | 2,650 | py | Python | nuitka/optimizations/BytecodeDemotion.py | dmikushin/Nuitka | 1e7e05257b9b39ec74be807bfdb0dec11a68e1ed | [
"Apache-2.0"
] | null | null | null | nuitka/optimizations/BytecodeDemotion.py | dmikushin/Nuitka | 1e7e05257b9b39ec74be807bfdb0dec11a68e1ed | [
"Apache-2.0"
] | null | null | null | nuitka/optimizations/BytecodeDemotion.py | dmikushin/Nuitka | 1e7e05257b9b39ec74be807bfdb0dec11a68e1ed | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 34.415584 | 86 | 0.739623 |
5ed880ff5f7c17a8e6b0538cfb7dff3c57e6f1a8 | 7,646 | py | Python | common/clr_keras_utils.py | CBIIT/NCI-DOE-Collab-Pilot1-Unified-Drug-Response-Predictor-Multi-tasking | 93ac7706741a22ef091fae3bf555d7271fe27bee | [
"MIT"
] | 51 | 2017-01-24T20:57:27.000Z | 2022-02-15T00:33:45.000Z | common/clr_keras_utils.py | CBIIT/NCI-DOE-Collab-Pilot1-Unified-Drug-Response-Predictor-Multi-tasking | 93ac7706741a22ef091fae3bf555d7271fe27bee | [
"MIT"
] | 59 | 2017-08-21T22:19:44.000Z | 2021-11-01T16:05:35.000Z | common/clr_keras_utils.py | CBIIT/NCI-DOE-Collab-Pilot1-Unified-Drug-Response-Predictor-Multi-tasking | 93ac7706741a22ef091fae3bf555d7271fe27bee | [
"MIT"
] | 90 | 2016-11-22T03:57:07.000Z | 2022-01-11T04:43:23.000Z | from tensorflow.keras.callbacks import Callback
from tensorflow.keras import backend as K
import numpy as np
def clr_check_args(args):
req_keys = ['clr_mode', 'clr_base_lr', 'clr_max_lr', 'clr_gamma']
keys_present = True
for key in req_keys:
if key not in args.keys():
keys_present = Fa... | 37.665025 | 118 | 0.582396 |
3f4795dbe44394c551da78077c21d2a78916c96d | 1,369 | py | Python | examples/BEMIO/CAPYTAINE/run_cases.py | srflp/WEC-Sim | 2820d31fd6d534f60d3b97ad9a0d4ba270f9a8e2 | [
"Apache-2.0"
] | 89 | 2015-01-09T01:45:25.000Z | 2022-01-20T15:45:11.000Z | examples/BEMIO/CAPYTAINE/run_cases.py | srflp/WEC-Sim | 2820d31fd6d534f60d3b97ad9a0d4ba270f9a8e2 | [
"Apache-2.0"
] | 731 | 2015-03-31T04:59:36.000Z | 2022-03-31T19:04:29.000Z | examples/BEMIO/CAPYTAINE/run_cases.py | srflp/WEC-Sim | 2820d31fd6d534f60d3b97ad9a0d4ba270f9a8e2 | [
"Apache-2.0"
] | 160 | 2015-01-06T21:36:53.000Z | 2022-03-28T09:10:28.000Z | # '-*- coding: utf-8 -*-
"""
Created on Wed Nov 18 11:32:31 2020
@author: akeeste
This script runs all of the Capytaine cases needed for the WEC-Sim bemio examples.
This script runs Capytaine, not BEMIO.
"""
import os
# num of problems in each case is nFrequencies*(nHeadings + nDof*nBodies)
# total: ~47,000 problems... | 26.326923 | 82 | 0.631118 |
43247d091613c6fbfb5dcccc4b4ea0d1cf312658 | 1,091 | py | Python | runtests.py | gjost/django-linkpile | a3b12f3cfc13b20fe74aa38ae1a669b91ecf303d | [
"BSD-3-Clause"
] | 4 | 2017-10-12T16:01:45.000Z | 2021-05-23T22:38:13.000Z | runtests.py | gjost/django-linkpile | a3b12f3cfc13b20fe74aa38ae1a669b91ecf303d | [
"BSD-3-Clause"
] | 2 | 2018-06-25T17:09:26.000Z | 2020-01-21T20:59:33.000Z | runtests.py | gjost/django-linkpile | a3b12f3cfc13b20fe74aa38ae1a669b91ecf303d | [
"BSD-3-Clause"
] | null | null | null | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="linkpile.urls",
INSTALLED_APPS=[
... | 20.980769 | 85 | 0.571036 |
af5ce1c211d6cd05d3f1f641ed4a340e032648ba | 475 | py | Python | examples/src/autodockerization/main.py | aniketmaurya/Chitra | e040311c25ccf2e101df5596662450ae532bee08 | [
"Apache-2.0"
] | 34 | 2022-01-01T08:18:42.000Z | 2022-03-27T16:02:22.000Z | examples/src/autodockerization/main.py | aniketmaurya/Chitra | e040311c25ccf2e101df5596662450ae532bee08 | [
"Apache-2.0"
] | 20 | 2021-12-31T14:52:05.000Z | 2022-03-26T20:57:52.000Z | examples/src/autodockerization/main.py | aniketmaurya/Chitra | e040311c25ccf2e101df5596662450ae532bee08 | [
"Apache-2.0"
] | 6 | 2022-01-12T23:38:19.000Z | 2022-03-10T16:03:15.000Z | from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
from chitra.serve import create_api
tokenizer = AutoTokenizer.from_pretrained("microsoft/xtremedistil-l6-h256-uncased")
model = AutoModelForSequenceClassification.from_pretrained("microsoft/xtremedistil-l6-h256-uncased")
classifier =... | 39.583333 | 100 | 0.835789 |
edce05eae7cbe4eac22f510dd0d35cc5d4667545 | 257 | py | Python | horast/__init__.py | renesugar/horast | 1f3cca6f03cbe82303655cd8e2f35fa96a820f6a | [
"Apache-2.0"
] | 12 | 2018-12-09T10:45:21.000Z | 2022-01-08T03:32:26.000Z | horast/__init__.py | renesugar/horast | 1f3cca6f03cbe82303655cd8e2f35fa96a820f6a | [
"Apache-2.0"
] | 6 | 2019-07-23T07:25:11.000Z | 2020-10-26T07:52:07.000Z | horast/__init__.py | renesugar/horast | 1f3cca6f03cbe82303655cd8e2f35fa96a820f6a | [
"Apache-2.0"
] | 5 | 2019-02-26T05:59:58.000Z | 2020-04-24T15:22:23.000Z | """horast: Human-oriented abstract syntax tree parser and unparser."""
from static_typing import dump
from .parser import parse
from .unparser import unparse
from .ast_validator import AstValidator
__all__ = ['dump', 'parse', 'unparse', 'AstValidator']
| 23.363636 | 70 | 0.766537 |
cc1a7116372c7715b03953fddd43dee12131c66c | 1,512 | py | Python | aMLpy/plot_crossmatch.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 15 | 2019-07-31T07:18:49.000Z | 2021-06-03T23:41:59.000Z | aMLpy/plot_crossmatch.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | null | null | null | aMLpy/plot_crossmatch.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 6 | 2019-08-01T19:33:16.000Z | 2020-08-27T13:01:15.000Z | """
Catalog cross-matching
----------------------
This plots the cross-matched samples between the SDSS imaging data and
the SDSS Stripe 82 standard stars.
"""
# Author: Jake VanderPlas <vanderplas@astro.washington.edu>
# License: BSD
# The figure is an example from astroML: see http://astroML.github.com
import os
im... | 28.528302 | 74 | 0.683201 |
e1e2c6326933eadce337864f1b35664f36257bd0 | 920 | py | Python | django_cropper_image/config.py | aneesh2usman/django_cropper_image | eb36e31979954009a47a77c701b58e842acaa137 | [
"MIT"
] | 19 | 2021-06-13T07:32:57.000Z | 2021-08-01T10:12:23.000Z | django_cropper_image/config.py | aneesh2usman/django_cropper_image | eb36e31979954009a47a77c701b58e842acaa137 | [
"MIT"
] | null | null | null | django_cropper_image/config.py | aneesh2usman/django_cropper_image | eb36e31979954009a47a77c701b58e842acaa137 | [
"MIT"
] | 3 | 2021-06-22T06:04:11.000Z | 2021-07-08T13:07:17.000Z |
from django.conf import settings
class CropperSettings(object):
@property
def default(self):
settings_default ={
'EXCLUDE_CROPPERJS':False,
'CROPPERJS_STATIC_JS':'django_cropper_image/js/cropper.min.js',
'CROPPERJS_STATIC_CSS':'django_cropper_image/css/cropper.min.css',
'CUSTOM_STATIC_JS':'django_crop... | 30.666667 | 94 | 0.768478 |
aafd8c10a1269183922100d79e501520f625c902 | 1,583 | py | Python | Software/Python/grove_i2c_color_sensor/color_sensor_example.py | benmcclelland/GrovePi | 1e48137b6007ffd4ce430e821d2aa744349e362a | [
"MIT"
] | 482 | 2015-01-09T03:06:14.000Z | 2022-03-24T10:05:07.000Z | Software/Python/grove_i2c_color_sensor/color_sensor_example.py | benmcclelland/GrovePi | 1e48137b6007ffd4ce430e821d2aa744349e362a | [
"MIT"
] | 257 | 2015-01-13T14:08:17.000Z | 2022-01-20T08:43:50.000Z | Software/Python/grove_i2c_color_sensor/color_sensor_example.py | benmcclelland/GrovePi | 1e48137b6007ffd4ce430e821d2aa744349e362a | [
"MIT"
] | 510 | 2015-01-27T17:15:44.000Z | 2022-03-29T01:27:13.000Z | import time
import grove_i2c_color_sensor
# Open connection to sensor
color_sensor = grove_i2c_color_sensor.GroveI2CColorSensor()
# Perform continuous integration with predefined duration of 100ms
color_sensor.use_continuous_integration(100)
# Set gain to 16x
color_sensor.set_gain_and_prescaler(16)
# Start integratio... | 32.979167 | 84 | 0.738471 |
bb83136c6388644fd41221d3158faa33acdbd63c | 2,320 | py | Python | tests/nemo_text_processing/test_time.py | agemagician/NeMo | 5839aee402f314aa413b28e9042b1e1cac10a114 | [
"Apache-2.0"
] | null | null | null | tests/nemo_text_processing/test_time.py | agemagician/NeMo | 5839aee402f314aa413b28e9042b1e1cac10a114 | [
"Apache-2.0"
] | null | null | null | tests/nemo_text_processing/test_time.py | agemagician/NeMo | 5839aee402f314aa413b28e9042b1e1cac10a114 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. 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... | 46.4 | 111 | 0.781034 |
bd5591d570af9ebfde3000d80aee1796d7c48b5c | 953 | py | Python | seleniumcrawler/sites/reddit/reddit.py | Goku0858756/selenium-crawler | e49df4c1f40a330af19d90b7c59d49ac1acee86c | [
"MIT"
] | 83 | 2015-10-07T06:34:45.000Z | 2022-03-09T06:26:54.000Z | seleniumcrawler/sites/reddit/reddit.py | corywalker/selenium-crawler | e49df4c1f40a330af19d90b7c59d49ac1acee86c | [
"MIT"
] | null | null | null | seleniumcrawler/sites/reddit/reddit.py | corywalker/selenium-crawler | e49df4c1f40a330af19d90b7c59d49ac1acee86c | [
"MIT"
] | 29 | 2015-12-04T13:08:16.000Z | 2021-07-15T23:15:36.000Z | from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
def get_profile():
# get the Firefox profile object
firefoxProfile = FirefoxProfile()
# Disable CSS
firefoxProfile.set_preference('permissions.default.stylesheet', 2)
# Disable images
firefoxPro... | 28.029412 | 78 | 0.691501 |
69a8fa57d12bfc7eeadde5db251a861075641f69 | 3,503 | py | Python | redkyn-grader/grader/test/test_new.py | redkyn/grader | 51f152bb5c5d9db156e5fcf7d548bc51d40cd7d1 | [
"MIT"
] | 13 | 2016-08-02T20:43:03.000Z | 2021-09-03T04:09:34.000Z | redkyn-grader/grader/test/test_new.py | redkyn/grader | 51f152bb5c5d9db156e5fcf7d548bc51d40cd7d1 | [
"MIT"
] | 29 | 2016-03-06T23:32:50.000Z | 2019-01-27T00:52:47.000Z | redkyn-grader/grader/test/test_new.py | redkyn/grader | 51f152bb5c5d9db156e5fcf7d548bc51d40cd7d1 | [
"MIT"
] | 2 | 2017-01-27T19:17:09.000Z | 2017-02-02T23:25:00.000Z | import os
import pytest
import yaml
from grader.models.gradesheet import GradeSheetError
from grader.models.config import ConfigValidationError
def test_new_without_repo(parse_and_run):
"""Test vanilla assignment initialization
"""
path = parse_and_run(["init", "cpl"])
parse_and_run(["new", "assignme... | 31 | 77 | 0.682843 |
1a392f31a6552f4631d386610b4dfe296ebb217c | 26,798 | py | Python | rtox/fabric/network.py | pycontribs/rtox | d60706f49ce12984a8bfd9689acb2410e6ff6299 | [
"Apache-2.0"
] | 6 | 2018-02-18T14:46:29.000Z | 2021-04-08T11:26:52.000Z | rtox/fabric/network.py | pycontribs/rtox | d60706f49ce12984a8bfd9689acb2410e6ff6299 | [
"Apache-2.0"
] | 15 | 2018-02-18T14:47:07.000Z | 2021-06-25T15:15:08.000Z | rtox/fabric/network.py | pycontribs/rtox | d60706f49ce12984a8bfd9689acb2410e6ff6299 | [
"Apache-2.0"
] | 2 | 2018-07-13T11:48:27.000Z | 2020-06-24T20:49:47.000Z | """
Classes and subroutines dealing with network connections and related topics.
"""
from functools import wraps
import getpass
import os
import re
import time
import six
import socket
import sys
from rtox.fabric.auth import get_password, set_password
from rtox.fabric.utils import handle_prompt_abort, warn
from rtox.... | 37.47972 | 164 | 0.629748 |
5994bdac247aaa6e424214c085111430865d364e | 1,406 | py | Python | plugin_manager.py | Wildream/simple-slack-bot-python | 4ac1832091c5823eb40a2054a6f3ae44a9db8ff1 | [
"MIT"
] | null | null | null | plugin_manager.py | Wildream/simple-slack-bot-python | 4ac1832091c5823eb40a2054a6f3ae44a9db8ff1 | [
"MIT"
] | null | null | null | plugin_manager.py | Wildream/simple-slack-bot-python | 4ac1832091c5823eb40a2054a6f3ae44a9db8ff1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import imp
import re
class PluginManager(object):
def __init__(self):
self.plugins_dir = 'plugins'
self.plugins = {}
def init_plugins(self):
print('Searching for plugins...')
module_paths = glob.glob("{0... | 29.914894 | 73 | 0.532006 |
e6a26d17f55a7dd8b4f4dd3f4706a2621ca1b83b | 24,601 | py | Python | ucloud/services/ucloudstack/schemas/models.py | wangrzneu/ucloud-sdk-python3 | 5115bdb754da8d277f6c1513d0ef9cf9a5fe184d | [
"Apache-2.0"
] | 37 | 2019-06-19T09:41:34.000Z | 2022-02-18T08:06:00.000Z | ucloud/services/ucloudstack/schemas/models.py | wangrzneu/ucloud-sdk-python3 | 5115bdb754da8d277f6c1513d0ef9cf9a5fe184d | [
"Apache-2.0"
] | 90 | 2019-08-09T09:27:33.000Z | 2022-03-30T15:54:55.000Z | ucloud/services/ucloudstack/schemas/models.py | wangrzneu/ucloud-sdk-python3 | 5115bdb754da8d277f6c1513d0ef9cf9a5fe184d | [
"Apache-2.0"
] | 19 | 2019-06-13T02:46:01.000Z | 2021-11-01T07:22:18.000Z | """ Code is generated by ucloud-model, DO NOT EDIT IT. """
from ucloud.core.typesystem import schema, fields
class BindVSInfoSchema(schema.ResponseSchema):
"""BindVSInfo - 证书绑定的vs信息"""
fields = {
"LBID": fields.Str(required=False, load_from="LBID"),
"LBName": fields.Str(required=False, load_... | 43.85205 | 80 | 0.649161 |
1624081fe12775e6430fa6a20048ec3a52c12b1a | 1,142 | py | Python | examples/random_elements_with_probability.py | Worvast/python-utils | 1cb4bf9e73b589b1e543685cb0427f05e1731165 | [
"MIT"
] | 4 | 2019-02-20T16:59:39.000Z | 2020-04-08T02:04:58.000Z | examples/random_elements_with_probability.py | Worvast/python-utils | 1cb4bf9e73b589b1e543685cb0427f05e1731165 | [
"MIT"
] | 29 | 2019-02-22T16:19:25.000Z | 2022-03-31T13:02:14.000Z | examples/random_elements_with_probability.py | Worvast/python-utils | 1cb4bf9e73b589b1e543685cb0427f05e1731165 | [
"MIT"
] | 2 | 2019-02-22T14:32:28.000Z | 2020-03-19T15:46:06.000Z | from devoutils.faker import SyslogFakeGenerator
from collections import OrderedDict
import random
from devo.sender import Sender
def get_choices():
"""Get dict with options and probability of be selected"""
return OrderedDict([("Failed", 0.5),
("Success", 0.2),
... | 30.864865 | 74 | 0.507881 |
f75cbacb34696af5531fc4f834d1d064c8056fe0 | 343 | py | Python | psi/serialize/int.py | delta-mpc/python-psi | 1665de12a713b37abd889268c66de84cddb1bf84 | [
"Apache-2.0"
] | 35 | 2021-05-28T10:03:09.000Z | 2022-03-24T12:08:19.000Z | psi/serialize/int.py | delta-mpc/python-psi | 1665de12a713b37abd889268c66de84cddb1bf84 | [
"Apache-2.0"
] | 9 | 2021-07-15T09:16:34.000Z | 2022-03-31T03:59:16.000Z | psi/serialize/int.py | delta-mpc/python-psi | 1665de12a713b37abd889268c66de84cddb1bf84 | [
"Apache-2.0"
] | 16 | 2021-06-18T02:18:56.000Z | 2022-03-25T02:43:48.000Z | __all__ = ["int_to_bytes", "bytes_to_int"]
def int_to_bytes(value: int):
byte_length = (value.bit_length() + 7) // 8
byte_length = (byte_length + 3) // 4 * 4
byte_length = 4 if byte_length == 0 else byte_length
return value.to_bytes(byte_length, "big")
def bytes_to_int(data: bytes):
return int.f... | 26.384615 | 56 | 0.673469 |
e8bf56587376642b882d2cadbeefb037a69a9258 | 1,077 | bzl | Python | go/go.bzl | dprotaso/rules_docker | 6d9fdf2ca948ba4cfe3da778bb5afae71a3cf8dd | [
"Apache-2.0"
] | null | null | null | go/go.bzl | dprotaso/rules_docker | 6d9fdf2ca948ba4cfe3da778bb5afae71a3cf8dd | [
"Apache-2.0"
] | null | null | null | go/go.bzl | dprotaso/rules_docker | 6d9fdf2ca948ba4cfe3da778bb5afae71a3cf8dd | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel 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 la... | 41.423077 | 88 | 0.753946 |
142a36e6df94b14e3543795d670f5c51b98336dc | 1,110 | py | Python | Recommendation/basiclib.py | city292/DeepLearningBook | 778add16d7e515d4fdbc5902e3931395e51585c8 | [
"MIT"
] | null | null | null | Recommendation/basiclib.py | city292/DeepLearningBook | 778add16d7e515d4fdbc5902e3931395e51585c8 | [
"MIT"
] | null | null | null | Recommendation/basiclib.py | city292/DeepLearningBook | 778add16d7e515d4fdbc5902e3931395e51585c8 | [
"MIT"
] | null | null | null | # coding: utf-8
#
# basiclib.py
#
# Author: Huang Anbu
# Date: 2017.3
#
# Description: Basic Configuration and Interface
#
# options: hyper-parameter setting
#
# optimizer: optimization algorithm
#
# Copyright©2017. All Rights Reserved.
# ===============================================================================... | 20.943396 | 97 | 0.669369 |
a3995f6e8dd4cc5e754f58c79e12b4b95ca338e6 | 1,743 | py | Python | some_completed_notebooks/energy_levels_not_commented/hamiltonian.py | Quantum-Computing-Cooperation/Quantum_Hackathon_2021 | 69bb50ebd93cbc2bdca59de360408a5a2ecd6f2e | [
"Apache-2.0"
] | 4 | 2021-11-17T19:42:15.000Z | 2022-03-05T18:36:59.000Z | some_completed_notebooks/energy_levels_not_commented/hamiltonian.py | Quantum-Computing-Cooperation/Quantum_Hackathon_2021 | 69bb50ebd93cbc2bdca59de360408a5a2ecd6f2e | [
"Apache-2.0"
] | null | null | null | some_completed_notebooks/energy_levels_not_commented/hamiltonian.py | Quantum-Computing-Cooperation/Quantum_Hackathon_2021 | 69bb50ebd93cbc2bdca59de360408a5a2ecd6f2e | [
"Apache-2.0"
] | 6 | 2021-11-19T18:37:07.000Z | 2021-11-20T22:26:17.000Z | import numpy as np
from qiskit.quantum_info import Pauli
from qiskit.opflow import PauliOp, SummedOp
def generate_pauli(idx_x,idx_z,n):
xmask = [0] * n
zmask = [0] * n
for i in idx_x: xmask[i] = 1
for i in idx_z: zmask[i] = 1
a_x = np.asarray(xmask, dtype=bool)
a_z = np.asarray(zmask, dtype=... | 37.891304 | 86 | 0.619048 |
68b321279218e6c6c5192f66477e08d0aded5abc | 1,529 | py | Python | list1/task3/agent.py | ErykKrupa/metaheuristic-algorithms | cdeb283b4bb052328fd1d06e0da398a2932a7602 | [
"MIT"
] | null | null | null | list1/task3/agent.py | ErykKrupa/metaheuristic-algorithms | cdeb283b4bb052328fd1d06e0da398a2932a7602 | [
"MIT"
] | null | null | null | list1/task3/agent.py | ErykKrupa/metaheuristic-algorithms | cdeb283b4bb052328fd1d06e0da398a2932a7602 | [
"MIT"
] | null | null | null | import numpy as np
EMPTY = 0
WALL = 1
AGENT = 5
EXIT = 8
class Agent:
def __init__(self, board):
agent_position = np.where(board == AGENT)
self.board = board.copy()
self.current_position = [int(agent_position[0]), int(agent_position[1])]
def look(self, directory):
return self... | 29.980392 | 101 | 0.59189 |
4f4cc4e0819148bfa4f8821a8b74a66a3740ff31 | 910 | py | Python | 06.7_bst_mirror.py | EashanKaushik/Data-Structures | e5bd391e029cb47e650d5665647ff57590b9b343 | [
"MIT"
] | null | null | null | 06.7_bst_mirror.py | EashanKaushik/Data-Structures | e5bd391e029cb47e650d5665647ff57590b9b343 | [
"MIT"
] | null | null | null | 06.7_bst_mirror.py | EashanKaushik/Data-Structures | e5bd391e029cb47e650d5665647ff57590b9b343 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data=None, left=None, right=None):
self._left = left
self._data = data
self._right = right
@property
def left(self):
return self._left
@left.setter
def left(self, left):
self._left = left
@property
def right(self):
return self._right
@right.setter
def right(self, ... | 16.545455 | 54 | 0.68022 |
87077970b374e46bc22e2caa861cb145cc70d048 | 6,605 | py | Python | enos/sample/SampleHelper.py | charleshuangcai/enos-device-sdk-python | bbbb31f4da7c4c4e6f457565faf0fb5cf15bb308 | [
"MIT"
] | 5 | 2020-05-09T09:21:22.000Z | 2021-05-31T02:42:56.000Z | enos/sample/SampleHelper.py | charleshuangcai/enos-device-sdk-python | bbbb31f4da7c4c4e6f457565faf0fb5cf15bb308 | [
"MIT"
] | 4 | 2020-04-18T03:28:09.000Z | 2021-05-28T09:41:05.000Z | enos/sample/SampleHelper.py | charleshuangcai/enos-device-sdk-python | bbbb31f4da7c4c4e6f457565faf0fb5cf15bb308 | [
"MIT"
] | 7 | 2020-01-19T07:58:28.000Z | 2021-12-22T06:53:43.000Z | import locale
from enos.core.MqttClient import MqttClient
from enos.core.constant.DeviceCredential import DeviceCredential
from enos.core.login.DynamicActivationLogin import DynamicActivationLogin
from enos.core.login.MessageIntegrationLogin import MessageIntegrationLogin
from enos.core.login.NormalDeviceLogin import N... | 42.339744 | 113 | 0.77835 |
706a751f7747ce19d0f0ab0e4870bea11f0f2794 | 6,188 | py | Python | other_implementations/CN-CRYPTONUMERICS/protect/privacy.py | lucaghislo/thesis_work | 95b45147c7c8294b32c2a12a50e83364b093029d | [
"MIT"
] | null | null | null | other_implementations/CN-CRYPTONUMERICS/protect/privacy.py | lucaghislo/thesis_work | 95b45147c7c8294b32c2a12a50e83364b093029d | [
"MIT"
] | null | null | null | other_implementations/CN-CRYPTONUMERICS/protect/privacy.py | lucaghislo/thesis_work | 95b45147c7c8294b32c2a12a50e83364b093029d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding=utf8
from abc import ABC, abstractmethod
from enum import Enum, auto
__all__ = ['KAnonymity']
class PrivacyModel(ABC):
def _get_config(self):
return {
'privacyModelType': self._model_name,
'params': self._get_params()
}
@abstractm... | 26.444444 | 80 | 0.573206 |
b6587e1f3643a1b0946f7404dc1294c49cbb8f68 | 2,919 | py | Python | src/utils.py | BUCS640/Combined-CNN-RNN-for-emotion-recognition | fc9f7a79b4d6901319c63005f11b7dae36cac2f5 | [
"MIT"
] | 32 | 2020-06-23T10:13:38.000Z | 2022-03-27T07:04:09.000Z | src/utils.py | BUCS640/Combined-CNN-RNN-for-emotion-recognition | fc9f7a79b4d6901319c63005f11b7dae36cac2f5 | [
"MIT"
] | 1 | 2021-07-15T07:45:18.000Z | 2021-07-19T08:12:05.000Z | src/utils.py | BUCS640/Combined-CNN-RNN-for-emotion-recognition | fc9f7a79b4d6901319c63005f11b7dae36cac2f5 | [
"MIT"
] | 13 | 2020-08-04T05:02:54.000Z | 2022-03-27T06:38:01.000Z | import os
import cv2
import pandas as pd
from src.config import PROCESSED_FRAMES_DATA_DIR, RAW_VIDEO_DATA_DIR
from src.data import DataSet
class VideoHelper():
"""
Get meta-information from videos. Private methods are used only locally because we don't save videos on the server
"""
def __init__(self... | 36.4875 | 118 | 0.690647 |
fe54b0ae74778148222499cfd8d3f1bf296b5f8d | 5,479 | py | Python | flask_unchained/bundles/api/extensions/marshmallow.py | briancappello/flask-unchained | bff296b5c808f5b1db10f7dddb81054600545749 | [
"MIT"
] | 69 | 2018-10-10T01:59:11.000Z | 2022-03-29T17:29:30.000Z | flask_unchained/bundles/api/extensions/marshmallow.py | briancappello/flask-unchained | bff296b5c808f5b1db10f7dddb81054600545749 | [
"MIT"
] | 18 | 2018-11-17T12:42:02.000Z | 2021-05-22T18:45:27.000Z | flask_unchained/bundles/api/extensions/marshmallow.py | briancappello/flask-unchained | bff296b5c808f5b1db10f7dddb81054600545749 | [
"MIT"
] | 7 | 2018-10-12T16:20:25.000Z | 2021-10-06T12:18:21.000Z | import marshmallow as ma
import flask_marshmallow as flask_ma
from flask_marshmallow.sqla import HyperlinkRelated
from flask_unchained import FlaskUnchained
from ..model_serializer import ModelSerializer
class Marshmallow:
"""
The `Marshmallow` extension::
from flask_unchained.bundles.api import ma... | 31.854651 | 84 | 0.655047 |
ce4e17f9bfcd8f65763315b3ccb4429f66e35a11 | 301 | py | Python | app/views.py | GrishonNganga/Elevator-Pitch | ae18886cae72b60f2d1069ec40f64d65cfb85905 | [
"MIT"
] | null | null | null | app/views.py | GrishonNganga/Elevator-Pitch | ae18886cae72b60f2d1069ec40f64d65cfb85905 | [
"MIT"
] | null | null | null | app/views.py | GrishonNganga/Elevator-Pitch | ae18886cae72b60f2d1069ec40f64d65cfb85905 | [
"MIT"
] | 1 | 2020-12-09T15:39:11.000Z | 2020-12-09T15:39:11.000Z | from flask import Blueprint
from flask import render_template
from flask_login import current_user
app = Blueprint('app', __name__)
@app.context_processor
def inject_user():
return dict(user=current_user)
@app.route('/')
def home():
return render_template('home.html', user = current_user)
| 21.5 | 60 | 0.76412 |
11b23d03ba615edaff8766c884d940bf485961d6 | 255,083 | py | Python | tests/admin_views/tests.py | allanice001/django | aac75fa30af22965f993c6dd8da8cd9882ba2f21 | [
"BSD-3-Clause"
] | null | null | null | tests/admin_views/tests.py | allanice001/django | aac75fa30af22965f993c6dd8da8cd9882ba2f21 | [
"BSD-3-Clause"
] | 1 | 2021-03-24T12:21:05.000Z | 2021-03-24T12:31:52.000Z | tests/admin_views/tests.py | allanice001/django | aac75fa30af22965f993c6dd8da8cd9882ba2f21 | [
"BSD-3-Clause"
] | 2 | 2021-03-24T12:11:48.000Z | 2021-06-10T19:56:03.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import re
import unittest
from django.contrib.admin import ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import DELETION, LogEntry
from django.contrib.admin.options imp... | 45.88649 | 251 | 0.652729 |
8f72eeb07698a2cf82c13a76f71f869cf076bee1 | 3,341 | py | Python | tests/basics/Classes32.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | 1 | 2022-01-01T18:29:24.000Z | 2022-01-01T18:29:24.000Z | tests/basics/Classes32.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | 1 | 2021-06-10T06:47:04.000Z | 2021-06-10T06:47:04.000Z | tests/basics/Classes32.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 22.574324 | 79 | 0.599222 |
8eb7fbd1aaaac87fce0f9b823dd8f83f5a40cdbd | 5,706 | py | Python | gremlin-python/src/main/jython/gremlin_python/process/strategies.py | dylanht/tinkerpop | 1d11b81681b1e9b5499ea9dc3590109a1e5a1569 | [
"Apache-2.0"
] | null | null | null | gremlin-python/src/main/jython/gremlin_python/process/strategies.py | dylanht/tinkerpop | 1d11b81681b1e9b5499ea9dc3590109a1e5a1569 | [
"Apache-2.0"
] | null | null | null | gremlin-python/src/main/jython/gremlin_python/process/strategies.py | dylanht/tinkerpop | 1d11b81681b1e9b5499ea9dc3590109a1e5a1569 | [
"Apache-2.0"
] | null | null | null | '''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 31.01087 | 117 | 0.706449 |
1a107ac62864645ae3d2222a62cace5f3bf68202 | 2,814 | py | Python | src/models/anna.py | HhotateA/quiche_pantie_patch | f50c4fd69bd43cccaeb38f026d486e3ccc3850d8 | [
"CC-BY-4.0"
] | 73 | 2019-01-26T02:57:24.000Z | 2022-02-15T08:45:11.000Z | src/models/anna.py | HhotateA/quiche_pantie_patch | f50c4fd69bd43cccaeb38f026d486e3ccc3850d8 | [
"CC-BY-4.0"
] | 9 | 2019-04-09T10:53:41.000Z | 2020-09-11T13:18:26.000Z | src/models/anna.py | HhotateA/quiche_pantie_patch | f50c4fd69bd43cccaeb38f026d486e3ccc3850d8 | [
"CC-BY-4.0"
] | 15 | 2019-04-07T11:28:57.000Z | 2022-03-29T04:35:48.000Z | import skimage.io as io
import skimage.transform as skt
import numpy as np
from PIL import Image
from src.models.class_patcher import patcher
from src.utils.imgproc import *
class patcher(patcher):
def __init__(self, body='./body/body_anna.png', **options):
super().__init__(name='吸血鬼アンナ', body=body, panti... | 40.2 | 137 | 0.585999 |
78c2a619dc79b8e0ef2ae227143c5ca8e8caa96e | 8,429 | py | Python | line-by-line.py | hkmoon/Line-by-line | a50714ccb3bc679ab417f4219e5717108f31cda4 | [
"MIT"
] | null | null | null | line-by-line.py | hkmoon/Line-by-line | a50714ccb3bc679ab417f4219e5717108f31cda4 | [
"MIT"
] | null | null | null | line-by-line.py | hkmoon/Line-by-line | a50714ccb3bc679ab417f4219e5717108f31cda4 | [
"MIT"
] | null | null | null | import sublime
import sublime_plugin
import os
import subprocess
import re
settingsfile = 'line-by-line.sublime-settings'
# escape double quote
def escape_dq(string):
string = string.replace('\\', '\\\\')
string = string.replace('"', '\\"')
return string
# clean command before sending to Terminal
def cle... | 37.798206 | 250 | 0.490331 |
a336f68b7be6e30606f1cd6ffe5898633f85b910 | 576 | py | Python | findPermsRecursive.py | akakream/crackingInterviews | decc4a85e5bfae996aa73eaa45a640eb6d80e24f | [
"MIT"
] | null | null | null | findPermsRecursive.py | akakream/crackingInterviews | decc4a85e5bfae996aa73eaa45a640eb6d80e24f | [
"MIT"
] | null | null | null | findPermsRecursive.py | akakream/crackingInterviews | decc4a85e5bfae996aa73eaa45a640eb6d80e24f | [
"MIT"
] | null | null | null | test1 = 'abcd'
def findPerms(string):
if len(string) == 1:
return list(string)
s1 = string[:-1]
returned = findPerms(s1)
s2 = string[-1]
willreturned = []
for el in returned:
for index in range(len(el)+1):
will_inserted = list(el)
will_inser... | 19.2 | 57 | 0.590278 |
ad83a03f0f93292c6acbc16c6b236a2bcc0b05cc | 425 | py | Python | systemcheck/systems/__init__.py | team-fasel/SystemCheck | cdc18ee0c8bab67f049228d28d03578babfafb3d | [
"MIT"
] | 2 | 2017-07-07T13:57:52.000Z | 2020-12-11T12:40:55.000Z | systemcheck/systems/__init__.py | team-fasel/systemcheck | cdc18ee0c8bab67f049228d28d03578babfafb3d | [
"MIT"
] | 1 | 2017-02-23T19:30:12.000Z | 2017-02-28T19:15:44.000Z | systemcheck/systems/__init__.py | team-fasel/systemcheck | cdc18ee0c8bab67f049228d28d03578babfafb3d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" System Specific Components of the systemcheck Application
Each system type will have a dedicated folder that contains the system specific functions.
"""
# define authorship information
__authors__ = ['Lars Fasel']
__author__ = ','.join(__authors__)
__credits__ = []
__copyr... | 21.25 | 90 | 0.701176 |
af4b03099e495ced9fe312ca0d2c0b0c05288c61 | 32,216 | py | Python | line.py | mhhm2005eg/CarND-Advanced-Lane-Lines | 1f571e4714df0dcca21fbf2b09b5af73caddb8f4 | [
"MIT"
] | null | null | null | line.py | mhhm2005eg/CarND-Advanced-Lane-Lines | 1f571e4714df0dcca21fbf2b09b5af73caddb8f4 | [
"MIT"
] | null | null | null | line.py | mhhm2005eg/CarND-Advanced-Lane-Lines | 1f571e4714df0dcca21fbf2b09b5af73caddb8f4 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import matplotlib
#matplotlib.use('Agg') # None interactive backend
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
from matplotlib import cm
import matplotlib.pyplot as plt
import matplotlib as mpl
import math
from common import DEBUG, draw_points, draw_sub_plot... | 44.010929 | 159 | 0.604544 |
df6e2c004d5ce86908ac2fc9d1fa6a525944c0ff | 8,016 | py | Python | Scweet/scweet.py | pydxflwb/Scweet | 4d6892edf3b76ff9ec50cda5ee570b80b064b46a | [
"MIT"
] | null | null | null | Scweet/scweet.py | pydxflwb/Scweet | 4d6892edf3b76ff9ec50cda5ee570b80b064b46a | [
"MIT"
] | null | null | null | Scweet/scweet.py | pydxflwb/Scweet | 4d6892edf3b76ff9ec50cda5ee570b80b064b46a | [
"MIT"
] | null | null | null | import csv
import os
import datetime
import argparse
import pandas as pd
from utils import init_driver, get_last_date_from_csv, log_search_page, keep_scroling, dowload_images
# class Scweet():
def scrap(start_date, max_date, words=None, to_account=None, from_account=None, interval=5, lang=None,
headless=Tr... | 45.288136 | 143 | 0.5998 |
6574126d051a5bc633c98cb61ab9b8c66e26089c | 7,063 | py | Python | displayAndPrompt.py | BradLyman/MafiaGame | c6f14a303b126886e8593ed91d034650cb7d82b0 | [
"MIT"
] | null | null | null | displayAndPrompt.py | BradLyman/MafiaGame | c6f14a303b126886e8593ed91d034650cb7d82b0 | [
"MIT"
] | null | null | null | displayAndPrompt.py | BradLyman/MafiaGame | c6f14a303b126886e8593ed91d034650cb7d82b0 | [
"MIT"
] | null | null | null | from checkState import *
from Player import *
from Action import *
from random import shuffle
availableRoles = [Citizen, Mafian]
### GENERIC PROMPTS ###
# Return True or False, based on input of "y" or "n".
def getYesOrNo(message):
while True:
response = input(message)
if response == 'y':
return True
eli... | 31.815315 | 126 | 0.702251 |
7cd01f517a7304fa0a8c9caab5b9c1caa904db3a | 133 | py | Python | tests/view_tests/templatetags/debugtags.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/view_tests/templatetags/debugtags.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/view_tests/templatetags/debugtags.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from django import template
register = template.Library()
@register.simple_tag
def go_boom():
raise Exception('boom')
| 14.777778 | 30 | 0.699248 |
ad7f70c31b6ba5d6b612979d8dc2d085e35eef55 | 1,378 | py | Python | tests/test_registry.py | bhgomes/oeis | 27555acdcdeec936431789c052ea097b1aa19d69 | [
"Unlicense"
] | 6 | 2019-03-29T05:01:35.000Z | 2021-12-21T08:13:38.000Z | tests/test_registry.py | bhgomes/oeis | 27555acdcdeec936431789c052ea097b1aa19d69 | [
"Unlicense"
] | 4 | 2019-04-05T08:45:23.000Z | 2019-04-15T06:48:40.000Z | tests/test_registry.py | bhgomes/oeis | 27555acdcdeec936431789c052ea097b1aa19d69 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*- #
#
# tests/test_registry.py
#
#
# MIT License
#
# Copyright (c) 2019 Brandon Gomes
#
# 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 wi... | 30.622222 | 80 | 0.714804 |
a44e8df964bb28cf15294cf513db0a2fc9f59d23 | 31,459 | py | Python | autoprotocol/container.py | kevin-ss-kim/autoprotocol-python | f55818e31b5c49bc093291f3ecc452f2b061e0a9 | [
"BSD-3-Clause"
] | null | null | null | autoprotocol/container.py | kevin-ss-kim/autoprotocol-python | f55818e31b5c49bc093291f3ecc452f2b061e0a9 | [
"BSD-3-Clause"
] | null | null | null | autoprotocol/container.py | kevin-ss-kim/autoprotocol-python | f55818e31b5c49bc093291f3ecc452f2b061e0a9 | [
"BSD-3-Clause"
] | null | null | null | """
Container, Well, WellGroup objects and associated functions
:copyright: 2020 by The Autoprotocol Development Team, see AUTHORS
for more details.
:license: BSD, see LICENSE for more details
"""
import json
import warnings
from .constants import SBS_FORMAT_SHAPES
from .unit import Unit
SEAL_TYPES... | 29.318733 | 80 | 0.539909 |
c45b3beaa25f1c783fae4e0d022528bdb94bb53d | 3,597 | py | Python | course_getter/middlewares.py | chtmp223/course-search | 5c7e28edb8281be8c20f73ab2a7a6336dee90aa7 | [
"MIT"
] | null | null | null | course_getter/middlewares.py | chtmp223/course-search | 5c7e28edb8281be8c20f73ab2a7a6336dee90aa7 | [
"MIT"
] | 1 | 2022-03-02T15:02:38.000Z | 2022-03-02T15:02:38.000Z | course_getter/middlewares.py | chtmp223/course-search | 5c7e28edb8281be8c20f73ab2a7a6336dee90aa7 | [
"MIT"
] | null | null | null | # !/usr/bin/python
# -*- coding: utf-8 -*-
# Created on 2020-03-22
# Class: Course Getter Spider Middleware
# Comment: Define the model for spider middleware
from scrapy import signals
class CourseGetterSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts... | 34.586538 | 78 | 0.666111 |
785853728edc164b4b6d422a318e431019054f53 | 451 | py | Python | frontier/info/migrations/0018_auto_20180125_1933.py | mcmaxwell/frontier | d1f59154108566c652965a43c4b999de33c05c58 | [
"MIT"
] | null | null | null | frontier/info/migrations/0018_auto_20180125_1933.py | mcmaxwell/frontier | d1f59154108566c652965a43c4b999de33c05c58 | [
"MIT"
] | null | null | null | frontier/info/migrations/0018_auto_20180125_1933.py | mcmaxwell/frontier | d1f59154108566c652965a43c4b999de33c05c58 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2018-01-25 19:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('info', '0017_auto_20180125_1923'),
]
operations = [
migrations.AlterField(
... | 21.47619 | 50 | 0.611973 |
ffad8163470873de0b6dd783eeacbbb14a82ea5f | 27,046 | py | Python | autotest/gdrivers/mrf.py | Esri/gdal | 8d9af5086ddb96f707ed281786a1cd278066a7f2 | [
"MIT"
] | 9 | 2019-05-30T17:01:56.000Z | 2021-01-30T01:06:41.000Z | autotest/gdrivers/mrf.py | Esri/gdal | 8d9af5086ddb96f707ed281786a1cd278066a7f2 | [
"MIT"
] | 4 | 2018-10-23T18:43:35.000Z | 2019-07-01T19:29:49.000Z | autotest/gdrivers/mrf.py | Esri/gdal | 8d9af5086ddb96f707ed281786a1cd278066a7f2 | [
"MIT"
] | 6 | 2019-02-03T14:19:32.000Z | 2021-12-19T06:36:49.000Z | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read/write functionality for MRF driver.
# Author: Even Rouault, <even.rouault at spatialys.com>
#
###########################################################... | 33.681196 | 654 | 0.599423 |
f21dc15c750fae3790acf4bb4eeb7c48cd795e8e | 5,017 | py | Python | exot/channel/_base.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | exot/channel/_base.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | exot/channel/_base.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright... | 36.355072 | 93 | 0.669723 |
208c63f6f2b2cca07c6147b7b4800e2208e64d2b | 1,335 | py | Python | ie/pe.py | nicolasmota/pyIE | 9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb | [
"MIT"
] | null | null | null | ie/pe.py | nicolasmota/pyIE | 9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb | [
"MIT"
] | null | null | null | ie/pe.py | nicolasmota/pyIE | 9e942dd692d0eab8a1e7717ad7ff3fe90d590ffb | [
"MIT"
] | null | null | null | # *-* coding:utf-8 *-*
"""Module states Pernanbuco"""
def start(st_reg_number):
"""Checks the number valiaty for the Pernanbuco state"""
divisor = 11
if len(st_reg_number) > 9:
return False
if len(st_reg_number) < 9:
return False
sum_total = 0
peso = 8
for i in range(len... | 23.017241 | 124 | 0.601498 |
6376557343f86e1d9c15a874dceea437e1016376 | 4,377 | py | Python | Helper/tap_executor.py | EVOLVED-5G/ELCM | 07d07a114b667e8c6915ee3ef125dd4864dd2247 | [
"Apache-2.0"
] | null | null | null | Helper/tap_executor.py | EVOLVED-5G/ELCM | 07d07a114b667e8c6915ee3ef125dd4864dd2247 | [
"Apache-2.0"
] | null | null | null | Helper/tap_executor.py | EVOLVED-5G/ELCM | 07d07a114b667e8c6915ee3ef125dd4864dd2247 | [
"Apache-2.0"
] | null | null | null | import subprocess
import psutil
import re
from Helper import Level
from Settings import Config, TapConfig
from typing import Dict, Optional, Callable
from time import sleep
class Tap:
initialized = False
tapConfig: TapConfig = None
closingRegex = None
@classmethod
def Initialize(cls):
cls... | 34.738095 | 102 | 0.587617 |
44735e4d81cdc90254897537f132e74ab8c9ba1c | 163 | py | Python | PoseEstimation/Script/Preprocessing/MotionBVH/PreproScript/__init__.py | AtsushiHashimoto/KinectOnTheCeiling | 116448e706da8b4e87e5402310747f46821beb4a | [
"MIT"
] | null | null | null | PoseEstimation/Script/Preprocessing/MotionBVH/PreproScript/__init__.py | AtsushiHashimoto/KinectOnTheCeiling | 116448e706da8b4e87e5402310747f46821beb4a | [
"MIT"
] | null | null | null | PoseEstimation/Script/Preprocessing/MotionBVH/PreproScript/__init__.py | AtsushiHashimoto/KinectOnTheCeiling | 116448e706da8b4e87e5402310747f46821beb4a | [
"MIT"
] | null | null | null |
from .bvh2wc import make_wc
from .normalize_bvh import normalize_bvh
from .reduce_bvh import reduce_bvh
__all__ = ["make_convert", "normalize_bvh", "reduce_bvh"] | 27.166667 | 57 | 0.803681 |
9874d8fe072575b9de82413c0e4e2c91d076174d | 1,702 | py | Python | setup.py | frague59/django-yamlfield | c7eb6f313ffcb6d5128b4b5069a2d7fa5e9f865d | [
"MIT"
] | null | null | null | setup.py | frague59/django-yamlfield | c7eb6f313ffcb6d5128b4b5069a2d7fa5e9f865d | [
"MIT"
] | null | null | null | setup.py | frague59/django-yamlfield | c7eb6f313ffcb6d5128b4b5069a2d7fa5e9f865d | [
"MIT"
] | 2 | 2020-01-31T20:18:37.000Z | 2020-06-07T03:02:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from distutils.core import Command
class TestCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
from django.conf impo... | 27.451613 | 64 | 0.568743 |
12769af402a8dd3ee42e119166728eb08b7cadda | 2,226 | py | Python | data/cirq_new/cirq_program/startCirq_noisy621.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_noisy621.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_noisy621.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=19
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Ci... | 32.735294 | 77 | 0.688679 |
9c22b5f7fe43753d8468a4da38fe90d37d306be1 | 10,591 | py | Python | tools/gen-magic-strings.py | zhanzr/jerryscript | 130288749884afe853caeddee129c031a17c5ac7 | [
"Apache-2.0"
] | 1,144 | 2018-12-18T09:46:47.000Z | 2022-03-07T14:51:46.000Z | tools/gen-magic-strings.py | zhanzr/jerryscript | 130288749884afe853caeddee129c031a17c5ac7 | [
"Apache-2.0"
] | 281 | 2018-02-13T18:50:54.000Z | 2019-01-26T06:17:56.000Z | tools/gen-magic-strings.py | zhanzr/jerryscript | 130288749884afe853caeddee129c031a17c5ac7 | [
"Apache-2.0"
] | 129 | 2018-12-18T09:46:50.000Z | 2022-03-30T07:30:13.000Z | #!/usr/bin/env python
# Copyright JS Foundation and other contributors, http://js.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.... | 36.52069 | 95 | 0.612879 |
9166c463a5a09c4e4db758f9a5b23734cf446ea5 | 2,194 | py | Python | netbox/extras/webhooks.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | null | null | null | netbox/extras/webhooks.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | null | null | null | netbox/extras/webhooks.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | null | null | null | import hashlib
import hmac
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
from django_rq import get_queue
from utilities.api import get_serializer_for_model
from .choices import *
from .models import Webhook
from .registry import registry
def generate_signature(request_... | 32.746269 | 97 | 0.674111 |
cd302faef649da130a32c345862657d50462e98c | 1,186 | py | Python | Test/getSystemVisitCode.py | sulantha2006/Processing_Pipeline | fb135560b7db79d811177cf02ee96e6081ce3364 | [
"Apache-2.0"
] | 1 | 2015-08-11T17:39:26.000Z | 2015-08-11T17:39:26.000Z | Test/getSystemVisitCode.py | sulantha2006/Processing_Pipeline | fb135560b7db79d811177cf02ee96e6081ce3364 | [
"Apache-2.0"
] | null | null | null | Test/getSystemVisitCode.py | sulantha2006/Processing_Pipeline | fb135560b7db79d811177cf02ee96e6081ce3364 | [
"Apache-2.0"
] | 2 | 2015-11-13T18:05:48.000Z | 2020-01-17T17:28:08.000Z | __author__ = 'sulantha'
import datetime
from Utils.DbUtils import DbUtils
csvFile = '/data/data03/sulantha/Downloads/av45_list.csv'
MatchDBClient = DbUtils(database='Study_Data.ADNI')
DBClient = DbUtils()
with open(csvFile, 'r') as csv:
next(csv)
for line in csv:
row = line.split(',')
rid = row[... | 39.533333 | 185 | 0.602867 |
3e944a7dbf85b36eb6232aa0c346f40beb6488f8 | 1,291 | py | Python | Curso_Em_Video_Python/ex056.py | ThallesTorres/Curso_Em_Video_Python | 95ffbff5a03f11fee41df746604dfe435f385a3b | [
"MIT"
] | null | null | null | Curso_Em_Video_Python/ex056.py | ThallesTorres/Curso_Em_Video_Python | 95ffbff5a03f11fee41df746604dfe435f385a3b | [
"MIT"
] | null | null | null | Curso_Em_Video_Python/ex056.py | ThallesTorres/Curso_Em_Video_Python | 95ffbff5a03f11fee41df746604dfe435f385a3b | [
"MIT"
] | null | null | null | # Ex: 056 - Desenvolva um programa que leia o nome, idade e sexo de 4 pessoas.
# No final do programa, mostre: A média de idade do grupo; Qual é o nome do
# homem mais velho; Quantas mulheres têm menos de 20 anos.
print('''
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--Seja bem-vindo!
--Exercício 056
-=-=-=-=-=-=-=-=... | 28.688889 | 79 | 0.538342 |
3e7b523637a1ba659b9a7ec725858b6521d5017b | 4,047 | py | Python | scripts/tests/make_echolib_api.py | diregoblin/muscle3 | 33761235eebd31984bb470161f259437dba73627 | [
"Apache-2.0"
] | null | null | null | scripts/tests/make_echolib_api.py | diregoblin/muscle3 | 33761235eebd31984bb470161f259437dba73627 | [
"Apache-2.0"
] | null | null | null | scripts/tests/make_echolib_api.py | diregoblin/muscle3 | 33761235eebd31984bb470161f259437dba73627 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import api_generator
from api_generator import (
API, Bool, Bytes, Class, Constructor, Destructor, Double, Enum,
EnumVal, Int, Int64t, MemFun, MemFunTmpl, Namespace, Obj, OverloadSet,
String, T, VecDbl, Vec2Dbl, Void)
color_desc = Enum('Color', [('RED'... | 40.069307 | 78 | 0.527798 |
a219f6da4f5c59dccb81d5b4f910a4b98b6e8463 | 29,704 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 ... | 48.299187 | 191 | 0.657386 |
8834332fd55b3e949eb969e6302ec0a51c490cac | 452 | py | Python | notebooks/cnn_tester.py | MichoelSnow/data_science | 7f6c054624268308ec4126a601c9fa8bc5de157c | [
"MIT"
] | null | null | null | notebooks/cnn_tester.py | MichoelSnow/data_science | 7f6c054624268308ec4126a601c9fa8bc5de157c | [
"MIT"
] | 8 | 2020-03-24T15:29:05.000Z | 2022-02-10T00:14:06.000Z | notebooks/cnn_tester.py | MichoelSnow/data_science | 7f6c054624268308ec4126a601c9fa8bc5de157c | [
"MIT"
] | null | null | null | from fastai.groups.default_cnn import *
PATH = '/data/msnow/nih_cxr/'
arch = resnet34
sz = 64
bs = 64
# data = get_data(sz,bs)
# learn = ConvLearner.pretrained(arch, data)
# def get_data(sz, bs):
# tfms = tfms_from_model(arch, sz, aug_tfms=transforms_basic, max_zoom=1.05)
# return ImageClassifierData.from_c... | 30.133333 | 88 | 0.676991 |
1c13afafb5256f28cd44050a05cff996f20c0f8f | 2,458 | py | Python | sdk/python/pulumi_azure_native/containerregistry/v20190401/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/containerregistry/v20190401/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/containerregistry/v20190401/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'Architecture',
'BaseImageTriggerType',
'OS',
'ResourceIdentityType',
'SecretObjectType',
'S... | 20.31405 | 118 | 0.631408 |
9e2585d54d10eb09a30f4f0ba788101a27d886aa | 937 | py | Python | octavia-cli/octavia_cli/apply/yaml_loaders.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 1 | 2022-03-29T01:08:58.000Z | 2022-03-29T01:08:58.000Z | octavia-cli/octavia_cli/apply/yaml_loaders.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 5 | 2022-02-22T14:49:48.000Z | 2022-03-19T10:43:08.000Z | octavia-cli/octavia_cli/apply/yaml_loaders.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 1 | 2022-03-11T06:21:24.000Z | 2022-03-11T06:21:24.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import os
import re
from typing import Any
import yaml
ENV_VAR_MATCHER_PATTERN = re.compile(r".*\$\{([^}^{]+)\}.*")
def env_var_replacer(loader: yaml.Loader, node: yaml.Node) -> Any:
"""Convert a YAML node to a Python object, expanding variable.
... | 26.027778 | 104 | 0.729989 |
0c8cf962db429406b999ef073977feb88a082f1f | 1,153 | py | Python | pySUMMA/plot.py | ahsen1402/pySUMMA | 3412e1282bc2cc9b9076f38bf64ef1674d69d770 | [
"Apache-2.0"
] | 1 | 2020-01-11T19:56:05.000Z | 2020-01-11T19:56:05.000Z | pySUMMA/plot.py | learn-ensemble/PY-SUMMA | 1b82237be5dc33af57b5c2e2c16aee4d568ddb77 | [
"Apache-2.0"
] | null | null | null | pySUMMA/plot.py | learn-ensemble/PY-SUMMA | 1b82237be5dc33af57b5c2e2c16aee4d568ddb77 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
def performance(x, y, ens, metric='AUC', savename=None):
"""Plot the performance of base classifiers and ensembles.
Plot the true vs. the inferred performance of each base classifier. Along
the y-axis plot the performance of each inputted ensemble.
Args:
x : (M... | 32.942857 | 77 | 0.61752 |
480001cddef662e569e41d6f07ee8c4539423e62 | 3,137 | py | Python | pyleecan/GUI/Dialog/DMachineSetup/SWPole/PWSlot60/Gen_PWSlot60.py | helene-t/pyleecan | 8362de9b0e32b346051b38192e07f3a6974ea9aa | [
"Apache-2.0"
] | 1 | 2021-02-26T12:28:45.000Z | 2021-02-26T12:28:45.000Z | GUI/Dialog/DMachineSetup/SWPole/PWSlot60/Gen_PWSlot60.py | magnetron/pyleecan | 2a3338f4ab080ad6488b5ab8746c3fea1f36f177 | [
"Apache-2.0"
] | null | null | null | GUI/Dialog/DMachineSetup/SWPole/PWSlot60/Gen_PWSlot60.py | magnetron/pyleecan | 2a3338f4ab080ad6488b5ab8746c3fea1f36f177 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""File generated according to PWSlot60/gen_list.json
WARNING! All changes made in this file will be lost!
"""
from pyleecan.GUI.Dialog.DMachineSetup.SWPole.PWSlot60.Ui_PWSlot60 import Ui_PWSlot60
class Gen_PWSlot60(Ui_PWSlot60):
def setupUi(self, PWSlot60):
"""Abstract class to u... | 31.059406 | 85 | 0.597067 |
520b3a7caaad05f11ab28588b3997364884e6ed2 | 703 | py | Python | examples/color.py | damani42/plumbum | 55a5058ccc20745bae77db7b29ec7f1c1f9daef5 | [
"MIT"
] | null | null | null | examples/color.py | damani42/plumbum | 55a5058ccc20745bae77db7b29ec7f1c1f9daef5 | [
"MIT"
] | null | null | null | examples/color.py | damani42/plumbum | 55a5058ccc20745bae77db7b29ec7f1c1f9daef5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from plumbum import colors
with colors.fg.red:
print("This is in red")
print("This is completely restored, even if an exception is thrown!")
print("The library will restore color on exiting automatically.")
print(colors.bold["This is bold and exciting!"])
print(colors.bg.cyan | "This is on... | 28.12 | 80 | 0.705548 |
cc571995e6a2663390d909d9d1342c2cec237a92 | 798 | py | Python | src/utils/list_images.py | Andrew-Chen-Wang/static-image-age-detection | 7dd0b353a7efb580f0120386c8db623d03533f90 | [
"Apache-2.0"
] | null | null | null | src/utils/list_images.py | Andrew-Chen-Wang/static-image-age-detection | 7dd0b353a7efb580f0120386c8db623d03533f90 | [
"Apache-2.0"
] | 1 | 2020-06-14T04:05:02.000Z | 2020-06-14T04:05:02.000Z | src/utils/list_images.py | Andrew-Chen-Wang/static-image-age-detection | 7dd0b353a7efb580f0120386c8db623d03533f90 | [
"Apache-2.0"
] | null | null | null | import os
from typing import List
def list_images(base_path: str) -> List[str]:
"""
Lists all image paths in specified directory.
Taken mostly from imutils with some adds/subtracts:
https://github.com/jrosebr1/imutils/blob/master/imutils/paths.py
"""
image_types = (".jpg", ".jpeg", ".png", ".b... | 38 | 74 | 0.636591 |
5379ed38d45e6b74ee4567a5d8ffd20dfccf9f47 | 3,583 | py | Python | ScidbLoader/scidb_load/test/test_scidb_loader.py | dllahr/scidb_python_utils | a0801c32959c44dc7acc19128f950f8702785d88 | [
"MIT"
] | null | null | null | ScidbLoader/scidb_load/test/test_scidb_loader.py | dllahr/scidb_python_utils | a0801c32959c44dc7acc19128f950f8702785d88 | [
"MIT"
] | null | null | null | ScidbLoader/scidb_load/test/test_scidb_loader.py | dllahr/scidb_python_utils | a0801c32959c44dc7acc19128f950f8702785d88 | [
"MIT"
] | null | null | null | """Copyright (C) 2012 David L. Lahr
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute... | 43.168675 | 102 | 0.704996 |
e8c24d60df64c9701a727ea2777eefb2614d44b2 | 382 | py | Python | python-src/logger.py | DEWMRAX/rbot | 2be7cf0757a07e5cf3ed1bd4e288d5d8646eca4a | [
"Unlicense",
"MIT"
] | 3 | 2021-03-18T21:18:32.000Z | 2022-01-19T19:23:24.000Z | python-src/logger.py | DEWMRAX/rbot | 2be7cf0757a07e5cf3ed1bd4e288d5d8646eca4a | [
"Unlicense",
"MIT"
] | null | null | null | python-src/logger.py | DEWMRAX/rbot | 2be7cf0757a07e5cf3ed1bd4e288d5d8646eca4a | [
"Unlicense",
"MIT"
] | 3 | 2020-09-13T21:21:04.000Z | 2021-11-15T17:59:23.000Z | import datetime
def record_event(s):
timestamp = '{:%m-%d,%H:%M:%S}'.format(datetime.datetime.now())
with open("events.txt", "a") as events:
events.write("%s,%s\n" % (timestamp, s))
def record_trade(s):
timestamp = '{:%m-%d,%H:%M:%S}'.format(datetime.datetime.now())
with open("trades.txt", "a"... | 31.833333 | 67 | 0.586387 |
e02e473813e0f29062e8c8486e4e223b01fba724 | 159 | py | Python | offsite/accounts/models.py | wh1te909/backup-offsite | 694f773583eb825b44ff20c51598ac9e1106cd32 | [
"MIT"
] | 4 | 2021-01-20T15:45:35.000Z | 2021-07-09T02:15:31.000Z | offsite/accounts/models.py | wh1te909/backup-offsite | 694f773583eb825b44ff20c51598ac9e1106cd32 | [
"MIT"
] | 6 | 2020-08-02T23:31:07.000Z | 2021-09-22T19:19:50.000Z | offsite/accounts/models.py | wh1te909/backup-offsite | 694f773583eb825b44ff20c51598ac9e1106cd32 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
is_active = models.BooleanField(default=True)
| 22.714286 | 51 | 0.805031 |
c17e14ec0d186660f4c79f41bd8b097c8e8e088e | 21,455 | py | Python | meta_reward_learning/semantic_parsing/nsm/tf_utils.py | jrmendeshurb/google-research | f9fa8cdd2fb77975b524371fd29df008b9dc6cf4 | [
"Apache-2.0"
] | 6 | 2019-12-16T04:23:57.000Z | 2021-12-09T14:17:14.000Z | meta_reward_learning/semantic_parsing/nsm/tf_utils.py | jrmendeshurb/google-research | f9fa8cdd2fb77975b524371fd29df008b9dc6cf4 | [
"Apache-2.0"
] | 13 | 2020-01-28T22:19:53.000Z | 2022-02-10T00:39:26.000Z | meta_reward_learning/semantic_parsing/nsm/tf_utils.py | jrmendeshurb/google-research | f9fa8cdd2fb77975b524371fd29df008b9dc6cf4 | [
"Apache-2.0"
] | 1 | 2019-12-19T09:44:55.000Z | 2019-12-19T09:44:55.000Z | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.942997 | 80 | 0.672431 |
3605916ede1f8cde48980442a8d5ed50d3bd314d | 1,566 | py | Python | Basic Data Structures/array/leet_682_BaseballGame.py | rush2catch/algorithms-leetcode | 38a5e6aa33d48fa14fe09c50c28a2eaabd736e55 | [
"MIT"
] | null | null | null | Basic Data Structures/array/leet_682_BaseballGame.py | rush2catch/algorithms-leetcode | 38a5e6aa33d48fa14fe09c50c28a2eaabd736e55 | [
"MIT"
] | null | null | null | Basic Data Structures/array/leet_682_BaseballGame.py | rush2catch/algorithms-leetcode | 38a5e6aa33d48fa14fe09c50c28a2eaabd736e55 | [
"MIT"
] | null | null | null | # Problem: Baseball Game
# Difficulty: Easy
# Category: Array
# Leetcode 682: https://leetcode.com/problems/baseball-game/description/
# Description:
"""
You're now a baseball game point recorder.
Given a list of strings, each string can be one of the 4 following types:
Integer (one round's score): Directly represent... | 37.285714 | 133 | 0.697957 |
ef7cbd69748b27fb829eac970a670bd117aab68f | 9,131 | py | Python | notebooks/python/cloudsat_precip.py | Pearl-Ayem/ATSC_Notebook_Data | c075d166c235ac4e68a4b77750e02b2a5e77abd0 | [
"MIT"
] | null | null | null | notebooks/python/cloudsat_precip.py | Pearl-Ayem/ATSC_Notebook_Data | c075d166c235ac4e68a4b77750e02b2a5e77abd0 | [
"MIT"
] | null | null | null | notebooks/python/cloudsat_precip.py | Pearl-Ayem/ATSC_Notebook_Data | c075d166c235ac4e68a4b77750e02b2a5e77abd0 | [
"MIT"
] | null | null | null |
# coding: utf-8
# <h1>Table of Contents<span class="tocSkip"></span></h1>
# <div class="toc"><ul class="toc-item"><li><span><a href="#Introduction" data-toc-modified-id="Introduction-1"><span class="toc-item-num">1 </span>Introduction</a></span></li><li><span><a href="#Read-in-the-height-and-reflectivity-f... | 38.690678 | 2,445 | 0.74154 |
7340c026653ed2430668da293c7f72ad4bd9ee64 | 1,326 | py | Python | fplcoin/encodings.py | vishnutalanki/fplcoin | d2ce6ce612497ae3fe24576ab5369d32f39e931a | [
"MIT"
] | null | null | null | fplcoin/encodings.py | vishnutalanki/fplcoin | d2ce6ce612497ae3fe24576ab5369d32f39e931a | [
"MIT"
] | null | null | null | fplcoin/encodings.py | vishnutalanki/fplcoin | d2ce6ce612497ae3fe24576ab5369d32f39e931a | [
"MIT"
] | null | null | null | # from https://pypi.python.org/pypi/base58/0.2.2
import fplcoin
class b58encoder(object):
""" Base58 encoder for fplcoin """
def __init__(self):
self.alphabet = 'zyxwvutsrqponmkjihgfedcbaZYXWVUTSRQPNMLKJHGFEDCBA987654321'
self.iseq = lambda s: map(ord, s)
self.bseq = lambda s: ''.jo... | 22.862069 | 84 | 0.496983 |
6a73d31980630393b32e22466e488de5ae2f89a5 | 5,588 | py | Python | tools/extract_changelog.py | delta-things/mos | 7ef8e79db5a169a0aafd48502087afe2ce7e70a3 | [
"Apache-2.0"
] | null | null | null | tools/extract_changelog.py | delta-things/mos | 7ef8e79db5a169a0aafd48502087afe2ce7e70a3 | [
"Apache-2.0"
] | null | null | null | tools/extract_changelog.py | delta-things/mos | 7ef8e79db5a169a0aafd48502087afe2ce7e70a3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2014-2018 Cesanta Software Limited
# 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/LICE... | 33.065089 | 122 | 0.60791 |
2f1e42af65663bab20edab1bd239559c7e15bb63 | 5,016 | py | Python | pyVim/fm.py | xweichu/pyvmomi | 77aedef02974a63517a079c482e49fd9890c09a4 | [
"Apache-2.0"
] | null | null | null | pyVim/fm.py | xweichu/pyvmomi | 77aedef02974a63517a079c482e49fd9890c09a4 | [
"Apache-2.0"
] | null | null | null | pyVim/fm.py | xweichu/pyvmomi | 77aedef02974a63517a079c482e49fd9890c09a4 | [
"Apache-2.0"
] | null | null | null | ## @file fm.py
## @brief Synchronous FileManager functions
##
## Detailed description (for Doxygen goes here)
"""
Synchronous FileManager functions.
Detailed description (for pydoc goes here)
"""
def Move(host, srcDatacenter, srcFile, dstDatacenter, dstFile, force,
fileType):
"""
Move a file from (s... | 37.714286 | 77 | 0.583134 |
62cbaff9106c4b3ac7e804e3b90c37aa3949a55d | 559 | py | Python | packages/pyright-internal/src/tests/samples/annotations6.py | Jasha10/pyright | 0ce0cfa10fe7faa41071a2cc417bb449cf8276fe | [
"MIT"
] | 3,934 | 2019-03-22T09:26:41.000Z | 2019-05-06T21:03:08.000Z | packages/pyright-internal/src/tests/samples/annotations6.py | Jasha10/pyright | 0ce0cfa10fe7faa41071a2cc417bb449cf8276fe | [
"MIT"
] | 107 | 2019-03-24T04:09:37.000Z | 2019-05-06T17:00:04.000Z | packages/pyright-internal/src/tests/samples/annotations6.py | Jasha10/pyright | 0ce0cfa10fe7faa41071a2cc417bb449cf8276fe | [
"MIT"
] | 119 | 2019-03-23T10:48:04.000Z | 2019-05-06T08:57:56.000Z | # This sample verifies that the Type[] and type[] annotations work
# as expected when the type argument is Any.
from typing import Type, Any
def is_type1(x: object, y: Type[Any]) -> bool:
return isinstance(x, y)
is_type1(1, int)
# This should generate an error.
is_type1(1, 1)
def is_type2(x: object, y: type... | 18.633333 | 66 | 0.686941 |
57aace56d81ea350127d3fcd6c679630ab5b984f | 72 | py | Python | test/test_scripts/__init__.py | asmeenray/autodq | 508cd51eaf2ba647f43219a8ef6313198c8fbc4d | [
"Apache-2.0"
] | 81 | 2020-06-29T08:47:58.000Z | 2022-03-27T19:15:27.000Z | test/test_scripts/__init__.py | asmeenray/autodq | 508cd51eaf2ba647f43219a8ef6313198c8fbc4d | [
"Apache-2.0"
] | 99 | 2018-10-03T01:32:29.000Z | 2020-03-01T15:20:20.000Z | test/test_scripts/__init__.py | asmeenray/autodq | 508cd51eaf2ba647f43219a8ef6313198c8fbc4d | [
"Apache-2.0"
] | 20 | 2018-10-03T02:29:34.000Z | 2020-01-17T14:40:23.000Z | from shared.utils import configure_test_logger
configure_test_logger()
| 18 | 46 | 0.875 |
03781376a9d2e6cd93d5f1a2deb2ec3e12a47e57 | 6,088 | py | Python | src/oci/opsi/models/update_exadata_insight_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/opsi/models/update_exadata_insight_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/opsi/models/update_exadata_insight_details.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... | 36.45509 | 245 | 0.668528 |
370f6efa84ed6484645e4a1277112f7f17cfa97e | 5,156 | py | Python | lib/solvers.py | Pexure/ScanNet-ME-3DSegmentation | f6d5b9d5e34b78abd39f68646ed63e0de843e252 | [
"MIT"
] | 19 | 2020-05-06T15:19:31.000Z | 2022-03-17T09:42:28.000Z | lib/solvers.py | Pexure/ScanNet-ME-3DSegmentation | f6d5b9d5e34b78abd39f68646ed63e0de843e252 | [
"MIT"
] | 5 | 2020-06-07T17:02:21.000Z | 2021-12-16T08:44:47.000Z | lib/solvers.py | Pexure/ScanNet-ME-3DSegmentation | f6d5b9d5e34b78abd39f68646ed63e0de843e252 | [
"MIT"
] | 3 | 2021-04-24T04:00:25.000Z | 2021-08-13T13:08:02.000Z | # Copyright (c) Chris Choy (chrischoy@ai.stanford.edu). All Rights Reserved.
#
# Please cite "4D Spatio-Temporal ConvNets: Minkowski Convolutional Neural
# Networks", CVPR'19 (https://arxiv.org/abs/1904.08755) if you use any part of
# the code.
import torch
import logging
from torch.optim import SGD, Adam
from torch.o... | 31.82716 | 105 | 0.640225 |
9d53cba3ec2e81dfe0ec8b6b2fe4b74e6fe069cf | 1,576 | py | Python | {{cookiecutter.directory_name}}/apps/core/auth.py | Serbel97/django-project-template | 3d7bba7031268ef8dedccb51d72553cdb0a13ca3 | [
"MIT"
] | null | null | null | {{cookiecutter.directory_name}}/apps/core/auth.py | Serbel97/django-project-template | 3d7bba7031268ef8dedccb51d72553cdb0a13ca3 | [
"MIT"
] | null | null | null | {{cookiecutter.directory_name}}/apps/core/auth.py | Serbel97/django-project-template | 3d7bba7031268ef8dedccb51d72553cdb0a13ca3 | [
"MIT"
] | null | null | null | from http import HTTPStatus
from typing import Optional
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.core.exceptions import ValidationError
from django.conf import settings
from django.utils import timezone
from django.utils.text import slugify
from d... | 29.185185 | 94 | 0.654188 |
8d78c1a214c09fc33a5d7da4efe160916b1dbb66 | 1,014 | py | Python | flask_angular_injection/setup.py | sujeetpillai/flask_angular_injection | cfdc75f2b7f1a0843bc6f9c595a89a7aaae8abb1 | [
"MIT"
] | 1 | 2019-03-16T13:34:40.000Z | 2019-03-16T13:34:40.000Z | flask_angular_injection/setup.py | sujeetpillai/flask_angular_injection | cfdc75f2b7f1a0843bc6f9c595a89a7aaae8abb1 | [
"MIT"
] | 1 | 2016-07-29T16:47:04.000Z | 2016-07-29T16:47:04.000Z | flask_angular_injection/setup.py | sujeetpillai/flask_angular_injection | cfdc75f2b7f1a0843bc6f9c595a89a7aaae8abb1 | [
"MIT"
] | null | null | null | """
Flask-Angular-Injection
-------------
Flask extension to inject Flask data into AngularJS controller through a service.
"""
from setuptools import setup
setup(
name='Flask-Angular-Injection',
version='1.0',
url='http://github.io/flask-angular-injection/',
license='MIT',
author='Sujeet Pillai'... | 28.971429 | 88 | 0.647929 |
c6a04f99977830e4b26086b0f2c42227c1e2a187 | 100,339 | py | Python | kgtk/io/kgtkreader.py | nicklein/kgtk | 54a95e6319251a34815053e0c26973f1c91998af | [
"MIT"
] | null | null | null | kgtk/io/kgtkreader.py | nicklein/kgtk | 54a95e6319251a34815053e0c26973f1c91998af | [
"MIT"
] | null | null | null | kgtk/io/kgtkreader.py | nicklein/kgtk | 54a95e6319251a34815053e0c26973f1c91998af | [
"MIT"
] | null | null | null | """Read a KGTK node or edge file in TSV format.
Normally, results are obtained as rows of string values obtained by iteration
on the KgtkReader object. Alternative iterators are available to return the results
as:
* concise_rows: lists of strings with empty fields converted to None
* kgtk_values: ... | 51.037131 | 188 | 0.584259 |
4b619ac7942b89a01c003f6c20172ce6e16138d9 | 7,152 | py | Python | pytext/models/representations/bilstm.py | kashpop/pytext | cb9fe110d69e39ac4cf6f2f29f707252999a0f8e | [
"BSD-3-Clause"
] | null | null | null | pytext/models/representations/bilstm.py | kashpop/pytext | cb9fe110d69e39ac4cf6f2f29f707252999a0f8e | [
"BSD-3-Clause"
] | null | null | null | pytext/models/representations/bilstm.py | kashpop/pytext | cb9fe110d69e39ac4cf6f2f29f707252999a0f8e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Optional, Tuple
import torch
import torch.nn as nn
import torch.onnx
from pytext.config import ConfigBase
from pytext.utils import cuda
from pytext.utils.usage import log_class_usage
from torch.nn.utils.rnn... | 42.070588 | 88 | 0.604306 |
5a8246549294bce1419da602fc67e2c466a8bbea | 488 | py | Python | casepy/eulerRuO2/nSod32768x1/chars.py | will-iam/Variant | 5b6732134fd51cf6c2b90b51b7976be0693ba28d | [
"MIT"
] | 8 | 2017-05-04T07:50:02.000Z | 2019-05-17T02:27:20.000Z | casepy/eulerRuO2/nSod32768x1/chars.py | will-iam/Variant | 5b6732134fd51cf6c2b90b51b7976be0693ba28d | [
"MIT"
] | null | null | null | casepy/eulerRuO2/nSod32768x1/chars.py | will-iam/Variant | 5b6732134fd51cf6c2b90b51b7976be0693ba28d | [
"MIT"
] | null | null | null | import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '../../../'))
import script.rio as io
import script.initial_condition.sod as sod
# Domain properties
lx = 1.0
ly = 1.0
Nx = 32768
Ny = 1
# Scheme execution options
T = 0.2
CFL = 0.5
gamma = 1.4
BCtype = 'N'
BClayer = 1
quantityList = ['rho', 'rhou_x', 'rh... | 20.333333 | 96 | 0.684426 |
4b2d66d52126672b5084b1cffdcf76ee14f2722e | 3,940 | py | Python | django/templatetags/static.py | Miserlou/django | 35ddeee45573de57ae3c791bf36496b4a7028ddf | [
"BSD-3-Clause"
] | 1 | 2016-03-07T15:37:48.000Z | 2016-03-07T15:37:48.000Z | django/templatetags/static.py | erdem/django | 76d5daa60f90d3692b3ff3b7f5054e4bc7c1f374 | [
"BSD-3-Clause"
] | null | null | null | django/templatetags/static.py | erdem/django | 76d5daa60f90d3692b3ff3b7f5054e4bc7c1f374 | [
"BSD-3-Clause"
] | null | null | null | from urlparse import urljoin
from django import template
from django.template.base import Node
from django.utils.encoding import iri_to_uri
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self, varname=None, na... | 24.936709 | 76 | 0.596954 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.