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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
02618a7eed33bdfbec9b651a6841eb4fcf49a22c | 1,663 | py | Python | utils/auth.py | BudzynskiMaciej/notifai_recruitment | 56860db3a2dad6115747a675895b8f7947e7e12e | [
"MIT"
] | null | null | null | utils/auth.py | BudzynskiMaciej/notifai_recruitment | 56860db3a2dad6115747a675895b8f7947e7e12e | [
"MIT"
] | 2 | 2021-05-21T13:26:26.000Z | 2022-02-10T10:04:55.000Z | utils/auth.py | BudzynskiMaciej/notifai_recruitment | 56860db3a2dad6115747a675895b8f7947e7e12e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from rest_framework import authentication
from rest_framework import exceptions
from notifai_recruitment import settings
class MasterKeyNaiveAuthentication(authentication.BaseAuthentication):
"""Authentication model for master key.
Note:
... | 47.514286 | 120 | 0.736019 | 1,470 | 0.883945 | 0 | 0 | 0 | 0 | 0 | 0 | 1,006 | 0.604931 |
02623225e5d363b265ee6e56ba38be5191b44c1f | 435 | py | Python | scripts/issues/issue6.py | slamer59/awesome-panel | 91c30bd6d6859eadf9c65b1e143952f7e64d5290 | [
"Apache-2.0"
] | 179 | 2019-12-04T14:54:53.000Z | 2022-03-30T09:08:38.000Z | scripts/issues/issue6.py | slamer59/awesome-panel | 91c30bd6d6859eadf9c65b1e143952f7e64d5290 | [
"Apache-2.0"
] | 62 | 2019-12-14T16:51:28.000Z | 2022-03-19T18:47:12.000Z | scripts/issues/issue6.py | slamer59/awesome-panel | 91c30bd6d6859eadf9c65b1e143952f7e64d5290 | [
"Apache-2.0"
] | 35 | 2019-12-08T13:19:53.000Z | 2022-03-25T10:33:02.000Z | import panel as pn
def main():
text_error = """
This is not formatted correctly by Markdown due to the indentation!"""
text_ok = """
This is formatted correctly by Markdown!
"""
app = pn.Column(
pn.pane.Markdown(text_error),
pn.pane.HTML(
"<hr>",
si... | 19.772727 | 75 | 0.542529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 150 | 0.344828 |
02649919ebe1649e2c617d8a536cb6343e919b0b | 18,257 | py | Python | Electronic_Arts_Software_Engineering_Virtual_Program/Task_1/Vaxman_in_Python/vaxman.py | melwyncarlo/Virtual_Internship_Programmes | 1d1ae99abd63765d69ce930438c4bd6d15bd3d45 | [
"CC0-1.0"
] | null | null | null | Electronic_Arts_Software_Engineering_Virtual_Program/Task_1/Vaxman_in_Python/vaxman.py | melwyncarlo/Virtual_Internship_Programmes | 1d1ae99abd63765d69ce930438c4bd6d15bd3d45 | [
"CC0-1.0"
] | null | null | null | Electronic_Arts_Software_Engineering_Virtual_Program/Task_1/Vaxman_in_Python/vaxman.py | melwyncarlo/Virtual_Internship_Programmes | 1d1ae99abd63765d69ce930438c4bd6d15bd3d45 | [
"CC0-1.0"
] | null | null | null | # Vax-Man, a re-implementation of Pacman, in Python, with PyGame.
# Forked from: https://github.com/hbokmann/Pacman
# Edited by Melwyn Francis Carlo (2021)
# Video link: https://youtu.be/ZrqZEC6DvMc
import time
import pygame
# Ghosts multiply themselves every thirty seconds.
GHOST_MULTIPLICATION_TIME_GAP = 30
# Th... | 29.025437 | 143 | 0.570083 | 4,397 | 0.240839 | 0 | 0 | 0 | 0 | 0 | 0 | 4,319 | 0.236567 |
02672c292331f32c5416bda0b2eba29281a17676 | 1,320 | py | Python | examples/ecr/rl_formulations/common/state_shaper.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | examples/ecr/rl_formulations/common/state_shaper.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | examples/ecr/rl_formulations/common/state_shaper.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
from maro.rl import AbstractStateShaper
class ECRStateShaper(AbstractStateShaper):
def __init__(self, *, look_back, max_ports_downstream, port_attributes, vessel_attributes):
super().__init__()
self._look_... | 45.517241 | 117 | 0.724242 | 1,184 | 0.89697 | 0 | 0 | 53 | 0.040152 | 0 | 0 | 119 | 0.090152 |
0267eac0bf1a3be3319a75260f8b10b9d6a39d75 | 2,834 | py | Python | src/runner.py | Shahrukh-Badar/DeepLearning | 5f6bbd6f8ace06014f10e35183442901d984b231 | [
"MIT"
] | null | null | null | src/runner.py | Shahrukh-Badar/DeepLearning | 5f6bbd6f8ace06014f10e35183442901d984b231 | [
"MIT"
] | null | null | null | src/runner.py | Shahrukh-Badar/DeepLearning | 5f6bbd6f8ace06014f10e35183442901d984b231 | [
"MIT"
] | null | null | null | from os import listdir
from os.path import join, isfile
import json
from random import randint
#########################################
## START of part that students may change
from code_completion_baseline import Code_Completion_Baseline
training_dir = "./../../programs_800/"
query_dir = "./../../programs_200/"
m... | 32.953488 | 127 | 0.650318 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 786 | 0.277347 |
0268d3f7d9cf4572520e699a426fa385cc8944bc | 4,491 | py | Python | superhelp/formatters/cli_formatter.py | grantps/superhelp | d8e861bf1ad91571ac23b9c833a8cd461bb1952f | [
"MIT"
] | 27 | 2020-05-17T20:48:43.000Z | 2022-01-08T21:32:30.000Z | superhelp/formatters/cli_formatter.py | grantps/superhelp | d8e861bf1ad91571ac23b9c833a8cd461bb1952f | [
"MIT"
] | null | null | null | superhelp/formatters/cli_formatter.py | grantps/superhelp | d8e861bf1ad91571ac23b9c833a8cd461bb1952f | [
"MIT"
] | null | null | null | from pathlib import Path
from textwrap import dedent
from superhelp import conf
from superhelp.conf import Level, Theme
from superhelp.formatters.cli_extras import md2cli
from superhelp.formatters.cli_extras.cli_colour import set_global_colours
from superhelp.gen_utils import (get_code_desc, get_intro,
get_line_nu... | 37.115702 | 93 | 0.674905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,497 | 0.333333 |
0268e7698751adcedb3a0f8d62ab2e3667fd33f3 | 4,941 | py | Python | atom/instance.py | enthought/atom | 1f194e3550d62c4ca1d79521dff97531ffe3f0ac | [
"BSD-3-Clause"
] | null | null | null | atom/instance.py | enthought/atom | 1f194e3550d62c4ca1d79521dff97531ffe3f0ac | [
"BSD-3-Clause"
] | 1 | 2020-12-04T10:11:07.000Z | 2020-12-04T10:13:46.000Z | atom/instance.py | enthought/atom | 1f194e3550d62c4ca1d79521dff97531ffe3f0ac | [
"BSD-3-Clause"
] | 1 | 2020-12-04T10:05:32.000Z | 2020-12-04T10:05:32.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
from .catom import (
Member, DEFAULT_FACTORY, DEFAULT_VALUE, USER_DEFAULT, VALIDATE_INSTANCE,... | 36.065693 | 79 | 0.608379 | 4,593 | 0.929569 | 0 | 0 | 0 | 0 | 0 | 0 | 2,885 | 0.58389 |
0268f15772e163a48707362a23538e64ee3c364e | 4,744 | py | Python | operators/elastic-cloud-eck/python/pulumi_pulumi_kubernetes_crds_operators_elastic_cloud_eck/_tables.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | operators/elastic-cloud-eck/python/pulumi_pulumi_kubernetes_crds_operators_elastic_cloud_eck/_tables.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | 2 | 2020-09-18T17:12:23.000Z | 2020-12-30T19:40:56.000Z | operators/elastic-cloud-eck/python/pulumi_pulumi_kubernetes_crds_operators_elastic_cloud_eck/_tables.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
SNAKE_TO_CAMEL_CASE_TABLE = {
"access_modes": "accessModes",
"api_group": "apiGroup",
"api_version": "apiVersion",
"app_protocol": "appProtocol",
... | 39.533333 | 80 | 0.707841 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,795 | 0.799958 |
026b557b15ada072d61283c89f10a088c8637df4 | 1,416 | py | Python | webapp/app.py | aleksandergurin/news | 9e7d3c35857600445cb6df42ba18d289dc0e37a9 | [
"BSD-3-Clause"
] | 3 | 2015-08-20T11:08:28.000Z | 2018-01-28T21:22:53.000Z | webapp/app.py | aleksandergurin/news | 9e7d3c35857600445cb6df42ba18d289dc0e37a9 | [
"BSD-3-Clause"
] | null | null | null | webapp/app.py | aleksandergurin/news | 9e7d3c35857600445cb6df42ba18d289dc0e37a9 | [
"BSD-3-Clause"
] | null | null | null |
from flask import Flask, render_template
from config import configs
from .extensions import login_manager, db
from .account import account
from .frontend import frontend
from webapp.session import RedisSessionInterface
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(configs[config_n... | 24.413793 | 80 | 0.711864 | 0 | 0 | 0 | 0 | 411 | 0.290254 | 0 | 0 | 91 | 0.064266 |
026bd83279fbac0f51bacbf47138a5022a5dd278 | 27,723 | py | Python | src/ezcode/knapsack/__init__.py | zheng-gao/ez_code | fbf48990291aa57d6436d4548b0a6c25dfb8f82d | [
"MIT"
] | null | null | null | src/ezcode/knapsack/__init__.py | zheng-gao/ez_code | fbf48990291aa57d6436d4548b0a6c25dfb8f82d | [
"MIT"
] | null | null | null | src/ezcode/knapsack/__init__.py | zheng-gao/ez_code | fbf48990291aa57d6436d4548b0a6c25dfb8f82d | [
"MIT"
] | null | null | null | from typing import Callable
class Knapsack:
@staticmethod
def best_value(
capacity: int,
sizes: list,
values: list,
quantities,
min_max: Callable = max,
zero_capacity_value=0,
fill_to_capacity=True,
output_item_list=True
):
if capacit... | 48.046794 | 145 | 0.537171 | 27,675 | 0.998269 | 0 | 0 | 27,601 | 0.995599 | 0 | 0 | 5,818 | 0.209862 |
026d6883b4b4ef48ca95ca7facd1d38932ace6a3 | 26 | py | Python | env/lib/python3.7/site-packages/grpc/_grpcio_metadata.py | PrudhviGNV/speechemotion | c99b4a7f644e1fd495cb5e6750ada0dd50d8b86f | [
"MIT"
] | 5 | 2019-04-16T20:43:47.000Z | 2020-10-24T22:35:39.000Z | Lib/site-packages/grpc/_grpcio_metadata.py | caiyongji/Anaconda-py36.5-tensorflow-built-env | f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2 | [
"PSF-2.0"
] | 2 | 2021-04-30T20:43:55.000Z | 2021-06-10T21:34:23.000Z | Lib/site-packages/grpc/_grpcio_metadata.py | caiyongji/Anaconda-py36.5-tensorflow-built-env | f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2 | [
"PSF-2.0"
] | 3 | 2019-08-03T13:47:09.000Z | 2021-08-03T14:20:25.000Z | __version__ = """1.19.0""" | 26 | 26 | 0.576923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0.461538 |
027134b2e08ff17613c7279b030cfe1fcf0d8e8e | 309 | py | Python | pycon/tutorials/urls.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 154 | 2015-01-17T02:29:24.000Z | 2022-03-20T20:37:24.000Z | pycon/tutorials/urls.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 316 | 2015-01-10T04:01:50.000Z | 2020-09-30T20:18:08.000Z | pycon/tutorials/urls.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | 89 | 2015-01-10T05:25:21.000Z | 2022-02-27T03:28:59.000Z | from django.conf.urls import url, patterns
from .views import tutorial_email, tutorial_message
urlpatterns = patterns("", # flake8: noqa
url(r"^mail/(?P<pk>\d+)/(?P<pks>[0-9,]+)/$", tutorial_email, name="tutorial_email"),
url(r"^message/(?P<pk>\d+)/$", tutorial_message, name="tutorial_message"),
)
| 34.333333 | 88 | 0.679612 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 114 | 0.368932 |
027194484ee86822b39b3b119ff07d71c83e4daa | 895 | py | Python | setup.py | oleks/gigalixir-cli | d1b1c303e24be548ddc895165e34652c378f4347 | [
"MIT"
] | null | null | null | setup.py | oleks/gigalixir-cli | d1b1c303e24be548ddc895165e34652c378f4347 | [
"MIT"
] | null | null | null | setup.py | oleks/gigalixir-cli | d1b1c303e24be548ddc895165e34652c378f4347 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='gigalixir',
url='https://github.com/gigalixir/gigalixir-cli',
author='Jesse Shieh',
author_email='[email protected]',
version='1.1.10',
packages=find_packages(),
include_package_data=True,
install_requires=[
'click~=6.7'... | 20.813953 | 53 | 0.492737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 362 | 0.404469 |
02723743e00e16a13861c25c7c9d6a4bb4b3f93e | 254 | py | Python | runTest.py | Amedeo91/cushypost_integration | fc7ffc9daf535ed5bcfdee4933a7a57340a583b2 | [
"MIT"
] | 1 | 2021-10-06T06:23:40.000Z | 2021-10-06T06:23:40.000Z | runTest.py | Amedeo91/cushypost_integration | fc7ffc9daf535ed5bcfdee4933a7a57340a583b2 | [
"MIT"
] | null | null | null | runTest.py | Amedeo91/cushypost_integration | fc7ffc9daf535ed5bcfdee4933a7a57340a583b2 | [
"MIT"
] | null | null | null | import os
import unittest
dir_path = os.path.dirname(os.path.realpath(__file__))
suite = unittest.TestLoader().discover(dir_path, pattern='test_*.py')
result = unittest.TextTestRunner(verbosity=3).run(suite)
print(result)
assert result.wasSuccessful()
| 25.4 | 69 | 0.787402 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0.043307 |
02735e99efa8906c66196996cdf60aedba9354a2 | 6,145 | py | Python | tests/test_pydent/test_models/models/test_plan.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 5 | 2019-01-21T11:12:05.000Z | 2020-03-05T20:52:14.000Z | tests/test_pydent/test_models/models/test_plan.py | aquariumbio/pydent | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 28 | 2020-11-18T02:07:09.000Z | 2021-06-08T15:49:41.000Z | tests/test_pydent/test_models/models/test_plan.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 2 | 2021-02-27T19:23:45.000Z | 2021-09-14T10:29:07.000Z | import pytest
from pydent.models import Plan
def test_plan_constructor(fake_session):
g = fake_session.Plan.new()
assert g.name is not None
print(g.plan_associations)
assert g.operations is None
assert g.wires == []
g = Plan(name="MyPlan", status="running")
assert g.name == "MyPlan"
... | 28.581395 | 76 | 0.621318 | 0 | 0 | 0 | 0 | 661 | 0.107567 | 0 | 0 | 3,936 | 0.640521 |
0273c9fe7bf28f09a7dc46bd636570ab46c8a8fa | 611 | py | Python | FusionIIIT/applications/gymkhana/migrations/0007_auto_20200608_2210.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 2 | 2020-01-24T16:34:54.000Z | 2020-08-01T05:09:24.000Z | FusionIIIT/applications/gymkhana/migrations/0007_auto_20200608_2210.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 1 | 2021-05-05T09:50:22.000Z | 2021-05-05T09:50:22.000Z | FusionIIIT/applications/gymkhana/migrations/0007_auto_20200608_2210.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 4 | 2020-01-16T17:00:08.000Z | 2020-06-30T15:58:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-06-08 22:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gymkhana', '0006_form_available'),
]
operations = [
migrations.RemoveField... | 24.44 | 101 | 0.610475 | 452 | 0.739771 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.237316 |
027588263d8cfcf1854016d6bcb09a5b8fcae300 | 1,899 | py | Python | config/presets/Modes/Python/T - Bits H/main.py | The-XOR/EYESY_OS | 6a5e3d0bc5574ba2311e0c7e81c600c3af7a3e34 | [
"BSD-3-Clause"
] | 18 | 2021-03-06T05:39:30.000Z | 2022-03-25T17:59:23.000Z | presets/Modes/Python/T - Bits H/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | null | null | null | presets/Modes/Python/T - Bits H/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | 4 | 2021-03-14T18:38:42.000Z | 2021-07-11T14:31:18.000Z | import os
import pygame
import random
trigger = False
x = 0
y = 0
height = 720
width = 1280
linelength = 50
lineAmt = 20
displace = 10
xpos = [random.randrange(-200,1280) for i in range(0, lineAmt + 2)]
xpos1 = [(xpos[i]+displace) for i in range(0, lineAmt + 2)]
xr = 360
yr = 240
def setup(screen, etc):
global trigg... | 31.131148 | 97 | 0.604529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0275d85ad826b0b81b83f4f373f69ae66117d9ed | 2,577 | py | Python | ext/std/code/mi.py | iazarov/metrixplusplus | 322777cba4e089502dd6053749b07a7be9da65b2 | [
"MIT"
] | null | null | null | ext/std/code/mi.py | iazarov/metrixplusplus | 322777cba4e089502dd6053749b07a7be9da65b2 | [
"MIT"
] | null | null | null | ext/std/code/mi.py | iazarov/metrixplusplus | 322777cba4e089502dd6053749b07a7be9da65b2 | [
"MIT"
] | null | null | null | #
# Metrix++, Copyright 2009-2019, Metrix++ Project
# Link: https://github.com/metrixplusplus/metrixplusplus
#
# This file is a part of Metrix++ Tool.
#
import mpp.api
class Plugin(mpp.api.Plugin,
mpp.api.IConfigurable,
mpp.api.Child,
mpp.api.MetricP... | 45.210526 | 100 | 0.568879 | 2,379 | 0.923166 | 0 | 0 | 0 | 0 | 0 | 0 | 819 | 0.317811 |
027b51903bbc31466f05349aa598a39bb4d2919d | 447 | py | Python | 6.00.1x/quiz/flatten.py | NicholasAsimov/courses | d60981f25816445578eb9e89bbbeef2d38eaf014 | [
"MIT"
] | null | null | null | 6.00.1x/quiz/flatten.py | NicholasAsimov/courses | d60981f25816445578eb9e89bbbeef2d38eaf014 | [
"MIT"
] | null | null | null | 6.00.1x/quiz/flatten.py | NicholasAsimov/courses | d60981f25816445578eb9e89bbbeef2d38eaf014 | [
"MIT"
] | null | null | null | def flatten(aList):
'''
aList: a list
Returns a copy of aList, which is a flattened version of aList
'''
if aList == []:
return aList
if type(aList[0]) == list:
return flatten(aList[0]) + flatten(aList[1:])
return aList[:1] + flatten(aList[1:])
aList = [[1, 'a', ['cat'], 2... | 22.35 | 66 | 0.548098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 122 | 0.272931 |
027cdd147516550681b095c7591faaa5e2b26a2b | 9,960 | py | Python | copo_code/copo/algo_svo/svo_env.py | decisionforce/CoPO | 3a06a48522b901db2e380a62a0efb5e8a30cd079 | [
"Apache-2.0"
] | 37 | 2021-11-01T03:30:30.000Z | 2022-03-29T08:38:12.000Z | copo_code/copo/algo_svo/svo_env.py | decisionforce/CoPO | 3a06a48522b901db2e380a62a0efb5e8a30cd079 | [
"Apache-2.0"
] | null | null | null | copo_code/copo/algo_svo/svo_env.py | decisionforce/CoPO | 3a06a48522b901db2e380a62a0efb5e8a30cd079 | [
"Apache-2.0"
] | 4 | 2021-11-05T06:55:34.000Z | 2022-01-04T07:08:37.000Z | """
Usage: Call get_svo_env(env_class) to get the real env class!
"""
from collections import defaultdict
from math import cos, sin
import numpy as np
from gym.spaces import Box
from metadrive.envs.marl_envs.marl_tollgate import TollGateObservation, MultiAgentTollgateEnv
from metadrive.obs.state_obs import LidarStateO... | 35.44484 | 113 | 0.570482 | 8,008 | 0.804016 | 0 | 0 | 2,196 | 0.220482 | 0 | 0 | 1,622 | 0.162851 |
027d3d4607b5f1e18cfb2663664c754672a047c8 | 1,995 | py | Python | tests/test_renderer.py | derlin/get-html | ea6d81f424ed0a60a37a52b95dd5b27c85cf0852 | [
"Apache-2.0"
] | 11 | 2020-03-02T08:38:37.000Z | 2021-11-19T05:03:20.000Z | tests/test_renderer.py | derlin/get-html | ea6d81f424ed0a60a37a52b95dd5b27c85cf0852 | [
"Apache-2.0"
] | 2 | 2020-03-02T11:43:12.000Z | 2020-03-10T07:59:07.000Z | tests/test_renderer.py | derlin/get-html | ea6d81f424ed0a60a37a52b95dd5b27c85cf0852 | [
"Apache-2.0"
] | 2 | 2020-03-02T08:13:53.000Z | 2020-03-09T21:15:26.000Z | from get_html.html_renderer import HtmlRenderer
import pytest
import re
@pytest.fixture(scope='module')
def renderer():
r = HtmlRenderer()
try:
yield r
finally:
r.close()
def test_response(renderer: HtmlRenderer):
url = 'http://www.twitter.com' # this will redirect to https://twitt... | 32.704918 | 148 | 0.680201 | 0 | 0 | 94 | 0.047118 | 666 | 0.333835 | 182 | 0.091228 | 777 | 0.389474 |
027e6a3b136fbe978f346957d7b86c2022fa6ea2 | 724 | py | Python | resources/include-lists/string_manipulator_util.py | e-loughlin/CppCodeGenerator | 638f80f9df21d709d1240bb3bd43f9d43dd2e3ac | [
"MIT"
] | 6 | 2019-09-30T10:27:15.000Z | 2020-12-20T14:46:24.000Z | resources/include-lists/string_manipulator_util.py | e-loughlin/CppCodeGenerator | 638f80f9df21d709d1240bb3bd43f9d43dd2e3ac | [
"MIT"
] | 4 | 2019-11-25T18:14:29.000Z | 2019-12-09T20:47:29.000Z | resources/include-lists/string_manipulator_util.py | emloughl/CppCodeGenerator | 638f80f9df21d709d1240bb3bd43f9d43dd2e3ac | [
"MIT"
] | 1 | 2021-12-01T07:03:31.000Z | 2021-12-01T07:03:31.000Z |
import sys
import os
import ntpath
def readFile(filePath):
with open(filePath, "r") as file:
return file.read()
def writeToDisk(filePath, stringToSave):
with open(filePath, "w+") as newFile:
newFile.write(stringToSave)
def main():
filePath = os.path.abspath("./qt-includes.txt")
stuf... | 20.111111 | 53 | 0.574586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 85 | 0.117403 |
027e798c00ba61f438e908e5871d0e08cf7a12f8 | 2,205 | py | Python | build/lib/henmedlib/functions/hounsfield.py | schmitzhenninglmu/henmedlib | 196b63710f092470ab21173cfcc0b14e65778f33 | [
"MIT"
] | null | null | null | build/lib/henmedlib/functions/hounsfield.py | schmitzhenninglmu/henmedlib | 196b63710f092470ab21173cfcc0b14e65778f33 | [
"MIT"
] | null | null | null | build/lib/henmedlib/functions/hounsfield.py | schmitzhenninglmu/henmedlib | 196b63710f092470ab21173cfcc0b14e65778f33 | [
"MIT"
] | 1 | 2019-09-20T10:59:25.000Z | 2019-09-20T10:59:25.000Z | __author__ = "Henning Schmitz"
import numpy as np
def calculate_hounsfield_unit(mu, mu_water, mu_air):
"""
Given linear attenuation coefficients the function calculates the corresponding Hounsfield units.
:param mu: Attenuation coefficient to determine corresponding Hounsfield unit.
:param mu_... | 38.017241 | 116 | 0.677098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,254 | 0.568707 |
027ff59d51aedead00128b3b38fec073cc323ee3 | 1,028 | py | Python | coaddExtract.py | rbliu/LSST_DM_Scripts | 0a32ba629a2b52d3add407e92ab8ff4bc3cbd64d | [
"MIT"
] | null | null | null | coaddExtract.py | rbliu/LSST_DM_Scripts | 0a32ba629a2b52d3add407e92ab8ff4bc3cbd64d | [
"MIT"
] | null | null | null | coaddExtract.py | rbliu/LSST_DM_Scripts | 0a32ba629a2b52d3add407e92ab8ff4bc3cbd64d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
## last modified by Robert Liu at 7/29/2019
## This script is used to extract data (and WCS info) in the image extension of a coadd patch.
## Ext 0 = primaryHDU, Ext 1 = image, Ext 2 = mask, Ext 3 = variancce.
## Then, the output fits file can be used by SWarp to assemble a... | 28.555556 | 94 | 0.715953 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 604 | 0.587549 |
02824286d75d00e50642afe49b18a9fd9681523d | 22 | py | Python | backend_server/backend_globals.py | MSNLAB/SmartEye | 40b38190aeff5d5b970c8cbf43e8781634b38028 | [
"MIT",
"Unlicense"
] | 17 | 2021-06-27T04:33:13.000Z | 2022-03-21T02:54:52.000Z | backend_server/backend_globals.py | MSNLAB/SmartEye | 40b38190aeff5d5b970c8cbf43e8781634b38028 | [
"MIT",
"Unlicense"
] | null | null | null | backend_server/backend_globals.py | MSNLAB/SmartEye | 40b38190aeff5d5b970c8cbf43e8781634b38028 | [
"MIT",
"Unlicense"
] | 2 | 2021-10-31T05:14:24.000Z | 2022-03-25T18:53:49.000Z |
global loaded_model
| 5.5 | 19 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
02842784fc821e743357ee9efac57212bf1f6827 | 326 | py | Python | src/utils.py | fabiob/wwwsqldesigner-aws | 5518eae682e8228be30b094c6015054b3cddf8f3 | [
"MIT"
] | null | null | null | src/utils.py | fabiob/wwwsqldesigner-aws | 5518eae682e8228be30b094c6015054b3cddf8f3 | [
"MIT"
] | null | null | null | src/utils.py | fabiob/wwwsqldesigner-aws | 5518eae682e8228be30b094c6015054b3cddf8f3 | [
"MIT"
] | 1 | 2021-04-04T09:41:51.000Z | 2021-04-04T09:41:51.000Z | from .env import S3_PREFIX
def respond(body=None, mime="text/plain", code=200, headers={}):
h = {"Content-Type": mime}
h.update(headers)
return {"statusCode": code, "body": body, "headers": h}
def fn(keyword):
return f'{S3_PREFIX}{keyword}.xml'
def fix(filename):
return filename[len(S3_PREFIX... | 20.375 | 64 | 0.650307 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 80 | 0.245399 |
028456bd34d14ef1d7f23ca7f443c4b9f0404a35 | 4,071 | py | Python | waferscreen/inst_control/inactive/agilent_34970A.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | 1 | 2021-07-30T19:06:07.000Z | 2021-07-30T19:06:07.000Z | waferscreen/inst_control/inactive/agilent_34970A.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | 8 | 2021-04-22T20:47:48.000Z | 2021-07-30T19:06:01.000Z | waferscreen/inst_control/inactive/agilent_34970A.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | null | null | null | import serial
class Agilent34970A:
def __init__(self):
self.timeout = 10
self.baudrate = 4800
self.bytesize = serial.EIGHTBITS
self.parity = serial.PARITY_NONE
self.stopbits = serial.STOPBITS_ONE
xonxoff = True
self.s = serial.Serial(port='/dev/ttyUSB3', time... | 39.911765 | 119 | 0.503316 | 4,055 | 0.99607 | 0 | 0 | 0 | 0 | 0 | 0 | 578 | 0.14198 |
0285c8a2ee84e232d1b5d465f4047d255ab9153e | 2,318 | py | Python | force_wfmanager/gui/tests/test_click_run.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 1 | 2019-08-19T16:02:20.000Z | 2019-08-19T16:02:20.000Z | force_wfmanager/gui/tests/test_click_run.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 396 | 2017-07-18T15:19:55.000Z | 2021-05-03T06:23:06.000Z | force_wfmanager/gui/tests/test_click_run.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 2 | 2019-03-05T16:23:10.000Z | 2020-04-16T08:59:11.000Z | # (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
import unittest
import sys
import os
from unittest import mock
from click.testing import CliRunner
import force_wfmanager.gui.run
from force_wfmanager.tests.dummy_classes.dummy_wfmanager import \
DummyWfManager
from force_wfmanager.ve... | 34.088235 | 74 | 0.615617 | 1,831 | 0.789905 | 0 | 0 | 0 | 0 | 0 | 0 | 228 | 0.098361 |
0286818653d925685a7dbe2ea01784b7a5521b18 | 675 | py | Python | menu.py | shaolinbertrand/RPG | 77292c54baa14baf9e09d036be67592bb8f2c093 | [
"MIT"
] | null | null | null | menu.py | shaolinbertrand/RPG | 77292c54baa14baf9e09d036be67592bb8f2c093 | [
"MIT"
] | null | null | null | menu.py | shaolinbertrand/RPG | 77292c54baa14baf9e09d036be67592bb8f2c093 | [
"MIT"
] | null | null | null | from cadastrarJogador import cadastra_jogador
from cadastrarMonstros import cadastra_monstro
from atualizaJogador import atualiza
from combate import combate_iniciado
while True:
print('Bem vindo ao RPG selecione a opção desenjada')
print('[0] - Cadastrar Novo Jogador\n[1] - Atualizar Jogador\n[2] - Cadastrar N... | 33.75 | 138 | 0.665185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 235 | 0.345081 |
02869a45220bc3cd768ae9f192b46417fa96c690 | 4,354 | py | Python | plugin_manager/accounts/models.py | ahharu/plugin-manager | 43d5e2c6e25ed8f50eedf7fd876fbc04f75d94bb | [
"MIT"
] | null | null | null | plugin_manager/accounts/models.py | ahharu/plugin-manager | 43d5e2c6e25ed8f50eedf7fd876fbc04f75d94bb | [
"MIT"
] | null | null | null | plugin_manager/accounts/models.py | ahharu/plugin-manager | 43d5e2c6e25ed8f50eedf7fd876fbc04f75d94bb | [
"MIT"
] | null | null | null | """
Custom user model for deployments.
"""
import urllib
import hashlib
import base64
import random
from authtools.models import AbstractEmailUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models.signals import post_save
from .managers import DeployUserManage... | 29.221477 | 78 | 0.595315 | 3,312 | 0.76068 | 0 | 0 | 158 | 0.036288 | 0 | 0 | 949 | 0.21796 |
02871af56c42a72cf7ba11b3dac2fc5de68923f2 | 1,007 | py | Python | heads/fc1024_normalize.py | ahmdtaha/tf_retrieval_baseline | 31b1588f888cecc1d4287f77bd046314956482d5 | [
"Apache-2.0"
] | 37 | 2019-06-01T02:11:48.000Z | 2021-12-31T06:27:42.000Z | heads/fc1024_normalize.py | ahmdtaha/tf_retrieval_baseline | 31b1588f888cecc1d4287f77bd046314956482d5 | [
"Apache-2.0"
] | 1 | 2019-06-21T03:20:59.000Z | 2019-09-03T14:20:04.000Z | heads/fc1024_normalize.py | ahmdtaha/tf_retrieval_baseline | 31b1588f888cecc1d4287f77bd046314956482d5 | [
"Apache-2.0"
] | 6 | 2019-10-11T10:21:56.000Z | 2022-03-09T06:22:57.000Z | import tensorflow as tf
from tensorflow.contrib import slim
def head(endpoints, embedding_dim, is_training, weights_regularizer=None):
predict_var = 0
input = endpoints['model_output']
endpoints['head_output'] = slim.fully_connected(
input, 1024, normalizer_fn=slim.batch_norm,
normalizer_pa... | 33.566667 | 105 | 0.675273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 184 | 0.182721 |
02875f5951726e518af5547e018727a57f4c2846 | 1,144 | py | Python | vendor/github.com/elastic/beats/topbeat/tests/system/test_base.py | ninjasftw/libertyproxybeat | b8acafe86ad285f091bf69b59d2ebd1da80dcf5e | [
"Apache-2.0"
] | 37 | 2016-01-25T10:52:59.000Z | 2021-05-08T11:44:39.000Z | vendor/github.com/elastic/beats/topbeat/tests/system/test_base.py | ninjasftw/libertyproxybeat | b8acafe86ad285f091bf69b59d2ebd1da80dcf5e | [
"Apache-2.0"
] | 35 | 2016-01-25T09:19:28.000Z | 2017-11-20T23:29:35.000Z | vendor/github.com/elastic/beats/topbeat/tests/system/test_base.py | ninjasftw/libertyproxybeat | b8acafe86ad285f091bf69b59d2ebd1da80dcf5e | [
"Apache-2.0"
] | 23 | 2016-01-25T09:15:05.000Z | 2020-12-14T06:08:31.000Z | from topbeat import BaseTest
import os
import shutil
import time
"""
Contains tests for base config
"""
class Test(BaseTest):
def test_invalid_config(self):
"""
Checks stop when input and topbeat defined
"""
shutil.copy("./config/topbeat-input-invalid.yml",
os... | 28.6 | 79 | 0.612762 | 1,035 | 0.90472 | 0 | 0 | 0 | 0 | 0 | 0 | 480 | 0.41958 |
0289963af258cded39c2b0dcfaad0d26f59c24b0 | 7,133 | py | Python | JapanSize.py | AleksanderLidtke/XKCD | 47c5029d9737390a910184adc66efc1347b84441 | [
"MIT"
] | null | null | null | JapanSize.py | AleksanderLidtke/XKCD | 47c5029d9737390a910184adc66efc1347b84441 | [
"MIT"
] | null | null | null | JapanSize.py | AleksanderLidtke/XKCD | 47c5029d9737390a910184adc66efc1347b84441 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Throughout my travels I've discovered that most people, including myself, do not
realise many things about our Planet's size. For example, the latitude and
longitude of certain regions (South America is much further east than the US)
or the relative size of countries (Japan is surprisingly l... | 43.493902 | 91 | 0.728305 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,550 | 0.357493 |
028a79224d1b3b0d7d2cc26a3b2408f89ff5f8c5 | 7,252 | py | Python | lstm_toyexample.py | dsriaditya999/LSTM-Toy-Example | 850f7923122b547c1fd25b3b1dc739e8c5db2570 | [
"MIT"
] | null | null | null | lstm_toyexample.py | dsriaditya999/LSTM-Toy-Example | 850f7923122b547c1fd25b3b1dc739e8c5db2570 | [
"MIT"
] | null | null | null | lstm_toyexample.py | dsriaditya999/LSTM-Toy-Example | 850f7923122b547c1fd25b3b1dc739e8c5db2570 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Importing Libraries
"""
# Commented out IPython magic to ensure Python compatibility.
import torch
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import torch.nn as nn
from tqdm import tqdm_notebook
from sklearn.preprocessing import MinMaxScaler... | 34.046948 | 212 | 0.734694 | 1,387 | 0.191258 | 0 | 0 | 0 | 0 | 0 | 0 | 3,469 | 0.478351 |
028b6c5908aab150cc0d4d671ccfb977919ebe32 | 22,929 | py | Python | api/chat.py | Jecosine/blivechat | d398e4913e0c76d93d3f5402938dc59ea1424ec6 | [
"MIT"
] | null | null | null | api/chat.py | Jecosine/blivechat | d398e4913e0c76d93d3f5402938dc59ea1424ec6 | [
"MIT"
] | null | null | null | api/chat.py | Jecosine/blivechat | d398e4913e0c76d93d3f5402938dc59ea1424ec6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import asyncio
import enum
import json
import logging
import random
import time
import uuid
from typing import *
import aiohttp
import tornado.websocket
import api.base
import blivedm.blivedm as blivedm
import config
import models.avatar
import models.translate
import models.log
logger = logg... | 34.019288 | 111 | 0.584326 | 21,544 | 0.925469 | 0 | 0 | 2,325 | 0.099875 | 12,763 | 0.548262 | 3,863 | 0.165944 |
65f43d030f26c2fcb657f044a4435543df49146f | 954 | py | Python | gan.py | AtlantixJJ/LBSGAN | e91d500d4a9c02dd5e3bfcbd9a9eca96dc60102a | [
"BSD-2-Clause"
] | 1 | 2019-06-09T02:43:35.000Z | 2019-06-09T02:43:35.000Z | gan.py | AtlantixJJ/LBSGAN | e91d500d4a9c02dd5e3bfcbd9a9eca96dc60102a | [
"BSD-2-Clause"
] | null | null | null | gan.py | AtlantixJJ/LBSGAN | e91d500d4a9c02dd5e3bfcbd9a9eca96dc60102a | [
"BSD-2-Clause"
] | null | null | null | import argparse
import os
import sys
import time
import torch
import torch.nn.functional as F
import torchvision
import models, lib
cfg = lib.config.BaseConfig()
cfg.parse()
print('Preparing model')
gen_model = cfg.gen_function(
upsample=cfg.upsample,
map_size=cfg.map_size,
out_dim=cfg.out_dim)
disc_model... | 24.461538 | 111 | 0.765199 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0.051363 |
65f47a4c6cbf9c3cbfef8996d91a66023d1ce4f0 | 1,475 | py | Python | leetcode/minimumAreaRectangle.py | federicoemartinez/problem_solving | d0352f76bc21ed67d6851a159a00f70a892934b9 | [
"MIT"
] | null | null | null | leetcode/minimumAreaRectangle.py | federicoemartinez/problem_solving | d0352f76bc21ed67d6851a159a00f70a892934b9 | [
"MIT"
] | null | null | null | leetcode/minimumAreaRectangle.py | federicoemartinez/problem_solving | d0352f76bc21ed67d6851a159a00f70a892934b9 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/minimum-area-rectangle/description/
"""
Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes.
If there isn't any rectangle, return 0.
Example 1:
Input: [[1,1],[1,3],[3,1],[3,3],[2,2]]
Outp... | 27.314815 | 147 | 0.553898 | 887 | 0.601356 | 0 | 0 | 0 | 0 | 0 | 0 | 583 | 0.395254 |
65f96718aa17ce886b225fbdf113223d6df0b594 | 3,002 | py | Python | code/google_sheet_writing.py | BastinFlorian/BoondManager-Auto-Holidays-Validation | 28ae01d997132745018666952829771d5f8d99a3 | [
"MIT"
] | null | null | null | code/google_sheet_writing.py | BastinFlorian/BoondManager-Auto-Holidays-Validation | 28ae01d997132745018666952829771d5f8d99a3 | [
"MIT"
] | 18 | 2020-03-24T17:24:10.000Z | 2022-03-12T00:29:56.000Z | code/google_sheet_writing.py | BastinFlorian/BoondManager-Auto-Holidays-Validation | 28ae01d997132745018666952829771d5f8d99a3 | [
"MIT"
] | null | null | null | '''Functions writing the needed informations in the google drive spreadsheet
From CP, RTT and holidays request : create a worksheet per employee --
write_info_in_worksheet(info_paie, out_attente, out_valide, name, sh, problemes_date, problemes_type_conge)
'''
from google_sheet_access import *
# Write in worksheet a... | 37.061728 | 112 | 0.651899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 478 | 0.159015 |
65f9d6849276abc9d2abce58b864383e8eca894c | 531 | py | Python | madlib.py | Yukthi-C/python_learing | 340579e2bb767e8fdb209f705fdf12058e8e150f | [
"MIT"
] | null | null | null | madlib.py | Yukthi-C/python_learing | 340579e2bb767e8fdb209f705fdf12058e8e150f | [
"MIT"
] | null | null | null | madlib.py | Yukthi-C/python_learing | 340579e2bb767e8fdb209f705fdf12058e8e150f | [
"MIT"
] | null | null | null | ad1 = input(f"Adjective1: ")
ad2 = input(f"Adjective2: ")
part1 = input(f"body part: ")
dish = input(f"Dish: ")
madlib=f"One day, a {ad1} fox invited a stork for dinner. \
Stork was very {ad2} with the invitation – she reached the fox’s home on time and knocked at the door with her {part1}.\
The fox took her to t... | 59 | 121 | 0.706215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 458 | 0.852886 |
65fb489a3669c5076b79a0d2bdaf7df0aec3faeb | 3,114 | py | Python | algofi/v1/send_keyreg_online_transaction.py | Algofiorg/algofi-py-sdk | 6100a6726d36db4d4d3287064f0ad1d0b9a05e03 | [
"MIT"
] | 38 | 2021-12-30T02:32:57.000Z | 2022-03-23T22:09:16.000Z | algofi/v1/send_keyreg_online_transaction.py | Algofiorg/algofi-py-sdk | 6100a6726d36db4d4d3287064f0ad1d0b9a05e03 | [
"MIT"
] | 4 | 2021-11-03T00:14:46.000Z | 2022-03-28T02:17:33.000Z | algofi/v1/send_keyreg_online_transaction.py | Algofiorg/algofi-py-sdk | 6100a6726d36db4d4d3287064f0ad1d0b9a05e03 | [
"MIT"
] | 8 | 2021-12-15T05:29:55.000Z | 2022-02-08T03:45:11.000Z |
from algosdk.future.transaction import ApplicationNoOpTxn
from .prepend import get_init_txns
from ..utils import Transactions, TransactionGroup, int_to_bytes
from ..contract_strings import algofi_manager_strings as manager_strings
def prepare_send_keyreg_online_transactions(sender, suggested_params, storage_account,... | 48.65625 | 168 | 0.756583 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,777 | 0.570649 |
65fdd0400541291beac65b8a408eaf8121f2b56b | 402 | py | Python | server/resources/platform.py | simon-dube/CARMIN-server | 1481d2c4231458d33119c57ab2e3e480375da63b | [
"MIT"
] | 1 | 2018-03-12T23:08:12.000Z | 2018-03-12T23:08:12.000Z | server/resources/platform.py | simon-dube/CARMIN-server | 1481d2c4231458d33119c57ab2e3e480375da63b | [
"MIT"
] | 15 | 2018-03-15T04:23:31.000Z | 2018-06-28T21:46:15.000Z | server/resources/platform.py | simon-dube/CARMIN-server | 1481d2c4231458d33119c57ab2e3e480375da63b | [
"MIT"
] | null | null | null | from flask_restful import Resource
from server.platform_properties import PLATFORM_PROPERTIES
from server.resources.models.platform_properties import PlatformPropertiesSchema
from server.resources.decorators import marshal_response
class Platform(Resource):
@marshal_response(PlatformPropertiesSchema())
def ge... | 36.545455 | 80 | 0.840796 | 167 | 0.415423 | 0 | 0 | 137 | 0.340796 | 0 | 0 | 0 | 0 |
65febfc830676365453c5d43b397d3e86ac87c5f | 471 | py | Python | invenio_flow/decorators.py | egabancho/invenio-flow | 583e55d17ab6aabd20bc4a46d098f034c0d0f693 | [
"MIT"
] | null | null | null | invenio_flow/decorators.py | egabancho/invenio-flow | 583e55d17ab6aabd20bc4a46d098f034c0d0f693 | [
"MIT"
] | null | null | null | invenio_flow/decorators.py | egabancho/invenio-flow | 583e55d17ab6aabd20bc4a46d098f034c0d0f693 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Esteban J. G. Gabancho.
#
# Invenio-Flow is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Useful decorators."""
from celery import shared_task
from .api import Task
def task(*args, ... | 23.55 | 73 | 0.694268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 303 | 0.643312 |
65ff6cff89c7853c15b51290646017146b4909fa | 2,460 | py | Python | backend/offchain/types/fund_pull_pre_approval_types.py | tanshuai/reference-wallet | e8efec4acc6af6e319cf075c10693ddf7754cc83 | [
"Apache-2.0"
] | 14 | 2020-12-17T08:03:51.000Z | 2022-03-26T04:21:18.000Z | backend/offchain/types/fund_pull_pre_approval_types.py | tanshuai/reference-wallet | e8efec4acc6af6e319cf075c10693ddf7754cc83 | [
"Apache-2.0"
] | 20 | 2020-12-15T12:02:56.000Z | 2021-05-19T23:37:34.000Z | backend/offchain/types/fund_pull_pre_approval_types.py | tanshuai/reference-wallet | e8efec4acc6af6e319cf075c10693ddf7754cc83 | [
"Apache-2.0"
] | 12 | 2020-12-10T16:35:27.000Z | 2022-02-01T04:06:10.000Z | import typing
from dataclasses import dataclass, field as datafield
from .command_types import CommandType
class FundPullPreApprovalStatus:
# Pending user/VASP approval
pending = "pending"
# Approved by the user/VASP and ready for use
valid = "valid"
# User/VASP did not approve the pre-approval ... | 27.032967 | 88 | 0.681301 | 2,207 | 0.897154 | 0 | 0 | 1,806 | 0.734146 | 0 | 0 | 371 | 0.150813 |
65ffb62169d811cc14af150c5eafa69ec8772792 | 19,924 | py | Python | data/battle_animation_scripts.py | kielbasiago/WorldsCollide | 5aa7cffdecd14754c9eaa83cd0ad4d0282cc2cc2 | [
"MIT"
] | 7 | 2022-01-15T02:53:53.000Z | 2022-02-17T00:51:32.000Z | data/battle_animation_scripts.py | asilverthorn/WorldsCollide | 5aa7cffdecd14754c9eaa83cd0ad4d0282cc2cc2 | [
"MIT"
] | 8 | 2022-01-16T02:45:24.000Z | 2022-03-21T02:08:27.000Z | data/battle_animation_scripts.py | asilverthorn/WorldsCollide | 5aa7cffdecd14754c9eaa83cd0ad4d0282cc2cc2 | [
"MIT"
] | 5 | 2022-01-15T02:53:38.000Z | 2022-01-19T17:42:10.000Z | # List of addresses within the Battle Animation Scripts for the following commands which cause screen flashes:
# B0 - Set background palette color addition (absolute)
# B5 - Add color to background palette (relative)
# AF - Set background palette color subtraction (absolute)
# B6 - Subtract color from backgroun... | 58.428152 | 133 | 0.630546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14,428 | 0.724152 |
65ffed323033ff0ac5225d3d784dead8adf418b4 | 2,643 | py | Python | Jumpscale/tools/capacity/reality_parser.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 2 | 2019-05-09T07:21:25.000Z | 2019-08-05T06:37:53.000Z | Jumpscale/tools/capacity/reality_parser.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 664 | 2018-12-19T12:43:44.000Z | 2019-08-23T04:24:42.000Z | Jumpscale/tools/capacity/reality_parser.py | threefoldtech/jumpscale10 | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 7 | 2019-05-03T07:14:37.000Z | 2019-08-05T12:36:52.000Z | """
this module contain the logic of parsing the actual usage of the ressource unit of a zero-os node
"""
from .units import GiB
from sal_zos.disks.Disks import StorageType
class RealityParser:
def __init__(self):
self._ressources = {"mru": 0.0, "cru": 0.0, "hru": 0.0, "sru": 0.0}
def get_report(sel... | 26.69697 | 97 | 0.626182 | 1,091 | 0.412788 | 0 | 0 | 212 | 0.080212 | 0 | 0 | 523 | 0.197881 |
5a01dafbd8cdef4d174904ccd475a2627ada858d | 3,314 | py | Python | fsem/similarity_measures/jaro.py | sajith-rahim/fs-em | 2e8dde8b5f36ee1e1dfc5407611ec2fb91630c2a | [
"BSD-3-Clause"
] | null | null | null | fsem/similarity_measures/jaro.py | sajith-rahim/fs-em | 2e8dde8b5f36ee1e1dfc5407611ec2fb91630c2a | [
"BSD-3-Clause"
] | null | null | null | fsem/similarity_measures/jaro.py | sajith-rahim/fs-em | 2e8dde8b5f36ee1e1dfc5407611ec2fb91630c2a | [
"BSD-3-Clause"
] | null | null | null | import math
__all__ = ['get_jaro_distance']
__author__ = 'Jean-Bernard Ratte - [email protected]'
""" Find the Jaro Winkler Distance which indicates the similarity score between two Strings.
The Jaro measure is the weighted sum of percentage of matched characters from each file and transposed characters... | 31.561905 | 118 | 0.658117 | 125 | 0.037719 | 0 | 0 | 0 | 0 | 0 | 0 | 1,130 | 0.340978 |
5a0258dc0630fde008fae59e8ca2f2322000aca2 | 732 | py | Python | UnitTests/FullAtomModel/PDB2Coords/test.py | dendisuhubdy/TorchProteinLibrary | 89f0f6c311658b9313484cd92804682a251b1b97 | [
"MIT"
] | null | null | null | UnitTests/FullAtomModel/PDB2Coords/test.py | dendisuhubdy/TorchProteinLibrary | 89f0f6c311658b9313484cd92804682a251b1b97 | [
"MIT"
] | null | null | null | UnitTests/FullAtomModel/PDB2Coords/test.py | dendisuhubdy/TorchProteinLibrary | 89f0f6c311658b9313484cd92804682a251b1b97 | [
"MIT"
] | null | null | null | import sys
import os
import matplotlib.pylab as plt
import numpy as np
import mpl_toolkits.mplot3d.axes3d as p3
import seaborn as sea
import torch
from TorchProteinLibrary import FullAtomModel
if __name__=='__main__':
# p2c = FullAtomModel.PDB2Coords.PDB2CoordsBiopython()
p2c = FullAtomModel.PDB2CoordsUnorde... | 24.4 | 58 | 0.674863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.110656 |
5a025cdbfc11bf834d39b1a16efe1582cdd5e329 | 4,306 | py | Python | vae/scripts/gm_vae_fc_toy.py | ondrejba/vae | 23f179637ca45c20d4e5f74e8c56b62f57554ef4 | [
"MIT"
] | 1 | 2019-11-23T20:51:58.000Z | 2019-11-23T20:51:58.000Z | vae/scripts/gm_vae_fc_toy.py | ondrejba/vae | 23f179637ca45c20d4e5f74e8c56b62f57554ef4 | [
"MIT"
] | null | null | null | vae/scripts/gm_vae_fc_toy.py | ondrejba/vae | 23f179637ca45c20d4e5f74e8c56b62f57554ef4 | [
"MIT"
] | 1 | 2021-12-01T07:29:39.000Z | 2021-12-01T07:29:39.000Z | import argparse
import collections
import os
import numpy as np
import matplotlib.pyplot as plt
from .. import toy_dataset
from .. import gm_vae_fc
def main(args):
# gpu settings
if args.gpus is not None:
os.environ["CUDA_VISIBLE_DEVICES"] = args.gpus
# generate and show dataset
train_data =... | 31.202899 | 107 | 0.65699 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 691 | 0.160474 |
5a042bec8f40b0fa98c21fc7bd7c2df868d70903 | 520 | py | Python | Python/354.py | JWang169/LintCodeJava | b75b06fa1551f5e4d8a559ef64e1ac29db79c083 | [
"CNRI-Python"
] | 1 | 2020-12-10T05:36:15.000Z | 2020-12-10T05:36:15.000Z | Python/354.py | JWang169/LintCodeJava | b75b06fa1551f5e4d8a559ef64e1ac29db79c083 | [
"CNRI-Python"
] | null | null | null | Python/354.py | JWang169/LintCodeJava | b75b06fa1551f5e4d8a559ef64e1ac29db79c083 | [
"CNRI-Python"
] | 3 | 2020-04-06T05:55:08.000Z | 2021-08-29T14:26:54.000Z | class Solution:
def maxEnvelopes(self, envelopes: List[List[int]]) -> int:
if not envelopes:
return 0
pairs = sorted(envelopes, key=lambda x: (x[0], -x[1]))
result = []
for pair in pairs:
height = pair[1]
if len(result) == 0 or height > result[-1]... | 34.666667 | 62 | 0.492308 | 503 | 0.967308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a054c6f2f48cad9dc180b59f6e0034f5b144f73 | 331 | py | Python | codes/day06/03.py | Youngfellows/HPyBaseCode | 94d11872795d85b8c4387b650e82edcd20da0667 | [
"Apache-2.0"
] | null | null | null | codes/day06/03.py | Youngfellows/HPyBaseCode | 94d11872795d85b8c4387b650e82edcd20da0667 | [
"Apache-2.0"
] | null | null | null | codes/day06/03.py | Youngfellows/HPyBaseCode | 94d11872795d85b8c4387b650e82edcd20da0667 | [
"Apache-2.0"
] | null | null | null | class Dog:
def __init__(self, newColor):
self.color = newColor
def bark(self):
print("---旺旺叫----")
def printColor(self):
print("颜色为:%s"%self.color)
def test(AAA):
AAA.printColor()
wangcai = Dog("白")
#wangcai.printColor()
xiaoqiang = Dog("黑")
#xiaoqiang.printColor()
tes... | 15.045455 | 34 | 0.592145 | 203 | 0.581662 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.252149 |
5a05e2efcbe249cfc654b1e6e98561ecca3c15b5 | 1,158 | py | Python | LC_problems/699.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/699.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/699.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 699.py
@Contact : [email protected]
@Modify Time : 2022/5/26 17:22
------------
"""
from typing import List
class Solution:
def fallingSquares(self, positions: List[List[int]]) -> List[int]:
height = [p[1] for p in pos... | 28.95 | 105 | 0.443005 | 857 | 0.740069 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.209845 |
5a05e7be3fed210c95055f9564a15535552003ac | 5,150 | py | Python | plastid/test/functional/test_metagene.py | joshuagryphon/plastid | e63a818e33766b01d84b3ac9bc9f55e6a1ece42f | [
"BSD-3-Clause"
] | 31 | 2016-04-05T09:58:29.000Z | 2022-01-18T11:58:30.000Z | plastid/test/functional/test_metagene.py | joshuagryphon/plastid | e63a818e33766b01d84b3ac9bc9f55e6a1ece42f | [
"BSD-3-Clause"
] | 49 | 2015-09-15T19:50:13.000Z | 2022-01-06T18:17:35.000Z | plastid/test/functional/test_metagene.py | joshuagryphon/plastid | e63a818e33766b01d84b3ac9bc9f55e6a1ece42f | [
"BSD-3-Clause"
] | 14 | 2017-02-08T09:38:57.000Z | 2020-09-16T02:32:46.000Z | #!/usr/bin/env python
"""Test suite for :py:mod:`plastid.bin.metagene`"""
import tempfile
import os
from pkg_resources import resource_filename, cleanup_resources
from nose.plugins.attrib import attr
from plastid.test.functional.base import execute_helper
from plastid.test.ref_files import (
RPATH,
REF_FILES,
... | 39.615385 | 100 | 0.594175 | 0 | 0 | 77 | 0.014951 | 122 | 0.023689 | 0 | 0 | 2,981 | 0.578835 |
5a0619271eef494f524dc719a9ba4f63c1373613 | 4,967 | py | Python | tests/router/test_router.py | macneiln/ombott | f18f6e0e639f20efb63b137edbab8c8b3871d354 | [
"MIT"
] | null | null | null | tests/router/test_router.py | macneiln/ombott | f18f6e0e639f20efb63b137edbab8c8b3871d354 | [
"MIT"
] | null | null | null | tests/router/test_router.py | macneiln/ombott | f18f6e0e639f20efb63b137edbab8c8b3871d354 | [
"MIT"
] | null | null | null | import pytest
from ombott.router import RadiRouter, Route
from ombott.router.errors import RouteMethodError
route_meth_handler_path = [
('/foo/bar', 'GET', 'foo_bar:get', '/foo/bar'),
('/foo/bar', 'POST', 'foo_bar:post', '/foo/bar/'),
('/foo/bar', ['PUT', 'PATCH'], 'foo_bar:put,patch', 'foo/bar'),
('f... | 29.742515 | 92 | 0.582444 | 1,385 | 0.27884 | 0 | 0 | 850 | 0.171129 | 0 | 0 | 934 | 0.188041 |
5a06baf447f7c7644ae324b314d4d848bee4ba67 | 12,225 | py | Python | app_api/serializers.py | pkucsie/SIEPServer | 00b0637eb8302135dfc772fccd18cd749a93e5c6 | [
"Apache-2.0"
] | 2 | 2021-02-12T10:02:42.000Z | 2021-03-15T13:08:04.000Z | app_api/serializers.py | pkucsie/SIEPServer | 00b0637eb8302135dfc772fccd18cd749a93e5c6 | [
"Apache-2.0"
] | null | null | null | app_api/serializers.py | pkucsie/SIEPServer | 00b0637eb8302135dfc772fccd18cd749a93e5c6 | [
"Apache-2.0"
] | null | null | null | import datetime
import time
from utils import utils
from rest_framework import serializers
from rest_framework.relations import StringRelatedField
from app_api.models import Album, Info, Order, Coupon, Integral, Notice, Lesson, Question, Cart, Setup, User, Bill, Address, Catalog, Log, \
ReadType, Teacher, Commen... | 23.41954 | 140 | 0.674683 | 11,203 | 0.916401 | 0 | 0 | 612 | 0.050061 | 0 | 0 | 954 | 0.078037 |
5a07b3f93f0df160b35b13e2ca081e2f2413ce44 | 718 | py | Python | 6_API/pytorch/configure.py | misoA/DeepCalendar | 50cafc1e70f125f3b6b42cd88e1e9dd071676b49 | [
"MIT"
] | null | null | null | 6_API/pytorch/configure.py | misoA/DeepCalendar | 50cafc1e70f125f3b6b42cd88e1e9dd071676b49 | [
"MIT"
] | 3 | 2019-01-14T06:59:24.000Z | 2019-01-14T07:48:38.000Z | 6_API/pytorch/configure.py | misoA/DeepCalendar | 50cafc1e70f125f3b6b42cd88e1e9dd071676b49 | [
"MIT"
] | 5 | 2019-01-08T05:01:26.000Z | 2021-05-17T23:34:51.000Z | # -*- coding: utf-8 -*-
# This file is made to configure every file number at one place
# Choose the place you are training at
# AWS : 0, Own PC : 1
PC = 1
path_list = ["/jet/prs/workspace/", "."]
url = path_list[PC]
clothes = ['shirt',
'jeans',
'blazer',
'chino-pants',
'jacket'... | 17.95 | 63 | 0.431755 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 371 | 0.516713 |
5a0835b17e7c0f765c8aa93d7341da5395fe71d2 | 32 | py | Python | provider/__init__.py | depop/django-oauth2-provider | afcdef72747233dc0259a4bc068a8086ba7a69d3 | [
"MIT"
] | 1 | 2020-05-10T00:11:05.000Z | 2020-05-10T00:11:05.000Z | provider/__init__.py | depop/django-oauth2-provider | afcdef72747233dc0259a4bc068a8086ba7a69d3 | [
"MIT"
] | 1 | 2016-05-23T15:22:41.000Z | 2016-05-23T15:22:41.000Z | provider/__init__.py | depop/django-oauth2-provider | afcdef72747233dc0259a4bc068a8086ba7a69d3 | [
"MIT"
] | null | null | null | __version__ = "0.2.7+depop.6.1"
| 16 | 31 | 0.65625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.53125 |
5a0841fa1b97d80f5fc2c97be82b59ce57dfb2d4 | 7,381 | py | Python | python/craftassist/voxel_models/subcomponent_classifier.py | kayburns/craftassist | 07909493d320afc2c9ff428d0891bc3acd4dc68f | [
"MIT"
] | null | null | null | python/craftassist/voxel_models/subcomponent_classifier.py | kayburns/craftassist | 07909493d320afc2c9ff428d0891bc3acd4dc68f | [
"MIT"
] | null | null | null | python/craftassist/voxel_models/subcomponent_classifier.py | kayburns/craftassist | 07909493d320afc2c9ff428d0891bc3acd4dc68f | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import logging
import queue
from multiprocessing import Queue, Process
import sys
import os
from mc_memory_nodes import InstSegNode, PropSegNode
from heuristic_perception import all_nearby_objects
from shapes import get_bounds
VISION_DIR = os.path.dirname(os.pa... | 38.243523 | 116 | 0.582441 | 6,731 | 0.911442 | 0 | 0 | 0 | 0 | 0 | 0 | 1,941 | 0.26283 |
5a0b2d031fe808c99bfba67eaa85c3e839cc5992 | 197 | py | Python | tests/test_problem16.py | nolanwrightdev/blind-75-python | b92ef3449eb0143c760ddd339897a3f0a2972830 | [
"MIT"
] | 6 | 2020-02-01T23:29:51.000Z | 2022-02-20T20:46:56.000Z | tests/test_problem16.py | nolanwrightdev/blind-75-python | b92ef3449eb0143c760ddd339897a3f0a2972830 | [
"MIT"
] | null | null | null | tests/test_problem16.py | nolanwrightdev/blind-75-python | b92ef3449eb0143c760ddd339897a3f0a2972830 | [
"MIT"
] | null | null | null | import unittest
from problems.problem16 import solution
class Test(unittest.TestCase):
def test(self):
self.assertTrue(solution([2, 3, 1, 1, 4]))
self.assertFalse(solution([3, 2, 1, 0, 4]))
| 21.888889 | 45 | 0.71066 | 138 | 0.700508 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a0b50f8318c63395085bc807823eccbb8a5e4b9 | 510 | py | Python | project/dynamic.py | andresitodeguzman/smspy | 29b9feb4356de5dbd1a5d222d38d45396a349d23 | [
"Apache-2.0"
] | 4 | 2017-01-27T05:15:09.000Z | 2020-12-08T13:24:19.000Z | project/dynamic.py | andresitodeguzman/smspy | 29b9feb4356de5dbd1a5d222d38d45396a349d23 | [
"Apache-2.0"
] | 1 | 2019-05-20T15:09:53.000Z | 2019-05-20T15:09:53.000Z | project/dynamic.py | andresitodeguzman/smspy | 29b9feb4356de5dbd1a5d222d38d45396a349d23 | [
"Apache-2.0"
] | null | null | null | ##
## DYNAMIC
##
## Import the module explicitly (import dynamics.<module_name> as module_name)
import dynamics.root as root
## Register all modules for checking here. If something interferes, rearrange the order
## module_name_ = module_name.do(params)
def responseQuery(number, body):
# Available params
... | 21.25 | 88 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 295 | 0.578431 |
5a0bac916180eec03144ad684ddb2ec3547f8ee7 | 288 | py | Python | accounts/urls.py | mishrakeshav/Django-Real-Estate-Website | 4f6146ad8d13003f890677c2c1af82b26c69678b | [
"MIT"
] | null | null | null | accounts/urls.py | mishrakeshav/Django-Real-Estate-Website | 4f6146ad8d13003f890677c2c1af82b26c69678b | [
"MIT"
] | 7 | 2021-04-08T20:21:35.000Z | 2022-01-13T03:27:33.000Z | accounts/urls.py | mishrakeshav/Django-Real-Estate-Website | 4f6146ad8d13003f890677c2c1af82b26c69678b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('login', views.login, name = 'login'),
path('register', views.register, name = 'register'),
path('logout', views.logout, name = 'logout'),
path('dashboard', views.dashboard, name = 'dashboard'),
] | 28.8 | 59 | 0.645833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 0.25 |
5a0e378937b9fd8ab97a5e345d693d92224ab800 | 4,333 | py | Python | src/past/types/oldstr.py | kianmeng/python-future | 80523f383fbba1c6de0551e19d0277e73e69573c | [
"MIT"
] | 908 | 2015-01-01T21:20:45.000Z | 2022-03-29T20:47:16.000Z | src/past/types/oldstr.py | kianmeng/python-future | 80523f383fbba1c6de0551e19d0277e73e69573c | [
"MIT"
] | 402 | 2015-01-04T01:30:19.000Z | 2022-03-24T11:56:38.000Z | src/past/types/oldstr.py | kianmeng/python-future | 80523f383fbba1c6de0551e19d0277e73e69573c | [
"MIT"
] | 305 | 2015-01-18T19:29:37.000Z | 2022-03-24T09:40:09.000Z | """
Pure-Python implementation of a Python 2-like str object for Python 3.
"""
from numbers import Integral
from past.utils import PY2, with_metaclass
if PY2:
from collections import Iterable
else:
from collections.abc import Iterable
_builtin_bytes = bytes
class BaseOldStr(type):
def __instancecheck_... | 31.860294 | 95 | 0.558505 | 3,714 | 0.857143 | 0 | 0 | 62 | 0.014309 | 0 | 0 | 2,766 | 0.638357 |
5a0e75196f538319c5078d09117599bf367b0df0 | 1,208 | py | Python | app/api/utlis/models.py | jurekpawlikowski/flask-boilerplate | 15b7e6c4e0241a7d59dbca543e023a22b17b9903 | [
"MIT"
] | 3 | 2017-08-05T08:57:37.000Z | 2021-03-03T09:09:03.000Z | app/api/utlis/models.py | jurekpawlikowski/flask-boilerplate | 15b7e6c4e0241a7d59dbca543e023a22b17b9903 | [
"MIT"
] | null | null | null | app/api/utlis/models.py | jurekpawlikowski/flask-boilerplate | 15b7e6c4e0241a7d59dbca543e023a22b17b9903 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from sqlalchemy.event import listen
from app.factory import db
class BaseModel(db.Model):
"""
Base model with `created_at` and `updated_at` fields
"""
__abstract__ = True
fields_to_serialize = []
created_at = db.Col... | 23.686275 | 80 | 0.647351 | 885 | 0.732616 | 0 | 0 | 61 | 0.050497 | 0 | 0 | 163 | 0.134934 |
5a0ebed0bb4e1667aef392ee3608c9732dd33560 | 278 | py | Python | systest/tests/test_rm.py | devconsoft/pycred | d72bdae2e703a87a7424f08af326834281b83fee | [
"MIT"
] | null | null | null | systest/tests/test_rm.py | devconsoft/pycred | d72bdae2e703a87a7424f08af326834281b83fee | [
"MIT"
] | 5 | 2018-07-01T22:53:24.000Z | 2018-07-17T21:54:10.000Z | systest/tests/test_rm.py | devconsoft/pycred | d72bdae2e703a87a7424f08af326834281b83fee | [
"MIT"
] | null | null | null | def test_rm_long_opt_help(pycred):
pycred('rm --help')
def test_rm_short_opt_help(pycred):
pycred('rm -h')
def test_rm_none_existing_store_gives_exit_code_2(pycred, workspace):
with workspace():
pycred('rm non-existing-store user', expected_exit_code=2)
| 23.166667 | 69 | 0.73741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.165468 |
5a0fd6978a62253af90bdbf0d79e056e97e5921d | 1,391 | py | Python | source/tweaks/cms_plugins.py | mverleg/svsite | 5c9dbcacf81020cf0c1960e337bdd33113acd597 | [
"BSD-3-Clause"
] | null | null | null | source/tweaks/cms_plugins.py | mverleg/svsite | 5c9dbcacf81020cf0c1960e337bdd33113acd597 | [
"BSD-3-Clause"
] | 142 | 2015-06-05T07:53:09.000Z | 2020-03-31T18:37:07.000Z | source/tweaks/cms_plugins.py | mdilli/svsite | 5c9dbcacf81020cf0c1960e337bdd33113acd597 | [
"BSD-3-Clause"
] | null | null | null |
"""
Raw HTML widget.
Adapted/copied from https://github.com/makukha/cmsplugin-raw-html
"""
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.template import Template
from django.utils.safestring import mark_safe
from .models import RawHtmlModel, CMSMember
from django.utils.... | 24.839286 | 79 | 0.757009 | 918 | 0.659957 | 0 | 0 | 0 | 0 | 0 | 0 | 424 | 0.304817 |
5a1046d61cc7585c8ffb76dc65a2afa1c14d62a9 | 3,296 | py | Python | tests/test_trackings.py | EugeneLiu/aftership-sdk-python | 37184272869452734d616b31295a4ac883051f5d | [
"MIT"
] | null | null | null | tests/test_trackings.py | EugeneLiu/aftership-sdk-python | 37184272869452734d616b31295a4ac883051f5d | [
"MIT"
] | null | null | null | tests/test_trackings.py | EugeneLiu/aftership-sdk-python | 37184272869452734d616b31295a4ac883051f5d | [
"MIT"
] | null | null | null | from unittest import TestCase, mock
import pytest
from requests import Response
import aftership
class TrackingTestCase(TestCase):
def setUp(self):
self.slug = "4px"
self.tracking_number = "HH19260817"
self.tracking_id = "k5lh7dy7vvqeck71p5loe011"
@pytest.mark.vcr()
def test_cre... | 34.694737 | 116 | 0.681129 | 3,191 | 0.968143 | 0 | 0 | 2,491 | 0.755765 | 0 | 0 | 392 | 0.118932 |
5a105c110cc6114a77deee02c167af5066ada602 | 1,089 | py | Python | 071_caixaeletronico.py | laissilveira/python-exercises | 906f7e46878b296ecb9b9df9fd39ec1e362ce3a4 | [
"MIT"
] | null | null | null | 071_caixaeletronico.py | laissilveira/python-exercises | 906f7e46878b296ecb9b9df9fd39ec1e362ce3a4 | [
"MIT"
] | null | null | null | 071_caixaeletronico.py | laissilveira/python-exercises | 906f7e46878b296ecb9b9df9fd39ec1e362ce3a4 | [
"MIT"
] | null | null | null | # Calcula a quantidade de notas de cada valor a serem sacadas em uma caixa eletrônico
print('=' * 30)
print('{:^30}'.format('CAIXA ELETRÔNICO'))
print('=' * 30)
valor = int(input('Valor a ser sacado: R$ '))
# notas de real (R$) existentes
tot200 = valor // 200
tot100 = (valor % 200) // 100
tot50 = ((valor % 200) % 100)... | 36.3 | 85 | 0.543618 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 476 | 0.433515 |
5a1066f50cc73cde3a7e5f65b4cffbe41ddedc46 | 575 | py | Python | 2020/04/Teil 1 - V01.py | HeWeMel/adventofcode | 90acb10f03f21ef388673bbcf132d04972175970 | [
"MIT"
] | 1 | 2020-12-12T19:34:59.000Z | 2020-12-12T19:34:59.000Z | 2020/04/Teil 1 - V01.py | HeWeMel/adventofcode | 90acb10f03f21ef388673bbcf132d04972175970 | [
"MIT"
] | null | null | null | 2020/04/Teil 1 - V01.py | HeWeMel/adventofcode | 90acb10f03f21ef388673bbcf132d04972175970 | [
"MIT"
] | null | null | null | import sys
lines=[]
new=True
lc=0
with open('input.txt', 'r') as f:
for line in f:
line=line[:-1] # remove new line char
if line=='':
lc+=1
new=True
else:
if new:
lines.append(line)
new=False
else:
... | 19.166667 | 66 | 0.452174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.132174 |
5a10f64e9ccb60f772e7fb4e5d093560ebd8cdb4 | 9,366 | py | Python | src/falconpy/quick_scan.py | CrowdStrike/falconpy | e7245202224647a2c8d134e72f27d2f6c667a1ce | [
"Unlicense"
] | 111 | 2020-11-19T00:44:18.000Z | 2022-03-03T21:02:32.000Z | src/falconpy/quick_scan.py | CrowdStrike/falconpy | e7245202224647a2c8d134e72f27d2f6c667a1ce | [
"Unlicense"
] | 227 | 2020-12-05T03:02:27.000Z | 2022-03-22T14:12:42.000Z | src/falconpy/quick_scan.py | CrowdStrike/falconpy | e7245202224647a2c8d134e72f27d2f6c667a1ce | [
"Unlicense"
] | 47 | 2020-11-23T21:00:14.000Z | 2022-03-28T18:30:19.000Z | """Falcon Quick Scan API Interface Class
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | ... | 40.025641 | 105 | 0.604527 | 7,228 | 0.771728 | 0 | 0 | 6,303 | 0.672966 | 0 | 0 | 7,052 | 0.752936 |
5a118345944c61aa57f158d2bab247572f49c59f | 353 | py | Python | images/auth-service/settings.d/00-settings.py | ESGF/esgf-docker | 95f5b76c85be65920810795484786a13865f4ac1 | [
"Apache-2.0"
] | 3 | 2018-04-16T00:58:30.000Z | 2020-10-07T17:58:02.000Z | images/auth-service/settings.d/00-settings.py | ESGF/esgf-docker | 95f5b76c85be65920810795484786a13865f4ac1 | [
"Apache-2.0"
] | 115 | 2017-01-10T20:12:42.000Z | 2021-03-03T16:11:48.000Z | images/auth-service/settings.d/00-settings.py | ESGF/esgf-docker | 95f5b76c85be65920810795484786a13865f4ac1 | [
"Apache-2.0"
] | 21 | 2017-08-28T15:20:24.000Z | 2021-02-09T00:08:49.000Z | # Application definition
INSTALLED_APPS = [
'django.contrib.staticfiles',
'django.contrib.sessions',
'authenticate',
]
ROOT_URLCONF = 'auth_service.urls'
WSGI_APPLICATION = 'auth_service.wsgi.application'
# Use a non database session engine
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookie... | 23.533333 | 66 | 0.776204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 225 | 0.637394 |
5a12d4be2ea76f2966c05949af40280a754ab4f5 | 3,641 | py | Python | tests/test_gru.py | nsuke/hyrnn | b3efcc7b004d8402344467bf319f1d86324d11e5 | [
"Apache-2.0"
] | 73 | 2019-04-08T08:17:39.000Z | 2022-03-29T03:48:07.000Z | tests/test_gru.py | nsuke/hyrnn | b3efcc7b004d8402344467bf319f1d86324d11e5 | [
"Apache-2.0"
] | 10 | 2019-03-19T04:24:07.000Z | 2021-02-25T00:19:24.000Z | tests/test_gru.py | nsuke/hyrnn | b3efcc7b004d8402344467bf319f1d86324d11e5 | [
"Apache-2.0"
] | 14 | 2019-05-06T09:42:37.000Z | 2021-07-17T17:18:05.000Z | import hyrnn
import torch.nn
def test_MobiusGRU_no_packed_just_works():
input_size = 4
hidden_size = 3
batch_size = 5
gru = hyrnn.nets.MobiusGRU(input_size, hidden_size, hyperbolic_input=False)
timestops = 10
sequence = torch.randn(timestops, batch_size, input_size)
out, ht = gru(sequence)... | 31.938596 | 84 | 0.651744 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 509 | 0.139797 |
5a12f3dfdcd98b07c6a9e2f6f164d8d44b462308 | 1,190 | py | Python | ecogvis/signal_processing/common_referencing.py | NKI-ECOG/ecogVIS | f65212fc238e5b2588a4674a6aa1236f99e7d833 | [
"BSD-3-Clause"
] | 13 | 2020-04-01T22:39:24.000Z | 2022-03-04T13:27:51.000Z | ecogvis/signal_processing/common_referencing.py | NKI-ECOG/ecogVIS | f65212fc238e5b2588a4674a6aa1236f99e7d833 | [
"BSD-3-Clause"
] | 56 | 2020-04-01T14:27:21.000Z | 2022-03-23T21:33:06.000Z | ecogvis/signal_processing/common_referencing.py | luiztauffer/ecogVIS | c97e79a20b3af1074a3a5e1f1ad864a580c97e04 | [
"BSD-3-Clause"
] | 11 | 2020-05-15T17:48:53.000Z | 2022-02-01T23:55:12.000Z | from __future__ import division
import numpy as np
__all__ = ['subtract_CAR',
'subtract_common_median_reference']
def subtract_CAR(X, b_size=16):
"""
Compute and subtract common average reference in 16 channel blocks.
"""
channels, time_points = X.shape
s = channels // b_size
r = ... | 23.8 | 71 | 0.616807 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 437 | 0.367227 |
5a13150c841953f716f3e772e7c48bc269734ed8 | 3,701 | py | Python | rackspace/heat_store/catalog/tests.py | rohithkumar-rackspace/rcbops | fb690bc528499bbf9aebba3ab0cce0b4dffd9e35 | [
"Apache-2.0"
] | null | null | null | rackspace/heat_store/catalog/tests.py | rohithkumar-rackspace/rcbops | fb690bc528499bbf9aebba3ab0cce0b4dffd9e35 | [
"Apache-2.0"
] | null | null | null | rackspace/heat_store/catalog/tests.py | rohithkumar-rackspace/rcbops | fb690bc528499bbf9aebba3ab0cce0b4dffd9e35 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import unittest
import mox
import six.moves.urllib.request as urlrequest
from six import StringIO
from solution import Solution
class TestSolution(unittest.TestCase):
def setUp(self):
self.mox = mox.Mox()
pass
def tearDown(self):
self.mox.VerifyAll()
se... | 39.795699 | 80 | 0.599838 | 3,497 | 0.94488 | 0 | 0 | 0 | 0 | 0 | 0 | 1,055 | 0.285058 |
5a13d8b3614f878639aab1f5c25f37f50a754ad3 | 17 | py | Python | tests/errors/semantic/ex4.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | tests/errors/semantic/ex4.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | tests/errors/semantic/ex4.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | x is 1
y is None
| 5.666667 | 9 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a15278549975dbd09dff5e97bcd011523d42479 | 4,784 | py | Python | GetTopK.py | unsuthee/SemanticHashingWeekSupervision | 2b2498c70ad3184203855222efde861211edcaea | [
"MIT"
] | 19 | 2018-10-30T08:36:49.000Z | 2020-09-11T08:08:47.000Z | GetTopK.py | unsuthee/SemanticHashingWeekSupervision | 2b2498c70ad3184203855222efde861211edcaea | [
"MIT"
] | 1 | 2019-10-12T07:03:06.000Z | 2020-03-08T09:22:00.000Z | GetTopK.py | unsuthee/SemanticHashingWeekSupervision | 2b2498c70ad3184203855222efde861211edcaea | [
"MIT"
] | 6 | 2018-09-05T09:07:34.000Z | 2020-04-07T16:58:08.000Z | ################################################################################################################
# Author: Suthee Chaidaroon
# [email protected]
################################################################################################################
import numpy as np
import os
from utils impo... | 36.519084 | 114 | 0.567517 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,037 | 0.216764 |
5a16e96d11bf3bbabd290d8e7eb17ada9e705ea1 | 1,065 | py | Python | migrate_from_fnordcredit.py | stratum0/Matekasse | 9b48a8a07978a150e1df1b13b394791044cce82e | [
"MIT"
] | 1 | 2019-07-13T16:25:06.000Z | 2019-07-13T16:25:06.000Z | migrate_from_fnordcredit.py | stratum0/Matekasse | 9b48a8a07978a150e1df1b13b394791044cce82e | [
"MIT"
] | 10 | 2020-01-09T16:14:19.000Z | 2021-03-07T17:04:30.000Z | migrate_from_fnordcredit.py | stratum0/Matekasse | 9b48a8a07978a150e1df1b13b394791044cce82e | [
"MIT"
] | 1 | 2021-06-01T07:21:03.000Z | 2021-06-01T07:21:03.000Z | from matekasse import create_app, db
from matekasse.models import User, Transaction
import sqlite3
import argparse
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("-p", "--path", action='store', type=str, required=True, help="Path to fnordcredit database")
inp = parser.parse_args()
app = cre... | 25.97561 | 113 | 0.650704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 324 | 0.304225 |
5a17b8b4d053d2409ae3602977dee83dcbebc0b2 | 4,340 | py | Python | scripts/lc/ARES/testing/run_rose_tool.py | ouankou/rose | 76f2a004bd6d8036bc24be2c566a14e33ba4f825 | [
"BSD-3-Clause"
] | 488 | 2015-01-09T08:54:48.000Z | 2022-03-30T07:15:46.000Z | scripts/lc/ARES/testing/run_rose_tool.py | ouankou/rose | 76f2a004bd6d8036bc24be2c566a14e33ba4f825 | [
"BSD-3-Clause"
] | 174 | 2015-01-28T18:41:32.000Z | 2022-03-31T16:51:05.000Z | scripts/lc/ARES/testing/run_rose_tool.py | ouankou/rose | 76f2a004bd6d8036bc24be2c566a14e33ba4f825 | [
"BSD-3-Clause"
] | 146 | 2015-04-27T02:48:34.000Z | 2022-03-04T07:32:53.000Z | #!/usr/bin/env python
"""Runs a ROSE tool. If the tool does not return status 0, then runs the
corresponding non-ROSE compiler. Records whether the tool succeeded, in
passed.txt and failed.txt, but always returns status 0.
"""
import argparse
import inspect
import os
from support.local_logging import Logger
from su... | 41.333333 | 118 | 0.653917 | 3,818 | 0.879724 | 0 | 0 | 0 | 0 | 0 | 0 | 1,665 | 0.383641 |
5a18641e63b3fcad6914df89d4ba92c48cbaed17 | 951 | py | Python | source/odp/migrations/0003_auto_20201121_0919.py | kssvrk/BhoonidhiODP | e222087629250ea4ccd1ae8d8903d9ff400c13b4 | [
"BSD-3-Clause"
] | null | null | null | source/odp/migrations/0003_auto_20201121_0919.py | kssvrk/BhoonidhiODP | e222087629250ea4ccd1ae8d8903d9ff400c13b4 | [
"BSD-3-Clause"
] | null | null | null | source/odp/migrations/0003_auto_20201121_0919.py | kssvrk/BhoonidhiODP | e222087629250ea4ccd1ae8d8903d9ff400c13b4 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-21 09:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('odp', '0002_auto_20201121_0659'),
]
operations = [
migrations.CreateModel(
name='ProcessGroup',
fields=[
... | 32.793103 | 114 | 0.59306 | 858 | 0.902208 | 0 | 0 | 0 | 0 | 0 | 0 | 200 | 0.210305 |
5a18bfbbcf6c30bc2b6197bebec5c6f5638d264b | 935 | py | Python | test/auth/test_client_credentials.py | membranepotential/mendeley-python-sdk | 0336f0164f4d409309e813cbd0140011b5b2ff8f | [
"Apache-2.0"
] | 103 | 2015-01-12T00:40:51.000Z | 2022-03-29T07:02:06.000Z | test/auth/test_client_credentials.py | membranepotential/mendeley-python-sdk | 0336f0164f4d409309e813cbd0140011b5b2ff8f | [
"Apache-2.0"
] | 26 | 2015-01-10T04:08:41.000Z | 2021-02-05T16:31:37.000Z | test/auth/test_client_credentials.py | membranepotential/mendeley-python-sdk | 0336f0164f4d409309e813cbd0140011b5b2ff8f | [
"Apache-2.0"
] | 43 | 2015-03-04T18:11:06.000Z | 2022-03-13T02:33:34.000Z | from oauthlib.oauth2 import InvalidClientError, MissingTokenError
import pytest
from test import configure_mendeley, cassette
def test_should_get_authenticated_session():
mendeley = configure_mendeley()
auth = mendeley.start_client_credentials_flow()
with cassette('fixtures/auth/client_credentials/get_a... | 34.62963 | 115 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 270 | 0.28877 |
5a18ed1bc8e6b13c94274ea7e8252580407f9a6b | 338 | py | Python | problem/01000~09999/06137/6137.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-19T16:37:44.000Z | 2019-04-19T16:37:44.000Z | problem/01000~09999/06137/6137.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-20T11:42:44.000Z | 2019-04-20T11:42:44.000Z | problem/01000~09999/06137/6137.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 3 | 2019-04-19T16:37:47.000Z | 2021-10-25T00:45:00.000Z | s=[]
for i in range(int(input())):
s.append(input())
cnt=0
while s:
flag=True
for i in range(len(s)//2):
if s[i]<s[-(i+1)]:
print(s[0],end='')
s.pop(0)
flag=False
break
elif s[-(i+1)]<s[i]:
print(s[-1],end='')
s.pop()
flag=False
break
if flag:
print(s[-1],end='')
s.pop()
cnt+=1
if ... | 15.363636 | 29 | 0.52071 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.017751 |
5a1bae372e9a9d499e2d0814cd4b789a6fdb51ad | 2,072 | py | Python | test/test_thirty.py | jakubtuchol/dailycodingproblem | 9f0f3193f1746e949e16febace5aa5622dc5d4dc | [
"MIT"
] | 1 | 2020-10-13T20:54:37.000Z | 2020-10-13T20:54:37.000Z | test/test_thirty.py | jakubtuchol/dailycodingproblem | 9f0f3193f1746e949e16febace5aa5622dc5d4dc | [
"MIT"
] | null | null | null | test/test_thirty.py | jakubtuchol/dailycodingproblem | 9f0f3193f1746e949e16febace5aa5622dc5d4dc | [
"MIT"
] | null | null | null | from src.thirty import edit_distance
from src.thirty import find_second_largest_node
from src.thirty import make_palindrome
from src.thirty import powerset
from src.data_structures import BinaryNode
class TestEditDistance:
"""
Problem #31
"""
def test_provided_example(self):
assert 3 == edit_... | 22.769231 | 55 | 0.605695 | 1,861 | 0.898166 | 0 | 0 | 0 | 0 | 0 | 0 | 209 | 0.100869 |
5a1be255168c22e03a6a98004add6394315035a9 | 3,947 | py | Python | src/google_music_proto/musicmanager/utils.py | ddboline/google-music-proto | d3af3a1fe911edcd083482c9a6e8bde5a2902462 | [
"MIT"
] | null | null | null | src/google_music_proto/musicmanager/utils.py | ddboline/google-music-proto | d3af3a1fe911edcd083482c9a6e8bde5a2902462 | [
"MIT"
] | null | null | null | src/google_music_proto/musicmanager/utils.py | ddboline/google-music-proto | d3af3a1fe911edcd083482c9a6e8bde5a2902462 | [
"MIT"
] | null | null | null | __all__ = [
'generate_client_id',
'get_album_art',
'get_transcoder',
'transcode_to_mp3',
]
import os
import shutil
import subprocess
from base64 import b64encode
from binascii import unhexlify
from hashlib import md5
import audio_metadata
# The id is found by: getting md5sum of audio, base64 encode md5sum, remo... | 23.777108 | 91 | 0.701292 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 975 | 0.247023 |
5a1c4a115bd07e61146d8a14b7bb3639da60f1ea | 8,731 | py | Python | Other/SocialNetwork/Solver.py | lesyk/Evolife | 8e3dd1aab84061f7ce082f3a4b1bac0b2e31bc4a | [
"MIT"
] | null | null | null | Other/SocialNetwork/Solver.py | lesyk/Evolife | 8e3dd1aab84061f7ce082f3a4b1bac0b2e31bc4a | [
"MIT"
] | null | null | null | Other/SocialNetwork/Solver.py | lesyk/Evolife | 8e3dd1aab84061f7ce082f3a4b1bac0b2e31bc4a | [
"MIT"
] | null | null | null | ## {{{ http://code.activestate.com/recipes/303396/ (r1)
'''equation solver using attributes and introspection'''
from __future__ import division
class Solver(object):
'''takes a function, named arg value (opt.) and returns a Solver object'''
def __init__(self,f,**args):
self._f=f
self._args={}
# ... | 31.293907 | 195 | 0.611499 | 2,588 | 0.296415 | 0 | 0 | 0 | 0 | 0 | 0 | 3,460 | 0.396289 |
5a1c596e4aa4f0daea1821382fed5edc2f1a2f2c | 15,459 | py | Python | server/graph.py | Alpacron/vertex-cover | cfdace128f1578f9613e30990b9a87cc64ffb988 | [
"MIT"
] | null | null | null | server/graph.py | Alpacron/vertex-cover | cfdace128f1578f9613e30990b9a87cc64ffb988 | [
"MIT"
] | 15 | 2021-04-03T08:28:58.000Z | 2021-06-07T15:08:08.000Z | server/graph.py | Alpacron/vertex-cover | cfdace128f1578f9613e30990b9a87cc64ffb988 | [
"MIT"
] | 1 | 2021-05-21T13:16:51.000Z | 2021-05-21T13:16:51.000Z | import json
import random
class Graph:
"""
Graph data structure G = (V, E). Vertices contain the information about the edges.
"""
def __init__(self, graph=None):
if graph is None:
graph = {}
is_weighted = graph is not None and any(
True for x in graph if len(gr... | 37.982801 | 113 | 0.559545 | 15,430 | 0.998124 | 0 | 0 | 0 | 0 | 0 | 0 | 3,129 | 0.202406 |
5a1caac07eb9f441668b6c4d0592a3fd8fa4aefc | 576 | py | Python | ex4.py | AyeAyeZin/python_exercises | 77079dcd7809dd2967180ffd30df0166dd53edb4 | [
"MIT"
] | null | null | null | ex4.py | AyeAyeZin/python_exercises | 77079dcd7809dd2967180ffd30df0166dd53edb4 | [
"MIT"
] | null | null | null | ex4.py | AyeAyeZin/python_exercises | 77079dcd7809dd2967180ffd30df0166dd53edb4 | [
"MIT"
] | null | null | null | cars=100
cars_in_space=5
drivers=20
pasengers=70
car_not_driven=cars-drivers
cars_driven=drivers
carpool_capacity=cars_driven*space_in_a_car
average_passengers_percar=passengers/cars_driven
print("There are", cars,"cars availble")
print("There are only",drivers,"drivers availble")
print("There will be",car_not_driven,"... | 36 | 72 | 0.805556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 223 | 0.387153 |
5a1cb185553a265ef90a6017854334865e3cc339 | 304 | py | Python | python_docs/05Functions/01Definition.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_docs/05Functions/01Definition.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_docs/05Functions/01Definition.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | # Definição de função
def soma(a2, b2): # Os parâmetros aqui precisam ter outro nome
print(f'A = {a2} e B = {b2}')
s = a2 + b2
print(f'A soma vale A + B = {s}')
# Programa principal
a = int(input('Digite um valor para A: '))
b = int(input('Digite um valor para B: '))
soma(a, b)
| 25.333333 | 63 | 0.582237 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 193 | 0.624595 |
5a1d0c02ec27af98a78a24a6f4e896b2268b6a0f | 852 | py | Python | python/number.py | Dahercode/datalumni-test | 9587400bddafd1c32e97655727c5d3dbbfd17574 | [
"MIT"
] | 1 | 2020-02-18T16:56:38.000Z | 2020-02-18T16:56:38.000Z | python/number.py | Dahercode/datalumni-test | 9587400bddafd1c32e97655727c5d3dbbfd17574 | [
"MIT"
] | null | null | null | python/number.py | Dahercode/datalumni-test | 9587400bddafd1c32e97655727c5d3dbbfd17574 | [
"MIT"
] | null | null | null | # Your code goes here
tab=[]
for i in range(1000) :
tab.append(i)
tab2=[]
for i in range(len(tab)):
if sum([ int(c) for c in str(tab[i]) ]) <= 10:
tab2.append(tab[i])
tab3=[]
for i in range(len(tab2)):
a=str(tab2[i])
if a[len(a)-2] == '4':
tab3.append(tab2[i])
tab4=[]
for i in range(l... | 18.933333 | 53 | 0.543427 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.09027 |
5a1d385aaac2b104c89e97a052215f1dccd44141 | 3,885 | py | Python | backend/src/baserow/contrib/database/migrations/0016_token_tokenpermission.py | ashishdhngr/baserow | b098678d2165eb7c42930ee24dc6753a3cb520c3 | [
"MIT"
] | null | null | null | backend/src/baserow/contrib/database/migrations/0016_token_tokenpermission.py | ashishdhngr/baserow | b098678d2165eb7c42930ee24dc6753a3cb520c3 | [
"MIT"
] | null | null | null | backend/src/baserow/contrib/database/migrations/0016_token_tokenpermission.py | ashishdhngr/baserow | b098678d2165eb7c42930ee24dc6753a3cb520c3 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.11 on 2020-10-23 08:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("core", "0001_initial"),... | 32.647059 | 88 | 0.344916 | 3,725 | 0.958816 | 0 | 0 | 0 | 0 | 0 | 0 | 548 | 0.141055 |
5a1f561a631ec5529e54bc7090d1958be5eb6f6f | 1,639 | py | Python | setup.py | davidharvey1986/rrg | 26b4658f14279af21af1a61d57e9936daf315a71 | [
"MIT"
] | 2 | 2019-11-18T12:51:09.000Z | 2019-12-11T03:13:51.000Z | setup.py | davidharvey1986/rrg | 26b4658f14279af21af1a61d57e9936daf315a71 | [
"MIT"
] | 5 | 2017-06-09T10:06:27.000Z | 2019-07-19T11:28:18.000Z | setup.py | davidharvey1986/rrg | 26b4658f14279af21af1a61d57e9936daf315a71 | [
"MIT"
] | 2 | 2017-07-19T15:48:33.000Z | 2017-08-09T16:07:20.000Z | #!/usr/local/bin/python3
import sys,os,string,glob,subprocess
from setuptools import setup,Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
import numpy
long_description = """\
This module uses the RRG ... | 32.78 | 101 | 0.494814 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 626 | 0.38194 |
5a2032ec76e617ec97b415d06f3a42408d534a65 | 635 | py | Python | restbed/core/api.py | mr-tenders/restbed | 68d36536286203048ce01f1467d3db7ee108bebb | [
"MIT"
] | null | null | null | restbed/core/api.py | mr-tenders/restbed | 68d36536286203048ce01f1467d3db7ee108bebb | [
"MIT"
] | null | null | null | restbed/core/api.py | mr-tenders/restbed | 68d36536286203048ce01f1467d3db7ee108bebb | [
"MIT"
] | null | null | null | """
restbed core api
"""
import pyinsane2
from typing import List
class CoreApi(object):
scanner: pyinsane2.Scanner = None
scan_session: pyinsane2.ScanSession = None
@staticmethod
def initialize():
"""
initialize SANE, don't call if unit testing
(well that's the hope...)
... | 22.678571 | 63 | 0.63937 | 566 | 0.891339 | 0 | 0 | 170 | 0.267717 | 0 | 0 | 125 | 0.19685 |
5a20458f16a895f14563ad81b494f0d3c1292dbf | 736 | py | Python | secure_notes_client/thread_pool.py | rlee287/secure-notes-client | 56d5fcce1d2eeb46de22aac63131fe7214b6f185 | [
"MIT"
] | null | null | null | secure_notes_client/thread_pool.py | rlee287/secure-notes-client | 56d5fcce1d2eeb46de22aac63131fe7214b6f185 | [
"MIT"
] | 4 | 2019-07-10T01:34:12.000Z | 2019-08-20T01:52:31.000Z | secure_notes_client/thread_pool.py | rlee287/secure-notes-client | 56d5fcce1d2eeb46de22aac63131fe7214b6f185 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor
import time
from PySide2.QtCore import QCoreApplication
thread_pool=None
def init_thread_pool():
global thread_pool
thread_pool=ThreadPoolExecutor()
def deinit_thread_pool():
global thread_pool
thread_pool.shutdown()
def submit_task(function,*args,*... | 26.285714 | 58 | 0.762228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.072011 |
5a2274118fccaff1a7fc9becbc4b24e208209e91 | 10,463 | py | Python | Fairness_attack/data_utils.py | Ninarehm/attack | 0d5a6b842d4e81484540151d879036e9fe2184f1 | [
"MIT"
] | 8 | 2021-03-08T17:13:42.000Z | 2022-03-31T00:57:53.000Z | Fairness_attack/data_utils.py | lutai14/attack | 773024c7b86be112521a2243f2f809a54891c81f | [
"MIT"
] | null | null | null | Fairness_attack/data_utils.py | lutai14/attack | 773024c7b86be112521a2243f2f809a54891c81f | [
"MIT"
] | 1 | 2022-02-10T22:36:11.000Z | 2022-02-10T22:36:11.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import numpy as np
import scipy.sparse as sparse
import defenses
import upper_bounds
class NumpyEncoder(json.JSONEncoder):
def default(self, obj):
... | 31.610272 | 136 | 0.581 | 423 | 0.040428 | 0 | 0 | 0 | 0 | 0 | 0 | 682 | 0.065182 |
5a23d3f4e52679a350233bbde834e4fd8f3310ec | 74 | py | Python | pytracetable/__init__.py | filwaitman/pytracetable | eb884953e179fc65677a9e3b3c70fde1b1439ccb | [
"MIT"
] | 1 | 2016-02-10T20:28:00.000Z | 2016-02-10T20:28:00.000Z | pytracetable/__init__.py | filwaitman/pytracetable | eb884953e179fc65677a9e3b3c70fde1b1439ccb | [
"MIT"
] | 1 | 2020-05-27T18:12:10.000Z | 2020-05-27T18:12:10.000Z | pytracetable/__init__.py | filwaitman/pytracetable | eb884953e179fc65677a9e3b3c70fde1b1439ccb | [
"MIT"
] | null | null | null | from pytracetable.core import tracetable
__all__ = [
'tracetable',
]
| 12.333333 | 40 | 0.716216 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0.162162 |
5a24938eab3876854f2631917fd72abe26cefe64 | 1,518 | py | Python | quandl_data_retriever/server.py | fabiomolinar/quandl-data-retriever | d9359922cb222ac519f7d9e4dd892bbcf6b1b2d0 | [
"MIT"
] | null | null | null | quandl_data_retriever/server.py | fabiomolinar/quandl-data-retriever | d9359922cb222ac519f7d9e4dd892bbcf6b1b2d0 | [
"MIT"
] | null | null | null | quandl_data_retriever/server.py | fabiomolinar/quandl-data-retriever | d9359922cb222ac519f7d9e4dd892bbcf6b1b2d0 | [
"MIT"
] | null | null | null | """ Server module
Quandl API limits:
Authenticated users have a limit of 300 calls per 10 seconds,
2,000 calls per 10 minutes and a limit of 50,000 calls per day.
"""
import urllib
import logging
from twisted.internet import reactor
from twisted.web.client import Agent, readBody
from . import settings
from . import... | 26.172414 | 94 | 0.614625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 334 | 0.220026 |
5a24a53e97cdff184ba28a85fbb3b5ee4e244277 | 4,696 | py | Python | actingweb/deprecated_db_gae/db_subscription_diff.py | gregertw/actingweb | e1c8f66451f547c920c64c4e2a702698e3a0d299 | [
"BSD-3-Clause"
] | null | null | null | actingweb/deprecated_db_gae/db_subscription_diff.py | gregertw/actingweb | e1c8f66451f547c920c64c4e2a702698e3a0d299 | [
"BSD-3-Clause"
] | null | null | null | actingweb/deprecated_db_gae/db_subscription_diff.py | gregertw/actingweb | e1c8f66451f547c920c64c4e2a702698e3a0d299 | [
"BSD-3-Clause"
] | null | null | null | from builtins import object
from google.appengine.ext import ndb
import logging
"""
DbSubscriptionDiff handles all db operations for a subscription diff
DbSubscriptionDiffList handles list of subscriptions diffs
Google datastore for google is used as a backend.
"""
__all__ = [
'DbSubscriptionDiff',
... | 33.304965 | 134 | 0.5296 | 4,336 | 0.923339 | 0 | 0 | 0 | 0 | 0 | 0 | 1,098 | 0.233816 |
5a24c50dca0ab02ce229e044f402eb5085a1288a | 1,703 | py | Python | azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 36.234043 | 77 | 0.603641 | 1,187 | 0.697005 | 0 | 0 | 0 | 0 | 0 | 0 | 1,225 | 0.719319 |
5a29b2a7e94aa859d4fcd87428416a71deaf7e01 | 551 | py | Python | 4344.py | yzkim9501/Baekjoon | 222e55d0bd65cbb66f1f5486652ad8c697817844 | [
"Unlicense"
] | null | null | null | 4344.py | yzkim9501/Baekjoon | 222e55d0bd65cbb66f1f5486652ad8c697817844 | [
"Unlicense"
] | null | null | null | 4344.py | yzkim9501/Baekjoon | 222e55d0bd65cbb66f1f5486652ad8c697817844 | [
"Unlicense"
] | null | null | null | # 대학생 새내기들의 90%는 자신이 반에서 평균은 넘는다고 생각한다. 당신은 그들에게 슬픈 진실을 알려줘야 한다.
# 첫째 줄에는 테스트 케이스의 개수 C가 주어진다.
# 둘째 줄부터 각 테스트 케이스마다 학생의 수 N(1 ≤ N ≤ 1000, N은 정수)이 첫 수로 주어지고, 이어서 N명의 점수가 주어진다. 점수는 0보다 크거나 같고, 100보다 작거나 같은 정수이다.
# 각 케이스마다 한 줄씩 평균을 넘는 학생들의 비율을 반올림하여 소수점 셋째 자리까지 출력한다.
def avg(l):
s=0
for i in l:
s+=i
... | 25.045455 | 114 | 0.555354 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 605 | 0.685164 |
5a29f8551225fbef514f169502222d4f73af2984 | 4,531 | py | Python | tests/dualtor/test_standby_tor_upstream_mux_toggle.py | AndoniSanguesa/sonic-mgmt | bac8b9bf7c51008ceab75e83ce68fa9473a7d2ec | [
"Apache-2.0"
] | 1 | 2021-09-24T08:40:57.000Z | 2021-09-24T08:40:57.000Z | tests/dualtor/test_standby_tor_upstream_mux_toggle.py | AndoniSanguesa/sonic-mgmt | bac8b9bf7c51008ceab75e83ce68fa9473a7d2ec | [
"Apache-2.0"
] | null | null | null | tests/dualtor/test_standby_tor_upstream_mux_toggle.py | AndoniSanguesa/sonic-mgmt | bac8b9bf7c51008ceab75e83ce68fa9473a7d2ec | [
"Apache-2.0"
] | null | null | null | import pytest
import logging
import ipaddress
import json
import re
import time
from tests.common.dualtor.dual_tor_mock import *
from tests.common.helpers.assertions import pytest_assert as pt_assert
from tests.common.dualtor.dual_tor_utils import rand_selected_interface, verify_upstream_traffic, get_crm_nexthop_counte... | 41.568807 | 154 | 0.670492 | 0 | 0 | 146 | 0.032222 | 192 | 0.042375 | 0 | 0 | 1,182 | 0.26087 |
5a2a01adbfb1b632775069e902a5a1facd9c2f69 | 3,308 | py | Python | birdsong_recognition/dataset.py | YingyingF/birdsong_recognition | 4f8a2ccb900898a02d4454a5f1c206125f23fa44 | [
"Apache-2.0"
] | null | null | null | birdsong_recognition/dataset.py | YingyingF/birdsong_recognition | 4f8a2ccb900898a02d4454a5f1c206125f23fa44 | [
"Apache-2.0"
] | null | null | null | birdsong_recognition/dataset.py | YingyingF/birdsong_recognition | 4f8a2ccb900898a02d4454a5f1c206125f23fa44 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: dataset.ipynb (unless otherwise specified).
__all__ = ['load_mp3', 'get_sample_label', 'preprocess_file', 'pad_by_zeros', 'split_file_by_window_size',
'wrapper_split_file_by_window_size', 'create_dataset_fixed_size', 'get_spectrogram', 'add_channel_dim']
# Cell
d... | 39.380952 | 145 | 0.703144 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 537 | 0.162334 |
5a2a02d3be8c76f34df0d751d6f767892052893d | 492 | py | Python | Lib/objc/_SplitKit.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | Lib/objc/_SplitKit.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | Lib/objc/_SplitKit.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | '''
Classes from the 'SplitKit' framework.
'''
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
PodsDummy_SplitKit = _Class('PodsDummy_SplitKit')
Instan... | 21.391304 | 76 | 0.731707 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 149 | 0.302846 |
5a2a102330d36f9fe8e0e169c14680aef835ac84 | 3,743 | py | Python | wiki_music/gui_lib/search_and_replace.py | marian-code/wikipedia-music-tags | e8836c23b7b7e43661b59afd1bfc18d381b95d4a | [
"MIT"
] | 5 | 2019-01-28T21:53:14.000Z | 2020-06-27T08:52:36.000Z | wiki_music/gui_lib/search_and_replace.py | marian-code/wikipedia-music-tags | e8836c23b7b7e43661b59afd1bfc18d381b95d4a | [
"MIT"
] | 4 | 2019-01-15T16:33:59.000Z | 2020-05-20T08:09:02.000Z | wiki_music/gui_lib/search_and_replace.py | marian-code/wikipedia-music-tags | e8836c23b7b7e43661b59afd1bfc18d381b95d4a | [
"MIT"
] | 1 | 2020-04-15T11:00:20.000Z | 2020-04-15T11:00:20.000Z | """Module controling search and replace tab."""
import logging
from wiki_music.constants import GUI_HEADERS
from wiki_music.gui_lib import BaseGui, CheckableListModel
from wiki_music.gui_lib.qt_importer import QMessageBox, QPushButton, QIcon, QStyle
__all__ = ["Replacer"]
log = logging.getLogger(__name__)
log.debug(... | 35.647619 | 82 | 0.6428 | 3,379 | 0.902752 | 0 | 0 | 0 | 0 | 0 | 0 | 1,028 | 0.274646 |