hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
96b1acfddaea8acf23911566a94f1e0201a808e2 | 1,084 | py | Python | models.py | VonStruddle/tacocat-app-treehouse | 3ca8e21fabe9037d8271fed979857b1eac13a083 | [
"MIT"
] | null | null | null | models.py | VonStruddle/tacocat-app-treehouse | 3ca8e21fabe9037d8271fed979857b1eac13a083 | [
"MIT"
] | null | null | null | models.py | VonStruddle/tacocat-app-treehouse | 3ca8e21fabe9037d8271fed979857b1eac13a083 | [
"MIT"
] | null | null | null | import datetime
from flask_login import UserMixin
from flask_bcrypt import generate_password_hash
from peewee import *
DB = SqliteDatabase('tacocat.db')
class User(UserMixin, Model):
email = CharField(unique=True)
password = CharField(max_length=100)
class Meta:
database = DB
@classmethod... | 21.68 | 61 | 0.617159 |
cb5f021d6816325cff962dc371b5af51b459fc81 | 1,006 | py | Python | src/mrnet/utils/graphs.py | KhanWhale/mrnet | fc6660b1b4175315b242b1eb69189e1fe8853cf6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/mrnet/utils/graphs.py | KhanWhale/mrnet | fc6660b1b4175315b242b1eb69189e1fe8853cf6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/mrnet/utils/graphs.py | KhanWhale/mrnet | fc6660b1b4175315b242b1eb69189e1fe8853cf6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from typing import List, Tuple
from pymatgen.analysis.graphs import MoleculeGraph
def extract_bond_environment(
mg: MoleculeGraph, bonds: List[Tuple[int, int]], order=1
) -> set:
"""
Extract the local environment of a particular chemical bond in a MoleculeGraph
:param bonds:
:param order:
:... | 27.944444 | 87 | 0.606362 |
2fe0699a44b7eddd414f73f3bcbab7ec23811dcd | 3,759 | py | Python | setup.py | timothydlister/iosfw | 29759d8595610492db921d19eee1e79c4f114811 | [
"MIT"
] | 74 | 2018-07-17T01:45:32.000Z | 2022-03-28T11:46:11.000Z | setup.py | timothydlister/iosfw | 29759d8595610492db921d19eee1e79c4f114811 | [
"MIT"
] | 12 | 2019-06-28T20:57:14.000Z | 2021-06-22T17:13:00.000Z | setup.py | timothydlister/iosfw | 29759d8595610492db921d19eee1e79c4f114811 | [
"MIT"
] | 16 | 2019-08-14T21:05:34.000Z | 2022-03-20T20:02:34.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Lovingly copied from https://github.com/kennethreitz/setup.py
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Pac... | 28.263158 | 86 | 0.644586 |
4b4e529b7367b13746c0daa55008ec910826e248 | 93 | py | Python | src/contactus/apps.py | Ameesha2001/Ekyam-scl-maxo | d9a8ec0e2d297d20fcf9139cfe50a7c814cdb2f5 | [
"MIT"
] | 10 | 2021-01-02T14:54:33.000Z | 2022-02-09T07:11:05.000Z | yantragene/contactus/apps.py | brijeshgzp05/techfest-yantragene | 98efdaefede9ea0e4fb7241e97272f0079673863 | [
"MIT"
] | 44 | 2020-05-13T20:15:26.000Z | 2022-03-04T02:58:58.000Z | yantragene/contactus/apps.py | brijeshgzp05/techfest-yantragene | 98efdaefede9ea0e4fb7241e97272f0079673863 | [
"MIT"
] | 8 | 2020-12-24T07:58:24.000Z | 2022-01-04T15:22:30.000Z | from django.apps import AppConfig
class ContactusConfig(AppConfig):
name = 'contactus'
| 15.5 | 33 | 0.763441 |
73bf0bac862e49305c40c94a2032a3563af7cc72 | 1,095 | py | Python | rssant_api/migrations/0012_auto_20191025_1526.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 1,176 | 2019-12-24T01:51:22.000Z | 2022-03-29T06:00:25.000Z | rssant_api/migrations/0012_auto_20191025_1526.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 33 | 2020-03-06T03:29:46.000Z | 2022-03-11T06:24:26.000Z | rssant_api/migrations/0012_auto_20191025_1526.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 110 | 2019-12-29T05:49:24.000Z | 2022-03-28T06:44:21.000Z | # Generated by Django 2.2.6 on 2019-10-25 15:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rssant_api', '0011_auto_20190714_0550'),
]
operations = [
migrations.AddField(
model_name='feed',
name='monthly_stor... | 37.758621 | 209 | 0.593607 |
7f849a261c6daf72ba9d476f4742b67f76d98176 | 6,968 | py | Python | hedwig/models/bert/__main__.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | 3 | 2019-07-20T15:23:59.000Z | 2021-04-26T02:57:59.000Z | hedwig/models/bert/__main__.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | null | null | null | hedwig/models/bert/__main__.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | null | null | null | import os
import random
import time
import numpy as np
import torch
from common.evaluators.bert_evaluator import BertEvaluator
from common.trainers.bert_trainer import BertTrainer
from datasets.bert_processors.aapd_processor import AAPDProcessor
from datasets.bert_processors.agnews_processor import AGNewsProcessor
fr... | 41.47619 | 144 | 0.692308 |
4f71853f1bbf67546075ef75c55a0f9aea741497 | 1,004 | py | Python | tests/test_util.py | ties/rpki-client-web | afce9bb2e8deeaab8cb6c4ff3fd26a1cde8563d9 | [
"MIT"
] | 1 | 2021-11-23T12:43:43.000Z | 2021-11-23T12:43:43.000Z | tests/test_util.py | ties/rpki-client-web | afce9bb2e8deeaab8cb6c4ff3fd26a1cde8563d9 | [
"MIT"
] | 18 | 2021-04-08T19:21:04.000Z | 2022-03-11T14:41:30.000Z | tests/test_util.py | ties/rpki-client-web | afce9bb2e8deeaab8cb6c4ff3fd26a1cde8563d9 | [
"MIT"
] | 1 | 2021-04-08T18:52:04.000Z | 2021-04-08T18:52:04.000Z | import pytest
from rpkiclientweb.util import parse_host, validate
def test_parse_legacy_format():
res = parse_host(
"rpki.cnnic.cn/rpki/A9162E3D0000/1587/h6wAjnaB0p2pptlBZ4bkOwowMM8.roa"
)
assert res == "rpki.cnnic.cn"
def test_rrdp_format():
res = parse_host(
"rrdp/73885635ed288148... | 25.1 | 141 | 0.72012 |
880c27987c3d8d6bc450c8d1c45ea48f67538bab | 6,111 | py | Python | rbtools/commands/patch.py | brettdh/rbtools | ddaa655aeac4a087580696f8e1155f90637d80be | [
"MIT"
] | null | null | null | rbtools/commands/patch.py | brettdh/rbtools | ddaa655aeac4a087580696f8e1155f90637d80be | [
"MIT"
] | null | null | null | rbtools/commands/patch.py | brettdh/rbtools | ddaa655aeac4a087580696f8e1155f90637d80be | [
"MIT"
] | null | null | null | import re
from rbtools.api.errors import APIError
from rbtools.commands import Command, CommandError, Option
from rbtools.utils.filesystem import make_tempfile
# MARKDOWN_ESCAPED_CHARS comes from markdown.Markdown.ESCAPED_CHARS. We don't
# want to have a dependency on markdown for rbtools, so we just copy it into
# ... | 37.956522 | 79 | 0.580429 |
6cadb21bc375444a3c12dea15d7cb9cf09c15767 | 702 | py | Python | incomplete/search-engine/sizes.py | adlerliu/500lines | 9100aaa8cf510439460ab8a1fad3311926a94d90 | [
"CC-BY-3.0"
] | 26,185 | 2015-01-01T04:59:51.000Z | 2022-03-31T10:20:14.000Z | incomplete/search-engine/sizes.py | fsxchen/500lines | 3f2cd407ebedaf0a3cfa6858c4cf94543067433d | [
"CC-BY-3.0"
] | 160 | 2015-01-05T12:20:21.000Z | 2021-10-03T07:25:43.000Z | incomplete/search-engine/sizes.py | fsxchen/500lines | 3f2cd407ebedaf0a3cfa6858c4cf94543067433d | [
"CC-BY-3.0"
] | 6,572 | 2015-01-01T01:31:00.000Z | 2022-03-31T07:31:22.000Z | #!/usr/bin/python
def xcumsum(xs):
total = 0
for xx in xs:
yield total
total += xx
def describe(sizes):
print ' ' * 4 + ' '.join("%4d" % size for size in sizes)
print ' ' * 4 + ' '.join("%4d" % tots for tots in xcumsum(sizes))
sizes = []
while True:
line = raw_input("+ ")
if ... | 22.645161 | 75 | 0.538462 |
2a6bf3bd9f1d921d9048cff8b4c962d6c797017e | 337 | py | Python | test_habitica.py | haclark30/habitica-cli | 5a5c2a919760a95af38a875da08e330e0948f620 | [
"MIT"
] | null | null | null | test_habitica.py | haclark30/habitica-cli | 5a5c2a919760a95af38a875da08e330e0948f620 | [
"MIT"
] | null | null | null | test_habitica.py | haclark30/habitica-cli | 5a5c2a919760a95af38a875da08e330e0948f620 | [
"MIT"
] | null | null | null | import unittest
from habitica import HabiticaAPI
import time
class TestHabitica(unittest.TestCase):
def setUp(self):
self.hbt_api = HabiticaAPI()
def test_get_content(self):
content = self.hbt_api.get_content()
time_diff = time.time() - content['dateRetrieved']
self.assertLess(... | 28.083333 | 58 | 0.703264 |
75ce8216f60b0353564c104d8fa5defa30da03d3 | 53,928 | py | Python | lib/sqlalchemy/orm/collections.py | brussee/sqlalchemy | 5e3357c70e419c244156ac3885b2cf784b5b3fc0 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/collections.py | brussee/sqlalchemy | 5e3357c70e419c244156ac3885b2cf784b5b3fc0 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/collections.py | brussee/sqlalchemy | 5e3357c70e419c244156ac3885b2cf784b5b3fc0 | [
"MIT"
] | null | null | null | # orm/collections.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Support for collections of mapped entities.
The collections package supplies... | 32.042781 | 78 | 0.621996 |
26e01f3706948ee9fdf0451e0ff891a7945fbade | 1,536 | py | Python | src/loader.py | mlennox/numeraiexplore | 888468f0802358f9778295b8f1fdf5f5f760053c | [
"MIT"
] | 1 | 2019-07-09T01:35:16.000Z | 2019-07-09T01:35:16.000Z | src/loader.py | mlennox/numeraiexplore | 888468f0802358f9778295b8f1fdf5f5f760053c | [
"MIT"
] | null | null | null | src/loader.py | mlennox/numeraiexplore | 888468f0802358f9778295b8f1fdf5f5f760053c | [
"MIT"
] | null | null | null | import pandas as pd
def load_training():
return pd.read_csv(
'./data/numerai_training_data.csv', header=0)
def load_tournament():
return pd.read_csv(
'./data/numerai_tournament_data.csv', header=0)
def pull_features(data_source, for_era=None, target_bernie_value=None):
if for_era is no... | 34.909091 | 85 | 0.713542 |
505be55c5e56be133e20a1c1780045f41296b2ae | 1,650 | py | Python | pychron/pipeline/plot/editors/spectrum_editor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/pipeline/plot/editors/spectrum_editor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/pipeline/plot/editors/spectrum_editor.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | 40.243902 | 85 | 0.597576 |
4395c486be6be5c4d811f96353eded08d823105a | 120 | py | Python | plugins/get_url/komand_get_url/util/constants.py | JaredAllen13/insightconnect-plugins | f68ce8c60ad20439284228dfcbcd9f8c1c0c7d31 | [
"MIT"
] | null | null | null | plugins/get_url/komand_get_url/util/constants.py | JaredAllen13/insightconnect-plugins | f68ce8c60ad20439284228dfcbcd9f8c1c0c7d31 | [
"MIT"
] | null | null | null | plugins/get_url/komand_get_url/util/constants.py | JaredAllen13/insightconnect-plugins | f68ce8c60ad20439284228dfcbcd9f8c1c0c7d31 | [
"MIT"
] | null | null | null | DEFAULT_USER_AGENT = "Mozilla/5.0"
DEFAULT_TIMEOUT = 60
DEFAULT_ENCODING = "utf-8"
DEFAULT_CACHE_FOLDER = "/var/cache/"
| 24 | 36 | 0.766667 |
f243d9573d49de3564ec245c4a468dd324ac39bd | 9,212 | py | Python | experiments/cleverhans/tutorials/mnist_tutorial_jsma.py | QMLB-GPapersCapstoneRepos/capstone18-AdversarialTexPlayground2 | 8feb6e1ef1d293dcb8869faa8a84216cdc3dd5ce | [
"Apache-2.0"
] | null | null | null | experiments/cleverhans/tutorials/mnist_tutorial_jsma.py | QMLB-GPapersCapstoneRepos/capstone18-AdversarialTexPlayground2 | 8feb6e1ef1d293dcb8869faa8a84216cdc3dd5ce | [
"Apache-2.0"
] | 1 | 2020-09-25T21:55:03.000Z | 2020-09-25T21:55:03.000Z | experiments/cleverhans/tutorials/mnist_tutorial_jsma.py | Qdata4Capstone/capstone18-AdversarialTexPlayground2 | 8feb6e1ef1d293dcb8869faa8a84216cdc3dd5ce | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import keras
import numpy as np
from six.moves import xrange
import tensorflow as tf
from tensorflow.python.platform import app
from tensorflow.python.platform import fla... | 42.256881 | 79 | 0.640252 |
3299c04c4ae554f3701d7b1ac46db7238a44ac28 | 4,021 | py | Python | DarcyFrictionFactor.py | DrTol/pressure_loss_calculator-Python | 44f2c2adce161ef663fd6774d1f1c188b4c7e5c3 | [
"MIT"
] | 2 | 2020-07-16T01:13:05.000Z | 2021-03-17T06:45:48.000Z | DarcyFrictionFactor.py | DrTol/pressure_loss_calculator-Python | 44f2c2adce161ef663fd6774d1f1c188b4c7e5c3 | [
"MIT"
] | null | null | null | DarcyFrictionFactor.py | DrTol/pressure_loss_calculator-Python | 44f2c2adce161ef663fd6774d1f1c188b4c7e5c3 | [
"MIT"
] | 3 | 2020-12-13T15:08:28.000Z | 2022-01-11T10:48:55.000Z | ## returns the Darcy-Weisbach friction factor for pressure loss calculations
# prepared by Hakan İbrahim Tol, PhD on 02/07/2019
import math
import warnings
# via Clamond algorithm _ Copied,Modified,Pasted!
def f_Clamond(R,K=0):
# DWc = COLEBROOK(R,K) fast, accurate and robust computation of the
# Dar... | 35.901786 | 109 | 0.536931 |
f64e5eddbbf9dbb75c4cad1f1fbdbcbccc9cdfe8 | 1,477 | py | Python | app/backend/visualization/helpers/get_and_process_image.py | admariner/social-media-profiler | 2001167201fc9602fef3070ee9d31f005978bfe8 | [
"MIT"
] | 34 | 2020-12-14T15:48:26.000Z | 2022-02-27T14:24:29.000Z | app/backend/visualization/helpers/get_and_process_image.py | pandrey2003/social-media-profiler | 4160e318997d161d63b8233511a65669542da026 | [
"MIT"
] | 1 | 2021-12-15T02:37:32.000Z | 2021-12-15T02:37:32.000Z | app/backend/visualization/helpers/get_and_process_image.py | admariner/social-media-profiler | 2001167201fc9602fef3070ee9d31f005978bfe8 | [
"MIT"
] | 6 | 2021-02-11T16:29:04.000Z | 2022-03-23T11:42:32.000Z | # -*- coding: utf-8 -*-
"""The module to obtain an image by the URL and process it."""
import io
from urllib.request import urlopen
from PIL import Image, ImageDraw
import numpy as np
def get_and_process_image(url: str) -> io.BytesIO:
"""
Get the image by the URL, then crop it into a circle using numpy and P... | 31.425532 | 82 | 0.689235 |
aff0228f47873aed5b62f0642ef7ba7139775e7b | 4,644 | py | Python | tests/manage/pv_services/test_pvc_delete_verify_size_is_returned_to_backendpool.py | vikasmulaje/ocs-ci | 98ce950150e061ba872c62f2d55f9bd395241a6e | [
"MIT"
] | null | null | null | tests/manage/pv_services/test_pvc_delete_verify_size_is_returned_to_backendpool.py | vikasmulaje/ocs-ci | 98ce950150e061ba872c62f2d55f9bd395241a6e | [
"MIT"
] | null | null | null | tests/manage/pv_services/test_pvc_delete_verify_size_is_returned_to_backendpool.py | vikasmulaje/ocs-ci | 98ce950150e061ba872c62f2d55f9bd395241a6e | [
"MIT"
] | null | null | null | """
A test case to verify after deleting pvc whether
size is returned to backend pool
"""
import logging
import pytest
from ocs_ci.ocs import constants, defaults
from ocs_ci.ocs.exceptions import UnexpectedBehaviour
from tests import helpers
from ocs_ci.framework.testlib import tier1, ManageTest
from ocs_ci.utility i... | 34.4 | 99 | 0.711886 |
49a8665aa056b55e2eaca11f08cd7bd3b2173199 | 1,822 | py | Python | rusentrel/rusentrel_ds/ctx/cnn.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | null | null | null | rusentrel/rusentrel_ds/ctx/cnn.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2020-12-16T18:21:11.000Z | 2020-12-30T10:08:27.000Z | rusentrel/rusentrel_ds/ctx/cnn.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2021-03-29T20:58:26.000Z | 2021-03-29T20:58:26.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path.append('../../../')
from io_utils import RuSentRelBasedExperimentsIOUtils
from arekit.common.evaluation.evaluators.two_class import TwoClassEvaluator
from arekit.contrib.experiments.single.model import SingleInstanceTensorflowModel
from arekit.contrib.exp... | 40.488889 | 113 | 0.770033 |
d6e41c67f36a6e0a2afcd907bc30cf397bbaf10f | 13,324 | py | Python | reagent/reporting/training_reporter.py | alexnikulkov/ReAgent | e404c5772ea4118105c2eb136ca96ad5ca8e01db | [
"BSD-3-Clause"
] | null | null | null | reagent/reporting/training_reporter.py | alexnikulkov/ReAgent | e404c5772ea4118105c2eb136ca96ad5ca8e01db | [
"BSD-3-Clause"
] | null | null | null | reagent/reporting/training_reporter.py | alexnikulkov/ReAgent | e404c5772ea4118105c2eb136ca96ad5ca8e01db | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import math
from collections import deque
from typing import Deque, List, NamedTuple, Optional
import numpy as np
import torch
from reagent.tensorboardX import SummaryWriterContext
logger = logging.getLogge... | 36.604396 | 88 | 0.599745 |
2dc97e5543c5f8cea310db78d2fd7123fe944862 | 6,343 | py | Python | biothings/web/connections.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | 30 | 2017-07-23T14:50:29.000Z | 2022-02-08T08:08:16.000Z | biothings/web/connections.py | kevinxin90/biothings.api | 8ff3bbaecd72d04db4933ff944898ee7b7c0e04a | [
"Apache-2.0"
] | 163 | 2017-10-24T18:45:40.000Z | 2022-03-28T03:46:26.000Z | biothings/web/connections.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | 22 | 2017-06-12T18:30:15.000Z | 2022-03-01T18:10:47.000Z | import hashlib
import logging
import os
import pickle
from functools import partial
import boto3
import elasticsearch
import elasticsearch_dsl
import requests
from biothings.utils.common import run_once
from elasticsearch import AIOHttpConnection
from elasticsearch import RequestsHttpConnection as _Conn
from requests_... | 31.246305 | 86 | 0.650166 |
b874d68887aff283f08bcbe962daafa1810614e8 | 154 | py | Python | Common/Measures/Portfolio/Timely/PortfolioAnnually.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | Common/Measures/Portfolio/Timely/PortfolioAnnually.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | Common/Measures/Portfolio/Timely/PortfolioAnnually.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | from Common.Measures.Portfolio.Timely.AbstractPortfolioTimely import AbstractPortfolioTimely
class PortfolioAnnually(AbstractPortfolioTimely):
pass
| 25.666667 | 92 | 0.87013 |
f68e9f54641d80b7467dc53d58a8ef02ecdc7921 | 12,946 | py | Python | skl2onnx/operator_converters/sgd_classifier.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | null | null | null | skl2onnx/operator_converters/sgd_classifier.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | null | null | null | skl2onnx/operator_converters/sgd_classifier.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
import numpy as np
from ..common._apply_operation import (
apply_add, apply_cast, apply_clip, apply_concat, apply_div, apply_exp,
apply_identity, apply_mul, apply_reciprocal, apply_reshape, apply_sub)
from ..common.data_types import (
BooleanTensorType, Int64TensorTyp... | 45.584507 | 79 | 0.67434 |
35dc4c726607e7f3270797b75df0ffc69048fccd | 7,612 | py | Python | ryu/services/protocols/bgp/utils/validation.py | vinaykothiyal/ryu | 32551989c649311854215df29860ccb272c105c0 | [
"Apache-2.0"
] | 9 | 2018-04-11T12:53:08.000Z | 2021-12-14T01:41:22.000Z | ryu/services/protocols/bgp/utils/validation.py | vinaykothiyal/ryu | 32551989c649311854215df29860ccb272c105c0 | [
"Apache-2.0"
] | 1 | 2019-05-20T13:23:28.000Z | 2020-12-20T09:06:52.000Z | ryu/services/protocols/bgp/utils/validation.py | vinaykothiyal/ryu | 32551989c649311854215df29860ccb272c105c0 | [
"Apache-2.0"
] | 2 | 2020-10-20T13:52:45.000Z | 2021-06-26T02:21:58.000Z | # Copyright (C) 2014 Nippon Telegraph and Telephone 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
#
# Unless required by appli... | 28.942966 | 79 | 0.665659 |
ce626fbf862ccb7ba395a1da1f82cbe6c51aa978 | 7,080 | py | Python | electrumx/lib/tx.py | Electrum-RVN-SIG/electrumx-ravencoin | 6b888a9246257037c95cdaffcce3386181050398 | [
"MIT"
] | 11 | 2021-04-03T21:29:44.000Z | 2022-03-28T09:37:34.000Z | electrumx/lib/tx.py | Electrum-RVN-SIG/electrumx-ravencoin | 6b888a9246257037c95cdaffcce3386181050398 | [
"MIT"
] | 4 | 2021-05-14T13:10:01.000Z | 2021-12-03T15:12:23.000Z | electrumx/lib/tx.py | Electrum-RVN-SIG/electrumx-ravencoin | 6b888a9246257037c95cdaffcce3386181050398 | [
"MIT"
] | 4 | 2021-04-05T22:07:06.000Z | 2021-09-23T08:04:48.000Z | # Copyright (c) 2016-2017, Neil Booth
# Copyright (c) 2017, the ElectrumX authors
#
# All rights reserved.
#
# The MIT License (MIT)
#
# 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 ... | 29.873418 | 115 | 0.674718 |
770583139946b58e26a0db9a06fb877e5e353899 | 611 | py | Python | wafer/sponsors/urls.py | drnlm/wafer | 1d843190428c401df06fcdfb89d1f9d9af67229e | [
"ISC"
] | 41 | 2015-03-16T17:47:00.000Z | 2022-01-07T04:31:21.000Z | wafer/sponsors/urls.py | drnlm/wafer | 1d843190428c401df06fcdfb89d1f9d9af67229e | [
"ISC"
] | 338 | 2015-03-15T17:26:36.000Z | 2021-12-02T04:34:53.000Z | wafer/sponsors/urls.py | drnlm/wafer | 1d843190428c401df06fcdfb89d1f9d9af67229e | [
"ISC"
] | 28 | 2015-07-27T14:11:13.000Z | 2020-11-16T03:50:30.000Z | from django.conf.urls import url, include
from rest_framework import routers
from wafer.sponsors.views import (
ShowSponsors, SponsorView, ShowPackages, SponsorViewSet, PackageViewSet)
router = routers.DefaultRouter()
router.register(r'sponsors', SponsorViewSet)
router.register(r'packages', PackageViewSet)
urlp... | 30.55 | 76 | 0.713584 |
8be38663aba02eac0a7fd1c4a6883c9b7416aa50 | 9,190 | py | Python | pettingzoo/magent/magent_env.py | QiyaoWei/PettingZoo | d27bdfe3507df48ff4e9ce04804d1dd1087a2dea | [
"Apache-2.0"
] | null | null | null | pettingzoo/magent/magent_env.py | QiyaoWei/PettingZoo | d27bdfe3507df48ff4e9ce04804d1dd1087a2dea | [
"Apache-2.0"
] | null | null | null | pettingzoo/magent/magent_env.py | QiyaoWei/PettingZoo | d27bdfe3507df48ff4e9ce04804d1dd1087a2dea | [
"Apache-2.0"
] | null | null | null | import math
import warnings
import magent
import numpy as np
from gym.spaces import Box, Discrete
from gym.utils import seeding
from pettingzoo import AECEnv
from pettingzoo.magent.render import Renderer
from pettingzoo.utils import agent_selector, wrappers
from pettingzoo.utils.env import ParallelEnv
def make_env(... | 42.35023 | 161 | 0.625898 |
fb679d1bcd1c26bf07b933c9ef665030f96dcef2 | 1,985 | py | Python | supervisor/dbus/network/configuration.py | pnjongang/supervisor | 2a006ae76de4b06e3e291b37aa2a4e14dc272445 | [
"Apache-2.0"
] | 597 | 2017-04-27T15:10:08.000Z | 2019-12-18T16:02:57.000Z | supervisor/dbus/network/configuration.py | pnjongang/supervisor | 2a006ae76de4b06e3e291b37aa2a4e14dc272445 | [
"Apache-2.0"
] | 1,056 | 2020-01-30T09:59:44.000Z | 2022-03-31T10:15:32.000Z | supervisor/dbus/network/configuration.py | pnjongang/supervisor | 2a006ae76de4b06e3e291b37aa2a4e14dc272445 | [
"Apache-2.0"
] | 295 | 2020-02-03T11:30:42.000Z | 2022-03-31T18:53:14.000Z | """NetworkConnection object4s for Network Manager."""
from ipaddress import IPv4Address, IPv4Interface, IPv6Address, IPv6Interface
from typing import Optional, Union
import attr
@attr.s(slots=True)
class IpConfiguration:
"""NetworkSettingsIPConfig object for Network Manager."""
gateway: Optional[Union[IPv6A... | 25.779221 | 76 | 0.690176 |
03736ec8e09e1e2d2110e8ca83063b568379f0cd | 8,921 | py | Python | core/jobs/jobs_manager_test.py | lheureuxe13/oppia | 7110e3e5d5a53527c31d7b33e14d25e8d5b981f9 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:53.000Z | 2022-02-06T13:00:14.000Z | core/jobs/jobs_manager_test.py | lheureuxe13/oppia | 7110e3e5d5a53527c31d7b33e14d25e8d5b981f9 | [
"Apache-2.0"
] | 80 | 2020-10-31T09:14:46.000Z | 2021-01-12T23:38:15.000Z | core/jobs/jobs_manager_test.py | lheureuxe13/oppia | 7110e3e5d5a53527c31d7b33e14d25e8d5b981f9 | [
"Apache-2.0"
] | 1 | 2020-10-02T13:28:26.000Z | 2020-10-02T13:28:26.000Z | # coding: utf-8
#
# Copyright 2021 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 requi... | 35.971774 | 101 | 0.709338 |
1bee2a7f19b88d204126f75fc3e577c6bbda66dc | 2,214 | py | Python | examples/twisted/wamp/rpc/slowsquare/backend.py | rapyuta-robotics/autobahn-python | c08e9e352d526a7fd0885bb94706366a432ada1a | [
"MIT"
] | 1,670 | 2015-10-12T15:46:22.000Z | 2022-03-30T22:12:53.000Z | examples/twisted/wamp/rpc/slowsquare/backend.py | rapyuta-robotics/autobahn-python | c08e9e352d526a7fd0885bb94706366a432ada1a | [
"MIT"
] | 852 | 2015-10-16T22:11:03.000Z | 2022-03-27T07:57:01.000Z | examples/twisted/wamp/rpc/slowsquare/backend.py | rapyuta-robotics/autobahn-python | c08e9e352d526a7fd0885bb94706366a432ada1a | [
"MIT"
] | 790 | 2015-10-15T08:46:12.000Z | 2022-03-30T12:22:13.000Z | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | 34.59375 | 79 | 0.671635 |
551edee1eabe80d45ff1e5017d5c2a6df62c5efa | 1,321 | py | Python | test/salt_master_files/tasks/custom_send_commands.py | dmulyalin/salt-nornir | 2fbbe136f5a462e7981ce638a3dd15463de63d18 | [
"MIT"
] | 12 | 2020-08-24T10:44:59.000Z | 2022-03-23T03:41:20.000Z | test/salt_master_files/tasks/custom_send_commands.py | dmulyalin/salt-nornir | 2fbbe136f5a462e7981ce638a3dd15463de63d18 | [
"MIT"
] | 3 | 2021-02-15T20:55:20.000Z | 2021-09-26T22:50:02.000Z | test/salt_master_files/tasks/custom_send_commands.py | dmulyalin/salt-nornir | 2fbbe136f5a462e7981ce638a3dd15463de63d18 | [
"MIT"
] | 1 | 2021-05-23T15:47:10.000Z | 2021-05-23T15:47:10.000Z | import time
from nornir.core.task import Result, Task
from nornir_netmiko.tasks import netmiko_send_command
import logging
log = logging.getLogger(__name__)
# define connection name for RetryRunner to properly detect it using:
# connection_name = task.task.__globals__.get("CONNECTION_NAME", None)
CONNECTION_NAME = "n... | 33.025 | 75 | 0.704769 |
1414e9b3a932702cd8f0890ebe3e93aed1bba77b | 2,588 | py | Python | sis_provisioner/views/jobs.py | uw-it-aca/canvas-sis-provisioner | 28f54ce101704a8feaaea1e514618aba5a330a25 | [
"Apache-2.0"
] | null | null | null | sis_provisioner/views/jobs.py | uw-it-aca/canvas-sis-provisioner | 28f54ce101704a8feaaea1e514618aba5a330a25 | [
"Apache-2.0"
] | 451 | 2016-10-25T22:08:19.000Z | 2022-03-23T20:27:52.000Z | sis_provisioner/views/jobs.py | uw-it-aca/canvas-sis-provisioner | 28f54ce101704a8feaaea1e514618aba5a330a25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from logging import getLogger
from sis_provisioner.models import Job
from sis_provisioner.views.admin import RESTDispatch, get_user
from django.utils.timezone import utc
from datetime import datetime
import json
logger = getLogger(... | 32.759494 | 75 | 0.59119 |
b1729ff14db41db6202ea932bf46a6208f0bff2f | 8,429 | py | Python | paper-launch-scripts/graph_results_utils.py | JBLanier/pipeline-psro | 33bc41892fb80a03604b118d5256555fb65d1c32 | [
"MIT"
] | 26 | 2020-11-04T13:50:58.000Z | 2022-03-11T08:09:00.000Z | paper-launch-scripts/graph_results_utils.py | JBLanier/distributed-rl-for-imperfect-info-games | e150e99e433cadae27aa3ae5f6c7134f7e5c6fda | [
"MIT"
] | null | null | null | paper-launch-scripts/graph_results_utils.py | JBLanier/distributed-rl-for-imperfect-info-games | e150e99e433cadae27aa3ae5f6c7134f7e5c6fda | [
"MIT"
] | 13 | 2020-12-07T11:39:37.000Z | 2021-11-04T15:59:17.000Z |
import ray
from ray.rllib.agents.trainer import with_common_config, with_base_config
from ray.rllib.models.catalog import MODEL_DEFAULTS
from ray.rllib.utils import try_import_tf
import json
import os
import pandas as pd
import multiprocessing
from itertools import repeat
from mprl.scripts.poker_parallel_algos.utils... | 48.442529 | 129 | 0.664492 |
9140914e9c17cdded39ee39d2ae9df4e327bb35c | 3,167 | py | Python | cachetclient/v1/metric_points.py | zipy124/cachet-client | b8962ab2e3c188752d5fdf3b532e9f143298b125 | [
"MIT"
] | null | null | null | cachetclient/v1/metric_points.py | zipy124/cachet-client | b8962ab2e3c188752d5fdf3b532e9f143298b125 | [
"MIT"
] | null | null | null | cachetclient/v1/metric_points.py | zipy124/cachet-client | b8962ab2e3c188752d5fdf3b532e9f143298b125 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Generator
from cachetclient.base import Manager, Resource
from cachetclient import utils
class MetricPoint(Resource):
@property
def id(self) -> int:
"""int: unique id of the metric point"""
return self.get('id')
@property
def metric_id... | 27.301724 | 108 | 0.595832 |
0b0c7c0f52eb5ea8173f4271e90896b1a0dbf5ea | 6,870 | py | Python | tests/unit/test_version.py | chalbersma/salt | c29514d41c12a79f9b261613cd4c0b722cff3467 | [
"Apache-2.0"
] | 1 | 2020-01-31T14:43:07.000Z | 2020-01-31T14:43:07.000Z | tests/unit/test_version.py | chalbersma/salt | c29514d41c12a79f9b261613cd4c0b722cff3467 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_version.py | chalbersma/salt | c29514d41c12a79f9b261613cd4c0b722cff3467 | [
"Apache-2.0"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
tests.unit.version_test
~~~~~~~~~~~~~~~~~~~~~~~
Test salt's regex git describe version parsing
'''
# Import python libs
from __future__ import absolute_import
import re
# Import Salt Testing libs
from tests.support.unit imp... | 37.540984 | 92 | 0.542649 |
2d033305c49366be8fb3f73d6b469375f8089d8c | 24,810 | py | Python | tools/nntool/graph/types/others.py | 00-01/gap_sdk | 25444d752b26ccf0b848301c381692d77172852c | [
"Apache-2.0"
] | null | null | null | tools/nntool/graph/types/others.py | 00-01/gap_sdk | 25444d752b26ccf0b848301c381692d77172852c | [
"Apache-2.0"
] | null | null | null | tools/nntool/graph/types/others.py | 00-01/gap_sdk | 25444d752b26ccf0b848301c381692d77172852c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | 29.291617 | 112 | 0.614349 |
2d97f1f1fcd58b5351ccdd24f3a5646c518cd8b1 | 2,513 | py | Python | tests/components/sense/test_config_flow.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | tests/components/sense/test_config_flow.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | tests/components/sense/test_config_flow.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Test the Sense config flow."""
from unittest.mock import patch
from sense_energy import SenseAPITimeoutException, SenseAuthenticationException
from openpeerpower import config_entries, setup
from openpeerpower.components.sense.const import DOMAIN
async def test_form(opp):
"""Test we get the form."""
awai... | 33.506667 | 86 | 0.653402 |
6eddcecb8718a60b01d1593b405ae518b2f770d9 | 696 | py | Python | src/apim/apim_open_admin_ui.py | paul-mateos/azure-apim-deployment-utils | 969fedfa5b5c910ffd3aa04ede265ab18c1844a3 | [
"Apache-2.0"
] | 14 | 2016-03-16T16:46:46.000Z | 2022-03-26T02:28:26.000Z | src/apim/apim_open_admin_ui.py | paul-mateos/azure-apim-deployment-utils | 969fedfa5b5c910ffd3aa04ede265ab18c1844a3 | [
"Apache-2.0"
] | 2 | 2016-04-10T08:28:26.000Z | 2018-01-30T07:58:46.000Z | src/apim/apim_open_admin_ui.py | paul-mateos/azure-apim-deployment-utils | 969fedfa5b5c910ffd3aa04ede265ab18c1844a3 | [
"Apache-2.0"
] | 8 | 2016-06-24T23:11:33.000Z | 2021-08-13T13:36:45.000Z | import os
import sys
import webbrowser
import token_factory
def open_admin_ui(base_dir, instance):
instances_json = os.path.join(base_dir, 'instances.json')
tf = token_factory.create_token_factory_from_file(instances_json)
sso_url = tf.get_admin_sso_link(instance)
webbrowser.open(sso_url)
if __n... | 26.769231 | 70 | 0.656609 |
5058ad89feddfec41dba023d614f91fa1391a52f | 516 | py | Python | settings/check_python_version.py | JagritiG/data-middleware | e51cedf173e487d270f42c993e5e7f79f85bd263 | [
"MIT"
] | null | null | null | settings/check_python_version.py | JagritiG/data-middleware | e51cedf173e487d270f42c993e5e7f79f85bd263 | [
"MIT"
] | null | null | null | settings/check_python_version.py | JagritiG/data-middleware | e51cedf173e487d270f42c993e5e7f79f85bd263 | [
"MIT"
] | null | null | null | # Python version compatibility check
import sys
try:
if not sys.version_info.major == 3 and sys.version_info.minor >= 7:
print("Python 3.7 or higher is required.")
print("You are using Python {}.{}.".format(sys.version_info.major, sys.version_info.minor))
else:
print("You are using Pyt... | 24.571429 | 99 | 0.672481 |
4e0dce19093ebaa8f6fc14f593cf85dffe811ad8 | 13 | py | Python | i2i/__init__.py | thorwhalen/i2i | f967aaba28793029e3fe643c5e17ae9bc7a77732 | [
"Apache-2.0"
] | 1 | 2019-08-29T01:35:12.000Z | 2019-08-29T01:35:12.000Z | i2i/__init__.py | thorwhalen/i2i | f967aaba28793029e3fe643c5e17ae9bc7a77732 | [
"Apache-2.0"
] | null | null | null | i2i/__init__.py | thorwhalen/i2i | f967aaba28793029e3fe643c5e17ae9bc7a77732 | [
"Apache-2.0"
] | null | null | null | name = "i2i"
| 6.5 | 12 | 0.538462 |
b471b135365e4e5bb48ae74b62641731e0768f68 | 355 | py | Python | app/recipe/urls.py | ricardolira/recipe-app-api | 749c39af92383ecfa208636fc2b09deaaefeeb2a | [
"MIT"
] | null | null | null | app/recipe/urls.py | ricardolira/recipe-app-api | 749c39af92383ecfa208636fc2b09deaaefeeb2a | [
"MIT"
] | null | null | null | app/recipe/urls.py | ricardolira/recipe-app-api | 749c39af92383ecfa208636fc2b09deaaefeeb2a | [
"MIT"
] | null | null | null | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredients', views.IngredientViewSet)
router.register('recipes', views.RecipeViewSet)
app_name = 'recipe'
urlpatterns = [
... | 22.1875 | 55 | 0.771831 |
f3184081495a358988f9bc219ec1e786fbce9e0e | 819 | py | Python | Samples/BasicDrawing.py | zaml/ComputerVision | 01afc8ee8c11c472a8251eabd3721d180223c2e8 | [
"MIT"
] | null | null | null | Samples/BasicDrawing.py | zaml/ComputerVision | 01afc8ee8c11c472a8251eabd3721d180223c2e8 | [
"MIT"
] | null | null | null | Samples/BasicDrawing.py | zaml/ComputerVision | 01afc8ee8c11c472a8251eabd3721d180223c2e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 11:25:22 2018
@author: juanzamora
"""
# -*- coding: utf-8 -*-
import numpy as np
import cv2
# Create a black image
img = np.zeros((512,512,3), np.uint8)
# Draw a diagonal blue line with thickness of 5 px
cv2.line(img,(0,0),(511,511),(255,0,0),5... | 20.475 | 71 | 0.647131 |
ccaa4949470ab15aae865a1d20f7487a5cc0ee0c | 6,623 | py | Python | robotframework_pykafka/kafka_helper.py | invadergir/robotframework-pykafka | 0d290d0883c468785ca38fb9aae62cc13c3a04ae | [
"Apache-2.0"
] | 9 | 2018-08-30T00:08:51.000Z | 2022-01-17T00:50:56.000Z | robotframework_pykafka/kafka_helper.py | invadergir/robotframework-pykafka | 0d290d0883c468785ca38fb9aae62cc13c3a04ae | [
"Apache-2.0"
] | 2 | 2018-10-10T20:54:26.000Z | 2018-10-10T20:57:02.000Z | robotframework_pykafka/kafka_helper.py | invadergir/robotframework-pykafka | 0d290d0883c468785ca38fb9aae62cc13c3a04ae | [
"Apache-2.0"
] | 2 | 2020-02-18T00:09:40.000Z | 2020-10-13T12:20:43.000Z | #!/bin/python3
import json
import os
import time
from pykafka import KafkaClient
from pykafka.common import OffsetType
from utils import *
##################################################
# Kafka helper class.
class kafka_helper:
##################################################
# Constructor. The broker... | 37.418079 | 181 | 0.571493 |
b7be271943f714774b3dc511dc0475a332b9a089 | 16,825 | py | Python | tests/test_sbuttons.py | eberver/hippy | 9a6e5f503e9bf4a74ae4b3144dc53eca0e75651f | [
"MIT"
] | 3 | 2020-09-17T04:30:54.000Z | 2020-10-27T17:18:07.000Z | tests/test_sbuttons.py | eberver/hippy | 9a6e5f503e9bf4a74ae4b3144dc53eca0e75651f | [
"MIT"
] | null | null | null | tests/test_sbuttons.py | eberver/hippy | 9a6e5f503e9bf4a74ae4b3144dc53eca0e75651f | [
"MIT"
] | 3 | 2020-09-16T18:57:19.000Z | 2022-02-18T07:24:50.000Z |
# Copyright 2016-2020 HP Development Company, L.P.
# SPDX-License-Identifier: MIT
#
""" Pytests for the Hippy sbuttons.
"""
from __future__ import division, absolute_import, print_function
import random
import threading
import pytest
from hippy import SButtons
from hippy import PySproutError
import check_device_t... | 35.646186 | 104 | 0.685944 |
d81d562f8581415bce053924c15537c5ea9784f3 | 3,853 | py | Python | data/eos/Tomida+Hori_2016/hydrostatic2.py | applejwjcat/dispatch | 4fad06ee952de181f6c51b91f179d6396bdfb333 | [
"BSD-3-Clause"
] | null | null | null | data/eos/Tomida+Hori_2016/hydrostatic2.py | applejwjcat/dispatch | 4fad06ee952de181f6c51b91f179d6396bdfb333 | [
"BSD-3-Clause"
] | null | null | null | data/eos/Tomida+Hori_2016/hydrostatic2.py | applejwjcat/dispatch | 4fad06ee952de181f6c51b91f179d6396bdfb333 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 12 16:54:41 2018
@author: Aake
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as pl
import EOS
from scaling import scaling,cgs
#%% Void object
class void():
pass
evol=void()
#%% Soft gravity
sc=scaling()
m_planet=5.0
a_planet... | 26.756944 | 96 | 0.481962 |
60345a2227c94fa4efef517f51201ec125421281 | 1,408 | py | Python | saefportal/analyzer/migrations/0004_auto_20200828_1100.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | 4 | 2020-12-16T13:14:26.000Z | 2022-03-26T08:54:12.000Z | saefportal/analyzer/migrations/0004_auto_20200828_1100.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | 1 | 2022-03-26T09:09:04.000Z | 2022-03-26T09:09:04.000Z | saefportal/analyzer/migrations/0004_auto_20200828_1100.py | harry-consulting/SAEF | 12ef43bbcc3178b8a988e21c1bef035881cf6e6d | [
"BSD-2-Clause"
] | 1 | 2020-12-16T13:20:17.000Z | 2020-12-16T13:20:17.000Z | # Generated by Django 3.0.3 on 2020-08-28 09:00
import analyzer.enums
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('analyzer', '0003_auto_20200827_1504'),
]
operations = [
migrations.AlterField(
... | 41.411765 | 430 | 0.666903 |
c12e36d69300e63805eb5720971687a167117c2a | 15,469 | py | Python | holdit/__main__.py | caltechlibrary/holdit | 474165764e3514303dfd118d1beb0b6570fb6e13 | [
"BSD-3-Clause"
] | 2 | 2019-01-31T21:47:13.000Z | 2020-11-18T04:28:58.000Z | holdit/__main__.py | caltechlibrary/holdit | 474165764e3514303dfd118d1beb0b6570fb6e13 | [
"BSD-3-Clause"
] | 4 | 2018-10-04T17:56:48.000Z | 2019-01-10T03:20:13.000Z | holdit/__main__.py | caltechlibrary/holdit | 474165764e3514303dfd118d1beb0b6570fb6e13 | [
"BSD-3-Clause"
] | null | null | null | '''
__main__: main command-line interface to Hold It!
Hold It! generates a printable Word document containing recent hold requests and
also update the relevant Google spreadsheet used for tracking requests.
By default, Hold It! uses a GUI dialog to get the user's Caltech access login
name and password. If the -G opt... | 44.451149 | 94 | 0.654793 |
16dbf9b74077f3825358d3a49b9cb272806b8cd3 | 1,256 | py | Python | build/catkin_generated/generate_cached_setup.py | Louis-AD-git/racecar_ws | 3c5cb561d1aee11d80a7f3847e0334e93f345513 | [
"MIT"
] | null | null | null | build/catkin_generated/generate_cached_setup.py | Louis-AD-git/racecar_ws | 3c5cb561d1aee11d80a7f3847e0334e93f345513 | [
"MIT"
] | null | null | null | build/catkin_generated/generate_cached_setup.py | Louis-AD-git/racecar_ws | 3c5cb561d1aee11d80a7f3847e0334e93f345513 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, ... | 40.516129 | 102 | 0.730096 |
79c0a6a7d5470ddd65878a50ceaf3c677e4f2d0d | 1,835 | py | Python | decorators_lab/solution/decorators.py | jeremyosborne/examples-python | 5900b3a4f47d59de0a32d3257a8b90a44e80fdcd | [
"MIT"
] | null | null | null | decorators_lab/solution/decorators.py | jeremyosborne/examples-python | 5900b3a4f47d59de0a32d3257a8b90a44e80fdcd | [
"MIT"
] | null | null | null | decorators_lab/solution/decorators.py | jeremyosborne/examples-python | 5900b3a4f47d59de0a32d3257a8b90a44e80fdcd | [
"MIT"
] | null | null | null | '''
>>> data = '{"username": "oscar", "password": "trashcan", "account": 1234, "amount": 12.03}'
>>> deposit(data)
'OK'
>>> data = '{"username": "oscar", "password": "trash", "account": 1234, "amount": 14.98}'
>>> deposit(data)
'Invalid Password'
>>> data = '{"username": "oscar", "password": "trashcan", "account": 1234... | 21.337209 | 92 | 0.608174 |
d053fb347f94455a77946d5626da7366884130e7 | 256 | py | Python | Python3/scripts-python3/desafios/mundo01/desafio020.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | Python3/scripts-python3/desafios/mundo01/desafio020.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | Python3/scripts-python3/desafios/mundo01/desafio020.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | from random import shuffle
a1 = str(input('Primeiro aluno: '))
a2 = str(input('Segundo aluno: '))
a3 = str(input('Terceiro aluno: '))
a4 = str(input('Quarto aluno: '))
lista = [a1, a2, a3, a4]
shuffle(lista)
print(f'A ordem de apresentação será {lista}')
| 25.6 | 46 | 0.671875 |
c56f7f2bf7ffdef07b6c5dbfe8256ee6529636ad | 2,199 | py | Python | bot.py | polyzer/telegram-bot-football-players-prediction | 6962daa38e4dbd898c26091abede97be52778108 | [
"MIT"
] | null | null | null | bot.py | polyzer/telegram-bot-football-players-prediction | 6962daa38e4dbd898c26091abede97be52778108 | [
"MIT"
] | null | null | null | bot.py | polyzer/telegram-bot-football-players-prediction | 6962daa38e4dbd898c26091abede97be52778108 | [
"MIT"
] | null | null | null | import telebot
import tensorflow as tf
from tensorflow.keras.models import load_model
import keras
import cv2
import skimage.transform
import re
import json
import decorator
import os
from flask import Flask, request
api_key = "1045675720:AAGV3UhR4Ks4mkV-x1ZTfjF8et0Iudp3hbk"
bot = telebot.TeleBot(api_key)
server = F... | 30.123288 | 140 | 0.699409 |
cef34af9d3906846bff89729e02c0addd5a5210b | 5,785 | py | Python | praw/models/listing/mixins/base.py | NedJunk/praw | dd75d91e5574f1499cbef445dd68eb71445629df | [
"BSD-2-Clause"
] | null | null | null | praw/models/listing/mixins/base.py | NedJunk/praw | dd75d91e5574f1499cbef445dd68eb71445629df | [
"BSD-2-Clause"
] | null | null | null | praw/models/listing/mixins/base.py | NedJunk/praw | dd75d91e5574f1499cbef445dd68eb71445629df | [
"BSD-2-Clause"
] | null | null | null | """Provide the BaseListingMixin class."""
from typing import Any, Dict, Iterator, Union
from urllib.parse import urljoin
from ....util import _deprecate_args
from ...base import PRAWBase
from ..generator import ListingGenerator
class BaseListingMixin(PRAWBase):
"""Adds minimum set of methods that apply to all li... | 38.566667 | 96 | 0.623336 |
339eff7b937ab870972ef1b0fa9b35f66a854025 | 819 | py | Python | pyopenproject/business/services/command/root/find.py | webu/pyopenproject | 40b2cb9fe0fa3f89bc0fe2a3be323422d9ecf966 | [
"MIT"
] | 5 | 2021-02-25T15:54:28.000Z | 2021-04-22T15:43:36.000Z | pyopenproject/business/services/command/root/find.py | webu/pyopenproject | 40b2cb9fe0fa3f89bc0fe2a3be323422d9ecf966 | [
"MIT"
] | 7 | 2021-03-15T16:26:23.000Z | 2022-03-16T13:45:18.000Z | pyopenproject/business/services/command/root/find.py | webu/pyopenproject | 40b2cb9fe0fa3f89bc0fe2a3be323422d9ecf966 | [
"MIT"
] | 6 | 2021-06-18T18:59:11.000Z | 2022-03-27T04:58:52.000Z | from pyopenproject.api_connection.exceptions.request_exception import RequestError
from pyopenproject.api_connection.requests.get_request import GetRequest
from pyopenproject.business.exception.business_error import BusinessError
from pyopenproject.business.services.command.root.root_command import RootCommand
from pyo... | 35.608696 | 82 | 0.737485 |
93202c2043a98b8b46f7238e1f83a70f2fa90207 | 9,910 | py | Python | notebooks-text-format/matrix_factorization_recommender.py | arpitvaghela/probml-notebooks | 32ecb309dd474b989fd1c6ce4ad6dab7a25bbead | [
"MIT"
] | 166 | 2021-07-16T17:33:09.000Z | 2022-03-30T03:35:34.000Z | notebooks-text-format/matrix_factorization_recommender.py | arpitvaghela/probml-notebooks | 32ecb309dd474b989fd1c6ce4ad6dab7a25bbead | [
"MIT"
] | 29 | 2021-07-21T16:31:51.000Z | 2022-03-31T19:50:13.000Z | notebooks-text-format/matrix_factorization_recommender.py | arpitvaghela/probml-notebooks | 32ecb309dd474b989fd1c6ce4ad6dab7a25bbead | [
"MIT"
] | 48 | 2021-07-17T08:26:18.000Z | 2022-03-31T03:36:18.000Z | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... | 40.950413 | 421 | 0.711806 |
9190b033f4412087f4ac2dec131c53671df74e7b | 26,551 | py | Python | tests/components/script/test_init.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 5 | 2020-10-08T12:59:44.000Z | 2021-12-28T06:46:25.000Z | tests/components/script/test_init.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 75 | 2020-08-05T07:22:42.000Z | 2022-03-23T21:54:57.000Z | tests/components/script/test_init.py | winning1120xx/home-assistant | 53d4c0ce2d374b5e97bbdc37742656c27adf8eea | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """The tests for the Script component."""
# pylint: disable=protected-access
import asyncio
import unittest
from unittest.mock import Mock, patch
import pytest
from homeassistant.components import logbook, script
from homeassistant.components.script import DOMAIN, EVENT_SCRIPT_STARTED
from homeassistant.const import ... | 31.421302 | 101 | 0.536891 |
7c6230a425fecb11e3b1437d2f4bc015b7fad842 | 1,841 | py | Python | scripts/archive/standardize_interwiki.py | LeesahMasko/piwikibot | 024af387ff48c21526ee206541178157d2653ddc | [
"MIT"
] | null | null | null | scripts/archive/standardize_interwiki.py | LeesahMasko/piwikibot | 024af387ff48c21526ee206541178157d2653ddc | [
"MIT"
] | 6 | 2021-02-27T03:35:42.000Z | 2021-03-07T22:17:40.000Z | scripts/archive/standardize_interwiki.py | LeesahMasko/piwikibot | 024af387ff48c21526ee206541178157d2653ddc | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Loop over all pages in the home wiki, standardizing the interwiki links.
Parameters:
-start: - Set from what page you want to start
"""
#
# (C) Pywikibot team, 2003-2020
#
# Distributed under the terms of the MIT license.
#
import pywikibot
from pywikibot import i18n, textlib
def main(*ar... | 28.765625 | 79 | 0.561108 |
b7f85567aaa55fab499d87ef2c98a85d683780ca | 2,230 | py | Python | Demo/sockets/mcast.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | 1 | 2021-12-26T22:20:34.000Z | 2021-12-26T22:20:34.000Z | Demo/sockets/mcast.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | null | null | null | Demo/sockets/mcast.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | 2 | 2018-08-06T04:37:38.000Z | 2022-02-27T18:07:12.000Z | #!/usr/bin/env python
#
# Send/receive UDP multicast packets.
# Requires that your OS kernel supports IP multicast.
#
# Usage:
# mcast -s (sender, IPv4)
# mcast -s -6 (sender, IPv6)
# mcast (receivers, IPv4)
# mcast -6 (receivers, IPv6)
MYPORT = 8123
MYGROUP_4 = '225.0.0.250'
MYGROUP_6 = 'ff15:7079:7468:6... | 27.530864 | 78 | 0.645291 |
17b3e687ac48a4380d8c09fd50b9472cf230cedd | 443 | py | Python | term-frequency/wordcounts.py | paulowe/python-data-programming | 96fdb3f888a554ac66e69e1f6958f3e0ef5b1075 | [
"MIT"
] | null | null | null | term-frequency/wordcounts.py | paulowe/python-data-programming | 96fdb3f888a554ac66e69e1f6958f3e0ef5b1075 | [
"MIT"
] | null | null | null | term-frequency/wordcounts.py | paulowe/python-data-programming | 96fdb3f888a554ac66e69e1f6958f3e0ef5b1075 | [
"MIT"
] | null | null | null | import numpy as np
import nltk
def wordcount_fn(file_uri):
nparr_words = open(file_uri, 'r')
text_as_str = nparr_words.read() #for small textfiles
text_as_list = text_as_str.split()
counts = nltk.FreqDist(text_as_list).items()
for key, val in counts:
print(str(val) + " " + str(key))
... | 26.058824 | 98 | 0.656885 |
0d6b8ea6736798e60c4456c431a0b217fd3789ca | 85 | py | Python | .ipynb_checkpoints/1_read-checkpoint.py | fadamsyah/LearnOpenCV | bd872e12d32720f09469d119695c2f564d209378 | [
"MIT"
] | null | null | null | .ipynb_checkpoints/1_read-checkpoint.py | fadamsyah/LearnOpenCV | bd872e12d32720f09469d119695c2f564d209378 | [
"MIT"
] | null | null | null | .ipynb_checkpoints/1_read-checkpoint.py | fadamsyah/LearnOpenCV | bd872e12d32720f09469d119695c2f564d209378 | [
"MIT"
] | null | null | null | import cv2 as cv
img = cv.imread('Resources/Photos/cat1.jpg')
cv.imshow('Cat', img) | 17 | 44 | 0.705882 |
69319a024b67f42dbda4089c08d5e315d8dfcfe7 | 59,501 | py | Python | test/functional/test_framework/mininode.py | adnetcoin/adnetcoin | bf95a2432f82d7d1f07842d1a4cba96736e96abd | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | adnetcoin/adnetcoin | bf95a2432f82d7d1f07842d1a4cba96736e96abd | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | adnetcoin/adnetcoin | bf95a2432f82d7d1f07842d1a4cba96736e96abd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-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.
"""Adnetcoin P2... | 31.152356 | 262 | 0.596511 |
cc6ece647c295aea078fd5fa118c09d24ecbd5b4 | 554 | py | Python | Desafio 82.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 82.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 82.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | num = []
numpar = []
numimpar = []
while True:
n = int(input('Digite um valor: '))
num.append(n)
respos = str(input('Quer continuar: [S/N] ')).strip().upper()[0]
while respos not in 'SN':
respos = str(input('Opção inválida..Quer continuar: [S/N] ')).strip().upper()[0]
if respos == 'N':
... | 29.157895 | 88 | 0.583032 |
ecf7fce5f83a7672e652de32bdeabb4572aa601c | 4,119 | py | Python | vmtkScripts/vmtksurfacearrayoperation.py | michelebucelli/vmtk | 738bd1d152e8836847ab4d75f7e8360bd574e724 | [
"Apache-2.0"
] | 217 | 2015-01-05T19:08:30.000Z | 2022-03-31T12:14:59.000Z | vmtkScripts/vmtksurfacearrayoperation.py | mrp089/vmtk | 64675f598e31bc6be3d4fba903fb59bf1394f492 | [
"Apache-2.0"
] | 226 | 2015-03-31T07:16:06.000Z | 2022-03-01T14:59:30.000Z | vmtkScripts/vmtksurfacearrayoperation.py | mrp089/vmtk | 64675f598e31bc6be3d4fba903fb59bf1394f492 | [
"Apache-2.0"
] | 132 | 2015-02-16T11:38:34.000Z | 2022-03-18T04:38:45.000Z | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfacearrayoperation.py,v $
## Language: Python
## Date: $Date: 2005/09/14 09:49:59 $
## Version: $Revision: 1.7 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This softwar... | 38.858491 | 231 | 0.621267 |
38a2b0a0da4a63833529771e715eeb32452f1fdf | 2,986 | py | Python | file_date.py | scienceopen/filedate-histogram | 5a075be229d39a8c623c0ae3eb0f553843282e68 | [
"MIT"
] | null | null | null | file_date.py | scienceopen/filedate-histogram | 5a075be229d39a8c623c0ae3eb0f553843282e68 | [
"MIT"
] | 1 | 2019-11-19T19:05:57.000Z | 2019-12-10T10:02:54.000Z | file_date.py | scivision/filedate-histogram | 5a075be229d39a8c623c0ae3eb0f553843282e68 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Plots histogram of dates of files in directory.
Works for Hugo, Jekyll and Git.
"""
from pathlib import Path
from datetime import datetime
import yaml
import re
import shutil
import typing
import subprocess
import logging
try:
import pandas
from matplotlib.pyplot import show
except I... | 25.521368 | 96 | 0.602813 |
f4ad1a6fdb03860182a7170406b362ab5de2ec11 | 20,812 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_web_application_firewall_policies_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_web_application_firewall_policies_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_web_application_firewall_policies_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.908873 | 215 | 0.672785 |
e2102bd0266e822f4bbf2eba7d66e02c18793d60 | 554 | py | Python | The Pythonic Temple/citizen.py | Shivam0808/TwilioQuestSolution | 2a265d68f8ff3d8c34ef4661c94bb128baaf8d1f | [
"MIT"
] | null | null | null | The Pythonic Temple/citizen.py | Shivam0808/TwilioQuestSolution | 2a265d68f8ff3d8c34ef4661c94bb128baaf8d1f | [
"MIT"
] | null | null | null | The Pythonic Temple/citizen.py | Shivam0808/TwilioQuestSolution | 2a265d68f8ff3d8c34ef4661c94bb128baaf8d1f | [
"MIT"
] | null | null | null | from distutils.command.build_scripts import first_line_re
class Citizen:
"this class is to describe a citizen of the City of Python"
def __init__(self, first_name, last_name):
self.first_name = first_name #this is an instance variable
self.last_name = last_name
def full_n... | 25.181818 | 113 | 0.648014 |
989291f2dad3a8b7b952de77688317d17f49b8d0 | 11,631 | py | Python | operations/mpi_rendering.py | vincentfung13/MINE | ef16cd83ae99c70f7970a583c533016c63587373 | [
"MIT"
] | 191 | 2021-07-30T06:11:28.000Z | 2022-03-31T13:45:51.000Z | operations/mpi_rendering.py | FreemanG/MINE | ef16cd83ae99c70f7970a583c533016c63587373 | [
"MIT"
] | 20 | 2021-08-24T16:05:11.000Z | 2022-03-28T11:58:47.000Z | operations/mpi_rendering.py | FreemanG/MINE | ef16cd83ae99c70f7970a583c533016c63587373 | [
"MIT"
] | 21 | 2021-07-30T06:49:52.000Z | 2022-03-07T05:42:44.000Z | import torch
from operations.homography_sampler import HomographySample
from operations.rendering_utils import transform_G_xyz, sample_pdf, gather_pixel_by_pxpy
def render(rgb_BS3HW, sigma_BS1HW, xyz_BS3HW, use_alpha=False, is_bg_depth_inf=False):
if not use_alpha:
imgs_syn, depth_syn, blend_weights, wei... | 42.761029 | 116 | 0.613361 |
2581bc68e76a073a60fa53f989150b3f2e571373 | 594 | py | Python | 1294E.py | julianferres/Codeforces | ac80292a4d53b8078fc1a85e91db353c489555d9 | [
"MIT"
] | 4 | 2020-01-31T15:49:25.000Z | 2020-07-07T11:44:03.000Z | 1294E.py | julianferres/CodeForces | 14e8369e82a2403094183d6f7824201f681c9f65 | [
"MIT"
] | null | null | null | 1294E.py | julianferres/CodeForces | 14e8369e82a2403094183d6f7824201f681c9f65 | [
"MIT"
] | null | null | null | n, m = map(int, input().split())
def solve(actual, target):
#print(actual, target)
rots = {i: 0 for i in range(n)}
for i, x in enumerate(actual):
if x in target:
rots[(i-target[x]) % n] -= 1
# print(rots)
return min([n+i+rots[i] for i in range(n)])
a = []
for _ in range(n):
... | 22 | 47 | 0.52862 |
f2685aaeb014edcfaef67f4467c20c9e7c8303fe | 6,111 | bzl | Python | generated_api_shadow/bazel/repository_locations.bzl | Y0Username/envoy | 9dd8ae3c69a9917d97a886ed03e1c010dcd9b098 | [
"Apache-2.0"
] | 1 | 2021-07-03T18:53:39.000Z | 2021-07-03T18:53:39.000Z | generated_api_shadow/bazel/repository_locations.bzl | Y0Username/envoy | 9dd8ae3c69a9917d97a886ed03e1c010dcd9b098 | [
"Apache-2.0"
] | 184 | 2021-04-19T09:34:37.000Z | 2022-03-31T15:14:40.000Z | generated_api_shadow/bazel/repository_locations.bzl | Y0Username/envoy | 9dd8ae3c69a9917d97a886ed03e1c010dcd9b098 | [
"Apache-2.0"
] | null | null | null | # This should match the schema defined in external_deps.bzl.
REPOSITORY_LOCATIONS_SPEC = dict(
bazel_skylib = dict(
project_name = "bazel-skylib",
project_desc = "Common useful functions and rules for Bazel",
project_url = "https://github.com/bazelbuild/bazel-skylib",
version = "1.0.... | 50.090164 | 120 | 0.664048 |
6675b8f956718dcf59ced1e287b7e8fc11b75806 | 2,437 | py | Python | cogs/fun.py | uthree/GeneralBot | 4204d4ba2b7df4c68bda3caa7cee368c37bdf2e7 | [
"MIT"
] | null | null | null | cogs/fun.py | uthree/GeneralBot | 4204d4ba2b7df4c68bda3caa7cee368c37bdf2e7 | [
"MIT"
] | null | null | null | cogs/fun.py | uthree/GeneralBot | 4204d4ba2b7df4c68bda3caa7cee368c37bdf2e7 | [
"MIT"
] | 1 | 2021-08-13T07:35:34.000Z | 2021-08-13T07:35:34.000Z | from discord.ext import commands
import discord as discord
import random
# Fun(ネタコマンド系) cog
class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=["sintyoku"])
async def sinchoku(self,ctx):
links = [
"https://cdn.discordapp.com/atta... | 42.017241 | 122 | 0.625359 |
6150bdf9e94064fef835942e95b9e6e70d3ea7eb | 7,645 | py | Python | tools/mxnet/common/fit.py | feifeibear/dlbench | 978b034e9c34e6aaa38782bb1e4a2cea0c01d0f9 | [
"MIT"
] | 181 | 2017-01-29T23:50:25.000Z | 2022-01-15T13:43:17.000Z | tools/mxnet/common/fit.py | waltersharpWEI/dlbenchData | 8f551ead44141aa1f678b1a32724d07ccbf4db5b | [
"MIT"
] | 33 | 2017-01-30T00:50:24.000Z | 2020-12-19T07:00:56.000Z | tools/mxnet/common/fit.py | waltersharpWEI/dlbenchData | 8f551ead44141aa1f678b1a32724d07ccbf4db5b | [
"MIT"
] | 54 | 2017-01-30T21:04:27.000Z | 2020-07-09T03:26:56.000Z | import mxnet as mx
import logging
import os
import time
def _get_lr_scheduler(args, kv):
if 'lr_factor' not in args or args.lr_factor >= 1:
return (args.lr, None)
epoch_size = args.num_examples / args.batch_size
if 'dist' in args.kv_store:
epoch_size /= kv.num_workers
begin_epoch = args... | 40.664894 | 111 | 0.608764 |
11602b0a020af8b87b4cc9327c2c6bfcb1e1845e | 2,079 | py | Python | challenge/agoda_cancellation_estimator.py | ranitoukhy/IML.HUJI | 156e67422311847d9f40efa36fb2020da3dd0087 | [
"MIT"
] | null | null | null | challenge/agoda_cancellation_estimator.py | ranitoukhy/IML.HUJI | 156e67422311847d9f40efa36fb2020da3dd0087 | [
"MIT"
] | null | null | null | challenge/agoda_cancellation_estimator.py | ranitoukhy/IML.HUJI | 156e67422311847d9f40efa36fb2020da3dd0087 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import NoReturn
from IMLearn.base import BaseEstimator
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
class AgodaCancellationEstimator(BaseEstimator):
"""
An estimator for solving the Agod... | 25.666667 | 77 | 0.577201 |
084df0b54fbbc8ce4f1d747c892a5203142abe75 | 2,721 | py | Python | pymic/transform/flip.py | vincentme/PyMIC | 5cbbca7d0a19232be647086d4686ceea523f45ee | [
"Apache-2.0"
] | null | null | null | pymic/transform/flip.py | vincentme/PyMIC | 5cbbca7d0a19232be647086d4686ceea523f45ee | [
"Apache-2.0"
] | null | null | null | pymic/transform/flip.py | vincentme/PyMIC | 5cbbca7d0a19232be647086d4686ceea523f45ee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import torch
import json
import math
import random
import numpy as np
from scipy import ndimage
from pymic.transform.abstract_transform import AbstractTransform
from pymic.util.image_process import *
class RandomFlip(AbstractTransform):
""" ... | 41.227273 | 92 | 0.6086 |
ee31c8bd8d074717ba1b1d5fd094ad2d7ebfff16 | 9,532 | py | Python | banana-split/banana-split.py | timwedde/banana-split | f129db7527b52206058727e8849d70f9a73f03ea | [
"MIT"
] | 7 | 2020-03-31T15:25:54.000Z | 2022-03-22T22:22:39.000Z | banana-split/banana-split.py | timwedde/banana-split | f129db7527b52206058727e8849d70f9a73f03ea | [
"MIT"
] | 4 | 2018-10-25T17:50:29.000Z | 2021-05-13T11:11:50.000Z | banana-split/banana-split.py | timwedde/banana-split | f129db7527b52206058727e8849d70f9a73f03ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
### System ###
import re
import sys
import time
import shutil
import argparse
from glob import glob
from tqdm import tqdm
from os import mkdir, remove, listdir
from os.path import join, dirname, exists
from signal import signal, SIGINT, SIG_IGN
from multiprocessing import cpu_count, Pool
### py... | 33.801418 | 122 | 0.587075 |
3e6652683f1ad0fa77f5e86134f041ec0ab7792a | 2,217 | py | Python | tests/qtoggleserver/core/expressions/conftest.py | DigitEgal/qtoggleserver | 54b6ac53742af9529fd349d4fc207b0dc8a38d3b | [
"Apache-2.0"
] | 12 | 2020-07-26T05:49:25.000Z | 2022-01-08T21:50:44.000Z | tests/qtoggleserver/core/expressions/conftest.py | DigitEgal/qtoggleserver | 54b6ac53742af9529fd349d4fc207b0dc8a38d3b | [
"Apache-2.0"
] | 8 | 2020-04-30T18:40:18.000Z | 2020-11-08T21:09:35.000Z | tests/qtoggleserver/core/expressions/conftest.py | DigitEgal/qtoggleserver | 54b6ac53742af9529fd349d4fc207b0dc8a38d3b | [
"Apache-2.0"
] | 2 | 2020-02-14T02:52:13.000Z | 2021-04-21T05:13:07.000Z |
import pytest
from qtoggleserver.core.expressions import literalvalues
@pytest.fixture(scope='session')
def literal_false():
return literalvalues.LiteralValue(False, 'false')
@pytest.fixture(scope='session')
def literal_true():
return literalvalues.LiteralValue(True, 'true')
@pytest.fixture(scope='sessi... | 22.17 | 76 | 0.747406 |
f22d5351fa47bbf8e0095e9da9abb445c0f45208 | 5,149 | py | Python | slider-agent/src/main/python/agent/shell.py | turningme/incubator-retired-slider | 1d4f519d763210f46e327338be72efa99e65cb5d | [
"Apache-2.0"
] | 60 | 2015-01-05T10:51:11.000Z | 2018-12-15T03:48:09.000Z | slider-agent/src/main/python/agent/shell.py | turningme/incubator-retired-slider | 1d4f519d763210f46e327338be72efa99e65cb5d | [
"Apache-2.0"
] | null | null | null | slider-agent/src/main/python/agent/shell.py | turningme/incubator-retired-slider | 1d4f519d763210f46e327338be72efa99e65cb5d | [
"Apache-2.0"
] | 87 | 2015-01-14T05:14:15.000Z | 2018-12-25T14:14:56.000Z | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | 31.981366 | 115 | 0.689066 |
ac26e6819735de755fc895f321077fd6d0bb6fdb | 11,670 | py | Python | tensorflow/python/keras/engine/base_preprocessing_layer_test.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 2 | 2019-06-28T17:43:04.000Z | 2019-06-28T17:43:07.000Z | tensorflow/python/keras/engine/base_preprocessing_layer_test.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 8 | 2019-07-08T10:09:18.000Z | 2019-09-26T20:55:43.000Z | tensorflow/python/keras/engine/base_preprocessing_layer_test.py | plopresti/tensorflow | 8b0c84d30d957596cbb3bcac9245e114c3f0b65b | [
"Apache-2.0"
] | 1 | 2021-02-27T07:40:01.000Z | 2021-02-27T07:40:01.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... | 34.835821 | 80 | 0.688003 |
e63c94670b9bf8a67224ad0c655103e180099a4e | 161 | py | Python | pythoscope/__init__.py | jmikedupont2/pythoscope | 58a1149f204897e8f789d93ee7e49b6db0bd346f | [
"MIT"
] | 2 | 2020-04-06T11:02:46.000Z | 2020-05-14T18:37:04.000Z | pythoscope/__init__.py | jmikedupont2/pythoscope | 58a1149f204897e8f789d93ee7e49b6db0bd346f | [
"MIT"
] | null | null | null | pythoscope/__init__.py | jmikedupont2/pythoscope | 58a1149f204897e8f789d93ee7e49b6db0bd346f | [
"MIT"
] | null | null | null | import sys
#from importlib import reload
#reload(sys)
#sys.setdefaultencoding("utf-8")
from .cmdline import main, __version__
from .snippet import start, stop
| 17.888889 | 38 | 0.782609 |
b953806efd9a2a4c0e0eeab7503bb41eb686ba64 | 1,841 | py | Python | SignLanguageRecognitionLearning/landmarkDetection.py | JanBinkowski/SignLanguageRecognition | 9c111a77301aafd3d480fffbe73e6b86d65eaead | [
"MIT"
] | 4 | 2021-11-13T20:40:26.000Z | 2021-12-30T18:25:51.000Z | SignLanguageRecognitionLearning/landmarkDetection.py | JanBinkowski/SignLanguageRecognition | 9c111a77301aafd3d480fffbe73e6b86d65eaead | [
"MIT"
] | null | null | null | SignLanguageRecognitionLearning/landmarkDetection.py | JanBinkowski/SignLanguageRecognition | 9c111a77301aafd3d480fffbe73e6b86d65eaead | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import mediapipe as mp
import cv2.cv2
import time
import os
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense
DATA_PATH = os.path.join('../MP_DATA')
DATA_PATH_VIDEO = os.path.join('../MP_VIDEOS')
actions = np.array(open(... | 43.833333 | 153 | 0.718088 |
c193cf543ab0209bfa058ded5d760fba5602ed42 | 899 | py | Python | shop/cart/modifiers/rebate_modifiers.py | ionata-archive/django-shop | 9197d71c038bd9b236e405fe8031993c09cf1514 | [
"BSD-3-Clause"
] | null | null | null | shop/cart/modifiers/rebate_modifiers.py | ionata-archive/django-shop | 9197d71c038bd9b236e405fe8031993c09cf1514 | [
"BSD-3-Clause"
] | null | null | null | shop/cart/modifiers/rebate_modifiers.py | ionata-archive/django-shop | 9197d71c038bd9b236e405fe8031993c09cf1514 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
from decimal import Decimal
from shop.cart.cart_modifiers_base import BaseCartModifier
class BulkRebateModifier(BaseCartModifier):
def add_extra_cart_item_price_field(self, cart_item):
"""
Add a rebate to a line item depending on the quantity ordered:
Th... | 40.863636 | 76 | 0.670745 |
1e38ba3cc300a35717372d1d3204931ba401e76f | 14,100 | py | Python | isi_sdk_8_1_1/isi_sdk_8_1_1/models/providers_krb5_krb5_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/providers_krb5_krb5_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/providers_krb5_krb5_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_1_1.models.provide... | 33.176471 | 203 | 0.609645 |
27b222b6028081725f25826a990984fb5c12a0ad | 1,398 | py | Python | socket-server.py | edlane/python-debug-harness | 45a98df0d9b2ba5164209c2a873f68f3bae96402 | [
"Apache-2.0"
] | null | null | null | socket-server.py | edlane/python-debug-harness | 45a98df0d9b2ba5164209c2a873f68f3bae96402 | [
"Apache-2.0"
] | null | null | null | socket-server.py | edlane/python-debug-harness | 45a98df0d9b2ba5164209c2a873f68f3bae96402 | [
"Apache-2.0"
] | null | null | null | import sys
import socket
import threading
import SocketServer
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def handle(self):
data = self.request.recv(1024)
cur_thread = threading.current_thread()
response = "{}: {}".format(cur_thread.name, data)
self.request.se... | 30.391304 | 77 | 0.690987 |
f17e40ed6efff60d12f36143476fb6deb83f6f8c | 1,103 | py | Python | SimGeneral/Debugging/test/runSimDigiDumper_cfg.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | SimGeneral/Debugging/test/runSimDigiDumper_cfg.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 26 | 2018-10-30T12:47:58.000Z | 2022-03-29T08:39:00.000Z | SimGeneral/Debugging/test/runSimDigiDumper_cfg.py | p2l1pfp/cmssw | 9bda22bf33ecf18dd19a3af2b3a8cbdb1de556a9 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("SimDigiDump")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(-1)
)
process.source = cms.Source("PoolSource",
file... | 34.46875 | 79 | 0.726201 |
cb08ae274a5819afe9e7dd6d360926696844e503 | 5,042 | py | Python | nlpsandbox/exceptions.py | Sage-Bionetworks/nlp-sandbox-client | e51720b35ca3413ccee71b9cdc223ce3578fe0fd | [
"Apache-2.0"
] | 3 | 2021-06-15T16:36:10.000Z | 2021-11-15T01:44:46.000Z | nlpsandbox/exceptions.py | nlpsandbox/nlpsandbox-client | 8cba4f65ff2c06cbef7dc50f45b0aec9b8ee0476 | [
"Apache-2.0"
] | 165 | 2020-11-23T00:36:40.000Z | 2022-03-24T00:53:59.000Z | nlpsandbox/exceptions.py | data2health/nlp-sandbox-evaluation | e51720b35ca3413ccee71b9cdc223ce3578fe0fd | [
"Apache-2.0"
] | 3 | 2020-12-11T00:04:13.000Z | 2022-01-03T16:59:10.000Z | """
NLP Sandbox API
NLP Sandbox REST API # noqa: E501
The version of the OpenAPI document: 1.2.0
Contact: team@nlpsandbox.io
Generated by: https://openapi-generator.tech
"""
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
class ApiTypeError(Ope... | 31.31677 | 78 | 0.599564 |
8fb2af576f4d78fa3c8f6c22b27c2e6e6aba133a | 5,921 | py | Python | cart_venv/Lib/site-packages/tensorflow_estimator/_api/v2/estimator/__init__.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | 2 | 2019-08-04T20:28:14.000Z | 2019-10-27T23:26:42.000Z | cart_venv/Lib/site-packages/tensorflow_estimator/_api/v2/estimator/__init__.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | null | null | null | cart_venv/Lib/site-packages/tensorflow_estimator/_api/v2/estimator/__init__.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | 1 | 2020-11-04T03:16:29.000Z | 2020-11-04T03:16:29.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Estimator: High level tools for working with models.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow_estimator._api.v2.estimator import ... | 76.896104 | 137 | 0.898497 |
97b30df027910dc253773d37c64f3ab44defc5b4 | 484 | py | Python | src/third_party/snappy.py | spencerjackson/mongo | 51c46e71c9f310fc91168c0945ffa6cfc00d380b | [
"Apache-2.0"
] | null | null | null | src/third_party/snappy.py | spencerjackson/mongo | 51c46e71c9f310fc91168c0945ffa6cfc00d380b | [
"Apache-2.0"
] | null | null | null | src/third_party/snappy.py | spencerjackson/mongo | 51c46e71c9f310fc91168c0945ffa6cfc00d380b | [
"Apache-2.0"
] | null | null | null |
def configure( env , fileLists , options ):
myenv = env.Clone()
if not options["windows"]:
myenv.Append(CPPFLAGS=" -Wno-sign-compare -Wno-unused-function ") #snappy doesn't compile cleanly
files = ["$BUILD_DIR/third_party/snappy/snappy.cc", "$BUILD_DIR/third_party/snappy/snappy-sinksource.cc"]
... | 34.571429 | 109 | 0.690083 |
dba01925051ab301755dd4a749b5f493af6ff92e | 10,344 | py | Python | src/settings.py | rdococ/lykos | fec1b361a6a539c997366a6536b2fcfbcfb1953a | [
"BSD-2-Clause"
] | null | null | null | src/settings.py | rdococ/lykos | fec1b361a6a539c997366a6536b2fcfbcfb1953a | [
"BSD-2-Clause"
] | null | null | null | src/settings.py | rdococ/lykos | fec1b361a6a539c997366a6536b2fcfbcfb1953a | [
"BSD-2-Clause"
] | null | null | null | import fnmatch
import re
import threading
from collections import OrderedDict
LANGUAGE = 'en'
MINIMUM_WAIT = 60
EXTRA_WAIT = 30
EXTRA_WAIT_JOIN = 0 # Add this many seconds to the waiting time for each !join
WAIT_AFTER_JOIN = 25 # Wait at least this many seconds after the last join
# token bucket for the IRC client; 1... | 42.393443 | 157 | 0.763631 |
c3c8771817c94c8d52c3a981908a7fa7762951f9 | 274 | py | Python | se34euca/runtest_view_page.py | eucalyptus/se34euca | af5da36754fccca84b7f260ba7605b8fdc30fa55 | [
"BSD-2-Clause"
] | 8 | 2015-01-08T21:06:08.000Z | 2019-10-26T13:17:16.000Z | se34euca/runtest_view_page.py | eucalyptus/se34euca | af5da36754fccca84b7f260ba7605b8fdc30fa55 | [
"BSD-2-Clause"
] | null | null | null | se34euca/runtest_view_page.py | eucalyptus/se34euca | af5da36754fccca84b7f260ba7605b8fdc30fa55 | [
"BSD-2-Clause"
] | 7 | 2016-08-31T07:02:21.000Z | 2020-07-18T00:10:36.000Z | #!/usr/bin/python
import se34euca
from se34euca.testcase.testcase_view_page import testcase_view_page
class ViewPage(se34euca.TestRunner):
testcase = "check_login_and_logout"
testclass = testcase_view_page
if __name__ == "__main__":
ViewPage().start_test()
| 19.571429 | 67 | 0.773723 |
8facf76fded2920425e3cd61578bb981c09fe709 | 1,794 | py | Python | aerosandbox/visualization/plotly.py | raihaan123/AeroSandbox | 1e7c78f04b066415f671237a4833ba98901bb9ec | [
"MIT"
] | 322 | 2019-05-29T20:40:04.000Z | 2022-03-29T12:46:45.000Z | aerosandbox/visualization/plotly.py | raihaan123/AeroSandbox | 1e7c78f04b066415f671237a4833ba98901bb9ec | [
"MIT"
] | 55 | 2019-07-14T09:52:59.000Z | 2022-03-28T16:02:21.000Z | aerosandbox/visualization/plotly.py | raihaan123/AeroSandbox | 1e7c78f04b066415f671237a4833ba98901bb9ec | [
"MIT"
] | 68 | 2019-06-02T09:57:26.000Z | 2022-03-28T15:03:47.000Z | import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
import aerosandbox.numpy as np
# Set the rendering to happen in browser
pio.renderers.default = "browser"
def spy(
matrix,
show=True,
):
"""
Plots the sparsity pattern of a matrix.
:param matrix: The mat... | 27.6 | 104 | 0.61427 |
5a77156150e573812b9dcfb2554339685692d6f3 | 2,544 | py | Python | app/app.py | paulrinckens/han_for_doc_classification | 2131e383f8bb779ae33ca658de9f9f66391bea74 | [
"MIT"
] | 3 | 2020-05-01T10:59:40.000Z | 2020-12-01T14:41:19.000Z | app/app.py | paulrinckens/han_for_doc_classification | 2131e383f8bb779ae33ca658de9f9f66391bea74 | [
"MIT"
] | 3 | 2020-11-13T18:48:49.000Z | 2022-02-10T01:55:04.000Z | app/app.py | paulrinckens/han_for_doc_classification | 2131e383f8bb779ae33ca658de9f9f66391bea74 | [
"MIT"
] | 1 | 2020-06-04T08:00:23.000Z | 2020-06-04T08:00:23.000Z | import base64
from io import BytesIO
import matplotlib.colors
import numpy as np
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figu... | 31.8 | 82 | 0.648585 |
25dc4c3d3dc1d7545e66b30fe1e7895ef3503121 | 9,803 | py | Python | util/tracklist.py | MeKLiN2/TinyChatBot | 606c792c2390ef40bfb9ed9277bbe638e1248342 | [
"MIT"
] | 18 | 2017-10-25T20:14:26.000Z | 2022-01-16T05:56:31.000Z | util/tracklist.py | MeKLiN2/TinyChatBot | 606c792c2390ef40bfb9ed9277bbe638e1248342 | [
"MIT"
] | 26 | 2017-10-25T17:58:44.000Z | 2019-07-26T06:01:08.000Z | util/tracklist.py | MeKLiN2/TinyChatBot | 606c792c2390ef40bfb9ed9277bbe638e1248342 | [
"MIT"
] | 23 | 2018-01-12T01:50:23.000Z | 2022-03-22T02:32:56.000Z | import time
class Track:
""" A class representing a track. """
def __init__(self, nick=None, **kwargs):
self.owner = nick
self.rq_time = time.time()
self.id = kwargs.get('video_id')
self.type = kwargs.get('type')
self.title = kwargs.get('video_title')
self.time ... | 30.538941 | 92 | 0.545955 |
7caf390e85f91d2dfcb09449a9d71db842eab585 | 8,887 | py | Python | steveBot.py | PikaBlue107/steve-content-warning | 1157824a96163987afb2750a045a1fde27e8a2cb | [
"MIT"
] | 1 | 2021-02-15T17:46:34.000Z | 2021-02-15T17:46:34.000Z | steveBot.py | PikaBlue107/steve-content-warning | 1157824a96163987afb2750a045a1fde27e8a2cb | [
"MIT"
] | null | null | null | steveBot.py | PikaBlue107/steve-content-warning | 1157824a96163987afb2750a045a1fde27e8a2cb | [
"MIT"
] | null | null | null | #Discord
import discord
from discord.ext import commands
from discord import errors
#Error handling
from pickle import UnpicklingError
from json import JSONDecodeError
#My files
from steveIO import SteveIO
from history import History
AUTH_LOC = "auth.json"
PACKAGE_LOC = "package.json"
GUILDS_LOC = "guilds.pickle"
... | 25.98538 | 168 | 0.723529 |
cd2ad2828933005aac9f03b488bb44c0b4207c23 | 189 | py | Python | test_tfrecordfile.py | travers-rhodes/multi_object_datasets | 60077353045365a1b614dc4a4400521bfba46a58 | [
"Apache-2.0"
] | null | null | null | test_tfrecordfile.py | travers-rhodes/multi_object_datasets | 60077353045365a1b614dc4a4400521bfba46a58 | [
"Apache-2.0"
] | null | null | null | test_tfrecordfile.py | travers-rhodes/multi_object_datasets | 60077353045365a1b614dc4a4400521bfba46a58 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
tf.compat.v1.enable_eager_execution()
import dots as d
dat = d.dataset("6_dots.tfrecords")
i = 0
for el in dat:
i+=1
if i > 3:
break
print(el)
| 14.538462 | 37 | 0.640212 |
4091393d902ac9ae64cc0f16f55114d8b93ec046 | 17,016 | py | Python | option_b.py | wrosecrans/colormap | 0b6a3b7e4caa5df72e7bad8ba196acfbbe5e5946 | [
"CC0-1.0"
] | 231 | 2015-06-03T01:28:13.000Z | 2022-03-27T02:02:42.000Z | option_b.py | CatarinaL/colormap | bc549477db0c12b54a5928087552ad2cf274980f | [
"CC0-1.0"
] | 10 | 2015-06-06T23:06:06.000Z | 2019-10-25T20:10:48.000Z | option_b.py | CatarinaL/colormap | bc549477db0c12b54a5928087552ad2cf274980f | [
"CC0-1.0"
] | 97 | 2015-06-04T00:46:34.000Z | 2022-01-23T17:37:24.000Z |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in viscm
parameters = {'xp': [0.62912107182941668, 5.9459613496072166, 109.50795214009284, -21.828857638709152, -6.5743399496759416],
'yp': [-9.0711805555555429, -75.1519097222222, 50.0400... | 60.127208 | 124 | 0.57728 |
563500829c4d069d25d29e122217af76c93ab51d | 174 | py | Python | api/Note_test.py | gracejiang/note-sharing | 3785ab4f3f6f805e8cd0f6556c2b0faf6ed6d8da | [
"MIT"
] | null | null | null | api/Note_test.py | gracejiang/note-sharing | 3785ab4f3f6f805e8cd0f6556c2b0faf6ed6d8da | [
"MIT"
] | null | null | null | api/Note_test.py | gracejiang/note-sharing | 3785ab4f3f6f805e8cd0f6556c2b0faf6ed6d8da | [
"MIT"
] | 1 | 2021-03-02T12:34:11.000Z | 2021-03-02T12:34:11.000Z | import json
from Note import Note
n = Note("Friction", "introduction to friction", "UC Berkeley", 0, True, False, False, "https://google.com", 'lec.pdf')
print(n.toJSON())
| 24.857143 | 119 | 0.689655 |
668f9483105f239e5932fa588b65e6cc516b7c06 | 1,009 | py | Python | bireme_tpcc_test/compare.py | lingfengzui/bireme | 96aed5fe42ee2e0679d66e8a5518f48af19c9b42 | [
"Apache-2.0"
] | 133 | 2017-09-13T02:32:56.000Z | 2022-03-11T02:38:33.000Z | bireme_tpcc_test/compare.py | mgbin088/bireme | 9cfc128230e7a718394132d9a51ec7d1019d08be | [
"Apache-2.0"
] | 84 | 2017-09-18T07:03:06.000Z | 2021-03-26T06:35:14.000Z | bireme_tpcc_test/compare.py | mgbin088/bireme | 9cfc128230e7a718394132d9a51ec7d1019d08be | [
"Apache-2.0"
] | 55 | 2017-09-13T03:28:22.000Z | 2021-04-21T08:13:19.000Z | import os
import sys
from sqlCheckSum import sqlCheckSum
try:
table = sys.argv[2]
key = sys.argv[3:]
if sys.argv[1] == "mysql":
mysqlIP = os.environ['MYSQL_IP']
mysqlPort = 3306
mysqlUser = os.environ['MYSQL_USER']
mysqlPasswd = os.environ['MYSQL_PASSWD']
mysqlDB =... | 32.548387 | 145 | 0.603568 |
94ccda15af46f159402fbd830a40f27b6522faaa | 847 | py | Python | web/tests/utils/test_predict_queue.py | salathegroup/crowdbreaks-streamer | 3019b0f8d48bd6b4419bdaa02d0463ea6617b496 | [
"MIT"
] | 6 | 2019-03-25T17:44:42.000Z | 2020-10-28T18:45:27.000Z | web/tests/utils/test_predict_queue.py | salathegroup/crowdbreaks-streamer | 3019b0f8d48bd6b4419bdaa02d0463ea6617b496 | [
"MIT"
] | null | null | null | web/tests/utils/test_predict_queue.py | salathegroup/crowdbreaks-streamer | 3019b0f8d48bd6b4419bdaa02d0463ea6617b496 | [
"MIT"
] | null | null | null | import pytest
class TestPredictQueue:
def test_push(self, predict_queue, tweet):
d = {'id': str(tweet['id']), 'text': tweet['text']}
predict_queue.push(d)
assert len(predict_queue) == 1
def test_pop_all(self, predict_queue, tweet, retweet):
d1 = {'id': str(tweet['id']), 'text':... | 36.826087 | 75 | 0.59268 |
2b2993665fdfa4018243b61056eb2f4a0b88e524 | 2,660 | py | Python | jointly/types.py | hpi-dhc/jointly | b56fca228b2705cf795ae453cd1d77c0567f099e | [
"MIT"
] | 7 | 2020-10-14T11:57:35.000Z | 2021-12-28T11:32:45.000Z | jointly/types.py | hpi-dhc/jointly | b56fca228b2705cf795ae453cd1d77c0567f099e | [
"MIT"
] | 5 | 2021-08-18T09:04:16.000Z | 2021-12-27T19:24:24.000Z | jointly/types.py | hpi-dhc/jointly | b56fca228b2705cf795ae453cd1d77c0567f099e | [
"MIT"
] | 1 | 2021-05-06T07:57:38.000Z | 2021-05-06T07:57:38.000Z | from typing import Dict, Union, List
import pandas as pd
SourceDict = Dict[str, Dict[str, Union[str, pd.DataFrame, float, pd.Timedelta, None]]]
"""
A dictionary of dictionaries.
Each entry defines an input sensor, and points to a dictionary with the keys ``data`` and ``ref_column``.
``data`` is a pandas ``DataFrame`... | 32.839506 | 121 | 0.631203 |
4070b2a5d9921417d2852365e13eb781b48b2cc7 | 237 | py | Python | tests/django_app/conftest.py | achaidaris/django-ansible | d0f37ac05b2037e5d7077dc271e72bd02676ddd9 | [
"MIT"
] | 19 | 2016-10-14T12:31:15.000Z | 2021-05-08T08:31:01.000Z | tests/django_app/conftest.py | achaidaris/django-ansible | d0f37ac05b2037e5d7077dc271e72bd02676ddd9 | [
"MIT"
] | 29 | 2016-11-15T15:38:59.000Z | 2020-06-05T18:17:30.000Z | tests/django_app/conftest.py | achaidaris/django-ansible | d0f37ac05b2037e5d7077dc271e72bd02676ddd9 | [
"MIT"
] | 9 | 2016-10-14T13:04:21.000Z | 2021-04-17T16:24:34.000Z | import pytest
from django_app.web import factories as web_factories
from pytest_factoryboy import register
# enable database for all tests
@pytest.fixture(autouse=True)
def enable_db(db):
pass
register(web_factories.UserFactory)
| 18.230769 | 53 | 0.814346 |
03c97e3c4e7a9d3cabccb3c34f411e9164abf008 | 44 | py | Python | tests/scruples/baselines/test_metrics.py | allenai/scruples | 9a43459c507e57d89ab8442a4f3985cedecb8710 | [
"Apache-2.0"
] | 29 | 2020-05-09T10:55:45.000Z | 2022-03-28T16:18:02.000Z | tests/scruples/baselines/test_metrics.py | allenai/scruples | 9a43459c507e57d89ab8442a4f3985cedecb8710 | [
"Apache-2.0"
] | null | null | null | tests/scruples/baselines/test_metrics.py | allenai/scruples | 9a43459c507e57d89ab8442a4f3985cedecb8710 | [
"Apache-2.0"
] | 6 | 2020-10-05T12:24:28.000Z | 2021-12-06T19:51:06.000Z | """Tests for scruples.baselines.metrics."""
| 22 | 43 | 0.727273 |
6bf81b127adc730c9ac3cf992c4e1b9d99303467 | 1,892 | py | Python | pypulseq_cest/simulate.py | KerstinHut/pypulseq-cest | a81fba9b66de0bb4b32f3df26c2c1d15967948ca | [
"MIT"
] | 2 | 2021-05-08T21:25:52.000Z | 2021-05-08T21:26:33.000Z | pypulseq_cest/simulate.py | KerstinHut/pypulseq-cest | a81fba9b66de0bb4b32f3df26c2c1d15967948ca | [
"MIT"
] | 13 | 2021-02-14T08:40:17.000Z | 2021-10-18T13:16:18.000Z | pypulseq_cest/simulate.py | KerstinHut/pypulseq-cest | a81fba9b66de0bb4b32f3df26c2c1d15967948ca | [
"MIT"
] | 2 | 2021-02-27T20:27:18.000Z | 2021-04-07T14:17:13.000Z | """
simulate.py
"""
from typing import Union
from pathlib import Path
from pySimPulseqSBB import SimPulseqSBB, SimulationParameters
from pypulseq_cest.parser import parse_params, get_zspec
from bmctool.set_params import load_params
from bmctool.utils.eval import plot_z
def simulate(config_file: Union[str, Path],
... | 28.238806 | 85 | 0.657505 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.