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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5cdf5ea0cb38ecd3281d9d8456f1ae7471e2176b | 1,546 | py | Python | demo_setup/utils/InterfaceStats.py | tum-lkn/appaware | 6335dbca67e3d73a431c1f0433fc3819c45d1b2b | [
"MIT"
] | null | null | null | demo_setup/utils/InterfaceStats.py | tum-lkn/appaware | 6335dbca67e3d73a431c1f0433fc3819c45d1b2b | [
"MIT"
] | null | null | null | demo_setup/utils/InterfaceStats.py | tum-lkn/appaware | 6335dbca67e3d73a431c1f0433fc3819c45d1b2b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import logging
import threading
import time
import queue
import socket
from netstatspy.readers.ip import IpStatsReader
IFACE_STATS_MESSAGE_TYPE = 'iface_stats'
class InterfaceStats(threading.Thread):
def __init__(self, iface, comm_queue=None, interval=1):
... | 26.655172 | 81 | 0.615783 |
c9b3a9298c9395842d02032a540d848b98c8fd20 | 6,438 | py | Python | flare/kindling/buffers.py | jfpettit/reinforcement-learning | 20ffac1cbf0f00ec9f0e0cca1fddab6eeba82081 | [
"MIT"
] | 2 | 2020-04-22T03:17:34.000Z | 2021-02-02T14:51:11.000Z | flare/kindling/buffers.py | jfpettit/reinforcement-learning | 20ffac1cbf0f00ec9f0e0cca1fddab6eeba82081 | [
"MIT"
] | 3 | 2020-04-22T23:17:58.000Z | 2021-04-30T21:18:23.000Z | flare/kindling/buffers.py | jfpettit/reinforcement-learning | 20ffac1cbf0f00ec9f0e0cca1fddab6eeba82081 | [
"MIT"
] | null | null | null | import numpy as np
import scipy
from typing import Optional, Any, Union
from flare.kindling.mpi_tools import mpi_statistics_scalar
import torch
class PGBuffer:
"""
A buffer for storing trajectories experienced by an agent interacting
with the environment, and using Generalized Advantage Estimation (GAE-La... | 39.256098 | 88 | 0.62333 |
2325ea2f718a0ac6b17f95c1c61f47189cdb8b85 | 867 | py | Python | ex107/moeda.py | brunocorbetta/exerciciocursoemvideo | b6ef52f3426f70f211ad70f233f0222c703a2c41 | [
"MIT"
] | null | null | null | ex107/moeda.py | brunocorbetta/exerciciocursoemvideo | b6ef52f3426f70f211ad70f233f0222c703a2c41 | [
"MIT"
] | null | null | null | ex107/moeda.py | brunocorbetta/exerciciocursoemvideo | b6ef52f3426f70f211ad70f233f0222c703a2c41 | [
"MIT"
] | null | null | null | def aumentar(preço=0, taxa=0, formato=False):
res = preço + (preço * taxa / 100)
return res if formato is False else moeda(res)
def diminuir(preço=0, taxa=0, formato=False):
res = preço - (preço * taxa / 100)
return res if formato is False else moeda(res)
def dobro(preço=0, formato=False):
res =... | 26.272727 | 54 | 0.621684 |
d7b0c76ebf0a8d4d8ad73cd66a5a471bc6feb313 | 146 | py | Python | TestGenerate.py | nogw/lisp-to-python | b77d2c9a5bbdbbc0aa673442f098af7f4b74ffe9 | [
"BSD-3-Clause"
] | null | null | null | TestGenerate.py | nogw/lisp-to-python | b77d2c9a5bbdbbc0aa673442f098af7f4b74ffe9 | [
"BSD-3-Clause"
] | null | null | null | TestGenerate.py | nogw/lisp-to-python | b77d2c9a5bbdbbc0aa673442f098af7f4b74ffe9 | [
"BSD-3-Clause"
] | null | null | null | def memhelper (pred, op):
def scheme_lambda_x000 (acc, next):
if and(not(acc), pred(op, next)):
return next
else:
return acc | 24.333333 | 37 | 0.616438 |
ea0929e7d44389a46d6e1a1b54f5a31dec51eff8 | 322 | py | Python | octave_nick.py | brentru/NYCR-CPY | 1b79b863397288977e17efca97da64da5ce6f17f | [
"MIT"
] | null | null | null | octave_nick.py | brentru/NYCR-CPY | 1b79b863397288977e17efca97da64da5ce6f17f | [
"MIT"
] | null | null | null | octave_nick.py | brentru/NYCR-CPY | 1b79b863397288977e17efca97da64da5ce6f17f | [
"MIT"
] | null | null | null | import time
from adafruit_circuitplayground.express import cpx
a = 440
b_flat = 466
b = 494
c = 523
notes = [a, b_flat, b, c]
note = a
while True:
for note_fu in range(0, len(notes)):
print("Playing ", note_fu)
note = note * pow(2, .083333333)
cpx.play_tone(note, 1)
time.sleep(0.... | 17.888889 | 50 | 0.618012 |
02df97733aad8611030f0f3a6a8a4b8915351e20 | 10,233 | py | Python | aiida/backends/tests/orm/test_groups.py | lekah/aiida_core | 54b22a221657b47044483dc9d4f51788ce8ab6b2 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | aiida/backends/tests/orm/test_groups.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | aiida/backends/tests/orm/test_groups.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 36.677419 | 102 | 0.620737 |
b58a771c82efea9864a9a3cb742c970e39810cda | 276 | py | Python | partner_ngos/meal/doctype/complain_mechanism_details/complain_mechanism_details.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | 1 | 2021-06-03T17:14:08.000Z | 2021-06-03T17:14:08.000Z | partner_ngos/meal/doctype/complain_mechanism_details/complain_mechanism_details.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/meal/doctype/complain_mechanism_details/complain_mechanism_details.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | 1 | 2021-10-09T16:20:09.000Z | 2021-10-09T16:20:09.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class ComplainMechanismDetails(Document):
pass
| 25.090909 | 52 | 0.786232 |
afaaa35d5ec57a352e722c9e322d1f8f8f7cc13d | 14,164 | py | Python | pypy/objspace/std/test/test_obj.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-06-02T23:02:09.000Z | 2021-06-02T23:02:09.000Z | pypy/objspace/std/test/test_obj.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-03-30T18:08:41.000Z | 2021-03-30T18:08:41.000Z | pypy/objspace/std/test/test_obj.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | from __future__ import with_statement
from pypy.conftest import option
class AppTestObject:
spaceconfig = {'usemodules': ['itertools']}
def setup_class(cls):
from pypy.interpreter import gateway
import sys
space = cls.space
cls.w_cpython_behavior = space.wrap(not option.runap... | 32.863109 | 109 | 0.546032 |
c11e5c4828bc5fffa4f2bddb42eccc9c9f2fb6e1 | 1,683 | py | Python | src/_cffi_src/openssl/err.py | aganders3/cryptography | dcf82c6c00bb006b6355c51d02c816769cb534a3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/_cffi_src/openssl/err.py | aganders3/cryptography | dcf82c6c00bb006b6355c51d02c816769cb534a3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/_cffi_src/openssl/err.py | aganders3/cryptography | dcf82c6c00bb006b6355c51d02c816769cb534a3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
INCLUDES = """
#include <openssl/err.h>
"""
TYPES = """
static const int EVP_F_EVP_ENCRYPTFINAL_EX;
static const int EVP_R_DATA_NOT_MULTI... | 29.017241 | 79 | 0.81224 |
06749b1edffd14435a8732d475e69468f6bf6abf | 5,335 | py | Python | tensorflow_privacy/privacy/dp_query/nested_query_test.py | cchoquette/privacy | 6a48a45afd17c211af4f3c4087316f236e9ccb34 | [
"Apache-2.0"
] | null | null | null | tensorflow_privacy/privacy/dp_query/nested_query_test.py | cchoquette/privacy | 6a48a45afd17c211af4f3c4087316f236e9ccb34 | [
"Apache-2.0"
] | null | null | null | tensorflow_privacy/privacy/dp_query/nested_query_test.py | cchoquette/privacy | 6a48a45afd17c211af4f3c4087316f236e9ccb34 | [
"Apache-2.0"
] | 1 | 2021-01-13T06:34:19.000Z | 2021-01-13T06:34:19.000Z | # Copyright 2018, The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 37.048611 | 80 | 0.680975 |
d50ae92e2c4d593a2aefa6688b3edcf1f4faf1bd | 3,729 | py | Python | Profiles/binary_search_tree.py | hemishv111/Hacktoberfest2k19 | ead7c6c7cdd569e730a48257c7ca1ba2f76dfbae | [
"MIT"
] | 22 | 2019-10-10T12:16:58.000Z | 2020-10-28T09:09:52.000Z | Profiles/binary_search_tree.py | hemishv111/Hacktoberfest2k19 | ead7c6c7cdd569e730a48257c7ca1ba2f76dfbae | [
"MIT"
] | 49 | 2019-10-09T11:23:06.000Z | 2020-10-01T07:26:14.000Z | Profiles/binary_search_tree.py | hemishv111/Hacktoberfest2k19 | ead7c6c7cdd569e730a48257c7ca1ba2f76dfbae | [
"MIT"
] | 80 | 2019-10-06T16:40:06.000Z | 2020-10-22T16:34:58.000Z | class BSTNode:
def __init__(self, key):
self.key = key
self.left = None
self.right = None
self.parent = None
def insert(self, node):
if self.key > node.key:
if self.left is None:
self.left = node
node.parent = self
... | 28.906977 | 69 | 0.507911 |
584f7908f47f90c7cfc6eeb27a6bac18c77d778f | 7,872 | py | Python | pytests/eventing/eventing_logging.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | 1 | 2020-08-31T18:51:45.000Z | 2020-08-31T18:51:45.000Z | pytests/eventing/eventing_logging.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | null | null | null | pytests/eventing/eventing_logging.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | 2 | 2020-07-24T07:12:01.000Z | 2022-03-17T23:43:28.000Z | from pytests.eventing.eventing_base import EventingBaseTest
from logredaction.log_redaction_base import LogRedactionBase
from pytests.security.auditmain import audit
from lib.testconstants import STANDARD_BUCKET_PORT
import logging
import copy
import json
from lib.couchbase_helper.tuq_helper import N1QLHelper
from lib.... | 58.311111 | 113 | 0.668445 |
05fd96d9673eebff3bb99a88dd1ef0b167adc45d | 1,651 | py | Python | baseStation/src/ui/domain/indicator/charge.py | olgam4/design3 | 6e05d123a24deae7dda646df535844a158ef5cc0 | [
"WTFPL"
] | null | null | null | baseStation/src/ui/domain/indicator/charge.py | olgam4/design3 | 6e05d123a24deae7dda646df535844a158ef5cc0 | [
"WTFPL"
] | null | null | null | baseStation/src/ui/domain/indicator/charge.py | olgam4/design3 | 6e05d123a24deae7dda646df535844a158ef5cc0 | [
"WTFPL"
] | null | null | null | import tkinter as tk
from tkinter import ttk
from application.domain.iObserver import IObserver
from prehensor.service.prehensorService import PrehensorService
class Charge(ttk.Frame, IObserver):
def __init__(self, master, prehensor_service: PrehensorService, **kwargs) -> None:
super().__init__(master, *... | 40.268293 | 86 | 0.6596 |
23147e1d53a7726c421e053b48a8e216c8fb17fb | 848 | py | Python | examples.py | mfdeux/aionewsapi | c42f3ca42cfb5ccf986eb8d8dba644d60ee04e5f | [
"MIT"
] | 4 | 2019-10-03T20:58:41.000Z | 2019-10-04T01:20:07.000Z | examples.py | mfdeux/aionewsapi | c42f3ca42cfb5ccf986eb8d8dba644d60ee04e5f | [
"MIT"
] | null | null | null | examples.py | mfdeux/aionewsapi | c42f3ca42cfb5ccf986eb8d8dba644d60ee04e5f | [
"MIT"
] | null | null | null | import asyncio
from aionewsapi import NewsAPI
news_api = NewsAPI()
async def sources():
return await news_api.sources()
async def many():
sources = await news_api.sources()
fetch_tasks = []
for source in sources:
fetch_tasks.append(
asyncio.ensure_future(
news_a... | 24.941176 | 71 | 0.645047 |
230e2144091dbf05e6eba775a1e59bbb7fac127e | 384 | py | Python | Inventory_Home/adminInv/migrations/0006_auto_20200615_1434.py | shaykhsiddique/Inventory-management-with-Django | 2313c5b460dafe817399213cabf91b66dd2c0b24 | [
"Apache-2.0"
] | 1 | 2020-06-18T23:42:55.000Z | 2020-06-18T23:42:55.000Z | Inventory_Home/adminInv/migrations/0006_auto_20200615_1434.py | shaykhsiddique/Inventory-management-with-Django | 2313c5b460dafe817399213cabf91b66dd2c0b24 | [
"Apache-2.0"
] | 11 | 2020-06-20T09:12:11.000Z | 2020-06-20T09:33:07.000Z | Inventory_Home/adminInv/migrations/0006_auto_20200615_1434.py | MarzanulHoque/Inventory-management-with-Django | 2313c5b460dafe817399213cabf91b66dd2c0b24 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-06-15 14:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adminInv', '0005_user_sessionid'),
]
operations = [
migrations.AlterField(
model_name='user',
name='sessionid',
... | 20.210526 | 50 | 0.596354 |
86cb960dd468b6dbae48912132fa9f1e7cf57d75 | 98 | py | Python | tests/tests/test_brew_control_dash.py | mcannamela/brew-control-dash | 04dcd1bad2b82a7432c766100ab62fb41f247545 | [
"MIT"
] | null | null | null | tests/tests/test_brew_control_dash.py | mcannamela/brew-control-dash | 04dcd1bad2b82a7432c766100ab62fb41f247545 | [
"MIT"
] | 4 | 2020-12-05T20:57:21.000Z | 2021-01-10T22:27:24.000Z | tests/tests/test_brew_control_dash.py | mcannamela/brew-control-dash | 04dcd1bad2b82a7432c766100ab62fb41f247545 | [
"MIT"
] | null | null | null | from brew_control_dash import __version__
def test_version():
assert __version__ == '0.1.0'
| 16.333333 | 41 | 0.744898 |
5fc7639f56fbdf82491625ae12d96548e965f738 | 17,932 | py | Python | public/Python27/Lib/gzip.py | NingrumFadillah/cekmutasi | 1fccb6cafb874c2a80ece9b71d7c682fd44dbd48 | [
"MIT"
] | 1 | 2020-11-26T18:53:46.000Z | 2020-11-26T18:53:46.000Z | public/Python27/Lib/gzip.py | NingrumFadillah/cekmutasi | 1fccb6cafb874c2a80ece9b71d7c682fd44dbd48 | [
"MIT"
] | null | null | null | public/Python27/Lib/gzip.py | NingrumFadillah/cekmutasi | 1fccb6cafb874c2a80ece9b71d7c682fd44dbd48 | [
"MIT"
] | 3 | 2017-04-07T12:02:22.000Z | 2020-03-23T12:11:55.000Z | """Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import struct, sys, time, os
import zlib
import io
import __builtin__
__all__ = ["GzipFile"... | 35.864 | 79 | 0.553257 |
318416d6293fd3d1f70d972a2d4d4d6131476729 | 10,622 | py | Python | src/common/utils.py | askme765cs/macro_pack | 9acfa610e215b4ba5812e48a3b452bdf92a8664f | [
"Apache-2.0"
] | 1 | 2021-07-06T23:21:04.000Z | 2021-07-06T23:21:04.000Z | src/common/utils.py | askme765cs/macro_pack | 9acfa610e215b4ba5812e48a3b452bdf92a8664f | [
"Apache-2.0"
] | null | null | null | src/common/utils.py | askme765cs/macro_pack | 9acfa610e215b4ba5812e48a3b452bdf92a8664f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
from random import choice
import string
import logging
from termcolor import colored
import os, sys
import socket
from collections import OrderedDict
import importlib.util
import psutil
from datetime import datetime
class ColorLogFiler(logging.StreamHandler):
""" Override... | 33.19375 | 180 | 0.571267 |
8e978f07f8fdcc773f7964e7ad31a8f52dad9318 | 2,552 | py | Python | indico/modules/events/management/controllers/posters.py | uxmaster/indico | ecd19f17ef6fdc9f5584f59c87ec647319ce5d31 | [
"MIT"
] | 1 | 2019-11-03T11:34:16.000Z | 2019-11-03T11:34:16.000Z | indico/modules/events/management/controllers/posters.py | NP-compete/indico | 80db7ca0ef9d1f3240a16b9ff2d84bf0bf26c549 | [
"MIT"
] | null | null | null | indico/modules/events/management/controllers/posters.py | NP-compete/indico | 80db7ca0ef9d1f3240a16b9ff2d84bf0bf26c549 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import uuid
from flask import request
from werkzeug.exceptions i... | 36.985507 | 106 | 0.726489 |
730a3dc313c65c3367dce97e29750204d707a860 | 1,105 | py | Python | release/stubs.min/Rhino/DocObjects/__init___parts/ObjectColorSource.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Rhino/DocObjects/__init___parts/ObjectColorSource.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Rhino/DocObjects/__init___parts/ObjectColorSource.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class ObjectColorSource(Enum,IComparable,IFormattable,IConvertible):
"""
Defines enumerated values for the source of display color of single objects.
enum ObjectColorSource,values: ColorFromLayer (0),ColorFromMaterial (2),ColorFromObject (1),ColorFromParent (3)
"""
def __eq__(self,*args):
""" x.__eq... | 29.078947 | 215 | 0.690498 |
2a40bfe70437e87b8b15ef3913df36cf9873835a | 15,136 | py | Python | homeassistant/components/google/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/google/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 20 | 2021-11-03T06:22:03.000Z | 2022-03-31T06:21:17.000Z | homeassistant/components/google/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | null | null | null | """Support for Google - Calendar Event Devices."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
from datetime import datetime, timedelta
import logging
from typing import Any
import aiohttp
from gcal_sync.api import GoogleCalendarService
from gcal_sync.exceptions import ApiExc... | 34.244344 | 87 | 0.663385 |
301c568f2b9e3791041a5b9192a5a3ee48a51f41 | 51,038 | py | Python | intelhex/__init__.py | debian-janitor/pkg-intelhex | 65fd28427f2c3d699a60b766d646d5d61719a79a | [
"BSD-3-Clause"
] | null | null | null | intelhex/__init__.py | debian-janitor/pkg-intelhex | 65fd28427f2c3d699a60b766d646d5d61719a79a | [
"BSD-3-Clause"
] | 1 | 2021-08-31T22:17:27.000Z | 2021-08-31T22:17:27.000Z | intelhex/__init__.py | debian-janitor/pkg-intelhex | 65fd28427f2c3d699a60b766d646d5d61719a79a | [
"BSD-3-Clause"
] | 1 | 2020-12-17T21:30:20.000Z | 2020-12-17T21:30:20.000Z | # Copyright (c) 2005-2016, Alexander Belchenko
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain
# the above copyright notice, this list of condi... | 37.75 | 117 | 0.550139 |
8310926db5ab9fc50319b558c9643a8d83d3fb0a | 8,691 | py | Python | test/functional/tl_managed.py | patrickdugan/BlockPo-to-Tradelayer | ba1ebf3c329751d414302577a09481ba28db1815 | [
"MIT"
] | null | null | null | test/functional/tl_managed.py | patrickdugan/BlockPo-to-Tradelayer | ba1ebf3c329751d414302577a09481ba28db1815 | [
"MIT"
] | 5 | 2021-06-21T21:21:53.000Z | 2021-06-22T20:10:16.000Z | test/functional/tl_managed.py | patrickdugan/BlockPo-to-Tradelayer | ba1ebf3c329751d414302577a09481ba28db1815 | [
"MIT"
] | 1 | 2021-06-21T21:14:45.000Z | 2021-06-21T21:14:45.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2017 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 basic for Creating tokens ."""
from test_framework.test_framework import BitcoinTestFramework
fro... | 39.148649 | 128 | 0.603843 |
619b8ad9824d2b6c55555f876fde6be4dce0c856 | 5,980 | py | Python | Project/src/Modules/House/Lighting/Outlets/_test/test_outlets.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | 3 | 2016-11-16T00:37:58.000Z | 2019-11-10T13:10:19.000Z | Project/src/Modules/House/Lighting/Outlets/_test/test_outlets.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | null | null | null | Project/src/Modules/House/Lighting/Outlets/_test/test_outlets.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | 1 | 2020-07-19T22:06:52.000Z | 2020-07-19T22:06:52.000Z | """
@name: /home/briank/workspace/PyHouse/Project/src/Modules/House/Lighting/_test/test_outlets.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2020 by D. Brian Kimmel
@license: MIT License
@note: Created on Dec 7, 2019
@summary:
Passed all 8 tests - DBK - 2019-12-08... | 32.5 | 99 | 0.648495 |
b21bd5733aac45bbe746c8e28bb73fa3f68b402e | 1,767 | py | Python | monero/backends/offline.py | lialsoftlab/monero-python | 18fa9aec11bf9300e80bba21f7f22472b3972483 | [
"BSD-3-Clause"
] | null | null | null | monero/backends/offline.py | lialsoftlab/monero-python | 18fa9aec11bf9300e80bba21f7f22472b3972483 | [
"BSD-3-Clause"
] | null | null | null | monero/backends/offline.py | lialsoftlab/monero-python | 18fa9aec11bf9300e80bba21f7f22472b3972483 | [
"BSD-3-Clause"
] | null | null | null | from .. import exceptions
from ..account import Account
from ..address import Address
from ..seed import Seed
class WalletIsOffline(exceptions.BackendException):
pass
class OfflineWallet(object):
"""
Offline backend for Monero wallet. Provides support for address generation.
"""
_address = None
... | 22.948052 | 79 | 0.653084 |
3dfff51d61ad41eae0d6a875193eea22433d37d7 | 14,921 | py | Python | tests/db_tests/test_reimporting_activities.py | gotiniens/workoutizer | a190e8f8d782b57e319cf123e9fe5e59ba6c9340 | [
"MIT"
] | 45 | 2020-10-23T13:01:34.000Z | 2022-03-07T08:48:16.000Z | tests/db_tests/test_reimporting_activities.py | gotiniens/workoutizer | a190e8f8d782b57e319cf123e9fe5e59ba6c9340 | [
"MIT"
] | 62 | 2020-10-06T19:18:12.000Z | 2022-01-13T19:25:34.000Z | tests/db_tests/test_reimporting_activities.py | gotiniens/workoutizer | a190e8f8d782b57e319cf123e9fe5e59ba6c9340 | [
"MIT"
] | 12 | 2020-10-07T12:44:00.000Z | 2021-09-13T06:36:24.000Z | import datetime
import shutil
from pathlib import Path
import pytest
import pytz
from wkz import configuration, models
from wkz.best_sections.generic import activity_suitable_for_awards
from wkz.demo import prepare_import_of_demo_activities
from wkz.io.file_importer import run_importer__dask
def test_reimport_of_ac... | 39.895722 | 119 | 0.749145 |
11b95e0f9e7afe8543bf0c3e7be151865cf4b771 | 5,394 | py | Python | tests/serve/mock/end-to-end/opbank/test_opbank.py | dfioravanti/hmt | df79404076ec7acea0cfb12b636d58e3ffc83bc5 | [
"MIT"
] | 25 | 2020-05-14T13:25:42.000Z | 2021-11-09T10:09:27.000Z | tests/serve/mock/end-to-end/opbank/test_opbank.py | dfioravanti/hmt | df79404076ec7acea0cfb12b636d58e3ffc83bc5 | [
"MIT"
] | 19 | 2020-05-05T19:47:41.000Z | 2021-02-05T17:06:53.000Z | tests/serve/mock/end-to-end/opbank/test_opbank.py | dfioravanti/hmt | df79404076ec7acea0cfb12b636d58e3ffc83bc5 | [
"MIT"
] | 6 | 2020-05-16T10:02:48.000Z | 2021-10-04T08:03:49.000Z | import json
import pytest
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from hmt.serve.mock.log import Log
from hmt.serve.mock.scope import Scope
from hmt.serve.mock.specs import load_specs
from hmt.serve.utils.routing import HeaderRouting
@pytest.fixture
def app(mocking_app):
return mocking_app(
... | 32.493976 | 90 | 0.670931 |
9a3c8f8c9c0ddfb0b0abad46ef94eea555519355 | 854 | py | Python | wrappers/QuASAR/quasar_split_by_chromosomes_qc.py | JSegueni/3DChromatin_ReplicateQC | 02d028bc56d8850cbef3192a813eaff8b35d2a8f | [
"MIT"
] | 30 | 2017-09-29T00:38:45.000Z | 2021-04-19T11:27:29.000Z | wrappers/QuASAR/quasar_split_by_chromosomes_qc.py | StayHungryStayFool/3DChromatin_ReplicateQC | 942949bb4d4111715cee83605fa0a51ee1acd91a | [
"MIT"
] | 16 | 2017-09-29T22:30:03.000Z | 2021-05-24T15:07:33.000Z | wrappers/QuASAR/quasar_split_by_chromosomes_qc.py | StayHungryStayFool/3DChromatin_ReplicateQC | 942949bb4d4111715cee83605fa0a51ee1acd91a | [
"MIT"
] | 14 | 2017-09-24T15:11:53.000Z | 2021-08-21T03:47:53.000Z | #!/usr/bin/env python
import sys
import glob
import argparse
import re
import os
def main():
scorefile = open( sys.argv[1], 'r')
samplename=sys.argv[2]
lines=scorefile.readlines()
header = None
for i in range(len(lines)):
if lines[i] == 'Quality Score Results\n':
header = i + 2... | 28.466667 | 155 | 0.588993 |
63203c0b485c8afa2e0aa099ffc610eeb1e49662 | 1,783 | py | Python | custom/ilsgateway/management/commands/test_report_data_generation.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | custom/ilsgateway/management/commands/test_report_data_generation.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | custom/ilsgateway/management/commands/test_report_data_generation.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from django.core.management import BaseCommand
from corehq.apps.locations.models import SQLLocation
from custom.ilsgateway.models import ILSGatewayConfig, ReportRun, SupplyPointStatus, DeliveryGroupReport, \
SupplyPointWarehouseRecord, OrganizationSummary, ProductAvailabilityData, Aler... | 40.522727 | 113 | 0.747616 |
d5b9a8c80d2128c28c8e4b0fcc537b5e32a968ff | 287 | py | Python | output/models/nist_data/atomic/g_month_day/schema_instance/nistschema_sv_iv_atomic_g_month_day_max_exclusive_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/g_month_day/schema_instance/nistschema_sv_iv_atomic_g_month_day_max_exclusive_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/g_month_day/schema_instance/nistschema_sv_iv_atomic_g_month_day_max_exclusive_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.g_month_day.schema_instance.nistschema_sv_iv_atomic_g_month_day_max_exclusive_5_xsd.nistschema_sv_iv_atomic_g_month_day_max_exclusive_5 import NistschemaSvIvAtomicGMonthDayMaxExclusive5
__all__ = [
"NistschemaSvIvAtomicGMonthDayMaxExclusive5",
]
| 47.833333 | 221 | 0.905923 |
d8d5ddae7aa8b40b8a5647b82b295acba5a71bfb | 1,838 | py | Python | authors/apps/notify/views.py | dev-jey/ah-the-phoenix | 985d216210c0c81ec06e223c6952b0c69fabdcfa | [
"BSD-3-Clause"
] | 1 | 2019-04-04T23:49:42.000Z | 2019-04-04T23:49:42.000Z | authors/apps/notify/views.py | dev-jey/ah-the-phoenix | 985d216210c0c81ec06e223c6952b0c69fabdcfa | [
"BSD-3-Clause"
] | 21 | 2019-01-29T17:41:36.000Z | 2022-03-11T23:43:20.000Z | authors/apps/notify/views.py | dev-jey/ah-the-phoenix | 985d216210c0c81ec06e223c6952b0c69fabdcfa | [
"BSD-3-Clause"
] | 1 | 2019-11-23T18:27:55.000Z | 2019-11-23T18:27:55.000Z | from rest_framework.response import Response
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from django.http import Http404
from .serializers import NotificationSerializer
# from .signal import *
from .renderers import NotificationJSONRe... | 31.689655 | 79 | 0.67247 |
058d19c2d13efa66a8ded640d89c1589d6ede936 | 515 | py | Python | Leetcoding-Actions/Explore-Monthly-Challenges/2020-11/05-Minimum-Cost-to-Move-Chips-to-the-Same-Position.py | shoaibur/SWE | 1e114a2750f2df5d6c50b48c8e439224894d65da | [
"MIT"
] | 1 | 2020-11-14T18:28:13.000Z | 2020-11-14T18:28:13.000Z | Leetcoding-Actions/Explore-Monthly-Challenges/2020-11/05-Minimum-Cost-to-Move-Chips-to-the-Same-Position.py | shoaibur/SWE | 1e114a2750f2df5d6c50b48c8e439224894d65da | [
"MIT"
] | null | null | null | Leetcoding-Actions/Explore-Monthly-Challenges/2020-11/05-Minimum-Cost-to-Move-Chips-to-the-Same-Position.py | shoaibur/SWE | 1e114a2750f2df5d6c50b48c8e439224894d65da | [
"MIT"
] | null | null | null | class Solution:
def minCostToMoveChips(self, position: List[int]) -> int:
'''
Idea: Move all even positioned chips to 0, i.e., count them and
all odd positioned chips to 1, i.e., count them; take min of two counts
T: O(n) and S: O(1)
'''
zeroCost, oneCost = 0, 0
... | 32.1875 | 79 | 0.506796 |
aee0fe124065c9ab1b63422b93948719c9f4f7e0 | 974 | py | Python | utils/layer_utils.py | alexchungio/CGAN-MNIST | 9da907f7902cc8dd470ac63f08a00b6395b23fc3 | [
"Apache-2.0"
] | null | null | null | utils/layer_utils.py | alexchungio/CGAN-MNIST | 9da907f7902cc8dd470ac63f08a00b6395b23fc3 | [
"Apache-2.0"
] | null | null | null | utils/layer_utils.py | alexchungio/CGAN-MNIST | 9da907f7902cc8dd470ac63f08a00b6395b23fc3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------
# @ File : layer_utils.py
# @ Description:
# @ Author : Alex Chung
# @ Contact : yonganzhong@outlook.com
# @ License : Copyright (c) 2017-2018
# @ Time : 2020/10/2 下午6:56
# @ Software : PyChar... | 27.828571 | 101 | 0.51232 |
a9e823b296dfa2dda74329da067651a420982ccf | 4,666 | py | Python | auto_naming_screenshot.py | akame-bottle/auto-naming-screenshot | c507d0e331e61e61ce6742a7fd1c96b2014675c8 | [
"MIT"
] | null | null | null | auto_naming_screenshot.py | akame-bottle/auto-naming-screenshot | c507d0e331e61e61ce6742a7fd1c96b2014675c8 | [
"MIT"
] | 2 | 2021-02-28T05:59:00.000Z | 2021-02-28T06:06:06.000Z | auto_naming_screenshot.py | akame-bottle/auto-naming-screenshot | c507d0e331e61e61ce6742a7fd1c96b2014675c8 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 赤目ボトル(Akame Bottle).
#
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
import bpy
import os
import glob
import re
bl_info = {
"name" = "Auto Naming Screenshot",
"author" = "Akame Bottle",
"version" = (0,1,0),... | 31.958904 | 125 | 0.596871 |
a9859f3841031de125e3c671ae5636f440ba4fa2 | 1,711 | py | Python | pythf/error.py | alipniczkij/pythf | 732c481491674d8fa17676262d8eb32c69e4465b | [
"MIT"
] | 5 | 2021-04-06T06:55:06.000Z | 2022-02-17T14:22:37.000Z | pythf/error.py | alipniczkij/pythf | 732c481491674d8fa17676262d8eb32c69e4465b | [
"MIT"
] | null | null | null | pythf/error.py | alipniczkij/pythf | 732c481491674d8fa17676262d8eb32c69e4465b | [
"MIT"
] | 5 | 2021-02-11T16:36:02.000Z | 2022-01-11T14:49:02.000Z | class ApiError(Exception):
"""Base class for all Group-IB THF API errors; also raised for generic internal errors."""
def __init__(self, message=None, original_exception=None):
"""
Initialize the ApiError.
Args:
message: The actual error message.
original_excepti... | 26.734375 | 94 | 0.593805 |
f418852098c9c143d037b962d3437b77f4a60dc4 | 6,432 | py | Python | git_split_commit/command.py | mik3y/git-split-commit | 04f82dee1bd1b303e6626331766bc54ae25787be | [
"MIT"
] | 4 | 2020-05-22T19:34:36.000Z | 2021-10-05T03:59:18.000Z | git_split_commit/command.py | mik3y/git-split-commit | 04f82dee1bd1b303e6626331766bc54ae25787be | [
"MIT"
] | 2 | 2020-05-22T19:06:44.000Z | 2020-12-22T08:29:30.000Z | git_split_commit/command.py | mik3y/git-split-commit | 04f82dee1bd1b303e6626331766bc54ae25787be | [
"MIT"
] | null | null | null | import os
import click
import git
import coloredlogs
import logging
import tempfile
from simple_term_menu import TerminalMenu
logger = logging.getLogger("main")
def print_error(msg):
click.echo(click.style(msg, fg="red"))
def setup_logging(debug):
if debug:
coloredlogs.install(level="DEBUG")
e... | 31.841584 | 93 | 0.657338 |
14b692e8dd221953ab2053b9b845c92c1f355352 | 1,258 | py | Python | mnm/bot/stats.py | agateblue/mnm | adf45c5f86611851ef3f51b60c30150095dba638 | [
"MIT"
] | 2 | 2021-02-09T06:49:24.000Z | 2021-07-19T00:44:39.000Z | mnm/bot/stats.py | agateblue/mnm | adf45c5f86611851ef3f51b60c30150095dba638 | [
"MIT"
] | null | null | null | mnm/bot/stats.py | agateblue/mnm | adf45c5f86611851ef3f51b60c30150095dba638 | [
"MIT"
] | 1 | 2021-06-07T10:39:07.000Z | 2021-06-07T10:39:07.000Z | import collections
from mnm.instances.influxdb_client import get_client
class Stat(object):
def get(self, **kwargs):
raise NotImplementedError
def get_results(self, query):
return get_client().query(query)
class InstanceFieldStat(Stat):
query = """
SELECT sum("{field}")
... | 22.464286 | 67 | 0.627186 |
666e1590a35424faa8e8152da8e2a9efca17422b | 1,515 | py | Python | mysite/verde/management/commands/plotly.py | induts/Capstone | d539a2de929cd05ff913e8c8731fd22894b38dc6 | [
"Apache-2.0"
] | null | null | null | mysite/verde/management/commands/plotly.py | induts/Capstone | d539a2de929cd05ff913e8c8731fd22894b38dc6 | [
"Apache-2.0"
] | null | null | null | mysite/verde/management/commands/plotly.py | induts/Capstone | d539a2de929cd05ff913e8c8731fd22894b38dc6 | [
"Apache-2.0"
] | null | null | null | import plotly.plotly as py
import plotly.graph_objs as go
import plotly
import pandas as pd
plotly.tools.set_credentials_file(username='cheryllewman', api_key='FHe2FrQ6UQXs6hvv8StD')
# Create random data with numpy
import numpy as np
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_us_a... | 30.3 | 99 | 0.590759 |
da94410293435762256cadbe933ad7be07049699 | 1,609 | py | Python | changes/api/plan_details.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 443 | 2015-01-03T16:28:39.000Z | 2021-04-26T16:39:46.000Z | changes/api/plan_details.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 12 | 2015-07-30T19:07:16.000Z | 2016-11-07T23:11:21.000Z | changes/api/plan_details.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 47 | 2015-01-09T10:04:00.000Z | 2020-11-18T17:58:19.000Z | from __future__ import absolute_import, division, unicode_literals
from flask.ext.restful import reqparse
from changes.api.auth import get_project_slug_from_plan_id, requires_project_admin
from changes.api.base import APIView
from changes.config import db
from changes.models.plan import Plan, PlanStatus
import uuid
... | 29.796296 | 82 | 0.674332 |
4a0684c27499199b41e43043a1b220001105e346 | 7,180 | py | Python | tests/test_apiv2_district_controller.py | tervay/the-blue-alliance | e14c15cb04b455f90a2fcfdf4c1cdbf8454e17f8 | [
"MIT"
] | 266 | 2015-01-04T00:10:48.000Z | 2022-03-28T18:42:05.000Z | tests/test_apiv2_district_controller.py | gregmarra/the-blue-alliance | 5bedaf5c80b4623984760d3da3289640639112f9 | [
"MIT"
] | 2,673 | 2015-01-01T20:14:33.000Z | 2022-03-31T18:17:16.000Z | tests/test_apiv2_district_controller.py | gregmarra/the-blue-alliance | 5bedaf5c80b4623984760d3da3289640639112f9 | [
"MIT"
] | 230 | 2015-01-04T00:10:48.000Z | 2022-03-26T18:12:04.000Z | import unittest2
import webtest
import json
import webapp2
from datetime import datetime
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.event_type import EventType
from controllers.api.api_district_controller import ApiDistrictListController, ApiDistrictEventsController
fr... | 41.264368 | 151 | 0.59805 |
385102019f5c4e52ed208d6d60720471d7db9ae5 | 9,831 | py | Python | PyFuscation.py | tdefise/PyFuscation | 1e73417c0cdfcada1ee6080785d399e9f8dfa586 | [
"BSD-3-Clause"
] | null | null | null | PyFuscation.py | tdefise/PyFuscation | 1e73417c0cdfcada1ee6080785d399e9f8dfa586 | [
"BSD-3-Clause"
] | 12 | 2021-02-10T20:53:08.000Z | 2022-03-28T04:56:06.000Z | PyFuscation.py | tdefise/PyFuscation | 1e73417c0cdfcada1ee6080785d399e9f8dfa586 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
PyFuscation.py
This python3 script obfuscates powershell function, variable and parameters in an attempt to bypass AV blacklists
"""
import ast
import configparser
import os
import random
import re
import shlex
import shutil
import string
import subprocess
import sys
import time
from argpar... | 29.611446 | 113 | 0.498118 |
d0990e88a60da6ea581d316ff03e07a774e54083 | 2,443 | py | Python | deeplabv3plus.py | Lin-boy/data | 5bb3c21e6d85af79168b13b242281448e130f494 | [
"MIT"
] | null | null | null | deeplabv3plus.py | Lin-boy/data | 5bb3c21e6d85af79168b13b242281448e130f494 | [
"MIT"
] | null | null | null | deeplabv3plus.py | Lin-boy/data | 5bb3c21e6d85af79168b13b242281448e130f494 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from net.sync_batchnorm import SynchronizedBatchNorm2d
from torch.nn import init
from net.backbone import build_backbone
from net.ASPP import ASPP
class deeplabv3plus(nn.Module):
def __init__(self, cfg):
super(deeplabv3plus, self)... | 38.171875 | 123 | 0.76054 |
5c9a4ae0501bba9fd8b0dde853853c6f5f812809 | 10,911 | py | Python | tests/providers/google/suite/hooks/test_sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2019-12-11T15:54:13.000Z | 2021-05-24T20:21:08.000Z | tests/providers/google/suite/hooks/test_sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 1 | 2021-09-29T17:37:13.000Z | 2021-09-29T17:37:13.000Z | tests/providers/google/suite/hooks/test_sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 2 | 2021-01-11T13:53:03.000Z | 2021-10-02T05:06:34.000Z | #
# 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... | 44.534694 | 109 | 0.706993 |
656df0e16a61e9d53bc1deea75be7d354cd024a7 | 1,022 | py | Python | LeetCode/0051_N-Queen_1.py | ankitpandey0/PythonAlgorithms | 48efed4664fdf2a14b2eb7ce917226a30b34ff53 | [
"MIT"
] | null | null | null | LeetCode/0051_N-Queen_1.py | ankitpandey0/PythonAlgorithms | 48efed4664fdf2a14b2eb7ce917226a30b34ff53 | [
"MIT"
] | null | null | null | LeetCode/0051_N-Queen_1.py | ankitpandey0/PythonAlgorithms | 48efed4664fdf2a14b2eb7ce917226a30b34ff53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#recursive or bottom-up approach decreases the number of iterations hence providing increased efficiency
#define a function to check for continuing the permutations search ... use the distance formula to get the diagonal points
def whether_to_extend(perm):
i = len(perm) - 1
for j in r... | 29.2 | 123 | 0.624266 |
e6e44eb1afb5487a7ca4c82df7bdccf4eb65ff75 | 735 | py | Python | test/unit/rules/templates/test_limitsize_description.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 1 | 2020-05-08T20:12:31.000Z | 2020-05-08T20:12:31.000Z | test/unit/rules/templates/test_limitsize_description.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | null | null | null | test/unit/rules/templates/test_limitsize_description.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 1 | 2020-12-01T14:54:28.000Z | 2020-12-01T14:54:28.000Z | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from test.unit.rules import BaseRuleTestCase
from cfnlint.rules.templates.LimitDescription import LimitDescription # pylint: disable=E0401
class TestTemplateLimitDescription(BaseRuleTestCase):
"""Test templa... | 30.625 | 94 | 0.714286 |
37853c87924721c22817ba497e5450b69044f0d3 | 21,202 | py | Python | electrum_axe/plugins/safe_t/qt.py | ddude1/electrum-axe | b2d030dfc2afb2ca27739b9169ac610c68421dbb | [
"MIT"
] | 336 | 2018-03-15T04:12:19.000Z | 2021-05-20T06:26:42.000Z | electrum_axe/plugins/safe_t/qt.py | ddude1/electrum-axe | b2d030dfc2afb2ca27739b9169ac610c68421dbb | [
"MIT"
] | 13 | 2018-05-13T09:40:18.000Z | 2022-03-20T09:15:50.000Z | electrum_axe/plugins/safe_t/qt.py | ddude1/electrum-axe | b2d030dfc2afb2ca27739b9169ac610c68421dbb | [
"MIT"
] | 73 | 2018-03-15T04:12:21.000Z | 2020-07-19T04:01:18.000Z | from functools import partial
import threading
from PyQt5.QtCore import Qt, pyqtSignal, QRegExp
from PyQt5.QtGui import QRegExpValidator
from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QPushButton,
QHBoxLayout, QButtonGroup, QGroupBox,
QTextEdit,... | 42.319361 | 140 | 0.609659 |
307cf8ef7c06be2eb85e391360aa01149a2f9237 | 1,244 | py | Python | teste/migrations/0001_initial.py | pussbb/django_teste | 6674cb96b8ff1a2e62f868d91f397c25ae5f8027 | [
"WTFPL"
] | null | null | null | teste/migrations/0001_initial.py | pussbb/django_teste | 6674cb96b8ff1a2e62f868d91f397c25ae5f8027 | [
"WTFPL"
] | 6 | 2020-06-05T23:19:35.000Z | 2022-02-10T10:50:13.000Z | teste/migrations/0001_initial.py | pussbb/django_teste | 6674cb96b8ff1a2e62f868d91f397c25ae5f8027 | [
"WTFPL"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-08 07:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 32.736842 | 77 | 0.54582 |
db9d784932acef67a1839ac5b21271c01e271840 | 2,387 | py | Python | nilearn/tests/test_segmentation.py | Qin-Ming/nilearn | 82f4075d8a8ea9aec25e66bd87ebb79a6be6d32f | [
"BSD-2-Clause"
] | null | null | null | nilearn/tests/test_segmentation.py | Qin-Ming/nilearn | 82f4075d8a8ea9aec25e66bd87ebb79a6be6d32f | [
"BSD-2-Clause"
] | null | null | null | nilearn/tests/test_segmentation.py | Qin-Ming/nilearn | 82f4075d8a8ea9aec25e66bd87ebb79a6be6d32f | [
"BSD-2-Clause"
] | null | null | null | """
Testing functions for random walker segmentation from scikit-image 0.11.3.
Thanks to scikit image.
"""
import numpy as np
import pytest
from nilearn._utils.segmentation import _random_walker
def test_modes_in_random_walker():
img = np.zeros((30, 30, 30)) + 0.1 * np.random.RandomState(
42
).stan... | 29.469136 | 80 | 0.655216 |
6f731b39dd21b0d9403abf7ba3b88cf200aad014 | 13,471 | py | Python | run/completion/trav_trans/train.py | CGCL-codes/naturalcc | 7bab9a97331fafac1235fb32de829ff8d572320f | [
"MIT"
] | 71 | 2020-12-04T02:18:13.000Z | 2022-03-30T15:19:50.000Z | run/completion/trav_trans/train.py | CGCL-codes/naturalcc | 7bab9a97331fafac1235fb32de829ff8d572320f | [
"MIT"
] | 4 | 2021-03-10T17:48:50.000Z | 2022-03-13T10:42:22.000Z | run/completion/trav_trans/train.py | CGCL-codes/naturalcc | 7bab9a97331fafac1235fb32de829ff8d572320f | [
"MIT"
] | 11 | 2020-12-09T12:17:44.000Z | 2022-03-30T09:02:13.000Z | import math
import os
import random
import torch
from ncc import LOGGER
from ncc import tasks
from ncc.data import iterators
from ncc.trainers.ncc_trainers import Trainer
from ncc.utils import checkpoint_utils, distributed_utils
from ncc.utils import set_seed
from ncc.utils import utils
from ncc.utils.file_ops.yaml_i... | 41.070122 | 117 | 0.661644 |
0815443dafd21bc8ef9eff44f0bb743c2d8581de | 403 | py | Python | grab-cores.py | wking/cpython-extension | d87eeb05813add0c407be4b8a19905cb51c16588 | [
"CC0-1.0"
] | 1 | 2019-06-11T00:06:50.000Z | 2019-06-11T00:06:50.000Z | grab-cores.py | wking/cpython-extension | d87eeb05813add0c407be4b8a19905cb51c16588 | [
"CC0-1.0"
] | null | null | null | grab-cores.py | wking/cpython-extension | d87eeb05813add0c407be4b8a19905cb51c16588 | [
"CC0-1.0"
] | 1 | 2020-03-26T13:21:47.000Z | 2020-03-26T13:21:47.000Z | #!/usr/bin/env python
import threading
import spam
def grab_cores(threads=1, count=int(1e9)):
_threads = []
for i in range(threads):
thread = threading.Thread(target=spam.busy, args=(count,))
_threads.append(thread)
thread.start()
for thread in _threads:
thread.join()
i... | 18.318182 | 66 | 0.637717 |
9669c7c868c60fb0d3f1f1fbd1d2667c7149b80b | 1,393 | py | Python | samples/test/placeholder_if_test.py | votti/pipelines | 1c3e2768e6177d5d6e3f4b8eff8fafb9a3b76c1f | [
"Apache-2.0"
] | 1 | 2022-03-30T05:22:19.000Z | 2022-03-30T05:22:19.000Z | samples/test/placeholder_if_test.py | votti/pipelines | 1c3e2768e6177d5d6e3f4b8eff8fafb9a3b76c1f | [
"Apache-2.0"
] | 1 | 2020-02-06T12:53:44.000Z | 2020-02-06T12:53:44.000Z | samples/test/placeholder_if_test.py | votti/pipelines | 1c3e2768e6177d5d6e3f4b8eff8fafb9a3b76c1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 39.8 | 101 | 0.753769 |
3c392c17091f2798f07c06af44d2de7bfd0705c2 | 862 | py | Python | switchrule.py | Lin-UN/shadowsocks-mod | 1061c3d899ec40b66c84cecb4c8f985bedc94016 | [
"Apache-2.0"
] | 4 | 2020-03-20T01:13:52.000Z | 2020-12-08T06:13:51.000Z | switchrule.py | aiastia/testssr | 070e72964ab3ebcd6c63c3ada39ee188b1fadf1d | [
"Apache-2.0"
] | 14 | 2021-01-05T06:58:04.000Z | 2022-02-04T19:06:02.000Z | switchrule.py | aiastia/testssr | 070e72964ab3ebcd6c63c3ada39ee188b1fadf1d | [
"Apache-2.0"
] | 8 | 2020-02-22T12:37:17.000Z | 2021-04-10T14:27:29.000Z | from configloader import get_config
def getKeys():
key_list = ["id", "port", "u", "d", "transfer_enable", "passwd", "enable"]
if get_config().API_INTERFACE == "sspanelv3":
key_list += ["method"]
elif get_config().API_INTERFACE == "sspanelv3ssr":
key_list += ["method", "obfs", "protocol"]
... | 27.806452 | 78 | 0.532483 |
6f80ef7041b59359fc7a790ede395f9c46c058e0 | 1,829 | py | Python | is_pto/preprocess_message.py | rohinigopalqxf2/practice-testing-ai-ml | ba8c8e14e24048653d8b00819f5337e3dc34757d | [
"MIT"
] | 2 | 2022-02-14T12:32:18.000Z | 2022-03-09T10:57:28.000Z | is_pto/preprocess_message.py | rohinigopalqxf2/practice-testing-ai-ml | ba8c8e14e24048653d8b00819f5337e3dc34757d | [
"MIT"
] | 3 | 2021-05-28T09:02:30.000Z | 2021-07-13T11:17:07.000Z | is_pto/preprocess_message.py | rohinigopalqxf2/practice-testing-ai-ml | ba8c8e14e24048653d8b00819f5337e3dc34757d | [
"MIT"
] | 1 | 2022-01-24T03:53:13.000Z | 2022-01-24T03:53:13.000Z | """
Preprocess incoming message to match what the training model uses
a) Clean the unwanted portions of the Skype message and SQS formatting
b) Mimic the training model - remove stop words and stem the words
"""
import re
from nltk.corpus import stopwords
from nltk.stem import SnowballStemmer
NOT_STOP_WORDS = ['not','o... | 39.76087 | 124 | 0.693275 |
350184c1f200436b507f860ff048a9194624f094 | 699 | py | Python | basico/core/migrations/0001_initial.py | ErickFernan/Django-Estudos | c42b9b00e57109389fef60235497d5ef903a7298 | [
"MIT"
] | null | null | null | basico/core/migrations/0001_initial.py | ErickFernan/Django-Estudos | c42b9b00e57109389fef60235497d5ef903a7298 | [
"MIT"
] | null | null | null | basico/core/migrations/0001_initial.py | ErickFernan/Django-Estudos | c42b9b00e57109389fef60235497d5ef903a7298 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2022-03-18 15:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Produto',
fields=[
('id', models.AutoField... | 29.125 | 114 | 0.599428 |
8a6af26441bdaf97b16cbde6c075c10a1a6a54c6 | 1,094 | py | Python | tests/063.py | abawchen/leetcode | 41d3b172a7694a46a860fbcb0565a3acccd000f2 | [
"MIT"
] | null | null | null | tests/063.py | abawchen/leetcode | 41d3b172a7694a46a860fbcb0565a3acccd000f2 | [
"MIT"
] | null | null | null | tests/063.py | abawchen/leetcode | 41d3b172a7694a46a860fbcb0565a3acccd000f2 | [
"MIT"
] | null | null | null | import unittest
import sys
sys.path.append('./')
solutions = __import__('solutions.063_unique_paths_ii', fromlist='*')
class Test(unittest.TestCase):
def test_uniquePathsWithObstacles(self):
s = solutions.Solution()
grid = [
[0,0,0],
[0,1,0],
[0,0,0]
... | 19.890909 | 69 | 0.490859 |
e57bd668fbe1495c0c1f3aa8a7bcba0147ee624e | 43 | py | Python | idiovec/__init__.py | bgutter/idiovec | 65fc2f4803b022d1a4f2dc63c761f39b138bb484 | [
"MIT"
] | 3 | 2019-08-06T22:50:29.000Z | 2022-02-07T02:11:31.000Z | idiovec/__init__.py | bgutter/idiovec | 65fc2f4803b022d1a4f2dc63c761f39b138bb484 | [
"MIT"
] | null | null | null | idiovec/__init__.py | bgutter/idiovec | 65fc2f4803b022d1a4f2dc63c761f39b138bb484 | [
"MIT"
] | null | null | null | from .idiovec import *
from . import cruft
| 14.333333 | 22 | 0.744186 |
4881f8db3f6b2565da5731ee49a5465bbaffecbc | 875 | py | Python | sentiment.py | MSJawad/Sentiment-Analysis | f39edb71051eeb4d781ece967aac5cea5de141ea | [
"MIT"
] | null | null | null | sentiment.py | MSJawad/Sentiment-Analysis | f39edb71051eeb4d781ece967aac5cea5de141ea | [
"MIT"
] | null | null | null | sentiment.py | MSJawad/Sentiment-Analysis | f39edb71051eeb4d781ece967aac5cea5de141ea | [
"MIT"
] | null | null | null | import tflearn
from tflearn.data_utils import to_categorical, pad_sequences
from tflearn.datasets import imdb
train, test , _ = imdb.load_data(path='imdb.pkl',n_words=10000 , valid_portion=0.1)
trainx,trainy= train
testx, testy = test
trainx=pad_sequences(trainx,maxlen=100,value=0.)
testx=pad_sequences(trainy,maxlen... | 32.407407 | 104 | 0.778286 |
218f927bf1f6289f6a9a547072ab987fbc589ee8 | 1,833 | py | Python | U3M1_sc/acme.py | chadeowen/DS-Unit-3-Sprint-1-Software-Engineering | a6459295debc0eb010f5982c7c7ae24b2c3ea8d3 | [
"MIT"
] | null | null | null | U3M1_sc/acme.py | chadeowen/DS-Unit-3-Sprint-1-Software-Engineering | a6459295debc0eb010f5982c7c7ae24b2c3ea8d3 | [
"MIT"
] | null | null | null | U3M1_sc/acme.py | chadeowen/DS-Unit-3-Sprint-1-Software-Engineering | a6459295debc0eb010f5982c7c7ae24b2c3ea8d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Python module for Acme Products organization.
"""
import numpy as np
class Product:
"""Example class to model an Acme Product
"""
def __init__(self, name=None, price=10, weight=20, flammability=0.5, identifier=np.random.randint(1000000, high=10000000)):
self.name = name
... | 30.55 | 127 | 0.590835 |
7ee06a5ebdb3d01d540568fa97d6683152dce109 | 6,814 | py | Python | kaztron/runner.py | Laogeodritt/KazTron | 42f35e520875b458ffde7c2729865c95de606aca | [
"MIT"
] | 6 | 2018-07-04T20:41:01.000Z | 2021-09-08T08:10:34.000Z | kaztron/runner.py | Laogeodritt/KazTron | 42f35e520875b458ffde7c2729865c95de606aca | [
"MIT"
] | 259 | 2018-05-01T22:41:32.000Z | 2022-02-08T23:25:00.000Z | kaztron/runner.py | Laogeodritt/KazTron | 42f35e520875b458ffde7c2729865c95de606aca | [
"MIT"
] | 6 | 2019-04-16T22:13:15.000Z | 2021-12-15T08:06:38.000Z | import asyncio
import logging
import random
import sys
import time
from discord.ext import commands
import kaztron
from kaztron import KazCog
from kaztron.config import get_kaztron_config, KaztronConfig, get_runtime_config
from kaztron.discord_patches import apply_patches
from kaztron.help_formatter import CoreHelpPa... | 33.239024 | 100 | 0.656149 |
b894f4bfe00469063bd424980cd52c20a87d16f5 | 1,036 | py | Python | Talla_Global_Home/migrations/0001_initial.py | denis254/talla | c776d5365db6d82b7ae14c8995d601c364594481 | [
"BSD-3-Clause"
] | null | null | null | Talla_Global_Home/migrations/0001_initial.py | denis254/talla | c776d5365db6d82b7ae14c8995d601c364594481 | [
"BSD-3-Clause"
] | 7 | 2020-06-05T18:14:27.000Z | 2022-03-11T23:21:13.000Z | Talla_Global_Home/migrations/0001_initial.py | denis254/talla | c776d5365db6d82b7ae14c8995d601c364594481 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.3 on 2018-05-26 03:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 37 | 192 | 0.63417 |
dee9ecff5e77c5965268624f9f03e2a29d285f2f | 1,067 | py | Python | sa-fastapi/otp-maker-atom/scripted-atom/scripts/redis_client.py | piximos/scripted-atoms | 6156803e2512bec11ed0403121b9e7f9bf019d99 | [
"MIT"
] | 2 | 2020-12-21T20:49:26.000Z | 2021-12-23T16:04:48.000Z | sa-fastapi/otp-maker-atom/scripted-atom/scripts/redis_client.py | piximos/scripted-atoms | 6156803e2512bec11ed0403121b9e7f9bf019d99 | [
"MIT"
] | null | null | null | sa-fastapi/otp-maker-atom/scripted-atom/scripts/redis_client.py | piximos/scripted-atoms | 6156803e2512bec11ed0403121b9e7f9bf019d99 | [
"MIT"
] | null | null | null | import os
import redis
from .opt_generator import OPTGenerator
class RedisClient:
def __init__(self):
self.host = os.getenv('SA_REDIS_HOST')
self.port = os.getenv('SA_REDIS_PORT')
self.password = os.getenv('SA_REDIS_PASSWORD')
self.db = os.getenv('SA_REDIS_DB')
self.ttl = ... | 34.419355 | 107 | 0.645736 |
2bbc2a910d5a57d0b1885f030c6ccf2bd0da7525 | 5,325 | py | Python | maskrcnn_benchmark/modeling/rpn/retinanet/retinanet.py | amsword/maskrcnn-benchmark | 660457d5f28c5d7d7887829486a20c60976b1dd8 | [
"MIT"
] | 2 | 2020-08-18T05:14:58.000Z | 2020-08-20T05:13:36.000Z | maskrcnn_benchmark/modeling/rpn/retinanet/retinanet.py | jacobswan1/maskrcnn-benchmark | 660457d5f28c5d7d7887829486a20c60976b1dd8 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/modeling/rpn/retinanet/retinanet.py | jacobswan1/maskrcnn-benchmark | 660457d5f28c5d7d7887829486a20c60976b1dd8 | [
"MIT"
] | 1 | 2020-08-18T05:15:08.000Z | 2020-08-18T05:15:08.000Z | import math
import torch
import torch.nn.functional as F
from torch import nn
from .inference import make_retinanet_postprocessor
from .loss import make_retinanet_loss_evaluator
from ..anchor_generator import make_anchor_generator_retinanet
from maskrcnn_benchmark.modeling.box_coder import BoxCoder
class RetinaNet... | 34.803922 | 88 | 0.611455 |
533af6574f1473e2150ec1af1a13494bab3f0bbf | 2,052 | py | Python | src/models/grid_search.py | ds-praveenkumar/m5-accuracy-prediction | 20255adc95c3e0fe6c6acec9fd16ac88c6e95908 | [
"MIT"
] | null | null | null | src/models/grid_search.py | ds-praveenkumar/m5-accuracy-prediction | 20255adc95c3e0fe6c6acec9fd16ac88c6e95908 | [
"MIT"
] | null | null | null | src/models/grid_search.py | ds-praveenkumar/m5-accuracy-prediction | 20255adc95c3e0fe6c6acec9fd16ac88c6e95908 | [
"MIT"
] | null | null | null | # github link: https://github.com/ds-praveenkumar/kaggle
# Author: ds-praveenkumar
# file: forcasting/grid_search.py/
# Created by ds-praveenkumar at 14-06-2020 10 52
# feature:
from sklearn.model_selection import ParameterGrid
from fbprophet import Prophet
import pandas as pd
import numpy as np
from fbprophet.diagno... | 26.649351 | 93 | 0.601365 |
a75cf39252c7332e09692c7a1f23e05dd24e6dd0 | 2,355 | py | Python | app/database.py | Gichia/questioner-v2 | b93ffdc521e364c191b770bf1bcb93964e7fa1f3 | [
"MIT"
] | null | null | null | app/database.py | Gichia/questioner-v2 | b93ffdc521e364c191b770bf1bcb93964e7fa1f3 | [
"MIT"
] | 6 | 2019-01-22T17:35:28.000Z | 2022-01-13T01:01:48.000Z | app/database.py | Gichia/questioner-v2 | b93ffdc521e364c191b770bf1bcb93964e7fa1f3 | [
"MIT"
] | null | null | null | """Querirs to initialize app database"""
def db_tables():
"""Queries to create app tables"""
tbl1 = """CREATE TABLE IF NOT EXISTS meetups (
meetup_id serial PRIMARY KEY NOT NULL,
created_by INT NOT NULL,
location CHAR(50) NOT NULL,
topic CHAR(50) NOT NULL,
createdOn CHAR(... | 31.824324 | 55 | 0.600425 |
77da2c0934bedbc1b1e455c6fc615c01791cba46 | 1,252 | py | Python | pbsmrtpipe/external_tools.py | PacificBiosciences/pbsmrtpipe | 4d532c823d3a46b82c2eb20b9d46e63544c8ba83 | [
"BSD-3-Clause"
] | 26 | 2015-08-06T02:09:51.000Z | 2021-02-26T02:25:01.000Z | pbsmrtpipe/external_tools.py | mpkocher/pbsmrtpipe | 4d532c823d3a46b82c2eb20b9d46e63544c8ba83 | [
"BSD-3-Clause"
] | 181 | 2015-08-07T18:13:02.000Z | 2021-04-13T16:24:32.000Z | pbsmrtpipe/external_tools.py | PacificBiosciences/pbsmrtpipe | 4d532c823d3a46b82c2eb20b9d46e63544c8ba83 | [
"BSD-3-Clause"
] | 29 | 2015-08-07T17:29:42.000Z | 2021-09-15T18:22:37.000Z | """Externally/subprocess calls.
The dot to image should be done within pygraphviz if the dependency isn't too
difficult to consistent to install.
"""
import os
import logging
import functools
from pbsmrtpipe.exceptions import RequiredExeNotFoundError
from pbsmrtpipe.engine import backticks
from pbcommand.utils import... | 29.116279 | 102 | 0.744409 |
62b652d67bb8183829d4af0af24ede2be62f0dff | 853 | py | Python | env/Lib/site-packages/OpenGL/GL/SGIX/ycrcb_subsample.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GL/SGIX/ycrcb_subsample.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GL/SGIX/ycrcb_subsample.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension SGIX.ycrcb_subsample
This module customises the behaviour of the
OpenGL.raw.GL.SGIX.ycrcb_subsample to provide a more
Python-friendly API
Overview (from the spec)
(Need to construct a real extension spec based on this)
The official definition of this extension is available here:
http://www.o... | 31.592593 | 71 | 0.801876 |
0d72b52ab743a3dc3ef9f5bee0b49e31afa62fbc | 1,284 | py | Python | thesis/utils.py | alki22/thesis | 079649cee05c1f6aa6b533ef4a41e6658b29b324 | [
"MIT"
] | null | null | null | thesis/utils.py | alki22/thesis | 079649cee05c1f6aa6b533ef4a41e6658b29b324 | [
"MIT"
] | null | null | null | thesis/utils.py | alki22/thesis | 079649cee05c1f6aa6b533ef4a41e6658b29b324 | [
"MIT"
] | 1 | 2018-09-13T15:44:25.000Z | 2018-09-13T15:44:25.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import fnmatch
import os
import numpy as np
def find(path, pattern):
"""
Implementation of unix `find`
:param path: Path to traverse
:param pattern: File pattern to look for
:return: Generator trave... | 27.913043 | 107 | 0.683801 |
55d8d2b0ecf4b92346df0ca7cd637cf123e721b9 | 7,049 | py | Python | indico/modules/rb/notifications/reservations.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | 1 | 2021-02-24T10:20:14.000Z | 2021-02-24T10:20:14.000Z | indico/modules/rb/notifications/reservations.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | 2 | 2021-05-26T09:16:52.000Z | 2021-05-26T09:28:59.000Z | indico/modules/rb/notifications/reservations.py | andrea-guarino-sonarsource/indico | 2dada1f293daea913dec85ebb33c29a9f2cb92ac | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import render_template
from sqlalchemy import and_
from sqlalchemy.orm import load_only
from i... | 38.309783 | 119 | 0.695276 |
c6c0e74050dd072a3797b3c582d8a32b9a41c7f3 | 15,378 | py | Python | tests/components/zha/test_cover.py | inishchith/core | 90892d275c259088ed302bdaa8838303a6ef4094 | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | tests/components/zha/test_cover.py | SicAriuSx83/core | 162c39258e68ae42fe4e1560ae91ed54f5662409 | [
"Apache-2.0"
] | 45 | 2020-10-15T06:47:06.000Z | 2022-03-31T06:26:16.000Z | tests/components/zha/test_cover.py | SicAriuSx83/core | 162c39258e68ae42fe4e1560ae91ed54f5662409 | [
"Apache-2.0"
] | 2 | 2020-05-11T00:38:26.000Z | 2021-01-15T13:23:44.000Z | """Test zha cover."""
import asyncio
import pytest
import zigpy.types
import zigpy.zcl.clusters.closures as closures
import zigpy.zcl.clusters.general as general
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
DOMAIN,
SERVICE_CLOSE_COVER,
SERVIC... | 35.597222 | 92 | 0.675575 |
3857956735279527f5c07243347fe853ed794a93 | 592 | py | Python | plot_mesh.py | JoeyValentine/gen-centerlines | fff03ee762eb1a852185ceb507e3850e1a47778c | [
"MIT"
] | 1 | 2021-04-27T07:26:44.000Z | 2021-04-27T07:26:44.000Z | plot_mesh.py | JoeyValentine/gen-centerlines | fff03ee762eb1a852185ceb507e3850e1a47778c | [
"MIT"
] | null | null | null | plot_mesh.py | JoeyValentine/gen-centerlines | fff03ee762eb1a852185ceb507e3850e1a47778c | [
"MIT"
] | null | null | null | import pyvista as pv
def confirm():
if len(plotter.picked_path.points) == 2:
plotter.close()
if __name__ == '__main__':
vti_file_name = 'level_sets.vti'
data = pv.read(vti_file_name)
vol = data.threshold_percent(30, invert=1)
surf = vol.extract_geometry()
smooth_surf = surf.smooth(n... | 22.769231 | 67 | 0.680743 |
c781139ec27f68515871d3ac0d70dc8358389d47 | 1,254 | py | Python | examples/flatten/test_flatten.py | mdawar/pretf | f11f8d646965e27dd2ade182fda3e8ce55d13804 | [
"MIT"
] | null | null | null | examples/flatten/test_flatten.py | mdawar/pretf | f11f8d646965e27dd2ade182fda3e8ce55d13804 | [
"MIT"
] | null | null | null | examples/flatten/test_flatten.py | mdawar/pretf | f11f8d646965e27dd2ade182fda3e8ce55d13804 | [
"MIT"
] | null | null | null | from unittest.mock import ANY
import pytest
from pretf import test
class TestFlatten(test.SimpleTest):
@pytest.mark.parametrize(
"stack,env", [
("iam", "dev"),
("iam", "prod"),
("vpc", "dev"),
("vpc", "prod"),
("vpc-peering", "prod"),
]... | 27.26087 | 65 | 0.470494 |
6002911e9b792b6f6d1666dc593d83a7300ce995 | 799 | py | Python | isiscb/openurl/migrations/0002_auto_20160323_1323.py | bgopalachary/IsisCB | c28e3f504eea60ebeff38318d8bb2071abb28ebb | [
"MIT"
] | 4 | 2016-01-25T20:35:33.000Z | 2020-04-07T15:39:52.000Z | isiscb/openurl/migrations/0002_auto_20160323_1323.py | bgopalachary/IsisCB | c28e3f504eea60ebeff38318d8bb2071abb28ebb | [
"MIT"
] | 41 | 2015-08-19T17:34:41.000Z | 2022-03-11T23:19:01.000Z | isiscb/openurl/migrations/0002_auto_20160323_1323.py | bgopalachary/IsisCB | c28e3f504eea60ebeff38318d8bb2071abb28ebb | [
"MIT"
] | 2 | 2020-11-25T20:18:18.000Z | 2021-06-24T15:15:41.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('openurl', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='resolver',
name='link_i... | 31.96 | 184 | 0.634543 |
d26475bf2844c3a80e87566dd696ba220512d9a5 | 13,498 | py | Python | sym_api_client_python/clients/admin_client.py | 3tilley/symphony-api-client-python | 8a743c27bcb2bba3fb22493c5494a19c78961ff4 | [
"MIT"
] | null | null | null | sym_api_client_python/clients/admin_client.py | 3tilley/symphony-api-client-python | 8a743c27bcb2bba3fb22493c5494a19c78961ff4 | [
"MIT"
] | null | null | null | sym_api_client_python/clients/admin_client.py | 3tilley/symphony-api-client-python | 8a743c27bcb2bba3fb22493c5494a19c78961ff4 | [
"MIT"
] | null | null | null | import requests
import json
import logging
import base64
from .api_client import APIClient
from ..exceptions.UnauthorizedException import UnauthorizedException
from requests_toolbelt.multipart.encoder import MultipartEncoder
# child class of APIClient --> Extends error handling functionality
# AdminClient class conta... | 43.401929 | 366 | 0.678989 |
f57aea54785b604ce74282fb60cf6943d6fb0028 | 4,894 | py | Python | doc/conf.py | ClericPy/trequests | 51dbf398da9383850bd0688fa3fb4edbe971597c | [
"MIT"
] | 27 | 2015-11-15T10:59:27.000Z | 2021-12-30T14:12:06.000Z | doc/conf.py | ClericPy/trequests | 51dbf398da9383850bd0688fa3fb4edbe971597c | [
"MIT"
] | 29 | 2015-11-15T12:47:22.000Z | 2020-03-23T09:28:56.000Z | doc/conf.py | ClericPy/trequests | 51dbf398da9383850bd0688fa3fb4edbe971597c | [
"MIT"
] | 5 | 2016-02-23T07:38:32.000Z | 2021-02-25T14:58:00.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 32.410596 | 80 | 0.653453 |
a63b9047e5d8c48354a889880618a61b2487442e | 1,609 | py | Python | aliyun-python-sdk-drds/aliyunsdkdrds/request/v20171016/DeleteDrdsDBRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-drds/aliyunsdkdrds/request/v20171016/DeleteDrdsDBRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-drds/aliyunsdkdrds/request/v20171016/DeleteDrdsDBRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"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.568182 | 74 | 0.766314 |
5b156aed61569eaff414d29fd7ad6eb71d793dba | 42 | py | Python | trolly/__init__.py | lhh/trolly | 178bfe24871889b35202f2b7eeebef001c9b9c73 | [
"BSD-2-Clause"
] | 1 | 2021-05-04T20:55:45.000Z | 2021-05-04T20:55:45.000Z | trolly/__init__.py | lhh/trolly | 178bfe24871889b35202f2b7eeebef001c9b9c73 | [
"BSD-2-Clause"
] | null | null | null | trolly/__init__.py | lhh/trolly | 178bfe24871889b35202f2b7eeebef001c9b9c73 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
__version__ = '0.1.4'
| 10.5 | 21 | 0.642857 |
f254946aa94bd2f8972b9fa880c22c161aad48f5 | 4,035 | py | Python | main.py | srlee-ai/KoBERT-nsmc | 9e0b03c5a20d444eea31544724e898aec988cb0f | [
"Apache-2.0"
] | null | null | null | main.py | srlee-ai/KoBERT-nsmc | 9e0b03c5a20d444eea31544724e898aec988cb0f | [
"Apache-2.0"
] | null | null | null | main.py | srlee-ai/KoBERT-nsmc | 9e0b03c5a20d444eea31544724e898aec988cb0f | [
"Apache-2.0"
] | null | null | null | import argparse
import json
from trainer import Trainer
from predict import Predict
from utils import init_logger, load_tokenizer, MODEL_CLASSES, MODEL_PATH_MAP
from data_loader import load_and_cache_examples
def main(args):
init_logger()
tokenizer = load_tokenizer(args)
train_dataset = None if args.do_p... | 54.527027 | 150 | 0.717968 |
fbbb5a05155b2e4a9a5ee671d221b14a49af0d67 | 805 | py | Python | documentation/scripts/supersampling_figure.py | diehlpk/muDIC | b5d90aa62267b4bd0b88ae0a989cf09a51990654 | [
"MIT"
] | 70 | 2019-04-15T08:08:23.000Z | 2022-03-23T08:24:25.000Z | documentation/scripts/supersampling_figure.py | diehlpk/muDIC | b5d90aa62267b4bd0b88ae0a989cf09a51990654 | [
"MIT"
] | 34 | 2019-05-03T18:09:43.000Z | 2022-02-10T11:36:29.000Z | documentation/scripts/supersampling_figure.py | diehlpk/muDIC | b5d90aa62267b4bd0b88ae0a989cf09a51990654 | [
"MIT"
] | 37 | 2019-04-25T15:39:23.000Z | 2022-03-28T21:40:24.000Z | import numpy as np
import matplotlib.pyplot as plt
from muDIC.phantoms.downsampler import coord_subpos,chess_board
N = 4
# make an empty data set
image = chess_board(1)[:4,:4]
center_coordinate = np.ones((1,1))*1.5
sub_coordinates_i = coord_subpos(center_coordinate,1.0,4,np.arange(4)[:,np.newaxis]*np.ones((4,4)),0)... | 30.961538 | 105 | 0.701863 |
52eacd2c45309a3d2fd5efe0160094d17c9931c1 | 1,114 | py | Python | plos_bio_scripts/postprocess_all_midas_data_serial.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | 2 | 2020-08-09T06:19:11.000Z | 2021-08-18T17:12:23.000Z | plos_bio_scripts/postprocess_all_midas_data_serial.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | plos_bio_scripts/postprocess_all_midas_data_serial.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | 8 | 2019-02-20T22:21:55.000Z | 2021-02-13T00:55:40.000Z | #!/usr/bin/env python
### This script runs the necessary post-processing of the MIDAS output
### across all species in serial.
import os
import sys
import config
if len(sys.argv) > 1:
argument=sys.argv[1]
else:
argument = 'all'
# First calculate core genes for each species
#os.system('python core_gene_uti... | 31.828571 | 95 | 0.789048 |
e246f0a79a66246066b8827acd4c3546c7fe1ada | 1,783 | py | Python | pontoon/translate/tests/test_views.py | anurzhanova/pontoon | b29f238e343ba81b6624d36d69fbb47c60bf4b8c | [
"BSD-3-Clause"
] | null | null | null | pontoon/translate/tests/test_views.py | anurzhanova/pontoon | b29f238e343ba81b6624d36d69fbb47c60bf4b8c | [
"BSD-3-Clause"
] | 4 | 2018-05-25T13:38:07.000Z | 2021-12-13T20:47:16.000Z | pontoon/translate/tests/test_views.py | anurzhanova/pontoon | b29f238e343ba81b6624d36d69fbb47c60bf4b8c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import pytest
from django.urls import reverse
from pontoon.translate.views import get_preferred_locale
@pytest.fixture
def user_arabic(user_a):
user_a.profile.custom_homepage = 'ar'
user_a.save()
return user_a
@pytest.mark.django_db
def test_translate_template(c... | 23.773333 | 77 | 0.661806 |
d24520457aa51c2cf64b2b3eeb75d64b02d0f80e | 142 | py | Python | tests/test_objects.py | holachau23/backend | 303d2044e117b7ed5a6932e9257212bc6a9f5e86 | [
"MIT"
] | 1 | 2021-12-03T16:10:27.000Z | 2021-12-03T16:10:27.000Z | tests/test_objects.py | holachau23/backend | 303d2044e117b7ed5a6932e9257212bc6a9f5e86 | [
"MIT"
] | null | null | null | tests/test_objects.py | holachau23/backend | 303d2044e117b7ed5a6932e9257212bc6a9f5e86 | [
"MIT"
] | 5 | 2021-11-15T23:30:05.000Z | 2021-11-30T13:10:59.000Z | import unittest
@unittest.skip("showing class skipping")
class MySkippedTestCase(unittest.TestCase):
def test_not_run(self):
pass | 23.666667 | 43 | 0.753521 |
903aa81576e3e4756439b02bf3dc3fac9580fec3 | 29,096 | py | Python | api/ccxt-master/python/ccxt/async/kraken.py | EdgarSargsyan/post | da26b98f4e68df5510fa0603645b1c1c6633f058 | [
"MIT"
] | 1 | 2021-10-14T09:59:54.000Z | 2021-10-14T09:59:54.000Z | api/ccxt-master/python/ccxt/async/kraken.py | EdgarSargsyan/post | da26b98f4e68df5510fa0603645b1c1c6633f058 | [
"MIT"
] | null | null | null | api/ccxt-master/python/ccxt/async/kraken.py | EdgarSargsyan/post | da26b98f4e68df5510fa0603645b1c1c6633f058 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
import base64
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import InvalidNonce
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import Order... | 38.537748 | 126 | 0.466387 |
f6e756de2e8e8d62613dbeef2e8437d02cf2891b | 124,000 | py | Python | flink-ai-flow/ai_flow/protobuf/message_pb2.py | LJMichale/flink-ai-extended | efda4ad801571a155970e3a9f42797fc0ee90c84 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-06T04:24:36.000Z | 2021-08-06T04:24:36.000Z | flink-ai-flow/ai_flow/protobuf/message_pb2.py | LJMichale/flink-ai-extended | efda4ad801571a155970e3a9f42797fc0ee90c84 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | flink-ai-flow/ai_flow/protobuf/message_pb2.py | LJMichale/flink-ai-extended | efda4ad801571a155970e3a9f42797fc0ee90c84 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-05-20T02:17:11.000Z | 2021-05-20T02:17:11.000Z | #
# 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... | 47.256098 | 12,204 | 0.769274 |
98516f43efe574b98d1316ad642c574bba5ae7c2 | 3,654 | py | Python | .history/DEBER_20210831114511.py | Alopezm5/PROYECTO-PARTE-1 | bd7a8594edf08d41c6ca544cf6bac01ea4fcb684 | [
"MIT"
] | null | null | null | .history/DEBER_20210831114511.py | Alopezm5/PROYECTO-PARTE-1 | bd7a8594edf08d41c6ca544cf6bac01ea4fcb684 | [
"MIT"
] | null | null | null | .history/DEBER_20210831114511.py | Alopezm5/PROYECTO-PARTE-1 | bd7a8594edf08d41c6ca544cf6bac01ea4fcb684 | [
"MIT"
] | null | null | null | class Nomina:
def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr="",email="",estado="",profe="",dep=""):#3
self.nombre=nom
self.ruc=ruc
self.direccion=dire
self.telefono=tele
self.ciudad=ciud
self.tipoEmpresa=tipEmpr
self.correo=email
self.... | 37.285714 | 247 | 0.655993 |
84db18c5836a151e089149994b7c314943b1d878 | 3,717 | py | Python | gallery/oauth2backend.py | cccs-is/callisto | 7e1da3d12a8da0d2b49d79c02399cc4c0accccce | [
"MIT"
] | null | null | null | gallery/oauth2backend.py | cccs-is/callisto | 7e1da3d12a8da0d2b49d79c02399cc4c0accccce | [
"MIT"
] | null | null | null | gallery/oauth2backend.py | cccs-is/callisto | 7e1da3d12a8da0d2b49d79c02399cc4c0accccce | [
"MIT"
] | null | null | null | import jwt
import requests
from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.backends import default_backend
from django.core.exceptions import PermissionDenied
from django.contrib.auth import get_user_model
from django.conf import settings
class OAuth2Authentication:
"""
Token-... | 42.238636 | 118 | 0.663438 |
90dc85de5cda62816f4c75fb4c0d66d248bd9cfa | 898 | py | Python | templates/proj_template.py | eric373/ml-py | 23d5e5685c0e5a09fc9fc1dbe50572562ee4cb32 | [
"MIT"
] | null | null | null | templates/proj_template.py | eric373/ml-py | 23d5e5685c0e5a09fc9fc1dbe50572562ee4cb32 | [
"MIT"
] | null | null | null | templates/proj_template.py | eric373/ml-py | 23d5e5685c0e5a09fc9fc1dbe50572562ee4cb32 | [
"MIT"
] | null | null | null | # Python Project Template
# 1. Prepare Problem
# a) Load libraries
# b) Load dataset
# 2. Summarize Data
# a) Descriptive statistics
# - Note the scale of the attributes for normalizing
# - Note features/variables that are correlated to be removed
# b) Data visualizations
# - Consider standardizing
# - Not... | 26.411765 | 64 | 0.739421 |
f863801d5bda8210b36af1f2685ad117a828af39 | 1,660 | py | Python | wagtail_sb_material/models/branding.py | softbutterfly/softbutterfly-wagtail-materialize | 8619166b5688d4a51b1a6e39a03e22661bc1a7ea | [
"BSD-3-Clause"
] | null | null | null | wagtail_sb_material/models/branding.py | softbutterfly/softbutterfly-wagtail-materialize | 8619166b5688d4a51b1a6e39a03e22661bc1a7ea | [
"BSD-3-Clause"
] | null | null | null | wagtail_sb_material/models/branding.py | softbutterfly/softbutterfly-wagtail-materialize | 8619166b5688d4a51b1a6e39a03e22661bc1a7ea | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.core.fields import StreamField
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.admin.edit_handlers import MultiFieldPanel
from wagtail.admin.edit_handlers import StreamFieldPanel
... | 21.558442 | 58 | 0.618072 |
8497902a6caa723701ee40d225db35a8da987ff4 | 324 | py | Python | array/643_maximum_average_subarray_i.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | array/643_maximum_average_subarray_i.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | array/643_maximum_average_subarray_i.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | class Solution:
def findMaxAverage(self, nums: List[int], k: int) -> float:
# sliding window, O(N) time, O(1) space
globMax = tempMax = sum(nums[:k])
for i in range(k, len(nums)):
tempMax += (nums[i] - nums[i-k])
globMax = max(tempMax, globMax)
return globMax ... | 36 | 63 | 0.546296 |
51dedae21277398cd8496854435176e789a6ca34 | 8,326 | py | Python | HttpTriggerHumanPose/postprocessor.py | haru315/ovaas-backend-template | 9672b30db537a1ab472ad8673e5f81f311f47376 | [
"MIT"
] | 1 | 2021-05-12T06:56:47.000Z | 2021-05-12T06:56:47.000Z | HttpTriggerHumanPose/postprocessor.py | haru315/ovaas-backend-template | 9672b30db537a1ab472ad8673e5f81f311f47376 | [
"MIT"
] | null | null | null | HttpTriggerHumanPose/postprocessor.py | haru315/ovaas-backend-template | 9672b30db537a1ab472ad8673e5f81f311f47376 | [
"MIT"
] | 1 | 2022-02-08T02:25:40.000Z | 2022-02-08T02:25:40.000Z | import cv2
import numpy as np
import math
from collections import defaultdict
from scipy.ndimage.filters import maximum_filter
import itertools
CocoPairs = [
(1, 2), (1, 5), (2, 3), (3, 4), (5, 6), (6, 7), (1, 8), (8, 9),
(9, 10), (1, 11), (11, 12), (12, 13), (1, 0), (0, 14), (14, 16),
(0, 15), (15, 17), (... | 38.192661 | 102 | 0.573745 |
cefdc69e66931d94cf30af7343ce37366fe6f018 | 510 | py | Python | examples/probabilistic_keypoint_estimation/demo_image.py | niqbal996/paz | f27205907367415d5b21f90e1a1d1d1ce598e889 | [
"MIT"
] | 300 | 2020-10-29T08:02:05.000Z | 2022-03-30T21:47:32.000Z | examples/probabilistic_keypoint_estimation/demo_image.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 30 | 2020-10-29T12:40:32.000Z | 2022-03-31T14:06:35.000Z | examples/probabilistic_keypoint_estimation/demo_image.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 62 | 2020-10-29T12:34:13.000Z | 2022-03-29T05:21:45.000Z | import argparse
from pipelines import DetectGMMKeypointNet2D
from paz.backend.image import show_image, load_image
description = 'Demo for visualizing uncertainty in probabilistic keypoints'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-p', '--path', type=str, help='Path to image')
arg... | 34 | 75 | 0.801961 |
f96d1935f23c99f93af94b86210f1387289e0827 | 2,254 | py | Python | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Aerodynamics/Common/Fidelity_Zero/Helper_Functions/wave_drag_lift.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Aerodynamics/Common/Fidelity_Zero/Helper_Functions/wave_drag_lift.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Aerodynamics/Common/Fidelity_Zero/Helper_Functions/wave_drag_lift.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | ## @ingroup Methods-Aerodynamics-Common-Fidelity_Zero-Helper_Functions
# wave_drag_lift.py
#
# Created: Jun 2014, T. Macdonald
# Modified: Jul 2014, T. Macdonald
# Jan 2016, E. Botero
# ----------------------------------------------------------------------
# Imports
# -------------------------------------... | 29.657895 | 93 | 0.540816 |
aa0a19d906f14be18562487c1d4b256f795846a1 | 778 | py | Python | katana/pedals/effects/rotary_1.py | leon3110l/katana_tsl_patch | a88cb35f524ba1941ccb4f94e0dcaa02df11fd18 | [
"MIT"
] | null | null | null | katana/pedals/effects/rotary_1.py | leon3110l/katana_tsl_patch | a88cb35f524ba1941ccb4f94e0dcaa02df11fd18 | [
"MIT"
] | null | null | null | katana/pedals/effects/rotary_1.py | leon3110l/katana_tsl_patch | a88cb35f524ba1941ccb4f94e0dcaa02df11fd18 | [
"MIT"
] | null | null | null | from enum import IntEnum
from .. import FXPedal, FXType
class RotaryType(IntEnum):
DEFAULT = 1
SLOW = 0
FAST = 1
class Rotary(FXPedal):
FX_TYPE = FXType.ROTARY_1
def __init__(self,
_type : RotaryType = RotaryType.DEFAULT,
depth: int = 60,
fall_tim... | 24.3125 | 56 | 0.521851 |
0fddc094b067ef3ca62411b6ffe98700e8f9016b | 440 | py | Python | manual_publish.py | roschaefer/sMirror | 5e0215dcf4fe9d1f55d821dcfe917602873f4f9e | [
"MIT"
] | 1 | 2018-02-12T17:39:07.000Z | 2018-02-12T17:39:07.000Z | manual_publish.py | roschaefer/sMirror | 5e0215dcf4fe9d1f55d821dcfe917602873f4f9e | [
"MIT"
] | 2 | 2018-01-05T23:47:20.000Z | 2018-11-18T11:17:45.000Z | manual_publish.py | roschaefer/sMirror | 5e0215dcf4fe9d1f55d821dcfe917602873f4f9e | [
"MIT"
] | 1 | 2018-01-05T23:36:47.000Z | 2018-01-05T23:36:47.000Z | #!/usr/bin/python
import paho.mqtt.publish as publish
import argparse
parser = argparse.ArgumentParser(description='Publish a url to a display via mqtt')
parser.add_argument('url', help='the url to publish')
parser.add_argument('--host', default='smirrormaster.local')
parser.add_argument('--topic', default='slave')
arg... | 31.428571 | 91 | 0.765909 |
d93545966091953319a0dae6049d2b41467865c1 | 1,851 | py | Python | upload_data.py | crazyhubox/RoomUse | a0b3b13d3f67ee9ec407d00e8224e6988a3cf5c7 | [
"MIT"
] | 1 | 2021-05-10T11:55:43.000Z | 2021-05-10T11:55:43.000Z | upload_data.py | crazyhubox/RoomUse | a0b3b13d3f67ee9ec407d00e8224e6988a3cf5c7 | [
"MIT"
] | null | null | null | upload_data.py | crazyhubox/RoomUse | a0b3b13d3f67ee9ec407d00e8224e6988a3cf5c7 | [
"MIT"
] | null | null | null |
from redis import Redis
from json import loads
import os
# 星期[1,2,3,4,5]
import os
PRO_PATH = os.path.dirname(os.path.abspath(__file__))
def read_datas(file_path:str) -> dict:
with open(file_path,'r',encoding='utf-8') as f:
strings = f.read()
return loads(strings)
def generateor_data():
""... | 22.301205 | 90 | 0.596975 |
491a799a21412a2ff7722fab3d94ff4c00bf91a5 | 2,091 | py | Python | hknweb/urls.py | NauqGnesh/hknweb | b4a358c1bff09ec92ba5b903ff7332db826271d4 | [
"MIT"
] | null | null | null | hknweb/urls.py | NauqGnesh/hknweb | b4a358c1bff09ec92ba5b903ff7332db826271d4 | [
"MIT"
] | null | null | null | hknweb/urls.py | NauqGnesh/hknweb | b4a358c1bff09ec92ba5b903ff7332db826271d4 | [
"MIT"
] | null | null | null | """hknweb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | 41.82 | 80 | 0.702056 |
01d09f05f3f860448abe6581b9be3468f055d500 | 3,680 | py | Python | schema/transform.py | basis-technology-corp/annotated-data-model | 14d201a78f0e2bca2f08015216ead94f389acb14 | [
"Apache-2.0"
] | 6 | 2016-03-08T15:26:15.000Z | 2018-03-21T17:58:40.000Z | schema/transform.py | basis-technology-corp/annotated-data-model | 14d201a78f0e2bca2f08015216ead94f389acb14 | [
"Apache-2.0"
] | 19 | 2016-02-23T21:50:24.000Z | 2020-10-02T20:16:59.000Z | schema/transform.py | basis-technology-corp/annotated-data-model | 14d201a78f0e2bca2f08015216ead94f389acb14 | [
"Apache-2.0"
] | 9 | 2016-02-05T14:55:12.000Z | 2018-09-27T15:47:41.000Z | import json
# load language codes (languages.groovy)
with open("language_codes.json") as f:
language_codes = json.load(f)
with open("adm-schema-generated.json") as f:
schema = json.load(f)
transformed = {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Annotated Text",
... | 33.761468 | 92 | 0.584511 |
6b70c2883a7e6a683fa0978c7eb10aea569ed1bd | 402 | py | Python | parkinglot/migrations/0012_auto_20210328_1056.py | Amankori2307/Park-Here | bf30e721577ff6df3b761f8bbb1bfe085ffac14c | [
"MIT"
] | null | null | null | parkinglot/migrations/0012_auto_20210328_1056.py | Amankori2307/Park-Here | bf30e721577ff6df3b761f8bbb1bfe085ffac14c | [
"MIT"
] | null | null | null | parkinglot/migrations/0012_auto_20210328_1056.py | Amankori2307/Park-Here | bf30e721577ff6df3b761f8bbb1bfe085ffac14c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-28 10:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parkinglot', '0011_auto_20210327_2330'),
]
operations = [
migrations.AlterField(
model_name='parking',
name='entry_t... | 21.157895 | 58 | 0.614428 |
e7a38a1ff1b1bbcdf9a41e408d552e5dbd584d94 | 793 | py | Python | motion_imitation/envs/env_wrappers/boundary_terminal_conditions.py | lauramsmith/fine-tuning-locomotion | 583f1de43e91cdd24d632d783872528eb1337480 | [
"Apache-2.0"
] | 41 | 2021-10-11T19:52:13.000Z | 2022-03-21T12:42:31.000Z | motion_imitation/envs/env_wrappers/boundary_terminal_conditions.py | ywkim0606/fine-tuning-locomotion | 96d7c81458511c0a7a11b59cf8c2c3fb8df8a64b | [
"Apache-2.0"
] | 6 | 2021-12-09T14:03:48.000Z | 2022-03-28T11:11:01.000Z | motion_imitation/envs/env_wrappers/boundary_terminal_conditions.py | ywkim0606/fine-tuning-locomotion | 96d7c81458511c0a7a11b59cf8c2c3fb8df8a64b | [
"Apache-2.0"
] | 8 | 2021-10-12T06:17:28.000Z | 2022-03-10T21:32:05.000Z | """Ends episode if robot is outside workspace bounds."""
class BoundaryTerminalCondition(object):
"""Ends episode if robot is outside workspace bounds."""
def __init__(self, x_space_m=5, y_space_m=5):
"""Constructor.
:param x_space_m: Length of workspace in meters.
:param y_space_m: Width of workspa... | 27.344828 | 59 | 0.684741 |
525f66b785193a893f1326c55ced72440b3b9365 | 446 | py | Python | insurance_backend/risk_types/views.py | tocilla/Insurance | f1f43101412e8a56a7615f961984d507ab0d0e06 | [
"MIT"
] | null | null | null | insurance_backend/risk_types/views.py | tocilla/Insurance | f1f43101412e8a56a7615f961984d507ab0d0e06 | [
"MIT"
] | null | null | null | insurance_backend/risk_types/views.py | tocilla/Insurance | f1f43101412e8a56a7615f961984d507ab0d0e06 | [
"MIT"
] | null | null | null | # Create your views here.
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
from .models import RiskType
from .serializers import RiskTypeSerializer
class RiskTypeViewSet(mixins.ListModelMixin,
mixins.CreateModelMixin,
mixins.RetrieveModel... | 31.857143 | 50 | 0.713004 |
d3f7ae25ac7229fa5eaf2c8e282a1799afcb97a8 | 27,748 | py | Python | clients/python-legacy/generated/openapi_client/api_client.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | clients/python-legacy/generated/openapi_client/api_client.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | clients/python-legacy/generated/openapi_client/api_client.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import atexit
i... | 39.527066 | 96 | 0.556833 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.