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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
49f8e8aabce75566ee81fa1b0f23c413377a4f30 | 5,573 | py | Python | MA/RocketLauncher_V001a.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/RocketLauncher_V001a.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/RocketLauncher_V001a.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | # Import statements
import sys
sys.path.append("/home/pi/Documents/Robots/slcypi/MA") ### ADD PATH
sys.path.append("/home/pi/Documents/Robots/slcypi/HAT_Python3") ### ADD PATH
import cv2
import numpy as np
import matplotlib.pyplot as plt
from Tank import Tank
from ImageAnalysis import ImageAnalysis
import picamera
impo... | 38.434483 | 90 | 0.440517 |
150bba7ecf689987fcb3d447165e0281936d3b81 | 1,026 | py | Python | Course_3/Week_03/Knapsack.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | Course_3/Week_03/Knapsack.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | 1 | 2020-07-16T08:03:22.000Z | 2020-07-16T08:09:34.000Z | Course_3/Week_03/Knapsack.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
def findSolution(items, weight):
values = [[0 for _ in range(weight+1)] for _ in range(len(items)+1)]
batcktrace = [[None for _ in range(weight+1)] for _ in range(len(items)+1)]
for i in range(1, len(items)+1):
for x in range(weight+1):
v, w = items[i-1][0], items[i-1][1]
cand_a =... | 25.65 | 77 | 0.540936 |
12b0583ca190ccadc787de653462b57d6bde8007 | 111,009 | py | Python | research/cvtmodel/resnest/src/resnest101.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/resnest/src/resnest101.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/resnest/src/resnest101.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 Module5(nn.Cell):
def __init__(self, conv2d_0_in_channels, conv2d_0_out_channels, conv2d_0_kernel_size, conv2d_0_padding,
conv2d_0_pad_mode, conv2d_0_group):
super(Module5, self).__init__()
self.conv2d_0 = nn.Conv2d(in_chann... | 60.069805 | 119 | 0.522237 |
67a2355880c5f1bf347bf1d24efa370d5caae934 | 69,909 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cloudengine/ce_lldp_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cloudengine/ce_lldp_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cloudengine/ce_lldp_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# 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) any later version.
#
# Ansible is distribut... | 50.475812 | 156 | 0.549443 |
67e034036804537a705917eacfa2f536d86da860 | 1,672 | py | Python | src/merchant.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | null | null | null | src/merchant.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | 9 | 2019-07-15T08:49:00.000Z | 2019-08-28T15:05:08.000Z | src/merchant.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | null | null | null | import items, random
class Merchant:
"""A base class for the merchant"""
def __init__(self):
self.gold = items.Gold(100)
self.items = []
def gen_listofitems(self):
quantity = random.randint(2, 5)
list = []
bool = False
item = self.get_item()
list.a... | 27.409836 | 59 | 0.494617 |
7a12798e99aaae8c496847af38afe1e3b98412ee | 1,078 | py | Python | leetcode/040-Combination-Sum-II/CombinationSumII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/040-Combination-Sum-II/CombinationSumII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/040-Combination-Sum-II/CombinationSumII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Node simplification, improvement & optimization
# How, it's good because it can be done on the original code of "Combination Sum"
class Solution:
# @param {integer[]} candidates
# @param {integer} target
# @return {integer[][]}
def combinationSum2(self, candidates, target):
candidates.sort()
... | 29.135135 | 81 | 0.463822 |
bec9df2c4afc543fdc5c4c0514b13b31c73c356f | 1,975 | py | Python | test/test_npu/test_network_ops/test_format_div.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_format_div.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_format_div.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... | 36.574074 | 77 | 0.70481 |
8369fea3179f45a36c02eb9cc8f9d5c9159e6ef4 | 383 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_20x/repost_valuation_rate_for_negative_inventory.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v6_20x/repost_valuation_rate_for_negative_inventory.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_20x/repost_valuation_rate_for_negative_inventory.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint
from erpnext.stock.stock_balance import repost
def execute():
if cint(frappe.db.get_value("Stock Settin... | 34.818182 | 78 | 0.796345 |
55fa44337309dacd56e014e3740c1b8bf396e8bd | 6,854 | py | Python | rattler/settings/base.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | rattler/settings/base.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | rattler/settings/base.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | """
Django settings for rattler project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | 32.794258 | 87 | 0.719288 |
3d3f2a66150ee76f09919fd2c7182522a1a6b1f6 | 130 | py | Python | python_project/python/fun_for (2).py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | python_project/python/fun_for (2).py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | python_project/python/fun_for (2).py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | def fun_for(n):
num=range(n)
print num
for w in num:
if w<5:
continue
print w
fun_for(10)
| 14.444444 | 20 | 0.492308 |
181edb840b93ffdab3040e1364d91bf6869ec58a | 211 | py | Python | synchroload/plugins/youtube.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 3 | 2020-07-08T08:58:46.000Z | 2020-12-01T20:23:30.000Z | synchroload/plugins/youtube.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 1 | 2020-12-30T12:49:43.000Z | 2021-01-04T11:05:48.000Z | synchroload/plugins/youtube.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 2 | 2018-06-21T17:45:11.000Z | 2020-12-30T00:30:45.000Z | import os
import random
import time
HOSTER_NAME = "youtube"
HOSTER_HAS_DIRECT_LINKS = False
HOSTER_KEEP_UNAVAILABLE_UPLOADS = True
def linkFromId(videoId):
return "https://youtube.com/watch?v=" + videoId
| 17.583333 | 51 | 0.781991 |
a15ee3ec858776a81afcd9921734c05b4853fc43 | 2,695 | py | Python | opc/opc ua/opc_ua_client.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | opc/opc ua/opc_ua_client.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | opc/opc ua/opc_ua_client.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null |
"""
Einfacher OPC UA-Client
Notwendige Bibliothek installieren:
apt-get install python3-lxml
pip3 install opcua
Für den Zugriff auf Variablen wird die OPC UA Notation genutzt:
ns=<namespaceIndex>;<identifiertype>=<identifier>
<namespace index> -> namespace index
<identifier ... | 35 | 118 | 0.630427 |
a1e74134c9505b58024f6c87012c4647e1ed591f | 864 | py | Python | data/raspi/src/praxis/led-raten.py | softwareengel/softwareengel-blog | e24192c096be4361c7f7bbe00d2c3e8263c9fd0b | [
"MIT"
] | null | null | null | data/raspi/src/praxis/led-raten.py | softwareengel/softwareengel-blog | e24192c096be4361c7f7bbe00d2c3e8263c9fd0b | [
"MIT"
] | null | null | null | data/raspi/src/praxis/led-raten.py | softwareengel/softwareengel-blog | e24192c096be4361c7f7bbe00d2c3e8263c9fd0b | [
"MIT"
] | null | null | null |
'''
Instanziieren Sie auch für diese LED ein Objekt Ihrer LED Klasse.
Entwickeln Sie ein Programm, bei dem eine Zahl geraten werden soll,
welche ein anderer Spieler zu Beginn eingibt.
Wenn ein Spieler eine falsche Zahl eingibt, soll die eine LED so oft blinken,
wie der Abstand der falschen zur richtigen Zahl ist.... | 27 | 97 | 0.696759 |
62c4cddeab866e00730abb0ffe3ab84a7f4c2548 | 630 | py | Python | elements/python/11/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/11/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/11/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import heapq
def largest_max_heap(h, k):
"""
Returns the k largest items from h, which has the heap property.
"""
aux = [(-h[0], 0)]
largest = []
for _ in xrange(k):
x, i = heapq.heappop(aux)
largest.append(-x)
for j in range(2*i+1, 2*i+3):
if j < len(h):
... | 19.090909 | 68 | 0.52381 |
c515f86d2a5fc7c4f3dcdc0b007e1b2675192029 | 279 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-37-exer-1-marks-with-dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-37-exer-1-marks-with-dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-37-exer-1-marks-with-dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | marks = {"DH1001": {"Bangla": 74, "English": 73},
"DH1002": {"Bangla": 70, "English": 75}}
print(marks["DH1001"])
print(marks["DH1001"]["English"])
marks["DH1003"] = {"Bangla": 68, "English": 72}
print(marks)
print(marks["DH1003"])
print(marks["DH1003"]["Bangla"])
| 19.928571 | 49 | 0.594982 |
c5674befeec217619503545a9a3f507a91809454 | 893 | py | Python | 7-assets/past-student-repos/Whiteboard-Pairing-master/ReverseLinkedList/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Whiteboard-Pairing-master/ReverseLinkedList/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Whiteboard-Pairing-master/ReverseLinkedList/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | def reverseLinkedList(node):
current = node
nextNode = None
prevNode = None
while current:
# store a reference to the next list node
# before we overwrite current.next
nextNode = current.next
# reverse the 'next' pointer
current.next = prevNode
# step forward to the next list node
... | 17.509804 | 54 | 0.646137 |
494ee5a526744b52a4f46c9e44d6f6d59cd5b733 | 11,219 | py | Python | Packs/PrismaCloud/Integrations/RedLock/RedLock_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/PrismaCloud/Integrations/RedLock/RedLock_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/PrismaCloud/Integrations/RedLock/RedLock_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
from freezegun import freeze_time
import demistomock as demisto
integration_params = {
'url': 'http://test.com',
'credentials': {'identifier': 'test', 'password': 'pass'},
'fetch_time': '3 days',
'proxy': 'false',
'unsecure': 'false',
}
@pytest.fixture(autouse=True)
def set_mocks(m... | 38.686207 | 120 | 0.499153 |
b8ec9d69cf9e68ff52a8de2ac2bffff29bf7f2d3 | 10,091 | py | Python | year_3/databases_sem1/lab1/maxdb/dbtable.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem1/lab1/maxdb/dbtable.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem1/lab1/maxdb/dbtable.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from .utils import LRUCache
from .dbelement import DBElement, DBFKElement, DeletedFKException
class Table(object):
def __init__(self, storage, name, columns, cache_size=10):
"""
:param storage: StorageProxy
:param name: Str
:param columns: Dict of {name: type} as {str: int}
... | 35.911032 | 107 | 0.56813 |
6288c6866fd0b1b93c9b8858f744003a8668d296 | 128 | py | Python | 02_Python/variables.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/variables.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/variables.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | def main():
a = 28
b = 1.5
c = "David"
d = True
e = None
return
if __name__ == '__main__':
main()
| 10.666667 | 26 | 0.445313 |
659f0166ea3115939b65c270c2e48232606ee3ee | 6,249 | py | Python | autojail/config/startup.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/config/startup.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/config/startup.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | import os
from pathlib import Path
from typing import Tuple
from mako.template import Template
from autojail.model.jailhouse import ShmemConfigNet
from ..model import AutojailConfig, Board, CellConfig, JailhouseConfig
from ..utils.logging import getLogger
from .passes import BasePass
_root_template = Template(
... | 25.506122 | 142 | 0.566331 |
02c30840f59fd5e674e6a1f36838d06599be91bf | 13,812 | py | Python | contest_server/pjkiserver/ruleserver/test.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/ruleserver/test.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/ruleserver/test.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import unittest
import json
import numpy as np
# test imports
from .bitboard import Board
from .valid_move_check import ValidCheck
from .WinConditions import reihencheckrk
from .WinConditions import reihencheckjs
from .jump_sturdy import movePlayerJS
from . import jump_sturdy
from . import racing_kings
from . import r... | 39.575931 | 253 | 0.533304 |
f30b9d1674b31960a437764b3ab2666b02e1bd6d | 4,722 | py | Python | norden/norden/doctype/cable_datasheet/cable_datasheet.py | thispl/norden | 2a208056e948cae42da688e28c15024124254867 | [
"MIT"
] | null | null | null | norden/norden/doctype/cable_datasheet/cable_datasheet.py | thispl/norden | 2a208056e948cae42da688e28c15024124254867 | [
"MIT"
] | null | null | null | norden/norden/doctype/cable_datasheet/cable_datasheet.py | thispl/norden | 2a208056e948cae42da688e28c15024124254867 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Teampro and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CableDatasheet(Document):
pass
@frappe.whitelist()
def get_product_info(doc):
cl1 = "... | 47.69697 | 661 | 0.621559 |
b8a3f66a231ba1398d8f37ebafc25f3b25fcf067 | 449 | py | Python | codeit/algorithm/merge_sort.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/algorithm/merge_sort.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/algorithm/merge_sort.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from merge import merge
def merge_sort(my_list):
size = len(my_list)
if size <= 1:
return my_list
mid = size // 2
left_half = merge_sort(my_list[:mid])
right_half = merge_sort(my_list[mid:])
return merge(left_half, right_half)
# 테스트
print(merge_sort([1, 3, 5, 7, 9, 11, 13, 1... | 23.631579 | 71 | 0.587973 |
b25041c06f3e474c1c9c895043a23cf977fa5c72 | 1,380 | py | Python | AdvancePython-master/chapter04/class_method.py | xuyifeiCoco/python | 83af27b3baf1caf157b330c580f356a94095e44d | [
"MIT"
] | 26 | 2019-09-17T12:48:36.000Z | 2022-02-24T12:27:01.000Z | AdvancePython-master/chapter04/class_method.py | xuyifeiCoco/python | 83af27b3baf1caf157b330c580f356a94095e44d | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | coding-200/chapter04/class_method.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 20 | 2019-05-31T14:21:00.000Z | 2021-07-27T15:58:25.000Z | class Date:
#构造函数
def __init__(self, year, month, day):
self.year = year
self.month = month
self.day = day
def tomorrow(self):
self.day += 1
@staticmethod
def parse_from_string(date_str):
year, month, day = tuple(date_str.split("-"))
return Date(int(... | 24.642857 | 97 | 0.598551 |
0c30846dfe95e21632069d1f8a2d256a2072a3f7 | 520 | py | Python | ___Python/Daniel/2018-06-25-VHS-Bielefeld-Python/p15_randomisierung/m01_random_dinner_party.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Daniel/2018-06-25-VHS-Bielefeld-Python/p15_randomisierung/m01_random_dinner_party.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Daniel/2018-06-25-VHS-Bielefeld-Python/p15_randomisierung/m01_random_dinner_party.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import random
r = random.Random()
# 1) PI annähern
n = 100000
c = 0
for i in range(n):
x, y = r.uniform(0, 1), r.uniform(0, 1)
if (x**2 + y**2) ** 0.5 <= 1:
c += 1
print(4 * c / n)
# 2) Check, ob zwei Polynome gleich sind
def p1(x):
return x ** 2 + 7 * x + 12
def p2(x):
... | 16.774194 | 44 | 0.494231 |
ac764d179a1c44c2484375881c5d94f2fd82e7b2 | 1,429 | py | Python | kernel/blog/admin.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/blog/admin.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/blog/admin.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import News
from .models import NewsGroup
from .models import NewsMovies
from .models import NewsPhotos
from .models import NewsTags
##############################
####### NEWS #######
##############################
@admin.register(NewsGroup)
class NewsGroupAd... | 25.070175 | 72 | 0.652904 |
0c9a26cf17f6b32892b49ce1910bc1f23abd0a4f | 2,476 | py | Python | lbry/tests/unit/blob/test_blob_manager.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | null | null | null | lbry/tests/unit/blob/test_blob_manager.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/tests/unit/blob/test_blob_manager.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import asyncio
import tempfile
import shutil
import os
from torba.testcase import AsyncioTestCase
from lbry.conf import Config
from lbry.extras.daemon.storage import SQLiteStorage
from lbry.blob.blob_manager import BlobManager
class TestBlobManager(AsyncioTestCase):
async def setup_blob_manager(self, save_blobs=T... | 42.689655 | 118 | 0.712843 |
0b63b5e219bc5cb07d88664d84b388d453e5a348 | 2,096 | py | Python | src/graphics/lib/compute/scripts/preprocess_and_format_glsl_shader.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 10 | 2020-12-28T17:04:44.000Z | 2022-03-12T03:20:43.000Z | src/graphics/lib/compute/scripts/preprocess_and_format_glsl_shader.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2022-01-14T23:38:40.000Z | 2022-01-14T23:38:40.000Z | src/graphics/lib/compute/scripts/preprocess_and_format_glsl_shader.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 4 | 2020-12-28T17:04:45.000Z | 2022-03-12T03:20:44.000Z | #!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Preprocess and clang-format a single GLSL shader script."""
import argparse
import os
import subprocess
import sys
def _Panic(ms... | 28.712329 | 78 | 0.635019 |
33054ee83944bd29385491b141cc3b713f7a32d7 | 28,965 | py | Python | Packs/SafeNet_Trusted_Access/Integrations/SafeNetTrustedAccess/SafeNetTrustedAccess_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SafeNet_Trusted_Access/Integrations/SafeNetTrustedAccess/SafeNetTrustedAccess_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SafeNet_Trusted_Access/Integrations/SafeNetTrustedAccess/SafeNetTrustedAccess_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from SafeNetTrustedAccess import Client
# Defining client object for mocker
client = Client(base_url="demisto.com")
# Defining result of command functions for mocker
user_list = [
{
"email": "demo.user@demisto.com",
"firstName": "Demo",
"id": "CNlM6Pyq3nADXA4rWyUAAAAc",
... | 35.024184 | 117 | 0.659244 |
68b4c267354f0bc0b9f41a11fc3bd687cb5fd85f | 1,624 | py | Python | bot/utils/time.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/utils/time.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/utils/time.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import datetime
from typing import Union
from enum import Enum
from dateutil.relativedelta import relativedelta
ValidTimestamp = Union[
int, datetime.datetime, datetime.date, datetime.timedelta, relativedelta
]
class TimestampFormats(Enum):
"""
Represents the different formats possible for Discord times... | 32.48 | 95 | 0.682266 |
04543ed9f2b1fb09007d9d3f74c9e7a85d389f6c | 4,112 | py | Python | Packs/HealthCheck/Scripts/HealthCheckPlaybookAnalysis/HealthCheckPlaybookAnalysis.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HealthCheck/Scripts/HealthCheckPlaybookAnalysis/HealthCheckPlaybookAnalysis.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HealthCheck/Scripts/HealthCheckPlaybookAnalysis/HealthCheckPlaybookAnalysis.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
args = demisto.args()
DESCRIPTION = [
'The playbook: "{}" may be a copy of a built-in playbook, you may consider using out of the box playbooks',
'The playbook: "{}" is using a sleep command, you may consider changing... | 41.535354 | 120 | 0.625973 |
f098582896c82654b0dbd9d3f887d05fbb6ac742 | 2,552 | py | Python | methods/transformers/examples/seq2seq/convert_pl_checkpoint_to_hf.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/examples/seq2seq/convert_pl_checkpoint_to_hf.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/examples/seq2seq/convert_pl_checkpoint_to_hf.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from pathlib import Path
from typing import Dict, List
import fire
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from transformers.utils.logging import get_logger
logger = get_logger(__name__)
def remove_prefix(text: str, prefix: str):
... | 34.026667 | 115 | 0.681034 |
767bd3047a17b4375020d8677e1e1b0577e19b8a | 5,327 | py | Python | user_sync/connector/oneroster.py | sabanawaf/user-sync.py | 51a7f9165d1740120b172edf507f1b3b3d5e57f8 | [
"MIT"
] | null | null | null | user_sync/connector/oneroster.py | sabanawaf/user-sync.py | 51a7f9165d1740120b172edf507f1b3b3d5e57f8 | [
"MIT"
] | null | null | null | user_sync/connector/oneroster.py | sabanawaf/user-sync.py | 51a7f9165d1740120b172edf507f1b3b3d5e57f8 | [
"MIT"
] | null | null | null | import collections
import time
from random import randint
import urllib.parse
import hmac
import base64
import hashlib
import requests
class OneRoster(object):
def __init__(self, client_id, client_secret):
self._client_id = client_id
self._client_secret = client_secret
def make_roster_request... | 34.367742 | 114 | 0.595269 |
4f65f86bbe1ec73eb72c03532c2e2937feb6a8b5 | 17,744 | py | Python | Packs/BluelivThreatCompass/Integrations/BluelivThreatCompass/BluelivThreatCompass.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/BluelivThreatCompass/Integrations/BluelivThreatCompass/BluelivThreatCompass.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/BluelivThreatCompass/Integrations/BluelivThreatCompass/BluelivThreatCompass.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | ''' IMPORTS '''
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import json
import urllib3
from datetime import datetime
''' PARAM DEFINITION '''
MAX_RESOURCES = 100
STATUS_VALUES = ["NOT_AVAILABLE", "NOT_IMPORTANT", "NOT_PROCESSABLE", "POSITIVE", "NEGATIVE",
... | 35.346614 | 118 | 0.616772 |
4ff0dfa2af9f5fc518948f37dc709e7b04a13e8d | 3,355 | py | Python | src/entity/RadarReader.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/entity/RadarReader.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/entity/RadarReader.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | import warnings
from datetime import timedelta
from pathlib import Path
import numpy as np
from cinrad.io import CinradReader
from numpy import ndarray
from data.calc import quick_cr
from log import logger
from type import PathLike
from . import apv_mapper, rainy_days
__all__ = ["RadarReader"]
class RadarReader(ob... | 30.5 | 106 | 0.498957 |
8cee743455a1f3450dddf7c937a3347e973613d4 | 1,364 | py | Python | Packs/FeedJSON/Integrations/FeedJSON/FeedJSON.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedJSON/Integrations/FeedJSON/FeedJSON.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedJSON/Integrations/FeedJSON/FeedJSON.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from JSONFeedApiModule import * # noqa: E402
def main():
params = {k: v for k, v in demisto.params().items() if v is not None}
params['feed_name_to_config'] = {
params.get('url'): {
'url': params.get('url'),
'ext... | 38.971429 | 119 | 0.655425 |
0fbdee747cc24c8a4709f333225f68723e136ebc | 1,602 | py | Python | user/admin.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | user/admin.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | user/admin.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
@admin.register(User)
class CustomUserAdmin(UserAdmin):
list_display = (
'id',
'first_name',
'last_name',
'email',
'is_active',
)
list_filter = (
'is_... | 19.301205 | 47 | 0.368914 |
fa2159c361e16352dd3de8da6fdf776386bf418c | 252 | py | Python | languages/python/exercises/concept/bools/arcade_game.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 200 | 2019-12-12T13:50:59.000Z | 2022-02-20T22:38:42.000Z | languages/python/exercises/concept/bools/arcade_game.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 1,938 | 2019-12-12T08:07:10.000Z | 2021-01-29T12:56:13.000Z | languages/python/exercises/concept/bools/arcade_game.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 239 | 2019-12-12T14:09:08.000Z | 2022-03-18T00:04:07.000Z | def eat_ghost(power_pellet_active, touching_ghost):
pass
def score(touching_power_pellet, touching_dot):
pass
def lose(power_pellet_active, touching_ghost):
pass
def win(has_eaten_all_dots, power_pellet_active, touching_ghost):
pass
| 21 | 65 | 0.789683 |
d75a6674c2cf8ace7979157d900811db49951566 | 4,237 | py | Python | ppyt/commands/backtest.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 4 | 2016-08-16T07:47:15.000Z | 2017-12-11T10:08:47.000Z | ppyt/commands/backtest.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | null | null | null | ppyt/commands/backtest.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 2 | 2018-06-15T04:43:15.000Z | 2020-05-02T07:47:15.000Z | # coding: utf-8
import logging
import os
import shutil
from datetime import date, datetime
from sqlalchemy import func
from ppyt import const
from ppyt.commands import CommandBase
from ppyt.exceptions import CommandError
from ppyt.models.orm import Stock, start_session
from ppyt.trading_manager import BacktestManager
... | 41.950495 | 110 | 0.59358 |
ad7751717a86a773f1bc4c7647bf08ee2fc49afc | 1,480 | py | Python | bubble sort.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | bubble sort.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | bubble sort.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | import unittest
def bubble_sort(seq):
'''
A função ordena uma lista usando o metodo bubble sort, a função faz 2 loops, o primeiro loop é a lista como um todo,
e o segundo é a troca de dos elementos, no primeiro ele pega a lista toda e entra no segundo, ai ele faz as comparaçoes de 2 em 2 itens,
caso o... | 35.238095 | 140 | 0.633784 |
ad9fde303cdd4e24eece506438fa8abab8d1bffd | 31,756 | py | Python | languages/python/django-oso/tests/test_post_relationship.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | languages/python/django-oso/tests/test_post_relationship.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | languages/python/django-oso/tests/test_post_relationship.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | """Standardized tests for adapters based on the Post model.
Tests come from the relationship document & operations laid out there.
"""
from django_oso.partial import TRUE_FILTER
import pytest
from django.core.exceptions import PermissionDenied
from django_oso.models import authorize_model
from django_oso.oso import O... | 38.726829 | 126 | 0.603791 |
0f0c05bfbb00373df910c095197f2d587a5c5cdd | 917 | py | Python | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/module1/buddymove_holidayiq.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/module1/buddymove_holidayiq.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/module1/buddymove_holidayiq.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """
Unit 3 Sprint 2 SQL Module 1
Part 2 Creating a Database
"""
import sqlite3 as sql
import pandas as pd
connection = sql.connect("buddymove_holidayiq.sqlite3")
curs = connection.cursor()
buddy = pd.read_csv("https://github.com/BrokenShell/DS-Unit-3-Sprint-2-SQL-and-Databases/raw/master/module1-introduction-to-sql/... | 28.65625 | 153 | 0.699019 |
0e1cf42d21bc2829229bbd489045ef0760dca90b | 359 | py | Python | projects/api/parameters.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/api/parameters.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/api/parameters.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Parameters blueprint."""
from flask import Blueprint, jsonify
from ..controllers.parameters import list_parameters
bp = Blueprint("parameters", __name__)
@bp.route("", methods=["GET"])
def handle_list_parameters(component_id):
"""Handles GET requests to /."""
return jsonify(list_... | 23.933333 | 62 | 0.727019 |
7d385054ab8ec94f33dcd2cda85b9abf57654594 | 260 | py | Python | Modell/tfliteUmwandlung.py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | Modell/tfliteUmwandlung.py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | Modell/tfliteUmwandlung.py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.models import load_model
model = load_model("model.h5")
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tfmodel = converter.convert()
open ("model.tflite" , "wb") .write(tfmodel)
print("\n Fertig \n")
| 32.5 | 59 | 0.765385 |
adbc7bab3e8006064649eadcd555cb0a8c2b110e | 2,287 | py | Python | myscrumy/websocket/views.py | Justfemi/Nameless | 239a44fd571d10d55a80a787ee865714c41552fa | [
"MIT"
] | null | null | null | myscrumy/websocket/views.py | Justfemi/Nameless | 239a44fd571d10d55a80a787ee865714c41552fa | [
"MIT"
] | null | null | null | myscrumy/websocket/views.py | Justfemi/Nameless | 239a44fd571d10d55a80a787ee865714c41552fa | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from .models import ChatMessage, Connection
import json
import boto3
# Create your views here.
@csrf_exempt
def test(request):
return JsonResponse( {'message':'Hello Daud'}, status=200, saf... | 30.092105 | 107 | 0.72453 |
cb0c9abf0c1de1652a59bc86c863db4bf2eabfc5 | 2,512 | py | Python | tests/onegov/translator_directory/shared.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/translator_directory/shared.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/translator_directory/shared.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from copy import deepcopy
from datetime import date, timedelta
from onegov.translator_directory.collections.certificate import \
LanguageCertificateCollection
from onegov.translator_directory.collections.language import LanguageCollection
from onegov.translator_directory.collections.translator import \
Transla... | 29.552941 | 79 | 0.695462 |
cb471001a69be8d6889d5442b86e29f428de2144 | 812 | py | Python | Python/Sonstige_Uebungen/fractal_like/square_fractal_turtle.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/fractal_like/square_fractal_turtle.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/fractal_like/square_fractal_turtle.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: square_fractal.py
# Project: Kapitel_07_Sequenzen_Mengen_und_Generatoren
# Created Date: Thursday 28.02.2019, 13:11
# Author: Apop85
# -----
# Last Modified: Friday 01.03.2019, 13:09
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MIT ... | 20.3 | 71 | 0.644089 |
cbbb47583e1d644629c66e025228a24efd7c204f | 744 | py | Python | Algorithms/2_Implementation/36.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/36.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/36.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/append-and-delete/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'appendAndDelete' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. STRING s
# 2. STRING t
# 3... | 19.578947 | 76 | 0.622312 |
389ea10d8ffcb6fd0b8edce8b62a28912c9c365d | 360 | py | Python | pandasguide/com/aaron/pkg/pkg_test.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | pandasguide/com/aaron/pkg/pkg_test.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | pandasguide/com/aaron/pkg/pkg_test.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # _*_ encoding:utf-8 _*_
"""
read package data test
"""
__author__="aaron.qiu"
import pkgutil
from io import StringIO
class PackageTest:
"""包测试对象"""
def read_data(self):
data = pkgutil.get_data('com.aaron.pkg', 'test.dat')
print(f"读取到包的数据:{data}")
if __name__ == "__main__":
pkg_test =... | 15.652174 | 60 | 0.641667 |
aab45e92d86c697439051f432f1d9b49fd694d61 | 447 | py | Python | tutorial/flask/app/__init__.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | null | null | null | tutorial/flask/app/__init__.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | 3 | 2018-11-22T09:49:52.000Z | 2019-05-29T14:43:52.000Z | tutorial/flask/app/__init__.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | null | null | null | # to use the .flaskenv, install pip install python-dotenv
from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route('/')
def index():
return "Hello, World!"
@app.route('/my_html')
def my_function():
return render_template('base.html', title='Was geht')
@app.route('/my_ima... | 20.318182 | 58 | 0.718121 |
2d765d249409b0bf63f3525d5a2e8afd5deab9e5 | 2,087 | py | Python | 20-fs-ias-lec/groups/11-sensUI/sensui/ViewManager.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/11-sensUI/sensui/ViewManager.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/11-sensUI/sensui/ViewManager.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from Manager import Manager
from View import View
from ViewWidget import ViewWidget
class ViewManager(Manager):
def __init__(self, views):
super().__init__(views)
self.__widgets = {}
'''
sensorLookup = {
nodeId = {
sensorId = [
... | 31.621212 | 75 | 0.555822 |
358c5fbe2c411f2b6ce865614a962c15bd84acb5 | 1,933 | py | Python | 0-notes/job-search/SamplesDSAlgos/data structures/datastructures-queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/data structures/datastructures-queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/data structures/datastructures-queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """
What is the difference between using an array vs. a linked list when
implementing a Queue?
Major difference is, arrays are index-based data structure and each
element of the array is associated with an index.
With a linked list, it relies on pointers; each node has the data
... | 31.177419 | 82 | 0.621314 |
ea6876e881a19f34e2d961825a7ad3238fb98d59 | 5,693 | py | Python | MachineTranslation/src_bak/seq2seq/v1(Session execution)/lib/get_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | MachineTranslation/src_bak/seq2seq/v1(Session execution)/lib/get_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | MachineTranslation/src_bak/seq2seq/v1(Session execution)/lib/get_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from lib.build_dataset_xrh import *
from tensorflow.keras.utils import Sequence
from tensorflow.keras.utils import to_categorical
class BatchDataGenSequence(Sequence):
"""
使用 Sequence 的数据批量生成器
1.Sequence 是进行多进程处理的更安全的方法,
2.保证网络在每个时期每个样本只训练一次
Author: ... | 28.898477 | 179 | 0.649745 |
aa1325477620bf2992c4a54224bd91661b574b3d | 17,393 | py | Python | bin/nmfe-player.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | bin/nmfe-player.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | bin/nmfe-player.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import time
import shlex
import struct
import platform
import subprocess
import pyglet
import cocos
from cocos.director import director
from cocos.audio.pygame.mixer import Sound
from cocos.audio.pygame import mixer
import colorama
colorama.init()
# support running from loca... | 32.149723 | 104 | 0.601046 |
aa3d2bc1d3d2cee6f7871190154eecdf654db4f7 | 2,216 | py | Python | tests/dashboardapimock.py | stg93/blaulichtsms_einsatzmonitor | db595f535ece0f944ec70a9eac70af7b667f63ef | [
"MIT"
] | 18 | 2017-07-24T18:08:04.000Z | 2021-05-06T06:50:22.000Z | tests/dashboardapimock.py | stg93/blaulichtsms_einsatzmonitor | db595f535ece0f944ec70a9eac70af7b667f63ef | [
"MIT"
] | 19 | 2018-09-25T20:42:17.000Z | 2021-11-23T21:26:18.000Z | tests/dashboardapimock.py | stg93/blaulichtsms_einsatzmonitor | db595f535ece0f944ec70a9eac70af7b667f63ef | [
"MIT"
] | 11 | 2018-05-05T04:49:41.000Z | 2022-02-18T17:33:13.000Z | import datetime
import uuid
from flask import Flask, jsonify, request
from blaulichtsmscontroller import BlaulichtSmsController
class Alarm:
def __init__(self, polling_interval, update_count):
self._polling_interval = polling_interval
self._update_count = update_count
self.get_alarm_requ... | 31.211268 | 109 | 0.671931 |
52bb83d9631c665c78bf7209acf2838b1cdc6ce0 | 1,344 | py | Python | project/api/weather_warning/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/weather_warning/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/weather_warning/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from marshmallow import fields
from project.api import marshmallow
from project.api.fields import CustomDateTimeField
from project.api.schemas import (
IdSchemaMixin,
PaginationRequestSchema,
PaginationResponseSchema,
SQLAlchemyBaseSchema,
)
from project.models import WeatherWarning
class WeatherWarn... | 23.578947 | 78 | 0.781994 |
52d7f3afa4009528b6bb217b50929198344160d5 | 30 | py | Python | lib/python3.5/os.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/os.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/os.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/os.py | 30 | 30 | 0.766667 |
dca88224545f321ced57530fcd09c4fcdc3649e3 | 229 | py | Python | Language Proficiency/Python/Strings/Designer Door Mat/door_mat.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Strings/Designer Door Mat/door_mat.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Strings/Designer Door Mat/door_mat.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
n, m = map(int, input().split())
pattern = [('.|.'*(2*i+1)).center(m, '-') for i in range(n//2)]
print('\n'.join(pattern+['WELCOME'.center(m, '-')]+pattern[::-1]))
| 25.444444 | 70 | 0.528384 |
f4e75b8ae9029c8b2376a338a8c419d3afa76b98 | 269 | py | Python | Licence 2/I33/TP 3/ex_7.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 3/ex_7.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 3/ex_7.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def is_irreducible(P, p):
is_irr = 0
for i in range(p):
index, P_b = 0, 0
while index < len(P) - 1:
P_b += P[index]
P_b *= i
index += 1
P_b += P[index]
is_irr += P_b % 3
return is_irr >= 0
| 22.416667 | 33 | 0.423792 |
5e6b6694f54548b056fb0570d71427cc13b50a7e | 1,422 | py | Python | doc/examples/bench_expr_broadcast/bench.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/bench_expr_broadcast/bench.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/bench_expr_broadcast/bench.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from transonic import boost, Array
A = Array[float, "3d"]
A1 = Array[float, "1d"]
def expr(a, b):
return np.arctan2(2 * np.exp(a) ** 2 + 4 * np.log(a * b) ** 3, 2 / a)
def broadcast(a: A, b: A1, out: A):
out[:] = expr(a, b)
def broadcast_loops(a: A, b: A1, out: A):
n0, n1, n2 = a.... | 25.854545 | 87 | 0.630802 |
1002b62e22159261396505759a1f1bed89d1147e | 3,537 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import
import pytest
from ansible_collections.community.general.plugins.modules.source_control.gitlab.gitl... | 34.676471 | 110 | 0.710489 |
12707d871749395098fc7393d68d0bc6b083814c | 404 | py | Python | PMIa/2015/Donkor_A_H/task_2_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Donkor_A_H/task_2_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Donkor_A_H/task_2_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 2. Вариант 10.
#Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Юстиниан. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
#Donkor А. Х.
#31.03.2016
print("Является престуnлением, когда один человек строит козни др... | 36.727273 | 200 | 0.769802 |
f65faaabb4aa2dc9d2abbfad29ba9b13889bca15 | 1,403 | py | Python | raw_code/pulson440/BackProjection.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/BackProjection.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/BackProjection.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import matplotlib.pyplot as plt
with open('Mandrill_1way_data.pkl', 'rb') as f:
data = pickle.load(f)
def back_projection(data, resolution, start, stop):
scan_data = data['scan_data'] # Create variable with all the scan data
platform_pos = data['platform_pos'] # Create ... | 31.886364 | 124 | 0.613685 |
9cae450735270256c53ff41a07e359f81fb0c17b | 3,715 | py | Python | checks/load_feeds.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | null | null | null | checks/load_feeds.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | null | null | null | checks/load_feeds.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | null | null | null | """
Loads feeds linked from pages and collects information on the contained content
"""
import logging
from time import mktime
from datetime import datetime
import feedparser
from checks.abstract_checker import AbstractChecker
class Checker(AbstractChecker):
def __init__(self, config, previous_results=None):
... | 30.702479 | 146 | 0.576043 |
145024431670d85ca427f658dbd0c332ed4c68de | 1,135 | py | Python | src/backend/db.py | marco-koenen/Hackathon-WeVsVirus | 48e8c44a935f728b3bb884dbb6213559742ba569 | [
"MIT"
] | 2 | 2020-03-24T14:12:09.000Z | 2020-03-25T07:43:10.000Z | src/backend/db.py | marco-koenen/Hackathon-WeVsVirus | 48e8c44a935f728b3bb884dbb6213559742ba569 | [
"MIT"
] | 2 | 2020-03-23T11:56:03.000Z | 2020-03-24T13:50:14.000Z | src/backend/db.py | marco-koenen/Hackathon-WeVsVirus | 48e8c44a935f728b3bb884dbb6213559742ba569 | [
"MIT"
] | 2 | 2020-03-20T22:00:58.000Z | 2020-03-21T00:11:45.000Z | from peewee import *
import os
import logging
from datetime import datetime
from playhouse.migrate import SqliteMigrator
from .activationOTP import generate_otp
db = SqliteDatabase('app.sqlite3')
def random_hash():
return os.urandom(16).hex()
class BaseModel(Model):
class Meta:
database = db
class... | 26.395349 | 82 | 0.726872 |
1484cd1143fe22427356b2597e76cc70b1578c78 | 2,657 | py | Python | research/cv/hardnet/src/pth2ckpt.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/hardnet/src/pth2ckpt.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/hardnet/src/pth2ckpt.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... | 39.656716 | 84 | 0.635303 |
1ae706af5a9001a9befb7c5033db8e47431bb97c | 902 | py | Python | usbdrive/_osfile.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | usbdrive/_osfile.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | usbdrive/_osfile.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._file import File
from os import listdir, sep
from os.path import isdir, exists, dirname
class OsFile(File):
def __init__(self, path: str):
self._path = path
def is_directory(self) -> bool:
return isdir(self._path)
def get_absolute_path(self):
return self._path
def get... | 27.333333 | 78 | 0.616408 |
21304e9a708655a38ab74f8a5f42d5f95092e5b2 | 755 | py | Python | utils/UnzipUtil.py | wanglikang/zzuARTensorflow2 | 2e31108ca90f183ab93309aa481de1dd88f98a9b | [
"MIT"
] | null | null | null | utils/UnzipUtil.py | wanglikang/zzuARTensorflow2 | 2e31108ca90f183ab93309aa481de1dd88f98a9b | [
"MIT"
] | null | null | null | utils/UnzipUtil.py | wanglikang/zzuARTensorflow2 | 2e31108ca90f183ab93309aa481de1dd88f98a9b | [
"MIT"
] | null | null | null | #coding:utf-8
import zipfile
import os
class UnzipUtil(object):
def __init__(self):
pass
def unzip_file(self,zipfilename, unziptodir):
self.selfname=zipfilename
if not os.path.exists(unziptodir):
os.mkdir(unziptodir)
print(zipfilename)
zfobj = zipfile.ZipF... | 24.354839 | 88 | 0.633113 |
213a409770d544417073040caf0c505b96078645 | 2,166 | py | Python | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/models.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/models.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/models.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 22:33:15 2016
@author: abhishek
"""
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.feature_se... | 31.852941 | 103 | 0.758541 |
b4c7ffef33a67823a68ff6962d2ded4e83fcbfc9 | 439 | py | Python | euler-12.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-12.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-12.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def visko_deljiva_trugularna_števila(n):
stevilo = 1
tringlarno_stevilo = 1
d = 0
while d < n+1:
stevilo +=1
tringlarno_stevilo += stevilo
delitelji = []
for x in range(1,tringlarno_stevilo + 1):
if tringlarno_stevilo % x == 0:
delite... | 24.388889 | 50 | 0.583144 |
2eb1d63f1f07cfd7176e13081f04343b34ca1b54 | 445 | py | Python | src/onegov/core/crypto/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/crypto/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/crypto/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.crypto.password import hash_password, verify_password
from onegov.core.crypto.random import random_password
from onegov.core.crypto.token import random_token
from onegov.core.crypto.token import RANDOM_TOKEN_LENGTH
from onegov.core.crypto.token import stored_random_token
__all__ = [
'hash_password... | 29.666667 | 70 | 0.791011 |
9f0f574b14a0590735fb495bb1a44674cbc27ebf | 36,716 | py | Python | frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.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, erpnext
from frappe import _, throw
from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate, add_days, add_months, get_... | 38.008282 | 181 | 0.731725 |
9f33f8c9ede4cd6a738f467a1d812c162ec0b090 | 1,030 | py | Python | skimind/kernel/learningModels/trainEval.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/learningModels/trainEval.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/learningModels/trainEval.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #-*-coding: utf-8 -*-
import tensorflow as tf
def train_input_fn(train_X, train_Y, const_shuffle, batch_size):
dataset = tf.data.Dataset.from_tensor_slices((dict(train_X), train_Y))
dataset = dataset.shuffle(const_shuffle).repeat().batch(batch_size)
return dataset.make_one_shot_iterator().get_nex... | 29.428571 | 76 | 0.696117 |
9f3f3fa412f9bdffdca580be9dd0c79e9f8ff8f3 | 1,471 | py | Python | 10.3389/fevo.2021.762173/scripts/make_dragonfly_mask.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fevo.2021.762173/scripts/make_dragonfly_mask.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fevo.2021.762173/scripts/make_dragonfly_mask.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | import os
import sys
import glob
import random
import shutil
import numpy as np
import cv2
def make_mask(f_input, f_output):
img = cv2.imread(f_input)
#img_original = img
b_ch, g_ch, r_ch = cv2.split(img)
img = cv2.fastNlMeansDenoisingColored(img, None, 2, 2, 9, 17)
img_dragonfly = cv... | 24.516667 | 94 | 0.628144 |
9817ad6308cfc68f0235b67c4644bedee8335e08 | 358 | py | Python | src/python/py-accepted/69A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/69A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/69A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 69A
# Created on : 2019-01-15 20:08:32
def Main():
n, a = int(input()), [0, 0, 0]
for i in range(0, n):
dt = [int(x) for x in input().split(" ")]
for j in range(3):
a[j] += dt[j]
if any(a):
print("NO")
else:
print("YES")
... | 16.272727 | 49 | 0.441341 |
2cbfd2322ae51890c6b493287b488441f4d1a9f9 | 231 | py | Python | Algorithms/Strings/mars_exploration.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/mars_exploration.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/mars_exploration.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
S = input().strip()
cnt = 0
for s in S[0::3]:
if s != 'S':
cnt += 1
for s in S[1::3]:
if s != 'O':
cnt += 1
for s in S[2::3]:
if s != 'S':
cnt += 1
print(cnt)
| 14.4375 | 22 | 0.428571 |
3901af7c4337cf49c51912d8610ff5b22e0a5156 | 213 | py | Python | python_lessons/PythonPDF/OpenCV/opencv_02.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/PythonPDF/OpenCV/opencv_02.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/PythonPDF/OpenCV/opencv_02.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
def main():
image=cv2.imread('Foto2.jpeg')
#image=cv2.resize(image,(1300,800))
orig=image.copy()
cv2.imshow('Origin',image)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
main() | 14.2 | 36 | 0.694836 |
39408aacec835a8b4cbdb1d9dcc8a46bf07ca325 | 153 | py | Python | src/server/app/models/Statistic.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/models/Statistic.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/models/Statistic.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ..db.settings import db
class Statistic(db.Document):
name = db.StringField(required=True)
date = db.IntField()
user = db.StringField() | 25.5 | 40 | 0.69281 |
b3d1d3bd25cf68c26b4482dccb6756072db3b627 | 17,682 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/ptlines2flows.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/ptlines2flows.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/ptlines2flows.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-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 available at
# https://www.ec... | 49.253482 | 120 | 0.562663 |
b3d2819015dfd64ad6d9fd7b0ae51e8d1f8553ce | 457 | py | Python | 1_DeepLearning-Basics/07_MNIST_Dataset_Klassifikation/visualization.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/07_MNIST_Dataset_Klassifikation/visualization.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/07_MNIST_Dataset_Klassifikation/visualization.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.datasets import mnist
from plotting import *
# Dataset
(x_train, y_train), (x_test, y_test) = mnist.load_data()
train_size = x_train.shape[0]
test_size = x_test.shape[0]
print(train_size)
print(test_size)
pr... | 19.869565 | 56 | 0.768053 |
20b891aa8c902dd227054019883aa0f3da616453 | 10,900 | py | Python | Welp/utils/database.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Welp/utils/database.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Welp/utils/database.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import hashlib
import sqlite3
import setup_db as setup_db
from flask import flash, session
# noinspection PyCompatibility
from pathlib import Path
from typing import Iterable, List, Tuple
#from util.annotations import deprecated
def add_account(username, password1, password2, ... | 33.333333 | 115 | 0.593945 |
afe8ecd6f4a85aace0c31c76df41d63672d4362a | 452 | py | Python | src/initialise.py | 1-chris/tbpf | c3b94c6d44cbb4fac50367c86f6b00f51abf7c7a | [
"Unlicense"
] | null | null | null | src/initialise.py | 1-chris/tbpf | c3b94c6d44cbb4fac50367c86f6b00f51abf7c7a | [
"Unlicense"
] | null | null | null | src/initialise.py | 1-chris/tbpf | c3b94c6d44cbb4fac50367c86f6b00f51abf7c7a | [
"Unlicense"
] | null | null | null | import sqlite3
conn = sqlite3.connect('tbpf-fs.db')
c = conn.cursor()
c.execute('''CREATE TABLE filetree (fileindex integer, path text, iscontainer bool, origin text, filehash text, baselocationid integer) ''')
c.execute('''CREATE TABLE tags (tagid integer, name text, taggroupid integer)''')
c.execute('''CREATE TABL... | 41.090909 | 140 | 0.745575 |
441427117eaf185fd9a3d0cd04d7dc8963138d91 | 1,305 | py | Python | python/en/archive/dropbox/programmers/02-2_list-2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/programmers/02-2_list-2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/programmers/02-2_list-2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 02-2_list.py
# (02) 리스트에서 원소 찾아내기
# 문제 설명
# 인자로 주어지는 리스트 L 내에서, 또한 인자로 주어지는 원소 x 가 발견되는 모든 인덱스를 구하여 이 인덱스들로 이루어진 리스트를 반환하는 함수 solution 을 완성하세요.
# 리스트 L 은 정수들로 이루어져 있고 그 순서는 임의로 부여되어 있다고 가정하며, 동일한 원소가 반복하여 들어 있을 수 있습니다. 이 안에 정수 x 가 존재하면 그것들을 모두 발견하여 해당 인덱스들을 리스트로 만들어 반환하... | 29 | 180 | 0.557854 |
448497eab739e889116883200af16021e6dc2f11 | 2,939 | py | Python | Packs/CyrenInboxSecurity/Integrations/CyrenInboxSecurity/CyrenInboxSecurity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CyrenInboxSecurity/Integrations/CyrenInboxSecurity/CyrenInboxSecurity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CyrenInboxSecurity/Integrations/CyrenInboxSecurity/CyrenInboxSecurity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """Cyren Inbox Security Integration for Cortex XSOAR - Unit Tests file
"""
import json
import io
import datetime
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_simulate_fetch():
from CyrenInboxSecurity import simulate_fetch
... | 22.960938 | 72 | 0.617557 |
92638d1c3b6c3f2566ecc3cc59d8c71956f053ec | 3,273 | py | Python | ryu/app/otherApp/plot-inter-cdf.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/otherApp/plot-inter-cdf.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/otherApp/plot-inter-cdf.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | import csv
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
newestFolder=sorted(os.listdir('Result'))[-5]
baseFolder='Result/'+newestFolder+'/'
con1=open(baseFolder+'migInter.csv')
# con1=open('C:/Users/25247/Desktop/result-0801/nomig/respondTime1.csv')
con1CSV=csv.reader(con1,delimiter=',')
Fo... | 31.776699 | 114 | 0.669722 |
a6b540a3d821729e8410c87ea4700aa1cd2ac6a9 | 4,301 | py | Python | main.py | nettnikl/timesheet | f6b2dc73bf1ae29e925c12e0ff6b6bba56d96d4e | [
"MIT"
] | null | null | null | main.py | nettnikl/timesheet | f6b2dc73bf1ae29e925c12e0ff6b6bba56d96d4e | [
"MIT"
] | null | null | null | main.py | nettnikl/timesheet | f6b2dc73bf1ae29e925c12e0ff6b6bba56d96d4e | [
"MIT"
] | null | null | null | from openpyxl import Workbook, load_workbook, drawing
import datetime
import PIL.Image
import locale
import holidays
class TimesheetGenerator:
def __init__(self):
self.workbook = load_workbook("template.xlsx")
self.worksheet = self.workbook.active
def run(self, when=datetime.date.today()):
... | 34.96748 | 81 | 0.56731 |
f3c5c0337ff4b452e5c60ba20e5943294ae4c7d4 | 4,528 | py | Python | src/main/python/ble_temperature_sensor/azartonsensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/azartonsensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/azartonsensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
sys.path.append('..')
import time
import logging
import atorlib
import ble_temperature_sensor
class AzartonSensor(atorlib.BleBluepyBase):
sensor = None
def __init__(self,
mac=None,
name=None,
data=None,
... | 35.375 | 143 | 0.517668 |
1b18e7a4cf2d4c3948a42f3e91bb2578c8b225e8 | 1,514 | py | Python | Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-11-02T05:36:38.000Z | 2021-11-02T05:36:38.000Z | Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-12-20T15:12:22.000Z | 2021-12-20T15:12:22.000Z | import demistomock as demisto
from QualysCreateIncidentFromReport import main, get_asset_id_for_ip
def test_main(mocker):
"""
Tests the full flow of the script
Given: A valid report and successful responses
When: Running the QualysCreateIncidentReport script
Then: Return a success... | 37.85 | 112 | 0.643329 |
94543d98ef2359e5ed5f355619e0c0192272271a | 9,113 | py | Python | torch/fx/experimental/fx2trt/trt_module.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | torch/fx/experimental/fx2trt/trt_module.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | torch/fx/experimental/fx2trt/trt_module.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | from typing import List, Any, Sequence
import tensorrt as trt
import torch
from .utils import torch_dtype_from_trt
class TRTModule(torch.nn.Module):
def __init__(self, engine=None, input_names=None, output_names=None, cuda_graph_batch_size=-1):
super(TRTModule, self).__init__()
self._register_st... | 41.611872 | 125 | 0.597498 |
8475abcef4bd748bb1c68d951cd6ae4206b77782 | 1,006 | py | Python | backend/app/db/__init__.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/db/__init__.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/db/__init__.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | # noinspection PyUnresolvedReferences
from app.db.base_class import Base
# noinspection PyUnresolvedReferences
from app.models.base_task import BaseTask
# noinspection PyUnresolvedReferences
from app.models.course import Course
# noinspection PyUnresolvedReferences
from app.models.course_members import Cou... | 27.944444 | 52 | 0.83499 |
04fcc80702e1ece48bfeda0d38416a4751bcdad2 | 228 | py | Python | pyramid-creator/app/api/endpoints/__init__.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | pyramid-creator/app/api/endpoints/__init__.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | pyramid-creator/app/api/endpoints/__init__.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from fastapi import APIRouter
from app.api.endpoints import slides
"""
Definition of all available API-Routes
"""
api_router = APIRouter()
api_router.include_router(slides.router, prefix="/slides", tags=["slides"])
| 20.727273 | 76 | 0.732456 |
fcfe3712c39fc665ee870667496f6c9a06d42721 | 55 | py | Python | ___Python/Michael/p02_listen/m03_anwendung_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p02_listen/m03_anwendung_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p02_listen/m03_anwendung_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | satz = "Fischers Fritze fischt frische Fische"
# e
| 13.75 | 47 | 0.690909 |
1ea5ba204a3f835b6e907c970924bf9d0c708575 | 4,418 | py | Python | Utils/py/ConfigViewer/ConfigViewerUi.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/ConfigViewer/ConfigViewerUi.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/ConfigViewer/ConfigViewerUi.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ConfigViewer.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectN... | 47.505376 | 105 | 0.697374 |
1ed105dfc5939d09ec53820a88cfb2d86a5d19fc | 1,249 | py | Python | registry/serializers.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | registry/serializers.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | 5 | 2020-10-10T00:21:37.000Z | 2021-09-22T18:01:46.000Z | registry/serializers.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from registry.models import Member, Membership, Role, Period, Client, AuthEvent
class MemberSerializer(serializers.ModelSerializer):
class Meta:
model = Member
fields = '__all__'
class MembershipSerializer(serializers.ModelSerializer):
class Meta:
... | 24.98 | 86 | 0.717374 |
78b50b57b75c185f130abab1fb2364ae90a2044b | 240 | py | Python | DataStructure/U3/U3_20.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | DataStructure/U3/U3_20.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | DataStructure/U3/U3_20.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | def gleichheit(F,G):
if(len(F) != len(G)):
return False
for i in range (len(F)):
if(F[i] != G[i]):
return False
return True
F = (1,2,3,4,5,6)
G1 = (1,2,3,4,5,6)
G2 = (1,2,3,4,5,5)
print(gleichheit(F,G1))
print(gleichheit(F,G2))
| 16 | 25 | 0.570833 |
152d45d30ef61d3bf148cf68fbbdd2a8a9c2f51a | 396 | py | Python | Dictionary/create_proper_names_list.py | Palamariuk/TextAnalyzer | 6423a7e318db682b830a6b9d9c17347678196b26 | [
"MIT"
] | 1 | 2021-02-08T11:21:04.000Z | 2021-02-08T11:21:04.000Z | Dictionary/create_proper_names_list.py | Palamariuk/TextAnalyzer | 6423a7e318db682b830a6b9d9c17347678196b26 | [
"MIT"
] | null | null | null | Dictionary/create_proper_names_list.py | Palamariuk/TextAnalyzer | 6423a7e318db682b830a6b9d9c17347678196b26 | [
"MIT"
] | null | null | null | def load_words():
with open('words.txt') as word_file:
valid_words = set(word_file.read().split())
return sorted(valid_words)
if __name__ == '__main__':
english_words = load_words()
with open('proper_names.txt', 'w') as proper_names:
for word in english_words:
if (word.capitalize()... | 26.4 | 59 | 0.636364 |
da0d1727f3993b23227505b2482f5a701e2a84f7 | 3,407 | py | Python | src/xrt/auxiliary/bindings/steamvr_profiles.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | src/xrt/auxiliary/bindings/steamvr_profiles.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | src/xrt/auxiliary/bindings/steamvr_profiles.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
"""Generate SteamVR input profiles from a JSON file describing interaction
profiles and bindings."""
from bindings import *
import argparse
import os
import errno
import json
def names(p):
hw_name = str(p.name.split("/")[... | 27.256 | 89 | 0.597887 |
da83fb6d4f63b313c01b9ea8448cd4329727598c | 1,656 | py | Python | src/onegov/translator_directory/collections/documents.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/collections/documents.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/collections/documents.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from itertools import groupby
from cached_property import cached_property
# This can be changed anytime without making further changes
# We assume - like for the Excel - that we will not add other languages in
# the future and do not use translations strings here
from onegov.file import File, FileCollection
from one... | 31.245283 | 75 | 0.702295 |
16f785616a9df7775e12263346f822229ed114de | 314 | py | Python | mass_add_http-main/add_http.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | mass_add_http-main/add_http.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | mass_add_http-main/add_http.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | banner = """
Mass Add HTTP | Jamet Crew
"""
print banner
def http(url):
try:
https = ('http://'+url)
open('http.txt','a').write(https+'\n'); print(https)
except: pass
site = raw_input('List Site : ')
ht = open(site, 'r').readlines()
for i in ht:
try:
siten = i.strip()
data=http(siten)
except: pass | 16.526316 | 54 | 0.60828 |
e503d44fc76c170e5fd3950ac1220ddb73b892fc | 3,917 | py | Python | Python/Sonstige_Uebungen/rearrange_string.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/rearrange_string.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/rearrange_string.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: rearrange_string.py
# Project: Sonstige_Uebungen
#-----
# Created Date: Saturday 16.01.2021, 11:52
# Author: Apop85
#-----
# Last Modified: Saturday 16.01.2021, 13:19
#-----
# Copyright (c) 2021 Apop85
# This software is published under the MIT license.
# C... | 31.087302 | 106 | 0.630329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.