hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f6d227d30456969e921610e7a2654fd2062131d6 | 882 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/fix_duplicate_icons.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/fix_duplicate_icons.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/fix_duplicate_icons.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from frappe.desk.doctype.desktop_icon.desktop_icon import (sync_desktop_icons,
get_desktop_icons, set_hidden)
from erpnext.patches.v7_0.migrate_schools_to_erpnext import reload_doctypes_for_schools_icons
def execute():
'''hide new style icons if old ones are set'''
frappe.reload_doc('desk', 'doctype'... | 32.666667 | 93 | 0.71542 |
12292ba2508a96b3bdc1975d35205c42fbc3596d | 280 | py | Python | 01.DataStructure/Tree/HG/B9934.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 01.DataStructure/Tree/HG/B9934.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 01.DataStructure/Tree/HG/B9934.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | K = int(input())
buildings = input().split(" ")
tree = []
while K > 0:
result = buildings[::2]
buildings = list(map(lambda x : x[1], filter(lambda x : x[0]%2==1, enumerate(buildings))))
tree.append(result)
K-=1
for level in tree[::-1]:
print(' '.join(level)) | 23.333333 | 94 | 0.578571 |
c3c468719cf9edfc2fe2cf0a18d25ca28b295676 | 781 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/74_map-75_filter-76_reduce/dados.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/74_map-75_filter-76_reduce/dados.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/74_map-75_filter-76_reduce/dados.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | produtos = [
{'nome': 'p1', 'preco': 13},
{'nome': 'p2', 'preco': 55.55},
{'nome': 'p3', 'preco': 5.59},
{'nome': 'p4', 'preco': 22},
{'nome': 'p5', 'preco': 81.23},
{'nome': 'p6', 'preco': 5.7},
{'nome': 'p7', 'preco': 10.90},
{'nome': 'p8', 'preco': 89.82},
{'nome': 'p9', 'preco': ... | 27.892857 | 39 | 0.427657 |
f6340beae65342cbdcd92afadb735757e8f2623b | 13 | py | Python | IVTp/2014/Lyach_A_A/Hi.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Lyach_A_A/Hi.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Lyach_A_A/Hi.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | Print ('Hi')
| 6.5 | 12 | 0.538462 |
f67d1c2d9df7c358701be3e954f1cc1a31ccd25a | 21,871 | py | Python | Shops.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | null | null | null | Shops.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | 5 | 2020-01-18T21:10:46.000Z | 2020-01-25T20:58:19.000Z | Shops.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | 2 | 2020-01-18T17:36:50.000Z | 2020-01-22T16:52:08.000Z | from __future__ import annotations
from enum import unique, Enum
from typing import List, Union, Optional, Set, NamedTuple, Dict
import logging
from BaseClasses import Location
from EntranceShuffle import door_addresses
from Items import item_name_groups, item_table, ItemFactory, trap_replaceable, GetBeemizerItem
from... | 47.034409 | 184 | 0.600978 |
9ca8e58f5e2b3eb93c18319288dde846818420d4 | 1,024 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/manager_account.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/manager_account.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/manager_account.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program 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 2
# of the License, or (at your option) any later version.
# -*- codi... | 27.675676 | 68 | 0.696289 |
2c1f56095eacfa666090070ee05f4caec45315a1 | 4,944 | py | Python | research/recommend/autodis/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/recommend/autodis/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/recommend/autodis/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 44.142857 | 113 | 0.676578 |
6ccdb849f4dd778382a862be3638f63d06d3b11c | 938 | py | Python | marsyas-vamp/marsyas/src/apps/carfac/carfac_binaural_3d.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/apps/carfac/carfac_binaural_3d.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/apps/carfac/carfac_binaural_3d.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import numpy as np
from enthought.mayavi import mlab
import marsyas
import sys
def marsyasplay(sfname):
mng = marsyas.MarSystemManager()
net = mng.create("Series","series")
net.addMarSystem(mng.create("SoundFileSource", "src"))
net.addMarSystem(mng.create("BinauralCARFAC", "carfac"))
net.... | 28.424242 | 102 | 0.708955 |
9f097302d855df5ea2ac4b84f6ea5d58334bd716 | 1,212 | py | Python | statcell_np.py | zgyr/StatCell | 7d5e0b07cda7d2b3ee1587e8e474db5a17ea1e56 | [
"MIT"
] | null | null | null | statcell_np.py | zgyr/StatCell | 7d5e0b07cda7d2b3ee1587e8e474db5a17ea1e56 | [
"MIT"
] | null | null | null | statcell_np.py | zgyr/StatCell | 7d5e0b07cda7d2b3ee1587e8e474db5a17ea1e56 | [
"MIT"
] | null | null | null | import numpy as np
class Cell:
def __init__(self, inputs, size=32):
self.inputs = inputs
self.size = size
self.c_acc = 1
self.s_acc = np.ones(self.inputs)
self.avg = np.zeros(self.inputs)
self.var = np.zeros(self.inputs)
self.weights = np.random.random((self... | 26.933333 | 60 | 0.557756 |
9f6fb70b647902a48abc213043bcf8f33aaf79a7 | 6,499 | py | Python | src/onegov/onboarding/models/town_assistant.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/models/town_assistant.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/models/town_assistant.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
import re
from onegov.core import utils
from onegov.core.crypto import random_password
from onegov.core.templates import render_template
from onegov.onboarding import _
from onegov.onboarding.errors import AlreadyExistsError
from onegov.onboarding.forms import FinishForm, TownForm
from onegov.onboardin... | 35.513661 | 79 | 0.542391 |
9fb49a2f90bc389a4a3ff2af6b2d1370a966a4b0 | 686 | py | Python | algorithms/dynamic_programming/billboards.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/dynamic_programming/billboards.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/dynamic_programming/billboards.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | import sys
if __name__ == '__main__':
N, K = list(map(int, sys.stdin.readline().split()))
profits = [int(sys.stdin.readline()) for i in range(N)]
total = sum(profits)
if K == N:
print(total)
else:
x = profits[: K + 1]
min_value = min(x)
min_index = x.index(min_va... | 23.655172 | 59 | 0.469388 |
2cbcd86974dc6d32a46e8b26503b9973e07c2ccc | 8,278 | py | Python | src/tools/data/ultrawrapper/UltraCurve.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/data/ultrawrapper/UltraCurve.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/data/ultrawrapper/UltraCurve.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import os
from pyparsing import alphas
# ----------------------------------------------------------------------------
# Class: UltraCurveItem
# ----------------------------------------------------------------------------
class UltraCurveItem(object):
""" An ultra curve info object.
Consists of Var, extents... | 31.356061 | 103 | 0.451558 |
644b3e826b1f4e46cee9203e3467e4fac4eb4a70 | 68,563 | py | Python | research/cvtmodel/densenet/src/densenet201.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/densenet/src/densenet201.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/densenet/src/densenet201.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | import mindspore.ops as P
from mindspore import nn
class Module0(nn.Cell):
def __init__(self, batchnorm2d_1_num_features, conv2d_3_in_channels):
super(Module0, self).__init__()
self.concat_0 = P.Concat(axis=1)
self.batchnorm2d_1 = nn.BatchNorm2d(num_features=batchnorm2d_1_num_features,
... | 70.248975 | 120 | 0.702332 |
3779ecc2c554189b85e1e845a33d0d69e57d4169 | 413 | py | Python | rattler/jinja2.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | rattler/jinja2.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | rattler/jinja2.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | '''
Jinja2 engine configurations.
'''
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls import reverse
from jinja2 import Environment
def environment(**options):
''' Sets the environmanet for the jinja2 template engine '''
env = Environment(**options)
env.globals.updat... | 25.8125 | 66 | 0.702179 |
80acd644ebf902fa7e8642a23f16d00ecadd46c1 | 247 | py | Python | jocker/backends/utils.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | 3 | 2017-10-18T08:11:58.000Z | 2019-07-31T23:53:37.000Z | jocker/backends/utils.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | null | null | null | jocker/backends/utils.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | null | null | null | """Jail backend utilities"""
from .ezjail import EZJailBackend
BACKENDS = {
'ezjail': EZJailBackend
}
def get_backend(backend='ezjail', jailname=None):
"""Return an instance of a given backend"""
return BACKENDS[backend](jailname)
| 19 | 49 | 0.708502 |
03b8cd446951a18dc1b4f1c2ceb33f2f97f24e5e | 1,185 | py | Python | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/interface.py | mariaschopp/SABER | 1d289c29d33d91fab1e2da15378601f540c9da28 | [
"Unlicense"
] | 5 | 2020-08-28T04:44:22.000Z | 2021-09-16T18:33:56.000Z | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/interface.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | null | null | null | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/interface.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | null | null | null | import subprocess
import serial
import mupq
class M4Settings(mupq.PlatformSettings):
#: Specify folders to include
scheme_folders = [ # mupq.PlatformSettings.scheme_folders + [
('pqm4', 'crypto_kem', ''),
]
#: List of dicts, in each dict specify (Scheme class) attributes of the
#: sch... | 26.931818 | 75 | 0.619409 |
ff199742d590cae84f0c21e44b961305f67b0157 | 670 | py | Python | leetcode/023-Merge-k-Sorted-Lists/MergekSortedLists_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/023-Merge-k-Sorted-Lists/MergekSortedLists_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/023-Merge-k-Sorted-Lists/MergekSortedLists_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
import heapq
class Solution:
# @param {ListNode[]} lists
# @return {ListNode}
def mergeKLists(self, lists):
hq = []
for ls in lists:
if ls:
... | 23.928571 | 60 | 0.50597 |
640f66213e7c233da689bc0f8b1c3062d76e466b | 3,915 | py | Python | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_python_module.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_python_module.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_python_module.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 32.355372 | 123 | 0.614304 |
44172460cedb59ac3ec4359ce4067a3b76b2f052 | 127 | py | Python | src/data_science/data_science/platform.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/platform.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/platform.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | # Detect Platform
import platform
PLATFORM = platform.uname().system # Windows or Linux
WINDOWS = "Windows"
LINUX = "Linux"
| 15.875 | 54 | 0.732283 |
44278a393d947a3b374c2b105389a798f88704cc | 761 | py | Python | backend/app/models/user_solution.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/models/user_solution.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/models/user_solution.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from sqlalchemy import JSON, Column, ForeignKey, Integer, Numeric, text
from app.db.base_class import Base
class UserSolution(Base):
user_id = Column(Integer, ForeignKey("user.id"), primary_key=True)
task_id = Column(Integer, ForeignKey("task.id"), primary_key=True)
percentage_solved = Column(Num... | 42.277778 | 83 | 0.706965 |
5bcbfda19b4fe0ad440156d96cd18f2aa53276f2 | 453 | py | Python | custom_user/forms.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/forms.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/forms.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | from django import forms
from custom_user.models import CustomUser
class UserCreationForm(forms.ModelForm):
class Meta:
model = CustomUser
fields = ('email',)
def save(self, commit=True):
# Save the provided password in hashed format
user = super(UserCreationForm, self).save(c... | 26.647059 | 63 | 0.653422 |
755b5149537bd6e58400a822e24a001b390056eb | 442 | py | Python | books/SystemProgramming/ch4_advanced/get_mac_info.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/SystemProgramming/ch4_advanced/get_mac_info.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/SystemProgramming/ch4_advanced/get_mac_info.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | #!/bin/env python
import typing
import requests
import getmac
def mac_info(mac_addr: str) -> typing.Optional[str]:
url = f"https://api.macvendors.com/{mac_addr}"
resp = requests.get(url)
result = None
if resp.ok:
result = resp.text
print(result)
else:
print("Not Found")
... | 17.68 | 52 | 0.649321 |
9430b41987870b928dcc37072fec0a50a9a7ffff | 1,040 | py | Python | streamlit_app.py | langsamer/COVID-19-Hospitalisierungen_in_Deutschland | 446780fc782e232847fbbd4a795b2984eea91cfc | [
"CC-BY-4.0"
] | null | null | null | streamlit_app.py | langsamer/COVID-19-Hospitalisierungen_in_Deutschland | 446780fc782e232847fbbd4a795b2984eea91cfc | [
"CC-BY-4.0"
] | null | null | null | streamlit_app.py | langsamer/COVID-19-Hospitalisierungen_in_Deutschland | 446780fc782e232847fbbd4a795b2984eea91cfc | [
"CC-BY-4.0"
] | null | null | null | # %%
import pandas as pd
import streamlit as st
from datetime import date, timedelta
cv19h_frame = pd.read_csv("Aktuell_Deutschland_COVID-19-Hospitalisierungen.csv")
# print(cv19h_frame.shape)
# print(cv19h_frame.index)
# print(cv19h_frame.columns)
# %%
date_range = st.slider(
label="Zeitraum",
min_value=dat... | 30.588235 | 129 | 0.7125 |
9485561e546e210a349878ce2c6ecec24afb4cc5 | 529 | py | Python | sketches/particles1/rectparticles.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/particles1/rectparticles.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/particles1/rectparticles.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # coding=utf-8
from particles import Particle
class RectParticle(Particle):
def __init__(self, l):
Particle.__init__(self, l)
# super(RectParticle, self).__init__(l)
rectMode(CENTER)
self.rota = PI/3
def display(self):
stroke(0, self.lifespan)
fill(204... | 25.190476 | 55 | 0.572779 |
b6f1bda5a588edddeb02b7be5da7c784c7f194f3 | 322 | py | Python | RDS/circle2_use_cases/port/src/api/Authorization_Cancel.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/port/src/api/Authorization_Cancel.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle2_use_cases/port/src/api/Authorization_Cancel.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from flask import jsonify
from connexion_plus.Optimizer import FlaskOptimize
@FlaskOptimize.do_not_minify()
def index():
return """
<html>
<body>
<center>There was an error. You can close this window now.<br />
<button onclick="window.close()">Close</button></center>
</body>
</html>
""... | 21.466667 | 68 | 0.658385 |
f3ee9f43e5d3dc26c866d9d650083ae9e3fad13f | 102 | py | Python | api/apps.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | 1 | 2021-02-05T15:58:02.000Z | 2021-02-05T15:58:02.000Z | api/apps.py | nathanwelsh8/guts_2021_hackathon | d875000051a423db4a4bb1a8df35d6d9a9e9db63 | [
"MIT"
] | 2 | 2021-02-06T13:54:45.000Z | 2021-02-06T20:05:18.000Z | api/apps.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | 2 | 2021-02-05T20:27:48.000Z | 2021-03-31T19:58:07.000Z | from django.apps import AppConfig as AppConfigBase
class AppConfig(AppConfigBase):
name = "api"
| 17 | 50 | 0.764706 |
6d3bc48f086a26bb142c8bc4c7d3b4da2f9b8ce3 | 2,555 | py | Python | oneflow/python/experimental/indexed_slices_ops.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/experimental/indexed_slices_ops.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/experimental/indexed_slices_ops.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 39.921875 | 74 | 0.796086 |
b617bdd926922c2a3f284a92e4467ed55e15d212 | 3,145 | py | Python | Metadataextraction/getNetCDFInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | null | null | null | Metadataextraction/getNetCDFInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 47 | 2018-11-13T13:55:01.000Z | 2019-09-16T13:38:11.000Z | Metadataextraction/getNetCDFInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 4 | 2018-11-27T12:36:51.000Z | 2020-10-14T18:07:04.000Z | import click # used to print something ,
import json, sqlite3, csv, pygeoj, extractTool
from osgeo import gdal, ogr, osr
import pandas as pd
import numpy as np
import xarray as xr
import os
import dateparser # used to parse the dates
"""
Function for extracting the bounding box of a NetCDF file
:param file... | 29.952381 | 108 | 0.684897 |
b65384e5706a2ebbcb769545c0673675cb6e66dd | 3,310 | py | Python | python/system/webserver.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | 1 | 2020-09-29T17:44:31.000Z | 2020-09-29T17:44:31.000Z | python/system/webserver.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | null | null | null | python/system/webserver.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | null | null | null |
import string
import os
from os.path import isfile, join
from os import listdir, remove
import string
import shutil
import base64
import asyncio
import tornado.web
import tornado.websocket
import json
import datetime
from system.log import log
class Webserver(tornado.web.Application):
main_loop = None
... | 37.613636 | 124 | 0.623867 |
a20d61fe1955b1a01e1211d9460a9f1f3f382cb5 | 267 | py | Python | kollektiv5gui/util/logging.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | kollektiv5gui/util/logging.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | kollektiv5gui/util/logging.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | def default_logger(x):
print(x)
__logging_function = default_logger
def setLoggingFunction(func):
global __logging_function
__logging_function = func
def log(text):
if type(text) is not str:
text = str(text)
__logging_function(text)
| 15.705882 | 35 | 0.70412 |
449b501af741495315fe3f88c6290b03baf6f2dc | 102 | py | Python | sso-service/sso/endpoints/__init__.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-service/sso/endpoints/__init__.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-service/sso/endpoints/__init__.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | """SSO service endpoints."""
import sso.endpoints.user_endpoint
import sso.endpoints.service_endpoint
| 25.5 | 37 | 0.823529 |
44e0e3d0243bab76b27c350e1a462362b924fc83 | 1,103 | py | Python | Packs/CortexXDR/Scripts/CortexXDRRemediationActionsWidget/CortexXDRRemediationActionsWidget_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Scripts/CortexXDRRemediationActionsWidget/CortexXDRRemediationActionsWidget_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Scripts/CortexXDRRemediationActionsWidget/CortexXDRRemediationActionsWidget_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import io
import pytest
import json
from CommonServerPython import *
import CortexXDRRemediationActionsWidget
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
@pytest.mark.parametrize('context_data, expected_result', [
(util_load_json('test_d... | 42.423077 | 105 | 0.7534 |
780a382cd7f38f4fa55b77a9b2051a96491c4c4d | 215 | py | Python | Curso-Em-Video-Python/2Exercicios/064_tratando_varios_valores.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/064_tratando_varios_valores.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/064_tratando_varios_valores.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | n = soma = 0
valor = int(input('Valor: '))
while valor != 999:
soma += valor
n += 1
valor = int(input('Valor: '))
print('O total de numeros digitados foi {}, e a soma entre eles foi {}'.format(n, soma))
| 26.875 | 88 | 0.590698 |
1580e3dc4bc824238d670286377b93c1698c79c9 | 3,491 | py | Python | pyventskalender/tag16_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag16_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag16_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | import base64
from random import choice
try:
from pyventskalender.tag14_loesung import zu_ratendes_wort, galgenmannbild
from pyventskalender.tag15_loesung import ist_aufgeben, ist_buchstabe, bewerte_geratenen_buchstaben
except ImportError:
from tag14_loesung import zu_ratendes_wort, galgenmannbild
from... | 32.626168 | 113 | 0.685763 |
15979ba7b9dc1b9bc44f453813939ab729e1244a | 3,940 | py | Python | S5/CS331-SS/PGM_002 - Process Scheduling Algorithm.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S5/CS331-SS/PGM_002 - Process Scheduling Algorithm.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S5/CS331-SS/PGM_002 - Process Scheduling Algorithm.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | #pip3 install beautifultable
from beautifultable import BeautifulTable
from random import sample
def waitTurnNonPreemption():
twt, ttt = 0, 0
bT.insert_column(4, "Start Time", [0]*n)
bT.insert_column(5, "Waiting Time", [0]*n)
bT.insert_column(6, "Turnaround Time", [0]*n)
for i in range(n):
bT[i]["Start Time"] ... | 29.62406 | 105 | 0.635787 |
01f5a55766f8b47c0f06c1f1bd0046ab13be8804 | 2,731 | py | Python | SBTK_League_Helper/user_interfaces/__DEPRECATED/console_ui/special_tools.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/user_interfaces/__DEPRECATED/console_ui/special_tools.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/user_interfaces/__DEPRECATED/console_ui/special_tools.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from sys import stdout
from getpass import getpass
class NonAsciiOrSpecialCodeError(Exception):
def __init__(self, code, description):
self.value = code
self.description = description.format(code)
def __str__(self):
return self.description
getchar_proper_implementation = Fals... | 27.31 | 105 | 0.516294 |
171db3eb5e3542ab9e3dcd881c6951e606d86f94 | 258 | py | Python | site/public/courses/CS-1.1/Examples/ControlFlowExamples/lists_loops.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.1/Examples/ControlFlowExamples/lists_loops.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.1/Examples/ControlFlowExamples/lists_loops.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | """A program demonstrating basic uses of lists."""
# fruits = []
fruits = ["banana", "pear", "pineapple"]
fruits.append("raspberry")
fruits.append("coconut")
fruits[2] = "jackfruit"
print(fruits[3])
for fruit in fruits:
print(fruit)
| 16.125 | 51 | 0.627907 |
0090148b07cd2c82acf2ad1315951f8b9b3127c7 | 7,062 | py | Python | quant/markets/market_factory.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/markets/market_factory.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/markets/market_factory.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging
from quant.common import constant
from ._bitfinex import Bitfinex
from ._kkex import Kkex
from ._liqui import Liqui
from ._hitbtc import Hitbtc
from ._cex import Cex
from ._bittrex import Bittrex
from ._binance import Binance
from ._gate import Gate
from ._... | 39.674157 | 64 | 0.549561 |
00e80558783a6a23214ca92c35a301a67dfc0b72 | 2,926 | py | Python | research/cv/CGAN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/CGAN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/CGAN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 36.575 | 89 | 0.62987 |
979fa2a6f37399ac1a90ccf1975acff8e982b76e | 1,647 | py | Python | cfd.py | millsmgb/cfdBacktester | 1958c401f189b90f3d106cb63c872b1aac925569 | [
"MIT"
] | null | null | null | cfd.py | millsmgb/cfdBacktester | 1958c401f189b90f3d106cb63c872b1aac925569 | [
"MIT"
] | null | null | null | cfd.py | millsmgb/cfdBacktester | 1958c401f189b90f3d106cb63c872b1aac925569 | [
"MIT"
] | null | null | null | # Author: Matthew Mills
# Copyright 2016
# Purpose of this python file is to simulate the operations of a CFD as if it were written as a smart contract
# Note network difficulty, block times, and gas/transaction costs are not taken into account
class CFD: # CFD Class handles all the contract requirements
def __init... | 35.804348 | 110 | 0.755313 |
de0001908b4b5592d7bee787c3775bfa0bddbb86 | 7,035 | py | Python | model/topoml_util/GeoVectorizer.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | model/topoml_util/GeoVectorizer.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | model/topoml_util/GeoVectorizer.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | import re
from shapely.wkt import loads
import numpy as np
import math
# TODO: refactor GEOMETRY_TYPES to use shapely.geometry.base.GEOMETRY_TYPE
GEOMETRY_TYPES = ["GeometryCollection", "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString",
"MultiPolygon", "Geometry"]
X_INDEX = 0 # the ... | 42.379518 | 120 | 0.639801 |
823901c5c3c880204666dcbacd8d15bc6c91734c | 1,003 | py | Python | tests/expertPatternsTests.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | tests/expertPatternsTests.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | tests/expertPatternsTests.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | from nose.tools import assert_equals
from datahandler import expertPatterns
"""
ATTENTION
Les tests ici sont directement dépendants du fichier choisi
"""
ep = expertPatterns.ExpertPatterns()
def setup_module(module):
print("")
print("Test de ExpertPatterns")
print("Lecture des données dans le fichier i... | 22.795455 | 87 | 0.684945 |
2e886d455bee4848cc92c0e3bc275ebc3af4d4e1 | 8,258 | py | Python | Packs/Cymptom/Integrations/Cymptom/Cymptom.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Cymptom/Integrations/Cymptom/Cymptom.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Cymptom/Integrations/Cymptom/Cymptom.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from typing import Dict, Set
import requests
# Imports
from enum import Enum
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
headers: Dict[str, str] = {}
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
class... | 33.164659 | 127 | 0.621942 |
cf245789e93c0c9f5040cc6d918cfbd125d341b3 | 1,789 | py | Python | dataset/dataloader.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | dataset/dataloader.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | dataset/dataloader.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 数据集加载器
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/31
"""
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pack_padded_sequence
import torch
def collate_func(X):
""" batch数据处理 (snntence, length, label)
@param:
:pre_X (tensor):从大到小排列的pre
:pre_length (tensor): pre长... | 31.946429 | 76 | 0.506428 |
cf308c9c054f35c1e6ce91d8bac94f92ef8c24b8 | 127 | py | Python | dewar/exts/__init__.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/exts/__init__.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/exts/__init__.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ._database import db, setup_database
from ._login import login_manager, current_user, setup_login
| 31.75 | 60 | 0.76378 |
321db8981f93ee0b02d2d65f83f2738179949ab5 | 757 | py | Python | config/configurable.py | gluttony2016/RNN | 8991f020abdb5b28d9f73062dbfcd88d30d760a8 | [
"MIT"
] | null | null | null | config/configurable.py | gluttony2016/RNN | 8991f020abdb5b28d9f73062dbfcd88d30d760a8 | [
"MIT"
] | null | null | null | config/configurable.py | gluttony2016/RNN | 8991f020abdb5b28d9f73062dbfcd88d30d760a8 | [
"MIT"
] | null | null | null | import json
class Configurable(object):
def __init__(self, section):
self._config_filename = 'config/config.json'
self._config = json.load(open(self._config_filename, 'r'))
self._section = section
@property
def config(self):
return self._config[self._section]
def get_c... | 28.037037 | 95 | 0.648613 |
5c9810b84e659b8685f5eacd0d403980a2d67f41 | 1,464 | py | Python | skillStarter.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | 4 | 2021-01-08T21:08:50.000Z | 2021-12-08T15:30:50.000Z | skillStarter.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | skillStarter.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | import subprocess
import os.path
from os import path
import fnmatch, sys
class Skillstarter:
def __init__(self):
self.command = None
self.process = subprocess
skills_path = os.getcwd() + "/" + os.path.dirname(__file__) + 'skills'
command = ''
pattern = 'action-*.py'
... | 28.153846 | 120 | 0.584699 |
7a683749510162ca7ca414a920a40077db949973 | 454 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_09_Dateien_verwalten/02_files_mit_regex_durchsuchen/create_files_from_clipboard.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_09_Dateien_verwalten/02_files_mit_regex_durchsuchen/create_files_from_clipboard.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_09_Dateien_verwalten/02_files_mit_regex_durchsuchen/create_files_from_clipboard.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | import os
from pyperclip import copy, paste
from time import sleep
os.chdir(os.path.dirname(__file__)+r'\\readme2')
pfad=os.getcwd()
counter=len(os.listdir(pfad))
def wait_4_it():
global counter
counter+=1
copy(0)
while paste() == '0':
sleep(0.5)
create_file(counter)
def create_file(nummer):
file=open('file'+... | 19.73913 | 48 | 0.702643 |
64ee1ad1fcb8981909ab3ff579d186da868914c2 | 1,051 | py | Python | src/test/tests/operators/ex_surf.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/ex_surf.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/operators/ex_surf.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: external_surface.py
#
# Programmer: Hank Childs
# Date: August 24, 2005
#
# Modifications:
#
# Mark C. Miller, Wed Jan 20 07:37:11 PST 2010
# Added ability to swtich between Silo's HDF5 and... | 20.607843 | 78 | 0.61275 |
74806ae6c87e9a079b395d2bd93ab7056de7a609 | 3,533 | py | Python | Modeling/fit.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | 1 | 2019-10-01T04:13:08.000Z | 2019-10-01T04:13:08.000Z | Modeling/fit.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | null | null | null | Modeling/fit.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | null | null | null | import numpy as np
'''
library for getting building functions
pass the objects following into the function object:
heavy
invHeavy
trend
periodAnn
periodSemiAnn
jump
exponential
sse
'''
class function(object):
'''
function is the function that describes the gps time series
Attributes:
equation : equati... | 17.577114 | 93 | 0.643929 |
ae02a6c2fb896f2d9bf7c3731dda01c0db68fe64 | 1,684 | py | Python | PythonPro/demo/regex.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | PythonPro/demo/regex.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | PythonPro/demo/regex.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
# 正则表达式
import re
# 将匹配的数字乘于 2
def double(matched):
value = int(matched.group('value'))
return str(value * 2)
s = 'A23G4HFD567'
print(re.sub('(?P<value>\d+)', double, s))
# phone = "2004-959-559 # 这是一个国外电话号码"
#
# # 删除字符串中的 Python注释
# num = re.sub(r'#.*$', "", phone)
# print ("电话号码是: ... | 25.907692 | 69 | 0.57304 |
7af3ad1b9cd9f09a78dc24ddda850f2fefd97858 | 14,513 | py | Python | plan/views.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | plan/views.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | plan/views.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | 2 | 2020-04-20T07:26:51.000Z | 2020-04-30T11:51:54.000Z | from django.http import JsonResponse
from django.db import transaction
from django.shortcuts import get_object_or_404
from rest_framework.views import APIView
from rest_framework.parsers import JSONParser
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from plan.models imp... | 38.192105 | 109 | 0.595673 |
bb07df64e27bf0bc023b3509f75efd9de25b8dbd | 2,512 | py | Python | components/amp-utility/python/uos.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/amp-utility/python/uos.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/amp-utility/python/uos.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # -*- coding: UTF-8 -*-
"""
模块功能:提供操作系统相关的功能函数
"""
def set_header(header):
"""
设置请求header参数
:param header(str): 设置请求的header参数
:returns: 0: 成功,其他: 失败
"""
pass
def open(path, mode):
"""
打开文件,具体使用方式参考Linux C下的fopen函数。
:param path(str): 待打开的文件路径及文件名;
:param mode(str): 待打开的文件长... | 20.760331 | 78 | 0.647691 |
bb35f8409e8e84159f9c20e35cf4b2d5a7f4d206 | 11,336 | py | Python | ti3-IPv4.py | Shelicus/IP-Adressen-rechner | 13faa6d0fffed799b014ebc01454a050be74d2f5 | [
"Apache-2.0"
] | 1 | 2021-08-15T15:27:31.000Z | 2021-08-15T15:27:31.000Z | ti3-IPv4.py | Shelicus/IP-Adressen-rechner | 13faa6d0fffed799b014ebc01454a050be74d2f5 | [
"Apache-2.0"
] | null | null | null | ti3-IPv4.py | Shelicus/IP-Adressen-rechner | 13faa6d0fffed799b014ebc01454a050be74d2f5 | [
"Apache-2.0"
] | null | null | null | class ip4v:
def __init__(self, netzwerks_bits, ip):
# speicherung der einzelnen Teile als self von der IP
try:
self.erster_teil = int(ip.split('.')[0])
self.zweiter_teil = int(ip.split('.')[1])
self.dritter_teil = int(ip.split('.')[2])
self.vier... | 34.042042 | 215 | 0.541814 |
bb4c76edb7660e668dfee98d224ff13920683e1a | 3,442 | py | Python | test/test_npu/test_network_ops/test_upsample_nearest1d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_upsample_nearest1d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_upsample_nearest1d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 37.824176 | 89 | 0.622313 |
8ebaec26e1cf0baedc15acbe66dfe3ecdc0d63b7 | 1,129 | py | Python | etc code/parse.py | gusghrlrl101/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 11 | 2019-06-17T02:59:01.000Z | 2021-05-24T14:10:04.000Z | etc code/parse.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | null | null | null | etc code/parse.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 3 | 2019-06-17T02:59:32.000Z | 2019-07-03T04:31:30.000Z | # -*- Encoding:UTF-8 -*- #
import pickle
import sys
import json
import os
# use -> python similarity.py 0000 0000
#TODO 1 : adjust pkl output format
#TODO 2 : adapt weight for each position
#file isn't exist
if(os.path.isfile('./'+str(sys.argv[1])+'parse.pkl')==False):
with open('./'+str(sys.argv[1])+'.pkl','rb'... | 24.021277 | 61 | 0.594331 |
795dc35f65739b440f668c7567569c2e7bb30770 | 4,436 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/beat_phase.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/beat_phase.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/beat_phase.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | import numpy
import pylab
import overlap
#import scipy.signal
def calc_pulse_trains(bpm, window, sr):
period = int(round(60.0 * sr / bpm))
#pulse_trains = numpy.zeros( (period, length) )
num_offsets = period
samples = len(window)
#print "#\t%.2f\t%i" % (bpm, period)
bp_mags = numpy.zeros( ... | 29.771812 | 93 | 0.533589 |
7993eda9a9394f9dd5caf673c50c5147ce6a03ef | 11,227 | py | Python | Dataset_Generation/img_gen_advanced.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | 4 | 2019-03-17T19:55:43.000Z | 2019-04-30T15:22:36.000Z | Dataset_Generation/img_gen_advanced.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | null | null | null | Dataset_Generation/img_gen_advanced.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# This script generates a set of training data for a playing card recognition
# software. More precisely, it generates a scene of a random amount of randomly
# augmented random playing cards on a random backgr... | 41.428044 | 137 | 0.502093 |
8de9bc0d04bbf4c49885e48cdf3feb5d0e6dcdac | 1,296 | py | Python | kmeans.py | J-CIC/Label_Propagation | 02997bb463e1021d4de354b270d0c7bbd93817ca | [
"MIT"
] | 3 | 2018-07-17T12:19:44.000Z | 2019-04-25T14:00:59.000Z | kmeans.py | J-CIC/Label_Propagation | 02997bb463e1021d4de354b270d0c7bbd93817ca | [
"MIT"
] | null | null | null | kmeans.py | J-CIC/Label_Propagation | 02997bb463e1021d4de354b270d0c7bbd93817ca | [
"MIT"
] | null | null | null | from sklearn.cluster import KMeans
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from scipy.misc import comb
edge_link = pd.read_table("email-Eu-core.txt",' ',header=None)
labels_res = pd.read_table("email-Eu-core-department-labels.txt"," ",header=None)
# label_class = 42 ... | 28.8 | 81 | 0.651235 |
3089b516523d93000b2f768af0a0d54d774854cc | 2,116 | py | Python | loss.py | ramesh152/SegmentationExperiment | b52dbc57759c086155e79c6621e6d25a4db0e974 | [
"Apache-2.0"
] | 2 | 2019-06-12T13:53:00.000Z | 2020-04-29T13:11:12.000Z | loss.py | ramesh152/SegmentationExperiment | b52dbc57759c086155e79c6621e6d25a4db0e974 | [
"Apache-2.0"
] | 1 | 2019-12-10T12:23:06.000Z | 2019-12-10T12:23:06.000Z | loss.py | ramesh152/SegmentationExperiment | b52dbc57759c086155e79c6621e6d25a4db0e974 | [
"Apache-2.0"
] | 1 | 2020-08-05T18:12:24.000Z | 2020-08-05T18:12:24.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
def dice_loss(pred, target, smooth = 1.):
pred = pred.contiguous()
target = target.contiguous()
intersection = (pred * target).sum(dim=2).sum(dim=2)
loss = (1 - ((2. * intersection + smooth) / (pred.sum(dim=... | 30.666667 | 118 | 0.619565 |
690d07673521396f40042dc41e6191bcc5a9648b | 9,520 | py | Python | src/onegov/swissvotes/views/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/views/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/views/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from onegov.core.crypto import random_token
from onegov.core.security import Private
from onegov.core.security import Public
from onegov.file.utils import as_fileintent
from onegov.form import Form
from onegov.swissvotes import _
from onegov.swissvotes import SwissvotesApp
from onegov.swis... | 26.666667 | 79 | 0.67521 |
2376ae43bb386315cd21e75fc8739b093e2b0a40 | 338 | pyde | Python | sketches/box2dtest/box2dtest.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/box2dtest/box2dtest.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/box2dtest/box2dtest.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | add_library('box2d_processing')
# add_library('jbox2d')
from box import Box
boxes = []
def setup():
global box2d
size(400, 300)
box2d = Box2DProcessing(this)
box2d.createWorld()
def draw():
background(255)
box2d.step()
if mousePressed:
box = Box(box2d, mouseX, mouseY)
... | 16.095238 | 40 | 0.627219 |
9dcb5f9ec9da88863502c39f37cf84e75285b3f3 | 1,962 | py | Python | crm/tests/tests_urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | crm/tests/tests_urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | crm/tests/tests_urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.urls import reverse, resolve
from crm.views import *
from django.contrib.auth.models import User, Permission, Group
class TestUrls(TestCase):
def setUp(self):
self.user = User.objects.create_superuser(username="user1", email="user1@example.de", password... | 37.730769 | 117 | 0.705403 |
9df7044a0018cb0a5efdd9ffd5b86d5933c316fe | 42 | py | Python | graph_network/data/__init__.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | graph_network/data/__init__.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | graph_network/data/__init__.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | __all__ = ["data", "pipeline", "utility"]
| 21 | 41 | 0.619048 |
31fa7e18b5a0b722640d331630dc56142846fe9c | 2,779 | py | Python | begin-python/cp6/chapter6.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp6/chapter6.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp6/chapter6.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
# ##抽象
# ###6.1 懒惰即美德
# ###6.2 抽象和结构
# ###6.3 创建函数
def fibs(num):
'通过递归求斐波那契数列'
if num == 1:
return [0]
elif num == 2:
return [0, 1]
else:
return fibs(num - 1) + [fibs(num - 2)[-1] + fibs(num - 1)[-1]]
print fibs(5)
print fibs.__doc__
# ####6.3.2 并非真正函数... | 19.70922 | 93 | 0.61317 |
a01db6314f4546f5ee4869364464294e96ed5f2a | 642 | py | Python | Prediction/read.py | Nivram710/Seretra | dc7a509ff37e07ea4688a87ab89d13783299c069 | [
"Apache-2.0"
] | 2 | 2018-04-12T14:24:33.000Z | 2020-09-16T07:03:28.000Z | Prediction/read.py | Nivram710/Seretra | dc7a509ff37e07ea4688a87ab89d13783299c069 | [
"Apache-2.0"
] | null | null | null | Prediction/read.py | Nivram710/Seretra | dc7a509ff37e07ea4688a87ab89d13783299c069 | [
"Apache-2.0"
] | null | null | null | import glob
import os
from vec2 import Vec2
DATA_PATH = ".data/"
def read_data():
objects = {}
for filename in glob.glob(DATA_PATH + "*"):
name = filename.lstrip(DATA_PATH)
if(os.path.isdir(filename)):
print("ignoring directory", filename)
continue
with open(f... | 25.68 | 56 | 0.520249 |
4e62ce2fe66eb949df24ff009086f5ae982aaa7b | 2,282 | py | Python | 2-resources/__DATA-Structures/Code-Challenges/cc76makeChange/makeChange.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc76makeChange/makeChange.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc76makeChange/makeChange.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # cc75 makeChange https://repl.it/student/submissions/1910097
'''
Write a function that, given an amount of money and a list of coin denominations,
returns an integer representing the number of ways that change can be made from
those denominations for the given amount.
For example, given amount = 4 (let's assume 4 cen... | 37.409836 | 118 | 0.7156 |
4eb3a7fe798b1aa561ba5caae13ccd808ddefb54 | 820 | py | Python | backend/migrations/versions/523e4c992f6b_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/523e4c992f6b_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/523e4c992f6b_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | """empty message
Revision ID: 523e4c992f6b
Revises: a8045d00ed67
Create Date: 2018-08-30 15:20:31.671597
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '523e4c992f6b'
down_revision = 'a8045d00ed67'
branch_labels = None
depends_on = None
def upgrade():
# ... | 26.451613 | 87 | 0.69878 |
14dd6e44158d9d31cc98ed29973e0a2304c4113d | 280 | py | Python | tests/web.adblockplus.org/setup.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/setup.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/setup.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | #!/usr/bin/env python
from distutils.core import setup
setup(
name='web.adblockplus.org_selenium',
version='1.0.0',
description='Selenium tests for adblockplus.org',
url='https://gitlab.com/eyeo/websites/web.adblockplus.org/tree/master/tests',
packages=[],
) | 25.454545 | 81 | 0.707143 |
14f402413a141aa09c160cbd5db45fff608dae01 | 7,991 | py | Python | Packs/GoogleBigQuery/Integrations/GoogleBigQuery/GoogleBigQuery_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-11-02T05:36:38.000Z | 2021-11-02T05:36:38.000Z | Packs/GoogleBigQuery/Integrations/GoogleBigQuery/GoogleBigQuery_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/GoogleBigQuery/Integrations/GoogleBigQuery/GoogleBigQuery_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-12-20T15:12:22.000Z | 2021-12-20T15:12:22.000Z | import datetime
import json
import demistomock as demisto
def test_convert_to_string_if_datetime():
from GoogleBigQuery import convert_to_string_if_datetime
test_conversion_for_none = convert_to_string_if_datetime(None)
assert test_conversion_for_none is None
now = datetime.datetime.now()
conver... | 26.996622 | 96 | 0.682518 |
14f5d925e7d23aa7903148fbd80223910edb3a86 | 164 | py | Python | python/primary/模块/mymodule_demo2.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/模块/mymodule_demo2.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/模块/mymodule_demo2.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: mymodule_demo2.py
from mymodule import sayhi,version
# Alternative:
# from mymodule import *
sayhi()
print('Version is ',version)
| 13.666667 | 34 | 0.737805 |
eeddb4dfa74847cea86c4d28460829c7d60db61a | 118 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/04_subprozesse_verwenden/subprozess.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/04_subprozesse_verwenden/subprozess.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/04_subprozesse_verwenden/subprozess.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # Ein kleines Script dass als Subprozess fungieren soll.
print('Diese Ausgabe wurde durch einen Subprozess erstellt.') | 59 | 61 | 0.813559 |
0158267dceb046eb7eea2f1b15906d5df31c7b80 | 365 | py | Python | Python1/aula1.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula1.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula1.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | '''-Crie quatro variáveis, sendo elas com nomes de animais, quantidade de animais, peso dos animais e se eles são vacinados ou não.
-Comente seu código usando comentários longos e curtos.'''
nome_animal1 = "Hipopótamo"
nome_animal2 = "Papagaio"
nome_animal3 = "Golfinho"
qtd_animais = "3"
peso_animal1 = "40.000kg"
pe... | 28.076923 | 131 | 0.753425 |
6d704e81e6c571f3574b57dbfb4a3bed4cd72954 | 3,524 | py | Python | eeprom.py | miximtor/EEPROM-Programmer | 068e726d42aa3db7be24510a8954cae9312b4c82 | [
"MIT"
] | null | null | null | eeprom.py | miximtor/EEPROM-Programmer | 068e726d42aa3db7be24510a8954cae9312b4c82 | [
"MIT"
] | null | null | null | eeprom.py | miximtor/EEPROM-Programmer | 068e726d42aa3db7be24510a8954cae9312b4c82 | [
"MIT"
] | null | null | null | import argparse
import os
import serial
import prettytable
CMD_DUMP = b'\x01'
CMD_ERASE = b'\x02'
CMD_WRITE_BYTE = b'\x03'
CMD_WRITE_FILE = b'\x04'
CMD_READ_BYTE = b'\x05'
eeprom_size = 0
def ensure_ack(ser: serial.Serial):
ack = ser.readline().decode('ascii').strip()
if ack != 'ACK':
raise Exception... | 28.419355 | 113 | 0.630817 |
0976b4f2eea8178c516b3ce2232b53e2adb41ea7 | 357 | py | Python | larq_compute_engine/__init__.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/__init__.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/__init__.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | from larq_compute_engine.tf.python.ops.compute_engine_ops import bsign
from larq_compute_engine.tf.python.ops.compute_engine_ops import (
bconv2d,
bconv2d8,
bconv2d32,
bconv2d64,
)
from larq_compute_engine.tf.python.modelconverter import ModelConverter
__all__ = ["bsign", "bconv2d", "bconv2d8", "bconv2... | 32.454545 | 86 | 0.778711 |
fed87e2eab2d093647f1e9301e0ab833fcafccbf | 2,616 | py | Python | DnDxMTG/mtg/gm.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | DnDxMTG/mtg/gm.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | DnDxMTG/mtg/gm.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | from discord.ext import commands
import asyncio
from . import sql
import logging
from discord import Member
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_format = logging.Formatter('[%(asctime)s - %(levelname)s] %(message)s')
stream_handler.setFormatter(s... | 31.902439 | 114 | 0.691514 |
28f18f76a083d2d3d92825524b0ba296442eb26b | 668 | py | Python | Boot2Root/vulnhub/Lord-Of-The-Root-1.0.1/exploit.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 21 | 2016-02-06T14:30:01.000Z | 2020-09-11T05:39:17.000Z | Boot2Root/vulnhub/Lord-Of-The-Root-1.0.1/exploit.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | null | null | null | Boot2Root/vulnhub/Lord-Of-The-Root-1.0.1/exploit.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 7 | 2017-02-02T16:27:02.000Z | 2021-04-30T17:14:53.000Z | import os, sys
files= ["/SECRET/door1/file","/SECRET/door2/file","/SECRET/door3/file"]
#exploit = "A"*500
#exploit = "A"*171 + "B"*4 + "x90"*8 + "C"*(500-171-4-8)
shell = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x31\xc9\x89\xca\x6a\x0b\x58\xcd\x80"
#exploit = "A"*171 + "B"*4 + "x90"*16 + shell + "... | 31.809524 | 106 | 0.642216 |
c9486f50ebf6591053730a7ed1000164b3813b28 | 990 | py | Python | sort/quick_sort.py | imttx/awesome-algorithm | d72277cc278131ae670bea74db4283b02f362758 | [
"MIT"
] | null | null | null | sort/quick_sort.py | imttx/awesome-algorithm | d72277cc278131ae670bea74db4283b02f362758 | [
"MIT"
] | null | null | null | sort/quick_sort.py | imttx/awesome-algorithm | d72277cc278131ae670bea74db4283b02f362758 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 快速排序,纯粹练手
class QuickSort(object):
def __init__(self, data):
self.__data = data
def run(self):
self.__run_helper(0, len(self.__data) - 1)
def __run_helper(self, l, r):
if l >= r:
return
p = self.__partision(l,... | 21.06383 | 75 | 0.483838 |
a367997ef4b1aae3c92bcdb153d05a7885dabe48 | 629 | py | Python | benwaonline/entities/image.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/entities/image.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/entities/image.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from benwaonline.schemas import ImageSchema, PreviewSchema
from benwaonline.entities import Entity
class Image(Entity):
'''Represents a Image resource object, related to the Image model in the database
Attributes:
type_: 'images'
'''
_schema = 'ImageSchema'
type_ = 'image'
attrs = {}
... | 24.192308 | 85 | 0.648649 |
9569d533882102857aceda4dac9f74da7a67853a | 8,532 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/duaIterate_analysis.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/duaIterate_analysis.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/duaIterate_analysis.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is avail... | 37.585903 | 95 | 0.59646 |
6c12196dde8338aab070d8da64c5ac9ad0046183 | 719 | py | Python | script/download/download.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | script/download/download.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | script/download/download.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | import requests
import pandas as pd
# downloads the .TIF files from the RAISE dataset
RAISE_CSV_PATH = ''
PATH_TO_RAW_DATA = ''
def load_data(path, sep=',', encoding='utf-8'):
df = pd.read_csv(path, sep=sep, encoding=encoding)
return df
def download_image(filename, url):
r = requests.get(url, allow_redi... | 23.966667 | 59 | 0.662031 |
b0e8f11dcb48bcc0a1b213b5034d907482079ca7 | 19,668 | py | Python | 2019/quals/web-pastetastic/app/config.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/quals/web-pastetastic/app/config.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/quals/web-pastetastic/app/config.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.846809 | 104 | 0.686394 |
bbe8ce1f715e3d29be5709ece552d1882f384002 | 740 | py | Python | tsUserv3.py | kona3266/SocketServer | 2bc9b271c909bba6b6457c709c98e95919f86198 | [
"Apache-2.0"
] | null | null | null | tsUserv3.py | kona3266/SocketServer | 2bc9b271c909bba6b6457c709c98e95919f86198 | [
"Apache-2.0"
] | null | null | null | tsUserv3.py | kona3266/SocketServer | 2bc9b271c909bba6b6457c709c98e95919f86198 | [
"Apache-2.0"
] | null | null | null | from socket import *
from time import ctime
import threading
HOST = ''
PORT = 21567
BUFSIZ = 1024
ADDR = (HOST, PORT)
udpSerSock = socket(AF_INET, SOCK_DGRAM)
udpSerSock.bind(ADDR)
def recv_handle(udpSerSock, BUFSIZ,addr):
while True:
data, addr = udpSerSock.recvfrom(BUFSIZ)
if data:
da... | 23.125 | 80 | 0.651351 |
3c5206227d82160281bd976e65cd90ccfbdc07a8 | 7,198 | py | Python | python/bc/docker_log_stats.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/bc/docker_log_stats.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/bc/docker_log_stats.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | """
Extract infos from gogs docker json logfiles
"""
import argparse
import json
from typing import Dict, List
def ordered_print(data: Dict[str, int], trim_string: str = ""):
"""
Sorts the dictionary content by key and prints the resulting dictionary.
:param data: Dict containing distinct addresses and t... | 39.333333 | 89 | 0.678105 |
3cdbad853e5b357a89c06a9a46f82a2ca446753f | 1,125 | py | Python | src/classifiers/tf_classifier.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/classifiers/tf_classifier.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/classifiers/tf_classifier.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from extras import Logger
from nltk import PorterStemmer
# Classify according to raw term frequency
class TFClassifier:
# Constructor for the TFClassifier
def __init__(self, dict_file):
dictionary_file = ... | 26.162791 | 72 | 0.642667 |
75befff6403f03ecda38cf9fd167a8df0c03b3fd | 320 | py | Python | Licence 1/I11/TP2/tp2_1_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP2/tp2_1_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP2/tp2_1_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | time = str(input("Entrer une heure au format 'hh:mm': "))
tp_hours = 13
tp_minutes = 0
tp = tp_hours * 60 + tp_minutes
time = int(time.split(":")[0]) * 60 + int(time.split(":")[1])
if time > tp:
print("Vous etes en retard")
elif time == tp:
print("Vous etes a l heure")
else:
print("Vous etes en avance")
| 21.333333 | 61 | 0.615625 |
2f0404f16093c3982534d59f36811a1288b03a95 | 55,393 | py | Python | resources/mechanics_lib/EBrain.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/EBrain.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/EBrain.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z |
from api.EComponent import EComponent
from EDevice import EDevice
from EModule import EModule
from ELibrary import *
import os
import shutil
class EBrain(EComponent):
"""
A class for representing the brain of the robot.
Stores the EModules (chains) directly attached to it
as well as any devices connec... | 45.108306 | 141 | 0.59401 |
f97e87fa8ea2f1f7ef5677be6611dfb60b11c23e | 590 | py | Python | python/pyqt/pyqt_designer_example/embedding_custom_widgets/my_app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/pyqt_designer_example/embedding_custom_widgets/my_app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/pyqt_designer_example/embedding_custom_widgets/my_app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from PyQt5 import QtWidgets, uic
import pyqtgraph as pg
import sys
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Load the UI page
uic.loadUi('mainwindow.ui', self)
self.plot(range(1, 11), [30, 32, 34, 32, 33, 31,... | 21.071429 | 73 | 0.625424 |
ddfdcd588dcde5348d9c1c30b53a6cc23e1b2174 | 2,989 | py | Python | Chapter7_CNN/Chapter7_3_CNN_Optimization/cnnGridSearch.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter7_CNN/Chapter7_3_CNN_Optimization/cnnGridSearch.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter7_CNN/Chapter7_3_CNN_Optimization/cnnGridSearch.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from scipy.stats import randint
from sklearn.model_selection import GridSearchCV
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Flatten
from tensorf... | 27.675926 | 88 | 0.631984 |
551e531f5636d8f50ea19cdae1f390c81b84c0c4 | 441 | py | Python | Blatt8/src/script.py | lewis206/Computational_Physics | 06ad6126685eaf65f5834bfe70ebd91b33314395 | [
"MIT"
] | null | null | null | Blatt8/src/script.py | lewis206/Computational_Physics | 06ad6126685eaf65f5834bfe70ebd91b33314395 | [
"MIT"
] | null | null | null | Blatt8/src/script.py | lewis206/Computational_Physics | 06ad6126685eaf65f5834bfe70ebd91b33314395 | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
# Set fontsize larger for plots
matplotlib.rcParams.update({"font.size": 20})
fig = plt.figure(figsize=(15, 15))
plt.xlim(x_min, x_max)
plt.ylim(y_min, y_max)
plt.plot(1, 1, ".r", mew=10, label="Minimum")
plt.x... | 21 | 45 | 0.725624 |
5520a913909acc78be92018d83748312cc09abad | 3,172 | py | Python | IVTa/2014/SHCHUKIN_F_O/python_games/quest.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | 1 | 2021-04-02T17:43:48.000Z | 2021-04-02T17:43:48.000Z | IVTa/2014/SHCHUKIN_F_O/python_games/quest.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/SHCHUKIN_F_O/python_games/quest.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | 1 | 2020-12-18T18:04:49.000Z | 2020-12-18T18:04:49.000Z | '''
Это небольшой квест на питоне.
Я называю все переменные по-русски, это только для понимания, лучше и
правильнее писать латиницей.
Попробуйте изменить локации, или даже придумать свой сюжет, это будет
интересно.
Федя ивт-а
'''
инвентарь = ['РУКИ']
def сообщение(что):
print('~~~')
print(что)
class Место:... | 30.796117 | 107 | 0.600567 |
9b69df9c13ac85187ee332f3f3afc1ebfb5d6ef6 | 727 | py | Python | divide-sum-pairs.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | divide-sum-pairs.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | divide-sum-pairs.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
def divisibleSumPairs(n, k, arr):
# Complete this function
mod_map = [0]*k
mod = 0
for ele in arr:
mod = ele % k
mod_map[mod] += 1
for i in range(k//2 + 1):
if(i ==0):
temp = mod_map[0]
pairs = (temp * (tem... | 22.71875 | 59 | 0.456671 |
2f686915ba58dd42cc9ec94b129efcec322a11b3 | 1,256 | py | Python | product/urls.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | product/urls.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | product/urls.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | from django.urls import path
from product import views
from product.views import ProOrderView, ProduceView, DeliverView, FinishView
urlpatterns = [
# 将订单加入生产流程控制页面
path('detail/<int:order_id>', views.order_detail, name='order_detail'),
# 生产人员将订单加入生产列表
path('add/<int:order_id>', views.prod_add... | 34.888889 | 77 | 0.650478 |
85e2f5619e2fd6b1c21707ad88c05d124cd979a7 | 25,764 | py | Python | lib/logger.py | Morgadow/Bierliste_K3.1 | 088806849affbbf5ea0b24fc0393a2308cd5b4aa | [
"MIT"
] | null | null | null | lib/logger.py | Morgadow/Bierliste_K3.1 | 088806849affbbf5ea0b24fc0393a2308cd5b4aa | [
"MIT"
] | null | null | null | lib/logger.py | Morgadow/Bierliste_K3.1 | 088806849affbbf5ea0b24fc0393a2308cd5b4aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
import time
import datetime
#############################
# Author: Simon Schmid #
# Date: 21.05.2019 #
#############################
# todo test dauer static_debug vs debug
# todo add custom log level
# todo remove custom log level
# todo formatter espec... | 45.519435 | 181 | 0.630026 |
c853c36007f11d6441b2feac99425a2c97a78ebe | 3,888 | py | Python | wz/backend/interface_subjects.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/backend/interface_subjects.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/backend/interface_subjects.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
backend/interface_subjects.py - last updated 2021-05-22
Controller/dispatcher for subjects management.
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with th... | 32.132231 | 76 | 0.668981 |
8d046fc3064b4941e0a99344236c154774ff9061 | 731 | py | Python | ___Python/Daniel/2018-06-25-VHS-Bielefeld-Python/p07_file_io/m02_count_files.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Daniel/2018-06-25-VHS-Bielefeld-Python/p07_file_io/m02_count_files.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Daniel/2018-06-25-VHS-Bielefeld-Python/p07_file_io/m02_count_files.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
# Zähle die Anzahl Ordner in einem Ordner (inkl. allen Unterordnern)
def count_dirs(path):
try:
subdirs = [subdir for subdir in path.iterdir() if subdir.is_dir()] # Bestimmte die direkten Unterordner des Ordners path
count = 1
for subdir in subdirs:
... | 30.458333 | 129 | 0.683995 |
9b128c6b83d106a675a736796fd86e1e4d16f1b2 | 540 | py | Python | backend/app/api/endpoints/annotations.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/api/endpoints/annotations.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/api/endpoints/annotations.py | jinnn-dev/learning-by-annotations | 7369973c905d64e09c24e4bcfd7589fbbe9a898e | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from typing import Any
from fastapi import APIRouter, Depends, UploadFile, File
from app.api.deps import get_current_active_user
from app.core.polygon_extractor import convert_image_to_annotations
from app.models.user import User
router = APIRouter()
@router.post("/convert")
async def convert_image(
... | 24.545455 | 68 | 0.727778 |
cdd79668402dcb78184ebc5fd6a67814fcc9e81c | 92 | py | Python | imgFilter/filter/apps.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | 1 | 2020-10-21T07:18:00.000Z | 2020-10-21T07:18:00.000Z | imgFilter/filter/apps.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | imgFilter/filter/apps.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FilterConfig(AppConfig):
name = 'filter'
| 15.333333 | 34 | 0.706522 |
a822251e7db6c764a368dd7e14e72d9846186afa | 956 | py | Python | Project Euler Questions 21 - 30/Project Euler Question 26.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 21 - 30/Project Euler Question 26.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 21 - 30/Project Euler Question 26.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 26
#Reciprocal cycles
import math
def prime_finder(x):
num = 3
primes = [2]
while (num < x):
for prime in primes:
if prime > (int(math.sqrt(num) + 1)):
primes.append(num)
break
if num % prime == 0:
break... | 22.761905 | 78 | 0.534519 |
57244310f4d55b70c3f514fce43b524d4f3acde2 | 5,221 | py | Python | lib/graphics/util.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/graphics/util.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/graphics/util.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Graph utilities
===============
A module containing several graph utility functions.
"""
# TODO: Translate these to Rust methods and call them from the fron... | 27.335079 | 98 | 0.600268 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.