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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7258626de0ccc4f4b39c6b798645061551f3ecc6 | 3,677 | py | Python | tests/test_examples/test_instantiate_examples.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | 1 | 2021-02-24T07:34:39.000Z | 2021-02-24T07:34:39.000Z | tests/test_examples/test_instantiate_examples.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | 1 | 2021-06-17T03:18:57.000Z | 2021-06-17T08:10:34.000Z | tests/test_examples/test_instantiate_examples.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from pathlib import Path
from textwrap import dedent
from typing import Any, List
import pytest
from hydra.test_utils.test_utils import (
assert_text_same,
chdir_hydra_root,
run_python_script,
)
chdir_hydra_root()
@pytest.mark.param... | 28.952756 | 106 | 0.576829 |
f77c256580eaad26844b1c0b7a21782351cda5b0 | 41,096 | py | Python | testplan/common/entity/base.py | tjisanaMS/testplan | 7c9a3604ef05458948fc3c393790358d467b133b | [
"Apache-2.0"
] | 96 | 2018-03-14T13:14:50.000Z | 2021-01-14T08:26:08.000Z | testplan/common/entity/base.py | tjisanaMS/testplan | 7c9a3604ef05458948fc3c393790358d467b133b | [
"Apache-2.0"
] | 135 | 2018-06-28T02:41:05.000Z | 2021-01-19T02:16:58.000Z | testplan/common/entity/base.py | tjisanaMS/testplan | 7c9a3604ef05458948fc3c393790358d467b133b | [
"Apache-2.0"
] | 53 | 2018-03-17T14:39:15.000Z | 2021-01-21T10:54:13.000Z | """
Module containing base classes that represent object entities that can accept
configuration, start/stop/run/abort, create results and have some state.
"""
import os
import sys
import time
import signal
import threading
import traceback
from collections import deque, OrderedDict
import psutil
from schema import Or... | 31.394958 | 83 | 0.590812 |
54bbb399801044f0a6fa5c595d6f0706b23902c7 | 1,051 | py | Python | manage.py | farooq98/Event-Management | 00db545a506173a67be52230ea9f314678b3c6cd | [
"MIT"
] | null | null | null | manage.py | farooq98/Event-Management | 00db545a506173a67be52230ea9f314678b3c6cd | [
"MIT"
] | 4 | 2022-03-25T10:36:00.000Z | 2022-03-31T10:39:04.000Z | manage.py | farooq98/Event-Management | 00db545a506173a67be52230ea9f314678b3c6cd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
from pathlib import Path
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some... | 32.84375 | 77 | 0.662226 |
e8fce1c414abffaf926151ff8ab604d26c95cab7 | 7,796 | py | Python | benchmarks/bench_rcv1_logreg_convergence.py | huzq/scikit-learn | f862129f36786acbae3d9f2d161bbb72d77b87ec | [
"BSD-3-Clause"
] | 1 | 2020-12-03T16:35:55.000Z | 2020-12-03T16:35:55.000Z | benchmarks/bench_rcv1_logreg_convergence.py | huzq/scikit-learn | f862129f36786acbae3d9f2d161bbb72d77b87ec | [
"BSD-3-Clause"
] | 1 | 2022-03-09T19:32:57.000Z | 2022-03-09T20:23:30.000Z | benchmarks/bench_rcv1_logreg_convergence.py | huzq/scikit-learn | f862129f36786acbae3d9f2d161bbb72d77b87ec | [
"BSD-3-Clause"
] | 1 | 2020-02-16T05:40:12.000Z | 2020-02-16T05:40:12.000Z | # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import matplotlib.pyplot as plt
from joblib import Memory
import numpy as np
import gc
import time
from sklearn.linear_model import LogisticRegression, SGDClassifier
from sklearn.dat... | 24.907348 | 86 | 0.569138 |
b6f2170523f24d3b4e58a167f3aa4bb2035bf12a | 497 | py | Python | meiduo_mall/apps/meiduo_admin/serializers/specs_options.py | kura-Lee/meiduo-mall | 8406eb49a41f8c8e726cca13231493b6422d427d | [
"MIT"
] | 1 | 2022-01-30T13:09:19.000Z | 2022-01-30T13:09:19.000Z | meiduo_mall/apps/meiduo_admin/serializers/specs_options.py | kura-Lee/meiduo-mall | 8406eb49a41f8c8e726cca13231493b6422d427d | [
"MIT"
] | null | null | null | meiduo_mall/apps/meiduo_admin/serializers/specs_options.py | kura-Lee/meiduo-mall | 8406eb49a41f8c8e726cca13231493b6422d427d | [
"MIT"
] | null | null | null | from rest_framework import serializers
from apps.goods.models import SpecificationOption, SPUSpecification
class SPUSpecOptionSerializer(serializers.ModelSerializer):
"""规格选项"""
spec = serializers.StringRelatedField()
spec_id = serializers.IntegerField()
class Meta:
model = SpecificationOpti... | 23.666667 | 67 | 0.706237 |
d11836402ed79c76adf34b770188705021c622f1 | 747 | py | Python | 10_files_and_exeptions/file_reader.py | simonhoch/python_basics | 4ecf12c074e641e3cdeb0a6690846eb9133f96af | [
"MIT"
] | null | null | null | 10_files_and_exeptions/file_reader.py | simonhoch/python_basics | 4ecf12c074e641e3cdeb0a6690846eb9133f96af | [
"MIT"
] | null | null | null | 10_files_and_exeptions/file_reader.py | simonhoch/python_basics | 4ecf12c074e641e3cdeb0a6690846eb9133f96af | [
"MIT"
] | null | null | null | with open('pi_digits.txt') as file_object:
contents = file_object.read()
print(contents)
print(contents.rstrip())#To remove blank line
filename = 'pi_digits.txt'
#read line by line
with open(filename) as file_object:
for line in file_object:
print(line)
with open(filename) as file_object:
... | 19.657895 | 49 | 0.698795 |
05cb8b1a462d8017919d12ed00e8a092b3ee211f | 7,013 | py | Python | kubernetes/client/models/v2beta1_external_metric_source.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v2beta1_external_metric_source.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | 3 | 2021-11-30T03:11:13.000Z | 2022-02-09T03:39:41.000Z | kubernetes/client/models/v2beta1_external_metric_source.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.24
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 34.043689 | 154 | 0.646941 |
5d267650e1068ba3f9d00df7caf8a85bb7471435 | 8,960 | py | Python | shakenfist_client/commandline/artifact.py | mandoonandy/client-python | ee7bba251ec8c132b772cd715a4dd677c8075057 | [
"Apache-2.0"
] | null | null | null | shakenfist_client/commandline/artifact.py | mandoonandy/client-python | ee7bba251ec8c132b772cd715a4dd677c8075057 | [
"Apache-2.0"
] | null | null | null | shakenfist_client/commandline/artifact.py | mandoonandy/client-python | ee7bba251ec8c132b772cd715a4dd677c8075057 | [
"Apache-2.0"
] | null | null | null | import click
import json
import os
from prettytable import PrettyTable
from tqdm import tqdm
import sys
import time
from shakenfist_client import apiclient
from shakenfist_client import util
@click.group(help='Artifact commands')
def artifact():
pass
def _get_artifacts(ctx, args, incomplete):
choices = [a[... | 37.48954 | 84 | 0.587723 |
2327d71946c6e6169c39f78111fc128153167d30 | 4,760 | py | Python | main.py | Iamgoingtomake/Calculator-bot-by-HyetelegramBots | 3a9995076a72c0359e5097cac1bf51bfa1d50de8 | [
"MIT"
] | null | null | null | main.py | Iamgoingtomake/Calculator-bot-by-HyetelegramBots | 3a9995076a72c0359e5097cac1bf51bfa1d50de8 | [
"MIT"
] | null | null | null | main.py | Iamgoingtomake/Calculator-bot-by-HyetelegramBots | 3a9995076a72c0359e5097cac1bf51bfa1d50de8 | [
"MIT"
] | null | null | null | # Made with python3
# (C) @Hyetelegram
# Copyright permission under MIT License
# All rights reserved by HyetelegramBots
# License -> https://github.com/iamgoingtomake/Calculator-bot-by-HyetelegramBots/blob/main/LICENSE
import os
from pyrogram import Client, filters
from pyrogram.types import *
Bot = Client(
... | 18.740157 | 99 | 0.562185 |
229c4fe135df925f619996793dcb369163749af5 | 872 | py | Python | table_converter.py | bertiqwerty/playground | 015c5ae3f1cab3eb4528815f7b2275137081f33d | [
"MIT"
] | null | null | null | table_converter.py | bertiqwerty/playground | 015c5ae3f1cab3eb4528815f7b2275137081f33d | [
"MIT"
] | null | null | null | table_converter.py | bertiqwerty/playground | 015c5ae3f1cab3eb4528815f7b2275137081f33d | [
"MIT"
] | null | null | null | _input_table = """method, machine, opt., speed-up, policy time [s], strategy time [s]
add/sub,Core 2 Duo,no,1.24, 51.67, 64.05
add/sub,Core 2 Duo,yes,4.13, 5.14, 21.27
max/min,Core 2 Duo,yes,1.76, 12.03, 21.17
Christoph’s add/sub,Core 2 Duo,yes,1.02, 44.29, 45.23
add/sub,i7,yes,3.69,3.41,12.59
max/min,i7,yes,2.31,5.44 ... | 32.296296 | 85 | 0.558486 |
8e07538f4aa29f7f18d119c078e66076ff1cfb74 | 7,146 | py | Python | test/functional/beerchain_evm_revert.py | beerchainproject/beerchain | 85a2701aff25358bbf2da6651d407a8d63ea2be8 | [
"MIT"
] | null | null | null | test/functional/beerchain_evm_revert.py | beerchainproject/beerchain | 85a2701aff25358bbf2da6651d407a8d63ea2be8 | [
"MIT"
] | null | null | null | test/functional/beerchain_evm_revert.py | beerchainproject/beerchain | 85a2701aff25358bbf2da6651d407a8d63ea2be8 | [
"MIT"
] | 2 | 2020-09-15T08:11:39.000Z | 2021-03-22T21:56:28.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from tes... | 49.625 | 291 | 0.673664 |
be432d72a23ccc9d0fa3affd7e57d02fa54ce45c | 1,694 | py | Python | scipy/signal/tests/test_filter_design.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-10-07T00:37:32.000Z | 2022-01-21T17:02:33.000Z | scipy/signal/tests/test_filter_design.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | null | null | null | scipy/signal/tests/test_filter_design.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-05-09T14:23:57.000Z | 2018-11-15T05:56:00.000Z | import warnings
import numpy as np
from numpy.testing import TestCase, assert_array_almost_equal, \
assert_array_equal, assert_raises, assert_
from scipy.signal import tf2zpk, zpk2tf, bessel, BadCoefficients
class TestTf2zpk(TestCase):
def test_simple(self):
z_r = np.array([0.5, -0.5])
... | 30.8 | 74 | 0.595041 |
fd6a4d09fec74c16e597a23b1189c993a702a95b | 21,679 | py | Python | exp/exp017_RoBERTa_large_FITv5.py | Hiroki29/kaggle2021-CommonLit-Readability-Prize | c588174c378f93890d6a16436050ec21f76cf919 | [
"MIT"
] | null | null | null | exp/exp017_RoBERTa_large_FITv5.py | Hiroki29/kaggle2021-CommonLit-Readability-Prize | c588174c378f93890d6a16436050ec21f76cf919 | [
"MIT"
] | null | null | null | exp/exp017_RoBERTa_large_FITv5.py | Hiroki29/kaggle2021-CommonLit-Readability-Prize | c588174c378f93890d6a16436050ec21f76cf919 | [
"MIT"
] | null | null | null | import gc
import json
import math
import os
import random
import time
from pathlib import Path
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import Adam
from torch.utils.data import (DataLoader, Dataset, RandomSampler, SequentialSampler)
from tra... | 37.05812 | 127 | 0.577979 |
3760cc83db673b72804b0f6b33c2b5a49eb4f15f | 2,901 | py | Python | pstests/models/dcn_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | 2 | 2021-12-05T07:11:04.000Z | 2021-12-15T07:53:48.000Z | pstests/models/dcn_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | null | null | null | pstests/models/dcn_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | 3 | 2021-04-01T22:39:13.000Z | 2021-04-21T11:51:57.000Z | from athena import gpu_ops as ad
from athena import optimizer
from athena import initializers as init
from athena import dataloader as dl
from athena import ndarray
import numpy as np
import time
# y = x1 * (x1)^-1 * w + x0 + bias
def cross_layer(x0, x1):
# x0: input embedding feature (batch_size, 26 * em... | 37.192308 | 132 | 0.665633 |
e312a55b0cff9fd64fc1dced8926fc90c65f8bd0 | 177 | py | Python | syntax/list/sliceUpdateExample.py | Dev-Learn/LearnPython | a601f5eeeb05236a3e179bf8c34425a95cb0c919 | [
"Apache-2.0"
] | null | null | null | syntax/list/sliceUpdateExample.py | Dev-Learn/LearnPython | a601f5eeeb05236a3e179bf8c34425a95cb0c919 | [
"Apache-2.0"
] | null | null | null | syntax/list/sliceUpdateExample.py | Dev-Learn/LearnPython | a601f5eeeb05236a3e179bf8c34425a95cb0c919 | [
"Apache-2.0"
] | null | null | null | years = [1990, 1991, 1992, 1993, 1994, 1995, 1996]
print("Years: ", years)
print("Update Slice: years[1:5] = [2000, 2001]")
years[1:5] = [2000, 2001]
print("Years: ", years) | 19.666667 | 50 | 0.615819 |
749cc16da4caa86e4c73408e52622d2b01b6b02f | 389 | py | Python | src/configapp/migrations/0002_profile_pen_name.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/configapp/migrations/0002_profile_pen_name.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/configapp/migrations/0002_profile_pen_name.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2 on 2021-12-28 17:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('configapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='pen_name',
... | 20.473684 | 63 | 0.596401 |
7c490076cd56f5461b3f35e140cf98430b9ebeb7 | 35,528 | py | Python | core/domain/skill_services_test.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | core/domain/skill_services_test.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | core/domain/skill_services_test.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Oppia 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 ... | 42.497608 | 80 | 0.637413 |
eb281dbcb70b937cf69e44da7ef393b3d7a73cba | 1,313 | py | Python | benchmark/plot.py | STEllAR-GROUP/hpxcl | 1d5fd791016548856d65866f64ca169778402c4f | [
"BSL-1.0"
] | 30 | 2015-10-01T16:15:02.000Z | 2022-03-17T12:21:47.000Z | benchmark/plot.py | STEllAR-GROUP/hpxcl | 1d5fd791016548856d65866f64ca169778402c4f | [
"BSL-1.0"
] | 50 | 2015-06-21T01:05:34.000Z | 2021-08-06T18:20:54.000Z | benchmark/plot.py | STEllAR-GROUP/hpxcl | 1d5fd791016548856d65866f64ca169778402c4f | [
"BSL-1.0"
] | 23 | 2015-03-18T11:18:36.000Z | 2021-12-27T16:36:32.000Z | import os
import csv
#for headless display in python
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
stencilCudaX = []
stencilCudaY = []
with open('StencilCuda.dat', 'rb') as f:
reader = csv.reader(f, delimiter=' ', quoting=csv.QUOTE_NONE)
for row in reader:
stencilCudaX.appen... | 29.177778 | 116 | 0.693069 |
6aeb2d119b4b1620f5105b3e7f01bfd6650183af | 1,088 | py | Python | dev_example/models.py | megasnort/django-utf8field | 63521c4296a898e86a71ab52ae7e5bba393bb7da | [
"Apache-2.0"
] | null | null | null | dev_example/models.py | megasnort/django-utf8field | 63521c4296a898e86a71ab52ae7e5bba393bb7da | [
"Apache-2.0"
] | null | null | null | dev_example/models.py | megasnort/django-utf8field | 63521c4296a898e86a71ab52ae7e5bba393bb7da | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from utf8field.fields import UTF8FileField, UTF8CharField, UTF8TextField
class TestModel(models.Model):
file = UTF8FileField(upload_to='media/', four_byte_detection=True)
class TestWithMaxContentLengthModel(models.Mod... | 31.085714 | 95 | 0.776654 |
cc944c3bd16ae32ce677281c16cb6c1f7d5c3703 | 26,885 | py | Python | tools/swarming_client/tests/local_caching_test.py | metahashorg/v8_vm | 0d2ca034d48cc4b796ddb52730ebc06ed21509ab | [
"BSD-3-Clause"
] | 1 | 2019-04-25T17:50:34.000Z | 2019-04-25T17:50:34.000Z | tools/swarming_client/tests/local_caching_test.py | metahashorg/v8_vm | 0d2ca034d48cc4b796ddb52730ebc06ed21509ab | [
"BSD-3-Clause"
] | null | null | null | tools/swarming_client/tests/local_caching_test.py | metahashorg/v8_vm | 0d2ca034d48cc4b796ddb52730ebc06ed21509ab | [
"BSD-3-Clause"
] | 1 | 2018-11-28T07:47:41.000Z | 2018-11-28T07:47:41.000Z | #!/usr/bin/env python
# Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import hashlib
import json
import logging
import os
import random
import string
import sys
import tempfile
import time
impor... | 34.780078 | 80 | 0.681756 |
a194851455105759178d03f072fa62e1a029bf60 | 257 | py | Python | tripoli/basic/doctype/vessel_services/vessel_services.py | ahmadRagheb/tripoli | d4f5ce4f4e270ce82e5ed8622ef8ed2f4159614c | [
"MIT"
] | null | null | null | tripoli/basic/doctype/vessel_services/vessel_services.py | ahmadRagheb/tripoli | d4f5ce4f4e270ce82e5ed8622ef8ed2f4159614c | [
"MIT"
] | null | null | null | tripoli/basic/doctype/vessel_services/vessel_services.py | ahmadRagheb/tripoli | d4f5ce4f4e270ce82e5ed8622ef8ed2f4159614c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Zaqout and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Vesselservices(Document):
pass
| 23.363636 | 49 | 0.782101 |
0c097d7efda7439881535cc7ee5e791b38ed22d7 | 2,858 | py | Python | examples/raisimpy_gym/anymal_blind_locomotion.py | alexpostnikov/raisimpy | 60277de71786664b2dc800282d7a44607d34ea56 | [
"MIT"
] | 38 | 2019-08-03T08:35:10.000Z | 2022-03-25T13:13:07.000Z | examples/raisimpy_gym/anymal_blind_locomotion.py | alexpostnikov/raisimpy | 60277de71786664b2dc800282d7a44607d34ea56 | [
"MIT"
] | 19 | 2019-08-07T18:53:02.000Z | 2020-06-24T04:49:49.000Z | examples/raisimpy_gym/anymal_blind_locomotion.py | alexpostnikov/raisimpy | 60277de71786664b2dc800282d7a44607d34ea56 | [
"MIT"
] | 9 | 2019-08-07T11:32:19.000Z | 2021-07-08T01:17:42.000Z | #!/usr/bin/env python
"""ANYmal blind locomotion RL example using Gym and raisimpy.
The example is mostly the same as the one given in [1], with few slight modifications.
References:
- [1] https://github.com/leggedrobotics/raisimGym/blob/master/scripts/anymal_blind_locomotion.py
"""
import os
import math
import ... | 32.477273 | 115 | 0.751575 |
1624b37383501333e6bfda697ad2a8f3716ad088 | 673 | py | Python | processing/ciesin/inputs/inputs.py | fieldmaps/population-stats | a0728c180b17e7070bc9e5822b8deae2c5c334de | [
"MIT"
] | 1 | 2022-01-28T02:37:43.000Z | 2022-01-28T02:37:43.000Z | processing/ciesin/inputs/inputs.py | fieldmaps/population-statistics | a0728c180b17e7070bc9e5822b8deae2c5c334de | [
"MIT"
] | null | null | null | processing/ciesin/inputs/inputs.py | fieldmaps/population-statistics | a0728c180b17e7070bc9e5822b8deae2c5c334de | [
"MIT"
] | null | null | null | import subprocess
from .utils import DATABASE, FILE_NAME, logging, cwd
logger = logging.getLogger(__name__)
data = cwd / f'../../../inputs/ciesin'
def main():
query = (data / 'query.sql').resolve()
query.unlink(missing_ok=True)
with open(query, 'w') as f:
subprocess.run([
'raster2pgsq... | 24.925926 | 56 | 0.51263 |
5775831a420518a40a0df05c98061b4e71ca6d7a | 3,744 | py | Python | app/routers/bitcoin.py | geco91/blitz_api | 42538a77b3de6a032bb6fdb60249433a0ad5ec56 | [
"MIT"
] | null | null | null | app/routers/bitcoin.py | geco91/blitz_api | 42538a77b3de6a032bb6fdb60249433a0ad5ec56 | [
"MIT"
] | null | null | null | app/routers/bitcoin.py | geco91/blitz_api | 42538a77b3de6a032bb6fdb60249433a0ad5ec56 | [
"MIT"
] | null | null | null | from fastapi import APIRouter, HTTPException, Request, status
from fastapi.params import Depends, Query
from app.auth.auth_bearer import JWTBearer
from app.external.sse_starlette import EventSourceResponse
from app.models.bitcoind import BlockchainInfo, BtcInfo, FeeEstimationMode, NetworkInfo
from app.repositories.bit... | 31.462185 | 144 | 0.724359 |
38591e52cecbb669b7f64492df05bedf3ccfcb5f | 176 | py | Python | util/__init__.py | Heng-Z/mwr | 28e42a3a64f46dc627333b2c6ae4b317803648ba | [
"MIT"
] | 21 | 2021-07-21T06:27:11.000Z | 2022-03-24T10:26:08.000Z | util/__init__.py | Heng-Z/mwr | 28e42a3a64f46dc627333b2c6ae4b317803648ba | [
"MIT"
] | 14 | 2021-07-28T12:35:32.000Z | 2022-02-19T03:23:29.000Z | util/__init__.py | Heng-Z/mwr | 28e42a3a64f46dc627333b2c6ae4b317803648ba | [
"MIT"
] | 1 | 2021-11-08T21:16:03.000Z | 2021-11-08T21:16:03.000Z |
#from .image import crop_center,toUint8,create_patch_image_2D
#from .noise_generator import make_noise
#from .norm import normalize
#from .prepare import PercentileNormalizer
| 29.333333 | 61 | 0.846591 |
abeb98e8166bc522470c31450541b20fba325deb | 1,403 | py | Python | vsts/vsts/tfvc/v4_0/models/vsts_info.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/tfvc/v4_0/models/vsts_info.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/tfvc/v4_0/models/vsts_info.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.264706 | 111 | 0.555952 |
4a934953ad2d4c6ecbe2bde2333a49bf8fd72821 | 15,124 | py | Python | tensorflow/contrib/distribute/python/combinations.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 2 | 2018-09-18T02:36:20.000Z | 2020-06-18T01:36:21.000Z | tensorflow/contrib/distribute/python/combinations.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distribute/python/combinations.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 2 | 2019-12-17T09:27:07.000Z | 2020-05-24T13:09:49.000Z | # Copyright 2018 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... | 36.009524 | 92 | 0.709336 |
8d48bcfc3e9b24c0050423b5ccf4251a6f8d5c34 | 2,359 | py | Python | cubeplayer/renderer/label.py | poletaevvlad/CubePlayer | 356adc121541b7170928fb856174eba42d517198 | [
"MIT-0",
"MIT"
] | null | null | null | cubeplayer/renderer/label.py | poletaevvlad/CubePlayer | 356adc121541b7170928fb856174eba42d517198 | [
"MIT-0",
"MIT"
] | null | null | null | cubeplayer/renderer/label.py | poletaevvlad/CubePlayer | 356adc121541b7170928fb856174eba42d517198 | [
"MIT-0",
"MIT"
] | null | null | null | from argparse import ArgumentParser, Namespace
from typing import Optional
from OpenGL.GL import *
from cubelang.cube import Cube
from cubelang.orientation import Side, Orientation
from .engine.texture import Texture
from ..cli import texture_image, dict_type
class Label:
def __init__(self, scale: float, textur... | 37.444444 | 98 | 0.593472 |
43b66b30d3f0e49258564d111768b09e072cd2a4 | 365 | py | Python | resolwe/flow/migrations/0024_process_entity_3.py | JureZmrzlikar/resolwe | 2c967b5fa06b6b7daeee88b3fca4cd19d10d99c3 | [
"Apache-2.0"
] | null | null | null | resolwe/flow/migrations/0024_process_entity_3.py | JureZmrzlikar/resolwe | 2c967b5fa06b6b7daeee88b3fca4cd19d10d99c3 | [
"Apache-2.0"
] | null | null | null | resolwe/flow/migrations/0024_process_entity_3.py | JureZmrzlikar/resolwe | 2c967b5fa06b6b7daeee88b3fca4cd19d10d99c3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-01 03:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("flow", "0023_process_entity_2"),
]
operations = [
migrations.RemoveField(model_nam... | 21.470588 | 78 | 0.676712 |
a2efbe356b2f9a7f40708e26aa0a5d93efaae334 | 1,657 | py | Python | apps/async/request_post.py | diudiu/featurefactory | ee02ad9e3ea66e2eeafe6e11859801f0420c7d9e | [
"MIT"
] | null | null | null | apps/async/request_post.py | diudiu/featurefactory | ee02ad9e3ea66e2eeafe6e11859801f0420c7d9e | [
"MIT"
] | null | null | null | apps/async/request_post.py | diudiu/featurefactory | ee02ad9e3ea66e2eeafe6e11859801f0420c7d9e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
Copyright (c) 2013-2016 SYPH, All Rights Reserved.
-----------------------------------------------------------
Author: S.JunPeng
Date: 2016/12/22
Change Activity:
"""
import requests
import json
from vendor.utils.constant import cons
from vendor.errors.contact_error imp... | 30.685185 | 93 | 0.614363 |
f3d9d34de866fcc54f132e8b74805de8caf69a56 | 6,363 | py | Python | tekore/_client/api/playlist/items.py | evanofslack/tekore | 91e4a1471562af01a9a33681d2ac3406f41990da | [
"MIT"
] | 135 | 2020-01-14T17:47:26.000Z | 2022-03-25T18:30:04.000Z | tekore/_client/api/playlist/items.py | evanofslack/tekore | 91e4a1471562af01a9a33681d2ac3406f41990da | [
"MIT"
] | 135 | 2020-01-13T22:56:35.000Z | 2022-03-11T19:41:36.000Z | tekore/_client/api/playlist/items.py | evanofslack/tekore | 91e4a1471562af01a9a33681d2ac3406f41990da | [
"MIT"
] | 21 | 2020-01-16T16:01:23.000Z | 2022-02-17T12:46:32.000Z | from typing import List, Tuple
from tekore._auth import scope
from ...base import SpotifyBase
from ...decor import send_and_process, scopes
from ...process import top_item, nothing
from ...chunked import chunked, return_last
class SpotifyPlaylistItems(SpotifyBase):
"""Playlist API endpoints for manipulating play... | 27.192308 | 81 | 0.541726 |
39a2854b22b897b078c9a3f7e967032f78b99c62 | 4,188 | py | Python | msgraph-cli-extensions/v1_0/usersfunctions_v1_0/azext_usersfunctions_v1_0/vendored_sdks/usersfunctions/operations/_users_calendar_events_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/usersfunctions_v1_0/azext_usersfunctions_v1_0/vendored_sdks/usersfunctions/operations/_users_calendar_events_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/usersfunctions_v1_0/azext_usersfunctions_v1_0/vendored_sdks/usersfunctions/operations/_users_calendar_events_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 41.465347 | 133 | 0.670248 |
13c506681f4ac081da3c1612a3b44313aecb6af2 | 729 | py | Python | lights.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | lights.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | lights.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | _init_lights = [0, 1, 0, 0, 1, 0, 1, 0]
# 方案一
def get_next_day(lights):
new_lights = [0]
for i in range(1, len(lights) - 1):
if lights[i - 1] == lights[i + 1]:
new_lights.append(1)
else:
new_lights.append(0)
new_lights.append(0)
return new_lights
def solution1... | 20.828571 | 68 | 0.643347 |
8d8a321dbb2382ea089dcefeacbe1b93af44cf76 | 1,723 | py | Python | core/views/event_viewset.py | LorenzSelv/pinned | f0df31dc68d6e2e5fdd13f2999a62d188df908f1 | [
"MIT"
] | 1 | 2017-11-21T13:46:09.000Z | 2017-11-21T13:46:09.000Z | core/views/event_viewset.py | LorenzSelv/pinned | f0df31dc68d6e2e5fdd13f2999a62d188df908f1 | [
"MIT"
] | null | null | null | core/views/event_viewset.py | LorenzSelv/pinned | f0df31dc68d6e2e5fdd13f2999a62d188df908f1 | [
"MIT"
] | null | null | null | from datetime import datetime
from django.utils import timezone
from django.utils import dateparse
from rest_framework import viewsets
from rest_framework.views import APIView
from rest_framework.response import Response
from ..models import Event, User, Tag
from ..serializers import EventSerializer
class EventView... | 33.134615 | 99 | 0.652931 |
5ce11ddde02bc4a3cf59a650a5e7c0137474f8d5 | 4,470 | py | Python | afkak/_protocol.py | ciena/afkak | e39fab350c203a7211f3f741fab9bdda877bb900 | [
"Apache-2.0"
] | 34 | 2016-05-12T02:37:05.000Z | 2021-12-02T23:47:21.000Z | afkak/_protocol.py | ciena/afkak | e39fab350c203a7211f3f741fab9bdda877bb900 | [
"Apache-2.0"
] | 100 | 2016-04-19T08:09:17.000Z | 2021-12-03T22:25:28.000Z | afkak/_protocol.py | ciena/afkak | e39fab350c203a7211f3f741fab9bdda877bb900 | [
"Apache-2.0"
] | 21 | 2016-05-12T02:39:33.000Z | 2021-07-08T10:02:08.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 Cyan, Inc.
# Copyright 2018 Ciena Corporation
#
# 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
#
# U... | 32.867647 | 109 | 0.668456 |
85d2005df2dc1d0749cedb4c8979eaca52f9a54c | 2,601 | py | Python | setup.py | redkyn/redkyn-common | 1ecaec46fe7f3e7fff404b7fcc30c6a188f54332 | [
"MIT"
] | 1 | 2020-06-04T14:49:16.000Z | 2020-06-04T14:49:16.000Z | setup.py | redkyn/redkyn-common | 1ecaec46fe7f3e7fff404b7fcc30c6a188f54332 | [
"MIT"
] | 1 | 2021-06-15T15:27:37.000Z | 2021-06-15T15:27:37.000Z | setup.py | redkyn/redkyn-common | 1ecaec46fe7f3e7fff404b7fcc30c6a188f54332 | [
"MIT"
] | 1 | 2020-02-05T19:39:32.000Z | 2020-02-05T19:39:32.000Z | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | 29.556818 | 77 | 0.652441 |
44b7e75b452a0ffee8c7eb97b71eea5c38d0c22e | 22,682 | py | Python | lib/data_store.py | strcrzy/grr | 60d113069b8016c3eba8bc735a3acbc5c738fda4 | [
"Apache-2.0"
] | 3 | 2016-02-20T13:06:31.000Z | 2017-12-15T12:09:01.000Z | lib/data_store.py | defaultnamehere/grr | ba1648b97a76f844ffb8e1891cc9e2680f9b1c6e | [
"Apache-2.0"
] | null | null | null | lib/data_store.py | defaultnamehere/grr | ba1648b97a76f844ffb8e1891cc9e2680f9b1c6e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""The main data store abstraction.
The data store is responsible for storing AFF4 objects permanently. This file
defines the basic interface of the data store, but there is no specific
implementation. Concrete implementations should extend the DataStore class and
provide non-abstract methods.
T... | 32.542324 | 80 | 0.680584 |
d0f055b7d317d8063ac8a1b6390c75c87eb3ccab | 255 | py | Python | matrix/common/exceptions.py | ambrosejcarr/matrix-service | f61252d79941fa962240e27062682c9676f07e95 | [
"MIT"
] | 11 | 2018-10-26T20:47:55.000Z | 2022-02-02T10:32:42.000Z | matrix/common/exceptions.py | ambrosejcarr/matrix-service | f61252d79941fa962240e27062682c9676f07e95 | [
"MIT"
] | 379 | 2018-06-04T22:44:33.000Z | 2020-06-03T00:20:08.000Z | matrix/common/exceptions.py | ambrosejcarr/matrix-service | f61252d79941fa962240e27062682c9676f07e95 | [
"MIT"
] | 4 | 2018-11-22T01:00:27.000Z | 2020-09-01T16:42:05.000Z | class MatrixException(Exception):
def __init__(self, status: int, title: str, detail: str = None, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.status = status
self.title = title
self.detail = detail
| 36.428571 | 93 | 0.615686 |
a7240654087fe61369c5f169bb92b06e4d7ea370 | 1,023 | py | Python | src2/timeslot/timeslot_3.py | unica-isde/isde | a9603d8b8d1a347447cec483108132aa1e8457eb | [
"Apache-2.0"
] | 7 | 2021-01-20T09:11:53.000Z | 2022-03-15T12:19:06.000Z | src2/timeslot/timeslot_3.py | unica-isde/isde | a9603d8b8d1a347447cec483108132aa1e8457eb | [
"Apache-2.0"
] | null | null | null | src2/timeslot/timeslot_3.py | unica-isde/isde | a9603d8b8d1a347447cec483108132aa1e8457eb | [
"Apache-2.0"
] | 10 | 2020-11-01T09:47:02.000Z | 2021-11-02T12:59:50.000Z | class TimeSlot:
"""A class to store time slot"""
minutes_in_hour = 60
def __init__(self, name='name'): # initialize an empty slot
self._timeslot = {'h': 0, 'm': 0}
self.name = name
# timeslot is an instance attribute
# (attribute of the object)
def set_h_m(self, h, m):... | 24.95122 | 79 | 0.595308 |
06b378c25e82dcaccb8d2839ec2d41b0fde9f052 | 797 | py | Python | apps/users/tests/test_models.py | FernanddoSalas/blog-api | 51faef7cc0edc31499ff0b3dfae38b59b58ada98 | [
"MIT"
] | 2 | 2019-05-30T04:23:34.000Z | 2019-05-30T04:23:57.000Z | apps/users/tests/test_models.py | FernanddoSalas/blog-api | 51faef7cc0edc31499ff0b3dfae38b59b58ada98 | [
"MIT"
] | null | null | null | apps/users/tests/test_models.py | FernanddoSalas/blog-api | 51faef7cc0edc31499ff0b3dfae38b59b58ada98 | [
"MIT"
] | null | null | null | """User models tests."""
# Django
from django.test import TestCase
# Models
from apps.users.models import User
# Exceptions
from django.db.utils import IntegrityError
class UserTest(TestCase):
"""Test the User model."""
def create_user(self):
"""Create a new user."""
data = {
'... | 24.151515 | 50 | 0.609787 |
8977c522cdd263f6121d0c8ecada44e2c11a45c6 | 3,248 | py | Python | clog/FTI.py | context-aware-Failure-Identification/CLog | ef2c87605fa3cdb6db6666c754311ab9c3fed371 | [
"MIT"
] | null | null | null | clog/FTI.py | context-aware-Failure-Identification/CLog | ef2c87605fa3cdb6db6666c754311ab9c3fed371 | [
"MIT"
] | null | null | null | clog/FTI.py | context-aware-Failure-Identification/CLog | ef2c87605fa3cdb6db6666c754311ab9c3fed371 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score
from sklearn.preprocessing import LabelEnc... | 41.641026 | 189 | 0.733374 |
ecce8237a4a52d1421e62608041ba0d7a6e65f5a | 183 | py | Python | src/graph_transpiler/webdnn/backend/webgpu/kernels/rsqrt.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | 1 | 2021-04-09T15:55:35.000Z | 2021-04-09T15:55:35.000Z | src/graph_transpiler/webdnn/backend/webgpu/kernels/rsqrt.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | src/graph_transpiler/webdnn/backend/webgpu/kernels/rsqrt.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | from webdnn.backend.webgpu.kernels.elementwise import register_elementwise_kernel
from webdnn.graph.operators.rsqrt import Rsqrt
register_elementwise_kernel(Rsqrt, "y = rsqrt(x0);")
| 36.6 | 81 | 0.84153 |
96e6d7f685004513803432925b0a2c923e2e42c6 | 10,613 | py | Python | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/colorama/ansitowin32.py | GinaJame/Portfolio_MLH | 541709dcf034ddca885a8b08f9922dc352c113f8 | [
"MIT"
] | 1 | 2022-03-06T13:06:33.000Z | 2022-03-06T13:06:33.000Z | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/colorama/ansitowin32.py | GinaJame/Portfolio_MLH | 541709dcf034ddca885a8b08f9922dc352c113f8 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/colorama/ansitowin32.py | GinaJame/Portfolio_MLH | 541709dcf034ddca885a8b08f9922dc352c113f8 | [
"MIT"
] | null | null | null | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
... | 40.200758 | 88 | 0.588429 |
8968afd0dae76ca2e97baba7c56ecf2493025ebd | 2,807 | py | Python | tests/strategies/test_hidden_single.py | benhorsburgh/pyslab | d495ca87110f1ac0fb1b49df49024f590bbb6c5c | [
"MIT"
] | null | null | null | tests/strategies/test_hidden_single.py | benhorsburgh/pyslab | d495ca87110f1ac0fb1b49df49024f590bbb6c5c | [
"MIT"
] | null | null | null | tests/strategies/test_hidden_single.py | benhorsburgh/pyslab | d495ca87110f1ac0fb1b49df49024f590bbb6c5c | [
"MIT"
] | null | null | null | import pytest
from pyslab.core.cells import row_cells, column_cells, box_cells
from pyslab.strategies.hidden_single import find_placements
from ..conftest import str_to_grid_candidates
class TestFindPlacements:
@staticmethod
def test_one_single_in_row():
grid, candidates = str_to_grid_candidates(
... | 33.023529 | 95 | 0.685429 |
5e609079818633d9b58df424220fc368f700003a | 733 | py | Python | xnat_dashboards/app/dashboards/model.py | XNAT-Dashboards/XNAT-Dashboards | a46b47d72cca5e15b02829ef8eb17ac92806af16 | [
"MIT"
] | null | null | null | xnat_dashboards/app/dashboards/model.py | XNAT-Dashboards/XNAT-Dashboards | a46b47d72cca5e15b02829ef8eb17ac92806af16 | [
"MIT"
] | 4 | 2021-11-10T19:09:37.000Z | 2022-03-04T16:07:19.000Z | xnat_dashboards/app/dashboards/model.py | XNAT-Dashboards/XNAT-Dashboards | a46b47d72cca5e15b02829ef8eb17ac92806af16 | [
"MIT"
] | 3 | 2020-10-20T06:34:20.000Z | 2021-11-12T15:51:20.000Z | import pickle
from xnat_dashboards import config
def load_users_data(server):
"""Opens pickle file to be used the the dashboard
controller.
Args:
server (str): URL of the server where user is
is registered.
Returns:
dict/None: If server details are mistaching it returns
... | 25.275862 | 66 | 0.612551 |
9ddaff0fc3e1f2494400ffd81ed26e17cc060ffa | 6,465 | py | Python | datablox_framework/datablox_framework/system_stats.py | mpi-sws-rse/datablox | 93af071e5f8a68dc83df1700ed657bd64aca8849 | [
"Apache-2.0"
] | null | null | null | datablox_framework/datablox_framework/system_stats.py | mpi-sws-rse/datablox | 93af071e5f8a68dc83df1700ed657bd64aca8849 | [
"Apache-2.0"
] | null | null | null | datablox_framework/datablox_framework/system_stats.py | mpi-sws-rse/datablox | 93af071e5f8a68dc83df1700ed657bd64aca8849 | [
"Apache-2.0"
] | null | null | null | """Package up various system statistics obtained from psutil package.
The caretaker creates a SystemStatsTaker object and periodically calls
take_snapshot(), which gathers the statistics
(which should be cumulative) and puts them in JSON-friendly form
to be sent back to the master.
"""
import sys
import socket
import ... | 36.320225 | 119 | 0.599691 |
b73845ed06fe27cb36fc0733293af2c3d6ba1c73 | 4,202 | py | Python | examples/connectivity/plot_mne_inverse_envelope_correlation.py | StevenLOL/mne-python | 2d31028f857b1b4de05d5098c4534a725b0323c2 | [
"BSD-3-Clause"
] | null | null | null | examples/connectivity/plot_mne_inverse_envelope_correlation.py | StevenLOL/mne-python | 2d31028f857b1b4de05d5098c4534a725b0323c2 | [
"BSD-3-Clause"
] | 28 | 2020-05-07T00:58:34.000Z | 2020-08-29T23:02:17.000Z | examples/connectivity/plot_mne_inverse_envelope_correlation.py | hichamjanati/mne-python | b8f5e5ce0da8acfeb7298c8eb1d26a75d5526eac | [
"BSD-3-Clause"
] | 1 | 2020-07-29T15:48:58.000Z | 2020-07-29T15:48:58.000Z | """
.. _ex-envelope-correlation:
=============================================
Compute envelope correlations in source space
=============================================
Compute envelope correlations of orthogonalized activity
:footcite:`HippEtAl2012,KhanEtAl2018` in source
space using resting state CTF data.
"""
# ... | 39.641509 | 78 | 0.605664 |
b6b73153c02e06c65c739d16e8ba484b8d11c437 | 1,027 | py | Python | samples/openapi3/client/petstore/python-experimental/test/test_class_model.py | tek08/openapi-generator | 5d14b46a5e305b8f1c541b1d6d96751f0626e363 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/test/test_class_model.py | tek08/openapi-generator | 5d14b46a5e305b8f1c541b1d6d96751f0626e363 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/test/test_class_model.py | tek08/openapi-generator | 5d14b46a5e305b8f1c541b1d6d96751f0626e363 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 20.54 | 174 | 0.659202 |
f6cc32f947ffaa1dece05e81ad6659f641b9cf47 | 18,228 | py | Python | libpysal/io/iohandlers/wk1.py | Kanahiro/dbf-df-translator | 6603ca1ac306203bf8c95e6545685c509324a438 | [
"MIT"
] | null | null | null | libpysal/io/iohandlers/wk1.py | Kanahiro/dbf-df-translator | 6603ca1ac306203bf8c95e6545685c509324a438 | [
"MIT"
] | null | null | null | libpysal/io/iohandlers/wk1.py | Kanahiro/dbf-df-translator | 6603ca1ac306203bf8c95e6545685c509324a438 | [
"MIT"
] | null | null | null | import struct
from .. import fileio
from ...weights import W
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>"
__all__ = ["Wk1IO"]
class Wk1IO(fileio.FileIO):
"""MATLAB ``wk1read.m`` and ``wk1write.m`` that were written by
Brian M. Bourgault in 10/22/93. Opens, reads, and writes weights
ile objects in L... | 47.46875 | 105 | 0.314242 |
6a13093ec251d45872665ecafcab14f4be241c2a | 9,279 | py | Python | homeassistant/components/harmony/remote.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/harmony/remote.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | 17 | 2021-11-17T02:32:23.000Z | 2022-03-31T06:22:34.000Z | homeassistant/components/harmony/remote.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | null | null | null | """Support for Harmony Hub devices."""
import json
import logging
import voluptuous as vol
from homeassistant.components import remote
from homeassistant.components.remote import (
ATTR_ACTIVITY,
ATTR_DELAY_SECS,
ATTR_DEVICE,
ATTR_HOLD_SECS,
ATTR_NUM_REPEATS,
DEFAULT_DELAY_SECS,
SUPPORT_AC... | 33.989011 | 91 | 0.66505 |
38d78167905f9e6583315eecee7d5d6a41bfce87 | 482 | py | Python | env/lib/python3.8/site-packages/plotly/validators/sunburst/hoverlabel/_namelengthsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/sunburst/hoverlabel/_namelengthsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/sunburst/hoverlabel/_namelengthsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="sunburst.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | 32.133333 | 86 | 0.651452 |
d59b6cc1e138d33fc83e05a02af26b51e77505d0 | 668 | py | Python | atcoder/abc/abc135_d.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/abc/abc135_d.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/abc/abc135_d.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | S = input()
dp = [[0] * 13 for _ in range(2)]
mod = 10**9 + 7
dp[0][0] = 1
pow10 = 1
for i, s in enumerate(S[::-1]):
now_idx, next_idx = i & 1, (i + 1) & 1
dp[next_idx] = [0] * 13
if s == '?':
for j in range(13):
for k in range(10):
next_mod = (j + k * pow10) % 13
... | 27.833333 | 56 | 0.452096 |
5cfee7a7a69e3a80038da7b8793a907b4ffa2b05 | 2,539 | py | Python | util/email_test.py | Dokeey/Buy-Sell | 9d70eb8649d79962657cc4be896e437908de537b | [
"MIT"
] | 7 | 2019-03-25T14:43:41.000Z | 2021-09-16T01:44:41.000Z | util/email_test.py | Dokeey/Buy-Sell | 9d70eb8649d79962657cc4be896e437908de537b | [
"MIT"
] | 80 | 2019-03-25T09:25:00.000Z | 2020-02-09T01:01:09.000Z | util/email_test.py | Dokeey/Buy-Sell | 9d70eb8649d79962657cc4be896e437908de537b | [
"MIT"
] | 4 | 2019-03-25T13:58:07.000Z | 2021-11-26T09:12:32.000Z | import math
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from accounts.supporter import send_mail
from random import randrange
class Lotto:
def __init__(self, cnt=None):
self.cnt = cnt
# 중복제거, 정렬
def create(self):
num_list = list(rang... | 23.95283 | 91 | 0.489169 |
004bf8c551a556f61f75d6c96d8a2818266ee9c9 | 6,498 | py | Python | v6.0.5/wanopt/test_fortios_wanopt_remote_storage.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.5/wanopt/test_fortios_wanopt_remote_storage.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.5/wanopt/test_fortios_wanopt_remote_storage.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... | 36.920455 | 133 | 0.695906 |
be7969ae8191de0992cba6e906240308f508f6ce | 12,759 | py | Python | bin/DistributionManager.py | ragmel/cocoma | 8c58816bcce4c77efb08067fe1e4bf7855089c43 | [
"Apache-2.0"
] | 2 | 2017-12-08T18:23:44.000Z | 2021-02-19T18:48:54.000Z | bin/DistributionManager.py | cragusa/cocoma | 8c58816bcce4c77efb08067fe1e4bf7855089c43 | [
"Apache-2.0"
] | 1 | 2017-12-16T21:19:33.000Z | 2017-12-18T16:16:31.000Z | bin/DistributionManager.py | cragusa/cocoma | 8c58816bcce4c77efb08067fe1e4bf7855089c43 | [
"Apache-2.0"
] | 1 | 2018-05-01T08:00:14.000Z | 2018-05-01T08:00:14.000Z | #!/usr/bin/env python
# Copyright 2012-2013 SAP 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 50.832669 | 376 | 0.607336 |
815b7ca97a1399025f521669b0ec97ac24bf1d2c | 317 | py | Python | pymc/tests/test_interactive.py | matthew-brett/pymc | 3a31613f056e7993a449d89bafef5fdaa40d47e9 | [
"MIT"
] | 5 | 2015-12-03T09:42:44.000Z | 2021-06-06T19:23:29.000Z | pymc/tests/test_interactive.py | matthew-brett/pymc | 3a31613f056e7993a449d89bafef5fdaa40d47e9 | [
"MIT"
] | 1 | 2016-09-27T02:00:41.000Z | 2016-09-27T02:15:32.000Z | pymc/tests/test_interactive.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | 1 | 2017-10-27T13:27:32.000Z | 2017-10-27T13:27:32.000Z | """
Test interactive sampler
"""
# TODO: Make real test case.
from pymc import MCMC
from pymc.examples import DisasterModel
import os, nose
def test_interactive():
S = MCMC(DisasterModel)
S.isample(200,100,2, out=open('testresults/interactive.log', 'w'))
if __name__ == '__main__':
nose.runmodule()
| 17.611111 | 71 | 0.70347 |
e593604ce72afcb19ac20d5d9fac7a0f1e0cb124 | 10,998 | py | Python | tests/commands/test_cluster_health.py | ViaQ/watches-cli | 25fc4d085798366cc676ebe346da43dd649e4681 | [
"Apache-2.0"
] | 1 | 2016-11-22T16:00:28.000Z | 2016-11-22T16:00:28.000Z | tests/commands/test_cluster_health.py | lukas-vlcek/watches-cli | 25fc4d085798366cc676ebe346da43dd649e4681 | [
"Apache-2.0"
] | 30 | 2016-11-30T09:10:17.000Z | 2017-06-07T12:33:46.000Z | tests/commands/test_cluster_health.py | lukas-vlcek/watches-cli | 25fc4d085798366cc676ebe346da43dd649e4681 | [
"Apache-2.0"
] | 1 | 2016-12-06T14:52:29.000Z | 2016-12-06T14:52:29.000Z | """Tests for our `watches cluster_health` subcommand."""
import json
from subprocess import PIPE, Popen as popen
from secure_support import TestSecureSupport
from watches.util import ESClientProducer
from six import string_types
class TestClusterHealth(TestSecureSupport):
username_password = ['--username', 'kir... | 47 | 119 | 0.64339 |
0ee80ca4bb178efea5d91eb26a5f47dcc3bb808e | 12,574 | py | Python | Cogs/Torment.py | skylarr1227/CorpBot.py | a6b4de2ff127320085411dd478e923c02d5e9f57 | [
"MIT"
] | null | null | null | Cogs/Torment.py | skylarr1227/CorpBot.py | a6b4de2ff127320085411dd478e923c02d5e9f57 | [
"MIT"
] | null | null | null | Cogs/Torment.py | skylarr1227/CorpBot.py | a6b4de2ff127320085411dd478e923c02d5e9f57 | [
"MIT"
] | null | null | null | import asyncio
import discord
import os
from datetime import datetime
from discord.ext import commands
from Cogs import DisplayName
def setup(bot):
# Add the bot and deps
settings = bot.get_cog("Settings")
bot.add_cog(Torment(bot, settings))
# This is the Torment module. It spams the target with ... | 29.24186 | 127 | 0.639733 |
412f3063630a4021340f3e96afcd0906070639ab | 1,362 | py | Python | passing/cq_examples/Ex004_Extruded_Cylindrical_Plate.py | RubenRubens/cq-testing | 558631a56b5751ef529f33d0aea4fe62ed8d5549 | [
"WTFPL"
] | null | null | null | passing/cq_examples/Ex004_Extruded_Cylindrical_Plate.py | RubenRubens/cq-testing | 558631a56b5751ef529f33d0aea4fe62ed8d5549 | [
"WTFPL"
] | null | null | null | passing/cq_examples/Ex004_Extruded_Cylindrical_Plate.py | RubenRubens/cq-testing | 558631a56b5751ef529f33d0aea4fe62ed8d5549 | [
"WTFPL"
] | null | null | null | import cadquery as cq
# These can be modified rather than hardcoding values for each dimension.
circle_radius = 50.0 # Radius of the plate
thickness = 13.0 # Thickness of the plate
rectangle_width = 13.0 # Width of rectangular hole in cylindrical plate
rectangle_length = 19.0 # Length of rectangular hole in cylind... | 45.4 | 79 | 0.737885 |
2957609c2acd4c3fe76170f93226bf4155b2a1e8 | 395 | py | Python | wordCount/wsgi.py | karthikkaiplody/wordCountProject | ca4b6302633e4359f0ee80ae78aace05d724279e | [
"MIT"
] | null | null | null | wordCount/wsgi.py | karthikkaiplody/wordCountProject | ca4b6302633e4359f0ee80ae78aace05d724279e | [
"MIT"
] | null | null | null | wordCount/wsgi.py | karthikkaiplody/wordCountProject | ca4b6302633e4359f0ee80ae78aace05d724279e | [
"MIT"
] | null | null | null | """
WSGI config for wordCount project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
5dcfc8163e167ec1e20f864ac86322b3c46245f3 | 141 | py | Python | Notebooks/MNIST/AutoEncoder/solutions/generate_single_sample.py | PhilBesse/MLTraining | 8edb180bcd75393d6a2eeed6f09085af8b5b68c3 | [
"MIT"
] | 10 | 2018-07-26T13:02:50.000Z | 2021-11-24T10:43:19.000Z | Notebooks/MNIST/AutoEncoder/solutions/generate_single_sample.py | PhilBesse/MLTraining | 8edb180bcd75393d6a2eeed6f09085af8b5b68c3 | [
"MIT"
] | null | null | null | Notebooks/MNIST/AutoEncoder/solutions/generate_single_sample.py | PhilBesse/MLTraining | 8edb180bcd75393d6a2eeed6f09085af8b5b68c3 | [
"MIT"
] | 10 | 2018-12-13T03:01:02.000Z | 2022-01-26T09:32:47.000Z | z_latents = np.expand_dims(np.random.normal(0,1,2), axis=0)
x_generate = decoder.predict(z_latents)
plt.imshow(x_generate[0].reshape(28, 28)) | 47 | 59 | 0.765957 |
2988033b2ff760e155095c863a74dbe87559f784 | 645 | py | Python | factorial.py | erickyudha/mathbot-backend-api | a479b06fbd8e8a95e110e6e1f38af20bcd9f9971 | [
"MIT"
] | null | null | null | factorial.py | erickyudha/mathbot-backend-api | a479b06fbd8e8a95e110e6e1f38af20bcd9f9971 | [
"MIT"
] | null | null | null | factorial.py | erickyudha/mathbot-backend-api | a479b06fbd8e8a95e110e6e1f38af20bcd9f9971 | [
"MIT"
] | null | null | null | MENU_TEXT = '''Factorial Calculator
by MathBot.
-exit to go back to main menu'''
EXC_TEXT = '''Invalid input!
try again or -exit to go back to main menu'''
def calc_factorial(num):
num = int(num)
if num == 0:
return 1
else:
return num * calc_factorial(num - 1)
def factoria... | 20.15625 | 55 | 0.545736 |
f45c3e286bf133d1ba41915ac87342ecfd3b4547 | 2,392 | py | Python | primehub-sdk-ct-pipeline/src/iris_training.py | InfuseAI/showcase | 54a177168c6e173580ed5c58fe97fe6018ecd06e | [
"Apache-2.0"
] | 1 | 2022-03-22T03:54:41.000Z | 2022-03-22T03:54:41.000Z | primehub-sdk-ct-pipeline/src/iris_training.py | InfuseAI/showcase | 54a177168c6e173580ed5c58fe97fe6018ecd06e | [
"Apache-2.0"
] | 4 | 2021-11-01T05:24:11.000Z | 2022-03-29T05:21:02.000Z | primehub-sdk-ct-pipeline/src/iris_training.py | InfuseAI/showcase | 54a177168c6e173580ed5c58fe97fe6018ecd06e | [
"Apache-2.0"
] | null | null | null | import mlflow
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
class IrisTraining:
def __init__(self):
self.df = None
self... | 33.690141 | 86 | 0.640468 |
2fadeab5b07011c87afd677b4eec3d7795db32e1 | 731 | py | Python | exer521.py | profnssorg/valmorMantelli1 | a9a42218b54da208e834f333aa5242d14639b28b | [
"MIT"
] | null | null | null | exer521.py | profnssorg/valmorMantelli1 | a9a42218b54da208e834f333aa5242d14639b28b | [
"MIT"
] | null | null | null | exer521.py | profnssorg/valmorMantelli1 | a9a42218b54da208e834f333aa5242d14639b28b | [
"MIT"
] | null | null | null | ###Titulo: Contagem de cédulas e modedas
###Função: Este programa le o valor e apresenta a quantidade de cédulas para pagar com repetição
###Autor: Valmor Mantelli Jr.
###Data: 27/12/2018
###Versão: 0.0.3
# Declaração de variáve e atribuição de valor
while True:
valor = float(input("Digite o valor a pagar: "))
if v... | 18.74359 | 96 | 0.618331 |
b3df36f5c845cf1605a6d4087037b0a175f8e0c9 | 280 | py | Python | events/apps.py | jannetasa/haravajarjestelma | 419f23656306d94ae4d9a8d3477a6325cc80b601 | [
"MIT"
] | null | null | null | events/apps.py | jannetasa/haravajarjestelma | 419f23656306d94ae4d9a8d3477a6325cc80b601 | [
"MIT"
] | 79 | 2018-11-26T09:43:41.000Z | 2022-02-10T08:19:11.000Z | events/apps.py | jannetasa/haravajarjestelma | 419f23656306d94ae4d9a8d3477a6325cc80b601 | [
"MIT"
] | 3 | 2018-11-27T08:08:22.000Z | 2022-03-25T08:30:34.000Z | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class EventsConfig(AppConfig):
name = "events"
verbose_name = _("Events")
def ready(self):
import events.receivers # noqa
import events.notifications # noqa
| 23.333333 | 55 | 0.707143 |
a924139fc7251134a2bb6bae6967f738d1e15207 | 3,197 | py | Python | 2020/day16/part02.py | sysboy/aoc | 536fc6eb46c2f0a677253de1ff9bc30c9f2f875b | [
"MIT"
] | 1 | 2020-12-02T08:33:16.000Z | 2020-12-02T08:33:16.000Z | 2020/day16/part02.py | sysboy/aoc | 536fc6eb46c2f0a677253de1ff9bc30c9f2f875b | [
"MIT"
] | null | null | null | 2020/day16/part02.py | sysboy/aoc | 536fc6eb46c2f0a677253de1ff9bc30c9f2f875b | [
"MIT"
] | 1 | 2020-12-07T12:43:51.000Z | 2020-12-07T12:43:51.000Z | #!/usr/bin/env python3.7
""" AOC day 16 """
import sys,re,copy,time
#departure location: 26-715 or 727-972
m = re.compile(r'^(?P<rule>[class]+): (?P<l1>\d+)\-(?P<h1>\d+]) or (?P<l2>\d+)\-(?P<h2>\d+])')
m = re.compile(r'(?P<rule>[departure location]+): (?P<l1>[0-9]+)=(?P<h1>[0-9]+) or (?P<l2>[0-9]+)-(?P<h2>[0-9]+)')
... | 27.09322 | 114 | 0.500469 |
682ef64abfc5484bef459dbe7cdba4f6949055d0 | 1,811 | py | Python | trading_sim/dataLoad.py | adanielnoel/NeuroTraders | 0b9d56b3c327ecb2f2b8c6461056260aa91499ad | [
"MIT"
] | 5 | 2018-03-17T07:32:32.000Z | 2019-07-29T14:13:24.000Z | trading_sim/dataLoad.py | adanielnoel/NeuroTraders | 0b9d56b3c327ecb2f2b8c6461056260aa91499ad | [
"MIT"
] | 2 | 2018-07-04T00:32:16.000Z | 2018-07-05T17:12:55.000Z | trading_sim/dataLoad.py | adanielnoel/NeuroTraders | 0b9d56b3c327ecb2f2b8c6461056260aa91499ad | [
"MIT"
] | 2 | 2017-11-20T12:59:51.000Z | 2018-03-13T20:32:20.000Z | import pandas
import numpy as np
run_on_true_data = True
if run_on_true_data:
csv = pandas.read_csv("./Best_Modelzz/AMZN/RNN_2_results.csv", header=4)
errors = csv.iloc[:, 0]
csv = pandas.read_csv("./Best_Modelzz/AMZN/RNN_1_results.csv", header=5)
prices = csv.iloc[:, 0]
relative_change ... | 44.170732 | 123 | 0.690779 |
b4399a1381109ae943528e3f5f95ef2eaf43858f | 277 | py | Python | Python/fizzBuzz.py | prajwal-scorpionking123/Fizz-Buzz | 97c5602e044700c65d7d96ca46549618196f1a7a | [
"MIT"
] | null | null | null | Python/fizzBuzz.py | prajwal-scorpionking123/Fizz-Buzz | 97c5602e044700c65d7d96ca46549618196f1a7a | [
"MIT"
] | null | null | null | Python/fizzBuzz.py | prajwal-scorpionking123/Fizz-Buzz | 97c5602e044700c65d7d96ca46549618196f1a7a | [
"MIT"
] | null | null | null | def fizz_Buzz(input):
if (input % 3 == 0) and (input % 5 == 0):
return "FizzBuzz"
if input % 3 == 0:
return "Fizz"
if input % 5 == 0:
return "Buzz"
return input
print(fizz_Buzz(3)) #Fizz
print(fizz_Buzz(5)) #Buzz
print(fizz_Buzz(7)) #7
| 21.307692 | 45 | 0.552347 |
869d5eeeb1609773d1dfa06b9d43f8d1459e7c74 | 172 | py | Python | .history/ClassFiles/ImagesInPython/Images_20210109171126.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/ImagesInPython/Images_20210109171126.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/ImagesInPython/Images_20210109171126.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | """ Working with Images in Python
What is Pul?
PIL stands for Python Imaging Library
PIL allows me to manipulate images.
"""
| 21.5 | 50 | 0.552326 |
560738fc9da6464f55fb5fd42b7abc7df3d44d3a | 3,627 | py | Python | ocelot/transformations/parameterization/implicit_references.py | cmutel/Ocelot | 20e9639570c43f84ae255750a6c402ebabe00981 | [
"BSD-3-Clause"
] | 21 | 2016-06-01T14:10:07.000Z | 2022-02-28T01:56:31.000Z | ocelot/transformations/parameterization/implicit_references.py | cmutel/Ocelot | 20e9639570c43f84ae255750a6c402ebabe00981 | [
"BSD-3-Clause"
] | 152 | 2016-05-16T21:33:22.000Z | 2019-06-24T12:57:14.000Z | ocelot/transformations/parameterization/implicit_references.py | cmutel/Ocelot | 20e9639570c43f84ae255750a6c402ebabe00981 | [
"BSD-3-Clause"
] | 12 | 2016-09-05T15:35:59.000Z | 2021-07-03T19:28:47.000Z | # -*- coding: utf-8 -*-
from ...io.ecospold2_meta import REFERENCE_REGULAR_EXPRESSIONS
from ..utils import iterate_all_parameters
import logging
logger = logging.getLogger('ocelot')
def get_exchange_reference(formula):
"""Return list of ``(full_reference_strings, uuid)`` from string ``formula``.
Finds ``Ref... | 39.857143 | 122 | 0.601323 |
1e41d24abfe8de58b86ed92dc5ed4811f293d8f5 | 10,881 | py | Python | official/bert/run_classifier1.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | official/bert/run_classifier1.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | official/bert/run_classifier1.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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... | 40.151292 | 101 | 0.661796 |
c9e0aaee6814be9c46777e2e0a9d687249554c3d | 1,766 | py | Python | training/train_diverse.py | ShengYun-Peng/selfstudy-adversarial-robustness | 6501370c57920b4615315bff714244ece414199c | [
"Apache-2.0"
] | 86 | 2021-05-06T02:00:16.000Z | 2022-03-26T06:58:57.000Z | training/train_diverse.py | tuananhbui89/selfstudy-adversarial-robustness | 6501370c57920b4615315bff714244ece414199c | [
"Apache-2.0"
] | 4 | 2021-05-21T00:08:34.000Z | 2021-05-25T19:04:21.000Z | training/train_diverse.py | tuananhbui89/selfstudy-adversarial-robustness | 6501370c57920b4615315bff714244ece414199c | [
"Apache-2.0"
] | 11 | 2021-05-13T18:46:40.000Z | 2022-02-15T12:45:43.000Z | # 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 agreed to in writing, ... | 28.483871 | 78 | 0.686297 |
bda4efed40c45792c8f049ade8a5fee93ef2ac12 | 3,129 | py | Python | estacionamento/settings.py | franciscoRic/Estacionamento | 2b435456f92122e576b8055db052971add5862bc | [
"MIT"
] | null | null | null | estacionamento/settings.py | franciscoRic/Estacionamento | 2b435456f92122e576b8055db052971add5862bc | [
"MIT"
] | null | null | null | estacionamento/settings.py | franciscoRic/Estacionamento | 2b435456f92122e576b8055db052971add5862bc | [
"MIT"
] | null | null | null | """
Django settings for estacionamento project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from ... | 25.647541 | 91 | 0.699265 |
0e6e81517aee11dbd053ada3c2adcbf51a18f6c4 | 67 | py | Python | scripts/portal/BPReturn_Magnus.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/portal/BPReturn_Magnus.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/portal/BPReturn_Magnus.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # 101020400
def init():
sm.warp(401000000, 1)
sm.dispose() | 13.4 | 25 | 0.61194 |
049fd80791685899812b47b86c09d087a7edba95 | 1,404 | py | Python | webapp/webapp/demo/migrations/0002_downloader_medcatmodel.py | willmaclean/MedCAT | 528a4765acbdf04acf8a8bd90a4f19bc1e3e33c3 | [
"MIT"
] | null | null | null | webapp/webapp/demo/migrations/0002_downloader_medcatmodel.py | willmaclean/MedCAT | 528a4765acbdf04acf8a8bd90a4f19bc1e3e33c3 | [
"MIT"
] | null | null | null | webapp/webapp/demo/migrations/0002_downloader_medcatmodel.py | willmaclean/MedCAT | 528a4765acbdf04acf8a8bd90a4f19bc1e3e33c3 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2022-01-27 10:45
import django.core.files.storage
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('demo', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Downloader',
... | 39 | 141 | 0.587607 |
dc6612aea9685e4ad8cd7a65099244457c79d665 | 310 | py | Python | nanomsg/forwarder/forwarder.py | kianby/sandbox | 58cd71c8b029a15fae896e640a8d8b773fffb982 | [
"Apache-2.0"
] | 1 | 2017-12-12T18:10:29.000Z | 2017-12-12T18:10:29.000Z | nanomsg/forwarder/forwarder.py | kianby/sandbox | 58cd71c8b029a15fae896e640a8d8b773fffb982 | [
"Apache-2.0"
] | 4 | 2020-07-15T21:38:27.000Z | 2021-04-08T08:48:54.000Z | nanomsg/forwarder/forwarder.py | kianby/sandbox | 58cd71c8b029a15fae896e640a8d8b773fffb982 | [
"Apache-2.0"
] | null | null | null | import nnpy
import time
pub = nnpy.Socket(nnpy.AF_SP, nnpy.PUB)
pub.bind('tcp://127.0.0.1:5555')
sub = nnpy.Socket(nnpy.AF_SP, nnpy.SUB)
sub.bind('tcp://127.0.0.1:5565')
sub.setsockopt(nnpy.SUB, nnpy.SUB_SUBSCRIBE, '')
while True:
msg = sub.recv()
print("forwarder log: %s" % msg)
pub.send(msg)
| 20.666667 | 48 | 0.66129 |
d79fbfd2fe77be4c9fb20bb8372beb021dbea7d3 | 814 | py | Python | tests/core.py | WindSoilder/try_access_page_until_success | 96f6496184534428dbd8efe0b70b0c90b54a4299 | [
"MIT"
] | 2 | 2020-11-07T15:11:15.000Z | 2020-11-25T12:33:54.000Z | tests/core.py | WindSoilder/try_access_page_until_success | 96f6496184534428dbd8efe0b70b0c90b54a4299 | [
"MIT"
] | 1 | 2021-06-01T21:55:09.000Z | 2021-06-01T21:55:09.000Z | tests/core.py | WindSoilder/try_access_page_until_success | 96f6496184534428dbd8efe0b70b0c90b54a4299 | [
"MIT"
] | null | null | null | '''
unittest for functions in core.py
'''
import unittest
from .context import retrier
class CoreFunctionTest(unittest.TestCase):
def test_auto_retry(self):
url = 'http://www.bing.com'
email = 'test@email.com'
self.assertTrue(retrier.auto_retry(url, email))
def test_auto_retry_when_la... | 31.307692 | 68 | 0.676904 |
64ca7eb3e979d5b1ed34754febae775032a576fb | 2,505 | py | Python | scripts/codigos_postales.py | open-mexico/mexpost | e563d768b25507819f9d0e9ba0064c8380999d65 | [
"MIT"
] | null | null | null | scripts/codigos_postales.py | open-mexico/mexpost | e563d768b25507819f9d0e9ba0064c8380999d65 | [
"MIT"
] | 108 | 2021-08-30T01:07:11.000Z | 2022-03-25T00:33:39.000Z | scripts/codigos_postales.py | open-mexico/mexpost | e563d768b25507819f9d0e9ba0064c8380999d65 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""codigos_postales.py
@author Arturo Ortega (@macarthuror)
https://github.com/macarthuror
@project MexPost
https://github.com/macarthuror/mexpost
Created at: 24/04/2021
Edited at: 24/04/2021
Required pacages:
- pandas
- sqlalchemy
- mysqlclient
"""
import pandas as pd
from sqlalchemy impor... | 41.75 | 212 | 0.727345 |
685b14128d85a493579ac894f35863b991794d55 | 617 | py | Python | bots/followfollwers.py | explore-thulani/tweepy-bots | b658a2d5d7f7d369abbe13b320a20fc1fdac6c37 | [
"MIT"
] | null | null | null | bots/followfollwers.py | explore-thulani/tweepy-bots | b658a2d5d7f7d369abbe13b320a20fc1fdac6c37 | [
"MIT"
] | null | null | null | bots/followfollwers.py | explore-thulani/tweepy-bots | b658a2d5d7f7d369abbe13b320a20fc1fdac6c37 | [
"MIT"
] | null | null | null | # tweepy-bots/bots/followfollowers.py
import tweepy
import logging
from config import create_api
import time
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
def follow_followers(api):
logger.info("Retrieving and following followers")
for follower in tweepy.Cursor(api.followers).items():
... | 22.851852 | 57 | 0.679092 |
6d821060b550c9c8075558f4c78b576c8f5507c7 | 2,989 | py | Python | tests/unit/docs/test_attr.py | mriedem/ibm-cos-sdk-python | f3892fbff6915d74558153826da58937ddb7ec2d | [
"Apache-2.0"
] | null | null | null | tests/unit/docs/test_attr.py | mriedem/ibm-cos-sdk-python | f3892fbff6915d74558153826da58937ddb7ec2d | [
"Apache-2.0"
] | null | null | null | tests/unit/docs/test_attr.py | mriedem/ibm-cos-sdk-python | f3892fbff6915d74558153826da58937ddb7ec2d | [
"Apache-2.0"
] | null | null | null | # Copyright 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
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accomp... | 38.320513 | 78 | 0.584811 |
a1e912960570254ee2ac7ad82f4344eafbc2be85 | 443 | py | Python | other/exerciseHours.py | aleksander-GD/AI-F20 | c5d086e317f657c1b7a2d2179eafcef0267755ed | [
"MIT"
] | null | null | null | other/exerciseHours.py | aleksander-GD/AI-F20 | c5d086e317f657c1b7a2d2179eafcef0267755ed | [
"MIT"
] | null | null | null | other/exerciseHours.py | aleksander-GD/AI-F20 | c5d086e317f657c1b7a2d2179eafcef0267755ed | [
"MIT"
] | null | null | null | def multiplyBy2(num):
return num * 2
# remove all even numbers from list
def checkEven(num):
return (num % 2) == 0
def listOnlyWithEvenNumbers(l):
return [(en % 2) == 0 for en in l]
def testComprehensionlists1(list):
newli = [multiplyBy2(x) for x in list]
print(newli)
def main():
testCom... | 17.038462 | 51 | 0.636569 |
d75b8bcbe8b0043da3c32ef1ba3518bc2ae0a801 | 6,820 | py | Python | egs/yomdle_tamil/v1/local/yomdle/yomdle2csv.py | LanceaKing/kaldi | eb205a83f08fb8056ba1deb03c505ec8b722d4d9 | [
"Apache-2.0"
] | 116 | 2016-10-25T06:04:49.000Z | 2022-03-13T02:30:52.000Z | egs/yomdle_tamil/v1/local/yomdle/yomdle2csv.py | LanceaKing/kaldi | eb205a83f08fb8056ba1deb03c505ec8b722d4d9 | [
"Apache-2.0"
] | 38 | 2018-04-03T14:25:35.000Z | 2022-02-19T21:03:11.000Z | egs/yomdle_tamil/v1/local/yomdle/yomdle2csv.py | LanceaKing/kaldi | eb205a83f08fb8056ba1deb03c505ec8b722d4d9 | [
"Apache-2.0"
] | 52 | 2016-04-21T13:38:21.000Z | 2022-02-16T08:33:13.000Z | #!/usr/bin/env python3
'''
GEDI2CSV
Convert GEDI-type bounding boxes to CSV format
'''
import logging
import os
import sys
import time
import glob
import csv
import imghdr
from PIL import Image
import argparse
import pdb
import cv2
import numpy as np
import xml.etree.ElementTree as ET
sin = np.sin
cos = np.cos
pi ... | 31.574074 | 146 | 0.537243 |
ff2867d013d67ea64ca5f9dcfb5a19bce82a5323 | 1,917 | py | Python | samples/fireworks.py | Eeems/asciimatics | f40a651c7fe477082a2f37b251a2fb2061036d6e | [
"Apache-2.0"
] | 1 | 2021-08-31T03:27:44.000Z | 2021-08-31T03:27:44.000Z | samples/fireworks.py | scottmudge/asciimatics | 34cf7861bedf09a5e0b1b7caf9e25cf5cd8bc938 | [
"Apache-2.0"
] | null | null | null | samples/fireworks.py | scottmudge/asciimatics | 34cf7861bedf09a5e0b1b7caf9e25cf5cd8bc938 | [
"Apache-2.0"
] | null | null | null | from asciimatics.effects import Stars, Print
from asciimatics.particles import RingFirework, SerpentFirework, StarFirework, \
PalmFirework
from asciimatics.renderers import SpeechBubble, FigletText, Rainbow
from asciimatics.scene import Scene
from asciimatics.screen import Screen
from asciimatics.exceptions import ... | 31.95 | 80 | 0.539384 |
9b5a0cea53c000a752bb9a3c7ec9f9e0c31a21a3 | 933 | py | Python | bot_log.py | shhubhxm/DODO-price-advantage-tweet-alert | fdc0e595dea887c971b625483a8aad627a252bc6 | [
"MIT"
] | 4 | 2021-05-16T07:26:10.000Z | 2021-05-25T12:30:58.000Z | bot_log.py | shhubhxm/DODO-price-advantage-tweet-alert | fdc0e595dea887c971b625483a8aad627a252bc6 | [
"MIT"
] | null | null | null | bot_log.py | shhubhxm/DODO-price-advantage-tweet-alert | fdc0e595dea887c971b625483a8aad627a252bc6 | [
"MIT"
] | 1 | 2021-10-16T06:24:03.000Z | 2021-10-16T06:24:03.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 10 10:20:02 2021
@author: divyp
"""
import csv
def createcsv(filename):
with open(f"logs/{filename}.csv", 'w', newline='') as myfile:
wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
heading = ["Timestamp","Currency Pair","Change Status","Tweet status"]... | 35.884615 | 78 | 0.606645 |
1414a614f8bee7b4a2d1bcd577784a1a36f9c05d | 3,919 | py | Python | faxplus/models/payload_number_modification.py | berryman121/faxplus-python | c4779c0fba4124da23e02359604170977e65cd80 | [
"MIT"
] | 1 | 2018-07-05T23:52:32.000Z | 2018-07-05T23:52:32.000Z | faxplus/models/payload_number_modification.py | allzamye/faxplus-python | c4779c0fba4124da23e02359604170977e65cd80 | [
"MIT"
] | null | null | null | faxplus/models/payload_number_modification.py | allzamye/faxplus-python | c4779c0fba4124da23e02359604170977e65cd80 | [
"MIT"
] | 1 | 2018-07-05T23:52:35.000Z | 2018-07-05T23:52:35.000Z | # coding: utf-8
"""
FAX.PLUS REST API
This is the fax.plus API v1 developed for third party developers and organizations. In order to have a better coding experience with this API, let's quickly go through some points:<br /><br /> - This API assumes **/accounts** as an entry point with the base url of **https... | 34.681416 | 903 | 0.609849 |
e5fe7e312cde0cb55896f7bbf03bf6a2e8447e28 | 207 | py | Python | thinpad/__init__.py | z4yx/Thinpad-Cloud-SDK | a4216ab16aa3fa16fe4132340cacea2e12419678 | [
"MIT"
] | null | null | null | thinpad/__init__.py | z4yx/Thinpad-Cloud-SDK | a4216ab16aa3fa16fe4132340cacea2e12419678 | [
"MIT"
] | null | null | null | thinpad/__init__.py | z4yx/Thinpad-Cloud-SDK | a4216ab16aa3fa16fe4132340cacea2e12419678 | [
"MIT"
] | null | null | null | from .cloud import ThinpadCloud
from .__version__ import __version__
BOARD_REV2 = 2
BOARD_REV3 = 7
BOARD_LOONG = 6
UART_CPLD = 0
UART_EXT = 1
MEM_BASE_RAM = 'base'
MEM_EXT_RAM = 'ext'
MEM_FLASH = 'flash'
| 14.785714 | 36 | 0.753623 |
f57875d073de1419cf3f324c286705d5fb2cf45f | 3,272 | py | Python | tests/ut/python/predict/test_predict_save_model.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | 2 | 2020-08-12T16:14:40.000Z | 2020-12-04T03:05:57.000Z | tests/ut/python/predict/test_predict_save_model.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | tests/ut/python/predict/test_predict_save_model.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.808511 | 112 | 0.673594 |
c925399bfcab8d7ccbac85d12f0587bc50fee5b8 | 3,648 | py | Python | hood/settings.py | yahyasaadi/jirani | 2f6d1da9a2a83636230461ec73aad2bb95fab8b7 | [
"MIT"
] | null | null | null | hood/settings.py | yahyasaadi/jirani | 2f6d1da9a2a83636230461ec73aad2bb95fab8b7 | [
"MIT"
] | null | null | null | hood/settings.py | yahyasaadi/jirani | 2f6d1da9a2a83636230461ec73aad2bb95fab8b7 | [
"MIT"
] | null | null | null | """
Django settings for hood project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
import os
from ... | 25.333333 | 91 | 0.70477 |
a89582081bb5033a1ab1268d1bb9450155449ff1 | 4,784 | py | Python | alipay/aop/api/domain/AlipayUserPartnerPrivilegeSyncModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayUserPartnerPrivilegeSyncModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayUserPartnerPrivilegeSyncModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserPartnerPrivilegeSyncModel(object):
def __init__(self):
self._biz_time = None
self._current_count = None
self._grade = None
self._max_count = None
... | 29.714286 | 77 | 0.576505 |
ff528de689357a41a3bf4d0dfaf4ffd7e3b18c16 | 316 | py | Python | Exercises/uniques_only/uniques.py | t-reppert/PythonMorsels | c681b7dd0d91b4c97bfd45d88c629542f7ce1b96 | [
"MIT"
] | null | null | null | Exercises/uniques_only/uniques.py | t-reppert/PythonMorsels | c681b7dd0d91b4c97bfd45d88c629542f7ce1b96 | [
"MIT"
] | null | null | null | Exercises/uniques_only/uniques.py | t-reppert/PythonMorsels | c681b7dd0d91b4c97bfd45d88c629542f7ce1b96 | [
"MIT"
] | null | null | null |
def uniques_only(nums):
hashable = set()
unhashable = []
for n in nums:
try:
if n not in hashable:
yield n
hashable.add(n)
except TypeError:
if n not in unhashable:
yield n
unhashable.append(n)
| 16.631579 | 36 | 0.452532 |
b527a05a69820e2c445f9ab76a4b43b229203793 | 2,089 | py | Python | Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/5.Handling-Authentication/auth_demo/accounts/views.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 4 | 2017-10-10T14:00:40.000Z | 2021-01-27T14:08:26.000Z | Stream-3/Full-Stack-Development/12.Stripe-Basic-Payments/2.Taking-Credit-Card-Details-With-Stripe-And-Generating-A-Stripe-Token/we_are_social/accounts/views.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 115 | 2019-10-24T11:18:33.000Z | 2022-03-11T23:15:42.000Z | Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/5.Handling-Authentication/auth_demo/accounts/views.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 5 | 2017-09-22T21:42:39.000Z | 2020-02-07T02:18:11.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import messages, auth
from django.core.urlresolvers import reverse
from django.shortcuts import render, redirect
from django.template.context_processors import csrf
from accounts.forms import UserRegistrationForm, UserLoginForm
from dja... | 30.720588 | 81 | 0.630445 |
4e88ddf91bd2313d21969882919cfba3a34075db | 202 | py | Python | python/test/context.py | mohawkjohn/cannonball | 886c159cd7860f896ed4ae6f23aa2a1a82c8d585 | [
"BSD-3-Clause"
] | null | null | null | python/test/context.py | mohawkjohn/cannonball | 886c159cd7860f896ed4ae6f23aa2a1a82c8d585 | [
"BSD-3-Clause"
] | null | null | null | python/test/context.py | mohawkjohn/cannonball | 886c159cd7860f896ed4ae6f23aa2a1a82c8d585 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import numpy as np
from scipy import linalg
import math
import unittest
import cannonball as cb
| 18.363636 | 82 | 0.767327 |
55709d1592f6173cbebaa3690a3da93fc7fbcd28 | 1,823 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/destipv6address_6333f28bd3662f5a8f83aabc7ece2d2a.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/topology/destipv6address_6333f28bd3662f5a8f83aabc7ece2d2a.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/topology/destipv6address_6333f28bd3662f5a8f83aabc7ece2d2a.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, ... | 37.979167 | 156 | 0.707625 |
a77a738c4a06c5c16773a6826de505b782709672 | 1,961 | py | Python | hubcave/game/random_walk.py | naphthalene/hubcave | e74edfe3b7700e1af5be90cf4765f19633ba2ebf | [
"MIT"
] | 1 | 2015-01-06T03:18:25.000Z | 2015-01-06T03:18:25.000Z | hubcave/game/random_walk.py | naphthalene/hubcave | e74edfe3b7700e1af5be90cf4765f19633ba2ebf | [
"MIT"
] | null | null | null | hubcave/game/random_walk.py | naphthalene/hubcave | e74edfe3b7700e1af5be90cf4765f19633ba2ebf | [
"MIT"
] | null | null | null | from random import random
from math import floor
MAP_SIZE = 30
FLOOR_COVERAGE = 35.0 # %
INITIAL_BUFFER = 5.0 # % border
# 0 -> wall
# 1 -> floor
def random_walk(map_size=MAP_SIZE, floor_coverage=FLOOR_COVERAGE, init_buffer=INITIAL_BUFFER):
initial_map = [[0 for j in range(map_size)] for i in range(map_size)]
... | 36.314815 | 94 | 0.568587 |
66dc3434012bd09c5ac810f2831081242b9fa0f6 | 6,328 | py | Python | tfLib/flowfield.py | davidfu0826/GazeCorrection | 863dbabe315994d612f8c45c98ef2ab731e9e619 | [
"Apache-2.0"
] | null | null | null | tfLib/flowfield.py | davidfu0826/GazeCorrection | 863dbabe315994d612f8c45c98ef2ab731e9e619 | [
"Apache-2.0"
] | null | null | null | tfLib/flowfield.py | davidfu0826/GazeCorrection | 863dbabe315994d612f8c45c98ef2ab731e9e619 | [
"Apache-2.0"
] | null | null | null | import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
def bilinear_sample(input, flow, name):
# reference to spatial transform network
# 1.details can be found in office release:
# https://github.com/tensorflow/models/blob/master/research/transformer/spatial_transformer.py
# 2.maybe anoth... | 45.855072 | 128 | 0.577592 |
a41b1ff4e465accd9b11086fcace9e7806d8eff0 | 1,912 | py | Python | archived/s3/S3File.py | DS3Lab/LambdaML | 0afca7819e08632ba116fec8e102084e4040a47a | [
"Apache-2.0"
] | 23 | 2021-05-17T09:24:24.000Z | 2022-01-29T18:40:44.000Z | archived/s3/S3File.py | DS3Lab/LambdaML | 0afca7819e08632ba116fec8e102084e4040a47a | [
"Apache-2.0"
] | 2 | 2021-05-17T16:15:12.000Z | 2021-07-20T09:11:22.000Z | archived/s3/S3File.py | DS3Lab/LambdaML | 0afca7819e08632ba116fec8e102084e4040a47a | [
"Apache-2.0"
] | 3 | 2021-05-17T09:31:53.000Z | 2021-12-02T16:29:59.000Z | import io
class S3File(io.RawIOBase):
def __init__(self, s3_object):
self.s3_object = s3_object
self.position = 0
def __repr__(self):
return "<%s s3_object=%r>" % (type(self).__name__, self.s3_object)
@property
def size(self):
return self.s3_object.conten... | 27.710145 | 77 | 0.554916 |
212e4b418b2565cbb5f122a69a41857e1c69d46e | 1,005 | py | Python | latex/install_texlive_without_docs_py2.py | rykugur/containers | 8112f62d1731132264a23d81c223b0d83a21707b | [
"CC0-1.0"
] | 5 | 2020-07-18T03:16:43.000Z | 2020-10-24T22:27:12.000Z | latex/install_texlive_without_docs_py2.py | rykugur/containers | 8112f62d1731132264a23d81c223b0d83a21707b | [
"CC0-1.0"
] | null | null | null | latex/install_texlive_without_docs_py2.py | rykugur/containers | 8112f62d1731132264a23d81c223b0d83a21707b | [
"CC0-1.0"
] | 4 | 2020-08-28T20:57:22.000Z | 2020-11-11T12:39:21.000Z | """
Source: https://gist.github.com/briandk/924d101f28dbf309758206fa3eff32b4
Help: https://docs.python.org/3/library/subprocess.html#call-function-trio
Port of the python 3 version to python 2.
"""
import subprocess
get_line_by_line_texlive_dependencies = subprocess.check_output(
["apt-cache", "depends", "texlive... | 27.916667 | 77 | 0.751244 |
22fd66b70ad9e458f66458aef2417c5df5443e28 | 44 | py | Python | stats/__init__.py | aturfah/cmplxsys530-final | c7365a2face3ba10f5cb502d8bd964b60990a9f5 | [
"MIT"
] | 4 | 2020-11-03T19:48:10.000Z | 2021-04-08T03:45:07.000Z | stats/__init__.py | aturfah/cmplxsys530-final | c7365a2face3ba10f5cb502d8bd964b60990a9f5 | [
"MIT"
] | 96 | 2018-02-14T00:49:14.000Z | 2019-09-25T14:07:39.000Z | stats/__init__.py | aturfah/cmplxsys530-final | c7365a2face3ba10f5cb502d8bd964b60990a9f5 | [
"MIT"
] | 2 | 2018-02-18T16:40:52.000Z | 2018-11-19T21:31:59.000Z | """Module for calculations and plotting."""
| 22 | 43 | 0.727273 |
4b8795cc2d839b480876a551261d32350393cffb | 8,308 | py | Python | openpeerpower/components/alexa/intent.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | null | null | null | openpeerpower/components/alexa/intent.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | null | null | null | openpeerpower/components/alexa/intent.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | 1 | 2019-04-24T14:10:08.000Z | 2019-04-24T14:10:08.000Z | """Support for Alexa skill service end point."""
import enum
import logging
from openpeerpower.components import http
from openpeerpower.core import callback
from openpeerpower.exceptions import OpenPeerPowerError
from openpeerpower.helpers import intent
from openpeerpower.util.decorator import Registry
from .const i... | 29.150877 | 87 | 0.619644 |
3e426f8be6838f3296c593dd1004472db0031e03 | 1,151 | py | Python | src/CorlDev/scripts/plotLabels.py | mwoehlke-kitware/spartan | 966a1f87482739ab073e441f61bdb519aad8ffa9 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/CorlDev/scripts/plotLabels.py | mwoehlke-kitware/spartan | 966a1f87482739ab073e441f61bdb519aad8ffa9 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/CorlDev/scripts/plotLabels.py | mwoehlke-kitware/spartan | 966a1f87482739ab073e441f61bdb519aad8ffa9 | [
"BSD-3-Clause-Clear"
] | null | null | null | import os
import sys
import numpy as np
import scipy.misc
import matplotlib.pyplot as plt
filename = sys.argv[1]
print 'reading:', filename
# load image
img = scipy.misc.imread(filename)
assert img.dtype == np.uint8
print 'width x height: %d x %d' % (img.shape[1], img.shape[0])
print 'shape:', img.shape
print 'n... | 18.868852 | 69 | 0.669852 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.