hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
742864bd2a489edccd1cf9060b5f76ff6dfe4c2a | 5,872 | py | Python | pipeline/cf_create_bq_layers/main.py | allenday/bigquery-openstreetmap | 3011c51d2ef129360607946819838dc33d33076f | [
"BSD-3-Clause"
] | 10 | 2020-01-22T14:49:08.000Z | 2022-02-15T15:54:20.000Z | pipeline/cf_create_bq_layers/main.py | allenday/bigquery-openstreetmap | 3011c51d2ef129360607946819838dc33d33076f | [
"BSD-3-Clause"
] | 61 | 2019-09-05T07:11:11.000Z | 2019-11-18T03:35:51.000Z | pipeline/cf_create_bq_layers/main.py | allenday/bigquery-openstreetmap | 3011c51d2ef129360607946819838dc33d33076f | [
"BSD-3-Clause"
] | 3 | 2019-08-21T08:00:59.000Z | 2020-03-27T22:52:12.000Z | """
Creates OSM layers in BigQuery based on SQL scripts
"""
import os
import time
import logging
from typing import List
from google.cloud import bigquery
from google.cloud import storage
from google.api_core.exceptions import NotFound
from copy_public_tables import copy_tables_to_public_dataset
GCP_PROJECT = os.en... | 34.541176 | 190 | 0.729053 |
73db7cf58ff061847268802673a43a2c5ac21c2a | 1,192 | py | Python | Managers/CollectionManager.py | fefelson/MLBProjections | 444a1c071cb7b1e21eedc49cf63ae91e80d37978 | [
"MIT"
] | null | null | null | Managers/CollectionManager.py | fefelson/MLBProjections | 444a1c071cb7b1e21eedc49cf63ae91e80d37978 | [
"MIT"
] | null | null | null | Managers/CollectionManager.py | fefelson/MLBProjections | 444a1c071cb7b1e21eedc49cf63ae91e80d37978 | [
"MIT"
] | null | null | null | import os
import MLBProjections.MLBProjections.Environ as ENV
################################################################################
################################################################################
################################################################################
########... | 31.368421 | 108 | 0.373322 |
6e5d70920668cb4e728fb076dcab5e0566d89980 | 16,310 | py | Python | train_openfold.py | ychnh/openfold | e61a00d063c0f2d939d24963929cea2b413d3e8e | [
"Apache-2.0"
] | null | null | null | train_openfold.py | ychnh/openfold | e61a00d063c0f2d939d24963929cea2b413d3e8e | [
"Apache-2.0"
] | null | null | null | train_openfold.py | ychnh/openfold | e61a00d063c0f2d939d24963929cea2b413d3e8e | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
#os.environ["CUDA_VISIBLE_DEVICES"] = "0"
#os.environ["MASTER_ADDR"]="10.119.81.14"
#os.environ["MASTER_PORT"]="42069"
#os.environ["NODE_RANK"]="0"
import random
import time
import numpy as np
import pytorch_lightning as pl
from pytorch_lightning.callbacks.lr_monitor import L... | 32.361111 | 80 | 0.634703 |
4c0617adddcead89cc386810a08bd63042d23702 | 1,326 | py | Python | tests/test_algebra_onnx_operators_opset.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | 323 | 2018-12-18T20:23:19.000Z | 2022-03-25T09:47:31.000Z | tests/test_algebra_onnx_operators_opset.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | 408 | 2019-01-02T12:16:10.000Z | 2022-03-21T14:01:28.000Z | tests/test_algebra_onnx_operators_opset.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | 70 | 2018-12-20T19:36:07.000Z | 2022-03-14T06:41:36.000Z | # SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from numpy.testing import assert_almost_equal
import onnx
import onnxruntime as ort
from skl2onnx.algebra.onnx_ops import OnnxPad # noqa
class TestOnnxOperatorsOpset(unittest.TestCase):
@unittest.skipIf(onnx.defs.onnx_opset_version() < 10... | 33.15 | 73 | 0.616893 |
7729d7d759748d087090722c02fc25dc7a50022c | 8,188 | py | Python | objects/chessboard.py | UnopposedQuill/ChessFinals | 3c6142a3379ff9429599ea589c417717af3bbac6 | [
"MIT"
] | null | null | null | objects/chessboard.py | UnopposedQuill/ChessFinals | 3c6142a3379ff9429599ea589c417717af3bbac6 | [
"MIT"
] | null | null | null | objects/chessboard.py | UnopposedQuill/ChessFinals | 3c6142a3379ff9429599ea589c417717af3bbac6 | [
"MIT"
] | null | null | null | from objects.pieces import *
def location_translator(row, column):
if column == 'a':
return 8 - row, 0
elif column == 'b':
return 8 - row, 1
elif column == 'c':
return 8 - row, 2
elif column == 'd':
return 8 - row, 3
elif column == 'e':
return 8 - row, 4
elif column == 'f':
return 8 - row, 5
elif c... | 32.109804 | 120 | 0.581705 |
b737042cd022913233be6f52432ae382353dee4a | 13,198 | py | Python | models/pt_3dpose/detectron/roi_data/retinanet.py | DreaJulca/uxsense | 538800f3e071660f4a8242c90b25f500b8667aa8 | [
"MIT"
] | 27,213 | 2018-01-22T22:28:13.000Z | 2022-03-31T15:37:11.000Z | models/pt_3dpose/detectron/roi_data/retinanet.py | DreaJulca/uxsense | 538800f3e071660f4a8242c90b25f500b8667aa8 | [
"MIT"
] | 992 | 2018-01-23T05:13:19.000Z | 2022-03-30T09:45:05.000Z | models/pt_3dpose/detectron/roi_data/retinanet.py | DreaJulca/uxsense | 538800f3e071660f4a8242c90b25f500b8667aa8 | [
"MIT"
] | 6,227 | 2018-01-22T22:28:48.000Z | 2022-03-31T12:54:07.000Z | # Copyright (c) 2017-present, Facebook, 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 agreed... | 45.66782 | 85 | 0.610623 |
1cc4bb6a8b9a54582aeca66608312b28d3663e00 | 1,586 | py | Python | scripts/from_ast_to_zip.py | masonproffitt/ServiceX_Code_Generator_FuncADL_uproot | 74aed86affed999dfe0338a9c85c8ee67271fc99 | [
"BSD-3-Clause"
] | null | null | null | scripts/from_ast_to_zip.py | masonproffitt/ServiceX_Code_Generator_FuncADL_uproot | 74aed86affed999dfe0338a9c85c8ee67271fc99 | [
"BSD-3-Clause"
] | null | null | null | scripts/from_ast_to_zip.py | masonproffitt/ServiceX_Code_Generator_FuncADL_uproot | 74aed86affed999dfe0338a9c85c8ee67271fc99 | [
"BSD-3-Clause"
] | null | null | null | # A script that will take as input a text ast (on the command line) and
# write out a zip file.
import sys
from servicex.code_generator_service.ast_translator import AstTranslator
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-a", "--ast",
... | 37.761905 | 115 | 0.627995 |
f3110ebd64fdf497e88d9d4a1212fae956b060c6 | 11,213 | py | Python | docx/text/parfmt.py | tanglw2020/python-docx-v2.0 | 32a41342695d8cd496852d85a8d0d2341adbf23d | [
"MIT"
] | null | null | null | docx/text/parfmt.py | tanglw2020/python-docx-v2.0 | 32a41342695d8cd496852d85a8d0d2341adbf23d | [
"MIT"
] | null | null | null | docx/text/parfmt.py | tanglw2020/python-docx-v2.0 | 32a41342695d8cd496852d85a8d0d2341adbf23d | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
Paragraph-related proxy types.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from ..enum.text import WD_LINE_SPACING
from ..shared import ElementProxy, Emu, lazyproperty, Length, Pt, Twips
from .tabstops import TabStops
class ParagraphFormat(El... | 34.082067 | 77 | 0.635869 |
557c829c2eb999ede338e32cfdfa1840dc680489 | 299 | py | Python | PYTHON/pythonDesafios/desafio009.py | Santos1000/Curso-Python | 549223a1633f6f619c87554dd8078cf7841bb1df | [
"MIT"
] | null | null | null | PYTHON/pythonDesafios/desafio009.py | Santos1000/Curso-Python | 549223a1633f6f619c87554dd8078cf7841bb1df | [
"MIT"
] | null | null | null | PYTHON/pythonDesafios/desafio009.py | Santos1000/Curso-Python | 549223a1633f6f619c87554dd8078cf7841bb1df | [
"MIT"
] | null | null | null | z = int(input('Digite o numero desejado'))
a = z * 1
b = z * 2
c = z * 3
d = z * 4
e = z * 5
f = z * 6
g = z * 7
h = z * 8
i = z * 9
j = z * 10
print(f'Tabuada de {z}:\n{z}x1={a}')
print(f'{z}x2={b}\n{z}x3={c}\n{z}x4={d}\n{z}x5={e}\n{z}x6={f}\n{z}x7={g}\n{z}x8={h}\n{z}x9={i}\n{z}x10={j}')
| 13 | 108 | 0.444816 |
90db4097dc5b245981c57edf3b08787feb06cd8c | 4,196 | py | Python | app/mod_user/controller.py | meraki/investigo-spark-bot | 34665143724522d463873d704dd8d77861748358 | [
"Apache-2.0"
] | 2 | 2019-01-18T04:16:26.000Z | 2020-03-12T22:13:17.000Z | web/app/mod_user/controller.py | rafael-carvalho/cmx-investigo | 0bd3b9905ecd9ddd4398b12a7cb8553e79e35648 | [
"Apache-2.0"
] | null | null | null | web/app/mod_user/controller.py | rafael-carvalho/cmx-investigo | 0bd3b9905ecd9ddd4398b12a7cb8553e79e35648 | [
"Apache-2.0"
] | 2 | 2018-04-18T08:35:59.000Z | 2020-03-12T22:13:19.000Z | """
Copyright 2017 Rafael Carvalho
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 i... | 33.568 | 98 | 0.594137 |
5293ee6df55d2109225229d40e421eb66c82bfe1 | 962 | py | Python | crf/densecrf.py | sahan-liyanaarachchi/bcrf-detectron | 7cbdd8a77e54f09cca1addd66c7359e17501b9e4 | [
"Apache-2.0"
] | 4 | 2020-09-11T05:39:22.000Z | 2022-02-03T20:50:51.000Z | crf/densecrf.py | sahan-liyanaarachchi/bcrf-detectron | 7cbdd8a77e54f09cca1addd66c7359e17501b9e4 | [
"Apache-2.0"
] | 4 | 2021-06-08T22:17:39.000Z | 2022-03-12T00:46:18.000Z | crf/densecrf.py | sahan-liyanaarachchi/bcrf-detectron | 7cbdd8a77e54f09cca1addd66c7359e17501b9e4 | [
"Apache-2.0"
] | 3 | 2020-09-05T11:31:59.000Z | 2020-10-03T00:11:48.000Z | from crf.pairwise import SpatialPairwise, BilateralPairwise
from crf.params import DenseCRFParams
from crf.util import softmax
class DenseCRF(object):
def __init__(self, image, params: DenseCRFParams):
alpha, beta, gamma = params.alpha, params.beta, params.gamma
self.sp = SpatialPairwise(image, ... | 30.0625 | 90 | 0.658004 |
5fe8d5406683aa67e68fc74b8386ced7615df746 | 1,478 | py | Python | 2021/CVE-2021-37678/vultarget/src/CreateExampleModel.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 421 | 2021-12-07T08:46:40.000Z | 2022-03-31T12:42:16.000Z | 2021/CVE-2021-37678/vultarget/src/CreateExampleModel.py | LinShiG0ng/reapoc | 99ebfcca818928eca79c0a2dcc2e466bc8f3e734 | [
"Apache-2.0"
] | 1 | 2022-03-14T06:07:39.000Z | 2022-03-14T15:52:22.000Z | 2021/CVE-2021-37678/vultarget/src/CreateExampleModel.py | LinShiG0ng/reapoc | 99ebfcca818928eca79c0a2dcc2e466bc8f3e734 | [
"Apache-2.0"
] | 144 | 2021-12-07T11:06:14.000Z | 2022-03-31T07:41:35.000Z | import tensorflow as tf
print('Se carga un set de datos que Google da como ejemplo para clasificación de imágenes\n\n')
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
print('\n\nSe crea un modelo de ML con una red neuronal p... | 24.633333 | 98 | 0.716509 |
df1417a1fc1c426e2f58c0ff47cdea818f05ec2f | 3,606 | py | Python | scripts/catch_non_abstract_annotation.py | ticosax/django-stubs | 2f7fac2eaf87fe1e50d635ab14bcbe6c475dabc8 | [
"MIT"
] | 641 | 2015-01-01T11:27:21.000Z | 2022-03-22T12:46:01.000Z | scripts/catch_non_abstract_annotation.py | ticosax/django-stubs | 2f7fac2eaf87fe1e50d635ab14bcbe6c475dabc8 | [
"MIT"
] | 177 | 2015-01-01T13:00:21.000Z | 2022-03-15T08:23:28.000Z | scripts/catch_non_abstract_annotation.py | ticosax/django-stubs | 2f7fac2eaf87fe1e50d635ab14bcbe6c475dabc8 | [
"MIT"
] | 118 | 2015-01-14T03:03:08.000Z | 2022-03-10T03:37:40.000Z | import os
from typing import Optional
import libcst
from libcst import Annotation, BaseExpression, FunctionDef, Name, Subscript
from libcst.metadata import SyntacticPositionProvider
BASE_DIR = 'django-stubs'
fpath = os.path.join(BASE_DIR, 'core', 'checks', 'model_checks.pyi')
with open(fpath, 'r') as f:
contents... | 40.516854 | 111 | 0.646977 |
4192e8055a0ba0ac2f86cebae4acc5923106a058 | 1,534 | py | Python | 0025.Reverse Nodes in k-Group/solution.py | zhlinh/leetcode | 6dfa0a4df9ec07b2c746a13c8257780880ea04af | [
"Apache-2.0"
] | null | null | null | 0025.Reverse Nodes in k-Group/solution.py | zhlinh/leetcode | 6dfa0a4df9ec07b2c746a13c8257780880ea04af | [
"Apache-2.0"
] | null | null | null | 0025.Reverse Nodes in k-Group/solution.py | zhlinh/leetcode | 6dfa0a4df9ec07b2c746a13c8257780880ea04af | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: zhlinhng@gmail.com
Version: 0.0.1
Created Time: 2016-01-26
Last_modify: 2016-01-26
******************************************
'''
'''
Given a linked list, reverse the nodes of ... | 24.349206 | 78 | 0.495437 |
3c9f39bf3f93787908d46f3d70458ec9d85a462d | 5,987 | py | Python | sdk/python/pulumi_aws/ec2/get_customer_gateway.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/get_customer_gateway.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/get_customer_gateway.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 34.017045 | 141 | 0.632871 |
52583431818e8fe0c2df65bdb321e0e9befcd4a8 | 4,971 | py | Python | test/torchaudio_unittest/transforms/torchscript_consistency_impl.py | vivekkumar7089/audio | 0ea6d10d3cd5cd66b0831e218ac18f6b7d8cab3c | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/transforms/torchscript_consistency_impl.py | vivekkumar7089/audio | 0ea6d10d3cd5cd66b0831e218ac18f6b7d8cab3c | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/transforms/torchscript_consistency_impl.py | vivekkumar7089/audio | 0ea6d10d3cd5cd66b0831e218ac18f6b7d8cab3c | [
"BSD-2-Clause"
] | null | null | null | """Test suites for jit-ability and its numerical compatibility"""
import torch
import torchaudio.transforms as T
from parameterized import parameterized
from torchaudio_unittest import common_utils
from torchaudio_unittest.common_utils import (
skipIfRocm,
TempDirMixin,
TestBaseMixin,
)
class Transforms... | 36.021739 | 97 | 0.681754 |
ab0c7a64256709e87956cd81f210d1f962d8c26a | 1,213 | py | Python | old-katas/roman-numbers/day-6.py | Alex-Diez/python-tdd-katas | a176f16cfd103e618e539a57cac0748fba52221c | [
"MIT"
] | null | null | null | old-katas/roman-numbers/day-6.py | Alex-Diez/python-tdd-katas | a176f16cfd103e618e539a57cac0748fba52221c | [
"MIT"
] | null | null | null | old-katas/roman-numbers/day-6.py | Alex-Diez/python-tdd-katas | a176f16cfd103e618e539a57cac0748fba52221c | [
"MIT"
] | null | null | null | # -*- codeing: utf-8 -*-
class Converter(object):
def __init__(self):
self.factors = {10: "X", 9: "IX", 5: "V", 4: "IV", 1: "I"}
def convert(self, n):
if n < 1:
return ""
arabic = sorted(list(filter(lambda e: e <= n, self.factors)))[-1]
roman = self.factors.get(ara... | 26.955556 | 73 | 0.624073 |
bb9075df8a02e9830a9f7016cdd9044eba0ab7d4 | 3,273 | py | Python | docs/conf.py | MaxRamgraber/skbel | 7d43fc495fc6aac2b4a833ed25c48619e8a15b62 | [
"BSD-3-Clause"
] | 7 | 2021-05-24T16:01:36.000Z | 2021-12-22T16:10:43.000Z | docs/conf.py | MaxRamgraber/skbel | 7d43fc495fc6aac2b4a833ed25c48619e8a15b62 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | MaxRamgraber/skbel | 7d43fc495fc6aac2b4a833ed25c48619e8a15b62 | [
"BSD-3-Clause"
] | 1 | 2021-05-27T21:47:49.000Z | 2021-05-27T21:47:49.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.088235 | 79 | 0.637336 |
435d16d35f22b614383f7ae95dcdd6cce7c3945d | 22,294 | py | Python | python/ccxt/bitfinex2.py | Bincentive/ccxt | 5a1c6ccd0945657d71d4f5107e2e71480b9f1b5d | [
"MIT"
] | null | null | null | python/ccxt/bitfinex2.py | Bincentive/ccxt | 5a1c6ccd0945657d71d4f5107e2e71480b9f1b5d | [
"MIT"
] | null | null | null | python/ccxt/bitfinex2.py | Bincentive/ccxt | 5a1c6ccd0945657d71d4f5107e2e71480b9f1b5d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.bitfinex import bitfinex
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Insuf... | 37.343384 | 126 | 0.440118 |
ad6e0d9cb72a3ae259b47f891facfad3fdf7cf32 | 305 | py | Python | 2015/11/table-homeless-cities-20151118/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/11/table-homeless-20151118/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/11/table-homeless-20151118/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1a78aETHbjs-hE43tgzOmfeAXhFMIx2BN9m44elQZaEo'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.816393 |
eb9460d255b190870638aefbcca94ef558894bd0 | 1,552 | py | Python | models/features.py | ghokun-thesis/domain-networks | 8f64182a5ef404a0e41eb023812de5efefe4233e | [
"MIT"
] | 1 | 2020-12-19T11:56:10.000Z | 2020-12-19T11:56:10.000Z | models/features.py | ghokun-thesis/domain-networks | 8f64182a5ef404a0e41eb023812de5efefe4233e | [
"MIT"
] | null | null | null | models/features.py | ghokun-thesis/domain-networks | 8f64182a5ef404a0e41eb023812de5efefe4233e | [
"MIT"
] | 1 | 2021-01-11T13:55:32.000Z | 2021-01-11T13:55:32.000Z | """
architecture of the domain feature extractors.
author: David-Alexandre Beaupre
date: 2020-04-27
"""
import torch
import torch.nn as nn
import models.blocks as blk
class Features(nn.Module):
def __init__(self, num_channels: int):
"""
represents the feature extractors for each spectrum.
... | 33.021277 | 84 | 0.607603 |
7afd7d19a5ba7d4e51fcb4e46751c52be59c2943 | 3,053 | py | Python | experiments/1.lexicon_experiment/stock_unseen_source.py | jkvc/modapt | 44610e6f03fb151433f2db633e1d23cc0dc470fc | [
"MIT"
] | null | null | null | experiments/1.lexicon_experiment/stock_unseen_source.py | jkvc/modapt | 44610e6f03fb151433f2db633e1d23cc0dc470fc | [
"MIT"
] | null | null | null | experiments/1.lexicon_experiment/stock_unseen_source.py | jkvc/modapt | 44610e6f03fb151433f2db633e1d23cc0dc470fc | [
"MIT"
] | 1 | 2021-04-28T17:09:05.000Z | 2021-04-28T17:09:05.000Z | # Usage: python <script_name> <dataset_name> <stock_lexicon_name> <arch>
import sys
from os import makedirs
from os.path import basename, join, realpath
from posixpath import dirname
import pandas as pd
import torch
from config import LEXICON_DIR, STOCK_LEXICON_DIR
from experiments.datadef.zoo import get_datadef
fro... | 30.53 | 83 | 0.740255 |
3c47ea6342a58c10d4ab8b9fa2b500d30a5bdce2 | 791 | py | Python | blog/migrations/0002_profile.py | dkowsikpai/librolet | 7148670655157ca5f1ad6853039c9ec00e37adef | [
"MIT"
] | null | null | null | blog/migrations/0002_profile.py | dkowsikpai/librolet | 7148670655157ca5f1ad6853039c9ec00e37adef | [
"MIT"
] | null | null | null | blog/migrations/0002_profile.py | dkowsikpai/librolet | 7148670655157ca5f1ad6853039c9ec00e37adef | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2018-12-27 15:38
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('blog', '0001_initial'),
... | 31.64 | 121 | 0.640961 |
66f33127480fedef521e58eb4f99be25a3461e17 | 3,272 | py | Python | pysnmp/CISCO-CABLE-WIDEBAND-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-CABLE-WIDEBAND-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-CABLE-WIDEBAND-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-CABLE-WIDEBAND-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-CABLE-WIDEBAND-CAPABILITY
# Produced by pysmi-0.3.4 at Mon Apr 29 17:34:39 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Pytho... | 105.548387 | 477 | 0.795844 |
5e91298828fbd2b2edd1f379c78d39b0e8bd6d73 | 79,267 | py | Python | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py | swanderz/azure-sdk-for-python | 4bc03153b06962fc75f8b8610e96172001c22657 | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py | swanderz/azure-sdk-for-python | 4bc03153b06962fc75f8b8610e96172001c22657 | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py | swanderz/azure-sdk-for-python | 4bc03153b06962fc75f8b8610e96172001c22657 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.455948 | 163 | 0.639737 |
2bcf5c933a4a056b4316f42605fc2389eafcaf9e | 76,291 | py | Python | unittests/linuxliketests.py | xggrnx/meson | af8b55d49b64e72dbefbd40d613b93f56d17b855 | [
"Apache-2.0"
] | null | null | null | unittests/linuxliketests.py | xggrnx/meson | af8b55d49b64e72dbefbd40d613b93f56d17b855 | [
"Apache-2.0"
] | null | null | null | unittests/linuxliketests.py | xggrnx/meson | af8b55d49b64e72dbefbd40d613b93f56d17b855 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2021 The Meson development 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
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | 44.982901 | 141 | 0.604881 |
f8cb449ac01f4bcd9724e122a9a3376ee0c83dee | 1,786 | py | Python | object_detection/box_coders/mean_stddev_box_coder_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | 1 | 2019-09-19T18:24:55.000Z | 2019-09-19T18:24:55.000Z | object_detection/box_coders/mean_stddev_box_coder_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | object_detection/box_coders/mean_stddev_box_coder_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Travis Yates
"""Tests for object_detection.box_coder.mean_stddev_boxcoder."""
import tensorflow as tf
from object_detection.box_coders import mean_stddev_box_coder
from object_detection.core import box_list
class MeanStddevBoxCoderTest(tf.test.TestC... | 37.208333 | 77 | 0.68533 |
cabadcee5e81b002c527e9219aa4bae243ee6267 | 1,509 | py | Python | sender.py | obrasier/tablets-of-stone-radio | 8e79da16b03fe93d4cf1758a921b5c40a4f964c5 | [
"MIT"
] | null | null | null | sender.py | obrasier/tablets-of-stone-radio | 8e79da16b03fe93d4cf1758a921b5c40a4f964c5 | [
"MIT"
] | null | null | null | sender.py | obrasier/tablets-of-stone-radio | 8e79da16b03fe93d4cf1758a921b5c40a4f964c5 | [
"MIT"
] | null | null | null | from microbit import *
import radio
radio.config(channel=7)
radio.on()
PACKET_SIZE = 6
msg_size = PACKET_SIZE - 1
def generate_packets(message):
packets = []
packet_num = 0
while message:
if packet_num > 9:
return packets
packet = str(packet_num) + message[:msg_size]
packets.append(packet)
... | 23.578125 | 55 | 0.6945 |
71c3d256540447d130560ac9efdd84ad55be2fad | 970 | py | Python | IceSpringMusicPlayer/plugins/IceSpringHelloWorldPlugin/helloWorldPlugin.py | baijifeilong/rawsteelp | 425547e6e2395bf4acb62435b18b5b3a4b7ebef4 | [
"MIT"
] | null | null | null | IceSpringMusicPlayer/plugins/IceSpringHelloWorldPlugin/helloWorldPlugin.py | baijifeilong/rawsteelp | 425547e6e2395bf4acb62435b18b5b3a4b7ebef4 | [
"MIT"
] | null | null | null | IceSpringMusicPlayer/plugins/IceSpringHelloWorldPlugin/helloWorldPlugin.py | baijifeilong/rawsteelp | 425547e6e2395bf4acb62435b18b5b3a4b7ebef4 | [
"MIT"
] | null | null | null | # Created by BaiJiFeiLong@gmail.com at 2022/1/21 17:13
import typing
from IceSpringRealOptional.typingUtils import gg
from PySide2 import QtWidgets, QtCore
from IceSpringMusicPlayer import tt
from IceSpringMusicPlayer.common.pluginMixin import PluginMixin
from IceSpringMusicPlayer.common.pluginWidgetMixin import Plu... | 33.448276 | 93 | 0.760825 |
9ad55b9e0e93b3cc29f6243a0df2f2953e5469d2 | 5,468 | py | Python | ryu/contrib/tinyrpc/protocols/__init__.py | umkcdcrg01/ryu_openflow | 37ed5b88f7d119344e07c95314a7450235c037a8 | [
"Apache-2.0"
] | 269 | 2015-03-08T11:32:45.000Z | 2022-03-30T11:18:16.000Z | ryu/contrib/tinyrpc/protocols/__init__.py | umkcdcrg01/ryu_openflow | 37ed5b88f7d119344e07c95314a7450235c037a8 | [
"Apache-2.0"
] | 14 | 2015-05-01T04:45:45.000Z | 2016-05-11T01:29:23.000Z | ryu/contrib/tinyrpc/protocols/__init__.py | umkcdcrg01/ryu_openflow | 37ed5b88f7d119344e07c95314a7450235c037a8 | [
"Apache-2.0"
] | 205 | 2015-01-13T04:52:25.000Z | 2022-03-30T13:37:33.000Z | #!/usr/bin/env python
from ..exc import *
class RPCRequest(object):
unique_id = None
"""A unique ID to remember the request by. Protocol specific, may or
may not be set. This value should only be set by
:py:func:`~tinyrpc.RPCProtocol.create_request`.
The ID allows client to receive responses out-... | 31.425287 | 82 | 0.662765 |
f050cf243a9af8e9383ce2f6eb034a21eee2f4be | 1,344 | py | Python | prompt_toolkit/key_binding/bindings/utils.py | gigforks/python-prompt-toolkit | d12cdbb556bef84011792108b1027930b81c4813 | [
"BSD-3-Clause"
] | 1 | 2016-10-01T20:28:31.000Z | 2016-10-01T20:28:31.000Z | prompt_toolkit/key_binding/bindings/utils.py | gigforks/python-prompt-toolkit | d12cdbb556bef84011792108b1027930b81c4813 | [
"BSD-3-Clause"
] | null | null | null | prompt_toolkit/key_binding/bindings/utils.py | gigforks/python-prompt-toolkit | d12cdbb556bef84011792108b1027930b81c4813 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from functools import wraps
from prompt_toolkit.filters import CLIFilter, Always
__all__ = (
'create_handle_decorator',
)
def create_handle_decorator(registry, filter=Always()):
"""
Create a key handle decorator, which is compatible with `Registry.handle`
but ha... | 33.6 | 79 | 0.644345 |
64ae34100ad6553fbdad05932a02f06a7d0baaa7 | 351 | py | Python | hwt/hdl/entity.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | hwt/hdl/entity.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | hwt/hdl/entity.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | from hwt.hdl.hdlObject import HdlObject
class Entity(HdlObject):
"""
Hdl container of hdl configuration and interfaces
"""
def __init__(self, name):
self.name = name
self.origin = None # creator of this object
self.generics = []
self.ports = []
self.ctx = {}
... | 21.9375 | 53 | 0.592593 |
a7ccd767f495fc80ac86c346fd952d0ae1afc61d | 12,208 | py | Python | sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.63745 | 160 | 0.67595 |
d2d9928df14acc5070172021238707ad1e25738d | 724 | py | Python | tests/reducers/res_test.py | beesperester/cinema4d-bootstrap | 199971fd5d5568fd08370d95611dd9dcd9ae07e8 | [
"MIT"
] | 1 | 2020-11-23T02:20:42.000Z | 2020-11-23T02:20:42.000Z | tests/reducers/res_test.py | beesperester/cinema4d-bootstrap | 199971fd5d5568fd08370d95611dd9dcd9ae07e8 | [
"MIT"
] | null | null | null | tests/reducers/res_test.py | beesperester/cinema4d-bootstrap | 199971fd5d5568fd08370d95611dd9dcd9ae07e8 | [
"MIT"
] | 1 | 2020-11-23T02:21:30.000Z | 2020-11-23T02:21:30.000Z | """Test res reducer module."""
import hashlib
import unittest
from bootstrap4c4d.classes.description import Description
from bootstrap4c4d.reducers.res import reduce_resource
class TestResourceReducer(unittest.TestCase):
def test_reduce_resource(self):
description = Description({
"id": "MY_... | 24.133333 | 57 | 0.59116 |
2452f10de848d200f47abe1368bc92144a489b1b | 443 | py | Python | setup.py | dawe/bbknn | 202721961e3c422592e70e0596dba5b17ecddeb2 | [
"MIT"
] | null | null | null | setup.py | dawe/bbknn | 202721961e3c422592e70e0596dba5b17ecddeb2 | [
"MIT"
] | null | null | null | setup.py | dawe/bbknn | 202721961e3c422592e70e0596dba5b17ecddeb2 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='bbknn',
version='1.3.6',
description='Batch balanced KNN',
url='https://github.com/Teichlab/bbknn',
packages=find_packages(exclude=['docs', 'figures', 'examples']),
install_requires=['Cython','numpy','scipy','annoy','umap-learn','sklearn'],
extras_require... | 27.6875 | 76 | 0.713318 |
2912190685a1a33d508894e8d2152aaf1eb2480c | 3,344 | py | Python | PiezoMove/arduino.py | aquilesC/disperscripts | 55afd510581b6d266cce18a2080031647501e9f4 | [
"MIT"
] | 1 | 2020-04-16T05:27:20.000Z | 2020-04-16T05:27:20.000Z | PiezoMove/arduino.py | aquilesC/disperscripts | 55afd510581b6d266cce18a2080031647501e9f4 | [
"MIT"
] | null | null | null | PiezoMove/arduino.py | aquilesC/disperscripts | 55afd510581b6d266cce18a2080031647501e9f4 | [
"MIT"
] | 2 | 2021-02-16T12:07:36.000Z | 2021-02-19T14:29:48.000Z | """
Arduino Model
=============
This is an ad-hoc model for controlling an Arduino Due board, which will in turn control a piezo-mirror, a laser,
and some LED's.
"""
from multiprocessing import Event
import pyvisa
from pyvisa import VisaIOError
from threading import RLock
from time import sleep
from d... | 31.54717 | 117 | 0.616926 |
fde3e27f3f79f3cd5f24ca8046f8fcf7dea2b95b | 189,796 | py | Python | tests/001_theoretical/test_010_ip_network_blueprint.py | vitlabuda/datalidator | 539063a98990c6be165baeff6c2a74ac2fd7a130 | [
"BSD-3-Clause"
] | null | null | null | tests/001_theoretical/test_010_ip_network_blueprint.py | vitlabuda/datalidator | 539063a98990c6be165baeff6c2a74ac2fd7a130 | [
"BSD-3-Clause"
] | null | null | null | tests/001_theoretical/test_010_ip_network_blueprint.py | vitlabuda/datalidator | 539063a98990c6be165baeff6c2a74ac2fd7a130 | [
"BSD-3-Clause"
] | null | null | null | #!/bin/false
# Copyright (c) 2022 Vít Labuda. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions an... | 66.947443 | 233 | 0.65513 |
7c0dd74068d95732f2124b322bdc6e4983a8e69c | 1,336 | py | Python | tests/kyu_7_tests/test_mumbling.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/kyu_7_tests/test_mumbling.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/kyu_7_tests/test_mumbling.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.kyu_7.mumbling import accum
class MumblingTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(accum('ZpglnRxqenU'),
'Z-Pp-Ggg-Llll-Nnnnn-Rrrrrr-Xxxxxxx-Qqqqqq'
'qq-Eeeeeeeee-Nnnnnnnnnn-Uuuuuuuuuuu')
def tes... | 43.096774 | 77 | 0.499251 |
43a85e56add3222a196d2983d0f49d6c5c6a9244 | 2,559 | py | Python | models/ops/setup.py | sunggukcha/QAHOI | 43e3292f96495431c1dd03ec11597ebec555b6c4 | [
"Apache-2.0"
] | 84 | 2021-06-22T08:38:17.000Z | 2022-03-31T14:19:48.000Z | mctrans/models/ops/setup.py | eshasadia/MCTrans | 9b8b5677eef584b423d5e1630680a4b667cbe823 | [
"Apache-2.0"
] | 16 | 2021-06-29T07:18:47.000Z | 2022-03-31T08:12:15.000Z | mctrans/models/ops/setup.py | eshasadia/MCTrans | 9b8b5677eef584b423d5e1630680a4b667cbe823 | [
"Apache-2.0"
] | 26 | 2021-07-05T08:41:34.000Z | 2022-03-22T02:57:30.000Z | # ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 35.541667 | 98 | 0.611176 |
238b955141f389a7ec46bceee2215f439721a25f | 1,931 | py | Python | setup.py | icemac/icemac.ab.document | c5e9a68ca509b5ea59a84cf8a8c50f570a83a9eb | [
"BSD-2-Clause"
] | 1 | 2020-02-25T17:04:39.000Z | 2020-02-25T17:04:39.000Z | setup.py | icemac/icemac.ab.document | c5e9a68ca509b5ea59a84cf8a8c50f570a83a9eb | [
"BSD-2-Clause"
] | null | null | null | setup.py | icemac/icemac.ab.document | c5e9a68ca509b5ea59a84cf8a8c50f570a83a9eb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
import setuptools
def read(*path_elements):
"""Read file."""
return open(os.path.join(*path_elements)).read()
version = '0.1.dev0'
long_description = '\n\n'.join([
read('README.rst'),
read('CHANGES.rst'),
])
setuptools.setup(
name='icemac.ab.document',
... | 30.171875 | 70 | 0.615225 |
9d4143e1e4ce698d9c32ded8fbad3cd16aa2b1c0 | 547 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractBuzyhoneybeeBlog.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_extractBuzyhoneybeeBlog.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_extractBuzyhoneybeeBlog.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractBuzyhoneybeeBlog(item):
'''
Parser for 'buzyhoneybee.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loi... | 24.863636 | 104 | 0.632541 |
9447a2c2be2d8c655ffc30ca6c2f9c4a7e6a74e8 | 652 | py | Python | .vim/bundle/ultisnips.vim/pythonx/UltiSnips/snippet/definition/snipmate.py | marshnmedia/dotfiles | d1a965ec81c9ed4e2f8addf9a07c588f2cea46db | [
"MIT"
] | null | null | null | .vim/bundle/ultisnips.vim/pythonx/UltiSnips/snippet/definition/snipmate.py | marshnmedia/dotfiles | d1a965ec81c9ed4e2f8addf9a07c588f2cea46db | [
"MIT"
] | null | null | null | .vim/bundle/ultisnips.vim/pythonx/UltiSnips/snippet/definition/snipmate.py | marshnmedia/dotfiles | d1a965ec81c9ed4e2f8addf9a07c588f2cea46db | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""A snipMate snippet after parsing."""
from UltiSnips.snippet.definition._base import SnippetDefinition
from UltiSnips.snippet.parsing.snipmate import parse_and_instantiate
class SnipMateSnippetDefinition(SnippetDefinition):
"""See module doc."""
SNIPMATE_SNIPPET_PRI... | 32.6 | 72 | 0.75 |
d63a773c98d1a741db8f318c09c6f472ca9b4d2c | 5,009 | py | Python | robots/LoCoBot/locobot_riss/scripts/dev/riss.py | HIRO-group/pyrobot | bc54608657f51f3691905a5b2a2d3abba1e3aa68 | [
"MIT"
] | null | null | null | robots/LoCoBot/locobot_riss/scripts/dev/riss.py | HIRO-group/pyrobot | bc54608657f51f3691905a5b2a2d3abba1e3aa68 | [
"MIT"
] | 1 | 2020-09-17T01:33:19.000Z | 2020-09-17T01:33:19.000Z | robots/LoCoBot/locobot_riss/scripts/dev/riss.py | HIRO-group/pyrobot | bc54608657f51f3691905a5b2a2d3abba1e3aa68 | [
"MIT"
] | 1 | 2020-08-26T18:53:25.000Z | 2020-08-26T18:53:25.000Z | #!/home/locobot/pyenvs/pyro3_ws/bin/python
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import time
import numpy as np
import matplotlib.pyplot as plt
try:
from image_processor import Imag... | 34.544828 | 205 | 0.684967 |
de8d42f1a7162a6a3efa177d1b54cee4c59d0b23 | 1,285 | py | Python | 05-image_denoising/03_hdr.py | myghact-1/complete-opencv | f89f7edce9d8ad1adde882e12d2e4eea91ea9155 | [
"MIT"
] | null | null | null | 05-image_denoising/03_hdr.py | myghact-1/complete-opencv | f89f7edce9d8ad1adde882e12d2e4eea91ea9155 | [
"MIT"
] | null | null | null | 05-image_denoising/03_hdr.py | myghact-1/complete-opencv | f89f7edce9d8ad1adde882e12d2e4eea91ea9155 | [
"MIT"
] | null | null | null | # https://en.wikipedia.org/wiki/High-dynamic-range_imaging
import cv2
import numpy as np
from glob import glob
#* 1. Loading exposure images into a list
images = glob("./images/hdr*")
images = [cv2.imread(image) for image in images]
exposure_times = np.array([15.0, 2.5, 0.25, 0.0333], dtype=np.float32)
#* 2. Mer... | 29.204545 | 76 | 0.768872 |
4585a76773a7ebc8b4894f4108c724e2e84147db | 4,990 | py | Python | apps/accounts/forms.py | seanlefevre/openduty | 34ab21117f114ccc808d8b0aa2cb801c819bdb86 | [
"MIT"
] | 145 | 2016-04-11T06:53:13.000Z | 2022-03-22T05:15:49.000Z | apps/accounts/forms.py | seanlefevre/openduty | 34ab21117f114ccc808d8b0aa2cb801c819bdb86 | [
"MIT"
] | 78 | 2017-09-24T10:59:49.000Z | 2022-02-12T07:36:27.000Z | apps/accounts/forms.py | seanlefevre/openduty | 34ab21117f114ccc808d8b0aa2cb801c819bdb86 | [
"MIT"
] | 30 | 2016-04-11T06:53:16.000Z | 2021-12-29T11:39:26.000Z | from django import forms
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm, SetPasswordForm
from apps.accounts.models import Profile
from betterforms.multiform import MultiModelForm
from apps.notification.notifier.hip... | 30.993789 | 118 | 0.604609 |
fe8f7fa1016111faf36ea389d999f9617c062acc | 4,465 | py | Python | packages/PIPS/pips/src/Passes/pyps/pipscc.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/pips/src/Passes/pyps/pipscc.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/pips/src/Passes/pyps/pipscc.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | #!/usr/bin/env python
from __future__ import with_statement # to cope with python2.5
import pyps
import sys
import os
import shutil
import string
import tempfile
import pickle
import subprocess
from pyps import module
class object_code:
"""preprocessed c source file descriptor"""
def __init__(self,sourcefile,cppflag... | 24.668508 | 75 | 0.66383 |
ec7af4e37ba7cb45a6a8086a1af24275c15bee53 | 3,553 | py | Python | venv/Lib/site-packages/mediapipe/calculators/core/sequence_shift_calculator_pb2.py | Farhan-Malik/advance-hand-gesture | 0ebe21ddd7c8c2eb14746678be57b33d38c47205 | [
"MIT"
] | 41 | 2021-06-19T13:57:18.000Z | 2021-12-02T17:08:53.000Z | venv/Lib/site-packages/mediapipe/calculators/core/sequence_shift_calculator_pb2.py | HxnDev/Pose-Detection | 2be27e88cf79a0fb643c5047158cba478c770be9 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/mediapipe/calculators/core/sequence_shift_calculator_pb2.py | HxnDev/Pose-Detection | 2be27e88cf79a0fb643c5047158cba478c770be9 | [
"MIT"
] | 4 | 2021-11-13T13:53:43.000Z | 2022-03-13T05:57:13.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/core/sequence_shift_calculator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
fro... | 42.297619 | 385 | 0.814523 |
4afaf685584c911fe67893958ef36bf145fb5bc2 | 13,071 | py | Python | sdk/python/pulumi_azure_native/storagesync/v20181001/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20181001/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20181001/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 36.107735 | 148 | 0.638054 |
a25d11821c38846ee768a2752b2b0b45ace29696 | 5,527 | py | Python | src/pretix/presale/views/__init__.py | alainrk/pretix | 867a8132aa1ed73dd9513efae5b3c46b5bbae140 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-08-31T13:16:55.000Z | 2021-08-31T13:16:55.000Z | src/pretix/presale/views/__init__.py | alainrk/pretix | 867a8132aa1ed73dd9513efae5b3c46b5bbae140 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/presale/views/__init__.py | alainrk/pretix | 867a8132aa1ed73dd9513efae5b3c46b5bbae140 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from datetime import timedelta
from decimal import Decimal
from itertools import groupby
from django.db.models import Sum
from django.utils.functional import cached_property
from django.utils.timezone import now
from pretix.base.decimal import round_decimal
from pretix.base.models import CartPosition, OrderPosition
f... | 36.846667 | 115 | 0.602135 |
235bed273204eb59147569f9fd38c176b07cf73b | 419 | py | Python | tests/checkpoint/test_torch_save.py | ECS-251-W2020/final-project-TorchFly | 69f60b337c5dec0b1cd8315c194bc7891ba98d3a | [
"MIT"
] | null | null | null | tests/checkpoint/test_torch_save.py | ECS-251-W2020/final-project-TorchFly | 69f60b337c5dec0b1cd8315c194bc7891ba98d3a | [
"MIT"
] | 3 | 2021-06-08T21:07:12.000Z | 2021-12-13T20:41:53.000Z | tests/checkpoint/test_torch_save.py | ECS-251-W2020/final-project-TorchFly | 69f60b337c5dec0b1cd8315c194bc7891ba98d3a | [
"MIT"
] | 1 | 2020-02-19T00:53:21.000Z | 2020-02-19T00:53:21.000Z | import os
import ray
import glob
import time
import torch
from transformers import AutoModel
import torchfly_dev
model = AutoModel.from_pretrained("roberta-large")
device = torch.device("cuda")
model = model.cuda()
for i in range(100):
start = time.time()
obj = torch.save(model.state_dict(), f"tmp.pth")
... | 15.518519 | 52 | 0.696897 |
731365cf9349c4d0b77363752e5f06d5744e1255 | 1,344 | py | Python | k8s_utils.py | b01901143/secret-script | ec71f2b4fbd91ff8d8f9d55824e001549f2237f1 | [
"Apache-2.0"
] | 15 | 2020-07-21T14:32:30.000Z | 2022-03-07T01:26:00.000Z | k8s_utils.py | b01901143/secret-script | ec71f2b4fbd91ff8d8f9d55824e001549f2237f1 | [
"Apache-2.0"
] | 22 | 2020-07-17T21:47:00.000Z | 2022-02-20T21:00:59.000Z | k8s_utils.py | b01901143/secret-script | ec71f2b4fbd91ff8d8f9d55824e001549f2237f1 | [
"Apache-2.0"
] | 8 | 2020-07-21T00:24:20.000Z | 2021-10-14T23:50:26.000Z | # k8s secret manager utilities
import os
import yaml
import subprocess
import base64
def k8sCreateSecret(secret_id, file):
literal = ""
with open(file) as f:
data = yaml.load_all(f, Loader=yaml.FullLoader)
for d in data:
for k,v in d.items():
literal += " --from-literal=" + str(k) +"=" + str(v)
os.syste... | 28.595745 | 117 | 0.666667 |
d51217b4408546e61a273ec7300dd2e6e9f7272a | 1,206 | py | Python | varats-core/varats/project/varats_project.py | ajrox090/VaRA-Tool-Suite | 1550d36a4049e0615afb0bacfb96b1d506a29c98 | [
"BSD-2-Clause"
] | null | null | null | varats-core/varats/project/varats_project.py | ajrox090/VaRA-Tool-Suite | 1550d36a4049e0615afb0bacfb96b1d506a29c98 | [
"BSD-2-Clause"
] | null | null | null | varats-core/varats/project/varats_project.py | ajrox090/VaRA-Tool-Suite | 1550d36a4049e0615afb0bacfb96b1d506a29c98 | [
"BSD-2-Clause"
] | null | null | null | """
VaRA-TS project abstraction.
This module defines the main project abstractions for VaRA-TS that extend the
benchbuild interface with tool suite specific functions.
"""
import typing as tp
from abc import abstractmethod
import benchbuild as bb
from varats.project.project_domain import ProjectDomains
from varats.p... | 28.046512 | 77 | 0.716418 |
de4c80ee81f1f6d8d83f3f378ca27a53c8f092d8 | 317 | py | Python | examples/compose_example.py | emthanh/svg_utils | 1ebd8e5a8cae067ed3f1d40939997eeed0a2d4fb | [
"MIT"
] | 195 | 2015-01-08T16:57:14.000Z | 2022-03-08T10:08:01.000Z | examples/compose_example.py | emthanh/svg_utils | 1ebd8e5a8cae067ed3f1d40939997eeed0a2d4fb | [
"MIT"
] | 61 | 2015-12-16T17:22:11.000Z | 2022-03-07T02:03:30.000Z | examples/compose_example.py | emthanh/svg_utils | 1ebd8e5a8cae067ed3f1d40939997eeed0a2d4fb | [
"MIT"
] | 58 | 2015-04-08T17:00:51.000Z | 2022-02-27T20:06:13.000Z | #!/usr/bin/env python3
# coding=utf-8
from svgutils.compose import *
CONFIG["svg.file_path"] = "files"
CONFIG["image.file_path"] = "files"
Figure(
"10cm",
"5cm",
SVG("svg_logo.svg").scale(0.2),
Image(
120,
120,
"lion.jpeg",
).move(120, 0),
).save("compose_example.svg")
| 16.684211 | 35 | 0.574132 |
7eae16a91d91872b120a411811918d86ac692fbc | 963 | py | Python | plugins/agent-installer/worker_installer/tests/mock-sudo-plugin/setup.py | konradxyz/dev_fileserver | 2c57520c447fc4bfda78668df575431be5c39276 | [
"Apache-2.0"
] | null | null | null | plugins/agent-installer/worker_installer/tests/mock-sudo-plugin/setup.py | konradxyz/dev_fileserver | 2c57520c447fc4bfda78668df575431be5c39276 | [
"Apache-2.0"
] | null | null | null | plugins/agent-installer/worker_installer/tests/mock-sudo-plugin/setup.py | konradxyz/dev_fileserver | 2c57520c447fc4bfda78668df575431be5c39276 | [
"Apache-2.0"
] | null | null | null | #########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | 31.064516 | 77 | 0.712357 |
2b708f0758f5a6ff55a0a3d263c10c9eea4e7251 | 1,311 | py | Python | authentication.py | alexanderluiscampino/ESTsoft-Data-Statistics-by-Period | 74949ec3de214a04ffd97ed484bfe27addee1bff | [
"MIT"
] | null | null | null | authentication.py | alexanderluiscampino/ESTsoft-Data-Statistics-by-Period | 74949ec3de214a04ffd97ed484bfe27addee1bff | [
"MIT"
] | null | null | null | authentication.py | alexanderluiscampino/ESTsoft-Data-Statistics-by-Period | 74949ec3de214a04ffd97ed484bfe27addee1bff | [
"MIT"
] | null | null | null | import os, sys
cwd = os.getcwd()
def readAuthenticationFile(page):
"""
# Reads Authentication data from file authenticate.txt
# params: @page - website to retrieve configs from
# returns: @payload to be used with HTTP requests library
"""
filename = "authenticate.txt"
data = [] # ... | 42.290323 | 81 | 0.529367 |
131bf93fd118a4bbf7dfcd44fe3e621d6045409a | 3,466 | py | Python | tests/test_service.py | ArdanaCLM/ardana-service | 680099101de36fce893ef6d138b75d778f92f182 | [
"Apache-2.0"
] | 1 | 2017-07-20T01:04:21.000Z | 2017-07-20T01:04:21.000Z | tests/test_service.py | GarySmith/ardana-service | 680099101de36fce893ef6d138b75d778f92f182 | [
"Apache-2.0"
] | null | null | null | tests/test_service.py | GarySmith/ardana-service | 680099101de36fce893ef6d138b75d778f92f182 | [
"Apache-2.0"
] | 2 | 2017-08-02T17:18:47.000Z | 2019-10-11T23:48:58.000Z | # (c) Copyright 2017-2018 SUSE 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 36.104167 | 75 | 0.621754 |
752dec82678180b9710fc4c6e2809bb362af5883 | 1,718 | py | Python | allauth/socialaccount/providers/__init__.py | christopherpoland/django-allauth | df78274669a87f5c1a9147843b353353230d1940 | [
"MIT"
] | 2 | 2020-04-19T20:13:46.000Z | 2022-03-11T09:48:53.000Z | allauth/socialaccount/providers/__init__.py | CZZLEGEND/django-allauth | ef0774318993c2f7757df6ca2b962bc0df1d5674 | [
"MIT"
] | 11 | 2021-04-08T19:05:56.000Z | 2022-03-12T00:10:25.000Z | allauth/socialaccount/providers/__init__.py | safwanrahman/django-allauth | dac31fdac2c13a97829e6879e09431c735abab4e | [
"MIT"
] | 17 | 2020-03-03T08:42:17.000Z | 2020-10-03T16:08:49.000Z | import importlib
from collections import OrderedDict
from django.conf import settings
class ProviderRegistry(object):
def __init__(self):
self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None):
self.load()
return [
provider_cls(requ... | 31.814815 | 79 | 0.579162 |
e7b5a979efcd5b616bf343d5f67bf2f6b3fba3dc | 1,855 | py | Python | userbot/plugins/zip.py | gamerfuckerofficial/userbot | 887332ab492a2deb6152257f0c169a895234eb7b | [
"MIT"
] | 3 | 2020-09-04T09:34:51.000Z | 2020-09-04T09:39:26.000Z | userbot/plugins/zip.py | gamerfuckerofficial/userbot | 887332ab492a2deb6152257f0c169a895234eb7b | [
"MIT"
] | null | null | null | userbot/plugins/zip.py | gamerfuckerofficial/userbot | 887332ab492a2deb6152257f0c169a895234eb7b | [
"MIT"
] | null | null | null | """ command: .compress """
from telethon import events
import asyncio
import zipfile
from pySmartDL import SmartDL
from datetime import datetime
import os
from uniborg.util import admin_cmd, humanbytes, progress, time_formatter
@borg.on(admin_cmd("compress"))
async def _(event):
if event.fwd_from:
return... | 32.54386 | 93 | 0.636119 |
b7e96d34789adeb1edca8e8cd0c68063111db49f | 500 | py | Python | coupon/migrations/0002_auto_20181110_0015.py | oereo/Hackton_8th_test | 786bc804f07d9b3b3c1e7785e70b83c570f37450 | [
"MIT"
] | 3 | 2020-09-22T00:24:17.000Z | 2020-10-11T03:44:57.000Z | coupon/migrations/0002_auto_20181110_0015.py | oereo/Hackton_8th_test | 786bc804f07d9b3b3c1e7785e70b83c570f37450 | [
"MIT"
] | 11 | 2020-09-21T19:04:39.000Z | 2020-10-19T18:08:14.000Z | coupon/migrations/0002_auto_20181110_0015.py | oereo/Hackton_8th_test | 786bc804f07d9b3b3c1e7785e70b83c570f37450 | [
"MIT"
] | 1 | 2020-09-22T00:24:23.000Z | 2020-09-22T00:24:23.000Z | # Generated by Django 2.1.3 on 2018-11-10 00:15
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coupon', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='coupon',
... | 25 | 146 | 0.654 |
07cb79e3bd27a674831ae87b7d11cb2bda8f426a | 760 | py | Python | src/schema/question/response_example/delete.py | week-with-me/fastapi-mongodb | c1b319a5f93a4a5c9c7800506fd7a1313de38ac1 | [
"MIT"
] | 1 | 2021-12-21T15:01:28.000Z | 2021-12-21T15:01:28.000Z | src/schema/question/response_example/delete.py | week-with-me/fastapi-mongodb | c1b319a5f93a4a5c9c7800506fd7a1313de38ac1 | [
"MIT"
] | null | null | null | src/schema/question/response_example/delete.py | week-with-me/fastapi-mongodb | c1b319a5f93a4a5c9c7800506fd7a1313de38ac1 | [
"MIT"
] | null | null | null | from src.schema.response import DeleteResponseModel, ErrorResponseModel
delete_response_example = {
"200": {
"model": DeleteResponseModel,
"description": "성공",
"content": {"application/json": {"example": {"detail": "Success"}}},
},
"400": {
"model": ErrorResponseModel,
... | 27.142857 | 76 | 0.502632 |
43a99b9358c8bd59db632bbdb8facdc86f1d5126 | 4,790 | py | Python | tests/unit/form_tests/test_query.py | campagnola/pynwb | b3f1034909ac4462378e79d0e438dc5b803e5fbf | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/unit/form_tests/test_query.py | campagnola/pynwb | b3f1034909ac4462378e79d0e438dc5b803e5fbf | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/unit/form_tests/test_query.py | campagnola/pynwb | b3f1034909ac4462378e79d0e438dc5b803e5fbf | [
"BSD-3-Clause-LBNL"
] | null | null | null | import unittest2 as unittest
import os
from h5py import File
import numpy as np
from pynwb.form.query import FORMDataset, Query
from pynwb.form.array import SortedArray, LinSpace
class AbstractQueryTest(unittest.TestCase):
def getDataset(self):
raise unittest.SkipTest('getDataset must be implemented')
... | 29.9375 | 65 | 0.561169 |
cdb89eff064f321e499370ce569ad221646eb697 | 526 | py | Python | app/logic/benchmark/migrations/0004_auto_20151209_2112.py | imvu/bluesteel | ab52133249a693b3cd2d8593c5d47408a3b0fce6 | [
"MIT"
] | 10 | 2017-01-13T06:28:04.000Z | 2020-11-18T13:00:26.000Z | app/logic/benchmark/migrations/0004_auto_20151209_2112.py | imvu/bluesteel | ab52133249a693b3cd2d8593c5d47408a3b0fce6 | [
"MIT"
] | null | null | null | app/logic/benchmark/migrations/0004_auto_20151209_2112.py | imvu/bluesteel | ab52133249a693b3cd2d8593c5d47408a3b0fce6 | [
"MIT"
] | 2 | 2018-03-29T14:10:53.000Z | 2019-11-20T08:21:57.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('benchmark', '0003_benchmarkexecutionentry_worker'),
]
operations = [
migrations.AlterField(
model_name='benchmar... | 25.047619 | 108 | 0.653992 |
39497b8f007f11d431b7b01bb4ecdeed424cb154 | 1,902 | py | Python | examples/sparkles.py | krishols/designer | 8f80b3309802d16d8577280274e0c9fa02db306b | [
"MIT"
] | 1 | 2022-01-05T19:51:13.000Z | 2022-01-05T19:51:13.000Z | examples/sparkles.py | krishols/designer | 8f80b3309802d16d8577280274e0c9fa02db306b | [
"MIT"
] | 24 | 2021-08-13T17:09:15.000Z | 2022-01-05T16:12:09.000Z | examples/sparkles.py | krishols/designer | 8f80b3309802d16d8577280274e0c9fa02db306b | [
"MIT"
] | null | null | null | from designer import *
import math
import random
DECELERATION = .5
Spark = {'image': DesignerObject, 'velocity': float}
World = {'sparks': [Spark]}
def create_world() -> World:
return {
'sparks': []
}
def create_spark(x: int, y: int) -> Spark:
color = random.choice(['red', 'yellow', 'orange',... | 26.416667 | 81 | 0.619874 |
e4c28559c9681fffadf76b260e0eeb6981958cb9 | 625 | py | Python | hknweb/elections/views.py | anthonymaltsev/hknweb | 7490fbb166208ba14463445ff0149292ca3c37ba | [
"MIT"
] | 20 | 2018-01-07T02:15:43.000Z | 2021-09-15T04:25:50.000Z | hknweb/elections/views.py | anthonymaltsev/hknweb | 7490fbb166208ba14463445ff0149292ca3c37ba | [
"MIT"
] | 292 | 2018-02-01T18:31:18.000Z | 2022-03-30T22:15:08.000Z | hknweb/elections/views.py | anthonymaltsev/hknweb | 7490fbb166208ba14463445ff0149292ca3c37ba | [
"MIT"
] | 85 | 2017-11-13T06:33:13.000Z | 2022-03-30T20:32:55.000Z | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.template import loader
from django.contrib import messages
from .forms import OfficerForm
def index(request):
form = OfficerForm(request.POST or None)
if request.method == "POST":
if form.is_valid():
... | 31.25 | 87 | 0.68 |
4619c98b023f8f23b710ae13f135d2ecde3432f8 | 19,056 | py | Python | test/acceptance/features/steps/steps.py | DuncanDoyle/service-binding-operator | e7594230afd28fb178bdd31c6d7a2d055af003a3 | [
"Apache-2.0"
] | null | null | null | test/acceptance/features/steps/steps.py | DuncanDoyle/service-binding-operator | e7594230afd28fb178bdd31c6d7a2d055af003a3 | [
"Apache-2.0"
] | null | null | null | test/acceptance/features/steps/steps.py | DuncanDoyle/service-binding-operator | e7594230afd28fb178bdd31c6d7a2d055af003a3 | [
"Apache-2.0"
] | null | null | null | # @mark.steps
# ----------------------------------------------------------------------------
# STEPS:
# ----------------------------------------------------------------------------
import ipaddress
import json
import os
import re
import time
import polling2
import parse
import binascii
from behave import given, regist... | 43.407745 | 160 | 0.750892 |
4d03ca7b7cce8da2eb3ab978c3e6c5324f2d28e8 | 2,626 | py | Python | path-finding/yolov5-rpi/yolov5_tflite_image_inference.py | sa-y-an/open-source-autonomous-vehicle-controller | 0cc415fb141d1b66ac45a7bf6b50add6814728fb | [
"MIT"
] | 3 | 2021-06-15T05:10:00.000Z | 2021-09-05T18:07:01.000Z | path-finding/yolov5-rpi/yolov5_tflite_image_inference.py | sa-y-an/open-source-autonomous-vehicle-controller | 0cc415fb141d1b66ac45a7bf6b50add6814728fb | [
"MIT"
] | 1 | 2021-06-07T21:05:14.000Z | 2021-06-07T21:05:14.000Z | path-finding/yolov5-rpi/yolov5_tflite_image_inference.py | sa-y-an/open-source-autonomous-vehicle-controller | 0cc415fb141d1b66ac45a7bf6b50add6814728fb | [
"MIT"
] | 9 | 2021-06-10T08:42:53.000Z | 2022-03-28T05:46:16.000Z | from yolov5_tflite_inference import yolov5_tflite
import argparse
import cv2
import time
from PIL import Image, ImageOps
import numpy as np
from utils import letterbox_image, scale_coords
def detect_image(weights,image_url,img_size,conf_thres,iou_thres):
start_time = time.time()
#image = cv2.imr... | 30.894118 | 111 | 0.642803 |
fa9a5030c071981317dd5365e6e67a4b53750cee | 9,752 | py | Python | docs/notebooks/expected_improvement.pct.py | uri-granta/trieste | 94678eb6c68e26e0db60707de7f43855cf1e826e | [
"Apache-2.0"
] | 119 | 2020-10-06T16:27:05.000Z | 2022-03-28T00:27:18.000Z | docs/notebooks/expected_improvement.pct.py | uri-granta/trieste | 94678eb6c68e26e0db60707de7f43855cf1e826e | [
"Apache-2.0"
] | 275 | 2020-10-07T22:32:53.000Z | 2022-03-31T15:57:44.000Z | docs/notebooks/expected_improvement.pct.py | uri-granta/trieste | 94678eb6c68e26e0db60707de7f43855cf1e826e | [
"Apache-2.0"
] | 30 | 2020-10-08T23:00:01.000Z | 2022-02-25T17:04:22.000Z | # %% [markdown]
# # Noise-free optimization with Expected Improvement
# %%
import numpy as np
import tensorflow as tf
np.random.seed(1793)
tf.random.set_seed(1793)
# %% [markdown]
# ## Describe the problem
# In this example, we look to find the minimum value of the two-dimensional Branin function over the hypercube ... | 38.85259 | 589 | 0.752153 |
d0f268d29a470527534beb3d22e49e7263f94e40 | 868 | py | Python | reptile/pyn_reptile_douban_movie.py | LuckyYcj/Python | 86eb55c868c31e589e5c8a3d71a69df446f71742 | [
"CNRI-Python"
] | null | null | null | reptile/pyn_reptile_douban_movie.py | LuckyYcj/Python | 86eb55c868c31e589e5c8a3d71a69df446f71742 | [
"CNRI-Python"
] | null | null | null | reptile/pyn_reptile_douban_movie.py | LuckyYcj/Python | 86eb55c868c31e589e5c8a3d71a69df446f71742 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python
# coding=gbk
# -*- coding : utf-8 -*-
import requests
from bs4 import BeautifulSoup
# pyquery
ua_headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36"}
url = "https://movie.douban.com/top250"
response = reques... | 26.30303 | 145 | 0.697005 |
40487a8d3ee3d812988d3a6e99a890931bd463d1 | 227 | py | Python | meiduo_mall/meiduo_mall/apps/contents/views.py | 15779500251/meiduo_project | f9beba0b71e6deb4d38c233e4f4bc957d89f1381 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/contents/views.py | 15779500251/meiduo_project | f9beba0b71e6deb4d38c233e4f4bc957d89f1381 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/contents/views.py | 15779500251/meiduo_project | f9beba0b71e6deb4d38c233e4f4bc957d89f1381 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.views import View
class IndexView(View):
"""首页广告"""
def get(self,request):
"""提供广告页面"""
return render(request, 'index.html') | 17.461538 | 44 | 0.651982 |
1f9aa2e80718129fe5345a29d96abb94da056aa4 | 167 | py | Python | kpm_api/__init__.py | kevihiiin/kpm-api | 65d14fa380b45dc9237a7f4460c8c3db9ba2be93 | [
"MIT"
] | null | null | null | kpm_api/__init__.py | kevihiiin/kpm-api | 65d14fa380b45dc9237a7f4460c8c3db9ba2be93 | [
"MIT"
] | null | null | null | kpm_api/__init__.py | kevihiiin/kpm-api | 65d14fa380b45dc9237a7f4460c8c3db9ba2be93 | [
"MIT"
] | null | null | null | """Top-level package for KeyPathwayMiner Python API Library."""
__author__ = """Kevin Yuan"""
__email__ = 'kevihiiin@users.noreply.github.com '
__version__ = '0.1.0'
| 27.833333 | 63 | 0.724551 |
3df9b5800ce77bf520ba117514ca7a11d498842d | 49,971 | py | Python | test/python/transpiler/test_pass_scheduler.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | 1 | 2019-06-04T12:23:36.000Z | 2019-06-04T12:23:36.000Z | test/python/transpiler/test_pass_scheduler.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | 35 | 2019-03-07T02:09:22.000Z | 2022-03-22T19:55:15.000Z | test/python/transpiler/test_pass_scheduler.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 50.990816 | 96 | 0.58638 |
f37322d6395ba0c122644340de695d2e87f3ce1b | 835 | py | Python | Alot_Todo/urls.py | meetdaxini/Alot_Todo | bf42a05f1b55273eb9211e95802c4837c605692f | [
"MIT"
] | 1 | 2020-11-16T09:20:25.000Z | 2020-11-16T09:20:25.000Z | Alot_Todo/urls.py | meetdaxini/Alot_Todo | bf42a05f1b55273eb9211e95802c4837c605692f | [
"MIT"
] | null | null | null | Alot_Todo/urls.py | meetdaxini/Alot_Todo | bf42a05f1b55273eb9211e95802c4837c605692f | [
"MIT"
] | null | null | null | """Alot_Todo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
C... | 34.791667 | 78 | 0.686228 |
babbf69a909a3f250b424fac8efd0516cb1550d7 | 2,244 | py | Python | setup.py | renovate-bot/python-video-transcoder-1 | e9c1c229fe88d200d0f60314814078e79e3f1524 | [
"Apache-2.0"
] | null | null | null | setup.py | renovate-bot/python-video-transcoder-1 | e9c1c229fe88d200d0f60314814078e79e3f1524 | [
"Apache-2.0"
] | null | null | null | setup.py | renovate-bot/python-video-transcoder-1 | e9c1c229fe88d200d0f60314814078e79e3f1524 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34 | 74 | 0.669786 |
a71ab363780cbbfb96d55b9259457c34eb856771 | 136 | py | Python | tools/dev_tools/test/pygments/lexers/compiled.py | salilab/rmf | 4895bff9d22381882ac38180bdd025e22bdc7c00 | [
"Apache-2.0"
] | 2 | 2017-12-22T18:09:47.000Z | 2019-12-18T05:00:50.000Z | tools/dev_tools/test/pygments/lexers/compiled.py | salilab/rmf | 4895bff9d22381882ac38180bdd025e22bdc7c00 | [
"Apache-2.0"
] | 5 | 2015-03-07T19:32:39.000Z | 2021-04-22T20:00:10.000Z | tools/dev_tools/test/pygments/lexers/compiled.py | salilab/rmf | 4895bff9d22381882ac38180bdd025e22bdc7c00 | [
"Apache-2.0"
] | 2 | 2015-03-12T18:34:23.000Z | 2015-06-19T20:15:14.000Z | class CppLexer(object):
def get_tokens_unprocessed(self, code):
return (('ind1', 'tok1', 'val1'), ('ind2', 'tok2', 'val2'))
| 34 | 67 | 0.602941 |
e99a9ac2ec99393ee24d39765b806ba98e989f98 | 1,158 | py | Python | lib/surface/bq/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/bq/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/bq/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. 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 requir... | 34.058824 | 78 | 0.761658 |
32130f0d213cb5534976acd4b900dbbe64fcbd33 | 25,954 | py | Python | BrianAmedee/repo/7SAofRevolution.py | javovelez/manim | 0a2b4786779448a4e35081909cf58f8d9ffa7e39 | [
"MIT"
] | null | null | null | BrianAmedee/repo/7SAofRevolution.py | javovelez/manim | 0a2b4786779448a4e35081909cf58f8d9ffa7e39 | [
"MIT"
] | null | null | null | BrianAmedee/repo/7SAofRevolution.py | javovelez/manim | 0a2b4786779448a4e35081909cf58f8d9ffa7e39 | [
"MIT"
] | null | null | null | from re import L
from manim import *
# HELPERS
def get_arc_lines(
graph, plane, dx=1, x_min=None, x_max=None, line_color=RED, line_width=3
):
dots = VGroup()
lines = VGroup()
result = VGroup(dots, lines)
x_range = np.arange(x_min, x_max, dx)
colors = color_gradient([BLUE_B, GREEN... | 32.770202 | 93 | 0.482623 |
c660fb221f03743b28d7f5c0560dc9cf2a08e941 | 73 | py | Python | test/fixtures/python/head_without_http.py | csperando/curlconverter | 733f110e5621375701f4424299ccd72e669876f6 | [
"MIT"
] | 536 | 2021-10-06T17:21:25.000Z | 2022-03-31T13:05:48.000Z | test/fixtures/python/head_without_http.py | csperando/curlconverter | 733f110e5621375701f4424299ccd72e669876f6 | [
"MIT"
] | 74 | 2021-10-08T13:57:14.000Z | 2022-03-31T06:55:39.000Z | test/fixtures/python/head_without_http.py | csperando/curlconverter | 733f110e5621375701f4424299ccd72e669876f6 | [
"MIT"
] | 104 | 2021-10-06T19:36:15.000Z | 2022-03-31T07:34:04.000Z | import requests
response = requests.head('http://localhost:28139/page')
| 18.25 | 55 | 0.767123 |
e89719f68062fae6c4c066fb548ad9991cc03098 | 4,886 | py | Python | code/markdown2/tools/tables-align-columns.py | Endres/Letterpress | 12a44d6a9c7eceb1fd2e8001c84c2b921ffe1922 | [
"BSD-3-Clause"
] | 291 | 2015-01-17T06:08:47.000Z | 2022-01-10T23:24:16.000Z | code/markdown2/tools/tables-align-columns.py | ahmedfadhil/Letterpress | 0913bc21c09b4982071159dd52502d597bf2a0c9 | [
"BSD-3-Clause"
] | 3 | 2015-01-20T14:57:46.000Z | 2017-07-15T14:27:26.000Z | code/markdown2/tools/tables-align-columns.py | ahmedfadhil/Letterpress | 0913bc21c09b4982071159dd52502d597bf2a0c9 | [
"BSD-3-Clause"
] | 39 | 2015-01-10T11:15:34.000Z | 2021-05-16T09:11:32.000Z | #!/usr/bin/env python
"""
Convert [tables](https://github.com/trentm/python-markdown2/wiki/tables)
a given Markdown document such that columns are aligned.
Limitations:
- Can't handle tables where cells have a pipe.
"""
from __future__ import print_function
__version__ = "1.0.0"
import codecs
import os
from pprint... | 33.696552 | 96 | 0.480147 |
33db7234cefb0e335c2281c3c5584eff83cfd86f | 666 | py | Python | src/scripts.py | ivezic/MultifitTests | 9d22d9f5c40d21ec693c0a7d54e2c6f6dda3f36e | [
"MIT"
] | null | null | null | src/scripts.py | ivezic/MultifitTests | 9d22d9f5c40d21ec693c0a7d54e2c6f6dda3f36e | [
"MIT"
] | null | null | null | src/scripts.py | ivezic/MultifitTests | 9d22d9f5c40d21ec693c0a7d54e2c6f6dda3f36e | [
"MIT"
] | null | null | null | from astrometry import *
from makeImage import stamp
from showImage import *
def demo(showStamp=0):
# make image
Npix1D = 23
Bkgd = 1000
s = stamp(Npix1D, Bkgd)
# add a Gaussian source
muX = 0.0
muY = 0.0
alpha = 2.0
Amplitude = 10000.0
s.addGaussianSource(muX, muY, alpha... | 19.028571 | 91 | 0.63964 |
e0d66257ef570c26c577346ef0b1d1cc8627d11b | 9,414 | py | Python | tests/shared/core/training_data/story_writer/test_yaml_story_writer.py | hercules261188/rasa | 6b0631f1fddf95a044c728e885e2940dd2f8f83e | [
"Apache-2.0"
] | 1 | 2021-11-12T08:01:05.000Z | 2021-11-12T08:01:05.000Z | tests/shared/core/training_data/story_writer/test_yaml_story_writer.py | hercules261188/rasa | 6b0631f1fddf95a044c728e885e2940dd2f8f83e | [
"Apache-2.0"
] | 64 | 2021-09-24T06:44:41.000Z | 2022-03-14T12:12:28.000Z | tests/shared/core/training_data/story_writer/test_yaml_story_writer.py | hercules261188/rasa | 6b0631f1fddf95a044c728e885e2940dd2f8f83e | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import textwrap
from typing import Text
from collections import OrderedDict
import pytest
from rasa.shared.core.constants import (
ACTION_SESSION_START_NAME,
ACTION_LISTEN_NAME,
ACTION_UNLIKELY_INTENT_NAME,
)
from rasa.shared.core.domain import Domain
from rasa.shared.core.events i... | 29.236025 | 86 | 0.65955 |
8c1c228d2c6eadae95da83ad7d27e785e3dfc00b | 40,667 | py | Python | k8s/images/codalab/apps/web/migrations/0001_initial.py | abdulari/codalab-competitions | fdfbb77ac62d56c6b4b9439935037f97ffcd1423 | [
"Apache-2.0"
] | 2 | 2021-12-20T11:39:03.000Z | 2021-12-20T11:39:06.000Z | k8s/images/codalab/apps/web/migrations/0001_initial.py | abdulari/codalab-competitions | fdfbb77ac62d56c6b4b9439935037f97ffcd1423 | [
"Apache-2.0"
] | 2 | 2022-01-27T22:35:11.000Z | 2022-02-09T21:48:23.000Z | k8s/images/codalab/apps/web/migrations/0001_initial.py | abdulari/codalab-competitions | fdfbb77ac62d56c6b4b9439935037f97ffcd1423 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-16 18:50
from __future__ import unicode_literals
import apps.web.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import mptt.fields
import s3direct.field... | 68.347899 | 320 | 0.638773 |
862eac2deade1010bc4f3b878e1ec9fb215225b6 | 360 | py | Python | backend/database/user/migrations/0004_auto_20200227_2017.py | HansErikHeum/tdt4140_2020_gruppe42 | a916b5a003a174a343e0625ca501b542907cda72 | [
"MIT"
] | null | null | null | backend/database/user/migrations/0004_auto_20200227_2017.py | HansErikHeum/tdt4140_2020_gruppe42 | a916b5a003a174a343e0625ca501b542907cda72 | [
"MIT"
] | null | null | null | backend/database/user/migrations/0004_auto_20200227_2017.py | HansErikHeum/tdt4140_2020_gruppe42 | a916b5a003a174a343e0625ca501b542907cda72 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-27 19:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0003_auto_20200227_2014'),
]
operations = [
migrations.RenameField(
model_name='kalas',
old_name='zipCode',
... | 18.947368 | 47 | 0.580556 |
3630bb0baea2cf0372e579317d83d3f92f499b67 | 34,399 | py | Python | bin/storm.py | Amauris86/Storm | d53615369b03a03362c629d9b3dc5fabfccf50ac | [
"Apache-2.0"
] | 3 | 2017-09-05T12:00:41.000Z | 2018-11-27T03:38:46.000Z | bin/storm.py | Amauris86/Storm | d53615369b03a03362c629d9b3dc5fabfccf50ac | [
"Apache-2.0"
] | null | null | null | bin/storm.py | Amauris86/Storm | d53615369b03a03362c629d9b3dc5fabfccf50ac | [
"Apache-2.0"
] | 1 | 2020-11-24T17:33:33.000Z | 2020-11-24T17:33:33.000Z | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | 38.477629 | 381 | 0.671618 |
d97f6472ad36d99e6ab02a9f8589a32f42888ec5 | 723 | py | Python | backend/comment/admin.py | PY-GZKY/django-miniprogram | 0cc49736dbe7bfd64dbcb224c57d7df7b9c72d3a | [
"Apache-2.0"
] | 2 | 2021-11-29T01:26:24.000Z | 2022-02-03T13:59:41.000Z | backend/comment/admin.py | PY-GZKY/django-miniprogram | 0cc49736dbe7bfd64dbcb224c57d7df7b9c72d3a | [
"Apache-2.0"
] | null | null | null | backend/comment/admin.py | PY-GZKY/django-miniprogram | 0cc49736dbe7bfd64dbcb224c57d7df7b9c72d3a | [
"Apache-2.0"
] | null | null | null | # from django.contrib import admin
# from django.db import models
# from django.forms import TextInput, Textarea
# from import_export.admin import ImportExportModelAdmin
#
# from comment.models import Comment
#
# @admin.register(Comment)
# class CommentAdmin(ImportExportModelAdmin):
# list_display = ('author', 'art... | 30.125 | 80 | 0.614108 |
625d18ebee8093e27c08ae2cce43afde05a25725 | 95,502 | py | Python | retrigger/retrigger.py | fixator10/Trusty-cogs | 3d47a63f562cb64eb44da6bb53cfe9f8324026e7 | [
"MIT"
] | 148 | 2017-04-23T19:57:50.000Z | 2022-03-12T06:59:58.000Z | retrigger/retrigger.py | mina9999/Trusty-cogs | a47de7c233f3c1802effd29f4a86f8a9b0e2b34a | [
"MIT"
] | 155 | 2018-01-01T13:27:45.000Z | 2022-03-12T05:17:51.000Z | retrigger/retrigger.py | mina9999/Trusty-cogs | a47de7c233f3c1802effd29f4a86f8a9b0e2b34a | [
"MIT"
] | 221 | 2017-04-02T00:26:08.000Z | 2022-03-26T15:06:54.000Z | import asyncio
import logging
from multiprocessing.pool import Pool
from pathlib import Path
from typing import Optional, Union
import discord
from discord.ext import tasks
from redbot.core import Config, VersionInfo, checks, commands, modlog, version_info
from redbot.core.commands import TimedeltaConverter
from redbo... | 47.022157 | 141 | 0.634542 |
17c8e4657c347da438d7797b9458730f7386b4e5 | 2,226 | py | Python | lib/surface/iot/devices/credentials/update.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/iot/devices/credentials/update.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/iot/devices/credentials/update.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... | 38.37931 | 74 | 0.715633 |
957139817fe3d1a74c9726e1c96935aec85d727f | 6,794 | py | Python | src/blade/new_project.py | southbear-club/blade-build | 3906806c49f2dd01ce57f4f4a924cab727e41710 | [
"BSD-3-Clause"
] | null | null | null | src/blade/new_project.py | southbear-club/blade-build | 3906806c49f2dd01ce57f4f4a924cab727e41710 | [
"BSD-3-Clause"
] | null | null | null | src/blade/new_project.py | southbear-club/blade-build | 3906806c49f2dd01ce57f4f4a924cab727e41710 | [
"BSD-3-Clause"
] | 1 | 2021-10-10T11:58:43.000Z | 2021-10-10T11:58:43.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : new_project.py
@Time : 2021/06/27 13:20:42
@Author : wotsen
@Version : 1.0.0
@Contact : astralrovers@outlook.com
@License : (C)Copyright 2020-2030, MIT
@Desc : None
'''
# here put the import lib
import os
import re
import time
import j... | 50.325926 | 144 | 0.626729 |
7842945e8905dbf5450c505f5ff34dfbc00915f4 | 25,121 | py | Python | run_glue_no_trainer_ds_pp.py | drunkcoding/model-finetune | 67c40b347ce41dc480dfd029bc74c9aa2501b6ee | [
"MIT"
] | null | null | null | run_glue_no_trainer_ds_pp.py | drunkcoding/model-finetune | 67c40b347ce41dc480dfd029bc74c9aa2501b6ee | [
"MIT"
] | null | null | null | run_glue_no_trainer_ds_pp.py | drunkcoding/model-finetune | 67c40b347ce41dc480dfd029bc74c9aa2501b6ee | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... | 40.322632 | 158 | 0.649536 |
28b8d4c47bd9985ba99b32ae2a99cdd5d3905606 | 489 | py | Python | bioviz/exceptions.py | BioWiz/msa | 634a99b2a36393dbec75ff008997de0ebd6cb2cb | [
"BSD-3-Clause"
] | 1 | 2021-04-01T05:50:44.000Z | 2021-04-01T05:50:44.000Z | bioviz/exceptions.py | BioWiz/msa | 634a99b2a36393dbec75ff008997de0ebd6cb2cb | [
"BSD-3-Clause"
] | null | null | null | bioviz/exceptions.py | BioWiz/msa | 634a99b2a36393dbec75ff008997de0ebd6cb2cb | [
"BSD-3-Clause"
] | null | null | null |
class InvalidColorMapException(Exception):
def __init__(self, *args):
if len(args)==1 and isinstance(args[0], str):
self.message = args[0]
else:
self.message = "Invalid colormap."
class InvalidFileFormatException(Exception):
def __init__(self, *args):
if ... | 30.5625 | 73 | 0.597137 |
0e851fc61b3596d7f982daa5493433558ea98213 | 2,352 | py | Python | utilities/permissions.py | BenitzCoding/Utility-Bot | a3959f5fc9a13e2e282d68ce6dd3b0266fc2b1b2 | [
"MIT"
] | null | null | null | utilities/permissions.py | BenitzCoding/Utility-Bot | a3959f5fc9a13e2e282d68ce6dd3b0266fc2b1b2 | [
"MIT"
] | null | null | null | utilities/permissions.py | BenitzCoding/Utility-Bot | a3959f5fc9a13e2e282d68ce6dd3b0266fc2b1b2 | [
"MIT"
] | null | null | null | import discord
from utils import default
from discord.ext import commands
owners = default.get("config.json").dev_ids
def is_owner(ctx):
return ctx.author.id in owners
async def check_permissions(ctx, perms, *, check=all):
if ctx.author.id in owners:
return True
resolved = ctx.channel.permiss... | 32.219178 | 113 | 0.671344 |
da8f86503b58036ab1b3aecab6a973cb9d95018e | 347 | py | Python | src/perspective.py | jamesfulford/better-lane-finding | 8b17f25b208b062694ced081fad89873b4ff2356 | [
"MIT"
] | null | null | null | src/perspective.py | jamesfulford/better-lane-finding | 8b17f25b208b062694ced081fad89873b4ff2356 | [
"MIT"
] | null | null | null | src/perspective.py | jamesfulford/better-lane-finding | 8b17f25b208b062694ced081fad89873b4ff2356 | [
"MIT"
] | null | null | null | import cv2
def get_transformers(src, dst):
M = cv2.getPerspectiveTransform(src, dst)
Minv = cv2.getPerspectiveTransform(dst, src)
return (
# Transform
lambda i: cv2.warpPerspective(i, M, (i.shape[1], i.shape[0])),
# Undo transform
lambda i: cv2.warpPerspective(i, Minv, (i.sh... | 31.545455 | 73 | 0.622478 |
918369b6bab2d73ca520367e3cf1e3932903cffc | 2,233 | py | Python | lib/clr.py | HarveyYan/RNAonGraph | 0056cc465f7bc4a89c4955d2cee88d6a858cef71 | [
"MIT"
] | 15 | 2020-06-27T08:08:20.000Z | 2022-02-22T03:29:45.000Z | lib/clr.py | HarveyYan/RNAonGraph | 0056cc465f7bc4a89c4955d2cee88d6a858cef71 | [
"MIT"
] | 2 | 2020-08-10T00:46:06.000Z | 2020-11-20T21:25:27.000Z | lib/clr.py | HarveyYan/RNAonGraph | 0056cc465f7bc4a89c4955d2cee88d6a858cef71 | [
"MIT"
] | 6 | 2020-02-19T16:04:00.000Z | 2021-12-09T22:32:23.000Z | '''
Downloaded from https://github.com/mhmoodlan/cyclic-learning-rate
Thanks Mahmoud!
'''
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.eager import context
def cyclic_learning_rate(global_step,
learning_r... | 45.571429 | 85 | 0.652933 |
c343c69daa12a382203ff3c282c1160e402f0c18 | 4,729 | py | Python | chromecast/tools/build/generate_test_lists.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | chromecast/tools/build/generate_test_lists.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chromecast/tools/build/generate_test_lists.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper script to generate unit test lists for the Chromecast build scripts.
"""
import glob
import optparse
import sys
def Combin... | 37.23622 | 80 | 0.67879 |
e2b7a02e428f4d991efacfb37fa306f80c1637b6 | 1,132 | py | Python | Machine_Learning/Introduction/03-Basic/Module_4/DenseNetX/image_input_fn.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | 1 | 2020-09-19T00:58:05.000Z | 2020-09-19T00:58:05.000Z | Machine_Learning/Introduction/03-Basic/Module_4/DenseNetX/image_input_fn.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | null | null | null | Machine_Learning/Introduction/03-Basic/Module_4/DenseNetX/image_input_fn.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | 2 | 2021-10-18T01:28:29.000Z | 2022-01-07T16:20:51.000Z | '''
Copyright 2020 Xilinx 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 agreed to in writing, softw... | 26.325581 | 73 | 0.729682 |
15fcf3db6ffd93e92bdd1d31c4a5c71ace595964 | 2,745 | py | Python | copilot/frame.py | aphistic/copilot | d434a801f321dfd0865448751a26f755b41f9037 | [
"MIT"
] | null | null | null | copilot/frame.py | aphistic/copilot | d434a801f321dfd0865448751a26f755b41f9037 | [
"MIT"
] | 1 | 2016-04-12T01:19:52.000Z | 2016-04-12T01:19:52.000Z | copilot/frame.py | aphistic/copilot | d434a801f321dfd0865448751a26f755b41f9037 | [
"MIT"
] | null | null | null | from tkinter import Toplevel, VERTICAL
from tkinter.ttk import Frame, Button, Label, Scrollbar
class CopilotBaseFrame(Frame):
def __init__(self, master, config):
super(CopilotBaseFrame, self).__init__(master)
self._master = master
self._config = config
def _make_full(self, root):
... | 30.164835 | 66 | 0.621129 |
a1ab54ba301ea9cccc7d216e622e5e4b98de6155 | 35 | py | Python | pulp/tests/__init__.py | atomassi/pulp | ec7105f515c0dc8058493677061b6d8d8c4b5be8 | [
"MIT"
] | 1,418 | 2015-04-23T12:33:11.000Z | 2022-03-31T22:26:43.000Z | pulp/tests/__init__.py | atomassi/pulp | ec7105f515c0dc8058493677061b6d8d8c4b5be8 | [
"MIT"
] | 360 | 2015-04-14T19:09:47.000Z | 2022-03-20T13:05:14.000Z | pulp/tests/__init__.py | atomassi/pulp | ec7105f515c0dc8058493677061b6d8d8c4b5be8 | [
"MIT"
] | 352 | 2015-04-16T15:45:41.000Z | 2022-03-12T09:16:04.000Z | from .run_tests import pulpTestAll
| 17.5 | 34 | 0.857143 |
1f80b8c91dbf6adcb703e93c9726eb9dac64373f | 25,368 | py | Python | sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py | aalapatirvbd/azure-sdk-for-python | aae867a31f53286b123cf008a43cf0cd3746f8ba | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py | aalapatirvbd/azure-sdk-for-python | aae867a31f53286b123cf008a43cf0cd3746f8ba | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py | aalapatirvbd/azure-sdk-for-python | aae867a31f53286b123cf008a43cf0cd3746f8ba | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typin... | 42.99661 | 110 | 0.654762 |
ddfb1bc39fc47fb4be3bd1dd75efbbfdc8e62294 | 11,421 | py | Python | nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_with_audio.py | sudhakarsingh27/NeMo | 9d75710f58d59d778e88aa4ddbaf28a022801620 | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_with_audio.py | sudhakarsingh27/NeMo | 9d75710f58d59d778e88aa4ddbaf28a022801620 | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_with_audio.py | sudhakarsingh27/NeMo | 9d75710f58d59d778e88aa4ddbaf28a022801620 | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright 2015 and onwards 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/license... | 53.619718 | 129 | 0.713773 |
e98bcd7c72803fcaa77f127e5682b22ad690110a | 15,296 | py | Python | scripts/sct_analyze_texture.py | valosekj/spinalcordtoolbox | 266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09 | [
"MIT"
] | 1 | 2020-05-17T00:39:47.000Z | 2020-05-17T00:39:47.000Z | scripts/sct_analyze_texture.py | valosekj/spinalcordtoolbox | 266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09 | [
"MIT"
] | null | null | null | scripts/sct_analyze_texture.py | valosekj/spinalcordtoolbox | 266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Analyse texture
#
# Copyright (c) 2017 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: Charley
# Modified: 2017-06-22
#
# About the license: see the file LICENSE.TXT
from __future__ import absolute_import
import os
import shutil
import sys
import numpy as np
import itertools
import ar... | 41.11828 | 209 | 0.620358 |
1a004c3a867509e5c9c83f68e7dfe55dcb2b3ce7 | 552 | py | Python | LD2/Python/Hadamard matrix.py | 0x4C4A/SS-2014 | 54bd34da340cba7b12717b87c5cd4efa3d93e35e | [
"CC0-1.0"
] | null | null | null | LD2/Python/Hadamard matrix.py | 0x4C4A/SS-2014 | 54bd34da340cba7b12717b87c5cd4efa3d93e35e | [
"CC0-1.0"
] | null | null | null | LD2/Python/Hadamard matrix.py | 0x4C4A/SS-2014 | 54bd34da340cba7b12717b87c5cd4efa3d93e35e | [
"CC0-1.0"
] | null | null | null | import math
matrix_size = pow(2,5);
#Allocate array
matrix = [[0 for x in xrange(matrix_size)] for x in xrange(matrix_size)]
matrix[0][0] = 1
for stage in range(0,int(math.log(matrix_size,2))):
block_edge = pow(2, stage)
for x in range(0, block_edge):
for y in range(0, block_edge):
matrix[x + block_edge][y]... | 25.090909 | 73 | 0.655797 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.