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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1328f0b33acf18190baed1af9cf5e9859aa5fb60 | 11,568 | py | Python | Packs/Twitter/Integrations/Twitter/Twitter.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Twitter/Integrations/Twitter/Twitter.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Twitter/Integrations/Twitter/Twitter.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 tweepy
import urllib
import requests
class Client:
def auth(self):
auth = tweepy.OAuthHandler(demisto.params().get('apikey'), demisto.params().get('apikey_secret'))
auth.set_a... | 49.016949 | 179 | 0.590163 |
1360bba7688d667231c6cd0ba3ec28c47e039ca2 | 437 | py | Python | haas_lib_bundles/python/docs/examples/human_existence_detector/haas506/code/radar.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/human_existence_detector/haas506/code/radar.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/human_existence_detector/haas506/code/radar.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | from driver import GPIO
class RADAR(object):
def __init__(self, gpioObj):
self.gpioObj = None
if not isinstance(gpioObj, GPIO):
raise ValueError("parameter is not a GPIO object")
self.gpioObj = gpioObj
def detect(self):
if self.gpioObj is None:
... | 23 | 62 | 0.576659 |
1375a385a8375e0fe79f1082de46ad504f2e06d0 | 2,288 | py | Python | python/oneflow/test/modules/test_batchnorm.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_batchnorm.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_batchnorm.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... | 33.15942 | 87 | 0.69493 |
b936ef70f57a47078c67c395e7092ffabaf806e6 | 2,088 | py | Python | research/nlp/atae_lstm/src/load_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/nlp/atae_lstm/src/load_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/nlp/atae_lstm/src/load_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.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.389831 | 79 | 0.667146 |
e0032431f1812623d5ae5414b6302245b2720765 | 5,543 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/kubevirt_cdi_upload.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/kubevirt_cdi_upload.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/kubevirt_cdi_upload.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 29.328042 | 136 | 0.666787 |
bc56ccbfe96922c8c1ff338c270e549535699b54 | 183 | py | Python | src/compgen2/testdata/__init__.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | 1 | 2022-02-02T12:41:06.000Z | 2022-02-02T12:41:06.000Z | src/compgen2/testdata/__init__.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | src/compgen2/testdata/__init__.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | from .testdata import GovTestData, get_accuracy
from .manipulator import Manipulator
from .linguistic import StringEnriched
from .synthetic import Synthetic, sample_test_set_from_gov
| 36.6 | 58 | 0.868852 |
4c1519efb1fd2f061945eb06391bcad4ba11f5c0 | 10,065 | py | Python | raw_code/pulson440/Misaligned Data.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/Misaligned Data.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/Misaligned Data.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
import sys
if Path("..//").resolve().as_posix() not in sys.path:
sys.path.insert(0, Path("..//").resolve().as_posix())
from common.helper_fu... | 35.192308 | 112 | 0.649677 |
d5e63184f1d5ab5cd779b46fe675cd8391efda03 | 720 | py | Python | 6th_sem/souptik_codes/matlabprograms/Actor_01/my_converter.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | 6th_sem/souptik_codes/matlabprograms/Actor_01/my_converter.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | 6th_sem/souptik_codes/matlabprograms/Actor_01/my_converter.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 23 18:01:34 2018
@author: souptik
"""
import python_speech_features as psf
import matplotlib.pyplot as plt
from scipy.io import wavfile as wav
import soundfile as sf
import glob as gl
import os
wav_path="/home/souptik/Audio_Speech_Actors_01-24/Acto... | 28.8 | 104 | 0.748611 |
9100b8f4a886e9c9b72f6c818ac4da5992c3ed17 | 623 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_4/cleanup_journal_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_4/cleanup_journal_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_4/cleanup_journal_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from pymysql import InternalError
def execute():
frappe.reload_doctype("Journal Entry Account")
for doctype, fieldname in (
("Sales Order", "against_sales_order"),
("Purchase Order", "against_purchase_order"),
("Sales Invoice", "against_invoice"),
("Purchase Invoice", "against_voucher"),
("Jo... | 29.666667 | 73 | 0.696629 |
e6b05e10f8213c8acc07708f3bea9c90f45c4e16 | 6,514 | py | Python | Externals/database.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | Externals/database.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | Externals/database.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | # pylint: disable=C0114
import sqlite3
import datetime
import Persistence.log as log
from GitVersion import Git
log_ = log.getLogger(__name__)
def setup_database(cli_args):
return Database(cli_args.readwrite)
class Database:
def __init__(self, readwrite):
git_ = Git()
self.sql = sqlite3.conne... | 28.321739 | 87 | 0.451029 |
e6cace8deba256f98d8d1233eff0c75130b7041d | 115 | py | Python | insomniac/extra_features/action_manage_clones.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 533 | 2020-06-01T10:40:11.000Z | 2022-03-29T17:05:50.000Z | insomniac/extra_features/action_manage_clones.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 399 | 2020-06-01T22:01:55.000Z | 2022-03-29T20:39:29.000Z | insomniac/extra_features/action_manage_clones.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 166 | 2020-06-01T21:51:52.000Z | 2022-03-12T14:14:44.000Z | from insomniac import activation_controller
exec(activation_controller.get_extra_feature('action_manage_clones'))
| 28.75 | 69 | 0.886957 |
fc197ad9be78193699edd9ffdf819bc9c3e3cb2b | 413 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.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
import frappe
def execute():
frappe.reload_doc("agriculture", "doctype", "land_unit")
for dt in ("Account", "Cost Center", "File", "Employee", "Land Unit", "Task", "Customer Group", "Sales ... | 45.888889 | 126 | 0.726392 |
fca6ce169b17c6dbfe62799cfbf02e9e7a91dd55 | 9,320 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | import pytest
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
from ansible_collections.community.general.plugins.modules.source_control.bitbucket import bitbucket_pipeline_known_host
from ansible_collections.community.general.plugins.modules.source_contro... | 49.574468 | 133 | 0.620815 |
5d4326c1a86bad7a60c5b0d78afd7f9d75662e7c | 327 | py | Python | examples/02 media/MediaBot.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2020-01-16T08:40:00.000Z | 2020-01-16T08:40:00.000Z | examples/02 media/MediaBot.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | null | null | null | examples/02 media/MediaBot.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2019-10-16T08:11:51.000Z | 2019-10-16T08:11:51.000Z | from samt import Bot
bot = Bot()
@bot.default_answer
def default():
return "Try it with\nGet me!"
@bot.answer("Get me!")
def send_me():
return "document:MediaBot.py;It's me!"
@bot.answer("Sticker")
def sticker():
return "sticker:CAADAgADzgEAAqwUnwaWEKfm00_ExAI"
if __name__ == "__main__":
bot.li... | 14.217391 | 52 | 0.675841 |
53bc83e2f56593fd19ca7491948257c7d98ad271 | 139 | py | Python | python/requests/advanced_usage/setting_base_urls.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/requests/advanced_usage/setting_base_urls.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/requests/advanced_usage/setting_base_urls.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from requests_toolbelt import sessions
http = sessions.BaseUrlSession(base_url='https://api.org')
http.get('/list')
http.get('/list/item') | 27.8 | 58 | 0.76259 |
54ebd175d0b06a3dcb91990a37a33fd2d2843519 | 694 | py | Python | PYTHON/Closures_and_Decorators/standardize_mobile_number_using_decorators.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Closures_and_Decorators/standardize_mobile_number_using_decorators.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Closures_and_Decorators/standardize_mobile_number_using_decorators.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
# +918689745612
# 09687456321
def wrapper(f):
def fun(l):
for i, num in enumerate(l):
if len(l[i]) == 10:
l[i] = '+91 %s %s' % (l[i][0:5], l[i][5:])
elif len(l[i]) == 11:
l[i] = '+91 %s %s' % (l[i][1:6], l[i][6:])
... | 23.931034 | 58 | 0.413545 |
0743b08e1e8c5cca5c56bd4b6fc7e071d2e23cae | 2,064 | py | Python | helper/segmentation/CutterSegmentationObjects.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | helper/segmentation/CutterSegmentationObjects.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | helper/segmentation/CutterSegmentationObjects.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import sys
#Change path specificly to your directories
sys.path.insert(1, '/home/codahead/Fishial/FishialReaserch')
import os
import json
import cv2
import numpy as np
from module.segmentation_package.src.utils import get_mask
# This script will cut objects from the COCO fish export file,
# create a folder and pla... | 32.761905 | 106 | 0.633236 |
db7d89c73d5f6163451182f8d7f5c3231b38e0a8 | 1,962 | py | Python | main.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | null | null | null | main.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | 1 | 2021-05-24T19:25:35.000Z | 2021-05-24T19:25:35.000Z | main.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | null | null | null | from src.model.capture import Capture
from src.model.device import Device
from datetime import datetime
import json
def create_capture_from_json():
with open('config.json', 'r') as f:
config = json.load(f)
print(config)
name = config['name']
baudrate = config['baudrate']
sa... | 31.645161 | 87 | 0.608563 |
725a4e8386b88d9a6e02cca4ad6447f06ceb855e | 3,655 | py | Python | applications/experimental/pipelines/pipelines/nodes/file_classifier/file_type.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/experimental/pipelines/pipelines/nodes/file_classifier/file_type.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/experimental/pipelines/pipelines/nodes/file_classifier/file_type.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2021 deepset GmbH. 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.o... | 40.164835 | 90 | 0.653625 |
72e81c730f2bd2d3fcf631b0bb79cc3a543d548d | 467 | py | Python | ___Python/RomanS/untitled/p07_file_io/m00_rekursion.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/untitled/p07_file_io/m00_rekursion.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/untitled/p07_file_io/m00_rekursion.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # 1) Fakultät
# Iterative Definition
# n! = 1 * 2 * 3 * 4 * 5 * ... * (n - 1) * n
# 5! = 1 * 2 * 3 * 4 * 5 (lies 5 Fakultät)
# 4! = 1 * 2 * 3 * 4
# 1! = 1
# 0! = 1
# Rekursive Definition
# n! = n * (n-1)!, für n >=1
# 0! = 1
def fak(n):
if n == 0:
return 1
else:
return n * ... | 15.566667 | 45 | 0.417559 |
fe54c9b7cf471e36fc4055086cdbdc4f0a0756f5 | 1,178 | py | Python | software/supervisor/evaluator.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/supervisor/evaluator.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/supervisor/evaluator.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | #imports
from database import session, Strings, strings, String1, string1, String2, string2, String3, string3, Panels, panels
import time, math
string_1 = session.query(String1).all()
string_2 = session.query(String2).all()
string_3 = session.query(String3).all()
# moduleitems: list with ... | 42.071429 | 151 | 0.628183 |
fe62a5c0fa7fbe3a6e55d5b08c048bb7bf534184 | 6,686 | py | Python | python/oneflow/compatible/single_client/test/ops/test_argwhere.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_argwhere.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_argwhere.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
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... | 33.59799 | 87 | 0.670655 |
fe62c532c8913633b03787aa238dcc523336d056 | 5,472 | py | Python | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/pcap.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/pcap.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/pcap.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | #!/usr/bin/env python3
# lib/pcap.py
# Nov 2019, Mar 2020 <christian.tschudin@unibas.ch>
# import fcntl # uncomment the LOCK_ calls for concurrent processes
import lopy4_cbor as cbor2 #CHANGES FOR LOPY4
import hashlib
import binascii #CHANGES FOR LOPY4
class PCAP:
def __init__(self, fname, rd_offse... | 30.569832 | 108 | 0.474963 |
fe80719b40b4447644058c7b62698b1877496d31 | 967 | py | Python | buildscript_versioning.py | mchresse/BeeIoT | 9289b9408168ddc223b073083f28e9c0aece5ede | [
"BSD-3-Clause"
] | null | null | null | buildscript_versioning.py | mchresse/BeeIoT | 9289b9408168ddc223b073083f28e9c0aece5ede | [
"BSD-3-Clause"
] | null | null | null | buildscript_versioning.py | mchresse/BeeIoT | 9289b9408168ddc223b073083f28e9c0aece5ede | [
"BSD-3-Clause"
] | 1 | 2020-12-22T18:55:22.000Z | 2020-12-22T18:55:22.000Z | FILENAME_BUILDNO = 'versioning'
FILENAME_VERSION_H = 'include/version.h'
vmajor = '1'
vminor = '0'
vrev = '01'
import datetime
build_no = 0
try:
with open(FILENAME_BUILDNO) as f:
build_no = int(f.readline()) + 1
except:
print('Starting build number from 1..')
build_no = 1
with open(FILENAME_BUIL... | 21.021739 | 77 | 0.640124 |
4a9a1fef01bf20f37f1f9f11d9ad5b1fcde5ac69 | 224 | py | Python | app/services/format.py | diedoman/PhaseFour | 5243835e05750498b6963a82793c6838f49b4086 | [
"MIT"
] | null | null | null | app/services/format.py | diedoman/PhaseFour | 5243835e05750498b6963a82793c6838f49b4086 | [
"MIT"
] | null | null | null | app/services/format.py | diedoman/PhaseFour | 5243835e05750498b6963a82793c6838f49b4086 | [
"MIT"
] | null | null | null | import datetime
def strDateFormat(date):
if type(date) is datetime.datetime:
return str(date.year) + "-" + str(date.month) + "-" + str(date.day) + "_" + str(date.hour) + ":" + str(date.minute)
else:
print(type(date))
| 32 | 118 | 0.638393 |
435bee06591549453932069c0075e1cf4aced251 | 10,897 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/test_payment_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/test_payment_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/test_payment_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import flt, nowdate
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.accou... | 32.625749 | 107 | 0.719923 |
880b0f4bb11bd66deddf0a90ee466a4c0df48d43 | 427 | py | Python | Fastir_Collector/evt/windows2008R2ServerEvt.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/evt/windows2008R2ServerEvt.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/evt/windows2008R2ServerEvt.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from logs import _EventLogs
class Windows2008ServerR2Evt(_EventLogs):
def __init__(self, params):
super(Windows2008ServerR2Evt, self).__init__(params)
def csv_event_logs(self):
super(Windows2008ServerR2Evt, self)._csv_event_logs(... | 28.466667 | 67 | 0.747073 |
e0926f70c04ac43e9bcd3389c07fedbfbcac7e28 | 529 | py | Python | exercises/fr/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Doc.has_extension("has_number"), "As-tu déclaré l'extension du doc ?"
ext = Doc.get_extension("has_number")
assert ext[2] is not None, "As-tu défini correctement le getter ?"
assert (
"getter=get_has_number" in __solution__
), "As-tu affecté get_has_number comme getter?"
... | 44.083333 | 87 | 0.701323 |
1c7eb5789657aa44c662c35a9d307dd185738967 | 4,173 | py | Python | python/oneflow/ops/array_ops.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/ops/array_ops.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/ops/array_ops.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
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... | 40.514563 | 123 | 0.619458 |
40155c7d520168e75dca860b09ee9d94b80878f2 | 241 | py | Python | power-of-four/power-of-four.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | power-of-four/power-of-four.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | power-of-four/power-of-four.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def isPowerOfFour(self, n: int) -> bool:
if n<1:
return False
while(n>1):
if n%4!=0:
return False
else:
n/=4
return True
| 21.909091 | 44 | 0.394191 |
90ef029c3834db7347d8d48c97a4b7d4910d81f5 | 1,690 | py | Python | IVTa/2014/MOSHKOV_Y_O/task_10_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/MOSHKOV_Y_O/task_10_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/MOSHKOV_Y_O/task_10_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 10. Вариант 23
# Напишите программу "Генератор персонажей" для игры.
# Пользователю должно быть предоставлено 30 пунктов,
# которые можно распределить между четырьмя характеристиками:
# Сила, Здоровье, Мудрость и Ловкость. Надо сделать так,
# чтобы пользователь мог не только брать эти пункты из общего "пула",
... | 37.555556 | 79 | 0.521302 |
291231f48c899827e974bfb9da19352f8895f35e | 604 | py | Python | src/tools/data/DataManualExamples/CreatingCompatible/vwregmesh.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/data/DataManualExamples/CreatingCompatible/vwregmesh.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/data/DataManualExamples/CreatingCompatible/vwregmesh.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import visit_writer, math
NX = 10
NY = 20
NZ = 30
# Create a zonal variable
zonal = []
index = 0
for k in range(NZ-1):
for j in range(NY-1):
for i in range(NX-1):
zonal = zonal + [index]
index = index + 1
# Create a nodal variable
nodal = []
for k in range(NZ):
for j in range(... | 22.37037 | 62 | 0.581126 |
463351f9190530c1b52c631e86a51b105f353d4b | 1,136 | py | Python | files/meas/Experiment_03/fit_sinewave.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/fit_sinewave.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/fit_sinewave.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | import numpy as np
from scipy.optimize import leastsq
import pylab as plt
N = 1000 # number of data points
time = np.linspace(0, 4 * np.pi, N)
f = 1.15247 # frequency
# create artificial data with noise
inData = 3.0 * np.sin(f * time + 0.001) + 0.5 + np.random.randn(N)
def fitSine(t, y):
''' Least Square Fitt... | 29.894737 | 76 | 0.628521 |
469de17cb1d32d4ea1de0c696033d6abdef1b429 | 3,651 | py | Python | fhirclient/r4models/operationoutcome.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/operationoutcome.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/operationoutcome.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class OperationOutcome(domainresource.DomainResource):
""" Information about the succe... | 35.105769 | 114 | 0.60367 |
310f4c77a93e447a52579b118cba6bbd6a18ceb1 | 2,418 | py | Python | mqtt/mqttClient/mqttApp/MqttClient.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | mqtt/mqttClient/mqttApp/MqttClient.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | mqtt/mqttClient/mqttApp/MqttClient.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | 1 | 2019-10-22T07:47:51.000Z | 2019-10-22T07:47:51.000Z |
import logging
import random
import sys
import paho.mqtt.client as mqtt
import Handlers as handler
logger = logging.getLogger(__name__)
_defaultHost="localhost"
_defaultPort=1883
mqttSubscriptions = [
"robo-01/notification/#",
]
mqttSubscriptionHandlers = {
"robo-01/notification/color/#": ... | 30.225 | 105 | 0.695616 |
31eb2e4f7bdca358ca13b86c1d8babb0ba02f0be | 654 | py | Python | notebooks/sadf.py | EnginKarahan/python_data_scraping | 5cd04e0e92c66f26c22995a35d2517ada9e899ab | [
"CC0-1.0"
] | null | null | null | notebooks/sadf.py | EnginKarahan/python_data_scraping | 5cd04e0e92c66f26c22995a35d2517ada9e899ab | [
"CC0-1.0"
] | null | null | null | notebooks/sadf.py | EnginKarahan/python_data_scraping | 5cd04e0e92c66f26c22995a35d2517ada9e899ab | [
"CC0-1.0"
] | null | null | null | import pandas as pd # import als 'pd' Kürzel für weniger Schreibarbeit
import json
with open('guardian_corona_parsed.json', 'r', encoding = 'utf-8') as f:
guardian = json.load(f)
#print(guardian[0].keys())
df = pd.DataFrame(guardian)
#print(df.info())
#print(df['chars'].describe())
#print(df.tags.value_counts()... | 31.142857 | 71 | 0.721713 |
7335d2b9ca3f5057763a124fa88ff2def331644f | 5,996 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/browser/operators.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/browser/operators.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/browser/operators.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import os, re
from browser import help, help_functions
from utils import color, error
from browser import executions
class Operators:
def __init__(self, unionpath):
self.unionpath = unionpath
self.executions = executions.Executions(self.unionpath)
'''
Allows registration to a server.
'''
def reg(self, cmds... | 24.983333 | 111 | 0.668446 |
b42833d903a74c395114cd8abb6a68d34d734d2d | 1,095 | py | Python | letspuppet/letspuppetTrade.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | 15 | 2018-05-16T02:39:01.000Z | 2021-05-22T13:12:55.000Z | letspuppet/letspuppetTrade.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | null | null | null | letspuppet/letspuppetTrade.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | 9 | 2018-05-16T00:47:34.000Z | 2021-11-26T05:39:48.000Z | # -*- coding: utf-8 -*-
"""
Author: 久久为功 , chaos
Date: 2017-11-19
Support multil-thread for different accounts
Change Activity:
2018 04 15 18:06:42 CST
重构lphaTrade到单独的文件:alphaTrade.py;重命名alphaTrade为AlphaTrade
将公用函数单独保存到tradetools.py
"""
from letspuppet import LogAll
import logging
import json
from lets... | 24.333333 | 114 | 0.641096 |
b44c43efec02a86b12f033db129224eb6ab2fe3c | 44,375 | py | Python | src/nownowcast.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | 1 | 2021-05-02T09:53:25.000Z | 2021-05-02T09:53:25.000Z | src/nownowcast.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | null | null | null | src/nownowcast.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 14 19:01:45 2021
@author: David
"""
from pathlib import Path
from datetime import datetime as dt
import zipfile
import os.path
import numpy as np
import scipy.signal as sig
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLoc... | 39.028144 | 215 | 0.620755 |
5ef2d823e25fdc6da05ad2a24b096d6ce1bf29b4 | 126 | py | Python | scripts/hello_world_tomy8910.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_tomy8910.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_tomy8910.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | '''
LANGUAGE: Python 3.6
AUTHOR: Tomas Alejandro V. Falgui III
GITHUB: https://github.com/tomy8910
'''
print("Hello World!")
| 15.75 | 37 | 0.706349 |
d2863cd303e7c18347fe3821cb11e59664ec6d57 | 356 | py | Python | src/notif/migrations/0003_auto_20220513_1656.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/notif/migrations/0003_auto_20220513_1656.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/notif/migrations/0003_auto_20220513_1656.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2022-05-13 16:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('notif', '0002_notif_canceled'),
]
operations = [
migrations.RenameField(
model_name='notif',
old_name='canceled',
... | 18.736842 | 47 | 0.575843 |
82b292996c8623aa5fed1888f4d65a87cbcb0d1d | 1,893 | py | Python | MachineTranslation/lib/models/position_encode_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | MachineTranslation/lib/models/position_encode_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | MachineTranslation/lib/models/position_encode_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# 适用于 tensorflow >= 2.0, keras 被直接集成到 tensorflow 的内部
import tensorflow as tf
import numpy as np
class SinusoidalPE:
"""
手工设计的使用正弦曲线的位置编码 (Positional Encoding)
ref:
1. Attention Is All You Need
"""
def __init__(self, d_model, maximum_position=100... | 22.807229 | 85 | 0.602747 |
7da95d1d9509d0e2d1fced3a97bd63329392f0b7 | 687 | py | Python | Python/zzz_training_challenge/UdemyPythonPro/Chapter11_Packages2/fastvector/fastvector/__init__.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | 4 | 2020-12-28T23:43:35.000Z | 2022-01-01T18:34:18.000Z | Python/zzz_training_challenge/UdemyPythonPro/Chapter11_Packages2/fastvector/fastvector/__init__.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/UdemyPythonPro/Chapter11_Packages2/fastvector/fastvector/__init__.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | 9 | 2020-09-26T19:29:28.000Z | 2022-02-07T06:41:00.000Z | from .computations import cython_clip_vector
from .computations import naive_cython_clip_vector
from .computations import python_clip_vector
from .dtypes import float32
from .dtypes import float64
from .dtypes import int8
from .dtypes import int16
from .dtypes import int32
from .dtypes import int64
from .dtypes import ... | 20.818182 | 50 | 0.723435 |
816ed674e8ef17ab902c454433c102fbd3b25d7d | 14,626 | py | Python | wagtail_localize/strings.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | wagtail_localize/strings.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | wagtail_localize/strings.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | from collections import Counter
from bs4 import BeautifulSoup, NavigableString, Tag
from django.utils.html import escape
from django.utils.translation import gettext as _
# List of tags that are allowed in segments
INLINE_TAGS = ["a", "abbr", "acronym", "b", "code", "em", "i", "strong", "br"]
def lstrip_keep(text)... | 28.962376 | 118 | 0.564884 |
6fb2aff6254ad5f2db3f29587fc5af972c72a8c0 | 1,147 | py | Python | demos/Multiscale/ThreeSided/model/state_variables.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSided/model/state_variables.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSided/model/state_variables.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | from .parts.sys_params import *
# Initial States
state_variables = {
'fiat_reserve': initial_values['fiat_reserve'],#unit: fiat
'overhead_cost': initial_values['overhead_cost'], #unit: fiat
'operational_budget': initial_values['operational_budget'], #unit: fiat
'token_r... | 60.368421 | 128 | 0.6966 |
6ff14effc37b384d287c4b9f2b23904e23fc021f | 8,852 | py | Python | asteroid/masknn/attention.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | asteroid/masknn/attention.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | asteroid/masknn/attention.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | from math import ceil
import warnings
import torch.nn as nn
from torch.nn.modules.activation import MultiheadAttention
from asteroid.masknn import activations, norms
import torch
from asteroid.utils import has_arg
from asteroid.dsp.overlap_add import DualPathProcessing
class ImprovedTransformedLayer(nn.Module):
... | 38.320346 | 95 | 0.587551 |
9671365b25c511a801644867461c4a69d93b1b6c | 276 | py | Python | src/models/selfsupervised/create_tiles.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/models/selfsupervised/create_tiles.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/models/selfsupervised/create_tiles.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null | import datasets.tiles as t
import datasets.divahisdb as diva
import experiment.data as exp
env = exp.Environment()
target = env.dataset('jigsaw_tiles')
target.mkdir(exist_ok=True)
dataset = diva.HisDBDataset(env.dataset('codices_all'))
t.document_to_tile(dataset, target)
| 21.230769 | 55 | 0.789855 |
9681d495fa1e495f5827d84d7374594bc4b8b91f | 175 | py | Python | the_platform/util.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | the_platform/util.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | the_platform/util.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | def gen_secret_key():
import os
from base64 import b64encode
random_bits = os.urandom(128)
random_encoded = b64encode(random_bits)
return random_encoded
| 19.444444 | 43 | 0.725714 |
739000468cea410615354c8ae617baf8470fde6f | 333 | py | Python | exercises/es/exc_02_05_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_02_05_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_02_05_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("es_core_news_sm")
# Importa la clase Doc
from ____ import ____
# El texto deseado: "¡¿En serio?!"
words = [____, ____, ____, ____, ____, ____]
spaces = [____, ____, ____, ____, ____, ____]
# Crea un Doc a partir de las palabras y los espacios
doc = ____(____, ____=____, ____=____)
pri... | 22.2 | 53 | 0.6997 |
83f89c1f983f6114f69369820f7c114117b2df2a | 8,221 | py | Python | Skripts/test_lowpass.py | galberding/Klassifikation_von_Erschoepfung | 33331762baf0a5ea2898004e63d9a98d26bb3070 | [
"Apache-2.0"
] | null | null | null | Skripts/test_lowpass.py | galberding/Klassifikation_von_Erschoepfung | 33331762baf0a5ea2898004e63d9a98d26bb3070 | [
"Apache-2.0"
] | null | null | null | Skripts/test_lowpass.py | galberding/Klassifikation_von_Erschoepfung | 33331762baf0a5ea2898004e63d9a98d26bb3070 | [
"Apache-2.0"
] | null | null | null | """Test the behaviour of the heartrates under the same conditions as in filemapper.py.
It is used to find out how to adjust heartrate samples with wrong detected maxes.
"""
import numpy as np
from datetime import datetime
import pandas as pd
import scipy.signal as signal
import matplotlib.pyplot as plt
from itertools ... | 33.149194 | 227 | 0.624133 |
f7d09e22427b81a3ef1acc2f2ac7be54147ef4a9 | 486 | py | Python | leetcode/053-Maximum-Subarray/MaxSubarray_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/053-Maximum-Subarray/MaxSubarray_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/053-Maximum-Subarray/MaxSubarray_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[]} nums
# @return {integer}
def maxSubArray(self, nums):
cumnums = [0] + nums
n = len(cumnums)
for i in range(1, n):
cumnums[i] += cumnums[i - 1]
minnum = 0
res = cumnums[1]
for i in range(2, n):
if cu... | 27 | 41 | 0.462963 |
f7f7394e504d7d329c52bef00fe2a3781ebcba3a | 7,265 | py | Python | bigbench/models/json_rpc_model.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/models/json_rpc_model.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/models/json_rpc_model.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | """JSON-rpc proxy model for BIG-Bench."""
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 33.634259 | 80 | 0.662354 |
7915515f3172878ec48d471c84efe75053967352 | 95 | py | Python | apps/login/urls.py | AlcindoSchleder/dashboard | aacb847bee05368bff72853a7d1887de211bccd2 | [
"MIT"
] | null | null | null | apps/login/urls.py | AlcindoSchleder/dashboard | aacb847bee05368bff72853a7d1887de211bccd2 | [
"MIT"
] | 4 | 2020-09-21T01:32:14.000Z | 2020-09-21T01:32:47.000Z | apps/login/urls.py | AlcindoSchleder/dashboard | aacb847bee05368bff72853a7d1887de211bccd2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.urls import path
app_name = 'login'
urlpatterns = []
| 15.833333 | 29 | 0.610526 |
f75321017375931478c261004740f35672b8e534 | 8,829 | py | Python | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Guido Lemoine
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
# Version :
import time
import sys
import os
import io
import json... | 29.528428 | 99 | 0.61751 |
f77d1ef80e640f784747b8058ebb71bafd559b84 | 330 | py | Python | exercises/pt/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("en_core_web_sm")
text = "It’s official: Apple is the first U.S. public company to reach a $1 trillion market value"
# Processar o texto the text
doc = nlp(text)
# Iterar nas entidades previstas
for ent in doc.ents:
# Imprimir o texto e a etiqueta da entidade
print(ent.text, en... | 23.571429 | 98 | 0.724242 |
e3984e82175cbb614d714cb45b338f112a717c67 | 144 | py | Python | Chapter4_Intermediate/Tuple.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 2 | 2021-02-13T19:18:00.000Z | 2021-11-10T09:54:49.000Z | Chapter4_Intermediate/Tuple.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | Chapter4_Intermediate/Tuple.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | list_a = [1, 2, 3]
list_a.append(4)
print(list_a)
# Tuple
tuple_a = (2, True, "hello", 2)
print(tuple_a.count(2))
print(tuple_a.index(2))
| 10.285714 | 31 | 0.638889 |
e3a0e26a40bc3d6d71a8ee684b060bfc43b73405 | 10,711 | py | Python | datahandler/miningPatterns.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | datahandler/miningPatterns.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | datahandler/miningPatterns.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import csv
from datahandler import analyser
# UTILS POUR LA LECTURE DU CSV
def groupByPack(it, n):
"""
Récupère une liste et fait des paquets de taille n
:param it: la liste
:param n: la taille des paquets souhaités
:return: un générateur de paquets
"""
first = it[:n... | 34.889251 | 158 | 0.547288 |
e3a478d12a6a0e6f395cd35a35aedae5ffdd8a8e | 950 | py | Python | CodeChef_problems/CRDGAME3/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/CRDGAME3/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/CRDGAME3/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | '''
-------------LOGIC---------------
We know that there are 10 digits possible i.e. from 0 to 9,
As we want to create the number with the use of a minimum number of digits,
we should use digit 9 as much possible which means for any power PP,
if we want to find out the number for which PP is the power with a minimum nu... | 27.142857 | 127 | 0.565263 |
b720ea589431e7a24ca48b5a8e0fac06a83b99be | 206 | py | Python | 21-fs-ias-lec/FrontEnd/socialgraph/admin.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/FrontEnd/socialgraph/admin.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/FrontEnd/socialgraph/admin.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from django.contrib import admin
from .models import Profile
from .models import FollowRecommendations
# Register your models here.
admin.site.register(Profile)
admin.site.register(FollowRecommendations) | 22.888889 | 42 | 0.834951 |
3f93bcfba510db706f8abaf81929a892d4c00551 | 27,468 | py | Python | repo/script.module.urlresolver/lib/urlresolver/plugins/linksnappy.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/plugins/linksnappy.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/plugins/linksnappy.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
URLResolver Kodi module
linksnappy plugin
Copyright (C) 2019 twilight0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | 31.002257 | 156 | 0.54518 |
b775c68a1ea09c0c6c6fdd46e441c80c62beb02b | 1,066 | py | Python | Python/Programação_em_Python_Essencial/5- Coleções/mapas.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Programação_em_Python_Essencial/5- Coleções/mapas.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Programação_em_Python_Essencial/5- Coleções/mapas.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | """
Mapas - Conhecidos em Python como Dicionários
Dicionários em Python são representados por chaves {}
# Iterar sobre dicionários
for chave in receita:
print(chave)
for chave in receita:
print(receita[chave])
for chave in receita:
print(f'Em {chave} recebi R$ {receita[chave]}')
# print(f'{chave} : {receita[... | 18.067797 | 53 | 0.685741 |
4da302894b30c03cdababf5b00acbe01e6ce36a6 | 11,747 | py | Python | fhirclient/r4models/medicationadministration.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/medicationadministration.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/medicationadministration.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationAdministration) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class MedicationAdministration(domainresource.DomainResource):
""" Administrat... | 42.255396 | 132 | 0.6182 |
4dee8663ab803226e2311648807b7fb6321cf16e | 1,424 | py | Python | Cracking_the_Coding_Interview/dfs_connected_cell_in_a_grid.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Cracking_the_Coding_Interview/dfs_connected_cell_in_a_grid.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Cracking_the_Coding_Interview/dfs_connected_cell_in_a_grid.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
class Graph(object):
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
... | 25.890909 | 91 | 0.530197 |
3f208ee88d4585e9117c8ce9d7942a92a92324e7 | 1,493 | py | Python | orchestrator/io_operation.py | suvambasak/fog-service-orchestration | 8404484c32b2f6c0bfb2ed820dc46d56f055141d | [
"Apache-2.0"
] | null | null | null | orchestrator/io_operation.py | suvambasak/fog-service-orchestration | 8404484c32b2f6c0bfb2ed820dc46d56f055141d | [
"Apache-2.0"
] | null | null | null | orchestrator/io_operation.py | suvambasak/fog-service-orchestration | 8404484c32b2f6c0bfb2ed820dc46d56f055141d | [
"Apache-2.0"
] | 1 | 2022-02-02T14:49:40.000Z | 2022-02-02T14:49:40.000Z | import ssl
import yaml
from urllib.request import urlopen
class FileHandler:
"File reader and writer"
def read_file(self, file_path: str) -> str:
"Read text file"
with open(file_path) as file:
content = file.read().strip()
return content
def write_file(self, file_... | 27.145455 | 142 | 0.609511 |
3600ad3cb32ac141fae74e13b5a11377e2b59c11 | 973 | py | Python | chapter_four/managing_dependencies/setup.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_four/managing_dependencies/setup.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_four/managing_dependencies/setup.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | from setuptools import find_packages, setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="flitton_fib_py",
version="0.0.1",
author="Maxwell Flitton",
author_email="maxwell@gmail.com",
description="Calculates a Fibonacci number",
long_description=long_descri... | 25.605263 | 64 | 0.614594 |
3d50aedd649d3ddb579875bb079dd26230ec9aa4 | 4,411 | py | Python | research/cv/FaceDetection/src/FaceDetection/yolo_postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/FaceDetection/src/FaceDetection/yolo_postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/FaceDetection/src/FaceDetection/yolo_postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.288 | 101 | 0.615053 |
183c0828160314b2e508721fde5f3001ae274c48 | 244 | py | Python | 02.Sort/NY/B1181.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 02.Sort/NY/B1181.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 02.Sort/NY/B1181.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | # 백준 1181 - 단어 정렬
# 후기
# - 더 효과적인 방법이 있나? 흠
N = int(input())
words = []
for i in range (N) :
word = input()
words.append((len(word), word))
words = list(set(words))
words.sort()
for i in range (len(words)) :
print(words[i][1]) | 13.555556 | 35 | 0.561475 |
1849215bd1f42265d596c3ff33d4737189ce7f66 | 291 | py | Python | src/server/app/models/Workspace.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/models/Workspace.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/models/Workspace.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ..db.settings import db
import json
from .User import User
class Workspace(db.Document):
w_id = db.StringField(primary_key=True, required=True)
w_name = db.StringField(required=True)
w_color = db.StringField()
w_users = db.ListField()
w_creator = db.StringField()
| 24.25 | 58 | 0.718213 |
187e6fccd7c1d1aed43c5af2dbb47474c09e94b3 | 446 | py | Python | zencad/examples/2.Operations/3.Sweep/pipe_shell_frenet.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/2.Operations/3.Sweep/pipe_shell_frenet.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/2.Operations/3.Sweep/pipe_shell_frenet.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: pipe_shell_frenet
"""
from zencad import *
ps = [(20, 0, 0), (20, 0, 10), (30, 0, 5)]
profile = polysegment(ps, closed=True)
spine = helix(h=100, r=20, step=30)
m0 = pipe_shell([profile], spine, frenet=False)
m1 = pipe_shell([profile], spine, frenet=True, solid=False)
... | 21.238095 | 59 | 0.672646 |
62f0f47c680582fa7f2af9f3729d4078aeed3b2b | 398 | py | Python | Python/Exercícios_Python/015_aluguel_de_carros.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/015_aluguel_de_carros.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/015_aluguel_de_carros.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""015 - Aluguel de Carros
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1SHo33wSHaoNxB53arSdH8QMMUskYsYWk
"""
dias = int(input('Digite o número de dias: '))
km = float(input('Digite o número de kms rodados: '))
valor = (dias ... | 30.615385 | 77 | 0.690955 |
a7e85f1d04a273d6e09fa17678610e3dc252c0a7 | 950 | py | Python | python/sockcli.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/sockcli.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/sockcli.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
import socket
import os
import sys
def trans_cli(message):
HOST = '127.0.0.1'
PORT = 18888
BUFSIZE = 1024
ADDR = (HOST,PORT)
try:
clisock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
clisock.connect(ADDR)
print 'ccccccccnnnnnnnnneeeeeeeee... | 21.111111 | 66 | 0.556842 |
c500ad836b98654a6328d008df6115d2dde7be9e | 199 | py | Python | src/python3_learn_video/pickle_json.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/pickle_json.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/pickle_json.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | city = {
'北京': '101010100',
'海淀': '101010200',
'朝阳': '101010300'
}
import pickle
pickle_file = open('city_data.pkl', 'wb')
pickle.dump(city, pickle_file) # dump 倾倒
pickle_file.close()
| 16.583333 | 41 | 0.628141 |
c5740a6a72e5a696945e0d921f98fb01fffd001d | 595 | py | Python | 3_Functions/args.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 3_Functions/args.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 3_Functions/args.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | # args (arguments) beliebig viele Argumente übergeben
# *args: variable number of pos. arguments
# Reihenfolge: NORMAL ARGS; *ARGS; DEFAULT ARGS
def my_function2(a, b, *args):
print(*args, type(args))
print('a: {}, b: {}, args: {}'.format(a, b, args))
my_function2(1, 2, 3, 4)
def my_function3(*args):
pri... | 27.045455 | 54 | 0.621849 |
b194f986291da38ae74daf23562fd5c9139f3eba | 2,974 | py | Python | src/onegov/agency/models/move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/models/move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/models/move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.core.orm.abstract import MoveDirection
class Move(object):
""" Base class for moving things. """
def __init__(self, session, subject_id, target_id, direction):
self.session = session
self.subject_id = subject_id
self.target_id = ... | 31.978495 | 78 | 0.631137 |
b8fc2120a83d0be7e7deb922abf8f42ffcd464ca | 2,299 | py | Python | imgtl/lib.py | reviforks/imgtl | b2141f9f0d7f2d318661f6ff6ab9594cff5b80f3 | [
"MIT"
] | null | null | null | imgtl/lib.py | reviforks/imgtl | b2141f9f0d7f2d318661f6ff6ab9594cff5b80f3 | [
"MIT"
] | null | null | null | imgtl/lib.py | reviforks/imgtl | b2141f9f0d7f2d318661f6ff6ab9594cff5b80f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shortuuid
import md5 as md5module
from wand.image import Image as wImage
from struct import unpack
from datetime import datetime, timedelta
from flask.ext.bcrypt import Bcrypt
from .const import URL_BLACKLIST, AVAILABLE_FORMAT, SERVERS, EXPIRE_BEHAVIORS
... | 24.2 | 91 | 0.672901 |
771909ffc81caabba8f9291f56378aa3f0f8cb09 | 2,436 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/third_party/LVM2/daemons/lvmdbusd/cfg.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/cfg.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/cfg.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# a... | 27.066667 | 72 | 0.756568 |
7733d060114cb38c0c09411528255734b6e97145 | 6,019 | py | Python | kernel/slovaki/models.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/slovaki/models.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/slovaki/models.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | from django.db import models
import secrets
from painless import functions as func
###########################
##### WEBSITE #####
###########################
# Create your models here.
class SlovakiWebsiteContent(models.Model):
about = models.TextField()
# Advertisement
title1 = models.CharFiel... | 30.709184 | 135 | 0.670211 |
6571fbb46a105d12a65fa9d3efb477aa890e6cc9 | 997 | py | Python | docker/api/api/cron.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | docker/api/api/cron.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | docker/api/api/cron.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Corona-Info-App
# Cron-Script for LK Marburg-Bidenkopf
# © 2020 Johannes Kreutz.
# Include utilities
# Include db connection
from main import db
from models.cron import cron
for job in cron.query.all():
if job.run() == False:
print ("A Job was unsuccessful:", job.id)
"""
#Fo... | 24.317073 | 71 | 0.65998 |
65de3e3c57b7ea7ec14b7ed590c731a363cb70fa | 1,234 | py | Python | 0_homeworks/Python/Console/2/List.py | Team-on/works | 16978b61c0d6bcb37e910efb4b5b80e9a2460230 | [
"MIT"
] | 10 | 2018-11-12T19:43:28.000Z | 2020-09-09T18:48:30.000Z | 0_homeworks/Python/Console/2/List.py | Team-on/works | 16978b61c0d6bcb37e910efb4b5b80e9a2460230 | [
"MIT"
] | null | null | null | 0_homeworks/Python/Console/2/List.py | Team-on/works | 16978b61c0d6bcb37e910efb4b5b80e9a2460230 | [
"MIT"
] | null | null | null | # List with cubes
n = (int)(input("N: "))
list1 = [x**3 for x in range(n+1) if x % 2 == 1]
for i in range(n + 1):
if i % 2 == 1:
list1.append(i**3)
print(list1)
# List from n-1 to n+1
n = 0
while n < 3:
try:
n = int(input("n: "))
except:
n = 0
list2 = [i for i in range(n-1, n+1)... | 16.236842 | 48 | 0.465154 |
02c31e80c5e9bdcb7007495f3735eb1a7a9892db | 870 | py | Python | examples/distance.py | Elecrow-RD/Raspberry-Pi-Starter-Kit | 9adad7bfb403a697119bf80bbc2290bc3832750d | [
"MIT"
] | 1 | 2020-08-11T23:39:23.000Z | 2020-08-11T23:39:23.000Z | examples/distance.py | Elecrow-RD/Raspberry-Pi-Starter-Kit | 9adad7bfb403a697119bf80bbc2290bc3832750d | [
"MIT"
] | null | null | null | examples/distance.py | Elecrow-RD/Raspberry-Pi-Starter-Kit | 9adad7bfb403a697119bf80bbc2290bc3832750d | [
"MIT"
] | 1 | 2020-08-05T18:30:45.000Z | 2020-08-05T18:30:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Author : www.modmypi.com
# Link: https://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi
import RPi.GPIO as GPIO
import time
# we set GPIO mode as GPIO.BCM
GPIO.setmode(GPIO.BCM)
# we set the pins for the TRIG and ECHO
TRIG = 23
ECHO = 24
# measur... | 19.333333 | 88 | 0.725287 |
a7bda28bcf5a1f4d3eb4915eb92e7ea866e5fd94 | 165 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-005/pg-5.3-1-equiteral-triangle.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-005/pg-5.3-1-equiteral-triangle.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-005/pg-5.3-1-equiteral-triangle.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | import turtle
turtle.speed(2)
turtle.forward(100)
turtle.left(120)
turtle.forward(100)
turtle.left(120)
turtle.forward(100)
turtle.left(120)
turtle.exitonclick()
| 12.692308 | 20 | 0.775758 |
ac362d7515e01f240320283d39526f22e307006d | 2,967 | py | Python | src/counter/lossy_counting.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | src/counter/lossy_counting.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | src/counter/lossy_counting.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | # -*- coding: utf-8 -*-
from util.iterator import sliding_window
class LossyCountingNGram(object):
'''
Count n-gram using Lossy Counting algorithme
:members:
_symbol_num: symbol count in training corpus.
_items: item dictionary. key is symbol which join \'@\' n-gram. value is symbol count... | 29.376238 | 94 | 0.510954 |
021be7744979087c4a9682fdc14e7cf6412a1ccd | 2,301 | py | Python | src/bo4e/enum/kalkulationsmethode.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/kalkulationsmethode.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/kalkulationsmethode.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring, line-too-long
from bo4e.enum.strenum import StrEnum
class Kalkulationsmethode(StrEnum):
"""
Auflistung der verschiedenen Berechnungsmethoden für ein Preisblatt.
"""
STUFEN = "STUFEN" #: Stufenmodell, d.h. die Gesamtmenge wird in eine Stufe eingeordnet und ... | 88.5 | 286 | 0.808779 |
0cc24aa04afa74d705fda642e05266cefb98f41f | 18,381 | py | Python | etl/io_config/jhapi.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/io_config/jhapi.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/io_config/jhapi.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | from etl.mappings.api_servers import servers
from etl.mappings.flowsheet_ids import flowsheet_ids
from etl.mappings.component_ids import component_ids
from etl.mappings.lab_procedures import lab_procedure_ids
from etl.core.environment import Environment
from etl.io_config.cloudwatch import Cloudwatch
import sys
impor... | 40.846667 | 171 | 0.627387 |
0b891f21f44738da29c457d06fbdca0606d7774f | 769 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/add_guardian_role_for_parent_portal.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/v10_0/add_guardian_role_for_parent_portal.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/add_guardian_role_for_parent_portal.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():
# create guardian role
if not frappe.get_value('Role', dict(role_name='Guardian')):
frappe.get_doc({
'doctype': 'Role',
'role_name': 'G... | 32.041667 | 120 | 0.716515 |
f04dd27dfc878d8b33492da497068c772c7bd1fb | 1,558 | py | Python | app/gui.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/gui.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/gui.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
import logging
class GUI:
def __init__(self, result_dir=None, url=None):
logging.info(f"[GUI] GUI init")
sg.theme("Dark")
dir_input = [
sg.Text("Zielordner auswählen"),
sg.In(size=(90, 10), enable_events=True, key="-FOLDER-", default_text=r... | 26.40678 | 99 | 0.539153 |
651fed6e44ddf67002e73c7fb1085f9519ba2b87 | 209 | py | Python | Exercicios/ex09-2.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex09-2.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex09-2.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | #transformar metros para centimtros
metros = float(input('Insira o comprimento em metros: '))
centimetros = metros*100
msg = '{0} metros equivalem à {1} centimetros'
print(msg.format(metros, centimetros))
| 20.9 | 57 | 0.746411 |
3361dbba9ae48c45687328b1192ee5f6bf05004b | 1,135 | py | Python | python/en/_packages/pyaudio/PyAudio-play_example_01.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/pyaudio/PyAudio-play_example_01.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/pyaudio/PyAudio-play_example_01.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | """
PyAudio-Play_example_01.py
Example to show how to use Play for PyAudio
Reference:
PyAudio, https://people.csail.mit.edu/hubert/pyaudio/
"""
# TODO: This didn't work at first. So do it again.
import pyaudio
import wave
import sys
from os import path
# Prepare the file
#filename = "jackhammer.wav"... | 23.163265 | 68 | 0.638767 |
68a5d4ef58038e53437686e8a5954b955b16d6f3 | 5,253 | py | Python | radiomics/radiomics_ria/scripts/segment.py | RimeT/p3_radio | 3d522a4356c62255cd93c6d74eb388a2e474dd00 | [
"Apache-2.0"
] | null | null | null | radiomics/radiomics_ria/scripts/segment.py | RimeT/p3_radio | 3d522a4356c62255cd93c6d74eb388a2e474dd00 | [
"Apache-2.0"
] | null | null | null | radiomics/radiomics_ria/scripts/segment.py | RimeT/p3_radio | 3d522a4356c62255cd93c6d74eb388a2e474dd00 | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
import csv
from datetime import datetime
import logging.config
import os
import threading
import SimpleITK as sitk
import six
import radiomics_ria.featureextractor
caseLogger = logging.getLogger('radiomics_ria.script')
_parallel_extraction_configured = False
def extractSegment(c... | 36.734266 | 120 | 0.73044 |
cc025a1c24d01530c84354ef2dc1f80f6ab1fb23 | 369 | py | Python | etl/transforms/primitives/row/load_discharge_json.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/transforms/primitives/row/load_discharge_json.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/transforms/primitives/row/load_discharge_json.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import json
import etl.mappings.confidence as confidence
def load_discharge_json(entry, log):
tsp = entry['HOSP_DISCH_TIME']
dept = entry['DischargeDepartment']
disposition = entry['DischargeDisposition']
result = [tsp,
json.dumps({'department':dept, 'disposition': disposition}),
... | 30.75 | 74 | 0.688347 |
c5e8877b4d02a85e3232b70bc2cbc7d30b98b90f | 4,689 | py | Python | app.py | innovation4health/workshop_i4h | cf072071c3e788297180e86cd5c3f297d8a76bce | [
"MIT"
] | 1 | 2021-02-28T20:50:11.000Z | 2021-02-28T20:50:11.000Z | app.py | innovation4health/workshop_i4h | cf072071c3e788297180e86cd5c3f297d8a76bce | [
"MIT"
] | null | null | null | app.py | innovation4health/workshop_i4h | cf072071c3e788297180e86cd5c3f297d8a76bce | [
"MIT"
] | null | null | null | import streamlit as st
import time
import pandas as pd
import numpy as np
import joblib
import PIL
from bokeh.models.widgets import Div
from sklearn.preprocessing import StandardScaler
import category_encoders as ce
import keras
import json
import nibabel as nib
import tensorflow as tf
import matplotlib.pyplot as plt
... | 39.403361 | 161 | 0.52122 |
681779806d72b020dd41a28020f911b6eec0648a | 319 | py | Python | exercises/pt/exc_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
# Importe a classe Doc
from ____ import ____
# Texto desejado: "Oh, realmente?!"
words = [____, ____, ____, ____, ____]
spaces = [____, ____, ____, ____, ____]
# Crie um Doc a partir das palavras words e espaçamento spaces
doc = ____(____, ____=____, ____=____)
print(doc.text)
| 21.266667 | 62 | 0.705329 |
a89e3caaf5f778a98a8529472102420a1c4a2b28 | 818 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_conta_ocorrencias.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_conta_ocorrencias.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_conta_ocorrencias.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por contar as ocorrências de um número em uma lista.
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import conta_ocorrencias
class PainelContaOc... | 37.181818 | 103 | 0.635697 |
766c4c98560e6413e7fdf9b7b30371b6213bc292 | 951 | py | Python | euler/20:Factorial_digit_sum.py | Alexdelia/Puzzle_Solving | 620e07508cd36dba7b806040c36360b87eb4637e | [
"CC0-1.0"
] | null | null | null | euler/20:Factorial_digit_sum.py | Alexdelia/Puzzle_Solving | 620e07508cd36dba7b806040c36360b87eb4637e | [
"CC0-1.0"
] | null | null | null | euler/20:Factorial_digit_sum.py | Alexdelia/Puzzle_Solving | 620e07508cd36dba7b806040c36360b87eb4637e | [
"CC0-1.0"
] | null | null | null | # **************************************************************************** #
# #
# ::: :::::::: #
# 20:Factorial_digit_sum.py :+: :+: :+: ... | 63.4 | 80 | 0.167192 |
4fddab25778ea363f5272e3577f0ac0569779caf | 711 | py | Python | src/gvz/migrations/0002_auto_20210424_2009.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 7 | 2021-04-24T19:11:15.000Z | 2021-10-30T12:59:16.000Z | src/gvz/migrations/0002_auto_20210424_2009.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 10 | 2021-04-25T10:25:12.000Z | 2021-04-26T17:55:20.000Z | src/gvz/migrations/0002_auto_20210424_2009.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2 on 2021-04-24 20:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gvz', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='administrativedivision',
old_name='TRAVEL_... | 24.517241 | 51 | 0.578059 |
8b38ca347bb66a5e0c275c4f3a04b7b014b5970c | 19,567 | py | Python | examples/information_extraction/DuUIE/uie/seq2struct/data_collator.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | examples/information_extraction/DuUIE/uie/seq2struct/data_collator.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | examples/information_extraction/DuUIE/uie/seq2struct/data_collator.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from dataclasses import dataclass
import random
import copy
import math
import numpy as np
from typing import Optional
from collections import OrderedDict
import logging
import paddle
from paddlenlp.data import Pad
from uie.evaluation.constants import (
BaseStructureM... | 38.593688 | 163 | 0.594266 |
8b4885987dcb5ba0640baf9def461879a9763170 | 1,267 | py | Python | packages/std/nodes/std___Print0/std___Print0.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___Print0/std___Print0.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___Print0/std___Print0.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
# USEFUL
# self.input(index) <- access to input data
# self.outputs[index].set_val(val) <- set output data port value
# self.main_widget <- access to main widget
class Print_NodeInstance(NodeIns... | 28.155556 | 84 | 0.56985 |
5079ab729465cf65ff3f3383886ea3004bed5817 | 1,504 | py | Python | projects/002-wuerfel/gaylordmartin179_Zufallsgenerator(fertig 2021 05 02).py | gaylordmartin179/start-projects | 094c7b3ab379bea39eabb31174e479307f9a3af0 | [
"MIT"
] | null | null | null | projects/002-wuerfel/gaylordmartin179_Zufallsgenerator(fertig 2021 05 02).py | gaylordmartin179/start-projects | 094c7b3ab379bea39eabb31174e479307f9a3af0 | [
"MIT"
] | 2 | 2021-04-04T09:16:43.000Z | 2021-04-07T08:53:53.000Z | projects/002-wuerfel/gaylordmartin179_Zufallsgenerator(fertig 2021 05 02).py | gaylordmartin179/start-projects | 094c7b3ab379bea39eabb31174e479307f9a3af0 | [
"MIT"
] | 2 | 2021-04-04T09:19:31.000Z | 2021-05-02T15:06:50.000Z | import random
#User mit der Application vertraut machen
print("Das hier ist ein Zufallsgenerator-Würfel-Programm.\n\n"
"Das Programm bietet ihnen die Möglichkeit im folgenden "
"festzulegen wie viele Würfelseiten ihr Würfel haben soll.\n"
"Anschließend dürfen sie dann raten auf welche Würfelseite de... | 34.976744 | 108 | 0.69016 |
50b1c6c4f143d9fc43d23f47cd73404a0762b190 | 393 | py | Python | DataStructures/Stacks/maximum_element.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | DataStructures/Stacks/maximum_element.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | DataStructures/Stacks/maximum_element.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
t = int(input().strip())
elem = []
max_elem = 0
for a0 in range(t):
n = input().split()
if n[0] == '1':
if max_elem < int(n[1]):
max_elem = int(n[1])
elem.append(int(n[1]))
elif n[0] == '2':
max_elem = 0
elem.pop()
if len(elem) > 0:... | 20.684211 | 32 | 0.46056 |
fa0b3b7446db993355eccf43afed20ef8b4b44b1 | 6,965 | py | Python | surface/Editor.py | StefanSchmelz/whoGetsTheMillion | 99a42b6a2e99def4faa05787b4869387d7827f86 | [
"MIT"
] | null | null | null | surface/Editor.py | StefanSchmelz/whoGetsTheMillion | 99a42b6a2e99def4faa05787b4869387d7827f86 | [
"MIT"
] | null | null | null | surface/Editor.py | StefanSchmelz/whoGetsTheMillion | 99a42b6a2e99def4faa05787b4869387d7827f86 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import tkinter as tk
from engine.Player import Player
from surface.qPanel import QuestionEditPanel
class EditorUi:
def __init__(self):
self.player = Player()
self.oldText = ""
self.editWindow = tk.Tk()
self.editWindow.title = "Who Gets The Million - EDITOR"... | 44.082278 | 226 | 0.651974 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.