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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7fc1eaf126fdc8571f5a1aa0495912c04e0c74d3 | 2,893 | py | Python | src/ztc/nginx/timelog.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/nginx/timelog.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/nginx/timelog.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
"""
Nginx TimeLog check class: calculates min/avg/max upstream response times.
Usage:
1. configure time_log log format in nginx config (http section):
log_format time_log '$upstream_response_time $request <anything you want>';
2. Add timelog log to all servers/locations you need to monitor:
acce... | 28.93 | 77 | 0.555133 |
3d012978fab5574b4b0eaed49cd7643bab61e117 | 851 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v9_0/set_schedule_date_for_material_request_and_purchase_order.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/v9_0/set_schedule_date_for_material_request_and_purchase_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_0/set_schedule_date_for_material_request_and_purchase_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for doctype in ("Material Request", "Purchase Order"):
frappe.reload_doctype(doctype)
frappe.reload_doctype(doctype + " Item")
if not fra... | 35.458333 | 91 | 0.726204 |
3d4551b855902436177ea00924846cf8238891dd | 3,201 | py | Python | Project Euler Questions 1 - 10/Project Euler Question 8.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 1 - 10/Project Euler Question 8.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 1 - 10/Project Euler Question 8.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 8
#The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
#73167176531330624919225119674426574742355349194934
#96983520312774506326239578318016984801869478851843
#85861560789112949495459501737958331952853208805511
#125406987471585238630507156... | 58.2 | 1,018 | 0.860356 |
1840e87be59bd6818b0b1170d5b7b76a9db29ded | 1,824 | py | Python | python/pyopenGL/ogl1/ogl_8_multiple_plots.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/pyopenGL/ogl1/ogl_8_multiple_plots.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/pyopenGL/ogl1/ogl_8_multiple_plots.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #// last done till 43 pg no do the graph inequalities the next day.
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import sys
#from numpy import *
import numpy as np
import math
def init():
glClearColor(1.0,1.0,1.0,1.0)
gluOrtho2D(-5.0,5.0,-5.0,5.0)
def plotfunc():
glClear(G... | 26.057143 | 120 | 0.542215 |
62fc25c9eb93dfcc9505716fcea3569679a26014 | 5,230 | py | Python | rbac/ledger_sync/inbound/listener.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | rbac/ledger_sync/inbound/listener.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | rbac/ledger_sync/inbound/listener.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 38.175182 | 84 | 0.555258 |
9ab3b6ab4175317ba8bba745b86688474420a649 | 3,900 | py | Python | research/nlp/skipgram/src/skipgram.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/skipgram/src/skipgram.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/skipgram/src/skipgram.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... | 33.333333 | 104 | 0.623333 |
49997d7ba1396e63db8a84c1b6ca053ca4b41b0d | 809 | py | Python | _collections/articles/obstoanki_setup.py | SubZeroX/SubZeroX.github.io | 1df9c43d538af7812e68ac07d7591f258c8c1619 | [
"MIT"
] | null | null | null | _collections/articles/obstoanki_setup.py | SubZeroX/SubZeroX.github.io | 1df9c43d538af7812e68ac07d7591f258c8c1619 | [
"MIT"
] | null | null | null | _collections/articles/obstoanki_setup.py | SubZeroX/SubZeroX.github.io | 1df9c43d538af7812e68ac07d7591f258c8c1619 | [
"MIT"
] | null | null | null | import urllib.request
import sys
import subprocess
import os
SCRIPT_URL = "".join(
[
"https://github.com/Pseudonium/Obsidian_to_Anki/releases/latest",
"/download/obsidian_to_anki.py"
]
)
REQUIRE_URL = "".join(
[
"https://github.com/Pseudonium/Obsidian_to_Anki/releases... | 26.096774 | 79 | 0.631644 |
91f26782088d79019bc4f02ecd720aa9fc815596 | 2,626 | py | Python | Assembler/tests/test_labels_beta.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | 1 | 2019-01-28T01:53:20.000Z | 2019-01-28T01:53:20.000Z | Assembler/tests/test_labels_beta.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | null | null | null | Assembler/tests/test_labels_beta.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | null | null | null | from tests import test
import labels as lb
def test_is_datastring():
test.assertTrue(lb.is_datastring('0xFfA'))
test.assertTrue(lb.is_datastring('-123645'))
test.assertTrue(lb.is_datastring('235'))
test.assertTrue(lb.is_datastring('0b0101001'))
test.assertFalse(lb.is_datastring('0xFfg'))
test.a... | 45.275862 | 113 | 0.706778 |
626e6c09f08958d78e1a96c9b4eba4f98fb25e05 | 1,578 | py | Python | PYTHON/Regex_and_Parsing/validating_uid.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/validating_uid.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/validating_uid.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
for _ in range(int(input())):
m = re.match(r'(?!([a-zA-Z0-9]){1,}.*?\1)(?=(.*\d+){3,})(?=(.*[A-Z]+){2,})(?=^[\d\w]{10}$)', input())
if m is None:
print('Invalid')
else:
print('Valid')
# TEST
# m = re.match(r'(?=^[\d\w]{10}$)(?=.*[0-9]{3,})(?=.*[A-Z]{... | 41.526316 | 107 | 0.308619 |
628dca7eafeadab9b0364001a2b436c3a726d50b | 2,997 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/build/history.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/build/history.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/build/history.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) 2011-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... | 39.96 | 110 | 0.644311 |
b8242ba9873540a3dbca15f727f6c96c2a8fc842 | 467 | py | Python | bind/pyevt/pyevt/evt_data.py | harrywong/evt | 95985384619e0f5ff4021e8838d421ac4b4b946d | [
"BSD-3-Clause"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | bind/pyevt/pyevt/evt_data.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | bind/pyevt/pyevt/evt_data.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | from io import StringIO
from . import evt_exception, libevt
class EvtData:
def __init__(self, data):
self.data = data
self.evt = libevt.check_lib_init()
def __del__(self):
ret = self.evt.lib.evt_free(self.data)
evt_exception.evt_exception_raiser(ret)
def to_hex_string(se... | 23.35 | 47 | 0.627409 |
b257a9e52146db719e997ed8872a96d99f210459 | 4,000 | py | Python | research/nlp/dscnn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/dscnn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/dscnn/eval.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... | 35.714286 | 114 | 0.6725 |
a23603b7b843cb11a99579993e200710f7f70f18 | 9,071 | py | Python | test/test_npu/test_network_ops/test_bitwise_xor.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_bitwise_xor.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_bitwise_xor.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... | 44.684729 | 92 | 0.653732 |
ac3300de7f3aefafe8411e87cbf809699c355a6f | 258 | py | Python | marsyas-vamp/marsyas/scripts/Python/batchPeakClustering.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/batchPeakClustering.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/batchPeakClustering.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | import os
from glob import glob
beginCommand = "./peakClustering "
endCommand = " -a -s -p 2 -c 3 -o ~/output -N music ";
for name in glob("../../../Database/*V.wav"):
command = beginCommand+name+endCommand
print command
os.system(command)
| 25.8 | 56 | 0.643411 |
ce009968e8640e6d1c77e4d902dc078249782d25 | 2,330 | py | Python | src/onegov/form/extensions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/extensions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/extensions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | form_extensions = {}
class FormExtension(object):
""" Enables the extension of form definitions/submissions.
When either of those models create a form class they will take the
'extensions' key in the meta dictionary to extend those formcode
based forms.
This allows for specialised behaviour of f... | 31.066667 | 79 | 0.663519 |
ce3502f5079fa6852e13265b391e01e6ac109b62 | 967 | py | Python | rivercam.py | OrrinEdenfield/RiverCam | 207f8c623bbcb9dc0cdbbefe91e1fd33bdb0b84e | [
"MIT"
] | null | null | null | rivercam.py | OrrinEdenfield/RiverCam | 207f8c623bbcb9dc0cdbbefe91e1fd33bdb0b84e | [
"MIT"
] | null | null | null | rivercam.py | OrrinEdenfield/RiverCam | 207f8c623bbcb9dc0cdbbefe91e1fd33bdb0b84e | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import datetime
from picamera import PiCamera
from time import sleep
from azure.storage.blob import BlobClient
# Path to temporary local image file
localpic = '/home/pi/rivercam/image.jpg'
# Take photo
camera = PiCamera()
sleep(5)
camera.capture(localpic)
# Create the va... | 30.21875 | 255 | 0.730093 |
02007348627f4ef13c1bf7f02eefb74e199a2762 | 7,788 | py | Python | python/oneflow/test/graph/test_graph_lr_scheduler.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/graph/test_graph_lr_scheduler.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/graph/test_graph_lr_scheduler.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"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... | 32.049383 | 88 | 0.616846 |
cec82a491e48e098ad32e60bf03ec9fd31eb84bc | 696 | py | Python | py/jpy/src/test/python/jpy_obj_test.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | py/jpy/src/test/python/jpy_obj_test.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | py/jpy/src/test/python/jpy_obj_test.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | import unittest
import jpyutil
jpyutil.init_jvm(jvm_maxmem='32M', jvm_classpath=['target/test-classes'])
import jpy
class TestJavaArrays(unittest.TestCase):
def setUp(self):
self.Fixture = jpy.get_type('org.jpy.fixtures.ConstructionTestFixture')
self.assertIsNotNone(self.Fixture)
def test_... | 24.857143 | 79 | 0.668103 |
65146ef8dc35caec09ada8e0674533c36180a7c2 | 4,469 | py | Python | Packs/Dig/Scripts/Dig/Dig.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Dig/Scripts/Dig/Dig.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Dig/Scripts/Dig/Dig.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import re
import subprocess
import traceback
from typing import Any, Dict
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' STANDALONE FUNCTION '''
# Run Dig command on the server and get A record for the specified host
def dig_result(server: str, name: str):
try:
... | 33.103704 | 128 | 0.620944 |
6525e20fd56f57771ac5fa7fed4aacac1e11f0bb | 11,933 | py | Python | train.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | 8 | 2021-03-07T10:25:21.000Z | 2022-02-20T23:57:24.000Z | train.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | train.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | from model.model import SOLO
from train.loss import SOLOLoss
from data.tfrecord_decode import Parser
from config import *
import argparse
from datetime import datetime
import time
import os
import tensorflow as tf
from tensorflow.keras.utils import Progbar
tf.config.run_functions_eagerly(False) # for debugging
@tf.... | 50.138655 | 281 | 0.611162 |
9be16ad025272fbd89cb45d3e090102853d8024d | 799 | py | Python | algorithms/ar-kmp/python3/knuth_morris_pratt.py | NuclearCactus/FOSSALGO | eb66f3bdcd6c42c66e8fc7110a32ac021596ca66 | [
"MIT"
] | 59 | 2018-09-11T17:40:25.000Z | 2022-03-03T14:40:39.000Z | algorithms/ar-kmp/python3/knuth_morris_pratt.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 468 | 2018-08-28T17:04:29.000Z | 2021-12-03T15:16:34.000Z | algorithms/ar-kmp/python3/knuth_morris_pratt.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 253 | 2018-08-28T17:08:51.000Z | 2021-11-01T12:30:39.000Z | #Python program for KMP Algorithm
def LPSArray(pat, M, lps):
lenn = 0
i = 1
while i < M:
if pat[i]== pat[lenn]:
lenn += 1
lps[i] = lenn
i += 1
else:
if lenn != 0:
lenn = lps[lenn-1]
else:
lps[i] = 0
i += 1
def KMP(pat, txt):
M = len(pat)
N = len(txt)
# create lps[] that will hold ... | 15.98 | 75 | 0.545682 |
500302a6edbc0f78c26797058326cae2f1dd7b5b | 2,624 | py | Python | test/test_npu/test_network_ops/test_dropout.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_dropout.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_dropout.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.485714 | 77 | 0.640625 |
a844b552f292190f3c5fa040f3621afb025f7afe | 7,164 | py | Python | solutions/block_demo/.utility/python/transymodem.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | solutions/block_demo/.utility/python/transymodem.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | solutions/block_demo/.utility/python/transymodem.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# version 1.0.1
import os
import sys
import re
import codecs
import time
import json
import argparse
import inspect
from ymodemfile import YModemfile
try:
import serial
from serial.tools import miniterm
from serial.tools.list_ports import comports
except:
... | 28.887097 | 100 | 0.61139 |
a85d442ed83636a731ffbcfcd4c75ba8be7db01f | 6,710 | py | Python | src/onegov/swissvotes/views/votes.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/views/votes.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/views/votes.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath.request import Response
from onegov.core.security import Private
from onegov.core.security import Public
from onegov.core.security import Secret
from onegov.form import Form
from onegov.swissvotes import _
from onegov.swissvotes import SwissvotesApp
from onegov.swissvotes.collections import SwissVoteColle... | 28.432203 | 79 | 0.609836 |
766491d3189d2ce4581c010a835c2c7cde8bdabf | 12,034 | py | Python | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/lab_test/lab_test.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/lab_test/lab_test.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/lab_test/lab_test.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from frappe.utils import getdate
from erpnext.healthcare.doctype.healthcare_settings.healthca... | 40.655405 | 190 | 0.781951 |
4f933cca9a376532a3bc93f78b79788387ab7bbc | 7,565 | py | Python | GZP_GTO_ArcMap/scripts/SCR_PFLICHT_Layer.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_ArcMap/scripts/SCR_PFLICHT_Layer.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_ArcMap/scripts/SCR_PFLICHT_Layer.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | # -*- coding: utf-8 -*-
"""
@author: ms.gis, June 2020
Script for ArcGIS GTO for Modul GZP
"""
##
import arcpy
import pythonaddins
## -------------------------
# Open progress dialog
with pythonaddins.ProgressDialog as dialog:
dialog.title = "PRUEFUNG PFLICHTDATENSAETZE"
dialog.description = "Pruefe Pflicht... | 35.186047 | 132 | 0.556642 |
8c31138dac71ba403f727368ec698d659c9472d2 | 724 | py | Python | Contrib-Inspur/openbmc/poky/meta/lib/oeqa/core/decorator/oetag.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/meta/lib/oeqa/core/decorator/oetag.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/meta/lib/oeqa/core/decorator/oetag.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
from . import OETestFilter, registerDecorator
from oeqa.core.utils.misc import strToList
def _tagFilter(tags, filters):
return False if set(tags) & set(filters) else True
@registerDecorator
class OETestTag(OETestFilter):
attrs = ('oe... | 25.857143 | 58 | 0.64779 |
50732a571e7539bcf8baed6e3621eb01035feddf | 494 | py | Python | transonic/_version.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/_version.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/_version.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | __version__ = "0.4.11"
try:
from pyfiglet import figlet_format
__about__ = figlet_format("transonic", font="big")
except ImportError:
__about__ = r"""
_ _
| | (_)
| |_ _ __ __ _ _ __ ___ ___ _ __ _ ___
| __| '__/ _` | '_ \/ __|/ _ \| ... | 26 | 65 | 0.44332 |
50dab888c31c96d59e83e825951242229f8cf7db | 1,316 | py | Python | app/username/views.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | app/username/views.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | 4 | 2020-08-29T16:11:12.000Z | 2022-03-12T00:47:03.000Z | app/username/views.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | # coding: utf-8
from StringIO import StringIO
from flask import send_file,redirect,url_for,flash
from . import username
from flask import render_template,request
from flask_login import login_required
from ..models import User,Article
@username.route('/<int:id>')
def detials(id):
user=User.query.get_or_404(id)
... | 32.097561 | 101 | 0.68997 |
ba2119f32355417c2644809bb5d6b273bb820282 | 1,876 | py | Python | ppyt/decorators.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 4 | 2016-08-16T07:47:15.000Z | 2017-12-11T10:08:47.000Z | ppyt/decorators.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | null | null | null | ppyt/decorators.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 2 | 2018-06-15T04:43:15.000Z | 2020-05-02T07:47:15.000Z | # coding: utf-8
import logging
from functools import wraps
from ppyt.exceptions import NoDataError
logger = logging.getLogger(__name__)
def handle_nodataerror(nodata_return):
"""NoDataErrorを処理するデコレータです。
このデコレータをつけておくと、内部でNoDataErrorが発生したときに[nodata_return]が返るようになります。
Args:
nodata_return: NoDataEr... | 28 | 71 | 0.632196 |
e8b1cc345188ec2513c3e78f2624627d00892d95 | 3,585 | py | Python | sentence_parser.py | hch-NLP/LTP | 4eaba8d33c20127a5cf75e17c6bbcc62574dcfb1 | [
"Apache-2.0"
] | 1 | 2020-11-23T05:04:18.000Z | 2020-11-23T05:04:18.000Z | sentence_parser.py | hch-NLP/LTP | 4eaba8d33c20127a5cf75e17c6bbcc62574dcfb1 | [
"Apache-2.0"
] | null | null | null | sentence_parser.py | hch-NLP/LTP | 4eaba8d33c20127a5cf75e17c6bbcc62574dcfb1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# File: sentence_parser.py
# Author: HKH<xtuhch@163.com>
# Date: 18-3-10
import os
from pyltp import Segmentor, Postagger, Parser, NamedEntityRecognizer, SementicRoleLabeller
class LtpParser:
def __init__(self):
LTP_DIR = "F:\\LTP\\ltp_data_v3.4.0\\"
... | 42.176471 | 116 | 0.614226 |
a8fd55aaa3ed3b16b9a4ac6ecf440894a3b0fc20 | 7,186 | py | Python | skaffold-STABLE/webapp/hello.py | LennartFertig/BigData | e74761b16812fd034519c06897329ea9ba9968df | [
"Apache-2.0"
] | null | null | null | skaffold-STABLE/webapp/hello.py | LennartFertig/BigData | e74761b16812fd034519c06897329ea9ba9968df | [
"Apache-2.0"
] | null | null | null | skaffold-STABLE/webapp/hello.py | LennartFertig/BigData | e74761b16812fd034519c06897329ea9ba9968df | [
"Apache-2.0"
] | 1 | 2021-10-19T07:45:12.000Z | 2021-10-19T07:45:12.000Z | from flask import Flask, render_template, request, redirect, url_for, flash
import emoji
import socket
import psycopg2
from pymemcache.client.base import Client
from essential_generators import DocumentGenerator
from kafka import KafkaProducer
# Lennart, 26.8
# from flask_caching import Cache
client = Client('memcached... | 34.883495 | 120 | 0.655998 |
0f2110fe2a5c2a18715a941c83b81ee45eb98923 | 320 | py | Python | udacity course code/01-03-numpyarrayattributes.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 1 | 2021-03-22T22:25:54.000Z | 2021-03-22T22:25:54.000Z | udacity course code/01-03-numpyarrayattributes.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 6 | 2017-01-16T09:53:21.000Z | 2017-01-18T12:20:09.000Z | udacity course code/01-03-numpyarrayattributes.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | null | null | null | """Array attributes."""
import numpy as np
def test_run():
# Generate an array full of random numbers, uniformly distributed from [0.0, 1.0)
a = np.random.random((5, 4))
print a
print a.shape
print len(a,shape)
print a.size
print a.dtype
if __name__ == "__main__":
test_run()
| 18.823529 | 85 | 0.61875 |
0f3d9e11e63c47d832dad04123d10ac7e6934e64 | 2,065 | py | Python | private_sdk/signature.py | teambge/bge-private-sdk | b27d4a6caf35bcb89a260938260fd75dba173311 | [
"MIT"
] | null | null | null | private_sdk/signature.py | teambge/bge-private-sdk | b27d4a6caf35bcb89a260938260fd75dba173311 | [
"MIT"
] | null | null | null | private_sdk/signature.py | teambge/bge-private-sdk | b27d4a6caf35bcb89a260938260fd75dba173311 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from base64 import b64encode
from datetime import datetime, timezone, timedelta
from uuid import uuid4
try:
from urllib import quote, quote_plus
except ImportError:
from urllib.parse import quote, quote_plus
import string
import hmac
class Signature(object):
salt = string.ascii_l... | 31.287879 | 75 | 0.614528 |
0e3290b35fe588287504328fa4f6b276bb7421d0 | 911 | py | Python | jumeaux/addons/final/json.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/final/json.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/final/json.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from owlmixin import OwlMixin, TOption
from jumeaux.addons.final import FinalExecutor
from jumeaux.models import FinalAddOnPayload, FinalAddOnReference
from jumeaux.logger import Logger
logger: Logger = Logger(__name__)
class Config(OwlMixin):
sysout: bool = False
indent: TOption[int... | 29.387097 | 100 | 0.675082 |
0e9efacad3b0ff51bec1249b715d4eda1c1e68af | 5,962 | py | Python | pvtool/routes/_measurement.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | 1 | 2019-10-31T13:34:12.000Z | 2019-10-31T13:34:12.000Z | pvtool/routes/_measurement.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | 1 | 2019-05-27T13:03:25.000Z | 2019-05-27T13:03:25.000Z | pvtool/routes/_measurement.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | null | null | null | """Overview of all Measurements and linked functions such as uploading removing and single view of measurement"""
import os
from werkzeug.utils import secure_filename
from flask import Blueprint, render_template, request, redirect, flash, g, current_app, url_for
from flask_login import current_user, login_required
from... | 43.202899 | 119 | 0.69423 |
383966bec51a678c93133bca8d324981bf23e90d | 7,526 | py | Python | sdd-db/cronjobs/db_upload_energy.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | sdd-db/cronjobs/db_upload_energy.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | sdd-db/cronjobs/db_upload_energy.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | """ Uploads Corona data from Zeit online
Note: infected numbers are known infections on a particular day.
Dead and Recovered numbers were summed up until today. """
import os
import pandas as pd
from datetime import datetime, timedelta
import pytz
# compatibility with ipython
try:
__IPYTHON__
os.chdir(os.path.dirn... | 34.054299 | 406 | 0.680973 |
69afcb6111e2b727f9b4db4fba7fb9a04892dfe5 | 1,099 | py | Python | time/plot.py | gray0018/Normal-integration-benchmark | 3f4fff86e659ae2a3588c0960ebb0af39e4a1e21 | [
"MIT"
] | null | null | null | time/plot.py | gray0018/Normal-integration-benchmark | 3f4fff86e659ae2a3588c0960ebb0af39e4a1e21 | [
"MIT"
] | null | null | null | time/plot.py | gray0018/Normal-integration-benchmark | 3f4fff86e659ae2a3588c0960ebb0af39e4a1e21 | [
"MIT"
] | null | null | null | import numpy as np
import operator
import matplotlib.pyplot as plt
import json
import os
# directory = '.'
# d = {}
# for filename in os.listdir(directory):
# if filename.endswith(".npy"):
# t = np.load(filename)
# d[filename[:-4]] = float(t)
# j = json.dumps(d)
# f = open("woloop.json","w")
# f.w... | 24.422222 | 61 | 0.658781 |
69ecdf48286aae4a1eb103b7ce4eaaa1dafeab2e | 6,300 | py | Python | src/onegov/fsi/views/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/views/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/views/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.html import html_to_text
from onegov.core.security import Private, Secret, Personal
from onegov.core.templates import render_template
from onegov.fsi import FsiApp
from onegov.fsi.collections.course import CourseCollection
from onegov.fsi.collections.course_event import CourseEventCollection
from onego... | 27.038627 | 77 | 0.628254 |
38dce8febadffc6a8a290ffb214c1ae017cc58f2 | 4,673 | py | Python | RDS/circle1_adapters_and_ports/port_openscienceframework/tests/server/example.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle1_adapters_and_ports/port_openscienceframework/tests/server/example.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle1_adapters_and_ports/port_openscienceframework/tests/server/example.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import json
# Use this to initialize a `Project` instance
node_json = """
{
"data": {
"relationships": {
"files": {
"links": {
"related": {
"href": "https://api.osf.io/v2/nodes/f3szh/files/",
"meta": {}
}
}
},
"view_only_links": {
... | 23.482412 | 91 | 0.395035 |
c7fa2d7b6279fbc16ddf225ebbef4fbcd6439d6d | 2,204 | py | Python | Grundlagen/Python/Minensucher/minensucher.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 2 | 2020-09-24T12:11:16.000Z | 2022-03-31T04:47:24.000Z | Grundlagen/Python/Minensucher/minensucher.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 1 | 2021-02-27T15:06:27.000Z | 2021-03-01T16:32:48.000Z | Grundlagen/Python/Minensucher/minensucher.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 1 | 2021-02-24T05:12:35.000Z | 2021-02-24T05:12:35.000Z |
from random import randint
FELD_BREITE = 15
FELD_HOEHE = 10
ANZAHL_MINEN = randint(
int(FELD_BREITE * FELD_HOEHE * 0.1), int(FELD_BREITE * FELD_HOEHE * 0.2)
)
WIDTH = FELD_BREITE * 20
HEIGHT = FELD_HOEHE * 20
feld = []
def minen_verteilen(anzahl):
for i in range(FELD_BREITE):
fe... | 25.929412 | 89 | 0.503176 |
2d83515d3b2c0545f64c14bb473a19cac246deff | 168 | py | Python | nz_django/day1/urls_include_demo/book/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day1/urls_include_demo/book/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day1/urls_include_demo/book/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('detail/<int:book_id>/', views.book_detail,{'name':'kangbazi'}),
]
| 24 | 73 | 0.666667 |
933cb13bc7fe5bd1b62885cb8b25ce8a810ed468 | 2,082 | py | Python | Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | from CommonServerPython import *
COMMAND_NAME = 'netstat'
def get_netstat_file_name(command_files):
if command_files and isinstance(command_files, dict):
netstat_files = command_files.get(COMMAND_NAME, [])
if netstat_files:
if isinstance(netstat_files, list):
# we want... | 33.580645 | 99 | 0.650336 |
35c47dafeebb19ee587dafd46dfb9444757360e8 | 352 | py | Python | Packs/CommonScripts/Scripts/DumpJSON/DumpJSON.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/DumpJSON/DumpJSON.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/DumpJSON/DumpJSON.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
key = demisto.args()['key']
obj_str = json.dumps(demisto.get(demisto.context(), key))
demisto.setContext('JsonStr', obj_str)
return_results(obj_str)
if __name__ in ('__main__', '__buil... | 22 | 61 | 0.6875 |
35d1681b32652ae64d777846da7fc45306f656ec | 476 | py | Python | ___Python/Angela/PyKurs/p07_file_io/m01_count_files.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p07_file_io/m01_count_files.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p07_file_io/m01_count_files.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
# Zaehle die Anzahl Ordner in einem Ordner (inkl. allen Unterordnern)
def count_dirs(path):
subdirs = [subdir for subdir in path.iterdir() if subdir.is_dir()] #Bestimme die direkten Unterordner des Ordners path
count = 1 # Spielwiese selbst
for subdir in subdirs:
... | 29.75 | 123 | 0.701681 |
ea420c4d8691173ecb3f646afb940711d48ce24a | 484 | py | Python | experiment/ea/make_tweet_tokenized_data_master.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | experiment/ea/make_tweet_tokenized_data_master.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | experiment/ea/make_tweet_tokenized_data_master.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | from tqdm import tqdm
import pymongo
import redis
import json
from bson import json_util
client = pymongo.MongoClient('localhost:27017')
db = client.tweet
r = redis.StrictRedis(host='localhost', port=6379, db=0)
events = [e for e in db.current_event.find({},{'_id':1})]
def send_message(eid):
message = {'event_... | 25.473684 | 65 | 0.725207 |
57741b8c449b1a45735b70561ed716e153f13b4e | 943 | py | Python | venv/Lib/site-packages/pynance/tst/unit/data/test_compare.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/tst/unit/data/test_compare.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/tst/unit/data/test_compare.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
Tests for performance comparison functions.
Copyright (c) 2016 Marshall Farrier
license http://opensource.org/licenses/MIT
"""
import unittest
import numpy as np
import pandas as pd
import pynance as pn
class TestCompare(unittest.TestCase):
def test_compare(self):
rng = pd.date_range('2016-03-28',... | 30.419355 | 108 | 0.610817 |
57de2bd1b9fbd5865d36e8b81853868fd4548e1b | 620 | py | Python | comp/yelp/onsite2/MinCoinNum_swirl_streaming.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/yelp/onsite2/MinCoinNum_swirl_streaming.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/yelp/onsite2/MinCoinNum_swirl_streaming.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Think about another ways
def mincoin(coins, target):
# coins: positive nums
coins.sort()
cand = set(coins)
minnums = [0] * target
cnt = 0
while len(cand) != 0:
cnt += 1
newcand = set()
for c in cand:
minnums[c] = cnt
for coin in coins:
... | 20.666667 | 41 | 0.41129 |
17b32a03eacb3b7786a65a8d9678832d9e175f53 | 857 | py | Python | tools/pythonpkg/tests/fast/arrow/test_multiple_reads.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/arrow/test_multiple_reads.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/arrow/test_multiple_reads.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
import os
try:
import pyarrow
import pyarrow.parquet
can_run = True
except:
can_run = False
class TestArrowReads(object):
def test_multiple_queries_same_relation(self, duckdb_cursor):
if not can_run:
return
parquet_filename = os.path.join(os.path.dirname(os... | 38.954545 | 118 | 0.697783 |
aa0112abd3623d59b95270b5dbc850092d2947d8 | 101 | py | Python | python_lessons/python_test/second_python.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/python_test/second_python.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/python_test/second_python.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | # second python test
# write via GNU nano MacBook Pro MMartin
n = 10
for i in range(n):
print(i)
| 12.625 | 40 | 0.683168 |
aa293795336e1733f07e56c3faa8c985e7a7dfa2 | 1,111 | py | Python | src/python3_learn_video/BIF_closure.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/BIF_closure.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/BIF_closure.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | # global 关键字
print('-----------------------------------')
count = 5
def MyFun():
count = 10
print(count)
MyFun()
print(count)
print('-----------------------------------')
def MyFun():
global count
count = 10
print(count)
MyFun()
print(count)
print('-----------------------------------')
de... | 13.070588 | 44 | 0.338434 |
a4b16b9a02b8e34f41e02a71006951401e22f714 | 1,009 | py | Python | Packs/PaloAltoNetworks_IoT3rdParty/Scripts/GeneratePANWIoTDeviceTableQueryForServiceNow/GeneratePANWIoTDeviceTableQueryForServiceNow.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworks_IoT3rdParty/Scripts/GeneratePANWIoTDeviceTableQueryForServiceNow/GeneratePANWIoTDeviceTableQueryForServiceNow.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworks_IoT3rdParty/Scripts/GeneratePANWIoTDeviceTableQueryForServiceNow/GeneratePANWIoTDeviceTableQueryForServiceNow.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
def main():
device_list = demisto.args().get('devices')
query_strs = []
query_str = 'mac_addressIN'
DEFAULT_VALUE_SIZE = 100 # each query contains 100 deviceid
res = {}
output_description = f'Total dat... | 30.575758 | 91 | 0.650149 |
1035e02df02cb8357fc290dc2aba63b6c1ba4281 | 1,640 | py | Python | backend/utils/id_generator.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 10 | 2020-03-20T19:14:43.000Z | 2020-10-29T21:31:40.000Z | backend/utils/id_generator.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 41 | 2020-03-20T20:27:55.000Z | 2020-03-24T21:49:37.000Z | backend/utils/id_generator.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 1 | 2020-03-21T09:31:51.000Z | 2020-03-21T09:31:51.000Z | import random
import time
from hashlib import sha1
random.seed()
WORDLIST = {
'adjective': [
'angenehm', 'attraktiv', 'aufmerksam', 'bunt', 'blau', 'charmant',
'dankbar', 'edel', 'frei', 'gelb', 'glatt', 'hell', 'ideal', 'jung',
'leicht', 'lieb', 'luftig', 'mutig', 'nah', 'neu', 'offen', '... | 33.469388 | 79 | 0.54939 |
f4e559ef07486c1df08e4e0937f04c329444508d | 2,126 | py | Python | books/PythonCleanCode/ch6_descriptors/descriptors_methods_4.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch6_descriptors/descriptors_methods_4.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch6_descriptors/descriptors_methods_4.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 6: Descriptors
> Methods of the descriptor interface: __set_name__
"""
from log import logger
class DescriptorWithName:
"""This descriptor requires the name to be explicitly set."""
def __init__(self, name):
self.name = name
def __get__(self, ins... | 26.575 | 81 | 0.660395 |
df4ccadd48ef65ce73e0ea13f4e72f45bf8f773d | 381 | py | Python | INBa/2015/RotkinAM/Zadacha_2_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/RotkinAM/Zadacha_2_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/RotkinAM/Zadacha_2_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 21.
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Леонардо да Винчи. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Rotkin A.M.
# 02.04.2016
print ('За сладкое приходтся горько расплачиваться')
prin... | 42.333333 | 210 | 0.779528 |
df762fc47e8e0a8f06d11c71436c63aab26e2183 | 398 | py | Python | api/app.py | singhprincejeet/in_poster | 1b0e18631ebede94e679eb0aba6c8e7630a02aba | [
"MIT"
] | null | null | null | api/app.py | singhprincejeet/in_poster | 1b0e18631ebede94e679eb0aba6c8e7630a02aba | [
"MIT"
] | 4 | 2021-04-30T21:09:19.000Z | 2022-03-12T00:19:12.000Z | api/app.py | singhprincejeet/in_poster | 1b0e18631ebede94e679eb0aba6c8e7630a02aba | [
"MIT"
] | null | null | null | from flask import Flask, request, send_file
from main_controller import MainController
app = Flask(__name__)
@app.route('/generate', methods=['POST'])
def generate():
image_src = MainController().generate_image(request)
return send_file(image_src)
@app.route('/ping', methods=['GET'])
def ping():
... | 23.411765 | 57 | 0.673367 |
33a49dcb8909ea1581dc4d90f918e7844abada00 | 223 | py | Python | WD/Cwiczenia/Kwadraty_w_petli.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | 1 | 2020-02-29T14:38:33.000Z | 2020-02-29T14:38:33.000Z | WD/Cwiczenia/Kwadraty_w_petli.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | WD/Cwiczenia/Kwadraty_w_petli.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | #2 ćwiczenia
#zadanie 7
ile=input("Podaj ile chcesz wczytać liczb: ")
ile=int(ile)
for i in range(ile):
liczba=input("Podaj liczbę numer "+str(i)+": ")
liczba=int(liczba)
print(str(liczba**2))
| 18.583333 | 52 | 0.609865 |
8938bff55d9a25b0a08b3653bc1b868f9bcab4d6 | 716 | py | Python | 30_days_of_Code/15_linked_list.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | 30_days_of_Code/15_linked_list.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | 30_days_of_Code/15_linked_list.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
class Node:
def __init__(self, data):
self.data = data
self.next = None
class Solution:
def display(self, head):
current = head
while current:
print(current.data, end=' ')
current = current.next
def insert(self, head, data):
... | 20.457143 | 40 | 0.519553 |
98359bcafb43958d81e407a2ccbc55ca959dfeb4 | 10,932 | py | Python | XlsxTools/xls2json/Tools/xls2json.py | maplelearC/Unity3DTraining | 3824d5f92c5fce5cbd8806feb1852e9a99e4a711 | [
"MIT"
] | 3,914 | 2017-01-20T04:55:53.000Z | 2022-03-31T18:06:12.000Z | XlsxTools/xls2json/Tools/xls2json.py | maplelearC/Unity3DTraining | 3824d5f92c5fce5cbd8806feb1852e9a99e4a711 | [
"MIT"
] | 5 | 2019-12-17T05:27:58.000Z | 2022-01-20T11:55:33.000Z | XlsxTools/xls2json/Tools/xls2json.py | maplelearC/Unity3DTraining | 3824d5f92c5fce5cbd8806feb1852e9a99e4a711 | [
"MIT"
] | 1,263 | 2017-01-15T09:54:44.000Z | 2022-03-31T14:59:11.000Z | # -*- coding: utf-8 -*-
import os,sys,importlib
import xml.etree.ElementTree as ET
import xdrlib,xlrd
# 防止中文乱码
importlib.reload(sys)
#配置文件名
CONFIG_NAME = "config.ini"
#保存文件类型
SAVE_FILE_TYPE = ".json"
#保存映射类类型
SAVE_MAPPING_TYPE = ".cs"
#分隔符
SPLIT_CAHR = ":"
#表格路径
XLS_PATH = ""
#解析路径
XML_PATH = ""
#导出路径
OUT_PATH = ""... | 36.198675 | 171 | 0.608214 |
9846d7a929dfc7206aaef3926e2eb249dc72eda7 | 30 | py | Python | notebooks/utils/tui/__init__.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | 1 | 2021-03-15T11:53:40.000Z | 2021-03-15T11:53:40.000Z | python/progress/__init__.py | pedromxavier/cookbook | 243532f893651c34e70fbba8a52f3f129dbc8dd3 | [
"MIT"
] | 2 | 2020-03-24T17:06:03.000Z | 2020-03-31T02:16:40.000Z | python/progress/__init__.py | pedromxavier/cookbook | 243532f893651c34e70fbba8a52f3f129dbc8dd3 | [
"MIT"
] | null | null | null | from .progress import Progress | 30 | 30 | 0.866667 |
120b99a0975e33345360483fef0a78b371c52141 | 2,633 | py | Python | ai/split-chinese/jieba-base.py | veaba/ncov | 6019f6b90761fd39363f8a7182ffcee22b9cb7ed | [
"MIT"
] | 288 | 2020-01-21T06:12:03.000Z | 2022-01-16T08:03:13.000Z | ai/split-chinese/jieba-base.py | veaba/ncov | 6019f6b90761fd39363f8a7182ffcee22b9cb7ed | [
"MIT"
] | 26 | 2020-01-20T05:07:31.000Z | 2022-03-12T00:24:56.000Z | ai/split-chinese/jieba-base.py | veaba/ncov | 6019f6b90761fd39363f8a7182ffcee22b9cb7ed | [
"MIT"
] | 48 | 2020-01-22T09:05:59.000Z | 2022-01-16T08:03:11.000Z | # encoding=utf-8
import jieba.posseg as psg
# string="来到北京清华大学"
string ="""
4月12日0—24时,31个省(自治区、直辖市)和新疆生产建设兵团报告新增确诊病例108例,其中98例为境外输入病例,10例为本土病例(黑龙江7例,广东3例);新增死亡病例2例(湖北2例);新增疑似病例6例,均为境外输入病例(黑龙江4例,上海2例)。
当日新增治愈出院病例88例,解除医学观察的密切接触者1092人,重症病例减少18例。
境外输入现有确诊病例867例(含重症病例38例),现有疑似病例72例。累计确诊病例1378例,累计治愈出院病例511例,无死亡病例。
... | 65.825 | 179 | 0.550703 |
89d9e48927ec828fd9208dc357f86ea67a28a09c | 793 | py | Python | scripts/add_come.py | belamu/kanthaus.online | de84010a77e60156cbefb8e014ac6290540ded69 | [
"CC0-1.0",
"MIT"
] | 6 | 2018-09-03T15:48:19.000Z | 2021-09-27T12:04:04.000Z | scripts/add_come.py | belamu/kanthaus.online | de84010a77e60156cbefb8e014ac6290540ded69 | [
"CC0-1.0",
"MIT"
] | 13 | 2017-12-25T20:44:37.000Z | 2020-10-30T09:37:10.000Z | scripts/add_come.py | belamu/kanthaus.online | de84010a77e60156cbefb8e014ac6290540ded69 | [
"CC0-1.0",
"MIT"
] | 14 | 2018-01-05T19:54:40.000Z | 2021-03-24T10:16:31.000Z | #!/usr/bin/env python3
# Usage: ./scripts/add_come.py
url = "https://codi.kanthaus.online/come/download"
import urllib.request
with urllib.request.urlopen(url) as response:
markdown = response.read().decode()
import yaml
parts = markdown.split('---')
frontmatter = parts[1]
frontmatter = yaml.safe_load(frontmatte... | 27.344828 | 82 | 0.741488 |
143a71f0538e957183a42d1dc096bccb0dd0d05c | 345 | py | Python | Problems/Two Pointers/easy/MergeStringAlternately/test_merge_string_alternately.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Two Pointers/easy/MergeStringAlternately/test_merge_string_alternately.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Two Pointers/easy/MergeStringAlternately/test_merge_string_alternately.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from merge_string_alternately import mergeAlternately
class Test(TestCase):
def test_merge_alternately(self):
self.assertEqual(mergeAlternately("abc", "pqr"), "apbqcr")
self.assertEqual(mergeAlternately("ab", "pqrs"), "apbqrs")
self.assertEqual(mergeAlternately... | 43.125 | 66 | 0.727536 |
1ae63296d699c65a0bd047816b0e603a4cff99eb | 5,841 | py | Python | hplc_analysis.py | furubayashim/hplc-analysis-hitachi | d8f2b594b577032548e860b424f55241bbe72b37 | [
"MIT"
] | null | null | null | hplc_analysis.py | furubayashim/hplc-analysis-hitachi | d8f2b594b577032548e860b424f55241bbe72b37 | [
"MIT"
] | null | null | null | hplc_analysis.py | furubayashim/hplc-analysis-hitachi | d8f2b594b577032548e860b424f55241bbe72b37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# script to draw PDA chromatogram & spectrum figure using Hitachi HPLC Chromaster stx/ctx files
import pandas as pd
import numpy as np
import glob
import os
import sys
import matplotlib.pyplot as plt
# change this if using different user/folder
data_dir = "raw/"
# can give sample name file as ... | 41.721429 | 349 | 0.640644 |
2ee382ef7e4e52fef0695c81d210f8710fbaae22 | 26,869 | py | Python | kiosk/models.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | kiosk/models.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | kiosk/models.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from dateutil import tz
import pytz
from datetime import date
from django.core.validators import MinValueValidator
from django.db import transaction
from profil.models import KioskUser
from django.db import connection
from django.conf import settings
from ... | 37.526536 | 354 | 0.737318 |
d31caf04cb9c133ec4d3c2c4da1c9cc2f19a7a62 | 553 | py | Python | module_functions.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | module_functions.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | module_functions.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | import platform
import os
def creation_date(path_to_file):
if platform.system() == 'Windows':
return os.path.getctime(path_to_file)
else:
stat = os.stat(path_to_file)
try:
return stat.st_birthtime
except AttributeError:
# We're probably on Linux. No easy ... | 27.65 | 78 | 0.60217 |
9f701bc08c1c4dfe533065e4d0ee3002ac64f361 | 1,661 | py | Python | c++basic/DATA_STRUCTURES/prime_mult.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | c++basic/DATA_STRUCTURES/prime_mult.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | c++basic/DATA_STRUCTURES/prime_mult.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from multiprocessing.pool import ThreadPool
import datetime
import numpy as np
import math
def __is_divisible__(a,b):
if a%b == 0:
return 1
return 0
def isPrime_n(a):
#is prime noob
k=0
for i in range(2,a-1):
if __is_divisible__(a,i) == 1:
k=1
break
if k... | 20.506173 | 73 | 0.5587 |
e290dde6888c2655675fa623360f1477b47adc7f | 5,415 | py | Python | app/freelancer/tests/test_profile.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/freelancer/tests/test_profile.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/freelancer/tests/test_profile.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | 1 | 2022-03-06T17:44:49.000Z | 2022-03-06T17:44:49.000Z | import os, tempfile
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import test, status
from rest_framework.test import APIClient
from core.models import Profile, Address, Gig, Education
from freelancer.serial... | 28.650794 | 88 | 0.635272 |
e2aefdb5d4c4918146034a0834daf3d3d9bd181b | 1,173 | py | Python | website/python/app.py | man-r/DimensionsLab | c94c3aec0d52326ad522a6fa41d43ec3bde87d74 | [
"MIT"
] | null | null | null | website/python/app.py | man-r/DimensionsLab | c94c3aec0d52326ad522a6fa41d43ec3bde87d74 | [
"MIT"
] | 1 | 2022-03-24T06:13:52.000Z | 2022-03-24T06:13:52.000Z | website/python/app.py | man-r/DimensionsLab | c94c3aec0d52326ad522a6fa41d43ec3bde87d74 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
users = [
{
"name": "Nicholas",
"age": 42,
"occupation": "Network Engineer"
},
{
"name": "Elvin",
"age": 32,
"occupation": "Doctor"
},
{
... | 19.881356 | 66 | 0.58994 |
394e6287c45dd4b169b78862df54b129511b5346 | 1,495 | py | Python | test_pyparsing_3_1.py | luluci/gui_env | 9c2ffe331c2dc8a7e128474ce9590498082de569 | [
"MIT"
] | null | null | null | test_pyparsing_3_1.py | luluci/gui_env | 9c2ffe331c2dc8a7e128474ce9590498082de569 | [
"MIT"
] | null | null | null | test_pyparsing_3_1.py | luluci/gui_env | 9c2ffe331c2dc8a7e128474ce9590498082de569 | [
"MIT"
] | null | null | null | import pyparsing as pp
def act_comment(token):
print("comment: " + str(token))
def act_keyword(token):
print("keyword: " + str(token))
def act_sc(token):
print("semicolon: " + str(token))
def act_parser_start(token):
print("parser_start: " + str(token))
def act_parser_end(token):
print("parser_end: " + s... | 19.166667 | 69 | 0.646154 |
200a07a8f6c323cf28ccdef7bc5e7ac20a331280 | 206 | py | Python | src/onegov/winterthur/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.winterthur.forms.mission_report import MissionReportForm
from onegov.winterthur.forms.mission_report import MissionReportVehicleForm
__all__ = ('MissionReportForm', 'MissionReportVehicleForm')
| 41.2 | 75 | 0.868932 |
6490cc9b76431e255aeab4722b02c97b8014ad01 | 5,628 | py | Python | src/flocker/blueprints/mvg-frame/__init__.py | Muxelmann/home-projects | 85bd06873174b9c5c6276160988c19b460370db8 | [
"MIT"
] | null | null | null | src/flocker/blueprints/mvg-frame/__init__.py | Muxelmann/home-projects | 85bd06873174b9c5c6276160988c19b460370db8 | [
"MIT"
] | null | null | null | src/flocker/blueprints/mvg-frame/__init__.py | Muxelmann/home-projects | 85bd06873174b9c5c6276160988c19b460370db8 | [
"MIT"
] | null | null | null | import os
import time
from flask import Blueprint, render_template, redirect, url_for, request, current_app
from . import mvg
from . import displays
from PIL import Image, ImageFont, ImageDraw
def create_bp(app):
bp_mvg = Blueprint('mvg-frame', __name__, url_prefix='/mvg-frame')
displays.init(app)
@bp_m... | 39.083333 | 122 | 0.555792 |
b3dac29fab9b30a15f3567e16ce2def62510c239 | 5,959 | py | Python | src/main/apps/mlops/utils/model_loader.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | 2 | 2021-08-23T21:56:07.000Z | 2022-01-20T13:52:19.000Z | src/main/apps/mlops/utils/model_loader.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | src/main/apps/mlops/utils/model_loader.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | import numpy as np
import os
from .file_loader import (
CatsvsdogsFileLoader,
FashionMnistFileLoader,
ImdbSentimentFileLoader,
StackoverflowFileLoader,
)
from .model_input import ModelInputGenerator
from .output_decoder import OutputDecoder
from .pipeline import Pipeline
from .preprocessing import pipe... | 35.260355 | 116 | 0.664205 |
37369717bf4744bf752a9e5e1db557ed280d3c7a | 496 | py | Python | Blatt-02/Sonstiges/tribonacci.py | MartinThoma/prog-ws1213 | c82a2fb81bac774f8d3214a25c33124a9f512ef0 | [
"MIT"
] | 1 | 2017-08-10T13:12:03.000Z | 2017-08-10T13:12:03.000Z | Blatt-02/Sonstiges/tribonacci.py | siviaseason/prog-ws1213 | c82a2fb81bac774f8d3214a25c33124a9f512ef0 | [
"MIT"
] | null | null | null | Blatt-02/Sonstiges/tribonacci.py | siviaseason/prog-ws1213 | c82a2fb81bac774f8d3214a25c33124a9f512ef0 | [
"MIT"
] | 2 | 2016-06-08T20:56:04.000Z | 2022-03-11T20:12:37.000Z | def tribonacci(n):
if n < 3:
return n
else:
return tribonacci(n-1) + tribonacci(n-2) + tribonacci(n-3)
def tribonacciBottomUp(n):
last = 1
secondLast = 1
thirdLast = 1
for i in range(2,n):
new = last + secondLast + thirdLast
thirdLast = secondLast
secondL... | 21.565217 | 73 | 0.568548 |
03fcad1d1936cee28640a02b1c3ebdfc5c4cd278 | 53 | py | Python | python_lessons/MtMk_Test_Files/numpy_test.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/MtMk_Test_Files/numpy_test.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/MtMk_Test_Files/numpy_test.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | import numpy as np
arr = np.arange(0,11)
print(arr) | 17.666667 | 22 | 0.698113 |
45a6eb2cafb85abd876f4684bf56dbe0066463d9 | 16,694 | py | Python | research/cv/eppmvsnet/src/networks.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/eppmvsnet/src/networks.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/eppmvsnet/src/networks.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... | 41.424318 | 117 | 0.636157 |
94216394fa225ea1e01514370a7ab54fc7850fd6 | 4,394 | py | Python | StateTracing/dataloader.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | StateTracing/dataloader.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | StateTracing/dataloader.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | 1 | 2020-09-08T13:42:16.000Z | 2020-09-08T13:42:16.000Z | from torch import tensor
from numpy.random import choice,shuffle
max_len = 128
def random_cut(length):
s = choice(length-max_len+1)
return s,s+max_len
def differeniate(statesA,statesB):
return [[i,b] for i,(a,b) in enumerate(zip(map(int,statesA),map(int,statesB))) if b!=a]
def generate_targe... | 26.46988 | 92 | 0.466318 |
84aa7a485b23bade222cd7a7bb91c2a1c86b90b1 | 5,893 | py | Python | research/cv/centernet_det/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/centernet_det/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/centernet_det/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # !/usr/bin/env python
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 applica... | 35.077381 | 108 | 0.642797 |
17042212e5fa71f184651ff1dc382b9b9ed9f1a9 | 1,278 | py | Python | research/cv/MaskedFaceRecognition/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/MaskedFaceRecognition/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/MaskedFaceRecognition/config.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... | 31.170732 | 78 | 0.643975 |
ca433cfdc583b5417c142f3e27cbbc19fc20126f | 636 | py | Python | python_first_step/sortalgoArrayOperation/sort2.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | python_first_step/sortalgoArrayOperation/sort2.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | python_first_step/sortalgoArrayOperation/sort2.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | import time
import numpy as np
import numpy.linalg as nl
import random
import matplotlib.pyplot as plt
def sortInt(n_max) :
# summe des carre
listInt=[]
for i in range(1, n_max) :
s = random.randint(1,10)
listInt.append(s)
return(listInt)
intRand= sortInt(5)
print(intRand)
d... | 16.307692 | 34 | 0.542453 |
ca74d344cab07cbfd869efaea460c4c5bc949315 | 316 | py | Python | exercises/de/exc_02_05_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/exc_02_05_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/exc_02_05_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("de")
# Importiere die Klasse Doc
from ____ import ____
# Erwarteter Text: "Na, alles klar?"
words = ["Na", ",", "alles", "klar", "?"]
spaces = [____, ____, ____, ____, ____]
# Erstelle ein Doc mit den Wörtern und Leerzeichen
doc = ____(____, ____=____, ____=____)
print(doc.text)
| 21.066667 | 50 | 0.674051 |
f3daf2d50e0303551f8d62b9050f38bb85c076ce | 1,562 | py | Python | python/pyqt/LearnPyQt/stack_layout.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/stack_layout.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/stack_layout.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtWidgets import (
QApplication,
QMainWindow,
QWidget,
QVBoxLayout,
QStackedLayout,
QPushButton,
)
from PyQt5.QtGui import (
QPalette,
QColor,
)
class Color(QWidget):
def __init__(self, color, *args, **kwargs):
super(Color, self).__init__(*args, **kwa... | 23.313433 | 59 | 0.644686 |
f3fe9cadd102e32ca06c472d5c44ec2934c88eb6 | 4,592 | py | Python | research/cv/PGAN/src/optimizer.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/PGAN/src/optimizer.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/PGAN/src/optimizer.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... | 31.027027 | 90 | 0.647213 |
b679e07e4853c1ac8702e21a433f7100a58636c7 | 1,553 | py | Python | dblp/python/citations.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | null | null | null | dblp/python/citations.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | null | null | null | dblp/python/citations.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | 1 | 2019-11-06T11:29:31.000Z | 2019-11-06T11:29:31.000Z | import citationsCommon
def countByIdAndYear(rdd):
docsplit = rdd.flatMap(lambda row:
[('{}.{}'.format(ref, row[2]), 1) for ref in row[1]])
return docsplit.reduceByKey(lambda c, d: c + d)
def joinIdYearAge(idYearCount, ddpairs):
# idYear: id, year cited
idYear = idYearCount.map(lambda row: ... | 41.972973 | 86 | 0.666452 |
1e61c19b1fa849a545aa5955ebc1129a3e165719 | 284 | py | Python | zencad/interactive/axis.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/interactive/axis.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/interactive/axis.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | from zencad.interactive.interactive_object import InteractiveObject
from OCC.Core.AIS import AIS_Axis
class AxisInteractiveObject(InteractiveObject):
def __init__(self, axis, color):
self.axis = axis
super().__init__(AIS_Axis(axis.to_Geom_Line()), color=color)
| 28.4 | 68 | 0.760563 |
1ebbf6764706c37fc954f30837690895994c3e65 | 1,759 | py | Python | example_code/python/plot_curve_fit.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | 1 | 2021-08-21T17:08:39.000Z | 2021-08-21T17:08:39.000Z | example_code/python/plot_curve_fit.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | null | null | null | example_code/python/plot_curve_fit.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | null | null | null | # Erstelle aus gegebnen Daten eine Ausgleichskurve
# Und Plotte diese Kurve + die Daten
# wechsle die Working Directory zum Versuchsordner, damit das Python-Script von überall ausgeführt werden kann
import os,pathlib
project_path = pathlib.Path(__file__).absolute().parent.parent
os.chdir(project_path)
# benutze die ma... | 30.859649 | 110 | 0.728823 |
eca4f5aa27488a24c929f36854a3145b768fa867 | 3,266 | py | Python | benwaonline/auth/core.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/auth/core.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/auth/core.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | import os
import requests
from flask import current_app
from jose import jwt, exceptions
from benwaonline.cache import cache
from benwaonline.exceptions import BenwaOnlineAuthError
ALGORITHMS = ['RS256']
def verify_token(token):
unverified_header = jwt.get_unverified_header(token)
rsa_key = match_key_id(unve... | 27.91453 | 95 | 0.649418 |
01f72bd21f2a381c2c81de43a8ad15b68badbae6 | 4,917 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/cloudscale.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/cloudscale.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/cloudscale.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from copy import deepcopy
from ansibl... | 36.969925 | 106 | 0.548709 |
bf3a5e972de95e03358433c9a82b2ed12f784caf | 1,025 | py | Python | Hackerrank_problems/counting_valleys/solution1_CountingValleys.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/counting_valleys/solution1_CountingValleys.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/counting_valleys/solution1_CountingValleys.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #
# working
# this function takes steps and detail of steps as input
# we declare a zero level above which any up step will be considered as a valley that is climbed
# we run from 0 to length of steps
# if we detect a "U" we increase the zero level
# similary if we detect "D" we decrease the zero... | 26.282051 | 100 | 0.616585 |
da69d942b34c7cb188f48d8f571305a3929e1a1b | 95 | py | Python | abfahrt/unittest/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/unittest/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/unittest/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | """
Unittest-Package for testing the most important classes/modules of the abfahrt-Package
"""
| 23.75 | 86 | 0.778947 |
e5f095d1388f9625e63f8d8fbeb39317cd585f8c | 68 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/ph-9.11-list-del-function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/ph-9.11-list-del-function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/ph-9.11-list-del-function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | li = [1, 2, 3, 3, 4, 5, 6]
del(li[1])
print(li)
del(li)
print(li)
| 8.5 | 26 | 0.5 |
97742d434f756859171175e1ee026361918f8086 | 3,151 | py | Python | blueprints/portfolio/build.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | blueprints/portfolio/build.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | blueprints/portfolio/build.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | from hausse import Hausse
from hausse.plugins import (
Assets,
DiscoverPartials,
Drop,
Handlebars,
Markdown,
MetadataMarkdown,
Relations,
Collection,
Collections
)
# Collections preparations
# By default, all files in "src/formations" folder will be grouped in this collection
Links... | 41.460526 | 96 | 0.70676 |
8ae079fb5cc787087019878ddc15a079fc9ed4df | 2,165 | py | Python | elements/python/9/14/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/9/14/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/9/14/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import collections
class MaxQueue(object):
"""
MaxQueue provides a base queue API and tracks the largest item contained
in the queue.
"""
def __init__(self):
self.items = []
self.peaks = []
def enqueue(self, x):
self.items.append(x)
while len(self.peaks) > 0 an... | 23.031915 | 81 | 0.50485 |
c12ff6fc86fc337cb5664cef1cd543659806c57c | 600 | py | Python | staris.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | staris.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | staris.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#You are climbing a stair case. It takes n steps to reach to the top.
#Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
class Solution:
# @param {integer} n
# @return {integer}
count=0
def climbStairs(self, n):
self.rec_climb(n)
print self.... | 18.181818 | 97 | 0.675 |
a9ee7d9ddb02712f3efcfc4263b4574071d89f40 | 237 | py | Python | src/server/handlers/issues.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/handlers/issues.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/handlers/issues.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from server.handlers.base import ListResource
from server.models import Issue
class IssueListResource(ListResource):
@property
def resource(self):
return Issue
@property
def key(self):
return "issues"
| 16.928571 | 45 | 0.696203 |
68c4d76626da0bce8c26017b492f398cab45c0ab | 18,560 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_point.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_point.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_point.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
# QDoubleValidator needs QValidator in qgis 3.4!
from PyQt5.QtCore import Qt, QLocale, pyqtSignal
from PyQt5.QtGui import QDoubleValidator
from PyQt5.QtWidgets import QWidget, QLabel, QLineEdit, QHBoxLayout, QToolButton, QToolBar, QComboBox, QDoubleSpinBox
from PyQ... | 41.061947 | 154 | 0.563524 |
6ba4e572e52707590a52608ce4cc12b513909627 | 2,117 | py | Python | gemtown/users/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/users/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/users/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from gemtown.modelphotos import models as modelphoto_models
from gemtown.modelers import models as modeler_models
from gemtown.musicians import models as musician_models
from . import models
import time
class TimestampField(serializers.Field):
def to_representation(self, valu... | 25.817073 | 60 | 0.561171 |
d84e7b0326da78457b27f3f5b7fda50734903f66 | 775 | py | Python | Data-Structures/Stacks/stack.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Data-Structures/Stacks/stack.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Data-Structures/Stacks/stack.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | """Implementation of a stack in python."""
class Stack:
def __init__(self):
self.items = []
def push(self, item):
"""Add an item to the stack."""
self.items.append(item)
def pop(self):
"""Remove the most recent item from the stack."""
if len(self.items) > 0:
... | 24.21875 | 68 | 0.536774 |
d8b43126c4341230aae3fa4c8b5aa73490e76164 | 356 | py | Python | uebung/bmi.py | wieerwill/Python-Intro | 6b6f1d8b1b5c95590ffe15b0b4ddf188b680b491 | [
"MIT"
] | 3 | 2019-03-02T16:34:53.000Z | 2021-11-15T11:43:53.000Z | uebung/bmi.py | wieerwill/Python-Intro | 6b6f1d8b1b5c95590ffe15b0b4ddf188b680b491 | [
"MIT"
] | null | null | null | uebung/bmi.py | wieerwill/Python-Intro | 6b6f1d8b1b5c95590ffe15b0b4ddf188b680b491 | [
"MIT"
] | null | null | null | # Calculate your Body-Mass-Index with Python
print("BMI - Calculator!")
weight_str = input("Please insert your weight (in kg): ")
height_str = input("Please insert your bodys height(in m): ")
weight = float(weight_str.replace(",", "."))
height = float(height_str.replace(",", "."))
bmi = weight / height ** 2
print("... | 29.666667 | 61 | 0.668539 |
514737538b6050cbe92637918e942f1823b10292 | 1,699 | py | Python | server/weather/RestWeatherProvider.py | EveryOtherUsernameWasAlreadyTaken/BIS | e132ce42dcc74e634231398dfecb08834d478cba | [
"MIT"
] | 3 | 2019-07-09T08:51:20.000Z | 2019-09-16T17:27:54.000Z | server/weather/RestWeatherProvider.py | thomasw-mitutoyo-ctl/BIS | 08525cc12164902dfe968ae41beb6de0cd5bc411 | [
"MIT"
] | 24 | 2019-06-17T12:33:35.000Z | 2020-03-27T08:17:35.000Z | server/weather/RestWeatherProvider.py | EveryOtherUsernameWasAlreadyTaken/BIS | e132ce42dcc74e634231398dfecb08834d478cba | [
"MIT"
] | 1 | 2020-03-24T17:54:07.000Z | 2020-03-24T17:54:07.000Z | import json
import logging
import threading
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
log = logging.getLogger(__name__)
class RestWeatherProvider(threading.Thread):
"""
The RestWeatherProvider serves the collected weather data using a simple http server. The weather data can be
obtai... | 30.339286 | 114 | 0.669806 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.