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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
76eb6aa3c4a3cb44cba264d94226244133790d6d | 137 | py | Python | Vorlesungsinhalte/2020-10-23_MauMau/main.py | wwi20ama-programmierung/python-intro | e779e3f600b7e54b7c5baef503b79065bdc3cdb6 | [
"MIT"
] | null | null | null | Vorlesungsinhalte/2020-10-23_MauMau/main.py | wwi20ama-programmierung/python-intro | e779e3f600b7e54b7c5baef503b79065bdc3cdb6 | [
"MIT"
] | null | null | null | Vorlesungsinhalte/2020-10-23_MauMau/main.py | wwi20ama-programmierung/python-intro | e779e3f600b7e54b7c5baef503b79065bdc3cdb6 | [
"MIT"
] | 2 | 2020-10-08T18:08:59.000Z | 2020-10-29T19:53:34.000Z | from maumau import start_maumau
import test
test.test_mischen()
test.test_ziehen()
test.test_geben()
test.test_pruefe()
#start_maumau()
| 15.222222 | 31 | 0.80292 |
6a881880655e68c323b39462586533dbe7b861af | 8,225 | py | Python | bot/utils/converters.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/utils/converters.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/utils/converters.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import importlib.util
from datetime import datetime
import typing as t
import logging
import discord
from dateutil.relativedelta import relativedelta
from discord.ext.commands import (
BadArgument,
Context,
Converter,
UserConverter,
)
from bot import exts
from bot.utils.time import parse_duration_stri... | 36.393805 | 98 | 0.622128 |
0a73c5f95020479ac3083bec33ca4fee8ca7cc8d | 2,110 | py | Python | sorting/insertion_sort.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | sorting/insertion_sort.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | sorting/insertion_sort.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | 1 | 2020-04-16T01:17:04.000Z | 2020-04-16T01:17:04.000Z | #!/usr/bin/python3
enable_debug = True
count_debug = 0
def debug(msg):
global enable_debug
global count_debug
if enable_debug:
print("%s, count: %s" % (msg, count_debug))
count_debug += 1
def swap(list_data, x, y):
list_data[x], list_data[y] = list_data[y], list_data[x]
def insertion... | 29.71831 | 80 | 0.564455 |
86da9203618a231a8efda5652493aa3d4ef9050f | 6,565 | py | Python | scripts/extraction/creodiasCARDS1Metadata2DB.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/extraction/creodiasCARDS1Metadata2DB.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/extraction/creodiasCARDS1Metadata2DB.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 :
# # Query And Transfer CARD Metadata with XMLHttpRequ... | 37.947977 | 228 | 0.674791 |
86fd7b014e8a91a32f63b042f8a649483e0407b2 | 3,875 | py | Python | py/jpy-integration/src/pythonToJava/python/test/test_jpy.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | py/jpy-integration/src/pythonToJava/python/test/test_jpy.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | py/jpy-integration/src/pythonToJava/python/test/test_jpy.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | import unittest
import jpyutil
import jpy
def some_function(x):
return x * x
def some_function2(x):
return x * x * x
class TheContext:
def __init__(self, amount):
self.amount = amount
def plus(self, other):
return self.amount + other
# Note: all jpy unit testing should go in this class for now, due... | 32.563025 | 122 | 0.746581 |
d4a369cfc6a59949db1f4dafef4875a35d2de8ab | 1,077 | py | Python | source/pkgsrc/emulators/unicorn/patches/patch-bindings_python_unicorn_unicorn.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/emulators/unicorn/patches/patch-bindings_python_unicorn_unicorn.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/emulators/unicorn/patches/patch-bindings_python_unicorn_unicorn.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-bindings_python_unicorn_unicorn.py,v 1.2 2021/02/25 19:47:51 leot Exp $
--- bindings/python/unicorn/unicorn.py.orig 2020-10-21 11:34:41.000000000 +0000
+++ bindings/python/unicorn/unicorn.py
@@ -71,20 +71,9 @@ def _load_lib(path):
_uc = None
# Loading attempts, in order
-# - user-provided environmen... | 37.137931 | 86 | 0.650882 |
ed13f6b2081a3ee05ee4e464c7a792c22c2624b2 | 1,474 | py | Python | books/PythonAutomate/file_organize/rename_dates.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/file_organize/rename_dates.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/file_organize/rename_dates.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # rename_dates.py - Renames filenames with American MM-DD-YYYY date format
# to European DD-MM-YYYY
import os
import re
import shutil
# Create a regex that matches files with the American date format
date_pattern = re.compile(
r"""^(.*?) # all text before the date
((0|1)?\d)- # one or... | 31.361702 | 81 | 0.626866 |
ed23fd550bb5627ad353dfafd9f2b18fcff3aa92 | 3,634 | py | Python | suds/transport/https.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | suds/transport/https.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | suds/transport/https.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | 36.707071 | 79 | 0.64557 |
ed83141fa49a95871fcad23c320e2589cee78725 | 1,533 | py | Python | src/ztc/net/http/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/net/http/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/net/http/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
# pylint: disable-msg=W0232,W0201
'''
ZTC HTTP check class - used to query url
TODO: use this class on nginx and apache templates
Copyright (c) 2010-2011 Vladimir Rusinov <vladimir@greenmice.info>
Licensed under GPL v.3
'''
import urllib2
import socket
import time
from ztc.check import ZTCChe... | 26.431034 | 76 | 0.598174 |
9c41f0732fabb952c9b4eaa80a5913a6f763db09 | 1,056 | py | Python | warp/constants.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | warp/constants.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | warp/constants.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | """
"""
import os
HOME_DIR_DEFAULT = '.warp'
if 'HOME_DIR_DEFAULT' in os.environ:
HOME_DIR_DEFAULT = os.environ['HOME_DIR_DEFAULT']
if 'WARP_HOME_DIR' in os.environ:
path = os.path.abspath(os.environ['WARP_HOME_DIR'])
assert os.path.isdir(path)
HOME_DIR_DEFAULT = os.path.join(path, HOME_DIR_DEFAULT)
... | 27.789474 | 111 | 0.711174 |
92d11f255c1effd4b21e00929352545aa1f26499 | 1,243 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/behavioral/strategy.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/behavioral/strategy.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/behavioral/strategy.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | """
*What is this pattern about?
Define a family of algorithms, encapsulate each one, and make them interchangeable.
Strategy lets the algorithm vary independently from clients that use it.
*TL;DR
Enables selecting an algorithm at runtime.
"""
class Order:
def __init__(self, price, discount_strategy=None):
... | 23.45283 | 83 | 0.668544 |
e051d9d3786b2cfb2b825405649a6c881705ed8f | 2,192 | py | Python | projects/g4h2-graduation-project/src/backends/scf_functions/utils/exceptions.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h2-graduation-project/src/backends/scf_functions/utils/exceptions.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h2-graduation-project/src/backends/scf_functions/utils/exceptions.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | """HTTP 异常
定义了一些与 HTTP 状态码 4xx 和 5xx 相关的异常,和从异常得到对应 HTTP 响应的方法
"""
import logging
from typing import Optional
from .response import generate_response
logger = logging.getLogger('utils.exceptions')
class HttpException(Exception):
default_status_code = 500
default_detail = 'Error'
def ... | 27.746835 | 89 | 0.627281 |
e06dbb14267d06dfea697e6039546e919179362f | 2,584 | py | Python | synop_dia.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | synop_dia.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | synop_dia.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | # Lee los archivos txt de los datos synop generados y crea un
# archivo txt con el resumen diario
import time, datetime, os
# Funciones en Modulo Personal
from module_functions import clear, creation_date
def diaaprocesar(dia):
# Se generan los datos de tipo Date
ahora = dia
ayer = ahora - datetime.timed... | 38.567164 | 105 | 0.668344 |
bc4364721d4bc77c81f3651b12a16e140ae74921 | 1,095 | py | Python | Packs/Campaign/Scripts/ShowCampaignHighestSeverity/ShowCampaignHighestSeverity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/ShowCampaignHighestSeverity/ShowCampaignHighestSeverity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/ShowCampaignHighestSeverity/ShowCampaignHighestSeverity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from ShowCampaignHighestSeverity import *
import pytest
data_test_get_incident_severity = [
('data_test/get_incident.json', 3)
]
@pytest.mark.parametrize('incident_data_path, expected_severity', data_test_get_incident_severity)
def test_get_incident_severity(mocker, incident_data_path, expected_severity):
w... | 37.758621 | 110 | 0.765297 |
bcf2a5deb240ea1429df387442bbfd14493e86dc | 13,403 | py | Python | module/segmentation_package/src/CopyPasteCustom.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | module/segmentation_package/src/CopyPasteCustom.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | module/segmentation_package/src/CopyPasteCustom.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import cv2
import matplotlib.pyplot as plt
import numpy as np
import os, json
from shapely.geometry import Polygon
import random
import os
import json
import copy
from tqdm import tqdm
import cv2
import numpy as np
from os import listdir
from os.path import isfile, join
import cv2
import matplotlib.pyplot as plt
import... | 34.633075 | 116 | 0.607774 |
d5e03b7691d15c74819044358cb7752abf74df40 | 3,964 | py | Python | tests/test_pdf.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 2,109 | 2020-05-02T23:47:18.000Z | 2022-03-31T22:16:54.000Z | tests/test_pdf.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 1,158 | 2020-04-29T18:07:02.000Z | 2022-03-31T21:50:57.000Z | tests/test_pdf.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 360 | 2020-04-29T14:44:49.000Z | 2022-03-31T09:26:23.000Z | """Testing PDF functionality of the CLI."""
from pathlib import Path
import pytest
from click.testing import CliRunner
from jupyter_book.cli.main import build
path_tests = Path(__file__).parent
@pytest.mark.requires_chrome
def test_pdfhtml(cli: CliRunner, temp_with_override: Path):
path_output = temp_with_ove... | 40.44898 | 85 | 0.703582 |
d5f6fd1bd44ecf69a67f71d44b5f1bfff57535d8 | 3,035 | py | Python | Packs/ThycoticDSV/Integrations/ThycoticDSV/ThycoticDSV.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ThycoticDSV/Integrations/ThycoticDSV/ThycoticDSV.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ThycoticDSV/Integrations/ThycoticDSV/ThycoticDSV.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 Dict
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
class Client(BaseClient):
def __init__(self, server_url: str, client_id: str, client_secret: str, proxy: bool, v... | 32.287234 | 115 | 0.630972 |
d5f730dc52c5508b89c8acbb469eb7972807618b | 16,521 | py | Python | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/train/train_D.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/train/train_D.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/train/train_D.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | from __future__ import print_function
import argparse
import os
import random
import sys
sys.path.append(os.getcwd())
import pdb
import time
import numpy as np
import json
import progressbar
import sys
sys.path.append('../')
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel... | 40.19708 | 118 | 0.636523 |
fc49807cdb24bcbbe9c4aa924df9e5acf3941eef | 8,649 | py | Python | sim/lib/parallel.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | null | null | null | sim/lib/parallel.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | null | null | null | sim/lib/parallel.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | 1 | 2021-07-28T13:52:58.000Z | 2021-07-28T13:52:58.000Z |
import time
import bisect
import copy
import numpy as np
import pandas as pd
import networkx as nx
import scipy
import scipy.optimize
import scipy as sp
import os, math
import pickle
import matplotlib.pyplot as plt
from joblib import Parallel, delayed
from pathos.multiprocessing import ProcessingPool as Pool
from lib... | 42.397059 | 145 | 0.655683 |
fc890695cd2a16a29967d9e47fb1848139d4639c | 4,159 | py | Python | ENV/tensorforce-master/mazerunner/world_queries.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ENV/tensorforce-master/mazerunner/world_queries.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ENV/tensorforce-master/mazerunner/world_queries.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | 1 | 2019-11-29T12:28:33.000Z | 2019-11-29T12:28:33.000Z | import math
import cocos
import cocos.euclid as eu
class WorldQueries(object):
"""
WorldQueries
Methods for querying map inherited by WorldLayer
Has context for game settings, map state and player state
"""
def __init__(self):
super(WorldQueries, self).__init__()
def distance_to... | 33.813008 | 108 | 0.501563 |
5d0d2e3985ae8108c770ab301961d3bd411d72ee | 753 | py | Python | order/migrations/0016_auto_20201208_0936.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | order/migrations/0016_auto_20201208_0936.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | order/migrations/0016_auto_20201208_0936.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-12-08 01:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0015_auto_20201207_1014'),
]
operations = [
migrations.AddField(
model_name='orderlist',
nam... | 30.12 | 134 | 0.569721 |
0701a45916eff647eb8a2b2f15ebf7da4e440c55 | 350 | py | Python | src/server/middleware/db.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/middleware/db.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/middleware/db.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import declarative_base
from server.models import mapper_registry
Base = declarative_base(metadata=mapper_registry.metadata)
db = SQLAlchemy(model_class=Base)
def init_db(app):
db.init_app(app)
db.app = app
with app.app_context():
db.cr... | 20.588235 | 58 | 0.748571 |
0716234c0ea2519883dc99244aa86a5f754ec78c | 789 | py | Python | python/coursera_python/MICHIGAN/WEB/week5/ass/test1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/WEB/week5/ass/test1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/WEB/week5/ass/test1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
serviceurl = 'http://maps.googleapis.com/maps/api/geocode/xml?'
while True:
address = input('Enter location: ')
if len(address) < 1: break
url = serviceurl + urllib.parse.urlencode({'address': address})
print('Retrie... | 30.346154 | 71 | 0.662864 |
ab46eb23788ceac071cbcd6c18543dca7cddd382 | 1,954 | py | Python | LogisticRegression/logisticregression_derivative.py | lance52587/MachineLearningNote | 0184f8de178990ee31ace2a43809830874313697 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | LogisticRegression/logisticregression_derivative.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | LogisticRegression/logisticregression_derivative.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2018-04-29 22:47:19
# @Author : Alan Lau
# @Email : rlalan@outlook.com
import math
import numpy as np
import matplotlib.pyplot as plt
def sigmoid(func):
"""sigmoid函数"""
return 1/(1+np.exp(-1*func))
def linear(a, b, X):
"""线性模型"""
return ... | 22.72093 | 89 | 0.585977 |
db6a8ebc4c37e8634c87ad9ffedc0a14d24736b3 | 939 | py | Python | DataStructures/Stacks/BalancedBrackets.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Stacks/BalancedBrackets.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Stacks/BalancedBrackets.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
n = int(raw_input())
pair = {
'(': ')',
'[': ']',
'{': '}',
}
for _ in xrange(n):
s = raw_input()
stacks = []
length = len(s)
if length % 2 != 0:
print 'NO'
break
mark = True
for i in xrange(length):
char = s[i]
if char in pair:
... | 19.5625 | 49 | 0.408946 |
db7af188b208b41b2e34157aff8d541e751ddf98 | 623 | py | Python | 2020-08-31-1109-gma_Level-3_UndRechtsHerum_mit_Funktion.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-08-31-1109-gma_Level-3_UndRechtsHerum_mit_Funktion.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-08-31-1109-gma_Level-3_UndRechtsHerum_mit_Funktion.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | '''
Created on 17.06.2018
@author: André Willms
'''
# Ab Python 3.8 müssen dlls als vertrauenswürdig markiert werden.
# Deshalb ab 3.8.x von den unteren beiden Anweisungen den
# Kommentar entfernen und den Pfad zum Projektverzeichnis
# korrekt angeben
import os
os.add_dll_directory("D:\Selfcoding\Will... | 18.878788 | 71 | 0.691814 |
72bab35da7dc62953dc4c95756d781b5a0b35bf7 | 449 | py | Python | src/onegov/feriennet/views/privacy_protection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/privacy_protection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/privacy_protection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public
from onegov.feriennet.app import FeriennetApp
from onegov.feriennet.layout import DefaultLayout
from onegov.org.models import Organisation
@FeriennetApp.html(
model=Organisation,
name='privacy-protection',
template='privacy_protection.pt',
permission=Public
)
de... | 24.944444 | 49 | 0.752784 |
72bae592734112ee7cf3f531c3a64c5987ebf0aa | 2,200 | py | Python | qmk_firmware/lib/python/qmk/path.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/lib/python/qmk/path.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/path.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Functions that help us work with files and folders.
"""
import logging
import os
import argparse
from pathlib import Path
from qmk.constants import MAX_KEYBOARD_SUBFOLDERS, QMK_FIRMWARE
from qmk.errors import NoSuchKeyboardError
def is_keyboard(keyboard_name):
"""Returns True if `keyboard_name` is a keyboard ... | 27.848101 | 166 | 0.686364 |
fe16b1f65624f40ff2f90dc630c98443dff10070 | 2,393 | py | Python | src/main/python/old/binaryzation100.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/old/binaryzation100.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/old/binaryzation100.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | import os
import sys
from PIL import Image
import os,random,string,shutil
path=".";
src="./src";
def subfilesName(path):
fl = [];
for i in os.walk(path, False):
for f in i[2]:
fl.append(f)
return fl
def cropImage(fileName):
#print "Processing ... ", fileName
#op... | 25.189474 | 88 | 0.535311 |
a3ac616cbe0ac9c8ac76dd664d8dca8a001a5fbb | 3,149 | py | Python | research/cv/midas/midas_run.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/midas/midas_run.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/midas/midas_run.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... | 38.876543 | 104 | 0.659257 |
4a9be1452610e1de63358d9996da3dcd89f74b09 | 3,169 | py | Python | test/test_npu/test_network_ops/test_bartlett_window.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_bartlett_window.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_bartlett_window.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... | 38.646341 | 78 | 0.729252 |
434ad3985c86f9a9ea6c5f0d6257d6a409d0e4e5 | 811 | py | Python | tests/test_login.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | 1 | 2019-10-31T13:34:12.000Z | 2019-10-31T13:34:12.000Z | tests/test_login.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | 1 | 2019-05-27T13:03:25.000Z | 2019-05-27T13:03:25.000Z | tests/test_login.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | null | null | null | from flask import session
def test_login_logout(client, auth, init_db):
"""
GIVEN a Flask app
WHEN navigated to /login
THEN check if login redirects to desired state
"""
assert client.get('/data').status_code == 302
assert client.get('/signin').status_code == 200
response = auth.login... | 25.34375 | 80 | 0.676942 |
71d669a7bea77473908deb117e0df6a249db4c2e | 248 | py | Python | leetcode/096-Unique-Binary-Search-Trees/UniqBinSearchTrees_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/096-Unique-Binary-Search-Trees/UniqBinSearchTrees_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/096-Unique-Binary-Search-Trees/UniqBinSearchTrees_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer} n
# @return {integer}
def numTrees(self, n):
a = [1] + [0] * n
for i in range(1, n + 1):
for j in range(i):
a[i] += a[j] * a[i - 1 - j]
return a[n]
| 22.545455 | 43 | 0.407258 |
1cab08a50d60df218f84100142b40d2e671e2dc9 | 642 | py | Python | src/python/linq.py | allenjzhang/playground | ef32d383d6c1751e204cb77db6658c6ed72624ad | [
"MIT"
] | 1 | 2020-06-10T11:34:59.000Z | 2020-06-10T11:34:59.000Z | src/python/linq.py | allenjzhang/playground | ef32d383d6c1751e204cb77db6658c6ed72624ad | [
"MIT"
] | null | null | null | src/python/linq.py | allenjzhang/playground | ef32d383d6c1751e204cb77db6658c6ed72624ad | [
"MIT"
] | 2 | 2020-05-26T06:39:04.000Z | 2020-11-16T06:34:23.000Z | import pymongo
class AnonObject(dict):
__getattr__ = dict.get
__setattr__ = dict.__setitem__
class Person:
def __init__(self, name, age, hobby) -> None:
self.hobby = hobby
self.name = name
self.age = age
def __repr__(self) -> str:
return "{0} is {1} and likes {2}".format(self.name, se... | 20.0625 | 79 | 0.629283 |
1ccba8f0573b73cb54dbc3e79a2e6bfbdae3f04f | 1,051 | py | Python | Raspberry Pi Pico/Pi_Pico_PIO_1Hz.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-03-22T18:38:43.000Z | 2021-03-22T18:38:43.000Z | Raspberry Pi Pico/Pi_Pico_PIO_1Hz.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | null | null | null | Raspberry Pi Pico/Pi_Pico_PIO_1Hz.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-02-06T10:07:36.000Z | 2021-02-06T10:07:36.000Z | # Pi_Pico_PIO_1Hz.py
# Example using PIO to blink an LED and raise an IRQ at 1Hz.
# https://github.com/raspberrypi/pico-micropython-examples/blob/master/pio/pio_1hz.py
import time
from machine import Pin
import rp2
@rp2.asm_pio(set_init=rp2.PIO.OUT_LOW)
def blink_1hz():
# Cycles: 1 + 1 + 6 + 32 * (30 + 1) = 1000
... | 27.657895 | 85 | 0.614653 |
1cea871938262bb13c22d471a8f4e807fbf3580e | 12,372 | py | Python | year_2/prog_base_sem1_cw/app/main/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_2/prog_base_sem1_cw/app/main/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_2/prog_base_sem1_cw/app/main/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | import os
from flask import render_template, redirect, url_for, abort, flash, request, current_app, send_from_directory, jsonify
from flask_login import login_required, current_user
from . import main
from .forms import EditProfileForm, PostForm, CommentForm, AvatarForm, EditCommentForm, DevBugForm, SearchForm, DeleteP... | 32.302872 | 126 | 0.67289 |
1c0a76d7497af8a6fb4c05a7967bececf70169f2 | 1,653 | py | Python | bets/management/commands/checkbets.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/management/commands/checkbets.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/management/commands/checkbets.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | import logging
from django.core.management.base import BaseCommand
from django.utils import timezone
from ...models import ChoiceBet, DateBet
from ...util import resolve_bet
from bets.exceptions import NoPlacedBets
class Command(BaseCommand):
help = 'Checks all bets, marks them as resolved if required and distr... | 44.675676 | 118 | 0.557774 |
c72c64eb133b30622b9829655fffdc6e9251531e | 4,364 | py | Python | examples/language_model/end_to_end_memory_networks/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/end_to_end_memory_networks/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/end_to_end_memory_networks/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 appli... | 36.066116 | 91 | 0.566224 |
c790d7d6bf307f67eeb39d7aba0afea13c2c78e7 | 12,690 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gce_labels.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gce_labels.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gce_labels.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright 2017 Google Inc.
# 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',
'status': ['preview'],
... | 39.166667 | 123 | 0.627266 |
31487c8ccb84b419eeb47e7609dbf4cd9934df68 | 4,400 | py | Python | myspiders/tools/tools_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/tools/tools_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/tools/tools_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | import aiohttp
import async_timeout
from urllib.parse import quote
from config import Logger, CONFIG
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
logger = Logger().logger
# 供 client_manual下载PDF时需要cookie使用
splash_url = 'http://%s:8050/execute?lua_source=' % CONFIG.H... | 33.333333 | 156 | 0.621818 |
314b2a0c0d59f1179ded9f847c0cde95ec8bb833 | 15,367 | py | Python | Controller/rest/Resources.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | Controller/rest/Resources.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | 7 | 2020-07-19T03:29:21.000Z | 2022-03-02T06:46:12.000Z | Controller/rest/Resources.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | from flask import request, send_from_directory
from flask_restful import Resource
from werkzeug.security import check_password_hash
import traceback
import jsonpatch
import os
import sys
from control.Injector import Injector
from rest.StatusCodes import Status as S
from data.ViewCompat import get_compatible_views
fr... | 38.321696 | 132 | 0.613132 |
315c5960d24704f7febe563b58d584143f4cc4a5 | 18,102 | py | Python | tests/onegov/election_day/formats/election/test_wabsti_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_wabsti_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_wabsti_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from io import BytesIO
from onegov.ballot import Election
from onegov.election_day.formats import import_election_wabsti_majorz
from onegov.election_day.models import Canton
def test_import_wabsti_majorz_cantonal_simple(session, import_test_datasets):
principal = 'sg'
# The tar file... | 30.069767 | 78 | 0.415147 |
31d9da1c3e105d66cd65e7f215a50695a0e3ca72 | 216 | py | Python | Exercicios/ex02.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex02.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex02.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | #verificar se é necessário parenteses
peso = float(input('Informe seu peso: '))
altura = float(input('Informe sua altura: '))
imc = peso/altura*altura
print('Seu imc é ',imc)
#o calculo gerou o resultado incorreto
| 24 | 45 | 0.731481 |
c32b8f5ab2566c9b02c78d4f15d2aa4929060121 | 2,988 | py | Python | 20-fs-ias-lec/groups/05-loraLink/src/LoRa_PC_Link/Wifi_Link_PC/lora_test_sensor_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/05-loraLink/src/LoRa_PC_Link/Wifi_Link_PC/lora_test_sensor_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/05-loraLink/src/LoRa_PC_Link/Wifi_Link_PC/lora_test_sensor_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from lora_feed_layer import Lora_Feed_Layer
import os
class Lora_Test_Sensor_Layer:
def __init__(self, feed_layer):
self.feed_layer = feed_layer
# Get sensor feed id (so far hard coded in lora_feed_layer)
fid = self.feed_layer.get_sensor_feed_fid()
print("Sensor Feed I... | 42.084507 | 92 | 0.629853 |
d2a2783e76bb49222355ad33a13f8986276d4b65 | 2,569 | py | Python | python/bag_of_words.py | Cl3V0r/MLSeminar | d05f171a9b7d773ea123e1919e07312a7f0c9fe8 | [
"MIT"
] | null | null | null | python/bag_of_words.py | Cl3V0r/MLSeminar | d05f171a9b7d773ea123e1919e07312a7f0c9fe8 | [
"MIT"
] | null | null | null | python/bag_of_words.py | Cl3V0r/MLSeminar | d05f171a9b7d773ea123e1919e07312a7f0c9fe8 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.cluster import KMeans
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
seed=42
dim = 1000
#get le... | 38.343284 | 120 | 0.722849 |
d2c1a25b3164b00bf92298408d2a927c512e9b76 | 585 | py | Python | leetcode/042-Trapping-Rain-Water/TrappingRainWater_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-04-07T15:08:53.000Z | 2016-04-07T15:08:53.000Z | leetcode/042-Trapping-Rain-Water/TrappingRainWater_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/042-Trapping-Rain-Water/TrappingRainWater_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[]} height
# @return {integer}
def trap(self, height):
i, j = 0, len(height) - 1
res = 0
while i < j:
if height[i] < height[j]:
h = height[i]
i += 1
while i <= j and height[i] < h:
... | 26.590909 | 47 | 0.335043 |
81b092a25ee81236e288920a241b1e7418bf0dc3 | 723 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/log/__init__.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/log/__init__.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/log/__init__.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | """Utility functionality for logging.
"""
import os
import logging
from cluster_helper import utils
LOG_NAME = "cluster_helper"
logger = logging.getLogger(LOG_NAME)
def setup_logging(log_dir):
logger.setLevel(logging.INFO)
if not logger.handlers:
formatter = logging.Formatter('[%(asctime)s] %(message... | 30.125 | 66 | 0.648686 |
c4ab703b778605af5c716a50a49f0dc934d5681a | 3,325 | py | Python | Packs/CommonScripts/Scripts/GetlistRow/GetListRow.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/GetlistRow/GetListRow.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/GetlistRow/GetListRow.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 *
def validate_args(parse_all, header, value):
if parse_all.lower() != 'true' and (not header or not value):
return_error("Error: If parse_all is false, both header and value must be specified.")
def validate_list_exists(list_data):
if not... | 37.359551 | 115 | 0.695338 |
484b216538afb3084111420aae1f0b8753de2190 | 1,038 | py | Python | file_extractor.py | HypoChloremic/FileManagement | e82e2fa284732b035673204fcb139b60fc972c24 | [
"Apache-2.0"
] | null | null | null | file_extractor.py | HypoChloremic/FileManagement | e82e2fa284732b035673204fcb139b60fc972c24 | [
"Apache-2.0"
] | null | null | null | file_extractor.py | HypoChloremic/FileManagement | e82e2fa284732b035673204fcb139b60fc972c24 | [
"Apache-2.0"
] | null | null | null | from os import walk
import os, shutil
class Expander:
def __init__(self):
self.ev = [".h", ".cpp"]
def bol(self, n):
for i in self.ev:
if i in n:
return True
return False
def expander(self, top, delimiter="/"): #, bol_=lambda i: True if (".h" or ".cpp" in i)):
walk_gen = walk(top)... | 21.183673 | 91 | 0.546243 |
d206bfa940d65924edec716d6163a8e573c0ad01 | 815 | py | Python | Packs/DeveloperTools/Scripts/VerifyEnoughIncidents/VerifyEnoughIncidents.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeveloperTools/Scripts/VerifyEnoughIncidents/VerifyEnoughIncidents.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeveloperTools/Scripts/VerifyEnoughIncidents/VerifyEnoughIncidents.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
args = demisto.args()
query = args.get('query')
size = int(args.get('size'))
try:
raw_result = demisto.executeCommand("SearchIncidentsV2", {"query": query,
... | 31.346154 | 111 | 0.584049 |
73674f4344eb683e0999368cff3a5c244eebfc96 | 854 | py | Python | WeChatRecorder/RecorderUtils/ConfigParser.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatRecorder/RecorderUtils/ConfigParser.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatRecorder/RecorderUtils/ConfigParser.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
# python35
class ConfigParser(object):
def __init__(self, config_file, split_format):
self.config_file = config_file
self.split_format = split_format
def get(self, attr_name):
with open(self.config_file, 'rb') as f:
config_lines = f.read().decode('ut... | 32.846154 | 60 | 0.535129 |
738dce82ee4db5deea7624066480c853b342aa46 | 388 | py | Python | tsTclnt3.py | kona3266/SocketServer | 2bc9b271c909bba6b6457c709c98e95919f86198 | [
"Apache-2.0"
] | null | null | null | tsTclnt3.py | kona3266/SocketServer | 2bc9b271c909bba6b6457c709c98e95919f86198 | [
"Apache-2.0"
] | null | null | null | tsTclnt3.py | kona3266/SocketServer | 2bc9b271c909bba6b6457c709c98e95919f86198 | [
"Apache-2.0"
] | null | null | null | from socket import *
HOST = 'localhost'
PORT = 21567
BUFSIZ = 1024
ADDR = (HOST, PORT)
tcpCliSock = socket(AF_INET, SOCK_STREAM)
tcpCliSock.connect(ADDR)
while True:
data = input('> ')
data = data.encode()
if not data:
break
tcpCliSock.send(data)
data = tcpCliSock.recv(BUFSIZ)
if not da... | 20.421053 | 41 | 0.646907 |
739c8e5b1ecbfecabfcd3a307d6d0ec690ef4053 | 1,500 | py | Python | docs/lectures/lecture06/notebook/helper.py | yankeesong/2021-CS109A | 0fea6b4411092446719d09379c6a12815aa91ab2 | [
"MIT"
] | 81 | 2020-08-17T10:18:50.000Z | 2022-03-14T00:10:17.000Z | docs/lectures/lecture06/notebook/helper.py | SBalas/2021-CS109A | 0f57c3d80b7cef99d660f6a77c0166cffc1253e8 | [
"MIT"
] | 1 | 2022-02-09T06:15:51.000Z | 2022-02-09T12:42:44.000Z | docs/lectures/lecture06/notebook/helper.py | SBalas/2021-CS109A | 0f57c3d80b7cef99d660f6a77c0166cffc1253e8 | [
"MIT"
] | 95 | 2020-08-29T22:49:34.000Z | 2022-03-25T18:36:13.000Z | import numpy
from sklearn.preprocessing import PolynomialFeatures
# This a helper function that will help you plot the estimated polynomial regression along with the true values & true function
# We will use this later
def plot_functions(d, est, ax, df, alpha, xvalid, yvalid, xtrain, ytrain):
"""Plot the approxi... | 41.666667 | 127 | 0.683333 |
73c1aee87a4065e25f7ce98b9051da5e0e5295d9 | 1,412 | py | Python | frappe-bench/apps/erpnext/erpnext/config/assets.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/assets.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/assets.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Assets"),
"items": [
{
"type": "doctype",
"name": "Asset",
},
{
"type": "doctype",
"name": "Asset Category",
},
{
"type": "doctype",
"name": "Asset Settings",
... | 17.219512 | 72 | 0.473796 |
73d8ce903bc47e1d86eba8c80354861b5c14f4f9 | 3,165 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex07_braces.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex07_braces.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex07_braces.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from enum import Enum, auto
from ch05_datastructures.solutions.ex02_stack import Stack
def check_parentheses(input):
# Ungerade Länge kann keine wohlgeformte Klammerung sein
if len(input) % 2 != 0:
return False
... | 28.772727 | 83 | 0.637915 |
584b7cd639ac5ab0b11007cd1c618144d9dd97c9 | 561 | py | Python | Online-Judges/HackerRank/Python/Lists.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/HackerRank/Python/Lists.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/HackerRank/Python/Lists.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | if __name__ == '__main__':
n = int(input())
data = []
for _ in range(n):
cmd = input().split()
if cmd[0] == "insert":
data.insert(int(cmd[1]), int(cmd[2]))
elif cmd[0] == "print":
print(data)
elif cmd[0] == "remove":
data.remove(int(cmd[1])... | 28.05 | 49 | 0.427807 |
58797f994eab4b559be0f0aba2238fc3431230b1 | 425 | py | Python | exercises/fr/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Importe la classe de langue "Français" et crée l'objet nlp
from spacy.lang.fr import French
nlp = French()
# Traite le texte
doc = nlp("La forêt est peuplée de loups gris et renards roux.")
# La portion du Doc pour "loups gris"
loups_gris = doc[5:7]
print(loups_gris.text)
# La portion du Doc pour "loups gris et r... | 26.5625 | 67 | 0.743529 |
587bfedc49dc7718bfa07479239f2ff4d94005c4 | 2,705 | py | Python | top/clearlight/base/liaoxuefeng/base/Fundament.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/base/Fundament.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/base/Fundament.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import re
import json
print('hello world')
# 输入且包含提示信息并赋值
# name = input('please input your name')
# print("hello", name)
a = -100
if a >= 0:
print(a)
else:
print(-a)
age = 20
if age >= 18:
print('adult')
else:
print('teenager')
# 多行打印
print(r'''line1,\n
line2
line3''')
a = 123 # a是整数
print(a)
a ... | 14.015544 | 58 | 0.63512 |
49e66136d9987f0b7f9c2e161823f9444cf93809 | 1,591 | py | Python | Sorting/src/recursive_sorting/notes/merge_sort_notes.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | null | null | null | Sorting/src/recursive_sorting/notes/merge_sort_notes.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/02_algorithms/Sorting/src/recursive_sorting/notes/merge_sort_notes.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """Algorithms :: Merge sort
Notes from reviewing merge sort in lecture.
"""
arr1 = [5, 9, 3, 7, 2, 8, 1, 6]
arr2 = [[5, 9, 3, 7], [2, 8, 1, 6]]
arr3_2 = [[5, 9], [3, 7], [2, 8], [1, 6]]
# Single-item arrays are sorted
arr3_2 = [[5], [9], [3], [7], [2], [8], [1], [6]]
def merge(arrA: list, arrB: list):
elemen... | 25.66129 | 56 | 0.518542 |
b7239847ae1774b6267e16332845d69e6e7985c9 | 406 | py | Python | src/onegov/org/constants.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/constants.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/constants.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.org import _
TICKET_STATES = {
'open': _("Open"),
'pending': _("Pending"),
'closed': _("Closed"),
'archived': _("Archived"),
'all': _("All")
}
PAYMENT_STATES = {
'open': TICKET_STATES['open'],
'paid': _("Paid"),
'failed': _("Failed"),
'cancelled': _("Refunded")
}
PAYME... | 18.454545 | 41 | 0.554187 |
b78d8f575d09172e9a978e09d3e847f7b22185e3 | 3,736 | py | Python | tests/addons/reqs2reqs/test_replace.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | tests/addons/reqs2reqs/test_replace.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | tests/addons/reqs2reqs/test_replace.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import freezegun
import pytest
from jumeaux.addons.reqs2reqs.replace import Executor
from jumeaux.models import Reqs2ReqsAddOnPayload
from owlmixin.util import load_yaml
class TestRequestCondition:
@pytest.mark.parametrize(
"reqs, expected",
[
... | 31.394958 | 92 | 0.329764 |
b7ed81ec4118759a88150caf4397a8206d2b2b92 | 1,936 | py | Python | testcode/deprecated_test_parser.py | Cl3V0r/MLSeminar | d05f171a9b7d773ea123e1919e07312a7f0c9fe8 | [
"MIT"
] | null | null | null | testcode/deprecated_test_parser.py | Cl3V0r/MLSeminar | d05f171a9b7d773ea123e1919e07312a7f0c9fe8 | [
"MIT"
] | null | null | null | testcode/deprecated_test_parser.py | Cl3V0r/MLSeminar | d05f171a9b7d773ea123e1919e07312a7f0c9fe8 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import json
def crawl_kompas(url):
result = []
req = requests.get(url)
soup = BeautifulSoup(req.text, "lxml")
#find paging page
paging = soup.find_all("div", {'class': 'paging clearfix'})
paging_link = paging[0].find_all('a', {'class': 'paging__l... | 30.730159 | 87 | 0.581612 |
4d83e02bde14729b0eeba4f461b3f6aa4970f6a2 | 2,596 | py | Python | pyFiber/scripts/pyFiberPhotometry.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 4 | 2017-06-20T19:56:22.000Z | 2021-05-29T10:07:47.000Z | pyFiber/scripts/pyFiberPhotometry.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 11 | 2017-05-31T19:14:32.000Z | 2018-09-12T23:44:11.000Z | pyFiber/scripts/pyFiberPhotometry.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 2 | 2017-06-20T17:14:38.000Z | 2017-06-20T19:51:34.000Z | import os
import json
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(suppress=True) # don't display scientific notation
def data_reduce(array1d,factor=1000*.3):
newLength=int(len(array1d)/factor)
reduced = np.empty(newLength)*np.nan
for i in range(newLength):
reduced[i]=np.a... | 33.714286 | 102 | 0.627889 |
426dc2f7a72dd370e450f4f1491c878140f30a97 | 1,912 | py | Python | test/test_tag17.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag17.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag17.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch, call
try:
from pyventskalender import tag17_loesung as heute
except ImportError:
from pyventskalender import tag17 as heute
class Tag17Tests(TestCase):
def test_10_mock_funktioniert(self):
with patch.object(heute.Katze, 'macht_ton', ... | 35.407407 | 98 | 0.616109 |
427c5de87c289498a7c65a56c41629173e00b639 | 395 | py | Python | flask/tutorial-1-3-router-blueprint/items/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | flask/tutorial-1-3-router-blueprint/items/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | flask/tutorial-1-3-router-blueprint/items/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | # https://github.com/gothinkster/flask-realworld-example-app/blob/master/conduit/user/views.py
from flask import Blueprint
blueprint = Blueprint('items', __name__, url_prefix='/items')
@blueprint.route("/", methods=('GET',))
def get_item_list():
return {"message": "Get List of Items."}
@blueprint.route("/", met... | 30.384615 | 94 | 0.701266 |
35eaa561d9fab4c6111ae94983e979e4bf227093 | 365 | py | Python | doc/precursers/2019_09-Sneakernet/MontagsTests/hashExample.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | doc/precursers/2019_09-Sneakernet/MontagsTests/hashExample.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | doc/precursers/2019_09-Sneakernet/MontagsTests/hashExample.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import nacl.hash
import nacl.encoding
from nacl.public import PrivateKey
message = 'Hallo, ich mag Kuchen.'
message2 = 'Kuchen.'
hash_function = nacl.hash.sha256
hash_function2 = nacl.hash.sha512
output = hash_function(message.encode(), nacl.encoding.HexEncoder)
output2 = hash_function2(message.encode(), nacl.encodi... | 22.8125 | 68 | 0.789041 |
2202d409fbce5b1cd0bc5661f5cd86075bdd9193 | 402 | py | Python | RunFaster/concurrency/Code-05-Printing_Default_ThreadName.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | RunFaster/concurrency/Code-05-Printing_Default_ThreadName.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | RunFaster/concurrency/Code-05-Printing_Default_ThreadName.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | '''
DEVELOPER NAME : BALAVIGNESH.M
IMPLEMENTED DATE: 16-11-2018
'''
import threading
import time
class ThreadName:
@staticmethod
def GetThreadName():
print(threading.currentThread().getName(),'Strating....')
time.sleep(2)
print(threading.currentThread().getName(),'Exiting.....')
thnam... | 20.1 | 65 | 0.686567 |
187b8466cb393088f2d002a05755844018015546 | 1,224 | py | Python | generateVersions.py | eonum/medcodesearch-frontend | 785c2956bfbe677dfcf623405aefaa456fa8b31c | [
"MIT"
] | null | null | null | generateVersions.py | eonum/medcodesearch-frontend | 785c2956bfbe677dfcf623405aefaa456fa8b31c | [
"MIT"
] | 8 | 2017-06-26T13:21:16.000Z | 2021-06-28T14:53:59.000Z | generateVersions.py | eonum/medcodesearch-frontend | 785c2956bfbe677dfcf623405aefaa456fa8b31c | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
GET the Versions for all languages and catalogs from eonum api and generate the typescript file
src/app/versions.ty, that exports them as Dictionary.
"""
import os;
import json
from urllib.request import urlopen
from pprint import pformat
DIR = os.path.dirname(os.path.realpath(__file__))
FILE_P... | 27.818182 | 104 | 0.638072 |
62a2c0cfb9d7c6eca01483970c913f61a09836be | 896 | py | Python | python/generator_tricks_for_systemprogrammer/fieldmap.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/fieldmap.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/fieldmap.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # retuple.py
#
# Read a sequence of log lines and parse them into a sequence of tuples
import re
def field_map(dictseq, name, func):
for d in dictseq:
d[name] = func(d[name])
yield d
if __name__ == "__main__":
loglines = open("access-log")
logpats = r"(\S+) (\S+) (\S+) ... | 21.853659 | 79 | 0.49442 |
62c8d404d6daa76219d6bc76a28968be00e6a32c | 1,227 | py | Python | Packs/ArcherRSA/Scripts/ArcherCreateIncidentExample/ArcherCreateIncidentExample.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ArcherRSA/Scripts/ArcherCreateIncidentExample/ArcherCreateIncidentExample.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ArcherRSA/Scripts/ArcherCreateIncidentExample/ArcherCreateIncidentExample.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import demistomock as demisto
from CommonServerPython import *
"""
Use the ArcherCreateIncidentExample script to create a incident object (applicationId = 75) in Archer.
The script gets the arguments required to create the incident, such as category, summary, and so on.
It creates the JSON object for the ... | 36.088235 | 113 | 0.699267 |
c54a277aecb97785c279624affa6e2be7a584733 | 7,711 | py | Python | src/Sephrasto/CharakterBeschreibungWrapper.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/CharakterBeschreibungWrapper.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/CharakterBeschreibungWrapper.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 10 17:11:39 2017
@author: Lennart
"""
from Wolke import Wolke
import UI.CharakterBeschreibung
from PyQt5 import QtWidgets, QtCore
import logging
from Hilfsmethoden import Hilfsmethoden
class BeschrWrapper(QtCore.QObject):
'''
Wrapper class for the Beschreibung GU... | 46.451807 | 236 | 0.655687 |
c54bac96bf394bf63243d61dad8ab67e41712d3c | 7,750 | py | Python | stashes/buildingdetectionunet.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | stashes/buildingdetectionunet.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | stashes/buildingdetectionunet.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # -*- coding: utf-8 -*-
"""BuildingDetectionUNet.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1WldjXVeLXAVlUUpb4-okaes1HOIB9HZz
"""
# Head here "https://www.kaggle.com/sayantandas30011998/zanzibar-openai-building-footprint-mapping?select=znz-s... | 29.245283 | 172 | 0.688129 |
3d96075ab59532ff321fbde09e4479631ee0953a | 26,666 | py | Python | repo/service.vpn.manager/libs/userdefined.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/libs/userdefined.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/libs/userdefined.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# 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... | 61.020595 | 317 | 0.512863 |
9adb04f61ed7aef9fb023d6a534fbfccc69e6779 | 951 | py | Python | Pythonjunior2020/Woche2/daten.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche2/daten.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche2/daten.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | # Die Bibliothek ist nur dem der HPI nachgemacht.
# Imports
from random import randint
# Aufgabe 2.1.1
alter = randint(1, 20)
# Aufgabe 2.1.2
namen = ["Alex", "Paul", "Otto", "Tim", "Theresa","Karl"]
name = namen[randint(0, len(namen)-1)]
# Aufgabe 2.1.3
max_anzahl = randint(1, 6)
belegt = randint(0, max_anzahl)
#... | 25.702703 | 67 | 0.67613 |
7702496c95fe5441001121c1cbe272cd0ecce53e | 2,445 | py | Python | test/test_npu/test_network_ops/test_confusion_transpose.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_confusion_transpose.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_confusion_transpose.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 42.894737 | 85 | 0.650716 |
6207e75c1c8f578101c9b35771d8319528eb1b21 | 4,811 | py | Python | Hackathons_19_20/Brainwaves 2019/Clustering Financial Articles/clustr.py | aviggithub/Hackathons_20 | a1bbc63cff3bd71982017749a0cc162d684e452b | [
"Apache-2.0"
] | null | null | null | Hackathons_19_20/Brainwaves 2019/Clustering Financial Articles/clustr.py | aviggithub/Hackathons_20 | a1bbc63cff3bd71982017749a0cc162d684e452b | [
"Apache-2.0"
] | null | null | null | Hackathons_19_20/Brainwaves 2019/Clustering Financial Articles/clustr.py | aviggithub/Hackathons_20 | a1bbc63cff3bd71982017749a0cc162d684e452b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 1 12:26:53 2019
@author: avi
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.metrics import adjusted... | 36.172932 | 162 | 0.705674 |
65e266ef8f174121fd9966b6b3d17967bad363bd | 974 | py | Python | Microsoft Partner Center/MSPC Retrieve Token/MSPC Retrieve Token.py | MithunKulkarniCTS/MithunKulkarniCTS | a9c264209d25495dea7ae919b8ad7080449f5db2 | [
"MIT"
] | 4 | 2019-12-07T03:27:41.000Z | 2021-03-11T02:30:40.000Z | Microsoft Partner Center/MSPC Retrieve Token/MSPC Retrieve Token.py | MithunKulkarniCTS/MithunKulkarniCTS | a9c264209d25495dea7ae919b8ad7080449f5db2 | [
"MIT"
] | 2 | 2021-08-17T03:06:52.000Z | 2021-09-17T13:18:19.000Z | Microsoft Partner Center/MSPC Retrieve Token/MSPC Retrieve Token.py | MithunKulkarniCTS/MithunKulkarniCTS | a9c264209d25495dea7ae919b8ad7080449f5db2 | [
"MIT"
] | 37 | 2019-08-19T19:41:16.000Z | 2022-02-03T08:43:59.000Z | import sys
import requests
import json
def execute(Resource,TenantID,ClientID,password,GrantType):
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
auth_body_data = {
'resource': Resource,
'grant_type': GrantType,
'client_secret': password,
'client_id': ClientID... | 30.4375 | 155 | 0.694045 |
02f58f64ddf3c3fb4be3e1e1f6f83c4ca8f2d5c7 | 771 | py | Python | CodeChef_problems/A Problem on Sticks/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 205 | 2021-09-30T15:41:05.000Z | 2022-03-27T18:34:56.000Z | CodeChef_problems/A Problem on Sticks/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 566 | 2021-09-30T15:27:27.000Z | 2021-10-16T21:21:02.000Z | CodeChef_problems/A Problem on Sticks/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 399 | 2021-09-29T05:40:46.000Z | 2022-03-27T18:34:58.000Z | t = int(input()) #Taking input of number of testcases
for i in range(t):
n = int(input()) #Taking Input of number of stick holders
li = list(map(int, input().split())) #Taking Input the Initial height of the stick in each stickholder
li.sort()
#If the number of sticks holder is 1 then we assign... | 48.1875 | 184 | 0.632944 |
02ffa0a22703511ead030b6cda4da1a9db74a78b | 19 | py | Python | RDS/circle3_central_services/token_storage/src/api/User/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/token_storage/src/api/User/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | gitapi_it/core/__init__.py | GitAPI-it/GitAPI.it-Python | c31fda491311ae1bc87af653282dc732729d441f | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from .User import * | 19 | 19 | 0.736842 |
b898666b55fd9a514b905e0bda3a86453fb97cc4 | 839 | py | Python | noc/e_1_8_motion_101_acceleration/walker.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | noc/e_1_8_motion_101_acceleration/walker.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | noc/e_1_8_motion_101_acceleration/walker.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Walker:
def __init__(self):
self.location = PVector(width/2, height/2)
self.velocity = PVector(0, 0)
self.acceleration = PVector(-0.001, 0.1)
self.topspeed = 10
self.d = 20
def update(self):
self.velocity.add(self.acceleration)
self.velocit... | 27.966667 | 56 | 0.544696 |
a2fed536235ac4dbb0f5d83ab8441c3a62717662 | 1,182 | py | Python | frappe-bench/apps/erpnext/erpnext/hr/doctype/employee/test_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/employee/test_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/employee/test_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe.utils
test_records = frappe.get_test_records('Employee')
class TestEmployee(unittest.TestCase):
def test... | 33.771429 | 108 | 0.773266 |
0c572449a02108a53ac04f5d6301ff548f1f2287 | 738 | py | Python | user/models.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | user/models.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | user/models.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
from utils import constants
class User(models.Model):
name = models.CharField('用户名', max_length=128, unique=True)
password = models.CharField('密码', max_length=256)
is_valid = models.BooleanField('是否有效', default=True)
created_time = mod... | 33.545455 | 103 | 0.684282 |
ac0b366ce5dce424910c2e18ac185964edd33d31 | 1,441 | py | Python | http/piface_http_beispiel.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | http/piface_http_beispiel.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | http/piface_http_beispiel.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Notwendige Bibliothek installieren:
# sudo apt install python3-flask
# oder
# pip3 install flask
from flask import Flask
from flask import request
# initialisiere Flask server
app = Flask(__name__)
# HTML-Formular
formular = """
<html>
<body>
<form... | 28.82 | 78 | 0.616239 |
02249919d7898ff1dc97190387633cba3983855e | 2,262 | py | Python | Packs/McAfee-MAR/Integrations/McAfee-MAR/McAfee-MAR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/McAfee-MAR/Integrations/McAfee-MAR/McAfee-MAR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/McAfee-MAR/Integrations/McAfee-MAR/McAfee-MAR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import importlib
import pytest
valid_private_key = """-----BEGIN PRIVATE KEY-----
This is a vaild Private Key
-----END PRIVATE KEY-----"""
valid_certificate = """-----BEGIN CERTIFICATE-----
This is a valid Certificate
-----END CERTIFICATE-----"""
invalid_private_key = r"\private\key\pat... | 34.8 | 74 | 0.680371 |
5a1e1bf511061be7240a534a4146c5ef52e2ddbc | 6,815 | py | Python | modelindex/utils.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 12 | 2021-02-26T08:19:00.000Z | 2022-01-26T14:00:16.000Z | modelindex/utils.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | null | null | null | modelindex/utils.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 3 | 2021-03-19T13:51:56.000Z | 2021-08-25T05:25:52.000Z | import os
from typing import List, Dict
import yaml
import json
import markdown
import glob
import re
from html.parser import HTMLParser
class CommentHTMLParser(HTMLParser):
def __init__(self):
super().__init__()
self.extracted_comments = []
def handle_comment(self, data):
self.extra... | 30.424107 | 104 | 0.55642 |
ceab1fa3559d308c4dda993b6d40ae3cd196edbb | 331 | py | Python | WifiEnigma/BattleAI/voice.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | WifiEnigma/BattleAI/voice.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | WifiEnigma/BattleAI/voice.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | import os
import time
def synthetize_voice(message):
print('Pico Text to Speech')
os.system('pico2wave -l fr-FR -w voice.wav "' + message + '" && aplay voice.wav')
time.sleep(1)
def delete_wav():
os.system('sudo rm -rf voice.wav')
if __name__ == '__main__':
message = "Test"
synthetize_voic... | 17.421053 | 86 | 0.649547 |
ced99977ef8bac53ba01ce2322ee5dee267eac9b | 2,826 | py | Python | 2_DeepLearning-Keras/05_Projekt_MNIST_mit_GUI/gui/dnn.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 2_DeepLearning-Keras/05_Projekt_MNIST_mit_GUI/gui/dnn.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 2_DeepLearning-Keras/05_Projekt_MNIST_mit_GUI/gui/dnn.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import *
from tensorflow.keras.activations import *
from tensorflow.keras.models import *
from tensorflow.keras.optimizers import *
from tensorflow.keras.initializers... | 29.747368 | 113 | 0.703822 |
0c89a43577f78d4b2a8a01102bf482346784700a | 296 | py | Python | exercises/fr/exc_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/exc_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/exc_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.fr import French
nlp = French()
doc = nlp("David Bowie a le label PER")
# Cherche le hash pour le label de chaine "PER"
person_hash = ____.____.____[____]
print(person_hash)
# Cherche person_hash pour obtenir la chaine
person_string = ____.____.____[____]
print(person_string)
| 22.769231 | 47 | 0.760135 |
0ca2db017dbba3ab9fac31d1efa7a6f8f7651d01 | 12,848 | py | Python | examples/text_summarization/prophetnet/generate.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_summarization/prophetnet/generate.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_summarization/prophetnet/generate.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import random
import time
from pprint import pprint
import numpy as np
import paddle
from paddle.io import BatchSampler, DataLoader
from rouge_score import rouge_scorer, scoring
from tqdm import tqdm
from paddlenlp.data import Pad, Tuple
from paddlenlp.datasets import load_dataset
from paddl... | 37.677419 | 111 | 0.566158 |
0ca38943c7c53033f81aa3947ceae33505e5541f | 2,157 | py | Python | Subrake-master/subrake/handlers/dnsdumpster.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Subrake-master/subrake/handlers/dnsdumpster.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Subrake-master/subrake/handlers/dnsdumpster.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import re
import threading
import requests
import hashlib
import urllib
class DNSDUMPSTER:
COOKIES = {'csrftoken' : ''}
DATA = {'csrfmiddlewaretoken' : '', 'targettip': ''}
SERVICE = "DNSDumpster"
LOCK = threading.Semaphore(value=1)
URL = "https://dnsdumpster.com"
REGEXP = "([a-z0-9]+[.])+%s"
TIMEOUT = 10
RES... | 27.653846 | 138 | 0.67733 |
e7f23734a43156545b58454a085bedeb9d72e801 | 5,315 | py | Python | sdk/beaker/mail.py | MailBeaker/mailbeaker-sdk | 324e48f9e255fd2dfa82d5f7f6bd52ab71e50904 | [
"MIT"
] | null | null | null | sdk/beaker/mail.py | MailBeaker/mailbeaker-sdk | 324e48f9e255fd2dfa82d5f7f6bd52ab71e50904 | [
"MIT"
] | null | null | null | sdk/beaker/mail.py | MailBeaker/mailbeaker-sdk | 324e48f9e255fd2dfa82d5f7f6bd52ab71e50904 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from sdk import sdk_settings
def send_rule_match_alert(alert_recipients, message_recipients, from_email, subject, rule_description):
msg = MIMEMultipart('alternative')
msg['From'] = "Mai... | 41.523438 | 272 | 0.610536 |
0bec0b66dca2dfe3ba23c6ff3de2542cc39ff762 | 13,632 | py | Python | BtmManager-Prototyp-py/Btm_temp.py | datend3nker/JuFo-BtM | a01e931ec4862c12e8a4861eed0661806ee2d19e | [
"BSD-Source-Code"
] | null | null | null | BtmManager-Prototyp-py/Btm_temp.py | datend3nker/JuFo-BtM | a01e931ec4862c12e8a4861eed0661806ee2d19e | [
"BSD-Source-Code"
] | null | null | null | BtmManager-Prototyp-py/Btm_temp.py | datend3nker/JuFo-BtM | a01e931ec4862c12e8a4861eed0661806ee2d19e | [
"BSD-Source-Code"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'BtM_temp.ui'
#
# Created by: PyQt5 UI code generator 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainW... | 57.518987 | 115 | 0.722638 |
0412e6055083b6e20cc30a2a8df8be61491b0d12 | 3,067 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/net/generator/grid.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/net/generator/grid.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/net/generator/grid.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2013-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 46.469697 | 110 | 0.605804 |
f096392d561b20893eee289ec1a5fa255ffd6281 | 214 | py | Python | Leetcode/ds/ListNode.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Leetcode/ds/ListNode.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Leetcode/ds/ListNode.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
def __repr__(self):
return "ListNode(val=" + str(self.val) + ", next={" + str(self.next) + "})" | 30.571429 | 83 | 0.556075 |
f0bd311bcabde13db6845ab6a0aa7aea3a0d0c52 | 522 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_10_Debugging/03_assertion_plausiblitaetspruefung.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_10_Debugging/03_assertion_plausiblitaetspruefung.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_10_Debugging/03_assertion_plausiblitaetspruefung.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 35_assertion_plausiblitaetspruefung.py
# Mit der Methode assertion kann man im Script hinterlegen welche Werte man für die Variablen
# an dieser Stelle vermutet. Erfüllt sich diese Vermutung nicht wird ein AssertionError ausgelöst
from random import randint as rng
from time import sleep
for i in range(10):
tr... | 34.8 | 97 | 0.716475 |
acc6e03ce51a7749d30123b810eb37c8eb6a1c67 | 650 | py | Python | IVTa/2014/BURMISTROV_V_D/task_6_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BURMISTROV_V_D/task_6_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BURMISTROV_V_D/task_6_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 23
# Создайте игру, в которой компьютер загадывает название одного из
# семи чудес света, а игрок должен его угадать.
# Burmistrov V. D.
# 31.03.2016
import random
wonder = ["Пирамида Хеопса", "Висячие сады Семирамиды", "Храм Артемиды в Эфесе", "Статуя Зевса в Олимпии", "Мавзолей в Галика... | 34.210526 | 177 | 0.681538 |
a86a3646f1f00add2626e02e6d496eae0b133912 | 1,036 | py | Python | wagtailextraicons/wagtail_hooks.py | octdanb/wagtailextraicons | 51a9bf500b6f417d48bb59fd4d2518abe11caa55 | [
"BSD-3-Clause"
] | 8 | 2019-12-23T09:14:21.000Z | 2022-03-06T22:13:24.000Z | wagtailextraicons/wagtail_hooks.py | octdanb/wagtailextraicons | 51a9bf500b6f417d48bb59fd4d2518abe11caa55 | [
"BSD-3-Clause"
] | 5 | 2019-12-19T00:24:00.000Z | 2022-03-15T21:58:13.000Z | wagtailextraicons/wagtail_hooks.py | octdanb/wagtailextraicons | 51a9bf500b6f417d48bb59fd4d2518abe11caa55 | [
"BSD-3-Clause"
] | 4 | 2020-05-15T10:30:18.000Z | 2022-03-22T05:50:49.000Z | from django.utils.html import format_html
from pkg_resources import parse_version
try:
from django.templatetags.static import static
except ImportError: # Fallback for Django <2.1
from django.contrib.staticfiles.templatetags.staticfiles import static
try:
from wagtail import __version__ as WAGTAIL_VERSIO... | 32.375 | 74 | 0.773166 |
a8704fafc445364e050a0d7cd9a2286fc2cf9c4f | 2,914 | py | Python | firmware/scripts/cw_fixedpoint.py | cwoodall/artemis-synth | a8e9496cf06a4afb002435746d07ca6c6ccdc49b | [
"CC-BY-3.0"
] | null | null | null | firmware/scripts/cw_fixedpoint.py | cwoodall/artemis-synth | a8e9496cf06a4afb002435746d07ca6c6ccdc49b | [
"CC-BY-3.0"
] | null | null | null | firmware/scripts/cw_fixedpoint.py | cwoodall/artemis-synth | a8e9496cf06a4afb002435746d07ca6c6ccdc49b | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/python
import math
# An implementation of Unsigned Fixed Point mathematics!
# Conversion from floating point to the desired fixed point parameters is very
# reliable, the math itself could be implemented better, but it works well.
# All errors seem to be rounding errors
class UFixedPoint(object):
# Prop... | 33.883721 | 92 | 0.555251 |
76a2d8fc00a76ce3d6791d08fb580b008ceb6349 | 8,642 | py | Python | DogeTheDart/DodgeTheDart.py | benbojarra/Dodge-The-Dart | 822e98f4dfd23ec508346f515e2720b88955e419 | [
"CC0-1.0"
] | null | null | null | DogeTheDart/DodgeTheDart.py | benbojarra/Dodge-The-Dart | 822e98f4dfd23ec508346f515e2720b88955e419 | [
"CC0-1.0"
] | null | null | null | DogeTheDart/DodgeTheDart.py | benbojarra/Dodge-The-Dart | 822e98f4dfd23ec508346f515e2720b88955e419 | [
"CC0-1.0"
] | null | null | null | import pygame
from pygame.version import PygameVersion
import os
from random import randint
class Settings():
window_width = 500
window_height = 750
window_border = 10
path_file = os.path.dirname(os.path.abspath(__file__))
path_image = os.path.join(path_file, "images")
fps = 60
... | 36.931624 | 118 | 0.566536 |
96f69214b648158560fa66769112a0a2dfa663e9 | 3,754 | py | Python | quant/config.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/config.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/config.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from decouple import config
markets = [
# "BitstampUSD",
# "BTCCCNY",
# "BtceUSD",
# "CoinbaseUSD",
# "GeminiUSD",
# "KrakenEUR",
# "KrakenUSD",
# "OKCoinCNY",
# "HuobiCNY",
# "Bittrex_BCH_BTC",
# "Bitfinex_BCH_USD",
# "Bitfinex_BCH_BTC",
# "Bitfinex_BTC_USD",
# "Kkex_BCC... | 19.350515 | 93 | 0.750133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.