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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ef5c05d07c94ab12daaf34ee2c942086381c9119 | 95 | py | Python | src/onegov/chat/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/chat/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/chat/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.chat.collections.message import MessageCollection
__all__ = ['MessageCollection']
| 23.75 | 61 | 0.831579 |
08640a6a15c950f34523b8f0a3a4f8749ffb761a | 890 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_multiprocessing_process.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_multiprocessing_process.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_multiprocessing_process.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_multiprocessing_process.py,v 1.2 2015/04/24 03:01:36 rodent Exp $
--- Lib/multiprocessing/process.py.orig 2014-12-10 15:59:39.000000000 +0000
+++ Lib/multiprocessing/process.py
@@ -306,7 +306,15 @@ class _MainProcess(Process):
self._popen = None
self._counter = itertools.count(1)
... | 40.454545 | 84 | 0.635955 |
41284f91e97e9c6ef198599aed54e1389643c1c1 | 188 | py | Python | event_detector/gttm/mathematics/math_func.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/mathematics/math_func.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/mathematics/math_func.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | import numpy as np
"""
http://xaktly.com/LogisticFunctions.html
"""
def sigmoid(x, x0=0, a=1, b=1):
return a / (1 + b * np.exp(x0 - x))
def linear(x, x_max):
return x / x_max
| 13.428571 | 40 | 0.590426 |
f5f327cd9ff06f5fab0f2ff8798824a261977b31 | 600 | py | Python | tools/parseVourchers.py | pegabot/pegabot | 72c68cd8b8f02366e13db79e03d5318f18715ddf | [
"MIT"
] | 1 | 2020-10-26T19:04:25.000Z | 2020-10-26T19:04:25.000Z | tools/parseVourchers.py | pegabot/pegabot | 72c68cd8b8f02366e13db79e03d5318f18715ddf | [
"MIT"
] | 9 | 2020-10-26T17:50:24.000Z | 2020-12-12T21:08:30.000Z | tools/parseVourchers.py | pegabot/pegabot | 72c68cd8b8f02366e13db79e03d5318f18715ddf | [
"MIT"
] | null | null | null | # Copyright(c) 2020 - 2021 The Pegabot authors
# This code is licensed under GNU Affero General Public License v3.0
# (see https: // github.com/pegabot/discord/blob/main/LICENSE for details)
from itertools import chain
from json import dumps
def parse() -> None:
with open("/Users/Nico/Documents/pegabot/tools/ra... | 28.571429 | 79 | 0.643333 |
f5f832d857fdf8ba2b20fae22c236465993fd701 | 9,522 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.accounts.doctype.sales_inv... | 30.915584 | 93 | 0.700378 |
f81cc92a77132004d46d45ce7256435cdeb20c5e | 179 | py | Python | diversos/ramdom.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/ramdom.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/ramdom.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | import random
numero = random.randint(0,666)
print (numero)
lista0 = [6, 45, 9 ,93, 333, 777 ,666 , 418 ,7 ,10 ]
print ("E o escolhido foi :-> " + str ( random.choice(lista0))) | 25.571429 | 63 | 0.631285 |
3e832bf254e17dcc6f45c13a705b354d17a88757 | 860 | py | Python | lib/widgets/elements/algctrl.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/elements/algctrl.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/elements/algctrl.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | from PyQt5.QtWidgets import (QLabel, QPushButton, QComboBox, QGridLayout)
from ...statics import ALGS
class AlgorithmControl(QGridLayout):
def __init__(self, parent=None):
super(AlgorithmControl, self).__init__()
self.selectedAlgorithm = 0
self.__controls()
self.__layout()
... | 26.875 | 73 | 0.639535 |
0a0695db7309eb82a535c64861a8ef0618fc3eaf | 166 | py | Python | quark_core_api/context/__init__.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | quark_core_api/context/__init__.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | quark_core_api/context/__init__.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | from quark_core_api.context.core_context import CoreContext
from quark_core_api.context.context_objects import ApplicationContext, WorkspaceContext, ExperimentContext | 83 | 106 | 0.909639 |
0a97b6dc3e022569d51dab49c7927f8f3858ff17 | 9,661 | py | Python | torch/autograd/grad_mode.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | torch/autograd/grad_mode.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | torch/autograd/grad_mode.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | import sys
import torch
import functools
import inspect
from typing import Any, Callable, TypeVar, cast
__all__ = ['no_grad', 'enable_grad', 'set_grad_enabled',
'inference_mode']
# Used for annotating the decorator usage of 'no_grad' and 'enable_grad'.
# See https://mypy.readthedocs.io/en/latest/generics.... | 33.77972 | 89 | 0.608322 |
7c18e9e8eb84c4991deb1abf6baef31d8f5e4c7d | 35,824 | py | Python | research/cvtmodel/regnet/src/regnet_y_400mf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/regnet/src/regnet_y_400mf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/regnet/src/regnet_y_400mf.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... | 60.513514 | 119 | 0.507174 |
7c5f31865a7d9da21e64de76cc746dc4437d7183 | 74,586 | py | Python | Elite-x.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Elite-x.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Elite-x.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #Recode Memeg
import requests,bs4,sys,os,random,time,re,json,uuid,subprocess
from random import randint
from concurrent.futures import ThreadPoolExecutor as ThreadPool
from bs4 import BeautifulSoup as par
from datetime import date
from datetime import datetime
from urllib.parse import quote
P = "\x1b[0;97m" # P... | 45.814496 | 364 | 0.448543 |
862a5e410aafaa9a9953b0a4403d4d1f539fa91f | 464 | py | Python | exercises/pt/test_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/test_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert "for ent in doc.ents" in __solution__, "Você está iterando nas entidades?"
assert (
"print(ent.text, ent.label_)" in __solution__
), "Você está imprimindo o texto (text) e o marcador (label)?"
__msg__.good(
"Ótimo trabalho! Até agora o modelo previu corretamente em to... | 38.666667 | 85 | 0.657328 |
86c597cad0de980fa7680a8981e75a8952f5f92e | 1,557 | py | Python | scripts/gitlab-runner-cleanup.py | ssube/k8s-shards | 8ce3464f4a7e96289c9b5f2b259de21d5d873815 | [
"MIT"
] | 1 | 2019-08-29T19:45:01.000Z | 2019-08-29T19:45:01.000Z | scripts/gitlab-runner-cleanup.py | ssube/k8s-shards | 8ce3464f4a7e96289c9b5f2b259de21d5d873815 | [
"MIT"
] | null | null | null | scripts/gitlab-runner-cleanup.py | ssube/k8s-shards | 8ce3464f4a7e96289c9b5f2b259de21d5d873815 | [
"MIT"
] | null | null | null | #! /usr/bin/env python2
import argparse
from datetime import datetime, timedelta
import requests
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--days', help='days since last contact before pruning', default=7, type=int)
parser.add_argument('--token', help='gitlab personal token with API scope')
p... | 33.847826 | 100 | 0.667951 |
86f139b48ac2136662c4b89731a34cc9bc3e0ca0 | 793 | py | Python | python/coursera_python/MICHIGAN/WEB/week4/webc/web.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/WEB/week4/webc/web.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/WEB/week4/webc/web.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # To run this, you can install BeautifulSoup
# https://pypi.python.org/pypi/beautifulsoup4
# Or download the file
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
# Ignore SSL ce... | 19.825 | 54 | 0.712484 |
8117cfab8b9134b0da20eec360d31c2d2b71e553 | 228 | py | Python | Lehrjahr_2/Modul_122/python/listmeminfo.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 5 | 2015-05-19T14:26:53.000Z | 2016-06-24T17:03:03.000Z | Lehrjahr_2/Modul_122/python/listmeminfo.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | null | null | null | Lehrjahr_2/Modul_122/python/listmeminfo.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 6 | 2015-05-26T06:25:05.000Z | 2020-04-30T07:25:30.000Z | #!/usr/bin/python3.4
#
#SCRIPT: listmemoryinfo.py
#AUTHOR: Severin Kaderli
#PURPOSE: List mem info
#USAGE: ./listmemoryinfo.py
def getmemoryinfo():
meminfo = open('/proc/meminfo', 'r')
liste = meminfo.readlines()
return liste | 22.8 | 37 | 0.72807 |
8120c8f11dda498b50f6f24c701af068c5fddcbc | 3,940 | py | Python | src/actiomatic/action.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/actiomatic/action.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/actiomatic/action.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | """
definition of an action
"""
class ActionManager:
def __init__(self, agent):
self.actions = []
self.agent = agent
def run_actions(self, game_state):
# TODO: Add priority check
# then execute, and remove appropriately
for action in self.actions:
... | 27.943262 | 152 | 0.628426 |
076c1bf58436d47231f74ee831a029573415ff29 | 60 | py | Python | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/profiling.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/profiling.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/profiling.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import cProfile
def sum():
print(1+2)
cProfile.run('sum()') | 15 | 21 | 0.683333 |
07a5e9d64859b7d1412fffc38c6a86451d8c08d2 | 3,696 | py | Python | test/test_npu/test_network_ops/test_prelu_backward.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_prelu_backward.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_prelu_backward.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... | 40.173913 | 77 | 0.590909 |
07d98ca5c6662b7fcb5dda622e54dbf4137d12a8 | 4,830 | py | Python | Grundgeruest/userena_urls.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Grundgeruest/userena_urls.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Grundgeruest/userena_urls.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from userena import settings as userena_settings
from userena import views as userena_views
from . import views as grundgeruest_views
from userena.compat import auth_views_compat_quirks, password_reset_uid_kwarg
from .forms import An... | 39.268293 | 102 | 0.671429 |
07ddbfbce97e47d8360789f587830bbc8382913c | 251 | py | Python | exercise2.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | 1 | 2020-11-21T16:57:40.000Z | 2020-11-21T16:57:40.000Z | exercise2.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null | exercise2.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null | import math
radius_str = input("Enter the radius of your circle")
radius_int = int(radius_str)
circumference = 2*math.pi*radius_int
area = math.pi*(radius_int*2)
print("The circumference is: ", circumference, \
", and the area is: ",area)
| 20.916667 | 53 | 0.705179 |
6a4168d8f99ed25f70dae901dab3576e092dfeea | 9,445 | py | Python | Utils/py/GoPro/utils/GameControlData.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/utils/GameControlData.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/utils/GameControlData.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | '''
Copied structure from the GameController "data.GameControlData.java" file.
'''
import logging
from struct import Struct
class GameControlData(Struct):
"""Representation of the SPL message format."""
GAMECONTROLLER_STRUCT_HEADER = b'RGme'
GAMECONTROLLER_STRUCT_VERSION = 11
COMPETITION_PHASE_... | 32.12585 | 95 | 0.533086 |
0ebf2af9a07dbf632878ea2a080d1809c41c4ca5 | 1,731 | py | Python | comp/zenefits/skype/BuyOneGetOne.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/zenefits/skype/BuyOneGetOne.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/zenefits/skype/BuyOneGetOne.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | def mincost(vals):
vals.sort()
pairs = [] # (price, quantity), from max price to min
pre, cnt = -1, 0
for i in range(len(vals) - 1, -1, -1):
if vals[i] != pre:
if i != len(vals) - 1:
pairs.append((pre, cnt))
cnt = 1
pre = vals[i]
else... | 28.377049 | 80 | 0.513576 |
bce12681acc4a19c6e1f7a1560587611271e4359 | 406 | py | Python | RDS/circle2_use_cases/port/src/api/Service/Service.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/port/src/api/Service/Service.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle2_use_cases/port/src/api/Service/Service.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from flask import jsonify
import Util
from connexion_plus import FlaskOptimize
def index():
return jsonify(Util.tokenService.getAllServices(informations=True))
def get(servicename):
servicename = servicename.lower()
if not servicename.startswith("port-"):
servicename = "port-{}".format(servicena... | 25.375 | 80 | 0.758621 |
e683000347dd4b68280f50c2f94da9adc3a72fdd | 2,135 | py | Python | external/test.py | AFE-GmdG/a-new-life | 22f3e5590ff6a5ec2c96f5855ad9e51dde36fe3c | [
"MIT"
] | 1 | 2019-10-27T17:09:46.000Z | 2019-10-27T17:09:46.000Z | external/test.py | a-friedel/a-new-life | 22f3e5590ff6a5ec2c96f5855ad9e51dde36fe3c | [
"MIT"
] | null | null | null | external/test.py | a-friedel/a-new-life | 22f3e5590ff6a5ec2c96f5855ad9e51dde36fe3c | [
"MIT"
] | null | null | null | import bpy
from mathutils import *
from math import *
f = bpy.data.objects['Cube']
f.matrix_local = Matrix()
#const axis = new Float3(0.1, 0.5, -0.3).normalized;
axis = Vector((0.1, 0.5, -0.3)).normalized()
#console.log(axis.toString("Rotation Axis"));
print("Rotation Axis:\n", axis)
#Matrix4x4.createRotat... | 37.45614 | 102 | 0.671663 |
e6bdc569e0848a5364824c40e3b917f48dd33a92 | 351 | py | Python | is-subsequence/is-subsequence.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | is-subsequence/is-subsequence.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | is-subsequence/is-subsequence.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
dp=[s[-i] for i in range(1,len(s)+1)]
for each in t:
if len(dp)==0:
return True
if each==dp[-1]:
dp.pop()
if len(dp)==0:
return True
else:
... | 23.4 | 52 | 0.401709 |
fc1c8699e749e364261e200b72a7184bde182410 | 4,690 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/GitReleaseAsset.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/GitReleaseAsset.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/GitReleaseAsset.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com> #
# Copyright 2017 Simon <spam@esemi.ru> ... | 49.368421 | 144 | 0.546695 |
f8f7e8d3821a2b4d4db878f333cd5725c3540238 | 2,151 | py | Python | storage/emulated/0/qpython/projects3/WebAppSample/main.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/projects3/WebAppSample/main.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/projects3/WebAppSample/main.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | #qpy:webapp:Hello Qpython
#qpy://127.0.0.1:8080/
"""
This is a sample for qpython webapp
"""
from bottle import Bottle, ServerAdapter
from bottle import run, debug, route, error, static_file, template
######### QPYTHON WEB SERVER ###############
class MyWSGIRefServer(ServerAdapter):
server = None
... | 31.632353 | 290 | 0.610879 |
5d4bc1b464620bfd6bbeb99ae766523d5f6cc398 | 6,377 | py | Python | contrib/华为云垃圾分类大赛心得与案例-GitLD/src_Xception_all_aug+TTA/train.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | contrib/华为云垃圾分类大赛心得与案例-GitLD/src_Xception_all_aug+TTA/train.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | contrib/华为云垃圾分类大赛心得与案例-GitLD/src_Xception_all_aug+TTA/train.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | # -*- coding: utf-8 -*-
import os
import multiprocessing
from glob import glob
import numpy as np
from keras import backend
from keras.models import Model
from keras.optimizers import adam
from keras.layers import Flatten, Dense, Input, Lambda, GlobalMaxPooling2D, GlobalAveragePooling2D, Concatenate, Dropout
from kera... | 43.087838 | 145 | 0.671476 |
5d4c7259852c3b1fcacae6df474ee20a893f40fb | 419 | py | Python | python/argparse/combining.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/argparse/combining.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/argparse/combining.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('square', type=int,
help='display a square of a given number')
parser.add_argument('-v', '--verbose', action='store_true',
help='increase output verbosity')
args = parser.parse_args()
answer = args.square ** 2... | 34.916667 | 62 | 0.663484 |
5d5ac72fd03ceea512462d39e9f6a46e58f3c197 | 1,724 | py | Python | python/oneflow/compatible/single_client/test/ops/test_memory_zone_out_of_memory.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_memory_zone_out_of_memory.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_memory_zone_out_of_memory.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... | 28.733333 | 83 | 0.718677 |
54d5a614ca2f243c5276f6d4fea76e0932bf4c9c | 689 | py | Python | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_mpu6050.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_mpu6050.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_mpu6050.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | """
Testing mpu6050 python driver
The below i2c configuration is needed in your board.json.
"mpu6050": {
"type": "I2C",
"port": 1,
"addrWidth": 7,
"freq": 400000,
"mode": "master",
"devAddr": 105
}
"""
print("testing mpu6050...")
from mpu6050 import MPU6050
mpu6050Dev = MPU6050()
mpu6050Dev.... | 19.138889 | 57 | 0.654572 |
37f9c60aebbca3187cfea82196477cb3c2c6e685 | 777 | py | Python | Problems/Dynamic Programming/Medium/MaxProductSubarray/max_product_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/MaxProductSubarray/max_product_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/MaxProductSubarray/max_product_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def maxProduct(self, nums: List[int]) -> int:
n = len(nums)
dp = [[nums[i] for _ in range(2)] for i in range(n)]
res = max(dp[0])
for i in range(1, n):
cur = nums[i]
if cur > 0:
dp[i][0] = max(cur, dp[i - 1][0] * cur)
if dp[i - 1][1] < 0... | 26.793103 | 56 | 0.432432 |
fe37df3973eff69714606cd1050c1ce52e4e592b | 27,403 | py | Python | Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Optional
''' IMPORTS '''
import re
import os
import json
import requests
from base64 import b64encode
''' GLOBAL VARS / INSTANCE CONFIGURATION '''
PARAMS = demisto.params()
USERNAME = PARAMS.get('c... | 29.560949 | 106 | 0.603985 |
43d11d8af9a19811e1c44039cf825dd15f2a5f50 | 312 | py | Python | 6_lets_review/solution.py | sourabhedake/hackerrank-30-days-of-code | c2d4ff6e8d9b4b1a2bb72a3b0a675b9ae09a8a5d | [
"MIT"
] | null | null | null | 6_lets_review/solution.py | sourabhedake/hackerrank-30-days-of-code | c2d4ff6e8d9b4b1a2bb72a3b0a675b9ae09a8a5d | [
"MIT"
] | null | null | null | 6_lets_review/solution.py | sourabhedake/hackerrank-30-days-of-code | c2d4ff6e8d9b4b1a2bb72a3b0a675b9ae09a8a5d | [
"MIT"
] | null | null | null | # Enter your code here. Read input from STDIN. Print output to STDOUT
num = int(input())
for i in range(num):
inp = input()
for i in range(0, len(inp), 2):
print (inp[i], end = "")
print (" ", end = "")
for i in range(1, len(inp), 2):
print (inp[i], end = "")
print ("")
| 19.5 | 69 | 0.519231 |
78e027ecb3c02475abeca4f82fb1e14094763b93 | 2,678 | py | Python | oneflow/python/test/ops/test_one_hot.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/ops/test_one_hot.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/ops/test_one_hot.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.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.475 | 87 | 0.682972 |
714a7e43f1baaa1a2862f633120f22144d694b32 | 17,575 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/bladepowerstate_lib.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/bladepowerstate_lib.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/bladepowerstate_lib.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 44.158291 | 166 | 0.61303 |
718053e0d2c3f7fb0c5d4613a272dcf69f655b3c | 5,614 | py | Python | c_CvDTree/Cluster.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | c_CvDTree/Cluster.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | c_CvDTree/Cluster.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import math
import numpy as np
from Util.Metas import TimingMeta
class Cluster(metaclass=TimingMeta):
def __init__(self, x, y, sample_weight=None, base=2):
self._x, self._y ... | 42.854962 | 113 | 0.589597 |
1ce6975c500280cb692c09da9b5c9362964bccfc | 1,588 | py | Python | demos/Multiscale/ThreeSided/model/parts/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSided/model/parts/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSided/model/parts/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z |
# params
params = {
'eta': [.065], # for tx_volume_generator
'tampw': [100000], # transactions limit
'alpha': [.9], # for cost_of_production_generator
'beta': [1.0], # for cost_of_production_generator
'flat': [500], #log quadratic overhead model; parameters
'a': [1000.0],
'b': [100.0],
... | 34.521739 | 90 | 0.63665 |
406defc0c9347f6601acf1a3c04804f335a8c3ca | 610 | py | Python | exercises/es/exc_02_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/exc_02_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/exc_02_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("es")
# Importa las clases Doc y Span
from spacy.____ import ____, ____
words = ["Me", "gusta", "David", "Bowie"]
spaces = [True, True, True, False]
# Crea un doc a partir de las palabras y los espacios
doc = ____(____, ____, ____)
print(doc.text)
# Crea un span para "David Bowie" a ... | 25.416667 | 79 | 0.706557 |
90fa7b23919c54cdd42c8447d297cec83f00d6f9 | 468 | py | Python | model/topoml_util/slack_send.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | model/topoml_util/slack_send.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | model/topoml_util/slack_send.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | import os
from slackclient import SlackClient
slack_token = os.environ.get("SLACK_API_TOKEN")
def notify(signature, message):
if slack_token:
sc = SlackClient(slack_token)
sc.api_call(
"chat.postMessage",
channel="#machinelearning",
text="Session \n" + signature + "\... | 29.25 | 102 | 0.666667 |
310515e4cd02010c2844d383eb3b43e2447f3887 | 2,403 | py | Python | Packs/CarbonBlackProtect/Integrations/CarbonBlackProtect/CarbonBlackProtect_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CarbonBlackProtect/Integrations/CarbonBlackProtect/CarbonBlackProtect_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CarbonBlackProtect/Integrations/CarbonBlackProtect/CarbonBlackProtect_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
def test_remove_prefix():
from CarbonBlackProtect import remove_prefix
prefix = "test_prefix"
str_with_prefix = '{}a'.format(prefix)
expected_response = 'a'
assert remove_prefix(prefix, str_with_prefix) == expected_response
str_without_prefix = 'b{}'.format(p... | 34.328571 | 99 | 0.744486 |
310a8fe2ee70140874ae1173dffbf59a68519e1c | 4,395 | py | Python | tarefas-poo/lista-01/calculos/model/calculos.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/model/calculos.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/model/calculos.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício calculos
# --------------------------
# Definição das funções que realizam cálculos diversos.
def media_de_tres_numeros(n1, n2, n3):
"""Calcula a média de três números.
"""
return (n1 + n2 + n3)/3
def soma_de_tres_numeros(n1, n2, n3)... | 24.691011 | 76 | 0.603185 |
73124228c253ec7722ed7497b7fdf775434b0fe0 | 2,088 | py | Python | Packs/CommonWidgets/Scripts/GetLargestInputsAndOuputsInIncidents/GetLargestInputsAndOuputsInIncidents_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonWidgets/Scripts/GetLargestInputsAndOuputsInIncidents/GetLargestInputsAndOuputsInIncidents_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonWidgets/Scripts/GetLargestInputsAndOuputsInIncidents/GetLargestInputsAndOuputsInIncidents_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | inputs_and_outputs = [
{
'args': [{'name': 'text', 'size': 10.44}],
'id': '9',
'name': 'Extract indicators from incident'
},
{
'id': '198',
'name': 'Malware Investigation',
'outputs': [{'name': 'IP', 'size': 159.692}],
'subplaybook': 'Malware Investiga... | 27.84 | 83 | 0.604885 |
7dfd3c1eca55b0cadc9e9c4e3ac04ba7a3a9f3ef | 2,211 | py | Python | Packs/Campaign/Scripts/ShowCampaignLastIncidentOccurred/ShowCampaignLastIncidentOccurred.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/ShowCampaignLastIncidentOccurred/ShowCampaignLastIncidentOccurred.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/ShowCampaignLastIncidentOccurred/ShowCampaignLastIncidentOccurred.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import dateutil.parser
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def get_incident_ids() -> list:
"""
Gets all the campaign incident ids.
Returns:
List of all the ids.
"""
incidents = demisto.get(demisto.context(), "EmailCampaign.incidents"... | 30.287671 | 109 | 0.613749 |
c377d2a50665e06c6361d690391aed35389fb26e | 1,003 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib___osx__support.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib___osx__support.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib___osx__support.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib___osx__support.py,v 1.1 2021/06/23 18:30:24 schmonz Exp $
macOS arm64 support, via MacPorts.
--- Lib/_osx_support.py.orig 2021-06-22 19:20:03.000000000 +0000
+++ Lib/_osx_support.py
@@ -470,6 +470,8 @@ def get_platform_osx(_config_vars, osnam
if len(archs) == 1:
mach... | 37.148148 | 76 | 0.548355 |
c4b729f5c81eda76f4601734c0d1b3cc5e0fd04e | 289 | py | Python | python_gui_tkinter/Tkinter/TkinterCourse/35_sliders_2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/Tkinter/TkinterCourse/35_sliders_2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/Tkinter/TkinterCourse/35_sliders_2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from tkinter import *
def show_values():
print (w1.get(), w2.get())
master = Tk()
w1 = Scale(master, from_=0, to=42)
w1.set(19)
w1.pack()
w2 = Scale(master, from_=0, to=200, orient=HORIZONTAL)
w2.set(23)
w2.pack()
Button(master, text='Show', command=show_values).pack()
mainloop()
| 17 | 55 | 0.66782 |
b513975bd1fa76b68b68806fce8aaab3f6c5bf9e | 1,860 | py | Python | CGR/TF/gen_scene.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | CGR/TF/gen_scene.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | CGR/TF/gen_scene.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | from random import randint as r
head = """set zoom 0.88
set scale 2
set scatter 5
set campos 0 0 -70.00
add light 22 6 2 0.78 0.78 0.78
add light 19 9 27 0.96 0.96 0.96
add light 21 -23 -1 0.72 0.72 0.72
add light 29 29 29 1.00 1.00 1.00
add sphere -13 0 -10 8 1
set sphere 0 color 1 0 1
set sphere 0 shiny 1
add sphe... | 20.217391 | 65 | 0.599462 |
968794864fe2a623f65dfe0b75e7e207e164179d | 10,548 | py | Python | pyScript_NodeManager/NodeContentWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/NodeContentWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/NodeContentWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | import re
from PySide2.QtWidgets import QWidget, QSizePolicy, QLineEdit, QColorDialog
from PySide2.QtCore import Qt
from PySide2.QtGui import QFontMetrics, QColor
from ui_node_manager_node_content_widget import Ui_Form
from Node import Node
from NodeInput import NodeInput
from NodeOutput import NodeOutput
from InputW... | 39.505618 | 122 | 0.678612 |
73b6c9a0fdc41053332ed89d877c3e47f0592e8d | 92 | py | Python | 2015/03/table-road-payments-20150312/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/03/table-road-payments-20150312/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/03/table-road-payments-20150312/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1qQpffy86h2BflEukxMET_P-hf69KXtYF1d4-nfb305U'
| 23 | 68 | 0.826087 |
fb86bf8269e0f8333fe1a538b84909026a728c5e | 407 | py | Python | Language Proficiency/Python/Strings/String Formatting/string_formatting.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Strings/String Formatting/string_formatting.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Strings/String Formatting/string_formatting.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def print_formatted(number):
# your code goes here
width = len("{:b}".format(n))
for i in range(1, n+1):
print("{0:{width}d}".format(i, width=width) + " " + "{0:{width}o}".format(i, width=width) + " " + "{0:{width}X}".format(i, width=width) + " " + "{0:{width}b}".format(i, w... | 27.133333 | 190 | 0.565111 |
f73ced32569e4fc87bf5de6a4e502ea584df54d9 | 304 | py | Python | Online-Judges/CodingBat/Python/String-02/String_2-03-cat_dog.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/String-02/String_2-03-cat_dog.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/String-02/String_2-03-cat_dog.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def cat_dog(str):
count_cat = 0
count_dog = 0
for i in range(len(str)-2):
if str[i:i+3] == "cat":
count_cat += 1
for i in range(len(str)-2):
if str[i:i+3] == "dog":
count_dog += 1
if count_cat == count_dog:
return True
return False
| 23.384615 | 31 | 0.5 |
b7d0f4d6b7085c72fd72c76b1b7542f3ff55ca28 | 675 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_tests_test__build__ext.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_tests_test__build__ext.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_tests_test__build__ext.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_distutils_tests_test__build__ext.py,v 1.1 2021/06/23 18:30:24 schmonz Exp $
darwin20 support, via MacPorts.
--- Lib/distutils/tests/test_build_ext.py.orig 2021-06-22 19:20:28.000000000 +0000
+++ Lib/distutils/tests/test_build_ext.py
@@ -491,7 +491,7 @@ class BuildExtTestCase(support.TempdirMa
... | 42.1875 | 94 | 0.645926 |
4dab3a21599d5fcb485b85b54b1bc17c985698b9 | 4,259 | py | Python | src/scripts/semdom/build-json-semantic-domains-data.py | pqh2/lfsite | 4ce17007c6a43b1324850f814ff7a98e07f000b3 | [
"MIT"
] | null | null | null | src/scripts/semdom/build-json-semantic-domains-data.py | pqh2/lfsite | 4ce17007c6a43b1324850f814ff7a98e07f000b3 | [
"MIT"
] | null | null | null | src/scripts/semdom/build-json-semantic-domains-data.py | pqh2/lfsite | 4ce17007c6a43b1324850f814ff7a98e07f000b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Parses semantic domain data from Ddp4.xml file (and related Ddp4Questions-*.xml files),
and outputs JSON data in the following format:
var semanticDomains_en = {
'1.1 Sky': {
'name': 'Sky',
'abbreviation': '1.1',
'description': 'Use this domain for words related t... | 36.09322 | 132 | 0.67011 |
4db64e368abb613d2456c0e09e3476312a84e1d0 | 561 | py | Python | Python/Topics/Sending-Email/01-sending-email.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Python/Topics/Sending-Email/01-sending-email.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Python/Topics/Sending-Email/01-sending-email.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | import smtplib
import os
EMAIL_ADDRESS = os.environ.get("GMAIL_ADDRESS")
EMAIL_PASSWORD = os.environ.get("GMAIL_APP_PASS")
with smtplib.SMTP("smtp.gmail.com", 587) as smtp:
smtp.ehlo()
smtp.starttls()
smtp.ehlo()
smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD)
subject = "Grab dinner this weekend?"
... | 24.391304 | 50 | 0.691622 |
678a59ae0b46ef0e0ca70a15486bff544ca76b63 | 1,481 | py | Python | fuzzsvc/model/FuzzingJob.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | 53 | 2016-08-26T02:51:45.000Z | 2021-05-24T21:05:44.000Z | model/FuzzingJob.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | null | null | null | model/FuzzingJob.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | 31 | 2016-08-26T04:08:31.000Z | 2021-05-24T21:05:54.000Z | from app import app
from datetime import *
from model.FuzzingJobState import FuzzingJobState
db = app.config['db']
class FuzzingJob(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(256), unique=True, nullable=False)
output = db.Column(db.String(8192))
state_id = db.C... | 40.027027 | 83 | 0.651587 |
e13ad75d0bb61d5d330b9a7b546f32aba898e5ef | 2,168 | py | Python | tarefas-poo/lista-03/prefeitura/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/prefeitura/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/prefeitura/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5663
# Exercício da Prefeitura
# --------------------------
# Classe que representa a interface com o usuário
#
from view.menu import Menu
from view.paineis.painel_cria_prefeitura import PainelCriaPrefeitura
from view.paineis.painel_analisa_prefeitura import PainelA... | 36.133333 | 86 | 0.549354 |
e155eccc22aaa7c0566f25cdf1c2f7adf885c0f6 | 290 | py | Python | python_playground/data/tools.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_playground/data/tools.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_playground/data/tools.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | # script that do some stuff
from data import compute_ground_truth_SimRank, DATASETS
def compute_sim():
for d in DATASETS:
print("computing true simrank: ", d)
compute_ground_truth_SimRank(d[0])
print("finish...")
if __name__ == '__main__':
compute_sim()
| 20.714286 | 55 | 0.672414 |
3d5835b9a8762f5a7e4246c41e4e47365573f336 | 4,371 | py | Python | .arch/resources.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | .arch/resources.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | .arch/resources.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | from devapp.tools import exists, write_file, read_file, abspath, os, project, os
from devapp.app import app, system, do
environ = os.environ
class emacs:
def rdp(rsc):
root = project.root()
DOOMDIR = root + '/cfg/doom'
prof_name = project.root().rsplit('/', 1)[1].strip()
# d = abs... | 36.425 | 145 | 0.510181 |
18250be3e158faddaa9fa02f08824966674baf9c | 79 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-35-declear-empty-dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-35-declear-empty-dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-35-declear-empty-dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | dt = {}
print(dt, type(dt))
dt[1] = 'one'
print(dt)
dt[2] = 'two'
print(dt)
| 7.9 | 19 | 0.518987 |
184be9bf473c3f675b88f010d7ca18510d1f8b70 | 1,106 | py | Python | Project Euler Qusetions 41 - 50/Project Euler Question 46.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 41 - 50/Project Euler Question 46.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 41 - 50/Project Euler Question 46.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 46
#Goldbach's other conjecture
import math
def prime_check(x):
if x > 2:
if x % 2 == 0:
return False
else:
for factor in range(3, int(math.sqrt(x) + 1), 2):
if (x % factor) == 0:
return False
else:
... | 24.043478 | 61 | 0.428571 |
18656d59f9b7059c590414ad6a61f24792421fa0 | 2,982 | py | Python | debtors_menu.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | debtors_menu.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | debtors_menu.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | from PyQt5 import uic
from PyQt5.QtWidgets import QDialog, QAction
from PyQt5.QtGui import QKeyEvent
from PyQt5.QtCore import Qt
from dbm import *
from custom_dialog import CustomDialog
from debtor_editor import DebtorEditor
class DebtorsMenu(QDialog):
def __init__(self, dbm: DataBaseManager):
super(Debt... | 37.275 | 93 | 0.604628 |
a1df50c9e0d7408d60209d82d93d2d6187c1ab6c | 420 | py | Python | exercises/en/test_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
import spacy.tokens
import spacy.lang.en
assert isinstance(
nlp, spacy.lang.en.English
), "The nlp object should be an instance of the English class."
assert isinstance(
doc, spacy.tokens.Doc
), "Did you process the text with the nlp object to create a doc?"
asse... | 30 | 75 | 0.661905 |
629d0667e8d8791d2d83ecf51ed002ff0836d9b9 | 2,404 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro_rotate.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro_rotate.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro_rotate.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import numpy as np
def rotate_right(values):
if len(values) < 2:
return values
end_pos = len(values) - 1
temp = values[end_pos]
for i in range(end_pos, 0, -1):
values[i] = values[i - 1]
value... | 19.867769 | 59 | 0.62604 |
9a7a033e9012e9230054bf4c38cc918b494342a7 | 1,912 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex10_flood_fill_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex10_flood_fill_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex10_flood_fill_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch06_arrays.solutions.ex10_flood_fill import flood_fill
def create_world_and_expected_fills():
first_world = [list(" # "),
list(" # "),
list("# # "),
... | 28.117647 | 61 | 0.34728 |
9afc643fd398679c2b8cb38184cd30df53b51f3a | 1,409 | py | Python | research/cv/DDM/dataset/__init__.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DDM/dataset/__init__.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DDM/dataset/__init__.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.225 | 116 | 0.687012 |
4995a1cbd0a7f5c8f6189e9860b98d6831c64d85 | 994 | py | Python | 2016/day03_squares_with_three_sides/python/src/part2.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day03_squares_with_three_sides/python/src/part2.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day03_squares_with_three_sides/python/src/part2.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Docstring."""
import io
from common import (
Sorter,
)
def get_input(file_loc="./input.txt"):
"""Docstring."""
with io.open(file_loc) as fh:
puzzle_input = fh.read().splitlines()
puzzle_input = [line for line in puzzle_input if line.strip() != '']
first, second, ... | 22.590909 | 72 | 0.561368 |
624d614d047b95928f505a57d7b355f33414d89c | 3,512 | py | Python | test/test_npu/test_network_ops/test_binary_cross_entropy_with_logits_backward.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_binary_cross_entropy_with_logits_backward.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_binary_cross_entropy_with_logits_backward.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... | 41.809524 | 100 | 0.723519 |
f30fcb126871d83a21a7ad2866a8e18f97f6ce0d | 621 | py | Python | 03.BruteForce/NY/B2178.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 03.BruteForce/NY/B2178.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 03.BruteForce/NY/B2178.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | #백준 2178 - 미로 탐색
from collections import deque
N, M = map(int, input().split())
maze = []
for _ in range (N) :
maze.append(list(map(int, input())))
dx = [0, 0, -1, 1]
dy = [-1, 1, 0, 0]
def BFS(x, y) :
dQueue = deque()
dQueue.append((x, y))
while dQueue :
x, y = dQueue.popleft()
... | 18.264706 | 49 | 0.428341 |
a2623b70a309a3aa2fa2a4146692a2edae968626 | 1,330 | py | Python | Algorithms/2_Implementation/52.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/52.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/52.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/the-time-in-words/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'timeInWords' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. INTEGER h
# 2. INTEGER m
#
def... | 27.142857 | 80 | 0.584211 |
a2899c7c79fe4f73fbf439fb2b8cacf0b3b13ef0 | 825 | py | Python | 04_SQL/commerce/auctions/migrations/0009_auto_20201103_2037.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0009_auto_20201103_2037.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0009_auto_20201103_2037.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-03 20:37
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0008_listing_watchers'),
]
operations = [
migrations.AddField(
model_name='listing'... | 27.5 | 119 | 0.6 |
0c564ea21dc940b38c123b086e38ef37e5716026 | 610 | py | Python | chord_rec/read_pk.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/read_pk.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/read_pk.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | import pickle
import h5py
'''
objects = []
with (open("src/pickle_vector_lists/Sears_reduce_vectors_ffnn_21enc.pkl", "rb")) as openfile:
while True:
try:
objects.append(pickle.load(openfile))
except EOFError:
break
for piece in objects:
#print("pieces:",len(piece))
p... | 25.416667 | 93 | 0.622951 |
0c5bbb90d3047bda1eb2cb8c2270622fe71ea10d | 666 | py | Python | 1_BasicFeatures/Numbers/float.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 1_BasicFeatures/Numbers/float.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 1_BasicFeatures/Numbers/float.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | import sys
import math
value = 42e+08 # 42 * 10 ^ 8
print(value)
print('{:.32f}'.format(value))
# Typüberprüfung
value_float = 18.345
print(type(value_float))
if isinstance(value_float, float):
print("it´s Float")
# gibt aus wieviel Byte benötigt werden
print(sys.getsizeof(value_float))
# Floats auf Gleichheit... | 22.2 | 63 | 0.720721 |
ac035b50953eb5246ebf516c47f4fc5e09eacaad | 5,657 | py | Python | src/test/tests/databases/ANSYS.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/ANSYS.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/ANSYS.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: ANSYS.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - Mesh
#
# Programmer: Brad Whitlock
# Date: Thu Jul 7 17:46:51 PST 2005
#
# Notes: The data for... | 26.434579 | 78 | 0.607036 |
3bb2e75f58910285f1c04756593e17dd59e27022 | 3,335 | py | Python | Utils/py/GoPro/utils/LEDStatusMonitor.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/utils/LEDStatusMonitor.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/utils/LEDStatusMonitor.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import socket
import threading
import time
from utils import Logger, blackboard
# setup logger for network related logs
logger = Logger.getLogger("LED")
class LedStatusMonitor(threading.Thread):
def __init__(self):
super().__init__()
self.__cancel = threading.Event()
self.sock = socket.... | 40.180723 | 92 | 0.498951 |
ce0fadf952005ceb2bd7f02e33842550789aafb3 | 382 | py | Python | onemax.py | chankane/pyind | 742bc671d3552d778024662867b64e32ae9bca9d | [
"MIT"
] | null | null | null | onemax.py | chankane/pyind | 742bc671d3552d778024662867b64e32ae9bca9d | [
"MIT"
] | null | null | null | onemax.py | chankane/pyind | 742bc671d3552d778024662867b64e32ae9bca9d | [
"MIT"
] | null | null | null | # Onemax Problem
import numpy as np
from pyind import pyind as pi
from pyind import defaults as df
IND_LEN = 100
POP_LEN = 100
def evl(ind):
return ind.sum()
if __name__ == "__main__":
pop = np.random.randint(2, size=(POP_LEN, IND_LEN))
conf = df.CONF
conf["eval"]["func"] = evl
best = pi.Py... | 14.692308 | 55 | 0.633508 |
5a14265e13b56d3b89aea5b959007eeb89861dc4 | 723 | py | Python | tests/resources/postgres/postgres-project/postgres_project/core/database.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 14 | 2021-03-27T22:18:56.000Z | 2022-03-21T19:04:48.000Z | tests/resources/postgres/postgres-project/postgres_project/core/database.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 33 | 2021-03-28T21:06:22.000Z | 2022-03-07T14:18:26.000Z | tests/resources/postgres/postgres-project/postgres_project/core/database.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | null | null | null | from typing import Any, AsyncGenerator, Dict
from sqlalchemy import inspect
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.ext.declarative import as_declarative
from sqlalchemy.orm import sessionmaker
from postgres_project.core.config import settings
engine = create_async_engine... | 31.434783 | 87 | 0.786999 |
ce6b209b0e7f754df92ac5e1bf6d0d4cca75c24d | 4,916 | py | Python | solutions/pedestrian_search/webserver/src/service/datasets/pedes.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/pedestrian_search/webserver/src/service/datasets/pedes.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/pedestrian_search/webserver/src/service/datasets/pedes.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import torch.utils.data as data
import numpy as np
import os
import pickle
import h5py
from PIL import Image
from scipy.misc import imread, imresize
from utils.directory import check_exists
class CuhkPedes(data.Dataset):
'''
Args:
root (string): Base root directory of dataset where [split].pkl and [sp... | 39.328 | 124 | 0.598454 |
f005b56732cd9fae1f9d3a7d0417478224bda004 | 6,001 | py | Python | research/cv/ESRGAN/src/model/generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ESRGAN/src/model/generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ESRGAN/src/model/generator.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... | 46.161538 | 120 | 0.630228 |
e8f8a53d9484cdce2fdbb6f76f97b7d5d758f905 | 9,463 | py | Python | Packs/PrismaSaasSecurity/Integrations/SaasSecurityEventCollector/SaasSecurityEventCollector.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/PrismaSaasSecurity/Integrations/SaasSecurityEventCollector/SaasSecurityEventCollector.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/PrismaSaasSecurity/Integrations/SaasSecurityEventCollector/SaasSecurityEventCollector.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import demistomock as demisto
import urllib3
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
import traceback
from typing import Dict, Tuple
# Disable insecure warnings
urllib3.disable_warnings() # pylint: disable=no-member
''' CONSTANTS ... | 36.964844 | 118 | 0.653176 |
cc03bb6e6a47192b2b5cf14d096235dd655d81d1 | 160 | py | Python | nodes/ue05_action_server/Test.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue05_action_server/Test.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue05_action_server/Test.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | path = [[1.0, 2.0], [4.0, 2.0], [0.0, 0.0]]
for goal in path:
print(goal)
print(goal[0])
print(goal[1])
for koord in goal:
print(koord)
| 20 | 43 | 0.5125 |
cc26e2ede5737bb0814fda9216cde42ee0faf73f | 22,178 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/buildman/toolchain.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/buildman/toolchain.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/buildman/toolchain.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2012 The Chromium OS Authors.
#
import re
import glob
from html.parser import HTMLParser
import os
import sys
import tempfile
import urllib.request, urllib.error, urllib.parse
import bsettings
import command
import terminal
import tools
(PRIORITY_FULL_PREFIX, PRIOR... | 36.417077 | 80 | 0.562043 |
04432d06ec6e95bf8e219011a435380c11b2a491 | 649 | py | Python | 7-assets/past-student-repos/data_struct_and_algo-master/ploting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/ploting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/ploting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # library
import matplotlib.pyplot as plt
from palettable.colorbrewer.qualitative import Pastel1_7
# create data
names='groupA', 'groupB', 'groupC', 'groupD',
size=[12,11,3,30]
# Create a circle for the center of the plot
my_circle=plt.Circle( (0,0), 0.7, color='white')
plt.pie(size, labels=names, colors=['red','green... | 25.96 | 68 | 0.718028 |
50062fe7cebc50ed7961e2cd17ebe265d9d698d8 | 1,898 | py | Python | paWeb.py | iSteveyang/bugWeb | 172dc202eaf4928c4b73ffe372e7e28b53e42e4f | [
"MIT"
] | null | null | null | paWeb.py | iSteveyang/bugWeb | 172dc202eaf4928c4b73ffe372e7e28b53e42e4f | [
"MIT"
] | null | null | null | paWeb.py | iSteveyang/bugWeb | 172dc202eaf4928c4b73ffe372e7e28b53e42e4f | [
"MIT"
] | null | null | null | #coding=utf-8
import requests
# from urllib.request import quote, unquote
import json
import os
import time
# keywords = ["书包", "雨伞"]
# for item in keywords:
# word = item
def search(lines):
leng = 9
wdata = []
for i in lines:
word = i.strip('\n')
print("读取到的一行:")
print(word)
... | 27.507246 | 81 | 0.452582 |
acd17a1b3722a933852207a1c50c17fd5b5cddb0 | 559 | py | Python | components/py_engine/tests/haas/HaaS200/python-apps/driver/led/main.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/py_engine/tests/haas/HaaS200/python-apps/driver/led/main.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaS200/python-apps/driver/led/main.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # coding=utf-8
# This is a sample Python script.
import utime
from driver import GPIO
print("start led test")
gpio = GPIO()
leds=("led1", "led2", "led3")
for i in range(3):
for led in leds:
gpio.open(led)
gpio.write(1)
utime.sleep_ms(200)
value = gpio.read()
print(value)
... | 20.703704 | 33 | 0.559928 |
c5a41cbdc0d83208b810a698cc7313474764573e | 878 | py | Python | gemtown/modelphotos/migrations/0002_auto_20190420_1510.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/modelphotos/migrations/0002_auto_20190420_1510.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/modelphotos/migrations/0002_auto_20190420_1510.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-04-20 06:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('modelphotos', '0001_initial'),
migrations.swappable_dependency... | 29.266667 | 127 | 0.65262 |
765c272ebaa4f8a5c2425b572503120225160a3e | 1,059 | py | Python | py-basics/src/lectures/classes/song.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/classes/song.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/classes/song.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | 4 | 2021-12-13T15:52:00.000Z | 2022-03-28T13:54:53.000Z | # 7 kyu | What a "Classy" Song
# https://www.codewars.com/kata/6089c7992df556001253ba7d/python
class Song:
def __init__(self, title, artist):
self.title = title
self.artist = artist
self.listeners = set()
def how_many(self, people):
old_length = len(self.listeners)
for ... | 35.3 | 78 | 0.645892 |
4f1b5ded162dffbfd49aec80a0ab8d19917c0e59 | 3,365 | py | Python | src/ingestion/transformers/monosi/zscores.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/ingestion/transformers/monosi/zscores.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/ingestion/transformers/monosi/zscores.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import logging
from math import sqrt
from typing import Any, List
from ingestion.transformers.base import Transformer
class ZScoreAlgorithm:
@classmethod
def _mean(cls, values: List[float]):
return round(sum(values) / len(values), 2)
@classmethod
def _std_dev(cls, values: List[float]):
... | 28.277311 | 78 | 0.508767 |
4fee84c14b8308b40c7f8e3b843771abe436a18e | 1,646 | py | Python | Kapitel_5/SmartLock/SmartLock.py | stephanhuewe/iotgadgets | a08204e87c864feee25ebc386974ebd6668945c9 | [
"MIT"
] | null | null | null | Kapitel_5/SmartLock/SmartLock.py | stephanhuewe/iotgadgets | a08204e87c864feee25ebc386974ebd6668945c9 | [
"MIT"
] | null | null | null | Kapitel_5/SmartLock/SmartLock.py | stephanhuewe/iotgadgets | a08204e87c864feee25ebc386974ebd6668945c9 | [
"MIT"
] | null | null | null | # Die nachfolgenden Libraries können bspw. über pip nachinstalliert werden
# Benötigt für den Zugriff auf den seriellen Port
import serial
# Regex benötigten wir zum parsen der Benutzernamen
import re
# Urllib2 hilft uns beim Aufruf der NUKI-Api
import urllib2
# Zunächst verbinden wir uns mit unserem seriellen... | 31.653846 | 89 | 0.676185 |
0fb508583a3c56c8efb1cd3b55027a161bf75499 | 499 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_0/update_dn_against_doc_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/update_dn_against_doc_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/update_dn_against_doc_fields.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('stock', 'doctype', 'delivery_note_item')
frappe.db.sql("""update `tabDelivery Note Item` set so_detail = prevdoc_detail_docname
where ifnu... | 35.642857 | 87 | 0.737475 |
d1417dcdfd69c3e9e25ba72baa5417414e7c2af5 | 2,492 | py | Python | research/cv/wgan/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-07-03T06:52:20.000Z | 2021-07-03T06:52:20.000Z | research/cv/wgan/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/wgan/eval.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... | 34.136986 | 99 | 0.695425 |
7ea71ea13fea019ee964615538c5cfd89ece6dc1 | 1,152 | py | Python | official/nlp/emotect/src/assessment_method.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/emotect/src/assessment_method.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/emotect/src/assessment_method.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... | 32.914286 | 78 | 0.640625 |
0e81a4703d1f7cd37171b48a9d10365e3c3d9830 | 267 | py | Python | packages/watchmen-meta/src/watchmen_meta/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .connected_space_graphic_service import ConnectedSpaceGraphicService
from .connected_space_service import ConnectedSpaceService
from .dashboard_service import DashboardService
from .report_service import ReportService
from .subject_service import SubjectService
| 44.5 | 73 | 0.906367 |
cb44687757c05d18886e65961fc8b6ee9e9bdd4c | 4,182 | py | Python | research/cv/UNet3+/dataset_preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/UNet3+/dataset_preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/UNet3+/dataset_preprocess.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... | 44.021053 | 116 | 0.62506 |
cb48bd511175c496241281a1c8f45524bfabdea2 | 281 | pyde | Python | kapitel2/w2_2/w2_2.pyde | ThomasBollmeier/programmieren-trainieren | b1670528aaae09f1ea9934db100f0d9c6eb3372f | [
"Apache-2.0"
] | null | null | null | kapitel2/w2_2/w2_2.pyde | ThomasBollmeier/programmieren-trainieren | b1670528aaae09f1ea9934db100f0d9c6eb3372f | [
"Apache-2.0"
] | null | null | null | kapitel2/w2_2/w2_2.pyde | ThomasBollmeier/programmieren-trainieren | b1670528aaae09f1ea9934db100f0d9c6eb3372f | [
"Apache-2.0"
] | null | null | null | # Weihnachtsbaum
def line(size, i, ch):
padding = size - 1 - i
return " " * padding + ch * (2*i+1) + " " * padding
def print_tree(size, ch):
for i in range(size):
print(line(size, i, ch))
print(line(size, 1, ch))
print_tree(7, "*")
| 18.733333 | 55 | 0.508897 |
38ca15ae3b889e2cb3e6efb33e6be900a9768116 | 4,347 | py | Python | service.py | satapathyS/aws_dashboard | 941d4ec10ead5eed7e1d4b1939fc4eb3ca9bdd90 | [
"MIT"
] | null | null | null | service.py | satapathyS/aws_dashboard | 941d4ec10ead5eed7e1d4b1939fc4eb3ca9bdd90 | [
"MIT"
] | null | null | null | service.py | satapathyS/aws_dashboard | 941d4ec10ead5eed7e1d4b1939fc4eb3ca9bdd90 | [
"MIT"
] | null | null | null | from flask import Flask, flash, abort, redirect, url_for, request, render_template, make_response, json, Response
import os, sys
import config
import boto.ec2.elb
import boto
from boto.ec2 import *
app = Flask(__name__)
@app.route('/')
def index():
list = []
creds = config.get_ec2_conf()
for region in config.r... | 36.529412 | 258 | 0.749942 |
aac738c5d8dd9310aec11eaf5f3fc41cfc758863 | 31,156 | py | Python | Packs/URLHaus/Integrations/URLHaus/URLHaus.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | Packs/URLHaus/Integrations/URLHaus/URLHaus.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/URLHaus/Integrations/URLHaus/URLHaus.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | from typing import Tuple
from CommonServerPython import *
''' IMPORTS '''
import traceback
import requests
import zipfile
import io
from datetime import datetime as dt
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# disable-secrets-detection-start
# Whether compromised websites are conside... | 38.993742 | 120 | 0.60303 |
2ab05dd7fbf33e6c54d91a5d9d939f09f502b529 | 1,505 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/intro/intro_binary_search_tree.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/intro/intro_binary_search_tree.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/intro/intro_binary_search_tree.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch08_binary_trees.util import TreeUtils
from ch08_binary_trees.intro.intro_binary_tree_node import BinaryTreeNode
def find(start_node, search_for):
# rekursiver Abbruch
if start_node is None:
return None
... | 23.153846 | 73 | 0.67907 |
2ab93afe69316ff2d13df9eee2a4ed35dc0507ba | 6,450 | py | Python | Packs/DeveloperTools/Integrations/CreateIncidents/CreateIncidents.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | null | null | null | Packs/DeveloperTools/Integrations/CreateIncidents/CreateIncidents.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/DeveloperTools/Integrations/CreateIncidents/CreateIncidents.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | null | null | null | import pathlib
from collections import namedtuple
import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
import requests
import traceback
from typing import Dict, Any
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=n... | 35.245902 | 115 | 0.657984 |
2dd53765d1e8fbd69035939ab02d3b109bd5fc44 | 2,384 | py | Python | pyntcloud/plot/threejs_backend.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/plot/threejs_backend.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/plot/threejs_backend.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import json
import os
import shutil
from pathlib import Path
import pandas as pd
try:
from IPython.display import IFrame
except ImportError:
IFrame = None
from .common import get_colors
from ..io.ply import write_ply
def plot_with_threejs(cloud, **kwargs):
if IFrame is None:
raise ImportError(... | 30.961039 | 106 | 0.615772 |
2dea29bed2261bc10f9bba359c8b135f6186a39f | 1,989 | py | Python | geol/utils/constants.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | geol/utils/constants.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | geol/utils/constants.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
Useful constants
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com>
# Michele Ferretti <mic.ferretti@gmail.com>
universal_crs = "epsg:3857"
default_crs = "epsg:4326"
# Foursquare crawler setup
max_request_per_hour = 4000
time_limit = 3480
# Urban Atlas
ITEM_COL = "ITEM2012"
CITIES = "CITIE... | 55.25 | 137 | 0.514832 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.