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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
378da4d13e06bbb31e58d1fc11e34c22a615d2dc | 22,136 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 ... | 50.081448 | 249 | 0.67135 |
d806ba338028be221739c993cbe08cc1ed62e517 | 5,011 | py | Python | pcap_tools/WhoIsIAmSummaryFilter.py | noelli/bacpypes | c2f4d753ed86bc0357823e718e7ff16c05f06850 | [
"MIT"
] | 1 | 2018-01-11T13:10:15.000Z | 2018-01-11T13:10:15.000Z | pcap_tools/WhoIsIAmSummaryFilter.py | noelli/bacpypes | c2f4d753ed86bc0357823e718e7ff16c05f06850 | [
"MIT"
] | null | null | null | pcap_tools/WhoIsIAmSummaryFilter.py | noelli/bacpypes | c2f4d753ed86bc0357823e718e7ff16c05f06850 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Who-Is and I-Am Summary Filter
"""
import sys
from collections import defaultdict
from bacpypes.debugging import Logging, function_debugging, ModuleLogger
from bacpypes.consolelogging import ConsoleLogHandler
from bacpypes.pdu import Address
from bacpypes.analysis import trace, strftimestamp, ... | 31.124224 | 115 | 0.628617 |
fe13432a81088e2daed80a83c29f8a3416e1e995 | 3,583 | py | Python | frappe-bench/apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils.nestedset import get_root_of
from frappe.utils import cint
from erpnext.accounts.doctype.pos_profile.pos_profile i... | 30.887931 | 103 | 0.715601 |
123ed9cc3e3b3ec86c1a5d2778eb181fdc42f915 | 6,000 | py | Python | pybind/slxos/v16r_1_00b/system_monitor_mail/fru/email_list/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/system_monitor_mail/fru/email_list/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/system_monitor_mail/fru/email_list/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 46.875 | 476 | 0.7035 |
e758b88944a0271a7b1657cba899a207afd26411 | 17,903 | py | Python | src/oci/mysql/models/work_request_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/mysql/models/work_request_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/mysql/models/work_request_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 41.251152 | 594 | 0.702676 |
8167f64d008f8ac7fd5ff9c25f0015e5a4ece07c | 14,758 | py | Python | foolbox/adversarial.py | schoyc/foolbox | e0f400be8fa393467d3db598576e985727edb310 | [
"MIT"
] | 2 | 2018-12-31T16:07:55.000Z | 2019-05-10T14:32:27.000Z | foolbox2/adversarial.py | IsCoelacanth/NeurIPS-2018-Adversarial-Vision-Challenge-Targeted-Attack | 93f824b3535a8a4e28576c15d978e5b16fd01ef2 | [
"MIT"
] | null | null | null | foolbox2/adversarial.py | IsCoelacanth/NeurIPS-2018-Adversarial-Vision-Challenge-Targeted-Attack | 93f824b3535a8a4e28576c15d978e5b16fd01ef2 | [
"MIT"
] | 1 | 2020-08-11T14:30:53.000Z | 2020-08-11T14:30:53.000Z | """
Provides a class that represents an adversarial example.
"""
import numpy as np
import numbers
from .distances import Distance
from .distances import MSE
class StopAttack(Exception):
"""Exception thrown to request early stopping of an attack
if a given (optional!) threshold is reached."""
pass
cl... | 32.578366 | 97 | 0.622645 |
5f68b4ba053daee7e67202d00923e7716fa8d86e | 926 | py | Python | setup.py | fsecada01/wtf-tortoise | aaecdec4e57adb57ab3438f5f1487d1b0d4afac8 | [
"MIT"
] | 2 | 2021-09-29T03:06:26.000Z | 2021-11-25T13:50:36.000Z | setup.py | fsecada01/wtf-tortoise | aaecdec4e57adb57ab3438f5f1487d1b0d4afac8 | [
"MIT"
] | 2 | 2021-11-25T13:50:20.000Z | 2022-01-12T08:12:37.000Z | setup.py | fsecada01/wtf-tortoise | aaecdec4e57adb57ab3438f5f1487d1b0d4afac8 | [
"MIT"
] | 1 | 2021-11-26T13:42:38.000Z | 2021-11-26T13:42:38.000Z | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="wtf-tortoise",
version="0.0.4",
author="sinisaos (packaged by fsecada01",
author_email="francis.secada@gmail.com",
description="Implementation of WTForms for Tortoise ORM... | 33.071429 | 78 | 0.661987 |
4b982ddea59ac0feebd1c527aeba547f069ca8b1 | 15,886 | py | Python | strawberryfields/utils.py | cgogolin/strawberryfields | d7af185cad87b18fda4ba7c70f9af37796482c93 | [
"Apache-2.0"
] | null | null | null | strawberryfields/utils.py | cgogolin/strawberryfields | d7af185cad87b18fda4ba7c70f9af37796482c93 | [
"Apache-2.0"
] | null | null | null | strawberryfields/utils.py | cgogolin/strawberryfields | d7af185cad87b18fda4ba7c70f9af37796482c93 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Xanadu Quantum Technologies 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 agre... | 28.778986 | 109 | 0.571698 |
2e049aa906af84591fdea264f54b0cf8e8e4b815 | 64 | py | Python | day2/day2-07 lab1-4.py | hajin-kim/2020-HighSchool-Python-Tutoring | 352025a954bff37d21cc3d59e7d5e0f0269a1f17 | [
"MIT"
] | null | null | null | day2/day2-07 lab1-4.py | hajin-kim/2020-HighSchool-Python-Tutoring | 352025a954bff37d21cc3d59e7d5e0f0269a1f17 | [
"MIT"
] | null | null | null | day2/day2-07 lab1-4.py | hajin-kim/2020-HighSchool-Python-Tutoring | 352025a954bff37d21cc3d59e7d5e0f0269a1f17 | [
"MIT"
] | null | null | null | x = float( input() )
y = float( input() )
print(x*x + y*y)
| 12.8 | 21 | 0.484375 |
7201956026b800d223878aebafa8d4401ce6ea31 | 770 | py | Python | desafio011.py | marcelocmedeiros/RevisaoPython | 04c602bf17e8ab37c9660337a8f8497eb498e10d | [
"MIT"
] | null | null | null | desafio011.py | marcelocmedeiros/RevisaoPython | 04c602bf17e8ab37c9660337a8f8497eb498e10d | [
"MIT"
] | null | null | null | desafio011.py | marcelocmedeiros/RevisaoPython | 04c602bf17e8ab37c9660337a8f8497eb498e10d | [
"MIT"
] | null | null | null | # Marcelo Campos de Medeiros
# ADS UNIFIP
# REVISÃO DE PYTHON
# AULA 07 GUSTAVO GUANABARA
'''
Faça um programa que leia a largura e a altura de uma parede em metros calcule a sua área
e a quantidade de tinta necessária para pintá-la, sabendo que cada litro de tinta, pinta uma
área de 2m².
'''
print('='*30)
print('{:$^... | 32.083333 | 148 | 0.68961 |
5eea08d7f9e508f905210ba7535d3edaebe17ba5 | 16,754 | py | Python | chemist_opt/gp_bandit.py | kamikaze0923/ChemBo | 596b4108deef785c7afe25f9a68975e6d3a18225 | [
"MIT"
] | 29 | 2019-08-07T07:41:25.000Z | 2022-03-20T13:10:49.000Z | chemist_opt/gp_bandit.py | ks-korovina/dragonfly_chemist | aa30a1cbacaee1d5c46e333f54781c90183f5cd7 | [
"MIT"
] | 10 | 2019-11-02T07:10:37.000Z | 2022-03-12T00:03:04.000Z | chemist_opt/gp_bandit.py | cyclone923/ChemBo | 596b4108deef785c7afe25f9a68975e6d3a18225 | [
"MIT"
] | 4 | 2020-06-29T02:39:59.000Z | 2022-02-17T20:52:46.000Z | """
A mirror of gp_bandit.py of Dragonfly:
imports class, resets a method and inherits further
This is an example of how to make this work:
>> sneaky_func = lambda: print("Hi!")
>> gpb_acquisitions.asy_ei.__code__ = sneaky_func.__code__
>> gpb_acquisitions.asy.ei()
TODO:
* anc_data has domain: use it for looping whil... | 50.161677 | 115 | 0.653993 |
46b3885c4b8bea36b5fc91130cd31cbc1812169a | 63,432 | py | Python | venv/lib/python3.6/site-packages/ansible/plugins/strategy/__init__.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible/plugins/strategy/__init__.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible/plugins/strategy/__init__.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 45.601725 | 152 | 0.590822 |
befa0b5062267d334dc03048f0c3abe3f2642aea | 3,106 | py | Python | pytorch_metric_learning/losses/generic_pair_loss.py | JoOkuma/pytorch-metric-learning | 4b17eb269d247c8725afcba100f2214680060ea3 | [
"MIT"
] | 2 | 2020-02-22T10:46:33.000Z | 2020-09-30T00:25:29.000Z | pytorch_metric_learning/losses/generic_pair_loss.py | liyongsheng-tech/pytorch-metric-learning | ae3807249a748512a1f7db62b380a524869b5911 | [
"MIT"
] | null | null | null | pytorch_metric_learning/losses/generic_pair_loss.py | liyongsheng-tech/pytorch-metric-learning | ae3807249a748512a1f7db62b380a524869b5911 | [
"MIT"
] | 2 | 2020-02-22T10:46:35.000Z | 2020-11-06T00:51:42.000Z | #! /usr/bin/env python3
import torch
from ..utils import loss_and_miner_utils as lmu
from .base_metric_loss_function import BaseMetricLossFunction
class GenericPairLoss(BaseMetricLossFunction):
"""
The function pair_based_loss has to be implemented by the child class.
By default, this class extracts eve... | 44.371429 | 95 | 0.667418 |
860b6a3aeea35ee1c423849ce2149066d0a89fbb | 13,128 | py | Python | modules/beam_search.py | frscharf/Bachelors-Thesis-RUN | 1596ba1a7967a4f33334c95f75b5dbe4a8ebf2bc | [
"Apache-1.1"
] | 7 | 2019-09-20T11:42:51.000Z | 2022-01-18T13:34:51.000Z | modules/beam_search.py | frscharf/Bachelors-Thesis-RUN | 1596ba1a7967a4f33334c95f75b5dbe4a8ebf2bc | [
"Apache-1.1"
] | 12 | 2020-01-28T22:17:01.000Z | 2022-02-09T23:31:19.000Z | modules/beam_search.py | frscharf/Bachelors-Thesis-RUN | 1596ba1a7967a4f33334c95f75b5dbe4a8ebf2bc | [
"Apache-1.1"
] | 2 | 2021-11-27T08:51:03.000Z | 2022-01-18T09:12:11.000Z | # -*- coding: utf-8 -*-
import copy
import numpy
import pickle
import torch
import torch.nn.functional as F
from enum import Enum
from torch.autograd import Variable
from execution_system import ExecutionSystem
from execution_system import MovementType, Turn
from modules.world_state_processer import World... | 38.95549 | 194 | 0.547608 |
47d4278d2cdd2a49ebb98d8196f72bdc9423a723 | 3,671 | py | Python | jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/export_test.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 680 | 2016-12-03T14:38:28.000Z | 2022-02-16T04:06:45.000Z | tensorflow/contrib/learn/python/learn/utils/export_test.py | alainrk/tensorflow | 314d9cd9b607460f8bfea80fc828b1521ca18443 | [
"Apache-2.0"
] | 38 | 2016-11-17T08:43:51.000Z | 2019-11-12T12:27:04.000Z | tensorflow/contrib/learn/python/learn/utils/export_test.py | alainrk/tensorflow | 314d9cd9b607460f8bfea80fc828b1521ca18443 | [
"Apache-2.0"
] | 250 | 2016-12-05T10:37:17.000Z | 2022-03-18T21:26:55.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.845361 | 80 | 0.689186 |
85ec3deedeb79bcf0c2ad7a63ca85c868c757251 | 8,298 | py | Python | plugins/util/microsofttranslator/__init__.py | TheTesterQED/skybot | d86e22061215365a0229c56097e19affcb8fd8c7 | [
"Unlicense"
] | null | null | null | plugins/util/microsofttranslator/__init__.py | TheTesterQED/skybot | d86e22061215365a0229c56097e19affcb8fd8c7 | [
"Unlicense"
] | null | null | null | plugins/util/microsofttranslator/__init__.py | TheTesterQED/skybot | d86e22061215365a0229c56097e19affcb8fd8c7 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
__init__
A translator using the micrsoft translation engine documented here:
http://msdn.microsoft.com/en-us/library/ff512419.aspx
:copyright: © 2011 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, see LICENSE for more details.
"""
__all__ = ['Transla... | 38.775701 | 80 | 0.613401 |
09cdf1d2beaebf49350c41543f3f9b258799e88d | 15,036 | py | Python | eZmaxApi/model/ezsigntemplatepackage_get_list_v1_response_m_payload.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | eZmaxApi/model/ezsigntemplatepackage_get_list_v1_response_m_payload.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | eZmaxApi/model/ezsigntemplatepackage_get_list_v1_response_m_payload.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | """
eZmax API Definition (Full)
This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501
The version of the OpenAPI document: 1.1.7
Contact: support-api@ezmax.ca
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401... | 45.017964 | 142 | 0.594972 |
2091560bd81a73108e3803d121616c2d65e0da9c | 370 | py | Python | times_tables.py | UlisseMini/mafs | 5b240ea36641f66698614d6ba49ddc0de73cbd45 | [
"MIT"
] | null | null | null | times_tables.py | UlisseMini/mafs | 5b240ea36641f66698614d6ba49ddc0de73cbd45 | [
"MIT"
] | null | null | null | times_tables.py | UlisseMini/mafs | 5b240ea36641f66698614d6ba49ddc0de73cbd45 | [
"MIT"
] | null | null | null | import brainlet as bl
import random
def questions() -> bl.Q:
while True:
n1 = random.randint(2, 9)
n2 = random.randint(6, 9)
yield random.choice([
bl.Q(f'{n1} * {n2}', n1*n2),
bl.Q(f'{n2} * {n1}', n1*n2),
])
def main():
bl.quiz('times tables', question... | 17.619048 | 45 | 0.505405 |
73d1e610e922bbd24af6a8cb62c03caf012d3645 | 13 | py | Python | Chapter 01/ch1_49.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 01/ch1_49.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 01/ch1_49.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | int('string') | 13 | 13 | 0.692308 |
285796664194301feb41855ab3b64dfa25396a44 | 923 | py | Python | Modules/Core/Common/wrapping/test/itkDirectoryTest.py | lassoan/ITK | 4634cb0490934f055065230e3db64df8f546b72a | [
"Apache-2.0"
] | 2 | 2019-09-15T10:17:06.000Z | 2019-09-15T10:19:06.000Z | Modules/Core/Common/wrapping/test/itkDirectoryTest.py | lassoan/ITK | 4634cb0490934f055065230e3db64df8f546b72a | [
"Apache-2.0"
] | null | null | null | Modules/Core/Common/wrapping/test/itkDirectoryTest.py | lassoan/ITK | 4634cb0490934f055065230e3db64df8f546b72a | [
"Apache-2.0"
] | 1 | 2021-09-23T08:33:37.000Z | 2021-09-23T08:33:37.000Z | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | 31.827586 | 77 | 0.589382 |
79d1f9c604dcd14dbcefe23fd093f0727ec52022 | 89 | py | Python | tketris/view/__init__.py | andydevs/tketris | 054914a9ad815b009b6792067bd689e36095e8de | [
"MIT"
] | 1 | 2020-09-13T21:29:12.000Z | 2020-09-13T21:29:12.000Z | tketris/view/__init__.py | andydevs/tketris | 054914a9ad815b009b6792067bd689e36095e8de | [
"MIT"
] | null | null | null | tketris/view/__init__.py | andydevs/tketris | 054914a9ad815b009b6792067bd689e36095e8de | [
"MIT"
] | null | null | null | """
Tketris
Tetris using tkinter
Author: Anshul Kharbanda
Created: 10 - 11 - 2018
"""
| 9.888889 | 25 | 0.685393 |
7b4e60610715b834a61bb3eec530e20a1afc35db | 158 | py | Python | StudentsMS/apps.py | king-tomi/Student-MS | 6ab3700b3b05829ea9777e704c79b5e43fff7bfa | [
"MIT"
] | 1 | 2021-08-12T01:20:27.000Z | 2021-08-12T01:20:27.000Z | StudentsMS/apps.py | king-tomi/Student-MS | 6ab3700b3b05829ea9777e704c79b5e43fff7bfa | [
"MIT"
] | null | null | null | StudentsMS/apps.py | king-tomi/Student-MS | 6ab3700b3b05829ea9777e704c79b5e43fff7bfa | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class StudentsmsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'StudentsMS'
| 22.571429 | 57 | 0.740506 |
622b842d004ec720baafa4c8de439d16f1e2e4bc | 7,201 | py | Python | Pillow-4.3.0/Tests/test_box_blur.py | leorzz/simplemooc | 8b1c5e939d534b1fd729596df4c59fc69708b896 | [
"MIT"
] | null | null | null | Pillow-4.3.0/Tests/test_box_blur.py | leorzz/simplemooc | 8b1c5e939d534b1fd729596df4c59fc69708b896 | [
"MIT"
] | null | null | null | Pillow-4.3.0/Tests/test_box_blur.py | leorzz/simplemooc | 8b1c5e939d534b1fd729596df4c59fc69708b896 | [
"MIT"
] | null | null | null | from helper import unittest, PillowTestCase
from PIL import Image, ImageOps
sample = Image.new("L", (7, 5))
sample.putdata(sum([
[210, 50, 20, 10, 220, 230, 80],
[190, 210, 20, 180, 170, 40, 110],
[120, 210, 250, 60, 220, 0, 220],
[220, 40, 230, 80, 130, 250, 40],
[250, 0, 80, 30, 6... | 32.436937 | 77 | 0.445771 |
e967334a8e350233bbb18fd8b4ca6043a9e6f5a9 | 2,174 | py | Python | src/azure-cli/azure/cli/command_modules/natgateway/_help.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/natgateway/_help.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/natgateway/_help.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.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.
# -----------------------------------------------------... | 32.939394 | 213 | 0.666973 |
4996b93b904ded39253dd287f95e582d1d6ad2a4 | 1,148 | py | Python | src/dualbound_event.py | roessig/verify-nn | 44e582f93c2a7702491be9ec351e0f5d7cf8a038 | [
"CC-BY-4.0"
] | 1 | 2021-12-22T18:42:55.000Z | 2021-12-22T18:42:55.000Z | src/dualbound_event.py | roessig/verify-nn | 44e582f93c2a7702491be9ec351e0f5d7cf8a038 | [
"CC-BY-4.0"
] | null | null | null | src/dualbound_event.py | roessig/verify-nn | 44e582f93c2a7702491be9ec351e0f5d7cf8a038 | [
"CC-BY-4.0"
] | 2 | 2021-09-24T02:04:11.000Z | 2021-09-28T09:57:01.000Z | from pyscipopt import Eventhdlr, SCIP_EVENTTYPE
import logging
class DualBoundEvent(Eventhdlr):
"""This class is used to stop the solving process when an instance is proved to be verifiable or refutable."""
def __init__(self, mip):
self.mip = mip
self.log = logging.getLogger('main_log')
... | 38.266667 | 114 | 0.648955 |
415a8bb4af974ce75fdef3ee0ff9fbede8ef18d4 | 115 | py | Python | Task+06.py | Umarhayat3/Road-Map-B | 839cf7b5e27e8986c14b7f6c8447f6f4cbda8c14 | [
"MIT"
] | null | null | null | Task+06.py | Umarhayat3/Road-Map-B | 839cf7b5e27e8986c14b7f6c8447f6f4cbda8c14 | [
"MIT"
] | null | null | null | Task+06.py | Umarhayat3/Road-Map-B | 839cf7b5e27e8986c14b7f6c8447f6f4cbda8c14 | [
"MIT"
] | null | null | null | import csv
result = [field for field in csv.DictReader(open('abc.csv', newline='',errors='ignore'))]
print(result)
| 28.75 | 89 | 0.721739 |
d178cc9039bee59e1af48b77bc1777105e0e5544 | 887 | py | Python | test/py_tests/test_lam.py | kalyanam-FMTGA/ray-original | f4f57896015c1c29ca571069b007c409d74824e0 | [
"BSD-3-Clause-LBNL"
] | null | null | null | test/py_tests/test_lam.py | kalyanam-FMTGA/ray-original | f4f57896015c1c29ca571069b007c409d74824e0 | [
"BSD-3-Clause-LBNL"
] | null | null | null | test/py_tests/test_lam.py | kalyanam-FMTGA/ray-original | f4f57896015c1c29ca571069b007c409d74824e0 | [
"BSD-3-Clause-LBNL"
] | null | null | null |
import os
import math
import string
import unittest
from unit_tools import support
from unit_tools import lcompare
class LamTestCase(unittest.TestCase):
def setUp(self):
self.oldpath = os.environ['PATH']
os.environ['PATH'] = os.path.abspath(support.BINDIR)
def tearDown(self):
os.environ['PATH'] = self.oldpa... | 21.119048 | 57 | 0.662909 |
9a4d3a263be30b83f21089075cf60f0dd362ecd7 | 1,196 | py | Python | build_binutils_i486.py | SydOS/toolchains | bb09e4a929813b9b305182c596192d22f89e290d | [
"MIT"
] | null | null | null | build_binutils_i486.py | SydOS/toolchains | bb09e4a929813b9b305182c596192d22f89e290d | [
"MIT"
] | null | null | null | build_binutils_i486.py | SydOS/toolchains | bb09e4a929813b9b305182c596192d22f89e290d | [
"MIT"
] | null | null | null | # File: build_binutils_i686.py
#
# Copyright (c) 2018 The SydOS Team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | 47.84 | 80 | 0.779264 |
326da14c6d21e760334eb37a8bb6ab0b086d3ada | 644 | py | Python | examples/ki_frame_lel.py | theswampire/matura | ab193d6ab4e85a7fbed49bdffddf48aa23467c3c | [
"MIT"
] | 1 | 2022-01-29T07:58:00.000Z | 2022-01-29T07:58:00.000Z | examples/ki_frame_lel.py | theswampire/matura | ab193d6ab4e85a7fbed49bdffddf48aa23467c3c | [
"MIT"
] | null | null | null | examples/ki_frame_lel.py | theswampire/matura | ab193d6ab4e85a7fbed49bdffddf48aa23467c3c | [
"MIT"
] | null | null | null | import random
import time
import numpy as np
from kAI.neural_network import *
from kAI.neural_network.inter_processor import *
from kAI.utils import row_vector_list
random.seed(0)
if __name__ == '__main__':
n = Network([Layer(3), Layer(4, ReLu), Layer(3)], RealtimeVizInter)
o = StochasticGD(
learni... | 23.851852 | 71 | 0.653727 |
50470a4fe0e5d88f14ccdb939596f3ef34f71fb4 | 587 | py | Python | _python/raspa_eel.py | luizeleno/pyjupiter | 48bca116a23ba7055fb941e03fa0184c8615e5d8 | [
"MIT"
] | null | null | null | _python/raspa_eel.py | luizeleno/pyjupiter | 48bca116a23ba7055fb941e03fa0184c8615e5d8 | [
"MIT"
] | null | null | null | _python/raspa_eel.py | luizeleno/pyjupiter | 48bca116a23ba7055fb941e03fa0184c8615e5d8 | [
"MIT"
] | null | null | null | import json
import raspa_curso as rc
EA = 'EA', '251', '0'
EB = 'EB', '152', '0'
EF = 'EF', '301', '0'
EM = 'EM', '202', '0'
EP = 'EP', '352', '4'
EQD = 'EQD', '052', '1'
EQN = 'EQN', '052', '4'
for curso, codigo, hab in [EF, EM, EA, EB, EP, EQD, EQN]:
URL = f'https://uspdigital.usp.br/jupiterweb/listarGradeCurri... | 24.458333 | 118 | 0.563884 |
d26933afbcef0ee93658da19907ad7cb82b5cdc9 | 1,494 | py | Python | python/security_test.py | lresende/toree-proxy-kernel | c6a2c4d122b1ed6d327785761724c87a2daa630e | [
"Apache-2.0"
] | 1 | 2019-03-24T09:04:39.000Z | 2019-03-24T09:04:39.000Z | python/security_test.py | lresende/toree-proxy-kernel | c6a2c4d122b1ed6d327785761724c87a2daa630e | [
"Apache-2.0"
] | 2 | 2017-01-27T06:48:00.000Z | 2017-03-03T02:36:50.000Z | python/security_test.py | lresende/toree-proxy-kernel | c6a2c4d122b1ed6d327785761724c87a2daa630e | [
"Apache-2.0"
] | 4 | 2017-01-26T23:16:33.000Z | 2017-10-06T12:23:41.000Z | #
# (C) Copyright IBM Corp. 2017
#
# 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 writi... | 39.315789 | 141 | 0.771754 |
a4ffa8b7380c44819e2f3930a21b75046d0c471e | 948 | py | Python | _assignments/basics/function/function_args_b.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _assignments/basics/function/function_args_b.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _assignments/basics/function/function_args_b.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | """
* Assignment: Function Arguments Divide
* Required: yes
* Complexity: easy
* Lines of code: 4 lines
* Time: 3 min
English:
1. Define function `divide`
2. Function takes two arguments
3. Function returns result of the division of both arguments
4. If division cannot be made, raise `ValueError` with
... | 24.947368 | 64 | 0.669831 |
adb597faf48da4d7844bd6b48f9a7000d46053b8 | 6,624 | py | Python | train_uncertainty_new.py | aldakata/ClassConditionalC2D | dd73e1d4d5f0f82438340211e3c479dbd16b8ffc | [
"MIT"
] | 1 | 2022-02-18T22:20:56.000Z | 2022-02-18T22:20:56.000Z | train_uncertainty_new.py | aldakata/ClassConditionalC2D | dd73e1d4d5f0f82438340211e3c479dbd16b8ffc | [
"MIT"
] | null | null | null | train_uncertainty_new.py | aldakata/ClassConditionalC2D | dd73e1d4d5f0f82438340211e3c479dbd16b8ffc | [
"MIT"
] | null | null | null | import sys
import numpy as np
import torch
import torch.nn.functional as F
def co_guess(net, net2, inputs_x, inputs_u, inputs_x2, inputs_u2, w_x, labels_x, T, smooth_clean):
# label co-guessing of unlabeled samples
outputs_u11 = net(inputs_u)
outputs_u12 = net(inputs_u2)
outputs_u21 = net2(inputs_u)
... | 43.294118 | 159 | 0.583635 |
499833b72d11ba39d81977ce7e196d0e01ed0d4a | 4,552 | py | Python | specklepy/gui/window.py | felixbosco/specklepy | 18f1d542f04cbe31fec8675791bf8350a09441c6 | [
"MIT"
] | null | null | null | specklepy/gui/window.py | felixbosco/specklepy | 18f1d542f04cbe31fec8675791bf8350a09441c6 | [
"MIT"
] | null | null | null | specklepy/gui/window.py | felixbosco/specklepy | 18f1d542f04cbe31fec8675791bf8350a09441c6 | [
"MIT"
] | 2 | 2020-12-07T14:21:13.000Z | 2021-02-26T13:52:52.000Z | import sys
from PyQt5 import QtWidgets, QtGui, QtCore
from specklepy.logging import logger
def start():
logger.info("Initializing application...")
app = QtWidgets.QApplication(sys.argv)
logger.info("Initializing GUI...")
win = Window()
win.show()
sys.exit(app.exec_())
cla... | 40.283186 | 119 | 0.519552 |
36225a0e9ff302a0c7b393d6ce330ca31d58b4f7 | 675 | py | Python | wavelet_entropy.py | ericblanco/eeg | 24c33250cadbeb855447134e96b10004e360eed9 | [
"MIT"
] | 26 | 2018-08-29T23:16:21.000Z | 2022-03-06T01:39:25.000Z | wavelet_entropy.py | ericblanco/eeg | 24c33250cadbeb855447134e96b10004e360eed9 | [
"MIT"
] | null | null | null | wavelet_entropy.py | ericblanco/eeg | 24c33250cadbeb855447134e96b10004e360eed9 | [
"MIT"
] | 11 | 2019-03-14T11:03:14.000Z | 2021-08-06T10:50:25.000Z | # not enough variance to choose
# wavelet entropy python
def WE(y, level = 4, wavelet = 'coif2'):
from math import log
n = len(y)
sig = y
ap = {}
for lev in range(0,level):
(y, cD) = pywt.dwt(y, wavelet)
ap[lev] = y
# Energy
Enr = np.zeros(level)
... | 20.454545 | 81 | 0.527407 |
562352d5c709236328666569bf632253c36a78af | 212 | py | Python | docs/source/tutorials/installation/install_check.demo.py | opendilab/DI-treetensor | fe5f681123c3d6e8d7507fba38586d2edf12e693 | [
"Apache-2.0"
] | 45 | 2021-09-04T15:57:44.000Z | 2022-03-11T19:28:56.000Z | docs/source/tutorials/installation/install_check.demo.py | opendilab/DI-treetensor | fe5f681123c3d6e8d7507fba38586d2edf12e693 | [
"Apache-2.0"
] | 7 | 2021-09-06T13:06:12.000Z | 2022-03-03T13:38:05.000Z | docs/source/tutorials/installation/install_check.demo.py | opendilab/DI-treetensor | fe5f681123c3d6e8d7507fba38586d2edf12e693 | [
"Apache-2.0"
] | 1 | 2021-09-30T15:18:06.000Z | 2021-09-30T15:18:06.000Z | from treetensor.config.meta import __TITLE__, __VERSION__, __AUTHOR__, __DESCRIPTION__
if __name__ == '__main__':
print(__TITLE__, __VERSION__)
print(__DESCRIPTION__)
print('Powered by', __AUTHOR__)
| 30.285714 | 86 | 0.764151 |
3150a9aa1954f3dc088e70d92c9ed6f3577fcf24 | 26,657 | py | Python | pyscripts/request_handlers.py | saar-win/switcher_webapi | 91153e4e559e6c4768ddd4564ebd9423f2effa8b | [
"MIT"
] | null | null | null | pyscripts/request_handlers.py | saar-win/switcher_webapi | 91153e4e559e6c4768ddd4564ebd9423f2effa8b | [
"MIT"
] | null | null | null | pyscripts/request_handlers.py | saar-win/switcher_webapi | 91153e4e559e6c4768ddd4564ebd9423f2effa8b | [
"MIT"
] | null | null | null | """Request handlers for the Switcher WebAPI.
.. codeauthor:: Tomer Figenblat <tomer.figenblat@gmail.com>
"""
# fmt: off
from asyncio import get_running_loop
from datetime import timedelta
from typing import Dict, List, Optional
from aioswitcher.api import SwitcherV2Api, messages
from aioswitcher.consts import (COMM... | 31.772348 | 95 | 0.622838 |
ff230d4e8512613c3deaaecde0ee136f4095c83b | 1,703 | py | Python | flasky_blog/models.py | guili618/flasky_blog | db0f69df395aa7e229837d5100a40026f21c6047 | [
"MIT"
] | null | null | null | flasky_blog/models.py | guili618/flasky_blog | db0f69df395aa7e229837d5100a40026f21c6047 | [
"MIT"
] | null | null | null | flasky_blog/models.py | guili618/flasky_blog | db0f69df395aa7e229837d5100a40026f21c6047 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import current_app
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flasky_blog import db,login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model,U... | 35.479167 | 78 | 0.69172 |
be7bd3dfcfb30a3b42f75fe413dcf67ca5b4d3fe | 56,188 | py | Python | Lib/idlelib/pyshell.py | blueyed/cpython | 0c3116309307ad2c7f8e2d2096612f4ab33cbb62 | [
"PSF-2.0"
] | null | null | null | Lib/idlelib/pyshell.py | blueyed/cpython | 0c3116309307ad2c7f8e2d2096612f4ab33cbb62 | [
"PSF-2.0"
] | null | null | null | Lib/idlelib/pyshell.py | blueyed/cpython | 0c3116309307ad2c7f8e2d2096612f4ab33cbb62 | [
"PSF-2.0"
] | null | null | null | #! /usr/bin/env python3
import sys
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise SystemExit(1)
import tkinter.messagebox as tkMessageBox
if TkVersion < 8.5:
root = Tk() # othe... | 36.462038 | 87 | 0.582171 |
ffbc84182c410200bdaf8212c899d0ca807a139e | 3,609 | py | Python | 01-Regression/Time-series-single-variate/airline_passengers/run.py | peter-doherty/machine_learning | a1b0cdde0844066ec9a0f5a866dcf4b2597a3a7f | [
"MIT"
] | null | null | null | 01-Regression/Time-series-single-variate/airline_passengers/run.py | peter-doherty/machine_learning | a1b0cdde0844066ec9a0f5a866dcf4b2597a3a7f | [
"MIT"
] | null | null | null | 01-Regression/Time-series-single-variate/airline_passengers/run.py | peter-doherty/machine_learning | a1b0cdde0844066ec9a0f5a866dcf4b2597a3a7f | [
"MIT"
] | null | null | null | """
import library
"""
import numpy
import matplotlib.pyplot as plt
import pandas
import math
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
# fix random seed for reproducibil... | 36.454545 | 111 | 0.763369 |
79484baceacf87b4181d697ae171edcfb66776e7 | 6,243 | py | Python | route/login_check_key.py | norhu1130/openNAMU | 332ffd4d571cc1f28de427761ef926a015ea3862 | [
"BSD-3-Clause"
] | null | null | null | route/login_check_key.py | norhu1130/openNAMU | 332ffd4d571cc1f28de427761ef926a015ea3862 | [
"BSD-3-Clause"
] | null | null | null | route/login_check_key.py | norhu1130/openNAMU | 332ffd4d571cc1f28de427761ef926a015ea3862 | [
"BSD-3-Clause"
] | null | null | null | from .tool.func import *
def login_check_key_2(conn, tool):
curs = conn.cursor()
if flask.request.method == 'POST' or \
('c_key' in flask.session and flask.session['c_key'] == 'email_pass'):
re_set_list = ['c_id', 'c_pw', 'c_ans', 'c_que', 'c_key', 'c_type', 'c_email']
ip = ip_check()
... | 45.23913 | 135 | 0.480218 |
4b4839315cc221d0c911039fc08a905536b2d940 | 10,028 | py | Python | openpyexcel/packaging/tests/test_manifest.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | 2 | 2019-07-03T06:37:42.000Z | 2020-05-15T00:28:13.000Z | openpyexcel/packaging/tests/test_manifest.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | null | null | null | openpyexcel/packaging/tests/test_manifest.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | 1 | 2020-01-06T10:01:42.000Z | 2020-01-06T10:01:42.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyexcel
import pytest
from io import BytesIO
from zipfile import ZipFile
from openpyexcel.xml.functions import fromstring, tostring
from openpyexcel.tests.helper import compare_xml
from ..manifest import WORKSHEET_TYPE
@pytest.fixture
def FileExte... | 34.57931 | 135 | 0.605604 |
030ddc7732031e49d4ad6d54bd9a6f17ac35b501 | 5,046 | py | Python | pyscrapper/utilities.py | pavanyekabote/pyscrapper | 1f24eaacbf9b9d03c7978f8da492bb5a12be429d | [
"MIT"
] | 2 | 2019-12-23T06:50:57.000Z | 2020-01-22T03:20:21.000Z | pyscrapper/utilities.py | pavanyekabote/pyscrapper | 1f24eaacbf9b9d03c7978f8da492bb5a12be429d | [
"MIT"
] | 1 | 2021-06-02T00:52:57.000Z | 2021-06-02T00:52:57.000Z | pyscrapper/utilities.py | pavanyekabote/pyscrapper | 1f24eaacbf9b9d03c7978f8da492bb5a12be429d | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
# Get Attribute from object Or Get Index from array etc...
def get_attr_with_err(src_object, index, none_if_empty=False, obj_if_empty=False):
result, is_error = None, False
try:
result = src_object[index]
if type(result) == list and none_if_empty:
if le... | 37.93985 | 116 | 0.621482 |
d5922daa3226d8746612b382706152375d1e6f61 | 16,537 | py | Python | lib/sqlalchemy/future/engine.py | mmeyer724/sqlalchemy | 330f112d4976786fba29b9a13c0e24dc3b3ef77c | [
"MIT"
] | null | null | null | lib/sqlalchemy/future/engine.py | mmeyer724/sqlalchemy | 330f112d4976786fba29b9a13c0e24dc3b3ef77c | [
"MIT"
] | 1 | 2020-07-20T13:23:44.000Z | 2020-07-20T13:23:44.000Z | lib/sqlalchemy/future/engine.py | mmeyer724/sqlalchemy | 330f112d4976786fba29b9a13c0e24dc3b3ef77c | [
"MIT"
] | null | null | null | from .. import util
from ..engine import Connection as _LegacyConnection
from ..engine import create_engine as _create_engine
from ..engine import Engine as _LegacyEngine
from ..engine.base import OptionEngineMixin
NO_OPTIONS = util.immutabledict()
def create_engine(*arg, **kw):
"""Create a new :class:`_future.E... | 39.657074 | 79 | 0.666143 |
3debcbec0a6d7313b69baab3b364d081336dbabe | 30,062 | py | Python | docker/manager.py | ahallermed/BentoML | ae47db40e0c770dfdb1697090dbb2efd3d58e37f | [
"Apache-2.0"
] | null | null | null | docker/manager.py | ahallermed/BentoML | ae47db40e0c770dfdb1697090dbb2efd3d58e37f | [
"Apache-2.0"
] | 3 | 2021-04-16T07:19:50.000Z | 2021-11-05T07:39:20.000Z | docker/manager.py | ahallermed/BentoML | ae47db40e0c770dfdb1697090dbb2efd3d58e37f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import itertools
import json
import operator
import os
import re
import shutil
from collections import defaultdict
from copy import deepcopy
from functools import lru_cache
from pathlib import Path
from typing import Dict, Iterator, List, MutableMapping, Optional, Tuple
from absl import app, log... | 36.660976 | 107 | 0.559377 |
79527bfc6710346163d034728c64bb7abd8fef2b | 1,056 | py | Python | 06.py | rubenhortas/python_challenge | b20041049421c1a28357065c91c84fd101c8ec78 | [
"MIT"
] | null | null | null | 06.py | rubenhortas/python_challenge | b20041049421c1a28357065c91c84fd101c8ec78 | [
"MIT"
] | null | null | null | 06.py | rubenhortas/python_challenge | b20041049421c1a28357065c91c84fd101c8ec78 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# http://www.pythonchallenge.com/pc/def/channel.html
import signal
from zipfile import ZipFile
from handlers.python import exit_signal_handler
# noinspection PyShadowingNames
def get_next_file(i, zf, file_name, result):
is_last = True
try:
file_words = zf.read(file_name).split()
... | 24.55814 | 82 | 0.619318 |
3db5e61fa632d4320d721f38280d0d25c0d620fb | 15,754 | py | Python | src/cryptoadvance/specter/rpc.py | bigspider/specter-desktop | b7b4e00966b3f08aa074cb3ea7ae051aa70e54da | [
"MIT"
] | null | null | null | src/cryptoadvance/specter/rpc.py | bigspider/specter-desktop | b7b4e00966b3f08aa074cb3ea7ae051aa70e54da | [
"MIT"
] | null | null | null | src/cryptoadvance/specter/rpc.py | bigspider/specter-desktop | b7b4e00966b3f08aa074cb3ea7ae051aa70e54da | [
"MIT"
] | null | null | null | import logging
import requests, urllib3, json, os
import os, sys, errno
from .helpers import is_ip_private
from .specter_error import SpecterError
logger = logging.getLogger(__name__)
# TODO: redefine __dir__ and help
RPC_PORTS = {
"testnet": 18332,
"test": 18332,
"regtest": 18443,
"main": 8332,
... | 34.39738 | 104 | 0.551987 |
8a06ae7a6b396164dc761b86dedbe0b16f2507bb | 4,596 | py | Python | sdk/python/pulumi_aws_native/servicecatalog/get_portfolio.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/servicecatalog/get_portfolio.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/servicecatalog/get_portfolio.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # 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
from... | 36.768 | 147 | 0.676675 |
2c127195ce9a512ef7725eb58cdc39d1ace8b61b | 1,421 | py | Python | utilities.py | CAltamirano98/OON | 936b001446c41fadadd44f8e3ef0b16c7770b992 | [
"BSD-3-Clause"
] | null | null | null | utilities.py | CAltamirano98/OON | 936b001446c41fadadd44f8e3ef0b16c7770b992 | [
"BSD-3-Clause"
] | null | null | null | utilities.py | CAltamirano98/OON | 936b001446c41fadadd44f8e3ef0b16c7770b992 | [
"BSD-3-Clause"
] | null | null | null | import json
from pathlib import Path
from gnpy.core.utils import merge_amplifier_restrictions
from gnpy.core.equipment import equipment_from_json
def _load_equipment(path):
with open(path, 'r') as file:
eqp_dict = json.load(file)
eqp = equipment_from_json(eqp_dict, path)
return eqp, ... | 37.394737 | 121 | 0.715693 |
cb4f27961e0e066c6b9dcb79b18f770473627e2b | 3,127 | py | Python | src/decoders/common/doc/conf.py | novatel/novatel_edie | d212681f1952704e50e9c8977891dd024c3338ae | [
"MIT"
] | 3 | 2021-05-04T21:14:18.000Z | 2021-07-23T17:19:54.000Z | src/decoders/common/doc/conf.py | novatel/novatel_edie | d212681f1952704e50e9c8977891dd024c3338ae | [
"MIT"
] | 1 | 2022-03-07T18:04:18.000Z | 2022-03-07T18:04:18.000Z | src/decoders/jsoninterface/doc/conf.py | novatel/novatel_edie | d212681f1952704e50e9c8977891dd024c3338ae | [
"MIT"
] | 2 | 2021-05-04T21:18:25.000Z | 2021-06-24T08:51:43.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 --------------------------------------------------------------
... | 34.744444 | 80 | 0.636073 |
0927f5dd2d951b9603a780a0da7ac9480739ed42 | 3,366 | py | Python | assignment2/PlannerVerifyOutput.py | cybershiptrooper/CS747-assignments | 5b4b2bce8321b8fc48e578615034bb16df3ca88e | [
"MIT"
] | null | null | null | assignment2/PlannerVerifyOutput.py | cybershiptrooper/CS747-assignments | 5b4b2bce8321b8fc48e578615034bb16df3ca88e | [
"MIT"
] | null | null | null | assignment2/PlannerVerifyOutput.py | cybershiptrooper/CS747-assignments | 5b4b2bce8321b8fc48e578615034bb16df3ca88e | [
"MIT"
] | null | null | null | #! /usr/bin/python
import random,argparse,sys,subprocess,os
parser = argparse.ArgumentParser()
import numpy as np
random.seed(0)
import time
input_file_ls = ['data/mdp/continuing-mdp-10-5.txt','data/mdp/continuing-mdp-2-2.txt','data/mdp/continuing-mdp-50-20.txt','data/mdp/episodic-mdp-10-5.txt','data/mdp/episodic-mdp-2... | 36.989011 | 221 | 0.545752 |
853534305a584942cced1d035893b4bed8d9a296 | 4,687 | py | Python | app/models.py | QIBET/Pitch-Ground | 77955bbb353ba630bfcc95c0338aaf905bacba22 | [
"MIT"
] | null | null | null | app/models.py | QIBET/Pitch-Ground | 77955bbb353ba630bfcc95c0338aaf905bacba22 | [
"MIT"
] | null | null | null | app/models.py | QIBET/Pitch-Ground | 77955bbb353ba630bfcc95c0338aaf905bacba22 | [
"MIT"
] | null | null | null | from werkzeug.security import generate_password_hash,check_password_hash
from . import db
from flask_login import UserMixin
from . import login_manager
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(UserMixin,db.Model):
'''
... | 29.29375 | 82 | 0.672072 |
9f0d5eec5f4dd33d8a437e587e9dc0a69af9a4fa | 1,296 | py | Python | qmla/exploration_strategies/nv_centre_spin_characterisation/nature_physics_2021/varying_true_model.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | qmla/exploration_strategies/nv_centre_spin_characterisation/nature_physics_2021/varying_true_model.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | qmla/exploration_strategies/nv_centre_spin_characterisation/nature_physics_2021/varying_true_model.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import sys
import os
import random
import qmla.construct_models
from qmla.exploration_strategies.nv_centre_spin_characterisation.nature_physics_2021 import FullAccessNVCentre, TieredGreedySearchNVCentre
__all__ = [
'VariableTrueModelNVCentre'
]
class VariableTrueModelNVCent... | 27 | 138 | 0.614969 |
651fc5da617a48670a91eae7243b205f2bccd2c7 | 10,614 | py | Python | bin/run_pyfeat.py | meyresearch/py_fe_estimators | 66302b36a9abe7d9b0afdde00e4c08ce325a7ff6 | [
"Unlicense"
] | 1 | 2020-10-09T15:04:18.000Z | 2020-10-09T15:04:18.000Z | bin/run_pyfeat.py | meyresearch/py_fe_estimators | 66302b36a9abe7d9b0afdde00e4c08ce325a7ff6 | [
"Unlicense"
] | null | null | null | bin/run_pyfeat.py | meyresearch/py_fe_estimators | 66302b36a9abe7d9b0afdde00e4c08ce325a7ff6 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
####################################################################################################
# #
# RUN SCRIPT FOR THE ALL ESTIMATORS IN THE PYFEATPACKAGE ... | 38.31769 | 137 | 0.39561 |
bf5fcad44c7ec6c7f00a2b4c20155dc21d6aba40 | 456 | py | Python | data/scripts/templates/object/tangible/furniture/base/shared_furniture_base.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/furniture/base/shared_furniture_base.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/furniture/base/shared_furniture_base.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/base/shared_furniture_base.iff"
result.attribute_template... | 26.823529 | 77 | 0.732456 |
8a23acf33370f9fbd9c5d10d9dcddce0dbb5ecac | 1,513 | py | Python | tests/backends/ros/messages/test_std_msgs.py | tetov/compas_fab | cec6b31a97b33b721425bb1821f70b7c15638a0d | [
"MIT"
] | null | null | null | tests/backends/ros/messages/test_std_msgs.py | tetov/compas_fab | cec6b31a97b33b721425bb1821f70b7c15638a0d | [
"MIT"
] | null | null | null | tests/backends/ros/messages/test_std_msgs.py | tetov/compas_fab | cec6b31a97b33b721425bb1821f70b7c15638a0d | [
"MIT"
] | null | null | null | from compas_fab.backends.ros.messages import ROSmsg
from compas_fab.backends.ros.messages import Header
from compas_fab.backends.ros.messages import Time
from compas_fab.backends.ros.messages import Float32MultiArray
from compas_fab.backends.ros.messages import Int8MultiArray
from compas_fab.backends.ros.messages impor... | 36.02381 | 220 | 0.689359 |
6d17d4a142d4bd0e95f41591d5c05d09807f97fd | 1,675 | py | Python | src/postings/api/views.py | zhuguangjun2002/REST-API-Basics-JWT | 53a68ac4219d8666a3bdb6065747a6af9950d5a5 | [
"MIT"
] | 206 | 2017-12-19T22:15:04.000Z | 2022-03-16T19:12:40.000Z | src/postings/api/views.py | zhuguangjun2002/REST-API-Basics-JWT | 53a68ac4219d8666a3bdb6065747a6af9950d5a5 | [
"MIT"
] | 8 | 2020-03-24T17:06:30.000Z | 2022-01-13T01:16:34.000Z | postings/api/views.py | TeddyTeddy/REST-API-Basics | c644ba054821206a5e4603dccdf35eba8a77189f | [
"MIT"
] | 132 | 2017-12-20T18:40:29.000Z | 2022-01-04T12:05:23.000Z | # generic
from django.db.models import Q
from rest_framework import generics, mixins
from postings.models import BlogPost
from .permissions import IsOwnerOrReadOnly
from .serializers import BlogPostSerializer
class BlogPostAPIView(mixins.CreateModelMixin, generics.ListAPIView): # DetailView CreateView FormView
... | 32.843137 | 102 | 0.638209 |
e36021def1465a0d1cb8cc0ca70788f7a9a92a91 | 230 | py | Python | Gmail-Bruteforce/Core/iControl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Gmail-Bruteforce/Core/iControl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Gmail-Bruteforce/Core/iControl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | def CheckTheInternet(url='https://www.google.com/', timeout=3):
import requests
try:
r = requests.head(url, timeout=timeout)
return True
except requests.ConnectionError as ex:
return False | 32.857143 | 64 | 0.643478 |
de7aa19d933ef6e534dd86b811a75baebaae5260 | 3,876 | py | Python | kgextension/feature_selection_sklearn.py | gabrielmacedoanac/kgextension | 0551ca278bc3de5c39baf663467be3220ad20edd | [
"MIT"
] | 67 | 2021-01-17T20:12:44.000Z | 2022-03-07T06:57:01.000Z | kgextension/feature_selection_sklearn.py | gabrielmacedoanac/kgextension | 0551ca278bc3de5c39baf663467be3220ad20edd | [
"MIT"
] | null | null | null | kgextension/feature_selection_sklearn.py | gabrielmacedoanac/kgextension | 0551ca278bc3de5c39baf663467be3220ad20edd | [
"MIT"
] | 3 | 2021-04-17T09:19:31.000Z | 2021-10-03T21:29:56.000Z | import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from kgextension.endpoints import DBpedia
from kgextension.feature_selection import (greedy_top_down_filter,
hierarchy_based_filter,
hill... | 36.224299 | 124 | 0.635449 |
112b4a169fe5c110a3b230e691a3d20c75de1532 | 10,481 | py | Python | projet10/api/tests/test_issues.py | S0Imyr/projet-10 | afb3c036ec6d830bdae0f0a98d1718b2a854c5fe | [
"MIT"
] | 1 | 2021-09-03T10:37:10.000Z | 2021-09-03T10:37:10.000Z | projet10/api/tests/test_issues.py | S0Imyr/projet-10 | afb3c036ec6d830bdae0f0a98d1718b2a854c5fe | [
"MIT"
] | null | null | null | projet10/api/tests/test_issues.py | S0Imyr/projet-10 | afb3c036ec6d830bdae0f0a98d1718b2a854c5fe | [
"MIT"
] | null | null | null | from django.urls.base import reverse
from rest_framework import status
from rest_framework.test import APIClient
from rest_framework.test import APITestCase
from rest_framework_simplejwt.tokens import RefreshToken
from authentication.models import User
from api.models import Project, Contributor, Issue, Comment,\
... | 49.672986 | 105 | 0.670738 |
83b7b310c801dfd84c2eb77cc0827dcc8b3bba9a | 1,448 | py | Python | DynamicProgramming/Medium/largest_sub_seq_inc.py | dsrao711/DSA-101-HacktoberFest | 0d04e2aecee224080c34146e327ff6de15d9ba16 | [
"MIT"
] | 16 | 2021-10-02T20:10:51.000Z | 2022-03-06T10:31:11.000Z | DynamicProgramming/Medium/largest_sub_seq_inc.py | dsrao711/DSA-101-HacktoberFest | 0d04e2aecee224080c34146e327ff6de15d9ba16 | [
"MIT"
] | 55 | 2021-10-02T07:31:41.000Z | 2021-10-30T06:19:26.000Z | DynamicProgramming/Medium/largest_sub_seq_inc.py | dsrao711/DSA-101-HacktoberFest | 0d04e2aecee224080c34146e327ff6de15d9ba16 | [
"MIT"
] | 36 | 2021-10-02T18:00:08.000Z | 2022-01-03T18:50:35.000Z | #https://leetcode.com/problems/longest-increasing-subsequence/
#https://www.youtube.com/watch?v=odrfUCS9sQk
class Solution(object):
def lengthOfLIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
n = len(nums)
dp = [0]*n
# for first ele , longest sub s... | 38.105263 | 104 | 0.524171 |
97d726072d50e19a977772483bb04d20a34e85c4 | 15,473 | py | Python | tuw_dynamixel_iwos_steering_controller/src/tuw_dynamixel_iwos_steering_controller/robotis/connection_handler.py | kaltenegger/tuw_dynamixel | 8f239b924490b2d403c89431aaa0699dd533f58d | [
"BSD-3-Clause"
] | null | null | null | tuw_dynamixel_iwos_steering_controller/src/tuw_dynamixel_iwos_steering_controller/robotis/connection_handler.py | kaltenegger/tuw_dynamixel | 8f239b924490b2d403c89431aaa0699dd533f58d | [
"BSD-3-Clause"
] | null | null | null | tuw_dynamixel_iwos_steering_controller/src/tuw_dynamixel_iwos_steering_controller/robotis/connection_handler.py | kaltenegger/tuw_dynamixel | 8f239b924490b2d403c89431aaa0699dd533f58d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from dynamixel_sdk import PacketHandler, PortHandler, DXL_HIBYTE, DXL_HIWORD, DXL_LOBYTE, DXL_LOWORD, DXL_MAKEDWORD, \
DXL_MAKEWORD, COMM_SUCCESS
from tuw_dynamixel_iwos_steering_controller.exception.invalid_data_exception import *
from tuw_dynamixel_iwos_steering_controller.robotis.robotis... | 51.749164 | 118 | 0.623926 |
99b8d573463b35d5d61ce05aadc553e07aadc157 | 1,182 | py | Python | hierarchical_auth/admin.py | digitalemagine/django-hierarchical-auth | f7523038db62e49e5a460b602ec6b7713aafb511 | [
"BSD-3-Clause"
] | 1 | 2016-03-28T23:37:14.000Z | 2016-03-28T23:37:14.000Z | hierarchical_auth/admin.py | digitalemagine/django-hierarchical-auth | f7523038db62e49e5a460b602ec6b7713aafb511 | [
"BSD-3-Clause"
] | 1 | 2020-01-21T07:59:21.000Z | 2021-03-31T18:03:05.000Z | hierarchical_auth/admin.py | digitalemagine/django-hierarchical-auth | f7523038db62e49e5a460b602ec6b7713aafb511 | [
"BSD-3-Clause"
] | 1 | 2015-08-27T15:08:41.000Z | 2015-08-27T15:08:41.000Z | from django.contrib import admin
from django.conf import settings
from django.db.models import get_model
from models import Group, User # this takes care of custom users Etc.
from django.contrib.auth.admin import GroupAdmin
try:
module_name, class_name = settings.AUTH_USER_ADMIN_CLASS.rsplit('.', 1)
mod = __... | 30.307692 | 75 | 0.790186 |
31083d0d370449625c2110017b93ec8efad8b9b9 | 1,368 | py | Python | LABORATORIO 10/Laboratorio 10.py | msolivera/Phyton | 1322fa2ff4bb06a17350fefa7e5268c0969e5b53 | [
"bzip2-1.0.6"
] | null | null | null | LABORATORIO 10/Laboratorio 10.py | msolivera/Phyton | 1322fa2ff4bb06a17350fefa7e5268c0969e5b53 | [
"bzip2-1.0.6"
] | null | null | null | LABORATORIO 10/Laboratorio 10.py | msolivera/Phyton | 1322fa2ff4bb06a17350fefa7e5268c0969e5b53 | [
"bzip2-1.0.6"
] | null | null | null | #LABORATORIO 10
#EJERCICIO 1:
def parametro (num):
return[x for x in range (num) if x%2==0]
#print(parametro(10))
#EJERCICIO 2:
def ejercicio():
return[(x+1)*(x-1) for x in range (1,1000) if (x+1)*(x-1)<1000]
#print(ejercicio())
#EJERCICIO 3:
def transformacion(cadena):
return[ "".join(c.upper... | 24 | 173 | 0.633772 |
1d3e7630ee1927cf981e50ce4c94e9078265f7b6 | 1,151 | py | Python | array/reverse_array_inplace.py | x899/algorithms | 38a5de72db14ef2664489da9857b598d24c4e276 | [
"MIT"
] | 472 | 2018-05-25T06:45:44.000Z | 2020-01-06T15:46:09.000Z | array/reverse_array_inplace.py | priyankchheda/algorithms | c435acc3e7a067de534372f8f7156f8fcf6e04ab | [
"MIT"
] | 6 | 2020-01-25T22:22:44.000Z | 2021-06-01T04:53:25.000Z | array/reverse_array_inplace.py | x899/algorithms | 38a5de72db14ef2664489da9857b598d24c4e276 | [
"MIT"
] | 44 | 2019-03-02T07:38:38.000Z | 2020-01-01T16:05:06.000Z | """ The problem is that we want to reverse a T[] array in O(N) linear
time complexity and we want the algorithm to be in-place as well!
For example: input is [1,2,3,4,5] then the output is [5,4,3,2,1]
"""
def iterative_reverse(arr):
""" reverse a list using iterative approach """
start = 0
end = l... | 25.021739 | 69 | 0.575152 |
97897e798e93c9e105f9facfb99e735b4d1a5ae2 | 3,475 | py | Python | 实例学习Numpy与Matplotlib/双y轴曲线.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | 95 | 2020-10-11T04:45:46.000Z | 2022-02-25T01:50:40.000Z | 实例学习Numpy与Matplotlib/双y轴曲线.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | null | null | null | 实例学习Numpy与Matplotlib/双y轴曲线.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | 30 | 2020-11-05T09:01:00.000Z | 2022-03-08T05:58:55.000Z | # 双y轴曲线图例合并是一个棘手的操作,现以MNIST案例中loss/accuracy绘制曲线。
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import time
import matplotlib.pyplot as plt
import numpy as np
x_data = tf.compat.v1.placeholder(tf.float32, [None, 784])
y_data = tf.compat.v1.placeholder(tf.float32, [None, 10])
x_image... | 39.942529 | 112 | 0.702158 |
5b33fdf1ce59759f15bc0d7c71c0f5db37b7d8e1 | 45 | py | Python | initial_setup/reset_db.py | flexbox-nicaragua/flexbox-code | a55eba438624a0b8f048a2c48d56ad7165bb6f84 | [
"MIT"
] | null | null | null | initial_setup/reset_db.py | flexbox-nicaragua/flexbox-code | a55eba438624a0b8f048a2c48d56ad7165bb6f84 | [
"MIT"
] | null | null | null | initial_setup/reset_db.py | flexbox-nicaragua/flexbox-code | a55eba438624a0b8f048a2c48d56ad7165bb6f84 | [
"MIT"
] | null | null | null | from flexbox import psql
psql.setup_schema() | 15 | 24 | 0.822222 |
ddc1ab2e9452d83460f9132d4ea5a113b04a920b | 750 | py | Python | functorch/compile/__init__.py | LaudateCorpus1/functorch | b07eea9d29fb44f0a9be3c35c042b3f6124bfcf2 | [
"BSD-3-Clause"
] | null | null | null | functorch/compile/__init__.py | LaudateCorpus1/functorch | b07eea9d29fb44f0a9be3c35c042b3f6124bfcf2 | [
"BSD-3-Clause"
] | null | null | null | functorch/compile/__init__.py | LaudateCorpus1/functorch | b07eea9d29fb44f0a9be3c35c042b3f6124bfcf2 | [
"BSD-3-Clause"
] | null | null | null | from .._src.operator_authoring import pointwise_operator
from .._src.python_key import pythonkey_decompose, pythonkey_meta
from .._src.decompositions import register_decomposition, decomposition_table
from .._src.fx_minifier import minimizer, check_nvfuser_subprocess
from .._src.aot_autograd import (
aot_function,
... | 25.862069 | 77 | 0.772 |
9210c529233c35d22c780855fbf4f599c79b8169 | 5,805 | py | Python | mergify_engine/actions/review.py | nafg/mergify-engine | 7fac6f561a0cd3481a89f2aa19cd8d4d0e39d7e8 | [
"Apache-2.0"
] | null | null | null | mergify_engine/actions/review.py | nafg/mergify-engine | 7fac6f561a0cd3481a89f2aa19cd8d4d0e39d7e8 | [
"Apache-2.0"
] | null | null | null | mergify_engine/actions/review.py | nafg/mergify-engine | 7fac6f561a0cd3481a89f2aa19cd8d4d0e39d7e8 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2019—2020 Mergify SAS
#
# 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 app... | 36.28125 | 95 | 0.582601 |
9a96746aac5682558c0cca2f4b939e7dcc2b3909 | 357 | py | Python | CodingBat/Python/List-2/count_even.py | unobatbayar/codingbat | 085c86f8f2f043cc020ba0f5fcc364d3f03de9e6 | [
"MIT"
] | 2 | 2018-10-28T16:56:20.000Z | 2019-05-17T19:13:21.000Z | CodingBat/Python/List-2/count_even.py | unobatbayar/CodingBat | 94044b6150df8ce7a4fbe42a47b168fbf2fede61 | [
"MIT"
] | 2 | 2022-02-22T04:23:15.000Z | 2022-03-31T06:55:56.000Z | CodingBat/Python/List-2/count_even.py | unobatbayar/CodingBat | 94044b6150df8ce7a4fbe42a47b168fbf2fede61 | [
"MIT"
] | null | null | null | """
Return the number of even ints in the given array. Note: the % "mod" operator computes the remainder, e.g. 5 % 2 is 1.
count_evens([2, 1, 2, 3, 4]) → 3
count_evens([2, 2, 0]) → 3
count_evens([1, 3, 5]) → 0
@author unobatbayar
"""
def count_evens(nums):
counter = 0;
for num in nums:
if num%2 == 0:
c... | 18.789474 | 118 | 0.602241 |
2922bc57348c88ec23710a014aa342132b3d4a5e | 1,096 | py | Python | experiments/pixelcopter_convq.py | Gerryflap/RL_project_common | 7663a84371ee49668eb667f8f73a46d0262425ab | [
"MIT"
] | 5 | 2018-08-07T13:01:55.000Z | 2020-10-10T05:16:06.000Z | experiments/pixelcopter_convq.py | Gerryflap/RL_project_common | 7663a84371ee49668eb667f8f73a46d0262425ab | [
"MIT"
] | 1 | 2020-07-16T06:30:52.000Z | 2020-07-16T06:30:52.000Z | experiments/pixelcopter_convq.py | Gerryflap/RL_project_common | 7663a84371ee49668eb667f8f73a46d0262425ab | [
"MIT"
] | 1 | 2019-06-07T02:16:44.000Z | 2019-06-07T02:16:44.000Z | if __name__ == '__main__':
import keras as ks
import numpy as np
from agents.deep_q import DeepQLearning
from environments.pixelcopter import VisualPixelCopter
from q_network import QNetwork
width, height = size = (32, 32)
env = VisualPixelCopter(size)
actions = env.valid_actions()
... | 31.314286 | 107 | 0.665146 |
f354db1f2e912c07086e79effcc138d05bcaa556 | 2,582 | py | Python | examples/singletask/train.py | DrSleep/DenseTorch | f90bef075429d763fc08338dea8222d28b0a4516 | [
"MIT"
] | 69 | 2019-05-04T04:37:28.000Z | 2021-12-25T13:41:04.000Z | examples/singletask/train.py | DrSleep/DenseTorch | f90bef075429d763fc08338dea8222d28b0a4516 | [
"MIT"
] | 13 | 2019-09-28T06:19:00.000Z | 2021-03-06T15:21:22.000Z | examples/singletask/train.py | DrSleep/DenseTorch | f90bef075429d763fc08338dea8222d28b0a4516 | [
"MIT"
] | 9 | 2019-07-03T07:03:30.000Z | 2021-07-16T02:05:42.000Z | import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
import densetorch as dt
from config import *
# model_options
## encoder
pretrained = True
return_idx = [1, 20]
config = 8 # output stride 8
# set seeds
dt.misc.set_seed(seed)
# ... | 28.373626 | 87 | 0.699458 |
dc1c4637e1abec9ae7c71624df928a6cf9234f7f | 1,945 | py | Python | lc/linked.py | afbarnard/glowing-broccoli | 1d5a84ac0844f1bf912adfdf4910c9446168933f | [
"MIT"
] | null | null | null | lc/linked.py | afbarnard/glowing-broccoli | 1d5a84ac0844f1bf912adfdf4910c9446168933f | [
"MIT"
] | null | null | null | lc/linked.py | afbarnard/glowing-broccoli | 1d5a84ac0844f1bf912adfdf4910c9446168933f | [
"MIT"
] | null | null | null | # Classes for programming practice with linked lists
import unittest
class Node:
def __init__(self, item, next=None):
self.item = item
self.next = next
@property
def val(self):
return self.item
@val.setter
def val(self, value):
self.item = value
def __repr... | 21.611111 | 59 | 0.515167 |
df6c08edcd161169ee7483fbfd9bb9bd5df240f1 | 463 | py | Python | python/code/preprocess.py | hsuyeemon/Sentiment-Analysis-of-microblogs | ab3e1f8e7788ec2b0e194679c167ad0dfd3f04d6 | [
"Apache-2.0"
] | 1 | 2021-05-10T15:50:45.000Z | 2021-05-10T15:50:45.000Z | python/code/preprocess.py | hsuyeemon/Sentiment-Analysis-of-microblogs | ab3e1f8e7788ec2b0e194679c167ad0dfd3f04d6 | [
"Apache-2.0"
] | null | null | null | python/code/preprocess.py | hsuyeemon/Sentiment-Analysis-of-microblogs | ab3e1f8e7788ec2b0e194679c167ad0dfd3f04d6 | [
"Apache-2.0"
] | null | null | null | print("please enter the original file name")
filename = input()
print(filename)
f = open('../data/input/'+filename,"r")
lines = f.readlines()
f.close()
#print(lines)
arr= []
for i in range ( len(lines) ):
arr.append(lines[i].split('\t'))
#print(len(lines))
filename = filename[:-4]
file = open('../data/ou... | 15.965517 | 58 | 0.604752 |
8545869398410aeac81d6885e0b85142fc4bd6b1 | 170 | py | Python | tests/variantstudy/test_variant_command_extractor.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 2 | 2020-09-30T11:40:22.000Z | 2020-11-09T09:06:30.000Z | tests/variantstudy/test_variant_command_extractor.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 542 | 2021-01-11T13:23:47.000Z | 2022-03-31T15:38:10.000Z | tests/variantstudy/test_variant_command_extractor.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 1 | 2020-10-01T12:18:15.000Z | 2020-10-01T12:18:15.000Z | def test_extract():
# Already covered by integration test "test_integration_variantmanager_tool"
pass
def test_diff():
# TODO test diff generation
pass
| 18.888889 | 80 | 0.729412 |
1c842cfc4dac9e5375995f1dbbcde73b10e26470 | 213 | py | Python | 607-Fargate-Task-With-Event/cdk-AWS-Cookbook-607/app.py | AWSCookbook/Containers | 896b660962d323245b9dfa7b0d9fea84aab4c8da | [
"MIT"
] | 13 | 2021-03-08T10:11:59.000Z | 2022-03-31T16:40:12.000Z | 607-Fargate-Task-With-Event/cdk-AWS-Cookbook-607/app.py | AWSCookbook/Containers | 896b660962d323245b9dfa7b0d9fea84aab4c8da | [
"MIT"
] | null | null | null | 607-Fargate-Task-With-Event/cdk-AWS-Cookbook-607/app.py | AWSCookbook/Containers | 896b660962d323245b9dfa7b0d9fea84aab4c8da | [
"MIT"
] | 3 | 2021-09-23T12:00:55.000Z | 2022-02-25T06:50:52.000Z | #!/usr/bin/env python3
import aws_cdk as cdk
from cdk_aws_cookbook_607.cdk_aws_cookbook_607_stack import CdkAwsCookbook607Stack
app = cdk.App()
CdkAwsCookbook607Stack(app, "cdk-aws-cookbook-607")
app.synth()
| 17.75 | 82 | 0.802817 |
b6942a819897ef25d74d20dda6c720dd65e59c69 | 1,896 | py | Python | tools/wait_for_pods.py | jonathanelbailey/kolla-kubernetes | 83cd360438ceb5ff4a5951ef62f7ef8dad6ceb00 | [
"Apache-2.0"
] | null | null | null | tools/wait_for_pods.py | jonathanelbailey/kolla-kubernetes | 83cd360438ceb5ff4a5951ef62f7ef8dad6ceb00 | [
"Apache-2.0"
] | null | null | null | tools/wait_for_pods.py | jonathanelbailey/kolla-kubernetes | 83cd360438ceb5ff4a5951ef62f7ef8dad6ceb00 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# 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, software
... | 30.580645 | 74 | 0.669831 |
b4c4ae4383666ece26b9a3d37afe40e99fe1db16 | 2,732 | py | Python | Space invaders.py | AKSHIT-BADYAL/Space-invaders | d091b48cce8d296919848c69b140d03a8b972d87 | [
"MIT"
] | null | null | null | Space invaders.py | AKSHIT-BADYAL/Space-invaders | d091b48cce8d296919848c69b140d03a8b972d87 | [
"MIT"
] | null | null | null | Space invaders.py | AKSHIT-BADYAL/Space-invaders | d091b48cce8d296919848c69b140d03a8b972d87 | [
"MIT"
] | null | null | null | import pygame# using pygame module
import os# using os(opersting system module)
import time #using time module
import random # using random module
# adding font
pygame.font.init()
# def.display window
width,height=600,600
main_window=pygame.display.set_mode((width,height))
# naming the title or caption of the ... | 46.305085 | 162 | 0.694729 |
23327de9b1b83aaee76b1d446097a2fd880d71ba | 1,598 | py | Python | legacy/flask_plot.py | FreddyWordingham/arctk | 05842d8a5842653179acaaf2a7de843ed9293b82 | [
"MIT"
] | 12 | 2020-08-17T01:59:33.000Z | 2021-07-05T13:57:29.000Z | legacy/flask_plot.py | FreddyWordingham/arctk | 05842d8a5842653179acaaf2a7de843ed9293b82 | [
"MIT"
] | null | null | null | legacy/flask_plot.py | FreddyWordingham/arctk | 05842d8a5842653179acaaf2a7de843ed9293b82 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import pandas
import matplotlib.pyplot as plt
import sys
def quit_figure(event):
if event.key == 'escape':
plt.close(event.canvas.figure)
cid = plt.gcf().canvas.mpl_connect('key_press_event', quit_figure)
# Settings
TITLE_LABEL = "Concentrations vs Time"
X_AXIS_LABEL = "Time (s)... | 19.975 | 66 | 0.518773 |
045035ba4b05f9e0f7150c39e2209b2445ff84ee | 1,245 | py | Python | openspeech/models/lstm_lm/__init__.py | techthiyanes/openspeech | 71d28bae1232420da1d6f357f52ff1a607dc983f | [
"Apache-2.0",
"MIT"
] | 207 | 2021-07-22T02:04:47.000Z | 2022-03-31T07:24:12.000Z | openspeech/models/lstm_lm/__init__.py | tqslj2/openspeech | 10307587f08615224df5a868fb5249c68c70b12d | [
"Apache-2.0",
"MIT"
] | 81 | 2021-07-21T16:52:22.000Z | 2022-03-31T14:56:54.000Z | openspeech/models/lstm_lm/__init__.py | tqslj2/openspeech | 10307587f08615224df5a868fb5249c68c70b12d | [
"Apache-2.0",
"MIT"
] | 43 | 2021-07-21T16:33:27.000Z | 2022-03-23T09:43:49.000Z | # MIT License
#
# Copyright (c) 2021 Soohwan Kim and Sangchun Ha and Soyoung Cho
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... | 42.931034 | 80 | 0.775904 |
99c234f05f5e70ddcfab093ecaf4c4692a3e607e | 23,214 | py | Python | scripts/PrintGaps.py | mrvollger/SDA | eba7d36d0cadf9eba42053b7d2a3371247eebe1b | [
"MIT"
] | 21 | 2019-11-11T10:09:47.000Z | 2022-03-28T01:22:12.000Z | scripts/PrintGaps.py | mrvollger/SDA | eba7d36d0cadf9eba42053b7d2a3371247eebe1b | [
"MIT"
] | 12 | 2019-11-04T23:30:25.000Z | 2021-12-04T12:49:26.000Z | scripts/PrintGaps.py | mrvollger/SDA | eba7d36d0cadf9eba42053b7d2a3371247eebe1b | [
"MIT"
] | 4 | 2019-11-15T09:52:24.000Z | 2021-04-07T16:42:54.000Z | #!/usr/bin/env python
import sys
import argparse
import Tools
import Align
import pdb
from Bio import SeqIO
ap = argparse.ArgumentParser(description="Print gaps in a SAM file.")
ap.add_argument("genome", help="Genome file with a .fai")
ap.add_argument("sam", help="Sam file of alignment.")
ap.add_argument("--onTarge... | 41.602151 | 199 | 0.487421 |
4186600f3615ef617d86c9b9345efd1d7071cf90 | 3,098 | py | Python | python/ray/tune/tests/test_result_grid.py | shrekris-anyscale/ray | d36fd77548e1d83d6510b478f72ac668434458af | [
"Apache-2.0"
] | null | null | null | python/ray/tune/tests/test_result_grid.py | shrekris-anyscale/ray | d36fd77548e1d83d6510b478f72ac668434458af | [
"Apache-2.0"
] | 41 | 2021-09-21T01:13:48.000Z | 2022-03-19T07:12:22.000Z | python/ray/tune/tests/test_result_grid.py | shrekris-anyscale/ray | d36fd77548e1d83d6510b478f72ac668434458af | [
"Apache-2.0"
] | null | null | null | import json
import os
import pytest
from ray import tune
from ray.air.checkpoint import Checkpoint
from ray.tune.result_grid import ResultGrid
def test_result_grid():
def f(config):
# simulating the case that no report is called in train.
with tune.checkpoint_dir(step=0) as checkpoint_dir:
... | 28.422018 | 82 | 0.65623 |
3484cc2119cb8a0bd1fea244b2597ac8e9d230c4 | 16,134 | py | Python | magenta/models/rl_tuner/rl_tuner_eval_metrics.py | cristianmtr/magenta | ac2d8ae455fdd07f4b46dec82aedab22fcb6bbbd | [
"Apache-2.0"
] | 1 | 2019-01-24T07:22:48.000Z | 2019-01-24T07:22:48.000Z | magenta/models/rl_tuner/rl_tuner_eval_metrics.py | dkun7944/magenta | 8f930263b7cfd67f27eb12cd871b4e5fa87d382e | [
"Apache-2.0"
] | null | null | null | magenta/models/rl_tuner/rl_tuner_eval_metrics.py | dkun7944/magenta | 8f930263b7cfd67f27eb12cd871b4e5fa87d382e | [
"Apache-2.0"
] | 1 | 2019-11-26T06:30:52.000Z | 2019-11-26T06:30:52.000Z | # Copyright 2018 The Magenta 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 ... | 37.175115 | 80 | 0.707264 |
37fd9760c65ee29a0aa318cc27d54a5cbacc044b | 896 | py | Python | config/Database.py | R4stl1n/condex | 9cb8961ead317414dd7d2848859ff88c7333883b | [
"MIT"
] | 8 | 2017-12-21T05:23:39.000Z | 2022-01-18T19:03:35.000Z | config/Database.py | R4stl1n/condex | 9cb8961ead317414dd7d2848859ff88c7333883b | [
"MIT"
] | 30 | 2017-12-19T02:05:49.000Z | 2018-01-09T23:09:37.000Z | config/Database.py | R4stl1n/condex | 9cb8961ead317414dd7d2848859ff88c7333883b | [
"MIT"
] | 6 | 2017-12-18T05:02:52.000Z | 2021-03-07T08:17:35.000Z | from config import CondexConfig
from peewee import *
from playhouse.pool import *
if CondexConfig.USE_DATABASE == 'MYSQL':
# Mysql Database Setup
internal_database = PooledMySQLDatabase(
CondexConfig.MYSQL_DB_NAME,
user= CondexConfig.MYSQL_DB_USER,
passwd= CondexConfig.MYSQL_USER_PASSWORD,
ho... | 32 | 79 | 0.757813 |
850d023655a6819c294cdd1eb2f7da5066181fb4 | 1,378 | py | Python | flair/__init__.py | OatsProduction/flair | d230535909bce5489609a307423449638c4ce773 | [
"MIT"
] | null | null | null | flair/__init__.py | OatsProduction/flair | d230535909bce5489609a307423449638c4ce773 | [
"MIT"
] | 1 | 2022-01-12T07:50:13.000Z | 2022-01-12T10:08:44.000Z | flair/__init__.py | OatsProduction/flair | d230535909bce5489609a307423449638c4ce773 | [
"MIT"
] | null | null | null | import logging.config
import os
from pathlib import Path
import torch
from transformers import set_seed as hf_set_seed
# global variable: cache_root
cache_root = Path(os.getenv("FLAIR_CACHE_ROOT", Path(Path.home(), ".flair")))
# global variable: device
if torch.cuda.is_available():
device = torch.device("cuda:0"... | 20.264706 | 93 | 0.587083 |
33e214c999f88fbe0928e06420117f37f53ee464 | 12,705 | py | Python | example_cases/3D_sphbubcollapse/input.py | ComputationalFlowPhysics/MFC-develop | 901bff8d9e9d7519613cfcacc7a5463ab6295181 | [
"MIT"
] | 3 | 2021-05-20T23:42:47.000Z | 2021-11-17T21:34:14.000Z | example_cases/3D_sphbubcollapse/input.py | ComputationalFlowPhysics/MFC-develop | 901bff8d9e9d7519613cfcacc7a5463ab6295181 | [
"MIT"
] | 28 | 2021-11-02T00:40:40.000Z | 2021-12-06T02:38:57.000Z | example_cases/3D_sphbubcollapse/input.py | ComputationalFlowPhysics/MFC-develop | 901bff8d9e9d7519613cfcacc7a5463ab6295181 | [
"MIT"
] | 9 | 2021-10-02T04:37:25.000Z | 2021-11-23T00:58:11.000Z | #!/usr/bin/env python3
# Dependencies and Logistics ===================================================
# Command to navigate between directories
from os import chdir
# Command to acquire directory path
from os.path import dirname
# Command to acquire script name and module search path
from sys import argv, path
#... | 65.489691 | 92 | 0.271468 |
855c553fd068faa985d2cafc5311ce07d21cc832 | 4,270 | py | Python | make_mixutre.py | annie-gu/MVAE | 252b052d69eae9a0b47f4058baf0fe565992f12f | [
"MIT"
] | 1 | 2022-01-08T03:31:31.000Z | 2022-01-08T03:31:31.000Z | make_mixutre.py | annie-gu/MVAE | 252b052d69eae9a0b47f4058baf0fe565992f12f | [
"MIT"
] | null | null | null | make_mixutre.py | annie-gu/MVAE | 252b052d69eae9a0b47f4058baf0fe565992f12f | [
"MIT"
] | 2 | 2020-06-21T12:55:53.000Z | 2020-11-16T00:56:36.000Z | import argparse
from itertools import combinations, product
import os
import random
import librosa
import numpy as np
import pyroomacoustics as pra
from scipy.io import wavfile
from scipy.signal import convolve
def get_rir(echoic=False):
absorption = 0.2 if echoic else 0.66
room = pra.ShoeBox([6, 5, 3], fs=1... | 36.186441 | 77 | 0.562061 |
12268787c79d5dc3c802e72c24f3c0d765303780 | 11,594 | py | Python | tests/test_operations/test_subset.py | roocs/daops | 44ba697aee2959cce081e2bb4b717c48c771e98a | [
"BSD-3-Clause"
] | 6 | 2020-05-01T11:17:17.000Z | 2022-02-24T22:06:26.000Z | tests/test_operations/test_subset.py | roocs/daops | 44ba697aee2959cce081e2bb4b717c48c771e98a | [
"BSD-3-Clause"
] | 61 | 2020-03-30T13:33:50.000Z | 2022-03-10T09:33:32.000Z | tests/test_operations/test_subset.py | roocs/daops | 44ba697aee2959cce081e2bb4b717c48c771e98a | [
"BSD-3-Clause"
] | 2 | 2020-04-02T14:19:21.000Z | 2020-10-26T17:26:16.000Z | import os
import pytest
import xarray as xr
from roocs_utils.exceptions import InvalidParameterValue
from roocs_utils.exceptions import MissingParameterValue
from roocs_utils.parameter import area_parameter
from roocs_utils.parameter import collection_parameter
from roocs_utils.parameter import time_parameter
from roo... | 28.416667 | 101 | 0.640762 |
7ae72e3703455615a4b3d808a74bd03e773b9709 | 73,505 | py | Python | fiddle_extra/parse_am37x_register_tables.py | bx/bootloader_instrumentation_suite | 747e23895e77b09537d85d2d0434f5805365eed3 | [
"MIT"
] | 41 | 2017-05-02T07:57:19.000Z | 2021-08-11T22:55:55.000Z | fiddle_extra/parse_am37x_register_tables.py | bx/bootloader_instrumentation_suite | 747e23895e77b09537d85d2d0434f5805365eed3 | [
"MIT"
] | null | null | null | fiddle_extra/parse_am37x_register_tables.py | bx/bootloader_instrumentation_suite | 747e23895e77b09537d85d2d0434f5805365eed3 | [
"MIT"
] | 7 | 2017-05-05T07:55:07.000Z | 2019-10-16T11:52:00.000Z | #!/usr/bin/env python2
# MIT License
# Copyright (c) 2017 Rebecca ".bx" Shapiro
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 41.064246 | 207 | 0.476417 |
722ee2b9b17dda06ff248c1a202090f0fd494c0b | 363 | py | Python | Prime_number/Prime_triple.py | Zeyecx/CodeSnippet | afeba3d2723760380a4669c09fe50d15b43a8b9e | [
"MIT"
] | null | null | null | Prime_number/Prime_triple.py | Zeyecx/CodeSnippet | afeba3d2723760380a4669c09fe50d15b43a8b9e | [
"MIT"
] | null | null | null | Prime_number/Prime_triple.py | Zeyecx/CodeSnippet | afeba3d2723760380a4669c09fe50d15b43a8b9e | [
"MIT"
] | null | null | null | # Imports
from function import check_is_prime as isprime
import sys
# set max
cap = sys.maxsize
# List of Prime Tuples
for i in range(1, 1000000, 1):
# Architecture 1
if isprime(i) and isprime(i+2) and isprime(i+6):
print((i, i+2, i+6))
# Architecture 2
if isprime(i) and isprime(i+4) and... | 21.352941 | 52 | 0.625344 |
368745159af6b345109577e214e417b4794e15ae | 313 | py | Python | VTK-7.1.1/build/Wrapping/Python/vtk/vtkIONetCDF.py | likewatchk/python-pcl | 2a66797719f1b5af7d6a0d0893f697b3786db461 | [
"BSD-3-Clause"
] | null | null | null | VTK-7.1.1/build/Wrapping/Python/vtk/vtkIONetCDF.py | likewatchk/python-pcl | 2a66797719f1b5af7d6a0d0893f697b3786db461 | [
"BSD-3-Clause"
] | null | null | null | VTK-7.1.1/build/Wrapping/Python/vtk/vtkIONetCDF.py | likewatchk/python-pcl | 2a66797719f1b5af7d6a0d0893f697b3786db461 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
try:
# use relative import for installed modules
from .vtkIONetCDFPython import *
except ImportError:
# during build and testing, the modules will be elsewhere,
# e.g. in lib directory or Release/Debug config directories
from vtkIONetCDFPython import *
| 31.3 | 63 | 0.760383 |
e81661d6e012e3e2306fc8a2d8cc63d8e4ba2030 | 31,985 | py | Python | pyNastran/bdf/cards/elements/beam.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/elements/beam.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | 1 | 2021-06-07T16:33:59.000Z | 2021-06-07T16:33:59.000Z | pyNastran/bdf/cards/elements/beam.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | 1 | 2021-12-17T10:45:08.000Z | 2021-12-17T10:45:08.000Z | # pylint: disable=C0103
"""
defines:
- CBEAM
- BEAMOR
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
from numpy.linalg import norm # type: ignore
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.bdf.cards.elements.bars import (
LineElement, init_... | 34.062833 | 111 | 0.499859 |
6b95e7529bfce45882a60b82681f005f04518b1b | 3,894 | py | Python | bionumpy/parser.py | knutdrand/bionumpy | 2a520ebfce19f346284bd5cf21d6197f6ba801ba | [
"MIT"
] | null | null | null | bionumpy/parser.py | knutdrand/bionumpy | 2a520ebfce19f346284bd5cf21d6197f6ba801ba | [
"MIT"
] | null | null | null | bionumpy/parser.py | knutdrand/bionumpy | 2a520ebfce19f346284bd5cf21d6197f6ba801ba | [
"MIT"
] | 1 | 2022-03-07T21:58:03.000Z | 2022-03-07T21:58:03.000Z | import numpy as np
my_empty = np.empty
import logging
from npstructures import npdataclass
logger = logging.getLogger(__name__)
wrapper = lambda x: x
def repr_bytes(n):
if n < 10 ** 4:
return str(n) + "b"
elif n < 10 ** 7:
return str(n // 1000) + "kb"
elif n < 10 ** 11:
return s... | 31.403226 | 117 | 0.602979 |
35a6838416d7e11b8f42e110f41814cc2c51db10 | 3,655 | py | Python | project/experiments/exp_800_mile_stone/src/common/wrapper_mut.py | liusida/thesis-bodies | dceb8a36efd2cefc611f6749a52b56b9d3572f7a | [
"MIT"
] | null | null | null | project/experiments/exp_800_mile_stone/src/common/wrapper_mut.py | liusida/thesis-bodies | dceb8a36efd2cefc611f6749a52b56b9d3572f7a | [
"MIT"
] | null | null | null | project/experiments/exp_800_mile_stone/src/common/wrapper_mut.py | liusida/thesis-bodies | dceb8a36efd2cefc611f6749a52b56b9d3572f7a | [
"MIT"
] | null | null | null | # Wrappers for 900 mutants, different topology, same dimension
import sys
import gym
import numpy as np
from common import common
from common import gym_interface
from common import colors
class MutantWrapper(gym.ObservationWrapper):
"""Mutants 900, different topology, but same dimension for simplicity."""
d... | 44.036145 | 181 | 0.64186 |
aab1221b6d01149ecffb01a097666a930fc46052 | 847 | py | Python | outputs.py | degree-analytics/meraki-receiver | cde6ef3b5ddb6a421c2075dd84b8c6b793ce6f37 | [
"MIT"
] | 3 | 2019-05-17T09:04:37.000Z | 2020-08-18T16:04:33.000Z | outputs.py | degree-analytics/meraki-receiver | cde6ef3b5ddb6a421c2075dd84b8c6b793ce6f37 | [
"MIT"
] | null | null | null | outputs.py | degree-analytics/meraki-receiver | cde6ef3b5ddb6a421c2075dd84b8c6b793ce6f37 | [
"MIT"
] | null | null | null | from app import get_logger, get_config
import boto3
from utils import chunk_it, jsonify
config = get_config()
my_logger = get_logger()
def to_log_file(data):
if isinstance(data, list):
for i in data:
my_logger.info(i)
else:
my_logger.info(data)
def to_firehose(data):
conn =... | 31.37037 | 146 | 0.676505 |
b9f9a61a68e45a0a7231ab8ec9fe33d85cbe4139 | 490 | py | Python | plotly/validators/layout/yaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/yaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/layout/yaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='color',
parent_name='layout.yaxis.titlefont',
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
... | 25.789474 | 66 | 0.604082 |
1d2c36c80da30a83723de77ffb7d098ce0a29fa5 | 3,210 | py | Python | playbooks/files/update_github_issues.py | Ashughorla/airshipctl | 63b3501a53b238e32f938371728eb830583fda3a | [
"Apache-2.0"
] | 1 | 2020-10-09T14:50:38.000Z | 2020-10-09T14:50:38.000Z | playbooks/files/update_github_issues.py | Ashughorla/airshipctl | 63b3501a53b238e32f938371728eb830583fda3a | [
"Apache-2.0"
] | null | null | null | playbooks/files/update_github_issues.py | Ashughorla/airshipctl | 63b3501a53b238e32f938371728eb830583fda3a | [
"Apache-2.0"
] | 2 | 2020-06-22T08:34:15.000Z | 2020-07-23T10:50:52.000Z | # 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, software
# distributed under th... | 38.214286 | 118 | 0.657944 |
296a28daad18295ee6b13547cc19477bcbfaae5b | 3,815 | py | Python | models.py | SH-96/nuclei-segmentation-pytorch | b9c8a0ad9069dc89c566c41e498b4fa4a2898508 | [
"MIT"
] | null | null | null | models.py | SH-96/nuclei-segmentation-pytorch | b9c8a0ad9069dc89c566c41e498b4fa4a2898508 | [
"MIT"
] | null | null | null | models.py | SH-96/nuclei-segmentation-pytorch | b9c8a0ad9069dc89c566c41e498b4fa4a2898508 | [
"MIT"
] | null | null | null | # Name: Sanjith Hebbar
# Date: 25-07-2020
# Description: Script containing U-net model
"""
U-Net model and U-Net parts borrowed from https://github.com/milesial/Pytorch-UNet/tree/master/unet
"""
# Import Libraries
import torch
import torchvision
import torch.nn.functional as F
from torch import nn
class DoubleConv(nn... | 32.606838 | 122 | 0.610223 |
518a1b090cd5645900d82889a75693973ca78ed0 | 6,390 | py | Python | ven2/lib/python2.7/site-packages/zope/tal/runtest.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | null | null | null | ven2/lib/python2.7/site-packages/zope/tal/runtest.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | null | null | null | ven2/lib/python2.7/site-packages/zope/tal/runtest.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany ... | 36.514286 | 79 | 0.56025 |
fea2de368d93eef68b6a16f55b423b8047cfdf23 | 2,079 | py | Python | tests/utils/test_internalize.py | google/timecast | 11f01d81e240d38ff194df54bbf219e6367f3cf5 | [
"Apache-2.0"
] | 11 | 2020-07-16T15:22:38.000Z | 2021-09-23T01:08:19.000Z | tests/utils/test_internalize.py | google/timecast | 11f01d81e240d38ff194df54bbf219e6367f3cf5 | [
"Apache-2.0"
] | 3 | 2020-08-26T00:26:37.000Z | 2021-01-02T19:29:21.000Z | tests/utils/test_internalize.py | google/timecast | 11f01d81e240d38ff194df54bbf219e6367f3cf5 | [
"Apache-2.0"
] | 1 | 2020-10-13T17:07:10.000Z | 2020-10-13T17:07:10.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.7 | 95 | 0.61039 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.