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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1abdb665b3f26fc44f71b7a52adc1fcb9d19d765 | 20,030 | py | Python | src/ask/sent_2_q.py | ercgn/11411-proj | 10c7f68e3d800af5e86fd3f3b63e2a298fd21a8c | [
"MIT"
] | null | null | null | src/ask/sent_2_q.py | ercgn/11411-proj | 10c7f68e3d800af5e86fd3f3b63e2a298fd21a8c | [
"MIT"
] | null | null | null | src/ask/sent_2_q.py | ercgn/11411-proj | 10c7f68e3d800af5e86fd3f3b63e2a298fd21a8c | [
"MIT"
] | null | null | null | #
# sent_2_q.py
#
# Given a sentence, this class can be used to turn the sentence into a question
# tries a variety of methods and returns after one has been successful
#
# Rachel Kobayashi
# with
# Aaron Anderson
# Eric Gan
#
#
import util.rdrpos as rdrpos
import nltk, string
from util.combinations import Combine... | 37.439252 | 79 | 0.521618 |
dbafcf10f68f91f2332890f439e9e5aeef38d178 | 1,449 | py | Python | setup.py | ubernostrum/django-flashpolicies | f24fb80907a82c6894d08c58e25d085a18b11155 | [
"BSD-3-Clause"
] | 7 | 2015-04-07T22:18:02.000Z | 2022-01-26T16:02:14.000Z | setup.py | ubernostrum/django-flashpolicies | f24fb80907a82c6894d08c58e25d085a18b11155 | [
"BSD-3-Clause"
] | 1 | 2017-06-05T01:41:10.000Z | 2017-10-23T10:14:23.000Z | setup.py | ubernostrum/django-flashpolicies | f24fb80907a82c6894d08c58e25d085a18b11155 | [
"BSD-3-Clause"
] | 2 | 2016-09-24T18:36:17.000Z | 2017-08-07T14:26:49.000Z | import os
from setuptools import find_packages, setup
setup(
name="django-flashpolicies",
zip_safe=False, # eggs are the devil.
version="1.13",
description="Flash cross-domain policies for Django sites",
long_description=open(os.path.join(os.path.dirname(__file__), "README.rst")).read(),
aut... | 35.341463 | 88 | 0.608696 |
2b7c00929417369437da32838fd327c99fe638a1 | 3,458 | py | Python | google/cloud/apigeeconnect_v1/types/connection.py | LaudateCorpus1/python-apigee-connect | ae944c10b2f63a682cf2f196d2122ccbed2dac48 | [
"Apache-2.0"
] | null | null | null | google/cloud/apigeeconnect_v1/types/connection.py | LaudateCorpus1/python-apigee-connect | ae944c10b2f63a682cf2f196d2122ccbed2dac48 | [
"Apache-2.0"
] | 30 | 2021-06-14T17:02:41.000Z | 2022-03-08T02:01:47.000Z | google/cloud/apigeeconnect_v1/types/connection.py | LaudateCorpus1/python-apigee-connect | ae944c10b2f63a682cf2f196d2122ccbed2dac48 | [
"Apache-2.0"
] | 3 | 2021-07-14T19:32:28.000Z | 2022-03-01T19:48:20.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.436364 | 85 | 0.655292 |
a04324b0cfab7ef0d9c49d32d2ebe8e6ecd38cbe | 317 | py | Python | conduct/__main__.py | lamartine-sl/mlops_project | 4391d9639129bcd4d1cbc9cc6a64f696a4c7b88e | [
"MIT"
] | null | null | null | conduct/__main__.py | lamartine-sl/mlops_project | 4391d9639129bcd4d1cbc9cc6a64f696a4c7b88e | [
"MIT"
] | 5 | 2022-02-21T04:36:06.000Z | 2022-03-31T04:36:53.000Z | conduct/__main__.py | lamartine-sl/mlops_project | 4391d9639129bcd4d1cbc9cc6a64f696a4c7b88e | [
"MIT"
] | null | null | null | import sys
import conduct.versioning.dvc_handler as dvc
def main():
"""The CLI entry point."""
args = sys.argv[1:]
print(f"{__name__} count of args {len(args)}")
for i, arg in enumerate(args):
print(f"{__name__} arg {i}: {arg}")
dvc.test(args)
if __name__ == "__main__":
main()
| 16.684211 | 50 | 0.602524 |
62279865add6af67810178e6121ba399a08896c1 | 619 | py | Python | src/python_wiki_api/console.py | Zazhka/python_wiki_api | e8fb15c2b6597c62f333ec1df98b7f3592d34e07 | [
"MIT"
] | null | null | null | src/python_wiki_api/console.py | Zazhka/python_wiki_api | e8fb15c2b6597c62f333ec1df98b7f3592d34e07 | [
"MIT"
] | null | null | null | src/python_wiki_api/console.py | Zazhka/python_wiki_api | e8fb15c2b6597c62f333ec1df98b7f3592d34e07 | [
"MIT"
] | null | null | null | """Command-line interface."""
import textwrap
import click
from . import __version__, wikipedia
API_URL: str = "https://en.wikipedia.org/api/rest_v1/page/random/summary"
@click.command()
@click.option(
"--language",
"-l",
default="en",
help="Language edition of Wikipedia",
metavar="LANG",
... | 22.107143 | 73 | 0.6979 |
0821318cf0d1b768a448097277705b7c1ef6897b | 6,705 | py | Python | 6_q-learning/Board.py | scottfabini/machine-learning-perceptron | 2bc4b7b415871bc73ac8c033983df73719df9422 | [
"Unlicense"
] | null | null | null | 6_q-learning/Board.py | scottfabini/machine-learning-perceptron | 2bc4b7b415871bc73ac8c033983df73719df9422 | [
"Unlicense"
] | null | null | null | 6_q-learning/Board.py | scottfabini/machine-learning-perceptron | 2bc4b7b415871bc73ac8c033983df73719df9422 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import random
from enum import Enum
import os
# Enumeration of available actions
class Action(Enum):
P = 0
N = 1
S = 2
E = 3
W = 4
# Enumeration of available states
class State(Enum):
Empty = 0
Wall = 1
Can = 2
class Board:... | 36.243243 | 227 | 0.579717 |
c0cde4c5478f3fdd2fd38ddaf4faad279432d9a6 | 614 | py | Python | portfolio/migrations/0005_auto_20200928_1604.py | ElmanTr/simple-django-web | 07f9b938e42ade4b515cbb8b41364089a5f9f2b1 | [
"MIT"
] | 1 | 2020-10-07T14:03:13.000Z | 2020-10-07T14:03:13.000Z | portfolio/migrations/0005_auto_20200928_1604.py | ElmanTr/simple-django-web | 07f9b938e42ade4b515cbb8b41364089a5f9f2b1 | [
"MIT"
] | null | null | null | portfolio/migrations/0005_auto_20200928_1604.py | ElmanTr/simple-django-web | 07f9b938e42ade4b515cbb8b41364089a5f9f2b1 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-28 12:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portfolio', '0004_data_category'),
]
operations = [
migrations.AlterModelOptions(
name='data',
options={'ordering': ... | 26.695652 | 104 | 0.596091 |
71751b2c92a5024137858ae7af0a15c9e7417718 | 752 | py | Python | setup.py | weaponhsu/youliPyLib | ffb8a6f066df3aa4f8d1055f50f2520feb73dcef | [
"MIT"
] | null | null | null | setup.py | weaponhsu/youliPyLib | ffb8a6f066df3aa4f8d1055f50f2520feb73dcef | [
"MIT"
] | null | null | null | setup.py | weaponhsu/youliPyLib | ffb8a6f066df3aa4f8d1055f50f2520feb73dcef | [
"MIT"
] | null | null | null | #! /usr/bin/python
# -*- coding:utf-8 -*-
# @author: weaponhsu
# @File: setup
# @Time: 2019/11/27 6:24 PM
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="youliPyLib-hsu0203",
version="0.0.1",
author="hsu0203",
author_email="huangxu4328... | 25.931034 | 50 | 0.650266 |
02eaf93b910920970778a6770f0cb25c4e26d66c | 486 | py | Python | exercises/fr/test_04_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/test_04_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/test_04_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
'spacy.blank("fr")' in __solution__
), "As-tu créé le modèle français vierge ?"
assert (
"DocBin(docs=docs)" in __solution__
), "As-tu créé correctement l'objet DocBin ?"
assert "doc_bin.to_disk(" in __solution__, "As-tu utilisé la méthode to_disk?"
assert "t... | 34.714286 | 86 | 0.652263 |
e37b78ec7c5b651e763eeb64acbb646137772ec0 | 1,439 | py | Python | oelint_adv/rule_base/rule_var_src_uri_file.py | Rahix/oelint-adv | b9dc381b181a8bdc7300bb5070f80bf90950efbd | [
"BSD-2-Clause"
] | 22 | 2019-06-10T00:40:07.000Z | 2022-01-18T19:59:47.000Z | oelint_adv/rule_base/rule_var_src_uri_file.py | Rahix/oelint-adv | b9dc381b181a8bdc7300bb5070f80bf90950efbd | [
"BSD-2-Clause"
] | 274 | 2019-03-07T06:00:27.000Z | 2022-03-27T10:22:10.000Z | oelint_adv/rule_base/rule_var_src_uri_file.py | Rahix/oelint-adv | b9dc381b181a8bdc7300bb5070f80bf90950efbd | [
"BSD-2-Clause"
] | 17 | 2019-08-24T23:04:39.000Z | 2021-11-02T19:18:19.000Z | from oelint_parser.cls_item import Variable
from oelint_adv.cls_rule import Rule
from oelint_parser.helper_files import get_scr_components
from oelint_parser.parser import INLINE_BLOCK
class VarSRCUriGitTag(Rule):
def __init__(self):
super().__init__(id="oelint.vars.srcurifile",
s... | 41.114286 | 119 | 0.558721 |
232feea67e9e6ce0afd3c439e4e1ca671e399489 | 11,473 | py | Python | tests/test_api_v1.py | userid/acoustid-server | 7c15ea1d4639f04a6b420e70be181b725055605b | [
"MIT"
] | null | null | null | tests/test_api_v1.py | userid/acoustid-server | 7c15ea1d4639f04a6b420e70be181b725055605b | [
"MIT"
] | null | null | null | tests/test_api_v1.py | userid/acoustid-server | 7c15ea1d4639f04a6b420e70be181b725055605b | [
"MIT"
] | null | null | null | # Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
from nose.tools import *
from tests import (prepare_database, with_database, assert_json_equals,
TEST_1_LENGTH,
TEST_1_FP,
TEST_1_FP_RAW,
TEST_2_LENGTH,
TEST_2_FP,
TEST_2_FP_RAW,
)
from we... | 50.54185 | 519 | 0.700776 |
c3112011f0499470bae5c814ef0cd4da75056cb7 | 492 | py | Python | context/app/test_routes_notebooks.py | mccalluc/flask-data-portal | 2ad5c7085c59d0e53c7704b1d3ad95d20ab3680d | [
"MIT"
] | null | null | null | context/app/test_routes_notebooks.py | mccalluc/flask-data-portal | 2ad5c7085c59d0e53c7704b1d3ad95d20ab3680d | [
"MIT"
] | 22 | 2019-10-10T23:45:05.000Z | 2019-10-17T15:33:19.000Z | context/app/test_routes_notebooks.py | mccalluc/flask-data-portal | 2ad5c7085c59d0e53c7704b1d3ad95d20ab3680d | [
"MIT"
] | null | null | null | import pytest
from .main import create_app
@pytest.fixture
def client():
app = create_app(testing=True)
with app.test_client() as client:
yield client
@pytest.mark.parametrize(
'entity_type',
['donors', 'samples', 'datasets']
)
def test_notebook(client, entity_type, mocker):
mocker.patc... | 23.428571 | 92 | 0.686992 |
10322562e72b453dc7c132ed2303da3615f1fe54 | 7,936 | py | Python | mysite/ct/urls.py | rimikt/socraticqs2 | 21f964cdc00c33e0b2482b463ca1795fcde9180c | [
"Apache-2.0"
] | null | null | null | mysite/ct/urls.py | rimikt/socraticqs2 | 21f964cdc00c33e0b2482b463ca1795fcde9180c | [
"Apache-2.0"
] | null | null | null | mysite/ct/urls.py | rimikt/socraticqs2 | 21f964cdc00c33e0b2482b463ca1795fcde9180c | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import patterns, include, url
from ct.views import *
urlpatterns = patterns('',
url(r'^$', main_page, name='home'),
url(r'^about/$', about, name='about'),
url(r'^people/(?P<user_id>\d+)/$', person_profile, name='person_profile'),
# instructor UI
# course tabs
url(r'^teach/... | 60.121212 | 127 | 0.613281 |
bc65a488eda8f026bc764aa57b6eb3b4a75890c3 | 2,660 | py | Python | src/baxter_dataflow/signals.py | GII/baxter_interface | 9979c30d3451fb9dbdd1e5e9d39c37bf834c8a90 | [
"BSD-3-Clause"
] | null | null | null | src/baxter_dataflow/signals.py | GII/baxter_interface | 9979c30d3451fb9dbdd1e5e9d39c37bf834c8a90 | [
"BSD-3-Clause"
] | null | null | null | src/baxter_dataflow/signals.py | GII/baxter_interface | 9979c30d3451fb9dbdd1e5e9d39c37bf834c8a90 | [
"BSD-3-Clause"
] | 2 | 2022-03-03T20:46:45.000Z | 2022-03-09T22:31:07.000Z | from __future__ import absolute_import
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyr... | 40.30303 | 77 | 0.711654 |
c0a6107c800a66a04c60aac44d02c1c6c6e0baef | 1,876 | py | Python | Day_25/part1.py | Uklusi/AdventOfCode2021 | 3d22ace832bfd6c9855b2ebad3bf7f10c4751982 | [
"MIT"
] | null | null | null | Day_25/part1.py | Uklusi/AdventOfCode2021 | 3d22ace832bfd6c9855b2ebad3bf7f10c4751982 | [
"MIT"
] | null | null | null | Day_25/part1.py | Uklusi/AdventOfCode2021 | 3d22ace832bfd6c9855b2ebad3bf7f10c4751982 | [
"MIT"
] | null | null | null | from AoCUtils import *
writeToLog = False
# writeToLog = True
useExample = False
# useExample = True
result = 0
partNumber = "1"
if writeToLog:
logFile = open("log" + partNumber + ".txt", "w")
else:
logFile = "stdout"
printLog = printLogFactory(logFile)
timer_start(partNumber)
rightMoving = set()
downMov... | 23.160494 | 67 | 0.590085 |
d00cd4a6c9eb0410ed12180bd091df6d89ce25c2 | 552 | py | Python | example/zoo_gsom.py | CDAC-lab/pygsom | d81aff2d9163b05a30b74d90ba35a37c42e9274a | [
"MIT"
] | 3 | 2020-05-08T01:54:04.000Z | 2020-08-26T22:54:22.000Z | example/zoo_gsom.py | CDAC-lab/pygsom | d81aff2d9163b05a30b74d90ba35a37c42e9274a | [
"MIT"
] | null | null | null | example/zoo_gsom.py | CDAC-lab/pygsom | d81aff2d9163b05a30b74d90ba35a37c42e9274a | [
"MIT"
] | 2 | 2020-12-16T01:51:25.000Z | 2021-12-07T17:33:11.000Z | import numpy as np
import pandas as pd
import gsom
data_filename = "data/zoo.txt".replace('\\', '/')
if __name__ == '__main__':
np.random.seed(1)
df = pd.read_csv(data_filename)
print(df.shape)
data_training = df.iloc[:, 1:17]
gsom_map = gsom.GSOM(.83, 16, max_radius=4)
gsom_map.fit(data_trai... | 24 | 52 | 0.65942 |
55c8875257b1ce5df31c2b6fc2f43320a040db50 | 14,757 | py | Python | contrib/gitian-build.py | funexcoin/funexcoin | 149c9328f420e3cd711ee63b91f2d51308445da2 | [
"MIT"
] | null | null | null | contrib/gitian-build.py | funexcoin/funexcoin | 149c9328f420e3cd711ee63b91f2d51308445da2 | [
"MIT"
] | null | null | null | contrib/gitian-build.py | funexcoin/funexcoin | 149c9328f420e3cd711ee63b91f2d51308445da2 | [
"MIT"
] | 1 | 2020-09-15T08:52:14.000Z | 2020-09-15T08:52:14.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import argparse
import os
import subprocess
import sys
def setup():
global args, workdir
program... | 56.110266 | 233 | 0.65352 |
befc2ee8ce0b1d7d16a8f38132fc07539b72b66a | 1,152 | py | Python | test/gtest-1.10.0/googlemock/scripts/generator/cpp/utils.py | EliSchleifer/yaml-cpp | c83fa7ce38fb94a7cb5b85f38d9aef05cbe9ebde | [
"MIT"
] | null | null | null | test/gtest-1.10.0/googlemock/scripts/generator/cpp/utils.py | EliSchleifer/yaml-cpp | c83fa7ce38fb94a7cb5b85f38d9aef05cbe9ebde | [
"MIT"
] | null | null | null | test/gtest-1.10.0/googlemock/scripts/generator/cpp/utils.py | EliSchleifer/yaml-cpp | c83fa7ce38fb94a7cb5b85f38d9aef05cbe9ebde | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | 28.097561 | 74 | 0.681424 |
060e073de7cf30a9218cc4dcaf7f2388f2ebc947 | 1,025 | py | Python | var/spack/repos/builtin/packages/r-crayon/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-crayon/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-crayon/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RCrayon(RPackage):
"""Colored Terminal Output.
Colored terminal output on terminals t... | 42.708333 | 95 | 0.772683 |
a5d1ff8f5003e484f1335a68ed4a4d2be9789fe0 | 2,046 | py | Python | maml_rl/envs/navigation.py | dragen1860/MAML-Pytorch-RL | 22c5072b3c58ff8fa97d37380f3493b7be885397 | [
"MIT"
] | 9 | 2019-10-18T01:30:07.000Z | 2021-11-29T07:04:51.000Z | maml_rl/envs/navigation.py | dragen1860/MAML-Pytorch-RL | 22c5072b3c58ff8fa97d37380f3493b7be885397 | [
"MIT"
] | 1 | 2019-12-09T13:49:30.000Z | 2019-12-09T13:49:30.000Z | maml_rl/envs/navigation.py | dragen1860/MAML-Pytorch-RL | 22c5072b3c58ff8fa97d37380f3493b7be885397 | [
"MIT"
] | 8 | 2019-03-21T15:23:31.000Z | 2021-11-08T13:30:28.000Z | import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
class Navigation2DEnv(gym.Env):
"""2D navigation problems, as described in [1]. The code is adapted from
https://github.com/cbfinn/maml_rl/blob/9c8e2ebd741cb0c7b8bf2d040c4caeeb8e06cc95/maml_examples/point_env_randgoal.py
At each ... | 31.96875 | 116 | 0.675464 |
16e34c3e5a541843393f3d223ee19106a2ef5ce8 | 4,527 | py | Python | modules/opnfv/utils/SSHUtils.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | modules/opnfv/utils/SSHUtils.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | modules/opnfv/utils/SSHUtils.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
# Authors: George Paraskevopoulos (geopar@intracom-telecom.com)
# Jose Lausuch (jose.lausuch@ericsson.com)
# All rights reserved. This program and the accompanying materials
# are made av... | 37.413223 | 78 | 0.550254 |
771a0179b84c04caa8d6e45f8796178e92ebd3fc | 2,755 | py | Python | freq_matched_noise.py | sunjerry019/RandomCodes | 4402604aaeee63bb1ce6fa962c496b438bb17e50 | [
"MIT"
] | null | null | null | freq_matched_noise.py | sunjerry019/RandomCodes | 4402604aaeee63bb1ce6fa962c496b438bb17e50 | [
"MIT"
] | null | null | null | freq_matched_noise.py | sunjerry019/RandomCodes | 4402604aaeee63bb1ce6fa962c496b438bb17e50 | [
"MIT"
] | null | null | null | """
Measure the frequencies coming in through the microphone
Mashup of wire_full.py from pyaudio tests and spectrum.py from Chaco examples
http://healthyalgorithms.com/2013/08/22/dsp-in-python-active-noise-reduction-with-pyaudio/
"""
import pyaudio
import numpy as np
import scipy.signal
CHUNK = 1024*2
WIDTH = 2
DTY... | 26.747573 | 141 | 0.623956 |
e310209035272a71ae4ef099b05063936c4b31f5 | 2,453 | py | Python | test/functional/wallet-encryption.py | xagau/placeh | bd10a67a39dca5b7d1619c29267b291a410b30ac | [
"MIT"
] | 2 | 2018-11-16T18:21:38.000Z | 2020-12-06T15:23:42.000Z | test/functional/wallet-encryption.py | xagau/placeh | bd10a67a39dca5b7d1619c29267b291a410b30ac | [
"MIT"
] | null | null | null | test/functional/wallet-encryption.py | xagau/placeh | bd10a67a39dca5b7d1619c29267b291a410b30ac | [
"MIT"
] | 1 | 2018-12-10T18:41:56.000Z | 2018-12-10T18:41:56.000Z | #!/usr/bin/env python3
# Copyright (c) 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.
"""Test Wallet encryption"""
import time
from test_framework.test_framework import placehTestFramework
from t... | 39.564516 | 136 | 0.709743 |
7a1eaaaae95ca2423447d60e7a8f6a4a17f037d2 | 6,398 | py | Python | examples/hardware/plotting.py | StanfordASL/soft-robot-control | 29ade9b7b952e25e639b42767a4f09c87a0e824a | [
"MIT"
] | 5 | 2021-03-07T11:42:11.000Z | 2022-02-28T09:46:05.000Z | examples/hardware/plotting.py | StanfordASL/soft-robot-control | 29ade9b7b952e25e639b42767a4f09c87a0e824a | [
"MIT"
] | null | null | null | examples/hardware/plotting.py | StanfordASL/soft-robot-control | 29ade9b7b952e25e639b42767a4f09c87a0e824a | [
"MIT"
] | 3 | 2021-01-23T11:09:40.000Z | 2022-03-02T11:54:57.000Z | from os.path import dirname, abspath, join
import numpy as np
from matplotlib import patches
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d
import pdb
from sofacontrol.utils import load_data
path = dirname(abspath(__file__))
#############################################
# Problem 1, Fig... | 39.493827 | 111 | 0.613473 |
84ef9039c5b07a3e7b33deee37ea54b7b4639eca | 7,779 | py | Python | docs/conf.py | coagulant/django-waffle | 4311becf83486cd006797fe4e3edbcfdfc1c75c4 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | coagulant/django-waffle | 4311becf83486cd006797fe4e3edbcfdfc1c75c4 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | coagulant/django-waffle | 4311becf83486cd006797fe4e3edbcfdfc1c75c4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# django-waffle documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 1 17:45:05 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | 32.012346 | 80 | 0.714359 |
9adf1032999ed2a2138a49fa9371aba21e618847 | 10,795 | py | Python | tests/test_segment.py | MarkHoo/rich | 51889e2e663bbda8d59b2a68f23322f578681cea | [
"MIT"
] | 4,407 | 2022-01-05T11:54:59.000Z | 2022-03-31T23:59:07.000Z | tests/test_segment.py | MarkHoo/rich | 51889e2e663bbda8d59b2a68f23322f578681cea | [
"MIT"
] | 244 | 2022-01-05T11:50:13.000Z | 2022-03-31T18:57:55.000Z | tests/test_segment.py | MarkHoo/rich | 51889e2e663bbda8d59b2a68f23322f578681cea | [
"MIT"
] | 177 | 2022-01-05T12:54:46.000Z | 2022-03-30T19:57:51.000Z | from io import StringIO
import pytest
from rich.segment import ControlType, Segment, SegmentLines, Segments
from rich.style import Style
def test_repr():
assert repr(Segment("foo")) == "Segment('foo')"
home = (ControlType.HOME, 0)
assert (
repr(Segment("foo", None, [home]))
== "Segment('... | 32.613293 | 671 | 0.533858 |
65efa9649bc7e74ae1b32cfc366dd78155eefab1 | 439 | py | Python | python/py_refresh/errors.py | star-junk/references | 5bf8f4eb710ebf953131722efea55d998ea98ed2 | [
"MIT"
] | null | null | null | python/py_refresh/errors.py | star-junk/references | 5bf8f4eb710ebf953131722efea55d998ea98ed2 | [
"MIT"
] | null | null | null | python/py_refresh/errors.py | star-junk/references | 5bf8f4eb710ebf953131722efea55d998ea98ed2 | [
"MIT"
] | null | null | null |
def divide(dividend, divisor):
if (divisor == 0):
raise ZeroDivisionError("Divisor cannot be zero ! Ha Ha Ha")
return dividend/divisor
print("welcome to the grade average program")
grades = []
try:
average = divide(sum(grades), len(grades))
except ZeroDivisionError as e:
print("There are no ... | 16.259259 | 68 | 0.651481 |
c9e228b760f3a05d1a2aad4ddc100c66ad2ea340 | 6,456 | py | Python | src/pypirun/cli.py | yahoo/pypirun | 77e0cd4d7b7350b6d33879f37fa5c2b04156fa6d | [
"BSD-3-Clause"
] | 2 | 2019-08-01T14:27:47.000Z | 2020-03-15T09:05:34.000Z | src/pypirun/cli.py | yahoo/pypirun | 77e0cd4d7b7350b6d33879f37fa5c2b04156fa6d | [
"BSD-3-Clause"
] | 14 | 2019-06-06T02:44:38.000Z | 2019-11-13T18:29:00.000Z | src/pypirun/cli.py | yahoo/pypirun | 77e0cd4d7b7350b6d33879f37fa5c2b04156fa6d | [
"BSD-3-Clause"
] | 4 | 2020-07-31T17:32:01.000Z | 2021-09-25T14:23:05.000Z | # Copyright 2019, Oath Inc.
# Licensed under the terms of the BSD 3 Clause license. See LICENSE file in project root for terms.
"""
pypirun command line utility
"""
import os
import shutil
import subprocess # nosec
import sys
import tempfile
from .arguments import parse_arguments, ParseError
from .utility import which... | 37.534884 | 218 | 0.655204 |
15e536b1b3eea1eebce7a628e2270200018ef6ba | 4,452 | py | Python | ex/parser/scanner.py | trishume/VintageousPlus | 1dd62435138234979fe5bb413e1731119b017daf | [
"MIT"
] | 6 | 2017-04-01T05:30:08.000Z | 2017-04-05T14:17:40.000Z | ex/parser/scanner.py | trishume/VintageousPlus | 1dd62435138234979fe5bb413e1731119b017daf | [
"MIT"
] | 1 | 2017-04-04T06:47:13.000Z | 2017-04-04T14:26:32.000Z | ex/parser/scanner.py | trishume/VintageousPlus | 1dd62435138234979fe5bb413e1731119b017daf | [
"MIT"
] | null | null | null | '''
Tokenization for the Vim command line.
'''
from VintageousPlus.ex.ex_error import ERR_UNKNOWN_COMMAND
from VintageousPlus.ex.ex_error import VimError
from . import subscanners
from .state import EOF
from .state import ScannerState
from .tokens import TokenComma
from .tokens import TokenDigits
from .tokens import ... | 26.5 | 82 | 0.59389 |
227b465fa7e6b6e412115b3805d1fcc5357f55b2 | 16,748 | py | Python | models/rank/bert4rec/net.py | LinJayan/DCN_V2_Paddle | 7dbf99eecf33ee0280908ec25ffe069f33c4e284 | [
"Apache-2.0"
] | null | null | null | models/rank/bert4rec/net.py | LinJayan/DCN_V2_Paddle | 7dbf99eecf33ee0280908ec25ffe069f33c4e284 | [
"Apache-2.0"
] | null | null | null | models/rank/bert4rec/net.py | LinJayan/DCN_V2_Paddle | 7dbf99eecf33ee0280908ec25ffe069f33c4e284 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 38.412844 | 79 | 0.595713 |
3db374fa9bae374aee6b7291c7d6712ffc3457e7 | 8,923 | bzl | Python | repositories.bzl | jiangtaoli2016/grpc-java | 512e55444e4176602f27fa39c41223e5b6074d59 | [
"Apache-2.0"
] | null | null | null | repositories.bzl | jiangtaoli2016/grpc-java | 512e55444e4176602f27fa39c41223e5b6074d59 | [
"Apache-2.0"
] | null | null | null | repositories.bzl | jiangtaoli2016/grpc-java | 512e55444e4176602f27fa39c41223e5b6074d59 | [
"Apache-2.0"
] | null | null | null | """External dependencies for grpc-java."""
def grpc_java_repositories(
omit_com_google_api_grpc_google_common_protos=False,
omit_com_google_auth_google_auth_library_credentials=False,
omit_com_google_code_findbugs_jsr305=False,
omit_com_google_code_gson=False,
omit_com_google_errorprone_error_prone... | 32.926199 | 118 | 0.750981 |
e582863d4c0dea4eb0c033514bd736878628baec | 4,559 | py | Python | tests/py3/unit/test_type_hint.py | cesartalves/python-cdi | a5a13b5e0ad6a5255e686ecd934d4606a9c2a1f2 | [
"BSD-3-Clause"
] | 10 | 2017-02-02T19:23:12.000Z | 2020-11-18T05:37:10.000Z | tests/py3/unit/test_type_hint.py | cesartalves/python-cdi | a5a13b5e0ad6a5255e686ecd934d4606a9c2a1f2 | [
"BSD-3-Clause"
] | 34 | 2017-07-29T21:03:20.000Z | 2021-07-01T13:35:31.000Z | tests/py3/unit/test_type_hint.py | cesartalves/python-cdi | a5a13b5e0ad6a5255e686ecd934d4606a9c2a1f2 | [
"BSD-3-Clause"
] | 1 | 2019-06-05T14:45:36.000Z | 2019-06-05T14:45:36.000Z | # -*- encoding: utf-8 -*-
import unittest
from pycdi.core import CDIContainer, DEFAULT_CONTAINER
from pycdi import Producer, Inject
from pycdi.shortcuts import new, call
SOME_STRING = 'some_string'
ANOTHER_STRING = 'another_string'
@Producer()
def get_some_string() -> str:
return SOME_STRING
@Producer(_context... | 28.49375 | 90 | 0.689625 |
48c9e222654d89a8db03854738cd428ed78c21e6 | 9,630 | py | Python | bdd100k/eval/mot.py | Celeven1996/bdd100k | 3b49d1b25f903ea9f2465590b3b7be115b6f0cb5 | [
"BSD-3-Clause"
] | null | null | null | bdd100k/eval/mot.py | Celeven1996/bdd100k | 3b49d1b25f903ea9f2465590b3b7be115b6f0cb5 | [
"BSD-3-Clause"
] | null | null | null | bdd100k/eval/mot.py | Celeven1996/bdd100k | 3b49d1b25f903ea9f2465590b3b7be115b6f0cb5 | [
"BSD-3-Clause"
] | null | null | null | """BDD100K tracking evaluation with CLEAR MOT metrics."""
import time
from multiprocessing import Pool
from typing import List, Tuple, Union
import motmetrics as mm
import numpy as np
import pandas as pd
from ..common.logger import logger
from ..common.typing import DictAny
METRIC_MAPS = {
"idf1": "IDF1",
"m... | 36.203008 | 79 | 0.58785 |
df6b339b53bd915863d54449fc91d62f17b8892d | 3,797 | py | Python | py/server/tests/test_wrapper.py | lbooker42/deephaven-core | 2d04563f18ae914754b28041475c02770e57af15 | [
"MIT"
] | null | null | null | py/server/tests/test_wrapper.py | lbooker42/deephaven-core | 2d04563f18ae914754b28041475c02770e57af15 | [
"MIT"
] | null | null | null | py/server/tests/test_wrapper.py | lbooker42/deephaven-core | 2d04563f18ae914754b28041475c02770e57af15 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
#
import unittest
import jpy
from deephaven._wrapper import JObjectWrapper
from tests.testbase import BaseTestCase
def alpha():
return MyObject(0, "ALPHA")
def beta():
return MyObject(1, "BETA")
def charlie():
return MyObject(2, "CHARL... | 29.434109 | 121 | 0.609692 |
9ad7d35224902d6de1c71d12280f9898461eb700 | 385 | py | Python | tamu/asgi.py | BlessedAssurance/RecipeBe | cd61ce2f6336e817ead77f16e7660f9ec70a71ca | [
"MIT"
] | null | null | null | tamu/asgi.py | BlessedAssurance/RecipeBe | cd61ce2f6336e817ead77f16e7660f9ec70a71ca | [
"MIT"
] | 6 | 2021-03-30T13:56:55.000Z | 2021-09-22T19:21:32.000Z | tamu/asgi.py | Mantongash/tamu_backend | 542affccfe0f53e729acbf7ce5931c22e2b6892f | [
"MIT"
] | 1 | 2020-06-17T18:51:47.000Z | 2020-06-17T18:51:47.000Z | """
ASGI config for tamu project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS... | 22.647059 | 78 | 0.781818 |
fe5412d2dbd5e49bd7565e72a7ba88a428dc6333 | 499 | py | Python | yandex-contest/backend-school-2022/a.py | kirilllapushinskiy/code | 8deea136de8d4559f7f2dad26005611b0e51790b | [
"MIT"
] | null | null | null | yandex-contest/backend-school-2022/a.py | kirilllapushinskiy/code | 8deea136de8d4559f7f2dad26005611b0e51790b | [
"MIT"
] | null | null | null | yandex-contest/backend-school-2022/a.py | kirilllapushinskiy/code | 8deea136de8d4559f7f2dad26005611b0e51790b | [
"MIT"
] | null | null | null | S = input()
Q = input()
rate = {}
answers = {}
for i in range(len(S)):
if S[i] not in rate:
rate[S[i]] = 0
if S[i] == Q[i]:
answers[i] = 'correct'
else:
rate[S[i]] += 1
answers[i] = ''
for i in range(len(Q)):
if answers[i]:
continue
else:
if Q[i] in ... | 18.481481 | 39 | 0.44489 |
3d395b009903566caffa6fd8bc41ffb49ad06e80 | 2,208 | py | Python | nadine/management/commands/billing_batch_run.py | czue/nadine | 61fbfcac4d0c3159aa73500e47f4fa23c0aa9ef0 | [
"Apache-2.0"
] | 1 | 2019-08-15T00:10:38.000Z | 2019-08-15T00:10:38.000Z | nadine/management/commands/billing_batch_run.py | czue/nadine | 61fbfcac4d0c3159aa73500e47f4fa23c0aa9ef0 | [
"Apache-2.0"
] | null | null | null | nadine/management/commands/billing_batch_run.py | czue/nadine | 61fbfcac4d0c3159aa73500e47f4fa23c0aa9ef0 | [
"Apache-2.0"
] | null | null | null |
from datetime import datetime
from django.core.management.base import BaseCommand
from nadine.models.billing import BillingBatch, UserBill
class Command(BaseCommand):
requires_system_checks = True
help = "Runs the billing batch."
def add_arguments(self, parser):
# Named (optional) arguments
... | 39.428571 | 579 | 0.619112 |
8eb49a05b6b3036dfe231ecd0bb42c25fb744e82 | 553 | py | Python | kNN.py | zxhaijm/- | 2448b05d95e188ed35812e2a0030454f6190f212 | [
"Unlicense"
] | null | null | null | kNN.py | zxhaijm/- | 2448b05d95e188ed35812e2a0030454f6190f212 | [
"Unlicense"
] | null | null | null | kNN.py | zxhaijm/- | 2448b05d95e188ed35812e2a0030454f6190f212 | [
"Unlicense"
] | null | null | null | def kNN(inX, dataSet, labels, k):
dataSetSize = dataSet.shape[0]
diffMat = np.tile(inX, (dataSetSize,1)) - dataSet
sqDiffMat = diffMat**2
sqDistance = sqDiffMat.sum(axis=1)
distances = sqDistance**0.5
sortedDistIndicies = distances.argsort()
classCount = {}
for i in range(k):
vot... | 39.5 | 91 | 0.681736 |
01f46813c24eb72d17e7473237ce843aed94ffa2 | 13,244 | py | Python | main.py | fab-jul/ppfin | f3e51583d42590eceb6d3920a351f8f2639792c1 | [
"MIT"
] | null | null | null | main.py | fab-jul/ppfin | f3e51583d42590eceb6d3920a351f8f2639792c1 | [
"MIT"
] | null | null | null | main.py | fab-jul/ppfin | f3e51583d42590eceb6d3920a351f8f2639792c1 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('otp.log')
fh.setLevel(logging.DEBUG)
logger.addHandler(fh)
import argparse
import urwid
import data_controller
import symbol_values
_BACKGROUND = urwid.SolidFill(u'\N{MEDIUM SHADE}')
_BASE_CURRENCY = 'CHF'
_main... | 30.168565 | 100 | 0.627001 |
c1924d3beeb90136baff1d41c8c4b08473a73264 | 2,656 | py | Python | qoc/standard/costs/forbidstates.py | sriharikrishna/qoc | 823d48966892fe71c828c31de8737582f36bdd5e | [
"MIT"
] | null | null | null | qoc/standard/costs/forbidstates.py | sriharikrishna/qoc | 823d48966892fe71c828c31de8737582f36bdd5e | [
"MIT"
] | null | null | null | qoc/standard/costs/forbidstates.py | sriharikrishna/qoc | 823d48966892fe71c828c31de8737582f36bdd5e | [
"MIT"
] | null | null | null | """
forbidstates.py - This module defines a cost function that penalizes
the occupation of a set of forbidden states.
"""
import jax
import jax.numpy as jnp
from qoc.models import Cost
from qoc.standard.functions.convenience import conjugate_transpose
class ForbidStates(Cost):
"""
This cost penalizes the occu... | 32.790123 | 84 | 0.638178 |
d6c74f3eadbc12e3b78bc73d2ba5f1965bd8dd97 | 6,097 | py | Python | games/algorithms.py | RamboWu/counterfactual-regret-minimization | f6883e1ffae13e133a71655b67a1ce4fa7f3753d | [
"MIT"
] | 141 | 2018-09-23T15:30:43.000Z | 2022-02-12T01:23:39.000Z | games/algorithms.py | bimingda100/counterfactual-regret-minimization | 4a223131e652c3541058f7b39b2338cde1f0dc00 | [
"MIT"
] | 2 | 2018-10-24T06:28:58.000Z | 2021-12-27T05:17:06.000Z | games/algorithms.py | bimingda100/counterfactual-regret-minimization | 4a223131e652c3541058f7b39b2338cde1f0dc00 | [
"MIT"
] | 41 | 2018-09-24T04:34:35.000Z | 2021-12-19T09:20:41.000Z | from common.constants import A
from common.utils import init_sigma, init_empty_node_maps
class CounterfactualRegretMinimizationBase:
def __init__(self, root, chance_sampling = False):
self.root = root
self.sigma = init_sigma(root)
self.cumulative_regrets = init_empty_node_maps(root... | 48.776 | 146 | 0.654584 |
0f9205f2ded1d1e5435f8ccf767c648c912cfdd3 | 36,676 | py | Python | erfa_generator.py | Stefan-Heimersheim/pyerfa | 16a0ab2e66aed29c4b7eb67876fef5ca680d7b8b | [
"BSD-3-Clause"
] | 20 | 2020-05-06T07:43:31.000Z | 2022-01-05T03:49:37.000Z | erfa_generator.py | Stefan-Heimersheim/pyerfa | 16a0ab2e66aed29c4b7eb67876fef5ca680d7b8b | [
"BSD-3-Clause"
] | 62 | 2020-05-05T01:26:45.000Z | 2021-11-05T16:38:25.000Z | erfa_generator.py | avalentino/pyerfa | efc2ba6300e4edac21c51cd891694bee8f91eb3b | [
"BSD-3-Clause"
] | 15 | 2020-05-05T19:26:42.000Z | 2022-03-10T07:45:41.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module's main purpose is to act as a script to create new versions
of ufunc.c when ERFA is updated (or this generator is enhanced).
`Jinja2 <http://jinja.pocoo.org/>`_ must be installed for this
module/script to function.
Note that this does *no... | 38.444444 | 100 | 0.516441 |
0bbb40f94295f53f0dfa15ea38cc629e924e0dc6 | 25,172 | py | Python | Apps/phpolyswarm/polyswarm_connector.py | phantom-dkhorasani/phantom-apps | 6d7e6edcfef3cb97f6cbf1fa5e13a0b2a9f63ab1 | [
"Apache-2.0"
] | null | null | null | Apps/phpolyswarm/polyswarm_connector.py | phantom-dkhorasani/phantom-apps | 6d7e6edcfef3cb97f6cbf1fa5e13a0b2a9f63ab1 | [
"Apache-2.0"
] | null | null | null | Apps/phpolyswarm/polyswarm_connector.py | phantom-dkhorasani/phantom-apps | 6d7e6edcfef3cb97f6cbf1fa5e13a0b2a9f63ab1 | [
"Apache-2.0"
] | null | null | null | # File: polyswarm_connector.py
# Copyright (c) PolySwarm, 2019.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
# Phantom App imports
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.action_result import ActionResult
from phantom.vault import V... | 35.453521 | 127 | 0.559868 |
c3c5767d492ac42d94b70b85e050d5ded8962c69 | 8,409 | py | Python | django/contrib/sitemaps/tests/test_http.py | dnozay/django | 5dcdbe95c749d36072f527e120a8cb463199ae0d | [
"BSD-3-Clause"
] | 1 | 2019-01-31T17:16:56.000Z | 2019-01-31T17:16:56.000Z | django/contrib/sitemaps/tests/test_http.py | rmutter/django | 5d044339037be879a11b03fe8bd8c3ef1d520b1a | [
"BSD-3-Clause"
] | null | null | null | django/contrib/sitemaps/tests/test_http.py | rmutter/django | 5d044339037be879a11b03fe8bd8c3ef1d520b1a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import os
from datetime import date
from unittest import skipUnless
from django.apps import apps
from django.conf import settings
from django.contrib.sitemaps import Sitemap, GenericSitemap
from django.contrib.sites.models import Site
from django.core.exceptions import Improper... | 45.454054 | 204 | 0.692829 |
dcfb050c8bb645de527e6088c93d56750205e7c6 | 3,128 | py | Python | bokeh/core/property/any.py | Jaok-ku/bokeh | 9330ed3afd22712baa152e2848c74d7843e74645 | [
"BSD-3-Clause"
] | 1 | 2021-10-30T00:32:00.000Z | 2021-10-30T00:32:00.000Z | bokeh/core/property/any.py | Jaok-ku/bokeh | 9330ed3afd22712baa152e2848c74d7843e74645 | [
"BSD-3-Clause"
] | 1 | 2021-02-12T19:50:48.000Z | 2021-02-12T23:32:21.000Z | bokeh/core/property/any.py | Jaok-ku/bokeh | 9330ed3afd22712baa152e2848c74d7843e74645 | [
"BSD-3-Clause"
] | 2 | 2021-01-12T18:22:24.000Z | 2021-10-30T00:32:02.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 30.368932 | 78 | 0.356777 |
9f15ec3e595e537d83146381242aa66460e42f11 | 197 | py | Python | Contest/ABC064/d/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/ABC064/d/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/ABC064/d/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
input()
s = input()
L = R = 0
for t in s:
if t == "(":
R += 1
else:
if R:
R -= 1
else:
L += 1
print("("*L + s + ")"*R) | 15.153846 | 24 | 0.329949 |
ea019b4e3a69ed6d00ebb2a624c0f55704669fce | 725 | py | Python | var/spack/repos/builtin/packages/r-scrime/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-scrime/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/r-scrime/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RScrime(RPackage):
"""Analysis of High-Dimensional Categorical Data Such as SNP Da... | 36.25 | 95 | 0.764138 |
12dcdc6ceeee060647e272c39b26adfb1ab55d4f | 11,915 | py | Python | porterStemmer.py | jcob-sikorski/searchEngine | db8b6295f81bc617e81abf5f8a8280f1f2073fd8 | [
"MIT"
] | null | null | null | porterStemmer.py | jcob-sikorski/searchEngine | db8b6295f81bc617e81abf5f8a8280f1f2073fd8 | [
"MIT"
] | null | null | null | porterStemmer.py | jcob-sikorski/searchEngine | db8b6295f81bc617e81abf5f8a8280f1f2073fd8 | [
"MIT"
] | null | null | null | import sys
class PorterStemmer:
def __init__(self):
"""The main part of the stemming algorithm starts here.
b is a buffer holding a word to be stemmed. The letters are in b[k0],
b[k0+1] ... ending at b[k]. In fact k0 = 0 in this demo program. k is
readjusted downwards as the stemmi... | 35.356083 | 108 | 0.450441 |
50259feea42b50c6b199d86006f2937571486739 | 10,148 | py | Python | spikeinterface/sortingcomponents/motion_correction.py | chyumin/spikeinterface | 12b7863684b705e3d0ae8165bb3009143c70530c | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/motion_correction.py | chyumin/spikeinterface | 12b7863684b705e3d0ae8165bb3009143c70530c | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/motion_correction.py | chyumin/spikeinterface | 12b7863684b705e3d0ae8165bb3009143c70530c | [
"MIT"
] | null | null | null | import numpy as np
import scipy.interpolate
import sklearn
from tqdm import tqdm
import sklearn.metrics
from spikeinterface.toolkit.preprocessing.basepreprocessor import BasePreprocessor, BasePreprocessorSegment
try:
import numba
HAVE_NUMBA = True
except ImportError:
HAVE_NUMBA = False
def correct_moti... | 39.640625 | 118 | 0.642787 |
aa1144058ab1a707dc8a629c2b87c94bb797cad6 | 2,984 | py | Python | problem_3.py | johangenis/problems_vs_algorithms | 9925d7319de849fd7814cf87050232c22d8c2a96 | [
"MIT"
] | null | null | null | problem_3.py | johangenis/problems_vs_algorithms | 9925d7319de849fd7814cf87050232c22d8c2a96 | [
"MIT"
] | null | null | null | problem_3.py | johangenis/problems_vs_algorithms | 9925d7319de849fd7814cf87050232c22d8c2a96 | [
"MIT"
] | null | null | null | def heapsort(arr):
arr_len = len(arr)
for i in range(arr_len - 1, -1, -1):
heapify(arr, len(arr), i)
# Swap the top element in heap with last element in array
arr[0], arr[i] = arr[i], arr[0]
def heapify(arr, n, i):
"""
:param: arr - array to heapify
n -- number of element... | 29.544554 | 112 | 0.62567 |
22ec2b60ed48f41c8cf56978f53627d7dbc08996 | 869 | py | Python | tests/unit/test_vcs_mercurial.py | rogerhil/pip | 7616583dbb2dcbda5a19d78873642d6751fbf017 | [
"MIT"
] | 7,089 | 2015-01-01T10:48:04.000Z | 2022-03-31T08:47:02.000Z | tests/unit/test_vcs_mercurial.py | rogerhil/pip | 7616583dbb2dcbda5a19d78873642d6751fbf017 | [
"MIT"
] | 8,417 | 2015-01-01T13:03:16.000Z | 2022-03-31T17:40:27.000Z | tests/unit/test_vcs_mercurial.py | rogerhil/pip | 7616583dbb2dcbda5a19d78873642d6751fbf017 | [
"MIT"
] | 2,663 | 2015-01-02T04:02:12.000Z | 2022-03-30T02:30:46.000Z | """
Contains functional tests of the Mercurial class.
"""
import configparser
import os
from pip._internal.utils.misc import hide_url
from pip._internal.vcs.mercurial import Mercurial
from tests.lib import need_mercurial
from tests.lib.path import Path
@need_mercurial
def test_mercurial_switch_updates_config_file_w... | 25.558824 | 79 | 0.715765 |
0907706108a486018d923d966cbe435c34c93499 | 158 | py | Python | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_Seasonal_Hour_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_Seasonal_Hour_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_Seasonal_Hour_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['PolyTrend'] , ['Seasonal_Hour'] , ['SVR'] ); | 39.5 | 80 | 0.746835 |
362f9a0dac1296db6e42d55e75d8a22d5b411754 | 4,461 | py | Python | leo/plugins/leo_babel/tests/idle_time.py | leonidborisenko/leo-editor | db55bd00c94fb8501795284453891ad64ce12af9 | [
"MIT"
] | null | null | null | leo/plugins/leo_babel/tests/idle_time.py | leonidborisenko/leo-editor | db55bd00c94fb8501795284453891ad64ce12af9 | [
"MIT"
] | null | null | null | leo/plugins/leo_babel/tests/idle_time.py | leonidborisenko/leo-editor | db55bd00c94fb8501795284453891ad64ce12af9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
#@+leo-ver=5-thin
#@+node:bob.20180206123613.1: * @file leo_babel/tests/idle_time.py
#@@first
#@@first
#@@language python
#@@tabwidth -4
#@+<< imports >>
#@+node:bob.20180206123613.2: ** << imports >>
import os
import time
# import traceback
import leo.core.leoGlobals as leoG
assert le... | 30.979167 | 124 | 0.566465 |
151de6f670ffc75d29ac25cd6f2024aa0810efaa | 6,048 | py | Python | utils.py | ethanluoyc/compile-jax | 65bea174b0b546b27ef17774bca90e0f25b11f7d | [
"MIT"
] | null | null | null | utils.py | ethanluoyc/compile-jax | 65bea174b0b546b27ef17774bca90e0f25b11f7d | [
"MIT"
] | null | null | null | utils.py | ethanluoyc/compile-jax | 65bea174b0b546b27ef17774bca90e0f25b11f7d | [
"MIT"
] | null | null | null | """Utility functions."""
import numpy as np
import jax
import jax.numpy as jnp
from jax import nn, random
EPS = 1e-17
NEG_INF = -1e30
def cross_entropy(logits, labels, reduction='none'):
sequence_length, batch_size = logits.shape[:2]
targets = jax.nn.one_hot(labels, logits.shape[-1])
return -jnp.sum(targets ... | 33.787709 | 80 | 0.689319 |
d23ae359ed05a2f17804adca3b27a947d9003f6c | 499 | py | Python | plotly/validators/mesh3d/_scene.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/mesh3d/_scene.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/mesh3d/_scene.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class SceneValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(self, plotly_name='scene', parent_name='mesh3d', **kwargs):
super(SceneValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | 33.266667 | 76 | 0.641283 |
85d391f7bec3296b0d2909766e165b7e58ed9c44 | 59 | py | Python | sis-inf.py | jorgegene/sis-inf-project | ed97162a828abb5c3c2013c33c6511e2ae0b6efd | [
"MIT"
] | null | null | null | sis-inf.py | jorgegene/sis-inf-project | ed97162a828abb5c3c2013c33c6511e2ae0b6efd | [
"MIT"
] | null | null | null | sis-inf.py | jorgegene/sis-inf-project | ed97162a828abb5c3c2013c33c6511e2ae0b6efd | [
"MIT"
] | null | null | null | from app import app, db
from app.models import User, Poster | 29.5 | 35 | 0.79661 |
6a2c86f09a1cd21b272da4436eeae50fb0865cd2 | 17,527 | py | Python | Modelling Scenarios/scenario forecast folders/Epidemic Modelling v0710/metrics/COVID19_r0.py | ec-jrc/COVID-19 | c9ef6ca3ae69edc8ba77b9f99d4a6875416136aa | [
"CC-BY-4.0"
] | 43 | 2020-04-23T08:46:49.000Z | 2022-03-29T07:49:50.000Z | Modelling Scenarios/scenario forecast folders/Epidemic Modelling v0710/metrics/COVID19_r0.py | ebuitragod/COVID-19 | b6989fe4cf9d10bdb47be7f840036f597d293e21 | [
"CC-BY-4.0"
] | 44 | 2020-05-05T08:35:20.000Z | 2022-01-13T03:29:28.000Z | Modelling Scenarios/scenario forecast folders/Epidemic Modelling v0710/metrics/COVID19_r0.py | ebuitragod/COVID-19 | b6989fe4cf9d10bdb47be7f840036f597d293e21 | [
"CC-BY-4.0"
] | 24 | 2020-05-19T16:45:01.000Z | 2021-12-14T06:00:59.000Z | import os, sys, getopt
import pandas as pd
import numpy as np
import datetime
from scipy import stats as sps
from scipy.interpolate import interp1d
# Gamma is 1/serial interval
# https://wwwnc.cdc.gov/eid/article/26/7/20-0282_article
# https://www.nejm.org/doi/full/10.1056/NEJMoa2001316
GAMMA = 1/7
def highest_densi... | 38.019523 | 280 | 0.579791 |
6e57882d06037ef3c5e93993bd8588cf5a550f61 | 7,485 | py | Python | ingest/prepare_scripts/alos/alos2_prepare.py | ChetanKhanna/NE-GeoCloud | bad907045729cd9ffd086ede034ef1805eeecc8b | [
"Apache-2.0"
] | 1 | 2019-07-22T05:24:40.000Z | 2019-07-22T05:24:40.000Z | ingest/prepare_scripts/alos/alos2_prepare.py | SivaramakrishnanKN/NE-GeoCloud | affcae49e0ccd7d29360a2771a9517147ed56590 | [
"Apache-2.0"
] | 1 | 2019-06-06T18:31:29.000Z | 2019-06-06T18:31:29.000Z | ingest/prepare_scripts/alos/alos2_prepare.py | SivaramakrishnanKN/NE-GeoCloud | affcae49e0ccd7d29360a2771a9517147ed56590 | [
"Apache-2.0"
] | 5 | 2019-06-05T07:26:13.000Z | 2019-06-08T06:53:11.000Z | # coding=utf-8
"""
Ingest data from the command-line.
"""
from __future__ import absolute_import, division
from __future__ import print_function
import logging
import uuid
from xml.etree import ElementTree
import re
from pathlib import Path
import yaml
from dateutil import parser
from datetime import timedelta
import ... | 30.303644 | 120 | 0.551637 |
64d8b91ffc54d7be0d117e747508e9449f29b37e | 5,263 | py | Python | honeybee_schema/energy/construction.py | MingboPeng/honeybee-schema | 84bfea4c4ed038e3cf71ae2d708b937cb98334d5 | [
"BSD-3-Clause"
] | null | null | null | honeybee_schema/energy/construction.py | MingboPeng/honeybee-schema | 84bfea4c4ed038e3cf71ae2d708b937cb98334d5 | [
"BSD-3-Clause"
] | null | null | null | honeybee_schema/energy/construction.py | MingboPeng/honeybee-schema | 84bfea4c4ed038e3cf71ae2d708b937cb98334d5 | [
"BSD-3-Clause"
] | null | null | null | """Construction Schema"""
from pydantic import Field, constr
from typing import List, Union
from ._base import IDdEnergyBaseModel
from .material import EnergyMaterial, EnergyMaterialNoMass, \
EnergyWindowMaterialGas, EnergyWindowMaterialGasCustom, \
EnergyWindowMaterialGasMixture, EnergyWindowMaterialSimpleGla... | 34.398693 | 99 | 0.67832 |
e600482d981d9faf663eb9739276f889dfa0775e | 2,999 | py | Python | configs/config_BiCLSTM_dunet.py | dkswxd/unetpp_pytorch_qiu | df439b07d13c5d8c87975f0cca4dd7a5ff19f8c2 | [
"Apache-2.0"
] | null | null | null | configs/config_BiCLSTM_dunet.py | dkswxd/unetpp_pytorch_qiu | df439b07d13c5d8c87975f0cca4dd7a5ff19f8c2 | [
"Apache-2.0"
] | null | null | null | configs/config_BiCLSTM_dunet.py | dkswxd/unetpp_pytorch_qiu | df439b07d13c5d8c87975f0cca4dd7a5ff19f8c2 | [
"Apache-2.0"
] | null | null | null |
from collections import OrderedDict
config_name = 'BiCLSTM_dunet'
config_dataset = OrderedDict([
('dataset', 'hyper'),
('channels', 60),
('n_class', 2),
('norm_kwargs', {'type':'data'}),
('npy_dir', '../cancer/npy/'),
('label_dir', '../cancer/label/'),
('train_split', '../cancer/split/spl... | 34.471264 | 107 | 0.598533 |
93a5510b7ca805ea8519bb98e84cc5a3c5e509ea | 7,927 | py | Python | code/brain_pipeline.py | Delta-Sigma/brain_segmentation | 4462bde26e8434391c91cf3d9a8ac53fd6d494bc | [
"MIT"
] | 315 | 2016-04-19T20:17:51.000Z | 2022-03-22T05:48:13.000Z | code/brain_pipeline.py | Delta-Sigma/brain_segmentation | 4462bde26e8434391c91cf3d9a8ac53fd6d494bc | [
"MIT"
] | 29 | 2016-10-16T13:32:18.000Z | 2021-08-30T01:40:34.000Z | code/brain_pipeline.py | Delta-Sigma/brain_segmentation | 4462bde26e8434391c91cf3d9a8ac53fd6d494bc | [
"MIT"
] | 206 | 2016-06-16T06:29:39.000Z | 2022-02-16T12:38:03.000Z | import numpy as np
import subprocess
import random
import progressbar
from glob import glob
from skimage import io
np.random.seed(5) # for reproducibility
progress = progressbar.ProgressBar(widgets=[progressbar.Bar('*', '[', ']'), progressbar.Percentage(), ' '])
class BrainPipeline(object):
'''
A class for pr... | 46.629412 | 140 | 0.59783 |
8f97a33bf65c5c1152061e1d471f109c80327372 | 2,192 | py | Python | setup.py | remram44/find_projections | f3988a206c4902e039ea75d832d2c3ef695c1f91 | [
"MIT"
] | 1 | 2021-03-29T18:23:57.000Z | 2021-03-29T18:23:57.000Z | setup.py | remram44/find_projections | f3988a206c4902e039ea75d832d2c3ef695c1f91 | [
"MIT"
] | null | null | null | setup.py | remram44/find_projections | f3988a206c4902e039ea75d832d2c3ef695c1f91 | [
"MIT"
] | 2 | 2021-03-18T19:39:48.000Z | 2022-01-05T16:25:44.000Z | import os
import sys
from distutils.core import Extension
from setuptools import setup
home_folder = os.path.expanduser("~")
user_site_packages_folder = "{0}/.local/lib/python{1}.{2}/site-packages".format(home_folder, sys.version_info[0],
... | 42.980392 | 120 | 0.593978 |
10720d1808c8f355c4a5f13de6ca92d051cedb4c | 46 | py | Python | bitmovin/services/manifests/__init__.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 44 | 2016-12-12T17:37:23.000Z | 2021-03-03T09:48:48.000Z | bitmovin/services/manifests/__init__.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 38 | 2017-01-09T14:45:45.000Z | 2022-02-27T18:04:33.000Z | bitmovin/services/manifests/__init__.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 27 | 2017-02-02T22:49:31.000Z | 2019-11-21T07:04:57.000Z | from .manifest_service import ManifestService
| 23 | 45 | 0.891304 |
3de44afd8d8da955f0f6fdc847cd1cee0ff44303 | 4,753 | py | Python | tests/test_rule_building.py | zStupan/NiaARM | 3ade6c5f89a22da7f1e7309cb4fec227bb913e6b | [
"MIT"
] | null | null | null | tests/test_rule_building.py | zStupan/NiaARM | 3ade6c5f89a22da7f1e7309cb4fec227bb913e6b | [
"MIT"
] | 14 | 2022-03-02T07:38:34.000Z | 2022-03-15T11:18:50.000Z | tests/test_rule_building.py | zStupan/NiaARM | 3ade6c5f89a22da7f1e7309cb4fec227bb913e6b | [
"MIT"
] | 1 | 2022-03-01T14:41:07.000Z | 2022-03-01T14:41:07.000Z | """
Test intended for testing the main procedure for building
an association rule from candidate solutions.
"""
from unittest import TestCase
from niaarm.niaarm import NiaARM
from niaarm.dataset import Dataset
from niaarm.feature import Feature
import os
class TestBuildRuleA(TestCase):
# let's borrow a test case... | 45.701923 | 98 | 0.432779 |
63eb059266786adf59e3541fe6bfe0ca075a37bf | 6,912 | py | Python | tni.py | AvidDabbler/TitleVI-Analysis | bc447ead902c4c6bf4fbfbb92f4dfbb75f22b5a6 | [
"MIT"
] | 1 | 2019-10-28T03:06:44.000Z | 2019-10-28T03:06:44.000Z | tni.py | AvidDabbler/TitleVI-Analysis | bc447ead902c4c6bf4fbfbb92f4dfbb75f22b5a6 | [
"MIT"
] | 5 | 2019-10-28T15:28:33.000Z | 2019-10-28T15:33:10.000Z | tni.py | AvidDabbler/TitleVI-Analysis | bc447ead902c4c6bf4fbfbb92f4dfbb75f22b5a6 | [
"MIT"
] | null | null | null | # ! are the imports needed if they are defined in main?
import arcpy
import os
import shutil
from helpers import *
# ! are we using tni at all?
# Compute Transit Need Index (TNI) based on the 2003 service standards for each census blockgroup.
# Use the minority, income, age and car ownership data computed in prior ... | 65.207547 | 244 | 0.754051 |
6e0fce2d79b732da02e8ec7fbf23e9b5b8e1b453 | 7,769 | py | Python | _test/test_indentation.py | zvxr/ruamel-yaml | 0f5e5dd4c650ee0d9faa7c49a5cbc0a3f3488759 | [
"MIT"
] | 8 | 2020-08-10T11:59:25.000Z | 2022-03-07T19:12:08.000Z | _test/test_indentation.py | zvxr/ruamel-yaml | 0f5e5dd4c650ee0d9faa7c49a5cbc0a3f3488759 | [
"MIT"
] | 2 | 2022-01-12T10:02:57.000Z | 2022-02-22T21:11:29.000Z | _test/test_indentation.py | zvxr/ruamel-yaml | 0f5e5dd4c650ee0d9faa7c49a5cbc0a3f3488759 | [
"MIT"
] | 4 | 2020-12-11T21:26:42.000Z | 2022-02-01T13:36:21.000Z | # coding: utf-8
import pytest # NOQA
from roundtrip import round_trip, round_trip_load, round_trip_dump, dedent, YAML
def rt(s):
res = round_trip_dump(round_trip_load(s))
return res.strip() + '\n'
class TestIndent:
def test_roundtrip_inline_list(self):
s = 'a: [a, b, c]\n'
output = r... | 23.191045 | 95 | 0.460677 |
e30d5101f2fc8f75c04560c168376fce1539be29 | 5,150 | py | Python | tests/test_add_option_enqueue.py | benhowes/loguru | b576d9767e32129c6c04869c054f20a739d6ce5c | [
"MIT"
] | 1 | 2020-05-30T10:00:36.000Z | 2020-05-30T10:00:36.000Z | tests/test_add_option_enqueue.py | benhowes/loguru | b576d9767e32129c6c04869c054f20a739d6ce5c | [
"MIT"
] | null | null | null | tests/test_add_option_enqueue.py | benhowes/loguru | b576d9767e32129c6c04869c054f20a739d6ce5c | [
"MIT"
] | null | null | null | from loguru import logger
import pytest
import time
import re
import sys
class NotPicklable:
def __getstate__(self):
raise RuntimeError("You shall not serialize me!")
def __setstate__(self, state):
pass
class NotUnpicklable:
def __getstate__(self):
return "..."
def __setsta... | 27.688172 | 76 | 0.629709 |
4089d5a55890ee41005c2ca825c7644b9733f297 | 753 | py | Python | src/dockerjango/dockerjango/urls.py | adamappsdev/Dockerjango | 76ecc537a4d8ef7efe41c4a8c69a5214edd23403 | [
"MIT"
] | null | null | null | src/dockerjango/dockerjango/urls.py | adamappsdev/Dockerjango | 76ecc537a4d8ef7efe41c4a8c69a5214edd23403 | [
"MIT"
] | null | null | null | src/dockerjango/dockerjango/urls.py | adamappsdev/Dockerjango | 76ecc537a4d8ef7efe41c4a8c69a5214edd23403 | [
"MIT"
] | null | null | null | """dockerjango URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 34.227273 | 77 | 0.710491 |
31358cf08831bc34d6a22910e63bb5a0259f59d3 | 420 | py | Python | run_demo.py | natchapolt/face-orientation-prep | 378b25fa78c7429d007cf384410c39791cbd317c | [
"MIT"
] | null | null | null | run_demo.py | natchapolt/face-orientation-prep | 378b25fa78c7429d007cf384410c39791cbd317c | [
"MIT"
] | 3 | 2021-03-19T01:39:32.000Z | 2022-01-13T01:22:13.000Z | run_demo.py | natchapolt/face-orientation-prep | 378b25fa78c7429d007cf384410c39791cbd317c | [
"MIT"
] | null | null | null | import cv2
import sys
from faceorientationprep.faceorientationfixer import FaceOrientationFixer
def main():
if len(sys.argv) == 1:
msg = """Usage:
python run_demo.py \"<image-path>\""""
print(msg)
return
f = FaceOrientationFixer()
im = cv2.imread(sys.argv[1])
cv2.ims... | 19.090909 | 73 | 0.619048 |
dcdb4a5b552f18aa140b708e3701bf1f940c8660 | 4,167 | py | Python | source/lambda/capture_news_feed/test/test_stream_helper.py | knihit/discovering-hot-topics-using-machine-learning | a7d2d87bedee54d18d6885d472f758b0bacf9db8 | [
"Apache-2.0"
] | null | null | null | source/lambda/capture_news_feed/test/test_stream_helper.py | knihit/discovering-hot-topics-using-machine-learning | a7d2d87bedee54d18d6885d472f758b0bacf9db8 | [
"Apache-2.0"
] | 21 | 2021-07-22T19:02:25.000Z | 2022-02-14T16:28:18.000Z | source/lambda/ingestion-youtube/test/test_stream_helper.py | aassadza-org/discovering-hot-topics-using-machine-learning | ef5f9d00a14b6b2024c9e0f9dfb915a6e632074d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 56.310811 | 472 | 0.552676 |
598544731ee469685aaff8bb7b149b02adf21435 | 2,039 | py | Python | examples/custom_eval.py | zangy17/OpenAttack | 9114a8af12680f14684d2bf1bc6a5c5e34f8932c | [
"MIT"
] | 1 | 2020-09-27T23:10:14.000Z | 2020-09-27T23:10:14.000Z | examples/custom_eval.py | zangy17/OpenAttack | 9114a8af12680f14684d2bf1bc6a5c5e34f8932c | [
"MIT"
] | null | null | null | examples/custom_eval.py | zangy17/OpenAttack | 9114a8af12680f14684d2bf1bc6a5c5e34f8932c | [
"MIT"
] | 1 | 2020-09-01T11:14:42.000Z | 2020-09-01T11:14:42.000Z | '''
This example code shows how to design a customized attack evaluation metric, namely BLEU score.
'''
import OpenAttack
from nltk.translate.bleu_score import sentence_bleu
class CustomAttackEval(OpenAttack.DefaultAttackEval):
def __init__(self, attacker, clsf, processor=OpenAttack.DefaultTextProcessor(), **kwarg... | 38.471698 | 95 | 0.641981 |
9b075415b437ccaa3a7d86cc2ef16be39ef9c0af | 5,001 | py | Python | src/clients/ctm_api_client/models/host_group_data.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 5 | 2021-12-01T18:40:00.000Z | 2022-03-04T10:51:44.000Z | src/clients/ctm_api_client/models/host_group_data.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 3 | 2022-02-21T20:08:32.000Z | 2022-03-16T17:41:03.000Z | src/clients/ctm_api_client/models/host_group_data.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 7 | 2021-12-01T11:59:16.000Z | 2022-03-01T18:16:40.000Z | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.215
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from clients.ct... | 27.478022 | 88 | 0.565487 |
8a873f00dcfbdb93174d03b2016b4767148bbd9e | 154 | py | Python | tests/odm/test_sqlite.py | quantmind/lux | 7318fcd86c77616aada41d8182a04339680a554c | [
"BSD-3-Clause"
] | 21 | 2015-03-28T23:27:43.000Z | 2020-11-23T13:24:10.000Z | tests/odm/test_sqlite.py | quantmind/lux | 7318fcd86c77616aada41d8182a04339680a554c | [
"BSD-3-Clause"
] | 195 | 2015-02-18T17:22:28.000Z | 2017-12-01T23:01:16.000Z | tests/odm/test_sqlite.py | quantmind/lux | 7318fcd86c77616aada41d8182a04339680a554c | [
"BSD-3-Clause"
] | 16 | 2015-03-31T23:15:38.000Z | 2017-04-18T11:59:43.000Z | import tests.odm.test_postgresql as postgresql
from tests.odm.utils import SqliteMixin
class TestSql(SqliteMixin, postgresql.TestPostgreSql):
pass
| 19.25 | 54 | 0.818182 |
4e8d13c8d1d568534d5ea1b9a820686c3ea45080 | 501 | py | Python | tests/system/test_base.py | kussj/cassandrabeat | feaf39f9eddc905780a59bb281983ec5ea28acd8 | [
"Apache-2.0"
] | null | null | null | tests/system/test_base.py | kussj/cassandrabeat | feaf39f9eddc905780a59bb281983ec5ea28acd8 | [
"Apache-2.0"
] | null | null | null | tests/system/test_base.py | kussj/cassandrabeat | feaf39f9eddc905780a59bb281983ec5ea28acd8 | [
"Apache-2.0"
] | null | null | null | from cassandrabeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Cassandrabeat normally
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
cassandrabeat_proc = se... | 25.05 | 79 | 0.638723 |
1dfee333e6fa0523611657da2908d959068d44f8 | 4,911 | py | Python | tests/test_fallback_expressions.py | Symmetry-International/m2cgen | 3157e0cbd5bd1ee7e044a992223c60224e2b7709 | [
"MIT"
] | 1 | 2021-05-28T06:59:21.000Z | 2021-05-28T06:59:21.000Z | tests/test_fallback_expressions.py | Symmetry-International/m2cgen | 3157e0cbd5bd1ee7e044a992223c60224e2b7709 | [
"MIT"
] | null | null | null | tests/test_fallback_expressions.py | Symmetry-International/m2cgen | 3157e0cbd5bd1ee7e044a992223c60224e2b7709 | [
"MIT"
] | null | null | null | from m2cgen import ast
from m2cgen.interpreters import CInterpreter, PythonInterpreter
from tests.utils import assert_code_equal
def test_abs_fallback_expr():
expr = ast.AbsExpr(ast.NumVal(-2.0))
interpreter = CInterpreter()
interpreter.abs_function_name = NotImplemented
expected_code = """
double ... | 25.184615 | 75 | 0.604358 |
10252181dfd15e2891365d5cf56448ee9a38231d | 1,887 | py | Python | autokeras/hyper_preprocessors.py | jwliou/autokeras | f9b4cdf445368d69f776317f372b09b66f45b69e | [
"Apache-2.0"
] | 4,704 | 2017-12-03T02:40:27.000Z | 2019-12-19T23:23:34.000Z | autokeras/hyper_preprocessors.py | jwliou/autokeras | f9b4cdf445368d69f776317f372b09b66f45b69e | [
"Apache-2.0"
] | 541 | 2018-02-13T21:59:58.000Z | 2019-04-01T15:21:57.000Z | autokeras/hyper_preprocessors.py | jwliou/autokeras | f9b4cdf445368d69f776317f372b09b66f45b69e | [
"Apache-2.0"
] | 738 | 2018-02-07T03:01:13.000Z | 2019-12-19T23:23:36.000Z | # Copyright 2020 The AutoKeras 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 applicable law or agreed to i... | 31.983051 | 83 | 0.72973 |
fe3c7a998c371a89535d41f098a60635a861c1d9 | 13,331 | py | Python | autokeras/image_supervised.py | Bennnun/autokeras | 8cd0b8dd5627e41ba31ea1f099a7c2ae469f902f | [
"MIT"
] | null | null | null | autokeras/image_supervised.py | Bennnun/autokeras | 8cd0b8dd5627e41ba31ea1f099a7c2ae469f902f | [
"MIT"
] | null | null | null | autokeras/image_supervised.py | Bennnun/autokeras | 8cd0b8dd5627e41ba31ea1f099a7c2ae469f902f | [
"MIT"
] | null | null | null | import csv
import os
import pickle
import time
from abc import abstractmethod
from functools import reduce
import numpy as np
from scipy import ndimage
import torch
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from autokeras.loss_function import classification_loss, ... | 36.225543 | 118 | 0.647963 |
97d5ae1f5dc76405bc0f01803d647534988f1616 | 3,229 | py | Python | research/object_detection/generate_tfrecord.py | stesha2016/models | addb5baa31875232b6b8f5b61d0522de56a79f08 | [
"Apache-2.0"
] | 1 | 2021-07-17T11:33:57.000Z | 2021-07-17T11:33:57.000Z | research/object_detection/generate_tfrecord.py | stesha2016/models | addb5baa31875232b6b8f5b61d0522de56a79f08 | [
"Apache-2.0"
] | null | null | null | research/object_detection/generate_tfrecord.py | stesha2016/models | addb5baa31875232b6b8f5b61d0522de56a79f08 | [
"Apache-2.0"
] | 1 | 2019-07-24T03:52:18.000Z | 2019-07-24T03:52:18.000Z | """ Usage: # From tensorflow/models/
# Create train data: python generate_tfrecord.py
--csv_input=images/train_labels.csv
--image_dir=images/train
--output_path=train.record
# Create test data: python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record """
from __f... | 34.72043 | 136 | 0.743574 |
769801b46e9f88419eea9f92be1c8656bf986912 | 2,364 | py | Python | MH.py | EricBlythe/RSA | 25b87c17ec56a21488c3f84dcc77a847f2dc5ef2 | [
"MIT"
] | 1 | 2021-07-01T13:57:29.000Z | 2021-07-01T13:57:29.000Z | MH.py | EricBlythe/RSA | 25b87c17ec56a21488c3f84dcc77a847f2dc5ef2 | [
"MIT"
] | null | null | null | MH.py | EricBlythe/RSA | 25b87c17ec56a21488c3f84dcc77a847f2dc5ef2 | [
"MIT"
] | null | null | null | def gcd(a,b):
a,b=abs(a), abs(b)
if a<b:
t=a
a=b
b=t
if a%b==0:
return b
else:
return gcd(a%b, b)
class Fraction:
def __init__(self,a,b):
if a==0:
self.a=0
self.b=1
return
if a*b<0:
... | 20.556522 | 71 | 0.416244 |
f8431aca0f5b810642bb4e9ef2d4ce581a0d28a8 | 537 | py | Python | mmdet/models/detectors/solov2.py | Joxis/mmdetection | ad14c6e820f7516c3b31514fea271ba5c46e8fdb | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/solov2.py | Joxis/mmdetection | ad14c6e820f7516c3b31514fea271ba5c46e8fdb | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/solov2.py | Joxis/mmdetection | ad14c6e820f7516c3b31514fea271ba5c46e8fdb | [
"Apache-2.0"
] | null | null | null | from .single_stage_ins import SingleStageInsDetector
from ..builder import DETECTORS
@DETECTORS.register_module
class SOLOv2(SingleStageInsDetector):
def __init__(self,
backbone,
neck,
bbox_head,
mask_feat_head,
train_cfg=None,
... | 29.833333 | 79 | 0.56797 |
2a5cd013563e07934fdfe94f81b94a324ca01984 | 101 | py | Python | python/rpdk/python/__init__.py | RG4421/cloudformation-cli-python-plugin | a53dc519764f7b876e1cc3cef4b9daea70822887 | [
"Apache-2.0"
] | null | null | null | python/rpdk/python/__init__.py | RG4421/cloudformation-cli-python-plugin | a53dc519764f7b876e1cc3cef4b9daea70822887 | [
"Apache-2.0"
] | null | null | null | python/rpdk/python/__init__.py | RG4421/cloudformation-cli-python-plugin | a53dc519764f7b876e1cc3cef4b9daea70822887 | [
"Apache-2.0"
] | 2 | 2020-09-01T16:42:30.000Z | 2021-09-28T05:20:36.000Z | import logging
__version__ = "2.1.0"
logging.getLogger(__name__).addHandler(logging.NullHandler())
| 16.833333 | 61 | 0.782178 |
a5aa0be7303ab8e928d16b283a18bcd25cac9c51 | 5,638 | py | Python | app/model/utils.py | othmanKisha/In-Door-Face-Mask-Inspector | d094ff80f8ed16285d668905a081c237d4345919 | [
"MIT"
] | 3 | 2020-12-06T17:03:57.000Z | 2021-01-01T13:11:39.000Z | app/model/utils.py | Alnasser0/In-Door-Face-Mask-Inspector-1 | d094ff80f8ed16285d668905a081c237d4345919 | [
"MIT"
] | null | null | null | app/model/utils.py | Alnasser0/In-Door-Face-Mask-Inspector-1 | d094ff80f8ed16285d668905a081c237d4345919 | [
"MIT"
] | 1 | 2021-01-21T18:55:05.000Z | 2021-01-21T18:55:05.000Z | # -*- encoding=utf-8
# Code from this Repository: https://github.com/AIZOOTech/FaceMaskDetection
import numpy as np
def generate_anchors(feature_map_sizes, anchor_sizes, anchor_ratios, offset=0.5):
'''
generate anchors.
:param feature_map_sizes: list of list, for example: [[40,40], [20,20]]
:param anc... | 43.038168 | 111 | 0.643313 |
502422d75e51be247286f1aa47b5ade27441fea5 | 11,649 | py | Python | MetamorphicTests/all_mutants/sales_forecasting_file/155.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/155.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/155.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | 1 | 2022-02-06T14:59:43.000Z | 2022-02-06T14:59:43.000Z | def gen_mutants():
import tensorflow as tf
import pandas
import numpy as np
DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv'
DATAFILE_VALIDATE = 'mock_kaggle_edit_... | 31.230563 | 232 | 0.629668 |
bef213c633a620d295b147bfa27439b22c57ecc4 | 6,782 | py | Python | glue/core/tests/test_hub.py | bsipocz/glue | 7b7e4879b4c746b2419a0eca2a17c2d07a3fded3 | [
"BSD-3-Clause"
] | null | null | null | glue/core/tests/test_hub.py | bsipocz/glue | 7b7e4879b4c746b2419a0eca2a17c2d07a3fded3 | [
"BSD-3-Clause"
] | null | null | null | glue/core/tests/test_hub.py | bsipocz/glue | 7b7e4879b4c746b2419a0eca2a17c2d07a3fded3 | [
"BSD-3-Clause"
] | null | null | null | #pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
import pytest
from mock import MagicMock
from ..exceptions import InvalidSubscriber, InvalidMessage
from ..message import SubsetMessage, Message
from ..hub import Hub, HubListener
from ..subset import Subset
from ..data import Data
from ..data_collection import Data... | 38.534091 | 79 | 0.680183 |
9e5e2e5abb5a02221b2950ed094527ad8d7acf32 | 18,030 | py | Python | test/test_LensModel/test_Profiles/test_chameleon.py | DarthLazar/lenstronomy | 64f72a89bb08ef19d3641b7e5e048238632e9094 | [
"MIT"
] | null | null | null | test/test_LensModel/test_Profiles/test_chameleon.py | DarthLazar/lenstronomy | 64f72a89bb08ef19d3641b7e5e048238632e9094 | [
"MIT"
] | 1 | 2022-02-26T21:04:47.000Z | 2022-02-26T21:04:47.000Z | test/test_LensModel/test_Profiles/test_chameleon.py | DarthLazar/lenstronomy | 64f72a89bb08ef19d3641b7e5e048238632e9094 | [
"MIT"
] | 1 | 2022-02-08T20:31:45.000Z | 2022-02-08T20:31:45.000Z |
import pytest
import numpy as np
import numpy.testing as npt
from lenstronomy.LensModel.Profiles.nie import NIE
from lenstronomy.LensModel.Profiles.chameleon import Chameleon, DoubleChameleon, DoubleChameleonPointMass, TripleChameleon
from lenstronomy.LightModel.Profiles.chameleon import DoubleChameleon as DoubleChame... | 43.341346 | 174 | 0.553356 |
0e6178979d3b16aadc68fd67e1409ab958dc6e6f | 7,082 | py | Python | metrics/algorithmic.py | cassianobecker/dnn | bb2ea04f77733de9df10f795bb049ac3b9d30478 | [
"MIT"
] | 3 | 2020-02-21T21:35:07.000Z | 2020-09-29T15:20:00.000Z | metrics/algorithmic.py | cassianobecker/dnn | bb2ea04f77733de9df10f795bb049ac3b9d30478 | [
"MIT"
] | 27 | 2020-02-20T21:00:23.000Z | 2020-05-22T15:23:25.000Z | metrics/algorithmic.py | cassianobecker/dnn | bb2ea04f77733de9df10f795bb049ac3b9d30478 | [
"MIT"
] | null | null | null | import math
from fwk.metrics import Metric
from fwk.config import Config
class EpochCounter(Metric):
def __init__(self) -> None:
super().__init__()
self.epoch = None
self.total_epochs = None
def on_before_epoch(self, local_variables):
self.epoch = local_variables['epoch']
... | 32.045249 | 117 | 0.655888 |
dc3d2b6d0f91f2b2a25bbb50c3fea732c8baed81 | 2,296 | py | Python | GetTheFieldsAndSubfields.py | WissamAntoun/LebaneseEngineers | c0cc7e85ead4e7ec6677882f80a5a7bcd4d80e87 | [
"MIT"
] | 1 | 2021-02-12T21:00:53.000Z | 2021-02-12T21:00:53.000Z | GetTheFieldsAndSubfields.py | WissamAntoun/LebaneseEngineers | c0cc7e85ead4e7ec6677882f80a5a7bcd4d80e87 | [
"MIT"
] | null | null | null | GetTheFieldsAndSubfields.py | WissamAntoun/LebaneseEngineers | c0cc7e85ead4e7ec6677882f80a5a7bcd4d80e87 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import requests
import sys
import codecs
sys.stdout.reconfigure(encoding="utf-8")
if __name__ == "__main__":
subfields_df = pd.read_csv("subfields.csv", encoding="utf-8", index_col=0)
fields_df = pd.read_csv("fields.csv", encoding="utf-8", index_col=0)
fields = np.d... | 31.888889 | 86 | 0.39939 |
a3ecb9050652368eccb195869c30f26e32c10fe4 | 38,248 | py | Python | visualizations/plot_utils.py | afogarty85/typos | 30b79a4ab4cd7c996fb394524906a6bffab3a2ab | [
"MIT"
] | null | null | null | visualizations/plot_utils.py | afogarty85/typos | 30b79a4ab4cd7c996fb394524906a6bffab3a2ab | [
"MIT"
] | 1 | 2021-04-15T16:41:31.000Z | 2021-04-15T16:41:31.000Z | visualizations/plot_utils.py | afogarty85/typos | 30b79a4ab4cd7c996fb394524906a6bffab3a2ab | [
"MIT"
] | 1 | 2021-04-22T14:29:36.000Z | 2021-04-22T14:29:36.000Z | ############################################################################
# IMPORTS
############################################################################
import numpy as np
import seaborn as sns
import pandas as pd
import altair as alt
from collections import OrderedDict
from vega_datasets import data
impor... | 44.892019 | 177 | 0.501935 |
a342a453e598c5666a65e62341c4df474c7b78af | 737 | py | Python | pymc3/examples/arbitrary_stochastic.py | vpolisky/pymc3 | 87cdd712c86321121c2ed3150764f3d847f5083c | [
"Apache-2.0"
] | 15 | 2016-03-29T17:22:45.000Z | 2021-05-05T06:28:06.000Z | pymc3/examples/arbitrary_stochastic.py | taku-y/pymc3 | 70e3ca5e137b67aac0390c7e3979ec16842c4aed | [
"Apache-2.0"
] | 1 | 2019-08-17T06:58:38.000Z | 2019-08-17T06:58:38.000Z | pymc3/examples/arbitrary_stochastic.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | 6 | 2016-06-30T08:58:16.000Z | 2019-01-26T16:50:54.000Z | import numpy as np
import pymc3 as pm
import theano.tensor as tt
def build_model():
with pm.Model() as model:
lam = pm.Exponential('lam', 1)
failure = np.array([0, 1])
value = np.array([1, 0])
def logp(failure, value):
return tt.sum(failure * np.log(lam) - lam * value)... | 26.321429 | 80 | 0.626866 |
9dc4ac1939f203f6dd514e3f7bfdde55b7e22e06 | 4,433 | py | Python | tests/unit/plugins/openstack/context/network/test_network.py | aforalee/rallyALi | 8050ca08b0e253aeb19a1cec34f33c648f00136a | [
"Apache-2.0"
] | 2 | 2015-02-06T11:03:12.000Z | 2015-03-02T10:39:44.000Z | tests/unit/plugins/openstack/context/network/test_network.py | aforalee/rallyALi | 8050ca08b0e253aeb19a1cec34f33c648f00136a | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/context/network/test_network.py | aforalee/rallyALi | 8050ca08b0e253aeb19a1cec34f33c648f00136a | [
"Apache-2.0"
] | 2 | 2016-03-16T03:52:13.000Z | 2020-10-02T07:58:50.000Z | # Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 45.234694 | 79 | 0.643582 |
a0c393565bb26f88c2ae74f20002c1cffa8d8639 | 2,462 | py | Python | emcap-compress.py | rpp0/emma | fab81e1c66b8a88d14e68b8878ddbb5ee6528de2 | [
"MIT"
] | 36 | 2019-01-08T12:49:36.000Z | 2022-03-31T08:11:48.000Z | emcap-compress.py | rpp0/emma | fab81e1c66b8a88d14e68b8878ddbb5ee6528de2 | [
"MIT"
] | 6 | 2020-01-28T22:59:05.000Z | 2022-02-10T00:14:43.000Z | emcap-compress.py | rpp0/emma | fab81e1c66b8a88d14e68b8878ddbb5ee6528de2 | [
"MIT"
] | 3 | 2019-02-12T11:55:42.000Z | 2020-08-12T23:30:05.000Z | #!/usr/bin/python
"""
This program compresses datasets captured with emcap using either PCA or an autoencoder. It looks for a manifest.emcap
inside the dataset directory and applies the compression to the trace set given as argument. The program is called from
emcap to mitigate the fact that Python 3 is not supported ... | 41.033333 | 121 | 0.6974 |
ff639141c6df908b8b14b6f18ec91167ca534325 | 7,409 | py | Python | qa/rpc-tests/test_framework/test_framework.py | dnoiz1/ruxcoin | 07e30a2b5ebc624ac8a2d92be435e895ede5deae | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/test_framework.py | dnoiz1/ruxcoin | 07e30a2b5ebc624ac8a2d92be435e895ede5deae | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/test_framework.py | dnoiz1/ruxcoin | 07e30a2b5ebc624ac8a2d92be435e895ede5deae | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Ruxcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
import logging
import optparse
import os
import sys
import shutil
import te... | 34.460465 | 139 | 0.613848 |
86e0b1ede63cdfbc23a29baa3671e3de0fa8fd4c | 246 | py | Python | instaread/instapaper/example.py | anhdat/instaread | c554c58ae32119d3d80c8db1a163a1712c3f4f90 | [
"MIT"
] | null | null | null | instaread/instapaper/example.py | anhdat/instaread | c554c58ae32119d3d80c8db1a163a1712c3f4f90 | [
"MIT"
] | null | null | null | instaread/instapaper/example.py | anhdat/instaread | c554c58ae32119d3d80c8db1a163a1712c3f4f90 | [
"MIT"
] | null | null | null | import instapaper
I = instapaper.Instapaper("<oauth_consumer_key>", "<oauth_consumer_secret>")
I.login("<user_name>", "<password>")
b = instapaper.Bookmark(I, {"url": "https://www.biblegateway.com/passage/?search=John+1&version=NIV"})
b.save()
| 30.75 | 102 | 0.723577 |
758678e10d95a793dcf123dd81afd7a6fccf5711 | 326 | py | Python | 2017/day21/part1.py | dcabezas98/advent-of-code | c3a1e376bfea877a5af3b4472bb1ca6a5807b52e | [
"MIT"
] | null | null | null | 2017/day21/part1.py | dcabezas98/advent-of-code | c3a1e376bfea877a5af3b4472bb1ca6a5807b52e | [
"MIT"
] | null | null | null | 2017/day21/part1.py | dcabezas98/advent-of-code | c3a1e376bfea877a5af3b4472bb1ca6a5807b52e | [
"MIT"
] | null | null | null |
pattern = [['.','#','.'],['.','.','#'],['#','#','#']]
rules_book_inputs = {}
rules_book_outputs = {}
with open("input.txt") as f:
for line in f:
i, o = line[:-1].split(" => ")
i = i.split("/")
i = list(map(list,i))
o = o.split("/")
o = list(map(list,o))
rules_book... | 20.375 | 53 | 0.407975 |
1ad9d0054f90f20f4055ba5af3fb3c2bb931f247 | 15,932 | py | Python | tensorflow/python/keras/engine/sequential.py | Byambaa0325/tensorflow | dc001fd87b0661436d090af8fd51253c8264679f | [
"Apache-2.0"
] | 1 | 2020-03-03T13:36:29.000Z | 2020-03-03T13:36:29.000Z | tensorflow/python/keras/engine/sequential.py | Byambaa0325/tensorflow | dc001fd87b0661436d090af8fd51253c8264679f | [
"Apache-2.0"
] | 2 | 2021-08-25T15:59:18.000Z | 2022-02-10T02:00:23.000Z | tensorflow/python/keras/engine/sequential.py | Byambaa0325/tensorflow | dc001fd87b0661436d090af8fd51253c8264679f | [
"Apache-2.0"
] | 1 | 2022-03-18T04:26:38.000Z | 2022-03-18T04:26:38.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.575472 | 91 | 0.682651 |
13599f1abb1b715b6c351d091033137d9fcbb2df | 902 | py | Python | jobs/delete_unsaved_candidates.py | jialin-wu-02/skyportal | 29d606ad8567b2230fb0553b18dd3cb9d3ab2d84 | [
"BSD-3-Clause"
] | null | null | null | jobs/delete_unsaved_candidates.py | jialin-wu-02/skyportal | 29d606ad8567b2230fb0553b18dd3cb9d3ab2d84 | [
"BSD-3-Clause"
] | 156 | 2019-10-17T19:35:22.000Z | 2021-08-01T13:23:47.000Z | jobs/delete_unsaved_candidates.py | jialin-wu-02/skyportal | 29d606ad8567b2230fb0553b18dd3cb9d3ab2d84 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import datetime
from skyportal.models import init_db, Candidate, Source, Obj, DBSession
from baselayer.app.env import load_env
env, cfg = load_env()
init_db(**cfg["database"])
try:
n_days = int(cfg["misc.days_to_keep_unsaved_candidates"])
except ValueError:
raise ValueError("Invalid (n... | 27.333333 | 91 | 0.727273 |
43777880f7de832c2dea7ab11d6cd56f586c7559 | 14,268 | py | Python | Python/Vague/piddletest3.py | joel-s/portfolio | 4b45f0c9bbf1647ef7865e0d2616b78030a27389 | [
"FSFAP"
] | null | null | null | Python/Vague/piddletest3.py | joel-s/portfolio | 4b45f0c9bbf1647ef7865e0d2616b78030a27389 | [
"FSFAP"
] | null | null | null | Python/Vague/piddletest3.py | joel-s/portfolio | 4b45f0c9bbf1647ef7865e0d2616b78030a27389 | [
"FSFAP"
] | null | null | null | """piddletest.py
This module puts the various PIDDLE backends through their paces.
"""
import pagesizes
from piddle import *
import string
import sys
import math
from math import pi
from math import sin
from math import cos
backends = ['piddlePDF','piddlePIL','piddleVCR','piddleTK',
'piddlePS','piddleAI','pidd... | 31.706667 | 119 | 0.629591 |
dce453660a898f30d149906116f2416c01f2cf85 | 6,482 | py | Python | tests/test_np.py | k7hoven/np | 1d0ba711c5b679c2d1c1204c2f6ae50d2f5a5e92 | [
"0BSD"
] | 6 | 2015-10-21T18:10:56.000Z | 2021-08-11T13:48:17.000Z | tests/test_np.py | artificialligence/np | 1d0ba711c5b679c2d1c1204c2f6ae50d2f5a5e92 | [
"0BSD"
] | null | null | null | tests/test_np.py | artificialligence/np | 1d0ba711c5b679c2d1c1204c2f6ae50d2f5a5e92 | [
"0BSD"
] | 2 | 2016-08-31T13:51:10.000Z | 2021-07-01T07:39:54.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 24 19:49:23 2016
@author: Koos Zevenhoven
"""
import unittest
import unittest.mock
import np
import sys
class NPTestCase(unittest.TestCase):
def assertIdenticalArray(self, arr1, arr2):
self.assertTrue((arr1 == arr2).all())
self.assertEqual(arr1.dtype... | 37.252874 | 104 | 0.573743 |
8c34cf54735c671cea4917cf8bc9e72219e36613 | 263 | py | Python | coinmarketcap/__init__.py | tfrizza/coinmarketcap-4.1.1 | 6013f3ef893bd98b9e3168f82908d7ad9429239e | [
"Apache-2.0"
] | null | null | null | coinmarketcap/__init__.py | tfrizza/coinmarketcap-4.1.1 | 6013f3ef893bd98b9e3168f82908d7ad9429239e | [
"Apache-2.0"
] | null | null | null | coinmarketcap/__init__.py | tfrizza/coinmarketcap-4.1.1 | 6013f3ef893bd98b9e3168f82908d7ad9429239e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__title__ = 'coinmarketcap'
__version__ = '4.1.1'
__author__ = 'Martin Simon <me@martinsimon.me>'
__repo__ = 'https://github.com/mrsmn/coinmarketcap-api'
__license__ = 'Apache v2.0 License'
from .core import Market
| 23.909091 | 55 | 0.711027 |
df6726a3fff69f96fb1bbe9ab76b475ca59236d9 | 7,286 | py | Python | deepcell/utils/testing_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/utils/testing_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/utils/testing_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 David Van Valen at California Institute of Technology
# (Caltech), with support from the Paul Allen Family Foundation, Google,
# & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you... | 40.703911 | 80 | 0.666072 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.