hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
444322f10b91e018e4a69d114b6a451fdf842aa0 | 1,427 | py | Python | tests/supply_E3631A.py | BlancaCC/granadaSat_batteries | 9302feddddc62c1d26ca4faa7684edd0eeb95aa1 | [
"MIT"
] | null | null | null | tests/supply_E3631A.py | BlancaCC/granadaSat_batteries | 9302feddddc62c1d26ca4faa7684edd0eeb95aa1 | [
"MIT"
] | null | null | null | tests/supply_E3631A.py | BlancaCC/granadaSat_batteries | 9302feddddc62c1d26ca4faa7684edd0eeb95aa1 | [
"MIT"
] | null | null | null | class SupplyE3631A:
def __init__(self, instr):
if 'HEWLETT-PACKARD,E3631A' not in instr.query("*IDN?"):
raise NameError('Device is not HEWLETT-PACKARD E3631A')
else:
self.instr = instr
def output_on(self):
self.instr.write('OUTP ON')
def output_of... | 27.442308 | 68 | 0.573231 |
3d9c00068e7b7a9d949ce589b44f27228e107591 | 268 | py | Python | code/ui_database/simple.py | evemorgen/PlasticMonkeysCansat | 5f6f8d52ac65de408c7e8ff082c20bebcb40f5e4 | [
"MIT"
] | 10 | 2018-10-16T15:53:09.000Z | 2020-08-19T06:06:23.000Z | code/ui_database/simple.py | evemorgen/PlasticMonkeysCansat | 5f6f8d52ac65de408c7e8ff082c20bebcb40f5e4 | [
"MIT"
] | 23 | 2018-10-13T16:00:43.000Z | 2019-04-27T19:08:58.000Z | code/ui_database/simple.py | evemorgen/PlasticMonkeysCansat | 5f6f8d52ac65de408c7e8ff082c20bebcb40f5e4 | [
"MIT"
] | 2 | 2018-11-04T17:55:53.000Z | 2018-11-18T17:33:27.000Z | from tinydb import TinyDB, Query
db = TinyDB('questions.json')
q = Query()
#db.insert({'lan':'PL','num': 1, 'type':'general', 'question': 'Czy potrzebujesz pomocy'})
result = db.get((q.lan == 'PL') & (q.num == 1))
question = result.get('question')
print question
| 20.615385 | 90 | 0.63806 |
98980e58d4a8c9f21c9b33c0ea1f92394363e620 | 675 | py | Python | backend/migrations/versions/0f846b00d0db_add_position_field.py | cclauss/lineage | 065cf182095cd7ff3fe5c9f38e1009f1f2a81c19 | [
"MIT"
] | 1 | 2021-09-06T15:26:46.000Z | 2021-09-06T15:26:46.000Z | backend/migrations/versions/0f846b00d0db_add_position_field.py | cclauss/lineage | 065cf182095cd7ff3fe5c9f38e1009f1f2a81c19 | [
"MIT"
] | null | null | null | backend/migrations/versions/0f846b00d0db_add_position_field.py | cclauss/lineage | 065cf182095cd7ff3fe5c9f38e1009f1f2a81c19 | [
"MIT"
] | 1 | 2020-11-12T05:23:09.000Z | 2020-11-12T05:23:09.000Z | """Add position field
Revision ID: 0f846b00d0db
Revises: f0c6a1421c2d
Create Date: 2020-09-29 18:40:51.646237
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0f846b00d0db'
down_revision = 'f0c6a1421c2d'
branch_labels = None
depends_on = None
def upgrade():
... | 23.275862 | 86 | 0.699259 |
24f5414813e2f78f1568794763da4784c301b042 | 8,549 | py | Python | tests/test_orders.py | NYU-DevOps-Spring2018-Orders/orders | 64e4f570871a66ce30d62e50977fc5d4a17cdeab | [
"Apache-2.0"
] | 2 | 2018-06-25T06:39:47.000Z | 2018-10-29T17:09:33.000Z | tests/test_orders.py | NYU-DevOps-Spring2018-Orders/orders | 64e4f570871a66ce30d62e50977fc5d4a17cdeab | [
"Apache-2.0"
] | 100 | 2018-02-18T16:52:08.000Z | 2018-05-02T19:32:01.000Z | tests/test_orders.py | NYU-DevOps-Spring2018-Orders/orders | 64e4f570871a66ce30d62e50977fc5d4a17cdeab | [
"Apache-2.0"
] | 4 | 2018-03-03T03:37:27.000Z | 2018-04-11T22:11:47.000Z | """
Test cases for Order Model
Test cases can be run with:
nosetests
coverage report -m
"""
import os
import unittest
from app import app, db
from app.models import Item, Order, DataValidationError
from datetime import datetime
from werkzeug.exceptions import NotFound
DATABASE_URI = os.getenv('DATABASE_URI', 'mys... | 34.333333 | 105 | 0.587554 |
7960801277784409e8be96cd4e0e7304efeb6b75 | 3,169 | py | Python | project_euler/problem_008/sol1.py | NavpreetDevpuri/Python | 7ef5ae66d777e8ed702993c6aa9270e0669cb0c6 | [
"MIT"
] | 145,614 | 2016-07-21T05:40:05.000Z | 2022-03-31T22:17:22.000Z | project_euler/problem_008/sol1.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 3,987 | 2016-07-28T17:31:25.000Z | 2022-03-30T23:07:46.000Z | project_euler/problem_008/sol1.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 40,014 | 2016-07-26T15:14:41.000Z | 2022-03-31T22:23:03.000Z | """
Project Euler Problem 8: https://projecteuler.net/problem=8
Largest product in a series
The four adjacent digits in the 1000-digit number that have the greatest
product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
8586... | 38.180723 | 74 | 0.84443 |
4072e1ad1100f866ae38639a995a1ea0aec45aac | 80,384 | py | Python | poppy/optics.py | remorgan123/poppy | 70f70a1ab96a88b602d67e02161dc8265f947bcc | [
"BSD-3-Clause"
] | 141 | 2015-02-18T09:18:51.000Z | 2022-02-23T20:18:00.000Z | poppy/optics.py | ivalaginja/poppy | 33c8857d64b5394375135ea9918e36417a76752c | [
"BSD-3-Clause"
] | 227 | 2015-01-22T04:30:04.000Z | 2022-01-13T19:39:19.000Z | poppy/optics.py | shanosborne/poppy | 2010aaac2e738ac347186e28b2258e489a22deec | [
"BSD-3-Clause"
] | 51 | 2015-02-25T22:51:22.000Z | 2021-09-15T03:48:08.000Z | import numpy as np
import scipy.special
import scipy.ndimage.interpolation
import matplotlib
import astropy.io.fits as fits
import astropy.units as u
import warnings
import logging
from . import utils
from . import conf
from . import accel_math
from .poppy_core import OpticalElement, Wavefront, BaseWavefront, PlaneTyp... | 41.413704 | 133 | 0.621579 |
5d7f616e8bdd5cf40c4c2fe0faee4fec24e52050 | 587 | py | Python | rest_api/config.py | spilioeve/WM-src | ba9265360bdac848b119ec11456b8f65bf2b1af8 | [
"MIT"
] | 2 | 2020-04-28T21:37:44.000Z | 2020-05-05T14:28:11.000Z | rest_api/config.py | spilioeve/WM-src | ba9265360bdac848b119ec11456b8f65bf2b1af8 | [
"MIT"
] | 1 | 2021-05-28T17:52:39.000Z | 2021-05-28T20:56:13.000Z | rest_api/config.py | spilioeve/WM-src | ba9265360bdac848b119ec11456b8f65bf2b1af8 | [
"MIT"
] | 3 | 2021-04-23T15:01:06.000Z | 2021-07-30T22:41:50.000Z | # Configuration file for `REST_API.py`
# Set to True for enhanced logging
DEBUG = False
# Set to true to use Redis (per specified configuration)
REDIS = False
# Set the default number of seconds results should be
# stored by Redis (604800 is equivalent to 7 days)
REDIS_TTL = 604800
# Specify Redis Instance (ignor... | 25.521739 | 66 | 0.761499 |
d44b1892942b7494360f657d80cfc87481fc1ff8 | 1,192 | py | Python | setup.py | ltirrell/pyCompare | a856ebc540f7ed0a15fcb6a3a00823b6501a37fa | [
"MIT"
] | null | null | null | setup.py | ltirrell/pyCompare | a856ebc540f7ed0a15fcb6a3a00823b6501a37fa | [
"MIT"
] | null | null | null | setup.py | ltirrell/pyCompare | a856ebc540f7ed0a15fcb6a3a00823b6501a37fa | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import os
basepath = os.path.realpath(__file__)
basepath = os.path.dirname(basepath)
path = os.path.join(basepath, 'pyCompare', 'VERSION')
with open(path, 'r') as file:
VERSION = file.readline().strip()
path = os.path.join(basepath, 'README.md')
with open(path, 'r') as f... | 27.090909 | 55 | 0.707215 |
3652f57bb66cddc91781a003b8ae2fcc3e3e37d3 | 550 | py | Python | cdl_rest_api/migrations/0005_experimentresult_experimentdata.py | zilkf92/cdl-django-webservice | 18536859a13c16e85f05bad14912f8d1939a78ea | [
"MIT"
] | 1 | 2022-01-25T13:52:03.000Z | 2022-01-25T13:52:03.000Z | cdl_rest_api/migrations/0005_experimentresult_experimentdata.py | zilkf92/cdl-django-webservice | 18536859a13c16e85f05bad14912f8d1939a78ea | [
"MIT"
] | null | null | null | cdl_rest_api/migrations/0005_experimentresult_experimentdata.py | zilkf92/cdl-django-webservice | 18536859a13c16e85f05bad14912f8d1939a78ea | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-12-21 13:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cdl_rest_api', '0004_coincidences_countrates_experimentdata'),
]
operations = [
migrations.AddField(
... | 27.5 | 139 | 0.68 |
2f449dc8f69e96d38c527f2a93abe97a4d4c469f | 3,923 | py | Python | python/tvm/hybrid/util.py | Orion34C/incubator-tvm | 27a02844cb52e883a4a66da68a527590d76f7d01 | [
"Apache-2.0"
] | 1 | 2021-03-20T02:03:00.000Z | 2021-03-20T02:03:00.000Z | python/tvm/hybrid/util.py | Orion34C/incubator-tvm | 27a02844cb52e883a4a66da68a527590d76f7d01 | [
"Apache-2.0"
] | null | null | null | python/tvm/hybrid/util.py | Orion34C/incubator-tvm | 27a02844cb52e883a4a66da68a527590d76f7d01 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.663551 | 98 | 0.664797 |
93f585410c26310319af9f492d5e168e08a36358 | 2,835 | py | Python | google/appengine/tools/devappserver2/python/pdb_sandbox.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 26 | 2015-01-20T08:02:38.000Z | 2020-06-10T04:57:41.000Z | google/appengine/tools/devappserver2/python/pdb_sandbox.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 53 | 2016-04-06T21:10:43.000Z | 2018-03-19T23:14:33.000Z | google/appengine/tools/devappserver2/python/pdb_sandbox.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 23 | 2016-04-19T05:45:26.000Z | 2021-12-31T23:22:36.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35 | 95 | 0.676543 |
aa01fdda715fcfcd4c5da83e593b9f720404ea28 | 734 | py | Python | mongodb/factory/results/_base.py | RaenonX/Jelly-Bot-API | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 5 | 2020-08-26T20:12:00.000Z | 2020-12-11T16:39:22.000Z | mongodb/factory/results/_base.py | RaenonX/Jelly-Bot | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 234 | 2019-12-14T03:45:19.000Z | 2020-08-26T18:55:19.000Z | mongodb/factory/results/_base.py | RaenonX/Jelly-Bot-API | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 2 | 2019-10-23T15:21:15.000Z | 2020-05-22T09:35:55.000Z | from abc import ABC
from dataclasses import dataclass
from typing import Optional
from JellyBot.api.static import result
from models import Model
from ._outcome import BaseOutcome
@dataclass
class BaseResult(ABC):
outcome: BaseOutcome
exception: Optional[Exception]
def serialize(self) -> dict:
... | 22.242424 | 63 | 0.69346 |
32d32a550a0b7898741dcdbb634c7d5e6ee484fb | 38,876 | py | Python | models/swin_transformer.py | rahulmangalampalli/esvit | 5caf6e36b088ae2e7aaa4100b307eec991078e3e | [
"MIT"
] | 237 | 2021-07-14T21:06:56.000Z | 2022-03-31T02:38:56.000Z | models/swin_transformer.py | rahulmangalampalli/esvit | 5caf6e36b088ae2e7aaa4100b307eec991078e3e | [
"MIT"
] | 18 | 2021-08-05T09:00:03.000Z | 2022-03-22T03:11:53.000Z | models/swin_transformer.py | rahulmangalampalli/esvit | 5caf6e36b088ae2e7aaa4100b307eec991078e3e | [
"MIT"
] | 25 | 2021-07-14T20:32:28.000Z | 2022-03-31T19:34:53.000Z | # --------------------------------------------------------
# Modified by Chunyuan Li (chunyl@microsoft.com)
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Written by Ze Liu
# --------------------------------------------------------
import os
import logging
import torch
import torch.nn as nn
import torch.nn.functi... | 39.62895 | 119 | 0.565362 |
c16c50e4d7f6ab448d8f8f9e9d196d9ba821e522 | 2,357 | py | Python | applications/kit/models/logger.py | Ayunken/my_web2py | 6f8ddf531b72ca5c3d6472a5ed3bd279b7be9260 | [
"BSD-3-Clause"
] | null | null | null | applications/kit/models/logger.py | Ayunken/my_web2py | 6f8ddf531b72ca5c3d6472a5ed3bd279b7be9260 | [
"BSD-3-Clause"
] | null | null | null | applications/kit/models/logger.py | Ayunken/my_web2py | 6f8ddf531b72ca5c3d6472a5ed3bd279b7be9260 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import logging, logging.handlers
from gluon import current
class GAEHandler(logging.Handler):
"""
Logging handler for GAE DataStore
"""
def emit(self, record):
from google.appengine.ext import db
class Log(db.Model):
name = db.StringProperty()
... | 33.197183 | 138 | 0.619431 |
3817cda08521634b3ce407846479800844c0ded3 | 1,235 | py | Python | aws_lambda_powertools/utilities/parser/models/kinesis.py | whardier/aws-lambda-powertools-python | 8de372914ade16f18a72484dbced8f4aba6de592 | [
"Apache-2.0",
"MIT-0"
] | null | null | null | aws_lambda_powertools/utilities/parser/models/kinesis.py | whardier/aws-lambda-powertools-python | 8de372914ade16f18a72484dbced8f4aba6de592 | [
"Apache-2.0",
"MIT-0"
] | null | null | null | aws_lambda_powertools/utilities/parser/models/kinesis.py | whardier/aws-lambda-powertools-python | 8de372914ade16f18a72484dbced8f4aba6de592 | [
"Apache-2.0",
"MIT-0"
] | null | null | null | import base64
import logging
from binascii import Error as BinAsciiError
from typing import List, Union
from pydantic import BaseModel, validator
from pydantic.types import PositiveInt
from aws_lambda_powertools.utilities.parser.types import Literal, Model
logger = logging.getLogger(__name__)
class KinesisDataStre... | 28.72093 | 78 | 0.752227 |
f964f4d479c5dda919491a22096f74a6bbf64fd8 | 15,580 | py | Python | xknx/devices/climate_mode.py | phbaer/xknx | 00b7cd4bda79d8bd6f8408a3596ab77a644b6c35 | [
"MIT"
] | null | null | null | xknx/devices/climate_mode.py | phbaer/xknx | 00b7cd4bda79d8bd6f8408a3596ab77a644b6c35 | [
"MIT"
] | null | null | null | xknx/devices/climate_mode.py | phbaer/xknx | 00b7cd4bda79d8bd6f8408a3596ab77a644b6c35 | [
"MIT"
] | null | null | null | """
Module for managing the climate mode.
Climate modes can be 'auto', 'comfort', 'standby', 'economy' or 'protection'.
"""
from xknx.exceptions import CouldNotParseTelegram, DeviceIllegalValue
from xknx.knx import (
DPTArray, DPTBinary, DPTControllerStatus, DPTHVACContrMode, DPTHVACMode,
GroupAddress, HVACOpe... | 53.910035 | 111 | 0.702632 |
1e08a75240a359a1c1c2c1988534a3320c69ce2c | 787 | py | Python | core/api/migrations/0007_tags.py | LegolasVzla/django-google-maps | 62efd2f35f8ee9fcdd5c3b9d3b0aba934b1d6fb3 | [
"MIT"
] | 5 | 2020-06-15T10:11:33.000Z | 2022-01-05T19:03:52.000Z | backend/everpro/django-google-maps/core/api/migrations/0007_tags.py | Ascensiony/EverPro-Intelligence-APIs | 41de67418a7ed266547840948301225220ddd6c9 | [
"Apache-2.0"
] | 9 | 2020-02-12T00:54:30.000Z | 2021-09-22T17:55:59.000Z | backend/everpro/django-google-maps/core/api/migrations/0007_tags.py | Ascensiony/EverPro-Intelligence-APIs | 41de67418a7ed266547840948301225220ddd6c9 | [
"Apache-2.0"
] | 6 | 2020-06-18T09:14:35.000Z | 2021-10-16T10:00:13.000Z | # Generated by Django 2.2.3 on 2019-08-01 03:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0006_spots_postal_code'),
]
operations = [
migrations.CreateModel(
name='Tags',
fields=[
('id... | 31.48 | 114 | 0.583227 |
875008626982638d5fdfc701f011c21c62054103 | 1,312 | py | Python | setup.py | jmatuskey/exoctk | bfd7e5100014048f73baf23c964598381f691ffd | [
"BSD-3-Clause"
] | null | null | null | setup.py | jmatuskey/exoctk | bfd7e5100014048f73baf23c964598381f691ffd | [
"BSD-3-Clause"
] | null | null | null | setup.py | jmatuskey/exoctk | bfd7e5100014048f73baf23c964598381f691ffd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY... | 26.77551 | 83 | 0.577744 |
51e0a7f9fc589479293e716e14def5b0a9cd403b | 5,199 | py | Python | tools/nntool/quantization/symmetric/kernels/linear.py | mfkiwl/gap_sdk | 642b798dfdc7b85ccabe6baba295033f0eadfcd4 | [
"Apache-2.0"
] | null | null | null | tools/nntool/quantization/symmetric/kernels/linear.py | mfkiwl/gap_sdk | 642b798dfdc7b85ccabe6baba295033f0eadfcd4 | [
"Apache-2.0"
] | null | null | null | tools/nntool/quantization/symmetric/kernels/linear.py | mfkiwl/gap_sdk | 642b798dfdc7b85ccabe6baba295033f0eadfcd4 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | 42.966942 | 92 | 0.602808 |
5265ff35f08f9f4242fd6e3c3a2c3dc880296ee0 | 4,166 | py | Python | broadlinky/__init__.py | technicalpickles/broadlinky | e16310c5429ecff00834982931d9daacc3f38d57 | [
"MIT"
] | 1 | 2021-09-17T00:16:56.000Z | 2021-09-17T00:16:56.000Z | broadlinky/__init__.py | technicalpickles/broadlinky | e16310c5429ecff00834982931d9daacc3f38d57 | [
"MIT"
] | null | null | null | broadlinky/__init__.py | technicalpickles/broadlinky | e16310c5429ecff00834982931d9daacc3f38d57 | [
"MIT"
] | null | null | null | """Interface for discovering/sending codes with a Broadlink device."""
import logging
import os
import re
import socket
import time
import broadlink
import yaml
_LOGGER = logging.getLogger(__name__)
class Device:
def __init__(self, broadlinky, name, state_config):
self.broadlinky = broadlinky
sel... | 29.546099 | 90 | 0.571771 |
33148d5683b8950371169773cbaa4a36b85dc0e6 | 468 | pyde | Python | sketches/box01/box01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/box01/box01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/box01/box01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | a = 0
def setup():
global chest
earth = loadImage("bluemarble.jpg")
size(400, 400, P3D)
noStroke()
chest = createShape(BOX, 180)
chest.setTexture(earth)
def draw():
global a, chest
background(51)
lights()
translate(width*.5, height*.5, 0)
sphereDetail(30)
with pushMatri... | 21.272727 | 39 | 0.59188 |
ad39aea28fbab558d3f7a13aa0eec00152045cff | 1,206 | py | Python | migrations/versions/55e0ccaf0fd6_.py | AshiSaxena996/flask_project_template-master | 109f0225ad32fcec2ad19648c5fef22b495de0c6 | [
"MIT"
] | null | null | null | migrations/versions/55e0ccaf0fd6_.py | AshiSaxena996/flask_project_template-master | 109f0225ad32fcec2ad19648c5fef22b495de0c6 | [
"MIT"
] | null | null | null | migrations/versions/55e0ccaf0fd6_.py | AshiSaxena996/flask_project_template-master | 109f0225ad32fcec2ad19648c5fef22b495de0c6 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 55e0ccaf0fd6
Revises: 2d86810e63ae
Create Date: 2020-05-12 14:46:45.343845
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '55e0ccaf0fd6'
down_revision = '2d86810e63ae'
branch_labels = None
depends_on = None
def upgrade():
# ... | 30.15 | 91 | 0.682421 |
66c1027a03eb056d0770bcfba2b78ddc4d796bbe | 2,534 | py | Python | compute_incident_rates.py | ramanshahdatascience/interval_sorting_demo | fc4d9cc88ce1b79902430ccd930c0902010afbf0 | [
"BSD-3-Clause"
] | 1 | 2020-01-14T15:40:42.000Z | 2020-01-14T15:40:42.000Z | compute_incident_rates.py | ramanshahdatascience/interval_sorting_demo | fc4d9cc88ce1b79902430ccd930c0902010afbf0 | [
"BSD-3-Clause"
] | 2 | 2020-04-30T20:45:03.000Z | 2021-10-19T17:48:21.000Z | compute_incident_rates.py | ramanshahdatascience/interval_sorting_demo | fc4d9cc88ce1b79902430ccd930c0902010afbf0 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
import pandas as pd
from scipy.optimize import fmin, fsolve
from scipy.stats import beta
import warnings
# These parameters give a mode at the national overdose death rate of 14.3 per
# 100k per year. They offer a reasonably broad distribution with a 95% highest
# density interval of [1.896e-4... | 41.540984 | 89 | 0.733623 |
96e69e7e7cf963c6ef16fce3dae67e2d3ac77d8f | 10,127 | py | Python | contrib/linearize/linearize-data.py | wkibbler/nyc3 | cf4ffcbd4c1561d7a21c2f30cad94a0f783d74b5 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-data.py | wkibbler/nyc3 | cf4ffcbd4c1561d7a21c2f30cad94a0f783d74b5 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-data.py | wkibbler/nyc3 | cf4ffcbd4c1561d7a21c2f30cad94a0f783d74b5 | [
"MIT"
] | 1 | 2019-07-21T20:59:27.000Z | 2019-07-21T20:59:27.000Z | #!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Nyc3 Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mi... | 31.256173 | 108 | 0.693789 |
8ce7819d3e0901ecb4a9b798e1d4169a13496488 | 34,315 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/purestorage/flashblade/plugins/modules/purefb_fs.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/purestorage/flashblade/plugins/modules/purefb_fs.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/purestorage/flashblade/plugins/modules/purefb_fs.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version":... | 39.306987 | 135 | 0.540609 |
3605c7a8b81cc348231862e5ad43a6a657a3fec1 | 7,232 | py | Python | tests/test_documents.py | bobweston/python-documentcloud | dd62f705645037391671b1092f829eb340c31580 | [
"MIT"
] | 2 | 2020-06-16T15:57:32.000Z | 2021-01-06T18:19:08.000Z | tests/test_documents.py | bobweston/python-documentcloud | dd62f705645037391671b1092f829eb340c31580 | [
"MIT"
] | null | null | null | tests/test_documents.py | bobweston/python-documentcloud | dd62f705645037391671b1092f829eb340c31580 | [
"MIT"
] | 4 | 2020-08-03T19:23:34.000Z | 2022-03-12T15:35:28.000Z | # Future
from __future__ import division, print_function, unicode_literals
# Standard Library
from builtins import str
from datetime import datetime
# Third Party
import pytest
# DocumentCloud
from documentcloud.documents import Mention
from documentcloud.exceptions import APIError, DoesNotExistError
from documentcl... | 30.905983 | 85 | 0.615459 |
72c7fa560dc28f997dff1d4d948ab220e0ec3113 | 13,109 | py | Python | tests/unit/models/test_model_interfaces.py | st--/trieste | 8c21681806b96912bd31929ab04d99ef0c6b48c9 | [
"Apache-2.0"
] | null | null | null | tests/unit/models/test_model_interfaces.py | st--/trieste | 8c21681806b96912bd31929ab04d99ef0c6b48c9 | [
"Apache-2.0"
] | null | null | null | tests/unit/models/test_model_interfaces.py | st--/trieste | 8c21681806b96912bd31929ab04d99ef0c6b48c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Trieste Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.525745 | 103 | 0.714776 |
04f0edf35a3a39e7aef8d93341690f4bd4e4a709 | 2,839 | py | Python | calendarapi.py | AsoTora/GoogleCalendarAPI | 72ada9fc29269a55c195000bde22a2d1050de4d5 | [
"MIT"
] | null | null | null | calendarapi.py | AsoTora/GoogleCalendarAPI | 72ada9fc29269a55c195000bde22a2d1050de4d5 | [
"MIT"
] | null | null | null | calendarapi.py | AsoTora/GoogleCalendarAPI | 72ada9fc29269a55c195000bde22a2d1050de4d5 | [
"MIT"
] | null | null | null | from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/... | 33.4 | 79 | 0.613244 |
e7189fce5c973a301ef5503ac1bf7607898c2691 | 22,831 | py | Python | test/functional/test_framework/test_framework.py | Mirkolance1/altcoin | d77e25be0ce015ff03c3df79801ac208e68be963 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_framework.py | Mirkolance1/altcoin | d77e25be0ce015ff03c3df79801ac208e68be963 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_framework.py | Mirkolance1/altcoin | d77e25be0ce015ff03c3df79801ac208e68be963 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
import configparser
from enum import Enum
import logging
import argpars... | 42.046041 | 331 | 0.633306 |
ca5ca7c23b016659991347bdf539b0117aa78b2e | 2,086 | py | Python | round 1 A/square.py | rocket3989/Code-Jam-2020 | cb9f91af25581cd68c5ee89f1ce88200c574f25c | [
"MIT"
] | 1 | 2020-04-05T02:10:44.000Z | 2020-04-05T02:10:44.000Z | round 1 A/square.py | rocket3989/Code-Jam-2020 | cb9f91af25581cd68c5ee89f1ce88200c574f25c | [
"MIT"
] | null | null | null | round 1 A/square.py | rocket3989/Code-Jam-2020 | cb9f91af25581cd68c5ee89f1ce88200c574f25c | [
"MIT"
] | null | null | null | for tc in range(int(input())):
R, C = [int(x) for x in input().split()]
floor = []
for r in range(R):
floor.append([int(x) for x in input().split()])
score = 0
while True:
neighborSum = [[0 for i in range(C)] for j in range(R)]
count ... | 32.59375 | 70 | 0.349952 |
72b6bcc8f8cc3199f8abc644ec0a2210a83e290f | 20,955 | py | Python | languageModels.py | isibord/LanguageModels | fe6a478e01cc7a5682a38620bcc052020ed5d30f | [
"Apache-2.0"
] | 1 | 2019-06-04T19:45:44.000Z | 2019-06-04T19:45:44.000Z | languageModels.py | isibord/LanguageModels | fe6a478e01cc7a5682a38620bcc052020ed5d30f | [
"Apache-2.0"
] | null | null | null | languageModels.py | isibord/LanguageModels | fe6a478e01cc7a5682a38620bcc052020ed5d30f | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from math import log, pow
import argparse
"""
Given a path to the corpus file, process it with our without unk for the models to access it
"""
class ProcessCorpus:
corpusArray = []
wordCountList = {}
totalNumWords = 0
unk = '<unk>'
startSymbol = '<s>'... | 43.74739 | 148 | 0.608542 |
868f9d7f0b008e42afa9c22df37d630cf9a14177 | 2,690 | py | Python | test/SConsignFile/default.py | acmorrow/scons | 0d9a99d630169277689e95e39ae64ccf9b9215bf | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/SConsignFile/default.py | acmorrow/scons | 0d9a99d630169277689e95e39ae64ccf9b9215bf | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/SConsignFile/default.py | acmorrow/scons | 0d9a99d630169277689e95e39ae64ccf9b9215bf | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... | 32.02381 | 77 | 0.722677 |
ada1ca7f8387eb79996255c875d78da190d72f4e | 9,630 | py | Python | test/functional/wallet_import_rescan.py | Dollar-coin/Dollar | 4b84e5d14408f3985d527aaccac21472b47c91d5 | [
"MIT"
] | 1 | 2021-02-06T22:18:29.000Z | 2021-02-06T22:18:29.000Z | test/functional/wallet_import_rescan.py | Dollar-coin/Dollar | 4b84e5d14408f3985d527aaccac21472b47c91d5 | [
"MIT"
] | 1 | 2021-02-07T00:57:29.000Z | 2021-02-07T10:22:29.000Z | test/functional/wallet_import_rescan.py | Dollar-coin/Dollar | 4b84e5d14408f3985d527aaccac21472b47c91d5 | [
"MIT"
] | 1 | 2021-02-26T22:29:45.000Z | 2021-02-26T22:29:45.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
impor... | 46.97561 | 130 | 0.664486 |
9bd0c7c8f9266ded85b09693ed8772b189718a99 | 2,592 | py | Python | operations.py | wesleydutrads/cash-machine-python | 7c6f26a9c290c83efc82d2c68f02cb5d2fca54ba | [
"MIT"
] | null | null | null | operations.py | wesleydutrads/cash-machine-python | 7c6f26a9c290c83efc82d2c68f02cb5d2fca54ba | [
"MIT"
] | 1 | 2021-07-01T02:19:12.000Z | 2021-07-01T02:19:12.000Z | operations.py | wesleydutrads/cash-machine-python | 7c6f26a9c290c83efc82d2c68f02cb5d2fca54ba | [
"MIT"
] | null | null | null | # coding: utf-8
import getpass
from bank_account_variables import account_lists, money_slips
def do_operation(option_typed, account_auth):
if option_typed == '1':
show_balance(account_auth)
elif option_typed == '10' and account_lists[account_auth]['admin']:
insert_money_slips()
elif option... | 35.027027 | 101 | 0.616127 |
13b86f573f79e93c160b136be6a1b2917cfe5408 | 3,025 | py | Python | Gena/map_center_object_no_zoom.py | guy1ziv2/earthengine-py-notebooks | 931f57c61c147fe6cff745c2a099a444716e69e4 | [
"MIT"
] | 1 | 2020-12-23T16:26:05.000Z | 2020-12-23T16:26:05.000Z | Gena/map_center_object_no_zoom.py | guy1ziv2/earthengine-py-notebooks | 931f57c61c147fe6cff745c2a099a444716e69e4 | [
"MIT"
] | null | null | null | Gena/map_center_object_no_zoom.py | guy1ziv2/earthengine-py-notebooks | 931f57c61c147fe6cff745c2a099a444716e69e4 | [
"MIT"
] | 1 | 2020-12-23T16:29:51.000Z | 2020-12-23T16:29:51.000Z | '''
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Gena/map_center_object_no_zoom.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_b... | 37.345679 | 422 | 0.734215 |
e945868dbc65301875db5c13f49865b3873fa351 | 4,774 | py | Python | tests/test_rocket.py | KianPardoe/RocketPy | d3d835fa7fd71fea636132616b2eea8917729875 | [
"MIT"
] | 70 | 2018-11-28T10:53:43.000Z | 2020-10-24T15:48:58.000Z | tests/test_rocket.py | RogueXT/RocketPy | 94fc5bc99442526f6f7890172764838883d5cd11 | [
"MIT"
] | 33 | 2018-09-10T02:28:25.000Z | 2020-10-19T17:05:13.000Z | tests/test_rocket.py | RogueXT/RocketPy | 94fc5bc99442526f6f7890172764838883d5cd11 | [
"MIT"
] | 23 | 2018-11-30T22:59:50.000Z | 2020-10-24T16:22:21.000Z | from unittest.mock import patch
import pytest
from rocketpy import Environment, SolidMotor, Rocket, Flight, Parachute
@patch("matplotlib.pyplot.show")
def test_rocket(mock_show):
test_motor = SolidMotor(
thrustSource="data/motors/Cesaroni_M1670.eng",
burnOut=3.9,
grainNumber=5,
g... | 28.248521 | 83 | 0.585253 |
54cd0426afae3365418d6cfc3c2f4f9c5811674a | 7,843 | py | Python | data_import_scripts/sqlalchemy_import.py | anapenedos/PhosQuest | 5a0b363b55850b25f67382b3fa4d227b3ec1c2df | [
"Apache-2.0"
] | 2 | 2019-06-08T10:30:53.000Z | 2021-06-29T13:58:56.000Z | data_import_scripts/sqlalchemy_import.py | anapenedos/PhosQuest | 5a0b363b55850b25f67382b3fa4d227b3ec1c2df | [
"Apache-2.0"
] | null | null | null | data_import_scripts/sqlalchemy_import.py | anapenedos/PhosQuest | 5a0b363b55850b25f67382b3fa4d227b3ec1c2df | [
"Apache-2.0"
] | 1 | 2021-06-21T22:11:04.000Z | 2021-06-21T22:11:04.000Z | # Standard library imports
from sqlalchemy.inspection import inspect
from datetime import datetime, timedelta
from pandas import isnull
# project imports
from PhosQuest_app.data_access.db_sessions import import_session_maker
from PhosQuest_app.data_access.class_functions import get_classes_key_attrs
# define null-typ... | 42.857923 | 79 | 0.647074 |
c830d963bcc1f08caf5fac43417c5575986502aa | 609 | py | Python | app/make_db.py | brighaus/tarot-tracker | 32040d7f16362a1463d677fa0f52db56d5f5ad1e | [
"MIT"
] | null | null | null | app/make_db.py | brighaus/tarot-tracker | 32040d7f16362a1463d677fa0f52db56d5f5ad1e | [
"MIT"
] | null | null | null | app/make_db.py | brighaus/tarot-tracker | 32040d7f16362a1463d677fa0f52db56d5f5ad1e | [
"MIT"
] | null | null | null | __author__ = 'brighamhausman'
import app.init_data as idt
import app.db_config as db_cfg
import shelve
import uuid
def dump_db(storage_targ=db_cfg.DB_SHELF):
status = []
dbsrc = idt.get_db(idt.__RAW_FILE_TARGET__)
status.append('looping db' + str(dbsrc))
with shelve.open(storage_targ) as db:
f... | 25.375 | 47 | 0.673235 |
3e478dd662f6f9024d19d506f3ca22bdc6acc882 | 912 | py | Python | formation/views.py | ahemery/formation_usagers | eb50682db798922ec393050624c4cbd3bb23675a | [
"Apache-2.0"
] | null | null | null | formation/views.py | ahemery/formation_usagers | eb50682db798922ec393050624c4cbd3bb23675a | [
"Apache-2.0"
] | null | null | null | formation/views.py | ahemery/formation_usagers | eb50682db798922ec393050624c4cbd3bb23675a | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
def login_view(request):
return render(request, 'index.html',
{
})
def logout_view(request):
return render(request, 'index.html',
{
})
def index_view(request):
return render(request, 'index.html',
{
})
def formation_view(request,... | 10.857143 | 50 | 0.506579 |
ecdaac621afb412857435cc94d189f6ed7e9b577 | 2,728 | py | Python | tests/zeus/utils/test_builds.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | tests/zeus/utils/test_builds.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | tests/zeus/utils/test_builds.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | from datetime import timedelta
from zeus import factories
from zeus.constants import Status, Result
from zeus.utils import timezone
from zeus.utils.builds import fetch_build_for_revision, merge_build_group
def test_merge_build_group_different_providers(client, default_login, default_revision):
now = timezone.now... | 31.72093 | 88 | 0.719575 |
5cd51578386d122ba218a5538c2d40af15721e00 | 1,612 | py | Python | tests/integration/test_termination.py | jobvs/cf-mendix-buildpack | 7df5585b5ac8550fd36d21c9d354d74489ff78c0 | [
"Apache-2.0"
] | 1 | 2022-01-31T09:56:06.000Z | 2022-01-31T09:56:06.000Z | tests/integration/test_termination.py | jobvs/cf-mendix-buildpack | 7df5585b5ac8550fd36d21c9d354d74489ff78c0 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_termination.py | jobvs/cf-mendix-buildpack | 7df5585b5ac8550fd36d21c9d354d74489ff78c0 | [
"Apache-2.0"
] | 5 | 2018-12-17T09:45:17.000Z | 2020-11-17T22:08:10.000Z | from tests.integration import basetest
class TestCaseTermination(basetest.BaseTest):
# Tests that the process terminates with a stack trace when Python code
# errors. The env variable S3_ENCRYPTION_KEYS is used here, it doesn't
# have a try-except on it.
# TODO determine if we can unit test this / sh... | 35.043478 | 75 | 0.630273 |
16547a8e0be6976ee3b841603319a84d7caa0d25 | 117 | py | Python | peek/__init__.py | ywangd/peek | 25d196b614acaf9c2f9fe4b8fea36a06554950cd | [
"MIT"
] | 16 | 2020-08-31T02:06:23.000Z | 2022-01-31T23:56:44.000Z | peek/__init__.py | ywangd/peek | 25d196b614acaf9c2f9fe4b8fea36a06554950cd | [
"MIT"
] | 97 | 2020-08-27T14:51:32.000Z | 2021-10-21T00:19:31.000Z | peek/__init__.py | ywangd/peek | 25d196b614acaf9c2f9fe4b8fea36a06554950cd | [
"MIT"
] | 1 | 2021-02-07T13:10:38.000Z | 2021-02-07T13:10:38.000Z | """Top-level package for peek."""
__author__ = """Yang Wang"""
__email__ = 'ywangd@gmail.com'
__version__ = '0.2.2'
| 19.5 | 33 | 0.65812 |
fb761cbbed13568f9fc7086989be6108735dbef2 | 113,854 | py | Python | pywikibot/date.py | luzpaz/pywikibot | c2f1a2b7a972389d01be4fd0c76cb0677be8011a | [
"MIT"
] | null | null | null | pywikibot/date.py | luzpaz/pywikibot | c2f1a2b7a972389d01be4fd0c76cb0677be8011a | [
"MIT"
] | null | null | null | pywikibot/date.py | luzpaz/pywikibot | c2f1a2b7a972389d01be4fd0c76cb0677be8011a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Date data and manipulation module."""
#
# (C) Rob W.W. Hooft, 2003
# (C) Daniel Herding, 2004
# (C) Ævar Arnfjörð Bjarmason, 2004
# (C) Andre Engels, 2004-2005
# (C) Yuri Astrakhan, 2005-2006 (<Firstname><Lastname>@gmail.com)
# (years/decades/centuries/millenniums str <=> int conversion... | 47.75755 | 79 | 0.500167 |
ccfa509ddd73e5549904dbac4ace3d72c36601bf | 809 | py | Python | manage.py | vique254/Review | 958bb9d45c54565377fae7f8da7d2d253777a5a2 | [
"MIT"
] | null | null | null | manage.py | vique254/Review | 958bb9d45c54565377fae7f8da7d2d253777a5a2 | [
"MIT"
] | 4 | 2020-02-12T03:30:05.000Z | 2021-09-08T01:34:56.000Z | manage.py | vique254/Review | 958bb9d45c54565377fae7f8da7d2d253777a5a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "awards.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | 33.708333 | 77 | 0.637824 |
234c12827c5d9f658acdd33e61ac3618ca85c93f | 1,197 | py | Python | Examples/FFT_py/sine.py | madhavakrishna/libStubs | ea8ba8caf7ab2f592c1e1b38fae18eebb6c68e2f | [
"Unlicense"
] | null | null | null | Examples/FFT_py/sine.py | madhavakrishna/libStubs | ea8ba8caf7ab2f592c1e1b38fae18eebb6c68e2f | [
"Unlicense"
] | null | null | null | Examples/FFT_py/sine.py | madhavakrishna/libStubs | ea8ba8caf7ab2f592c1e1b38fae18eebb6c68e2f | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
import scipy.fftpack
import numpy as np
import matplotlib.pyplot as plt
# Number of samplepoints -- FFT size
N = 512
# sampling frequency : fs
# maximum frequency that can be measured "fs/2" Nyquist's theorem
fs= 1000 #Hz
# sampling time period = 1/fs
T = 1/fs
# length of the signal in time
L = N... | 26.6 | 79 | 0.675856 |
a1eb5feb2f1f7efeabace340c2475fe5312d0339 | 1,318 | py | Python | openstack_dashboard/dashboards/admin/dashboard.py | hashsos/hashcloudos-horizon | 0cc080ca6777e4a1dac5cbcc6143202baddab176 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/admin/dashboard.py | hashsos/hashcloudos-horizon | 0cc080ca6777e4a1dac5cbcc6143202baddab176 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/admin/dashboard.py | hashsos/hashcloudos-horizon | 0cc080ca6777e4a1dac5cbcc6143202baddab176 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 35.621622 | 78 | 0.653263 |
853147a611b2f9082033a8e2598774b94704e575 | 568 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractBluedreamsblogJimdofreeCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractBluedreamsblogJimdofreeCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractBluedreamsblogJimdofreeCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractBluedreamsblogJimdofreeCom(item):
'''
Parser for 'bluedreamsblog.jimdofree.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),... | 25.818182 | 104 | 0.644366 |
8a877fd49bb7044e8e1dca5cd4874b6a19ab7c24 | 2,148 | py | Python | Supported Languages/Python/smash/models/two_factor_authentication_model_response.py | SMASH-INC/API | d0679f199f786aa24f0510df078b4318c27dcc0f | [
"MIT"
] | null | null | null | Supported Languages/Python/smash/models/two_factor_authentication_model_response.py | SMASH-INC/API | d0679f199f786aa24f0510df078b4318c27dcc0f | [
"MIT"
] | null | null | null | Supported Languages/Python/smash/models/two_factor_authentication_model_response.py | SMASH-INC/API | d0679f199f786aa24f0510df078b4318c27dcc0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
smash.models.two_factor_authentication_model_response
This file was automatically generated for SMASH by SMASH v2.0 ( https://smashlabs.io )
"""
class TwoFactorAuthenticationModelResponse(object):
"""Implementation of the 'Two Factor Authentication Model Response' model.
... | 26.85 | 90 | 0.582868 |
412e42d963695845c374fb1972e17e53c57cb880 | 342 | py | Python | middleware/headers.py | enricobacis/flaskey | 203038b438545f33e2570e60974aab0a7af7bd2a | [
"Apache-2.0"
] | null | null | null | middleware/headers.py | enricobacis/flaskey | 203038b438545f33e2570e60974aab0a7af7bd2a | [
"Apache-2.0"
] | null | null | null | middleware/headers.py | enricobacis/flaskey | 203038b438545f33e2570e60974aab0a7af7bd2a | [
"Apache-2.0"
] | null | null | null | from flask.wrappers import Request
class HeaderGetter(object):
"""Header Getter middleware"""
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
req = Request(environ, shallow=True)
print req.headers.get('X-Auth-Token')
return self.app(env... | 26.307692 | 48 | 0.669591 |
166d84789674e7392faac57081156d323b920666 | 82 | py | Python | benchmarks/python/PythonApp1.py | satoshigeyuki/Centaurus | 032ffec87fc8ddb129347974d3478fd1ee5f305a | [
"MIT"
] | 3 | 2021-02-23T01:34:28.000Z | 2021-07-19T08:07:10.000Z | benchmarks/python/PythonApp1.py | satoshigeyuki/Centaurus | 032ffec87fc8ddb129347974d3478fd1ee5f305a | [
"MIT"
] | null | null | null | benchmarks/python/PythonApp1.py | satoshigeyuki/Centaurus | 032ffec87fc8ddb129347974d3478fd1ee5f305a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import CoreLib
if __name__ == "__main__":
pass | 11.714286 | 26 | 0.695122 |
51f574ee9cfdc982cc7a4179c2a530c3a62fbc2a | 803 | py | Python | utils/neuron/models/trackers/_dummy.py | tsingqguo/ABA | c32edbbe5705b0332a08951b5ee436b5f58c2e70 | [
"MIT"
] | 12 | 2021-07-27T07:18:24.000Z | 2022-03-09T13:52:20.000Z | utils/neuron/models/trackers/_dummy.py | tsingqguo/ABA | c32edbbe5705b0332a08951b5ee436b5f58c2e70 | [
"MIT"
] | 2 | 2021-08-03T09:21:33.000Z | 2021-12-29T14:25:30.000Z | utils/neuron/models/trackers/_dummy.py | tsingqguo/ABA | c32edbbe5705b0332a08951b5ee436b5f58c2e70 | [
"MIT"
] | 3 | 2021-11-18T14:46:40.000Z | 2022-01-03T15:47:23.000Z | from neuron.config import registry
from .tracker import Tracker, OxUvA_Tracker
__all__ = ['DummyTracker', 'DummyOxUvA_Tracker']
@registry.register_module
class DummyTracker(Tracker):
def __init__(self):
super(DummyTracker, self).__init__(
name='Dummy', is_deterministic=True, input_type='fil... | 23.617647 | 67 | 0.667497 |
628d5769eee2209f07a0c3229948824d1607a213 | 289,961 | py | Python | theano/tensor/opt.py | brandonwillard/Theano | f375a0e999b950a81824a003f685b0bfd1c4e405 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/opt.py | brandonwillard/Theano | f375a0e999b950a81824a003f685b0bfd1c4e405 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/opt.py | brandonwillard/Theano | f375a0e999b950a81824a003f685b0bfd1c4e405 | [
"BSD-3-Clause"
] | 1 | 2020-08-15T17:09:10.000Z | 2020-08-15T17:09:10.000Z | """ Tensor optimizations addressing the ops in basic.py."""
# TODO: intelligent merge for mul/add
# TODO: 0*x -> 0
import itertools
import logging
import operator
import sys
import time
import traceback
import warnings
from collections import defaultdict
from functools import reduce
import numpy as np
from six import... | 36.11871 | 109 | 0.567642 |
e66eb5c049e6a4d420c1e01f88b24ffdcd60c6fa | 10,411 | py | Python | src/python/m5/util/convert.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 765 | 2015-01-14T16:17:04.000Z | 2022-03-28T07:46:28.000Z | src/python/m5/util/convert.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 148 | 2018-07-20T00:58:36.000Z | 2021-11-16T01:52:33.000Z | src/python/m5/util/convert.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 807 | 2015-01-06T09:55:38.000Z | 2022-03-30T10:23:36.000Z | # Copyright (c) 2021 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | 32.033846 | 76 | 0.6326 |
ee3ef8c6d770029d574dee8516a8c2f54ac4b511 | 4,749 | py | Python | ce_api/models/body_update_loggedin_user_api_v1_users_put.py | maiot-io/cengine | 3a1946c449e8c5e1d216215df6eeab941eb1640a | [
"Apache-2.0"
] | 7 | 2020-10-13T12:47:32.000Z | 2021-03-12T12:00:14.000Z | ce_api/models/body_update_loggedin_user_api_v1_users_put.py | maiot-io/cengine | 3a1946c449e8c5e1d216215df6eeab941eb1640a | [
"Apache-2.0"
] | null | null | null | ce_api/models/body_update_loggedin_user_api_v1_users_put.py | maiot-io/cengine | 3a1946c449e8c5e1d216215df6eeab941eb1640a | [
"Apache-2.0"
] | 1 | 2021-01-23T02:19:42.000Z | 2021-01-23T02:19:42.000Z | # coding: utf-8
"""
maiot Core Engine API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
i... | 28.957317 | 119 | 0.592967 |
055c2360c29f569dcf051d340b61add1876285e1 | 4,651 | py | Python | app/models.py | Waithera-m/partage | 293905385839b7c36847a46c91e142cb2df2a3ae | [
"Unlicense"
] | null | null | null | app/models.py | Waithera-m/partage | 293905385839b7c36847a46c91e142cb2df2a3ae | [
"Unlicense"
] | null | null | null | app/models.py | Waithera-m/partage | 293905385839b7c36847a46c91e142cb2df2a3ae | [
"Unlicense"
] | null | null | null | from . import db
from datetime import datetime
from flask_login import UserMixin
from werkzeug.security import generate_password_hash,check_password_hash
from . import login_manager
@login_manager.user_loader
def load_user(user_id):
'''
function queries and returns user with a given id
'''
return User... | 25.696133 | 72 | 0.639647 |
c38fddd53a0fa233ab4d850b571d1d01836a5a5d | 2,559 | py | Python | rivernet_prep/call_streamnet_downsample.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | null | null | null | rivernet_prep/call_streamnet_downsample.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | null | null | null | rivernet_prep/call_streamnet_downsample.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | 3 | 2020-11-08T16:01:47.000Z | 2021-01-13T17:13:32.000Z | # Python script to process downsampled hydrography from 'downsample_hydro.py
# Calls streamnet function and creates 'rec'.csv (using jsosa/LFPtools), to describe the river network
#
# Requires:
# mpiexec
# streamnet from TauDEM (https://github.com/dtarb/TauDEM)
# split module from LFPtools (https://github.com/jsosa/LFP... | 41.95082 | 199 | 0.745604 |
a4b675268ac471c4a3ebf5138fd69725cd7f6186 | 1,591 | py | Python | tests/test_tensorboard.py | TreeKid/stable-baselines | 129c1958160b95962b887c312cd2273aed35df60 | [
"MIT"
] | 19 | 2020-06-26T18:45:35.000Z | 2022-03-08T14:20:32.000Z | tests/test_tensorboard.py | TreeKid/stable-baselines | 129c1958160b95962b887c312cd2273aed35df60 | [
"MIT"
] | 7 | 2020-11-13T17:48:40.000Z | 2022-03-12T00:35:14.000Z | tests/test_tensorboard.py | TreeKid/stable-baselines | 129c1958160b95962b887c312cd2273aed35df60 | [
"MIT"
] | 7 | 2019-10-01T05:49:22.000Z | 2021-12-24T07:11:55.000Z | import os
import shutil
import pytest
from stable_baselines import A2C, ACER, ACKTR, DQN, DDPG, PPO1, PPO2, SAC, TD3, TRPO
TENSORBOARD_DIR = '/tmp/tb_dir/'
if os.path.isdir(TENSORBOARD_DIR):
shutil.rmtree(TENSORBOARD_DIR)
MODEL_DICT = {
'a2c': (A2C, 'CartPole-v1'),
'acer': (ACER, 'CartPole-v1'),
'a... | 31.196078 | 84 | 0.688246 |
3f0757d8d95aff8b257f6a2291725fba81464eac | 836 | py | Python | MergeSortRecursive.py | sidhu177/pythonprog | a75285e9e4d3cd6f1257b9a79dc39e49c68a695d | [
"MIT"
] | 2 | 2019-05-01T04:32:07.000Z | 2019-05-04T02:22:16.000Z | MergeSortRecursive.py | sidhu177/pythonprog | a75285e9e4d3cd6f1257b9a79dc39e49c68a695d | [
"MIT"
] | null | null | null | MergeSortRecursive.py | sidhu177/pythonprog | a75285e9e4d3cd6f1257b9a79dc39e49c68a695d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
taken from Data Structures and Algorithms using Python, Lee and Hubbard, Springer
"""
def merge(seq,start,mid,stop):
lst = []
i = start
j = mid
while i < mid and j < stop:
if seq[i] <seq[j]:
lst.append(seq[i])
i+=1
e... | 22.594595 | 82 | 0.503589 |
f49ead240d62e2d34df1e26b24971939c8c51227 | 100 | py | Python | pan_cortex_data_lake/adapters/__init__.py | Faqa/pan-cortex-data-lake-python | cfa0cfca48e7c659e173ded9687b48ff08ef1d69 | [
"ISC"
] | 27 | 2018-03-19T08:12:47.000Z | 2019-12-10T04:15:00.000Z | pan_cortex_data_lake/adapters/__init__.py | Faqa/pan-cortex-data-lake-python | cfa0cfca48e7c659e173ded9687b48ff08ef1d69 | [
"ISC"
] | 55 | 2018-03-16T19:53:04.000Z | 2019-04-03T16:34:26.000Z | pan_cortex_data_lake/adapters/__init__.py | Faqa/pan-cortex-data-lake-python | cfa0cfca48e7c659e173ded9687b48ff08ef1d69 | [
"ISC"
] | 9 | 2018-03-21T18:03:42.000Z | 2019-10-06T03:56:58.000Z | # -*- coding: utf-8 -*-
"""Adapters package."""
from .adapter import StorageAdapter # noqa: F401
| 16.666667 | 49 | 0.64 |
f84aab692d42b9386991062eaaa4f123fa7b95c1 | 12,549 | py | Python | main.py | Trxppy/ecosystem-simulator | df7e953813c42978ec2588dec363d4b4000817a7 | [
"MIT"
] | null | null | null | main.py | Trxppy/ecosystem-simulator | df7e953813c42978ec2588dec363d4b4000817a7 | [
"MIT"
] | null | null | null | main.py | Trxppy/ecosystem-simulator | df7e953813c42978ec2588dec363d4b4000817a7 | [
"MIT"
] | null | null | null | # import modules
from classes.environment import *
from classes.plant import *
# startup file
version = "0.2.0"
print("-- Ecosystem Simulator")
print("--- Developed by Matthew Grant")
print("---- Version " + str(version) + "\n")
# setup stages vars
program_active = True
environment_setup_active = True
organism_setup_... | 44.031579 | 148 | 0.553431 |
8eddf413e1fea5d428259911adbba6e19c4a641b | 11,500 | py | Python | wpa_pyfi/network.py | garretthagen21/rpi3-wifi | 540f4e7bfe4ffa4c4e02d3e6cfea80a4438de2ca | [
"BSD-2-Clause"
] | null | null | null | wpa_pyfi/network.py | garretthagen21/rpi3-wifi | 540f4e7bfe4ffa4c4e02d3e6cfea80a4438de2ca | [
"BSD-2-Clause"
] | null | null | null | wpa_pyfi/network.py | garretthagen21/rpi3-wifi | 540f4e7bfe4ffa4c4e02d3e6cfea80a4438de2ca | [
"BSD-2-Clause"
] | 1 | 2021-12-12T08:20:24.000Z | 2021-12-12T08:20:24.000Z | #!/usr/bin/python3
#
# @file network.py
#
# @brief This class handles network configurations that are loaded to and from wpa_supplicant.conf
#
# @author Garrett Hagen <garretthagen21@gmail.com>
#
# @date 2021-01-03
#
import subprocess
from ifconfigparser import IfconfigParser
from operator import attrgett... | 35.9375 | 118 | 0.600348 |
8c7a7370f81a5b81d08c87136688765dce556ada | 4,554 | py | Python | research/qa_kg/model_n2nmn/modules.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | research/qa_kg/model_n2nmn/modules.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | research/qa_kg/model_n2nmn/modules.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 1,474 | 2018-02-01T04:33:18.000Z | 2022-03-08T07:02:20.000Z | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.5 | 80 | 0.628898 |
337dc273a3a96c1b2acff01c11087521ce1cb7b5 | 569 | py | Python | spacy_lookups_data/tests/test_hr.py | spacy-pl/spacy-lookups-data | 54ed95b020a7b0f15df8f872346211d39edf5053 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_hr.py | spacy-pl/spacy-lookups-data | 54ed95b020a7b0f15df8f872346211d39edf5053 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_hr.py | spacy-pl/spacy-lookups-data | 54ed95b020a7b0f15df8f872346211d39edf5053 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from spacy.lang.hr import Croatian
import pytest
@pytest.fixture(scope="session")
def hr_nlp():
return Croatian()
@pytest.mark.parametrize(
"string,lemma",
[
("trčao", "trčati"),
("adekvatnim", "adekvatan"),
("dekontaminaci... | 21.074074 | 61 | 0.625659 |
7ec62be260c612073877078c19e391d54210c429 | 1,729 | py | Python | setup.py | boogieLing/r0redis | 15508c5cf6f86dab001af5cb70bcd5f3bf3777fe | [
"MIT"
] | null | null | null | setup.py | boogieLing/r0redis | 15508c5cf6f86dab001af5cb70bcd5f3bf3777fe | [
"MIT"
] | null | null | null | setup.py | boogieLing/r0redis | 15508c5cf6f86dab001af5cb70bcd5f3bf3777fe | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('README.rst', 'r') as fp:
long_description = fp.read()
setup(
name='r0redis',
version='0.4.5',
description='Easily store, index, and modify Python dicts in Redis (with flexible searching)',
long_description=long_description,
author='r0',
... | 31.436364 | 98 | 0.591093 |
9d8163afe575fae6f06b87a5b0d20f6fe78aa35d | 8,934 | py | Python | benchmarks/exps/old/card233.py | SymbioticLab/Salus | b2a194e7e4654b51dbd8d8fc1577fb1e9915ca6f | [
"Apache-2.0"
] | 104 | 2019-02-12T20:41:07.000Z | 2022-03-07T16:58:47.000Z | benchmarks/exps/old/card233.py | SymbioticLab/Salus | b2a194e7e4654b51dbd8d8fc1577fb1e9915ca6f | [
"Apache-2.0"
] | 9 | 2019-08-24T03:23:21.000Z | 2021-06-06T17:59:07.000Z | benchmarks/exps/old/card233.py | SymbioticLab/Salus | b2a194e7e4654b51dbd8d8fc1577fb1e9915ca6f | [
"Apache-2.0"
] | 18 | 2019-03-04T07:45:41.000Z | 2021-09-15T22:13:07.000Z | # -*- coding: future_fstrings -*-
#
# Copyright 2019 Peifeng Yu <peifeng@umich.edu>
#
# This file is part of Salus
# (see https://github.com/SymbioticLab/Salus).
#
# 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 co... | 39.184211 | 115 | 0.561898 |
89551b72d08b7daa3b86e6d52500c2b1c4b43371 | 32 | py | Python | python/eda/eda/components/ST/__init__.py | 32bitmicro/EDA | 476a7f6dda23a494788bfdfaa27dff7082a80d6d | [
"BSD-3-Clause"
] | 1 | 2019-06-05T20:01:19.000Z | 2019-06-05T20:01:19.000Z | python/eda/eda/components/ST/__init__.py | 32bitmicro/EDA | 476a7f6dda23a494788bfdfaa27dff7082a80d6d | [
"BSD-3-Clause"
] | null | null | null | python/eda/eda/components/ST/__init__.py | 32bitmicro/EDA | 476a7f6dda23a494788bfdfaa27dff7082a80d6d | [
"BSD-3-Clause"
] | null | null | null | from eda.components.ST import *
| 16 | 31 | 0.78125 |
385951b66a0a0fe4caa0afdbbe49563371afba3a | 113 | py | Python | test/schedule/apps.py | rishikumar/django_test_model | 72c9fe41795da85d5e113f81e7705fc76439cd4e | [
"BSD-3-Clause"
] | null | null | null | test/schedule/apps.py | rishikumar/django_test_model | 72c9fe41795da85d5e113f81e7705fc76439cd4e | [
"BSD-3-Clause"
] | null | null | null | test/schedule/apps.py | rishikumar/django_test_model | 72c9fe41795da85d5e113f81e7705fc76439cd4e | [
"BSD-3-Clause"
] | null | null | null | from django import apps
class AppConfig(apps.AppConfig):
name = 'test.schedule'
label = 'test.schedule' | 18.833333 | 32 | 0.707965 |
77db8b89e6103769719b08fa74e6c96aa3d0df7a | 1,921 | py | Python | setup.py | Scout24/snakepit | afd7b1837fc9d2c083071413ce2be2eae7578f30 | [
"Apache-2.0"
] | null | null | null | setup.py | Scout24/snakepit | afd7b1837fc9d2c083071413ce2be2eae7578f30 | [
"Apache-2.0"
] | null | null | null | setup.py | Scout24/snakepit | afd7b1837fc9d2c083071413ce2be2eae7578f30 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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
#
# ... | 34.303571 | 107 | 0.7038 |
1ea26451d3671f87df15bdff948b7f9c503a19fd | 152,248 | py | Python | src/sage/schemes/elliptic_curves/ell_curve_isogeny.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/schemes/elliptic_curves/ell_curve_isogeny.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/schemes/elliptic_curves/ell_curve_isogeny.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | # -*- coding: utf-8 -*-
r"""
Isogenies
An isogeny `\varphi: E_1\to E_2` between two elliptic curves `E_1` and
`E_2` is a morphism of curves that sends the origin of `E_1` to the
origin of `E_2`. Such a morphism is automatically a morphism of group
schemes and the kernel is a finite subgroup scheme of `E_1`. Such a
su... | 36.783764 | 632 | 0.567219 |
63b2242d3e00341f402fcb1ddf1e9b21b3ecb7ba | 2,800 | py | Python | pnc_cli/swagger_client/models/singleton.py | SakuragawaAsaba/pnc-cli | 0e0c5976766f6d2e32980c39ebc30950fc02960e | [
"Apache-2.0"
] | null | null | null | pnc_cli/swagger_client/models/singleton.py | SakuragawaAsaba/pnc-cli | 0e0c5976766f6d2e32980c39ebc30950fc02960e | [
"Apache-2.0"
] | 3 | 2015-06-01T22:12:27.000Z | 2015-10-11T16:20:11.000Z | pnc_cli/swagger_client/models/singleton.py | SakuragawaAsaba/pnc-cli | 0e0c5976766f6d2e32980c39ebc30950fc02960e | [
"Apache-2.0"
] | 5 | 2015-05-28T18:14:36.000Z | 2018-07-20T07:38:21.000Z | # coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 26.666667 | 77 | 0.577143 |
c0036e6c7b492b9788c40b1295d4658513bfe064 | 5,018 | py | Python | docs/conf.py | KCRW-org/kcrw.apple_news | 81c0a402f210e87ae73fe02a3d39b7929c328ceb | [
"MIT"
] | null | null | null | docs/conf.py | KCRW-org/kcrw.apple_news | 81c0a402f210e87ae73fe02a3d39b7929c328ceb | [
"MIT"
] | 85 | 2020-03-09T22:40:20.000Z | 2022-03-31T01:10:18.000Z | docs/conf.py | KCRW-org/kcrw.apple_news | 81c0a402f210e87ae73fe02a3d39b7929c328ceb | [
"MIT"
] | 2 | 2021-05-12T17:37:09.000Z | 2021-08-14T11:30:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# kcrw.apple_news documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 30 09:17:41 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | 30.228916 | 77 | 0.685731 |
0a5b2ef1c3467c21127cfd982730d7b27332d282 | 8,279 | py | Python | gan-script.py | godmoves/GAN_MNIST | 92dddc40f1b85ffaeba3387228ea0cd523b0a524 | [
"MIT"
] | null | null | null | gan-script.py | godmoves/GAN_MNIST | 92dddc40f1b85ffaeba3387228ea0cd523b0a524 | [
"MIT"
] | null | null | null | gan-script.py | godmoves/GAN_MNIST | 92dddc40f1b85ffaeba3387228ea0cd523b0a524 | [
"MIT"
] | null | null | null | """
This is a straightforward Python implementation of a generative adversarial network.
The code is drawn directly from the O'Reilly interactive tutorial on GANs
(https://www.oreilly.com/learning/generative-adversarial-networks-for-beginners).
A version of this model with explanatory notes is also available on GitHub... | 45.489011 | 136 | 0.70552 |
3172772e1b4277d0d877d131e2815b189b33bcfd | 195 | py | Python | src/aio_dtls/dtls/handshake_ecdhe_psk.py | businka/aio_dtls | 0dba40d425b443e5ceb516011aadf58f573a4dc8 | [
"MIT"
] | null | null | null | src/aio_dtls/dtls/handshake_ecdhe_psk.py | businka/aio_dtls | 0dba40d425b443e5ceb516011aadf58f573a4dc8 | [
"MIT"
] | null | null | null | src/aio_dtls/dtls/handshake_ecdhe_psk.py | businka/aio_dtls | 0dba40d425b443e5ceb516011aadf58f573a4dc8 | [
"MIT"
] | null | null | null | from .helper import Helper
from ..constructs import dtls
from ..tls.handshake_ecdhe_psk import EcdhePsk as TlsEcdhePsk
class EcdhePsk(TlsEcdhePsk):
tls_construct = dtls
helper = Helper
| 21.666667 | 61 | 0.779487 |
50a62ee105a643ebb7ca172adc067f69aea63a81 | 19,525 | py | Python | google/ads/google_ads/v2/services/campaign_bid_modifier_service_client.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v2/services/campaign_bid_modifier_service_client.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v2/services/campaign_bid_modifier_service_client.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2020-03-13T00:14:31.000Z | 2020-03-13T00:14:31.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 52.486559 | 176 | 0.725787 |
e805319d651ea65e204b8fd744367a789289d818 | 57,572 | py | Python | ion_functions/data/adcp_functions.py | ooici/ion-functions | ad5f7a1a00e3d359c72156d64f59686705c09d53 | [
"Apache-2.0"
] | 10 | 2015-04-03T15:32:21.000Z | 2018-11-21T11:57:26.000Z | ion_functions/data/adcp_functions.py | ooici/ion-functions | ad5f7a1a00e3d359c72156d64f59686705c09d53 | [
"Apache-2.0"
] | 8 | 2015-01-07T15:19:22.000Z | 2015-12-08T18:14:04.000Z | ion_functions/data/adcp_functions.py | ooici/ion-functions | ad5f7a1a00e3d359c72156d64f59686705c09d53 | [
"Apache-2.0"
] | 17 | 2015-01-14T16:23:00.000Z | 2021-07-19T08:26:52.000Z | #!/usr/bin/env python
"""
@package ion_functions.data.adcp_functions
@file ion_functions/data/adcp_functions.py
@author Christopher Wingard, Russell Desiderio, Craig Risien
@brief Module containing ADCP related data-calculations.
"""
import numpy as np
from ion_functions.data.generic_functions import magnetic_d... | 40.036161 | 103 | 0.63418 |
66f7c2fde8d72f64a1371ced7e47b3ca47545073 | 8,290 | py | Python | tests/edalize_common.py | idex-biometrics/edalize | 36a12f8e47ffb0cda4e6c8fe76fafb2073fa7704 | [
"BSD-2-Clause"
] | 1 | 2022-03-17T23:30:32.000Z | 2022-03-17T23:30:32.000Z | tests/edalize_common.py | idex-biometrics/edalize | 36a12f8e47ffb0cda4e6c8fe76fafb2073fa7704 | [
"BSD-2-Clause"
] | null | null | null | tests/edalize_common.py | idex-biometrics/edalize | 36a12f8e47ffb0cda4e6c8fe76fafb2073fa7704 | [
"BSD-2-Clause"
] | null | null | null | from collections import OrderedDict
import os.path
import shutil
import pytest
from edalize import get_edatool
tests_dir = os.path.dirname(__file__)
class TestFixture:
"""A fixture that makes an edalize backend with work_root directory
Create this object using the make_edalize_test factory fixture. This ... | 33.97541 | 84 | 0.602654 |
323e78e9c2f1f27943fa2cfa3516158f210c9e33 | 627 | py | Python | helpers/db_test.py | thejeswi/BobGoesToJail | ac8a6e4242446634837d6166158fc5401c2818ac | [
"MIT"
] | 3 | 2018-08-20T14:14:01.000Z | 2020-06-15T17:39:24.000Z | helpers/db_test.py | thejeswi/BobGoesToJail | ac8a6e4242446634837d6166158fc5401c2818ac | [
"MIT"
] | null | null | null | helpers/db_test.py | thejeswi/BobGoesToJail | ac8a6e4242446634837d6166158fc5401c2818ac | [
"MIT"
] | 1 | 2020-06-15T17:39:26.000Z | 2020-06-15T17:39:26.000Z | from pymongo import MongoClient
client = MongoClient()
client = MongoClient('localhost', 27017)
db = client['raw_law']
laws_db = db.laws
from filters.corpus2DB.schema import raw_law
def insert_law():
newLaw = raw_law()
newLaw.num = "15",
newLaw.title = "Law Title",
newLaw.text = ["This is a law_text"... | 20.9 | 57 | 0.674641 |
bb2616edfa38a9263b89efd33043053520c3ae53 | 559 | py | Python | moceansdk/exceptions/__init__.py | d3no/mocean-sdk-python | cbc215a0eb8aa26c04afb940eab6482f23150c75 | [
"MIT"
] | null | null | null | moceansdk/exceptions/__init__.py | d3no/mocean-sdk-python | cbc215a0eb8aa26c04afb940eab6482f23150c75 | [
"MIT"
] | null | null | null | moceansdk/exceptions/__init__.py | d3no/mocean-sdk-python | cbc215a0eb8aa26c04afb940eab6482f23150c75 | [
"MIT"
] | null | null | null | class MoceanErrorException(Exception):
def __init__(self, msg, error_response=None):
if error_response is not None:
super(MoceanErrorException, self).__init__(
error_response['err_msg'])
self._error_response = error_response
else:
super(MoceanError... | 27.95 | 59 | 0.694097 |
fb8d9cc6746634508619bc782e723a37b1331f1d | 81 | py | Python | modtools/version.py | yash-agrawal/lapels | 7aef03226c35ffa125c452d0c3f15f14da432d0d | [
"MIT"
] | 2 | 2015-06-21T18:41:49.000Z | 2018-08-13T18:51:41.000Z | modtools/version.py | yash-agrawal/lapels | 7aef03226c35ffa125c452d0c3f15f14da432d0d | [
"MIT"
] | 3 | 2015-06-21T18:47:12.000Z | 2016-09-20T22:31:31.000Z | modtools/version.py | yash-agrawal/lapels | 7aef03226c35ffa125c452d0c3f15f14da432d0d | [
"MIT"
] | null | null | null | '''
Created on Oct 31, 2012
@author: Shunping Huang
'''
__mod_version__ = '0.1' | 11.571429 | 23 | 0.666667 |
f5ebc8e1ab85f151c1fda77ace945aa55f9c9bf1 | 15,976 | py | Python | utils/lib/netbox/ingest.py | mrlesmithjr/netbox | 0e9ba9c21e1a054c7ac5b5d9abbb0817883e544c | [
"MIT"
] | 4 | 2020-05-10T12:13:02.000Z | 2021-04-23T13:59:39.000Z | utils/lib/netbox/ingest.py | mrlesmithjr/netbox | 0e9ba9c21e1a054c7ac5b5d9abbb0817883e544c | [
"MIT"
] | 1 | 2021-09-23T23:31:38.000Z | 2021-09-23T23:31:38.000Z | utils/lib/netbox/ingest.py | mrlesmithjr/netbox | 0e9ba9c21e1a054c7ac5b5d9abbb0817883e544c | [
"MIT"
] | null | null | null | """lib/netbox/ingest.py"""
class NetBoxIngest:
"""Main NetBox ingestion class"""
def __init__(self, netbox):
self.netbox_data = {}
self.netbox = netbox
def data(self):
"""Collect all relevant NetBox data"""
# DCIM
self.dcim_collections()
# Tenancy
... | 35.740492 | 81 | 0.626377 |
4b2e27b7425b4b13f6fce76c24fbab59a396923d | 4,333 | py | Python | tensorforce/core/optimizers/tf_optimizer.py | perara/tensorforce | c0da10893d92f44c6fbbf482e511d2ccdc53147d | [
"Apache-2.0"
] | 1 | 2019-04-06T10:04:00.000Z | 2019-04-06T10:04:00.000Z | tensorforce/core/optimizers/tf_optimizer.py | petrosgk/tensorforce | dd04f904acac78fd185ea8ee2c3ce6bac8859c1d | [
"Apache-2.0"
] | null | null | null | tensorforce/core/optimizers/tf_optimizer.py | petrosgk/tensorforce | dd04f904acac78fd185ea8ee2c3ce6bac8859c1d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 reinforce.io. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.809917 | 112 | 0.649896 |
6575dc57538f9d81bb46603e7b09e4b3c091c775 | 870 | py | Python | python_lib/setup.py | scorelab/bassa-client-libraries | a1a9d6c73d624646bdeabc5ffeb8c8ad28957887 | [
"Apache-2.0"
] | 7 | 2020-05-20T15:35:54.000Z | 2020-06-20T08:18:41.000Z | python_lib/setup.py | scorelab/BassaClient | a1a9d6c73d624646bdeabc5ffeb8c8ad28957887 | [
"Apache-2.0"
] | 12 | 2020-05-23T08:50:13.000Z | 2020-06-28T09:01:58.000Z | python_lib/setup.py | scorelab/bassa-client-libraries | a1a9d6c73d624646bdeabc5ffeb8c8ad28957887 | [
"Apache-2.0"
] | 2 | 2020-05-20T15:35:56.000Z | 2020-05-21T20:47:48.000Z | import setuptools
def readme():
with open('README.md') as f:
README = f.read()
return README
setuptools.setup(
name="bassa-kmehant",
version="1.0.0-alpha.1",
author="Mehant Kammakomati",
author_email="kmehant@scorelab.org",
description="Python Client Library for the Bassa Project... | 28.064516 | 62 | 0.63908 |
e2f548475bbe7b7c32e2650c462d529df5e4b1bb | 5,003 | py | Python | test/mapping/who2016_child_mapping.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | test/mapping/who2016_child_mapping.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | test/mapping/who2016_child_mapping.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | MAPPING = [
{
'sid': 'Mother alive',
'symptom': 's7',
'Id10356': 'yes'
},
{
'sid': 'Baby cried',
'symptom': 's17',
'Id10104': 'yes'
},
{
'sid': 'Baby moved',
'symptom': 's18',
'Id10109': 'yes'
},
{
'sid': 'Baby ... | 22.137168 | 68 | 0.41635 |
14ee41fa6822d462a533f523294d0ef5681c903c | 9,790 | py | Python | docs/conf.py | joaopfonseca/ml-research | a2a063e341010397bd13df812109f31ce05ac9f7 | [
"MIT"
] | 1 | 2021-12-13T09:27:06.000Z | 2021-12-13T09:27:06.000Z | docs/conf.py | joaopfonseca/research | ac4ad6fa05b5985050c63dc9e4e18cd00965e09b | [
"MIT"
] | 20 | 2021-12-10T11:54:59.000Z | 2022-03-18T17:55:33.000Z | docs/conf.py | joaopfonseca/research | ac4ad6fa05b5985050c63dc9e4e18cd00965e09b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# research documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have ... | 31.993464 | 93 | 0.703779 |
96263cbb0e9bd5a42cb3f8a946aab1e010b729bc | 2,888 | py | Python | scipy/fftpack/__init__.py | seberg/scipy | d8081cdd40ed8cbebd5905c0ad6c323c57d5da6e | [
"BSD-3-Clause"
] | 2 | 2015-10-30T10:04:46.000Z | 2017-03-11T00:58:21.000Z | scipy/fftpack/__init__.py | seberg/scipy | d8081cdd40ed8cbebd5905c0ad6c323c57d5da6e | [
"BSD-3-Clause"
] | null | null | null | scipy/fftpack/__init__.py | seberg/scipy | d8081cdd40ed8cbebd5905c0ad6c323c57d5da6e | [
"BSD-3-Clause"
] | null | null | null | """
==================================================
Discrete Fourier transforms (:mod:`scipy.fftpack`)
==================================================
Fast Fourier Transforms (FFTs)
==============================
.. autosummary::
:toctree: generated/
fft - Fast (discrete) Fourier Transform (FFT)
ifft ... | 26.254545 | 78 | 0.634003 |
c8996ae4229ee74a69510d5c06e8001344d093f6 | 4,684 | py | Python | doc2dash/parsers/sphinx.py | ofan/doc2dash | 6691678b9f86e6c357d4257d6634f9e29f6f087d | [
"MIT"
] | null | null | null | doc2dash/parsers/sphinx.py | ofan/doc2dash | 6691678b9f86e6c357d4257d6634f9e29f6f087d | [
"MIT"
] | 2 | 2021-03-31T19:56:06.000Z | 2021-12-13T20:45:07.000Z | doc2dash/parsers/sphinx.py | ofan/doc2dash | 6691678b9f86e6c357d4257d6634f9e29f6f087d | [
"MIT"
] | null | null | null | import errno
import logging
import os
import re
from bs4 import BeautifulSoup
from . import types
from .base import _BaseParser
log = logging.getLogger(__name__)
class SphinxParser(_BaseParser):
"""Parser for Sphinx-based documenation: Python, Django, Pyramid..."""
name = 'sphinx'
DETECT_FILE = '_s... | 29.093168 | 79 | 0.54526 |
0dccd1c415b1d2bd1cd969fa2f6091e843b0a658 | 3,835 | py | Python | misc/config_tools/scenario_config/ivshmem_cfg_h.py | donsheng/acrn-hypervisor | 79edf8ba08f3f6d11d1ccf464b208c80b5b0fd24 | [
"BSD-3-Clause"
] | 2 | 2020-09-14T06:48:39.000Z | 2020-10-12T14:21:01.000Z | misc/config_tools/scenario_config/ivshmem_cfg_h.py | donsheng/acrn-hypervisor | 79edf8ba08f3f6d11d1ccf464b208c80b5b0fd24 | [
"BSD-3-Clause"
] | 4 | 2021-11-09T10:08:28.000Z | 2021-12-30T06:13:44.000Z | misc/config_tools/scenario_config/ivshmem_cfg_h.py | donsheng/acrn-hypervisor | 79edf8ba08f3f6d11d1ccf464b208c80b5b0fd24 | [
"BSD-3-Clause"
] | 2 | 2019-03-25T02:54:20.000Z | 2019-03-27T04:06:21.000Z | # Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import common
import scenario_cfg_lib
import board_cfg_lib
IVSHMEM_HEADER_DEFINE = scenario_cfg_lib.HEADER_LICENSE + r"""
#ifndef IVSHMEM_CFG_H
#define IVSHMEM_CFG_H
"""
IVSHMEM_END_DEFINE = r"""#endif /* IVSHMEM_... | 37.598039 | 129 | 0.619296 |
33d09199ec422681a4315ded2400ab8c12ced50e | 575 | py | Python | engine/date_tools.py | gabrii/TrendsEngine | afe141704421aaac999cda8c3292fb418fb86cfa | [
"MIT"
] | null | null | null | engine/date_tools.py | gabrii/TrendsEngine | afe141704421aaac999cda8c3292fb418fb86cfa | [
"MIT"
] | null | null | null | engine/date_tools.py | gabrii/TrendsEngine | afe141704421aaac999cda8c3292fb418fb86cfa | [
"MIT"
] | null | null | null | from datetime import datetime, date
def from_timestamp(timestamp: int) -> date:
"""Returns date from timestamp in utc."""
return datetime.utcfromtimestamp(timestamp)
def isocalendar(_date: date) -> (int, int):
"""Wraper for isocaReturns a tuple with (year, week).
The week is from ISO-8601 Calenda... | 28.75 | 72 | 0.673043 |
6b7406e8e3619d94aee96dbff9cdf76be604a9f7 | 610 | py | Python | utils_components/string.py | BhasherBEL/ProgrammingChallenges | e697c7f7e3d8177b9ee615918f3c78b645b927d0 | [
"MIT"
] | null | null | null | utils_components/string.py | BhasherBEL/ProgrammingChallenges | e697c7f7e3d8177b9ee615918f3c78b645b927d0 | [
"MIT"
] | 1 | 2020-12-09T12:00:56.000Z | 2020-12-09T12:00:56.000Z | utils_components/string.py | BhasherBEL/ProgrammingChallenges | e697c7f7e3d8177b9ee615918f3c78b645b927d0 | [
"MIT"
] | 1 | 2020-12-09T11:38:49.000Z | 2020-12-09T11:38:49.000Z | class String:
@staticmethod
def levenshtein_distance(w1: str, w2: str) -> int:
if len(w1) == 0 or len(w2) == 0:
return max(len(w1), len(w2))
if w1[0] == w2[0]:
return String.levenshtein_distance(w1[1:], w2[1:])
return 1 + min(
String.levenshtein_dist... | 32.105263 | 81 | 0.540984 |
a6eb5a3372bbaf375f66e66c6814e8a325377e0a | 8,722 | py | Python | proxy/http/websocket.py | certusone/proxy-model.py | 9b6babbc4b78cc8e51e7286ea27ad724662c4f0f | [
"BSD-3-Clause"
] | 4 | 2021-09-10T21:29:27.000Z | 2021-11-17T01:43:58.000Z | proxy/http/websocket.py | certusone/proxy-model.py | 9b6babbc4b78cc8e51e7286ea27ad724662c4f0f | [
"BSD-3-Clause"
] | 339 | 2021-04-28T06:38:54.000Z | 2022-03-31T11:16:36.000Z | proxy/http/websocket.py | certusone/proxy-model.py | 9b6babbc4b78cc8e51e7286ea27ad724662c4f0f | [
"BSD-3-Clause"
] | 5 | 2021-08-17T14:30:28.000Z | 2022-01-18T07:19:47.000Z | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | 32.423792 | 88 | 0.560881 |
4f1321437fc6605c0a810469d2f2d7761a9ab0bd | 4,854 | py | Python | src/zocalo/cli/queue_drain.py | woutdenolf/python-zocalo | d35f1316bcc34c32bd6a8c62e6eab2c3c1484443 | [
"BSD-3-Clause"
] | null | null | null | src/zocalo/cli/queue_drain.py | woutdenolf/python-zocalo | d35f1316bcc34c32bd6a8c62e6eab2c3c1484443 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T15:55:19.000Z | 2021-12-13T12:35:11.000Z | src/zocalo/cli/queue_drain.py | stufisher/python-zocalo | d35f1316bcc34c32bd6a8c62e6eab2c3c1484443 | [
"BSD-3-Clause"
] | null | null | null | #
# zocalo.queue_drain
# Drain one queue into another in a controlled manner
#
import argparse
import queue
import sys
import time
from datetime import datetime
import workflows.recipe.wrapper
import workflows.transport
import zocalo.configuration
def show_cluster_info(step):
try:
print("Beamline " ... | 29.962963 | 87 | 0.57396 |
68f7c5867b770849f72c0aadaf6b584916c1b033 | 1,257 | py | Python | venv/lib/python3.7/site-packages/datalad/tests/test_installed.py | emmetaobrien/dats-validator | fb25f97a32119c2bce4eb50dc080a93d5ee77141 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/datalad/tests/test_installed.py | emmetaobrien/dats-validator | fb25f97a32119c2bce4eb50dc080a93d5ee77141 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/datalad/tests/test_installed.py | emmetaobrien/dats-validator | fb25f97a32119c2bce4eb50dc080a93d5ee77141 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## #... | 36.970588 | 93 | 0.588703 |
cc597254aecb7628314a64896988e3697e1008b5 | 1,753 | py | Python | retinex/utils.py | Mikehem/ImageEnhancement | 6e2df5b8e3d9147e0109f72204425f0fbebe0ae0 | [
"MIT"
] | null | null | null | retinex/utils.py | Mikehem/ImageEnhancement | 6e2df5b8e3d9147e0109f72204425f0fbebe0ae0 | [
"MIT"
] | null | null | null | retinex/utils.py | Mikehem/ImageEnhancement | 6e2df5b8e3d9147e0109f72204425f0fbebe0ae0 | [
"MIT"
] | null | null | null | import numpy as np
from PIL import Image
def data_augmentation(image, mode):
if mode == 0:
# original
return image
elif mode == 1:
# flip up and down
return np.flipud(image)
elif mode == 2:
# rotate counterwise 90 degree
return np.rot90(image)
... | 29.711864 | 79 | 0.585282 |
f928c3d0c1f38bfbd894e51617927851be4b6ccd | 2,109 | py | Python | tests/handlers/test_widgets.py | hgs847825/redash | 11d09b2f0945fb90898b68b730d12e7a52190251 | [
"BSD-2-Clause"
] | 4 | 2018-07-31T09:39:33.000Z | 2019-05-22T23:56:18.000Z | tests/handlers/test_widgets.py | hgs847825/redash | 11d09b2f0945fb90898b68b730d12e7a52190251 | [
"BSD-2-Clause"
] | 1 | 2018-04-16T20:27:32.000Z | 2018-04-16T20:27:32.000Z | tests/handlers/test_widgets.py | hgs847825/redash | 11d09b2f0945fb90898b68b730d12e7a52190251 | [
"BSD-2-Clause"
] | 1 | 2018-04-16T13:08:44.000Z | 2018-04-16T13:08:44.000Z | from tests import BaseTestCase
from redash import models
class WidgetAPITest(BaseTestCase):
def create_widget(self, dashboard, visualization, width=1):
data = {
'visualization_id': visualization.id,
'dashboard_id': dashboard.id,
'options': {},
'width': width... | 31.477612 | 101 | 0.618303 |
db4dbb5228562e02fd73181174b2bae679b4efcb | 3,850 | py | Python | profiles_api/views.py | leonsolon/profiles-rest-api | 591dd921d0a207a6fed8d46618f0eb875300b932 | [
"MIT"
] | null | null | null | profiles_api/views.py | leonsolon/profiles-rest-api | 591dd921d0a207a6fed8d46618f0eb875300b932 | [
"MIT"
] | 7 | 2020-06-06T01:44:24.000Z | 2022-02-10T10:27:43.000Z | profiles_api/views.py | leonsolon/profiles-rest-api | 591dd921d0a207a6fed8d46618f0eb875300b932 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from res... | 33.77193 | 77 | 0.652208 |
aca87a5ee811911ea4b5662f915bf679231c9032 | 14,490 | py | Python | vat.py | csterling/TorchSSL | b7478424abfdee925da8f013391e598bfc61c720 | [
"MIT"
] | null | null | null | vat.py | csterling/TorchSSL | b7478424abfdee925da8f013391e598bfc61c720 | [
"MIT"
] | null | null | null | vat.py | csterling/TorchSSL | b7478424abfdee925da8f013391e598bfc61c720 | [
"MIT"
] | null | null | null | # import needed library
import os
import logging
import random
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.multiprocessing as mp
from utils import net_builder, get_logger, count_parame... | 42.997033 | 149 | 0.60628 |
78f33a21132f9bfe6d6d36aa79e4209e8be277be | 1,497 | py | Python | examples/deep-learning-notes-and-labs/13_Transfer_Learning/alexnet-feature-extraction-lab/feature_extraction.py | kcavagnolo/udacity_selfdrive | 1e1e884c3f82eec476ccc7b4f4dd6b54f48d032e | [
"MIT"
] | null | null | null | examples/deep-learning-notes-and-labs/13_Transfer_Learning/alexnet-feature-extraction-lab/feature_extraction.py | kcavagnolo/udacity_selfdrive | 1e1e884c3f82eec476ccc7b4f4dd6b54f48d032e | [
"MIT"
] | null | null | null | examples/deep-learning-notes-and-labs/13_Transfer_Learning/alexnet-feature-extraction-lab/feature_extraction.py | kcavagnolo/udacity_selfdrive | 1e1e884c3f82eec476ccc7b4f4dd6b54f48d032e | [
"MIT"
] | null | null | null | import time
import tensorflow as tf
import numpy as np
import pandas as pd
from scipy.misc import imread
from alexnet import AlexNet
sign_names = pd.read_csv('signnames.csv')
nb_classes = 43
x = tf.placeholder(tf.float32, (None, 32, 32, 3))
resized = tf.image.resize_images(x, 227, 227)
# NOTE: By setting `feature_ex... | 30.55102 | 96 | 0.707415 |
623a2b5929d66a7f41246694d41ac02f9c4f914a | 10,319 | py | Python | deependrequestlog/settings/default_example.py | alikins/django-deepend-request-log | 4c28e9843cc73fa2c8d3354700be066f0fe388e2 | [
"MIT"
] | null | null | null | deependrequestlog/settings/default_example.py | alikins/django-deepend-request-log | 4c28e9843cc73fa2c8d3354700be066f0fe388e2 | [
"MIT"
] | null | null | null | deependrequestlog/settings/default_example.py | alikins/django-deepend-request-log | 4c28e9843cc73fa2c8d3354700be066f0fe388e2 | [
"MIT"
] | null | null | null | # (c) 2012-2018, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... | 25.992443 | 77 | 0.577769 |
0c945ce4dbee37ed57ace0e11dd8b801a167b890 | 1,436 | py | Python | setup.py | byrnereese/mkdocs-swagger-ui | 5c8bddfb37dbe153ed42f7eaf56c85abd29f165f | [
"MIT"
] | 3 | 2021-07-31T23:48:30.000Z | 2022-02-08T17:03:10.000Z | setup.py | byrnereese/mkdocs-swagger-ui | 5c8bddfb37dbe153ed42f7eaf56c85abd29f165f | [
"MIT"
] | 1 | 2021-07-31T23:57:41.000Z | 2021-07-31T23:57:41.000Z | setup.py | byrnereese/mkdocs-swagger-ui | 5c8bddfb37dbe153ed42f7eaf56c85abd29f165f | [
"MIT"
] | 1 | 2021-10-07T10:14:17.000Z | 2021-10-07T10:14:17.000Z | from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='mkdocs-swagger-ui',
version='0.1.0',
description='An MkDocs plugin to generate a markdown file containing an API reference built using Swagger UI from a base OAS3 ... | 33.395349 | 146 | 0.626741 |
551fa54842a183456346405b185bf060260e5a58 | 18,357 | py | Python | tests/unit/lib/sync/flows/test_layer_sync_flow.py | aubelsb2/aws-sam-cli | 13e80fef8c9e53ec35a500ab0ae0ab873e22a56d | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/unit/lib/sync/flows/test_layer_sync_flow.py | aubelsb2/aws-sam-cli | 13e80fef8c9e53ec35a500ab0ae0ab873e22a56d | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/unit/lib/sync/flows/test_layer_sync_flow.py | aubelsb2/aws-sam-cli | 13e80fef8c9e53ec35a500ab0ae0ab873e22a56d | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-03-18T18:16:23.000Z | 2020-03-18T18:16:23.000Z | import base64
import hashlib
from unittest import TestCase
from unittest.mock import MagicMock, Mock, patch, call, ANY, mock_open, PropertyMock
from parameterized import parameterized
from samcli.lib.sync.exceptions import MissingPhysicalResourceError, NoLayerVersionsFoundError
from samcli.lib.sync.flows.layer_sync_f... | 42.591647 | 118 | 0.703274 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.