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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6bbd7e3dd7a06bb6f317dd6f9232e74526ab2143 | 643 | py | Python | Python/Sonstige_Uebungen/bin2csv.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/bin2csv.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/bin2csv.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: bin2csv.py
# Project: Sonstige_Uebungen
#-----
# Created Date: Sunday 09.02.2020, 16:47
# Author: Apop85
#-----
# Last Modified: Sunday 09.02.2020, 16:48
#-----
# Copyright (c) 2020 Apop85
# This software is published under the MIT license.
# Check http://w... | 20.741935 | 71 | 0.660964 |
d41294b3de9552ec9d40ac447b3128a7e60d31dd | 2,100 | py | Python | src/model/fake_serial.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | null | null | null | src/model/fake_serial.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | 1 | 2021-05-24T19:25:35.000Z | 2021-05-24T19:25:35.000Z | src/model/fake_serial.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | null | null | null | # fake_serial.py
# D. Thiebaut
# A very crude simulator for PySerial assuming it
# is emulating an Arduino.
# a Serial class emulator
class Serial:
## init(): the constructor. Many of the arguments have default values
# and can be skipped when calling the constructor.
def __init__(self, port='COM1', bau... | 30 | 83 | 0.59 |
d45a835ea72e7be32995fbf4df7ef63cf61ee5b7 | 359 | py | Python | source/pkgsrc/inputmethod/fcitx5-mozc/patches/patch-build__tools_mozc__version.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/inputmethod/fcitx5-mozc/patches/patch-build__tools_mozc__version.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/inputmethod/fcitx5-mozc/patches/patch-build__tools_mozc__version.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-build__tools_mozc__version.py,v 1.1 2021/02/17 15:29:51 ryoon Exp $
* NetBSD support
--- build_tools/mozc_version.py.orig 2021-02-15 03:48:53.000000000 +0000
+++ build_tools/mozc_version.py
@@ -69,6 +69,7 @@ TARGET_PLATFORM_TO_DIGIT = {
'iOS': '6',
'iOS_sim': '6',
'Wasm': '7',
+ 'NetB... | 23.933333 | 82 | 0.640669 |
5cf16bf1d9bb25201e5ec4024363f1f2d648727a | 3,534 | py | Python | src/fonts/tools/code_points.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 14 | 2020-10-25T05:48:36.000Z | 2021-09-20T02:46:20.000Z | src/fonts/tools/code_points.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 1 | 2022-01-14T23:38:40.000Z | 2022-01-14T23:38:40.000Z | src/fonts/tools/code_points.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 4 | 2020-12-28T17:04:45.000Z | 2022-03-12T03:20:44.000Z | #!/usr/bin/env python3
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Get code point coverage for a font file.
The default output is in a compact format that expresses the ranges of code
points as a s... | 31.274336 | 80 | 0.637238 |
cf0080a52bbad06b58afb1f0f6842dc7f3742afc | 783 | py | Python | novel/crawler/rudaozhisheng/spiders/rudaozhisheng_spider.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/crawler/rudaozhisheng/spiders/rudaozhisheng_spider.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/crawler/rudaozhisheng/spiders/rudaozhisheng_spider.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # -*- coding: utf-8 -*-
import scrapy
from robot.novelcrawler.rudaozhisheng import RudaozhishengItem
class RudaozhishengSpider(scrapy.Spider):
name = "rudaozhisheng"
allowed_domains = ["biquge.tw"]
start_urls = [
"http://www.biquge.tw/0_52/"
]
def parse(self, response):
for href... | 29 | 73 | 0.633461 |
51c3228e9fc97107b36a9fe4900d54445d725ba0 | 529 | py | Python | extender/mem/impl/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | extender/mem/impl/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | extender/mem/impl/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | import os
from conans import ConanFile, CMake, MSBuild, tools
#conan install . -s arch=x86 -s build_type=Debug
class DarkstarHookConan(ConanFile):
settings = {"os": None, "compiler": None, "build_type": None, "arch": "x86"}
def build(self):
msbuild = MSBuild(self)
msbuild.build_env.lib_paths.... | 31.117647 | 80 | 0.655955 |
8e7c68f39b1fafed4299264447015ad69997161d | 5,421 | py | Python | scripts/update_review_relevance_index.py | pratikkumar-jain/Twitter-Mining | 228a852f38b8ff8b8c9b86f270d4b530840696f7 | [
"MIT"
] | 1 | 2020-10-04T13:46:21.000Z | 2020-10-04T13:46:21.000Z | scripts/update_review_relevance_index.py | pratikkumar-jain/Twitter-Mining | 228a852f38b8ff8b8c9b86f270d4b530840696f7 | [
"MIT"
] | null | null | null | scripts/update_review_relevance_index.py | pratikkumar-jain/Twitter-Mining | 228a852f38b8ff8b8c9b86f270d4b530840696f7 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
"""Script to update the review relevance index for all tweets."""
from cassandra.cluster import Cluster
from cassandra.query import BatchStatement
from textblob import TextBlob
from nltk.tokenize import RegexpTokenizer
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatize... | 31.33526 | 197 | 0.680871 |
d9364198c25d6795c029d356fe6d2d03e1402cca | 7,460 | py | Python | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/src/hashtable.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/src/hashtable.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/src/hashtable.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Hash tables :: Assignment
Linked List hash table key/value pair.
"""
class LinkedPair:
def __init__(self, key, value):
self.key = key
self.value = value
self.next = None
def __str__(self):
return f"<'{self.key}': '{self.value}' -> next: {self.next}>"
def __repr__(sel... | 36.213592 | 82 | 0.573861 |
d960770f87cbb724ea1dff425b1536e10e26d203 | 12,265 | py | Python | research/cv/arcface/infer/sdk/main_sdk_jpg.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/arcface/infer/sdk/main_sdk_jpg.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/arcface/infer/sdk/main_sdk_jpg.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # coding=utf-8
"""
Copyright (c) 2021. Huawei Technologies Co., Ltd. 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 requ... | 37.393293 | 118 | 0.619976 |
8de28edafaa7da501dfb921c915cde89787c40bd | 386 | py | Python | oled-arm/demo.py | lichtwellenreiter/dockerfiles | bad31b1dafffdf95cfc7a83c7f012ae80245b501 | [
"MIT"
] | null | null | null | oled-arm/demo.py | lichtwellenreiter/dockerfiles | bad31b1dafffdf95cfc7a83c7f012ae80245b501 | [
"MIT"
] | null | null | null | oled-arm/demo.py | lichtwellenreiter/dockerfiles | bad31b1dafffdf95cfc7a83c7f012ae80245b501 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306
serial = i2c(port=1, address=0x3C)
device = ssd1306(serial)
device.cleanup = lambda _: None
with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline="white", f... | 27.571429 | 70 | 0.738342 |
8dfa03684d5dc53769a6c28eacfc105b91c34260 | 360 | py | Python | Problems/Dynamic Programming/Easy/MaxSubArray/test_max_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Easy/MaxSubArray/test_max_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Easy/MaxSubArray/test_max_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from max_subarray import maxSubArray
class Test(TestCase):
def test_max_sub_array(self):
self.assertTrue(maxSubArray([1]) == 1)
self.assertTrue(maxSubArray([5, 4, -1, 7, 8]) == 23)
self.assertTrue(maxSubArray([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6)
self.... | 36 | 74 | 0.619444 |
5c1b35bee79d14ba6507d56a0d99caedf653cc01 | 4,943 | py | Python | myspiders/spider_hr/citicbank_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/spider_hr/citicbank_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/spider_hr/citicbank_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | from config import Target, Job
from myspiders.ruia import JsonField, HtmlField, AttrField, TextField, RegexField, Item, Spider, Bs4HtmlField, Bs4AttrField, Bs4TextField
branch_list = [
{'branchId': '703220', 'city': '南京'},
{'branchId': '703260', 'city': '合肥'},
{'branchId': '703400', 'city': '福州'},
{'b... | 34.326389 | 303 | 0.629375 |
30e4d8e52d295438b4458fb124e4488dafc65f1e | 538 | py | Python | finbyz_dashboard/finbyz_dashboard/dashboard_overrides/prepared_report.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 1 | 2021-11-19T05:27:11.000Z | 2021-11-19T05:27:11.000Z | finbyz_dashboard/finbyz_dashboard/dashboard_overrides/prepared_report.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | null | null | null | finbyz_dashboard/finbyz_dashboard/dashboard_overrides/prepared_report.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 2 | 2021-08-21T10:41:38.000Z | 2021-11-19T05:27:13.000Z | from __future__ import unicode_literals
import frappe, json
from frappe import _
@frappe.whitelist()
def get_reports_in_queued_state(report_name, filters):
reports = frappe.get_all('Prepared Report',
filters = {
'report_name': report_name,
'filters': json.dumps(json.loads(filters)),
'status': 'Queued'
})... | 26.9 | 79 | 0.762082 |
eb795fedb82592b4fa749e2fe126330ab40d2445 | 630 | py | Python | Contests/CCC/CCC '05 J1 - The Cell Sell.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '05 J1 - The Cell Sell.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '05 J1 - The Cell Sell.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | plan1 = 0
plan2 = 0
daytime = int(input())
even = int(input())
weekend = int(input())
if daytime > 100:
plan1 = (daytime - 100) * 0.25
if daytime > 250:
plan2 = (daytime - 250) * 0.25
if even > 0:
plan1 += even * 0.15
if even > 0:
plan2 += even * 0.35
if weekend > 0:
plan1 += weeke... | 19.090909 | 45 | 0.568254 |
ebbbf343be975075cc4d0a861858f427c2b5998f | 879 | py | Python | Problems/Depth-First Search/medium/ReorderRoutesMakeAllPathsCityZero/reorder_routes_make_all_paths_city_zero.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/ReorderRoutesMakeAllPathsCityZero/reorder_routes_make_all_paths_city_zero.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Depth-First Search/medium/ReorderRoutesMakeAllPathsCityZero/reorder_routes_make_all_paths_city_zero.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import List
# def minReorder(self, n: int, connections: List[List[int]]) -> int:
# d = defaultdict(dict)
# for a, b in connections:
# d[a][b] = 1
# d[b][a] = 0
#
# print(d)
# seen = set()
#
# def dfs(a):
# seen.add(a)
# ... | 22.538462 | 69 | 0.514221 |
ba98b9053c286ac4085e32d0878e668aa504c6d5 | 86 | py | Python | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.11-Printing-Pattern.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.11-Printing-Pattern.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.11-Printing-Pattern.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | for i in range(1, 5):
for _ in range(i):
print("#", end=" ")
print()
| 14.333333 | 27 | 0.44186 |
79e853f1861826578b7f0c8fb73865991907b992 | 432 | py | Python | exercises/en/test_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert "for ent in doc.ents" in __solution__, "Are you iterating over the entities?"
assert (
"print(ent.text, ent.label_)" in __solution__
), "Are you printing the text and the label?"
__msg__.good(
"Great work! So far, the model has been correct every single time. "
... | 36 | 88 | 0.638889 |
0301e7c52f1424bc751225f99423e88f9db7f53f | 23,421 | py | Python | 180419_qCat_SurfAtomExt.py | cwandtj/A2P2 | a5999f6dbcd7da194fbded8b8c113affdb419c3b | [
"MIT"
] | 1 | 2017-08-25T07:46:30.000Z | 2017-08-25T07:46:30.000Z | 180419_qCat_SurfAtomExt.py | cwandtj/A2P2 | a5999f6dbcd7da194fbded8b8c113affdb419c3b | [
"MIT"
] | null | null | null | 180419_qCat_SurfAtomExt.py | cwandtj/A2P2 | a5999f6dbcd7da194fbded8b8c113affdb419c3b | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import os
from sys import argv
import copy
import json
plot_angle = 0 # plot histogram of maxmimum angle between NN atom vectors.
class POSCAR:
theta = 90 # surface threshold in degree
ninfile = ''
lines = ''
line_list = []
com... | 38.207178 | 133 | 0.550489 |
236a28cc4fa52d3c7d4cc6f38ce5afeeeea28b34 | 2,143 | py | Python | partner_ngos/programs_management/doctype/indicator_tool/indicator_tool.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/programs_management/doctype/indicator_tool/indicator_tool.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/programs_management/doctype/indicator_tool/indicator_tool.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class IndicatorTool(Document):
def get_conditions(self):
conditions = ... | 33.484375 | 127 | 0.725152 |
88c613628969f64f9d4924c341444a9429b98620 | 1,643 | py | Python | src/cli.py | staugur/ssp | 1f5a0cec7369b078a09e9846d81881cc37dd2c3c | [
"BSD-3-Clause"
] | 1 | 2019-03-25T06:43:54.000Z | 2019-03-25T06:43:54.000Z | src/cli.py | saintic/ssp | 1f5a0cec7369b078a09e9846d81881cc37dd2c3c | [
"BSD-3-Clause"
] | null | null | null | src/cli.py | saintic/ssp | 1f5a0cec7369b078a09e9846d81881cc37dd2c3c | [
"BSD-3-Clause"
] | 1 | 2019-10-13T12:25:07.000Z | 2019-10-13T12:25:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ssp.cli
~~~~~~~~~~~~~~
Cli Entrance
:copyright: (c) 2019 by staugur.
:license: BSD 3-Clause, see LICENSE for more details.
"""
import click
from lib import run_add_system, run_check, run_remove_system
@click.group()
def cli():
pass
@cli.co... | 31 | 157 | 0.690201 |
aee97b59e9fceeddcf88bc25cd4ff795324ab933 | 1,913 | py | Python | myspiders/spider_hr/xacbank_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/spider_hr/xacbank_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/spider_hr/xacbank_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | from myspiders.ruia import JsonField, Item, Spider, Bs4HtmlField, Bs4AttrField, Bs4TextField
import json
from config import Target
from urllib.parse import quote, urljoin
import re
from bs4 import BeautifulSoup
import base64
class XacbankItem(Item):
url_detail = 'https://job.xacbank.com:8001'
target_item = Bs4... | 36.09434 | 111 | 0.679561 |
aefb64d6fc82a039a3fa1fc8d59caa0a7ccfac4b | 17,424 | py | Python | Classification/Live Kidney Classification/lib/DKC.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | 7 | 2020-03-06T05:53:43.000Z | 2022-01-30T17:31:18.000Z | Classification/Live Kidney Classification/lib/DKC.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | Classification/Live Kidney Classification/lib/DKC.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import f1_score
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from datetime import date
from time import time
import os
import seaborn as sns
import lib.transformers as trf
import pandas as pd
import matplot... | 40.901408 | 133 | 0.562098 |
d18620d88b00ca336d7d1133cc0992d90c4767b0 | 2,762 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/logger.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/logger.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/logger.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 33.277108 | 83 | 0.632151 |
d1d299c3b0dde2af54f2faad9f90dd91dd284aa9 | 977 | py | Python | Str0nger-master/sound.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Str0nger-master/sound.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Str0nger-master/sound.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 pyaudio
import wave
import time
def sound_go():
while True:
chunk = 1024
sample_format = pyaudio.paInt16
channels = 2
fs = 44100
seconds = 4
filename = "output.wav"
p = pyaudio.PyAudio()
stream = p.open(format=sample_form... | 25.051282 | 58 | 0.4913 |
ae990a6eb563b9549e18a946a10bead61d1c99aa | 3,525 | py | Python | smsBomber-main/bomber.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | smsBomber-main/bomber.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | smsBomber-main/bomber.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 os
import requests
import time # для контроля над временем при проверке файлов
import telebot
import subprocess
import random
bot = telebot.TeleBot("1801887812:AAFyBsFhelBEcLPc-55Gb5nD2pFwta3mwHs") #Тут должен быть токен (надеюсь знаете как его получить)
ID = '1035726612'
b = 0
u = ["Отправлено!", "Не... | 26.111111 | 129 | 0.567943 |
4e74485b13a4d40b20ab926fa422630ccc915071 | 762 | py | Python | extract_urls.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | extract_urls.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | extract_urls.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | import re
import os
_dir = './LNCS'
files = os.listdir(_dir)
fp_write = open('lncs_article_urls.txt', 'wb')
for _file in files:
with open(_dir + '/' + _file, 'r') as fp:
content = fp.read()
result_list = re.search('<ol id="results-list" (.*?)</ol>', content, re.S)
if result_list is None:... | 29.307692 | 83 | 0.492126 |
4eb772d23ed61f8db1adf3abc767df6d11ded57b | 3,206 | py | Python | lib/services/actions.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/services/actions.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/services/actions.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | # import msgpackrpc
from mprpc import RPCClient
class Call():
''' This class is used to communicate with the rust backend '''
client = None
@staticmethod
def connect():
if Call.client is None:
Call.client = RPCClient("127.0.0.1", port=6000, timeout=3000)
@classmethod
def ... | 26.716667 | 82 | 0.551466 |
11b76172a01fbf761c23a195042cf2597ca96bf8 | 3,401 | py | Python | Webpage/jollen/views.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/jollen/views.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/jollen/views.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | #from django.contrib.auth import authenticate
import csv
import io
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.paginator import Paginator
from django.http import HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django import template
f... | 28.822034 | 142 | 0.624816 |
e11f804c74ed9f5df8db79059d29ea31a7490b09 | 3,044 | py | Python | lang-python/csv_read_parse.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/csv_read_parse.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/csv_read_parse.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | import re
import csv
from collections import defaultdict
from csv import DictReader
###########################################################
## TEST
def print_sammler(filename):
with open(filename) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['errolename... | 29.269231 | 101 | 0.505256 |
6d70d609f9a290e01107ca6fc4fa232dc7d072bd | 416 | py | Python | pacman-arch/test/pacman/tests/sync131.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sync131.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sync131.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sysupgrade with a sync package replacing a set of local ones"
sp = pmpkg("pkg4")
sp.replaces = ["pkg1", "pkg2", "pkg3"]
self.addpkg2db("sync", sp)
lp1 = pmpkg("pkg1")
self.addpkg2db("local", lp1)
lp2 = pmpkg("pkg2")
self.addpkg2db("local", lp2)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")... | 21.894737 | 81 | 0.699519 |
6ddbaa9b5764832be37c64cc80c1907b4c89a920 | 2,398 | py | Python | research/cv/resnetv2/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/resnetv2/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/resnetv2/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.966667 | 105 | 0.691827 |
09873757fd76a26b74285d41521afd450afe83ab | 599 | py | Python | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/dist_from_sofia.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/dist_from_sofia.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/dist_from_sofia.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | distances_from_sofia = [
('Bansko', 97),
('Belgium - Brussels', 1701),
('Egypt - Alexandria', 1403),
('France - Nice', 1307),
('Hungary - Szeged', 469),
('Ireland - Dublin', 2479),
('Italy - Palermo', 987),
('Norway - Oslo', 2098),
('Russia - Moscow', 1779),
('Spain - Madrid', 22... | 26.043478 | 49 | 0.584307 |
09cb43e3053265b0c337e3e8dcc9fedb184f4b5c | 414 | py | Python | logm.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | logm.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | logm.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | import time
class LogManager:
def __init__(self):
self.file = open("log.txt", "a", encoding="utf-8")
def append(self, err_type: str, err_msg: str):
dt = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime())
result = "[{0}][{1}]: {2} \n".format(dt, err_type, err_msg.replace("\n... | 27.6 | 87 | 0.538647 |
09d0ffbc4a92ca91f2ed21cc5b47b871179a0d0f | 2,322 | py | Python | Objekte/texturen.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | Objekte/texturen.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | Objekte/texturen.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | # pylint: disable=wildcard-import, unused-wildcard-import, invalid-name, import-error, missing-docstring, too-few-public-methods, redefined-builtin
__author__ = 'floriandienesch'
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from PIL.Image import *
class Texturen(object):
"""
Cla... | 41.464286 | 148 | 0.660207 |
111af258263100f2cb3a7fb135b3dafb79523118 | 417 | py | Python | app/api/timetrack/resource.py | WagnerJM/timetracker | f5413aca5422b21d9fa094fbf9a96f9474487e35 | [
"MIT"
] | null | null | null | app/api/timetrack/resource.py | WagnerJM/timetracker | f5413aca5422b21d9fa094fbf9a96f9474487e35 | [
"MIT"
] | null | null | null | app/api/timetrack/resource.py | WagnerJM/timetracker | f5413aca5422b21d9fa094fbf9a96f9474487e35 | [
"MIT"
] | null | null | null | from flask import request
from flask_restful import Resource
from flask_jwt_extended import jwt_required
from datetime import datetime
from app.api.timetrack.models import WorkDay, WorkDaySchema
from app.database import db
class TimeListApi(Resource):
@jwt_required
def get(self):
pass
class TimeApi(R... | 20.85 | 59 | 0.729017 |
3ac04e66ab6b4535a5e9af3f17be3a49490a5078 | 1,401 | py | Python | exercises/pt/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert len(pattern1) == 2, "pattern1 deve conter dois tokens."
assert len(pattern2) == 2, "pattern2 deve conter dois tokens."
assert (
len(pattern1[0]) == 1
), "O primeiro token de pattern1 necessita de um atributo apenas."
assert any(
pattern1[0].get(l) == "iphone" for l... | 42.454545 | 88 | 0.626695 |
a35d6f7e86e6e4a8492aea75ebd461da9c35adbb | 2,366 | py | Python | src/python3_learn_video/list.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/list.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/list.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | # 列表:一个打了激素的数组——整数、浮点数、字符串、对象
"""
创建列表:
----创建一个普通列表
----创建一个混合列表
----创建一个空列表
"""
member = ['小甲鱼', '小布丁', '黑夜', '迷途', '怡静']
print(member)
print(id(member))
number = [1, 2, 3, 4, 5]
print(number)
mix = [1, '小甲鱼', 3.14, [1, 2, 3]]
print(mix)
empty = []
print(empty)
print('--------------------------------... | 16.205479 | 54 | 0.538884 |
6e8f6130ed46667c158e626b2428f543e094940b | 327 | py | Python | django/api/handlers.py | cyberjacob/Eventlr | a1474ab73d50b08d4bd21ec83830105b2632ecfa | [
"MIT"
] | null | null | null | django/api/handlers.py | cyberjacob/Eventlr | a1474ab73d50b08d4bd21ec83830105b2632ecfa | [
"MIT"
] | null | null | null | django/api/handlers.py | cyberjacob/Eventlr | a1474ab73d50b08d4bd21ec83830105b2632ecfa | [
"MIT"
] | null | null | null | from piston.handler import BaseHandler
from web.models import Event
class EventHandler(BaseHandler):
allowed_methods = ('GET',)
model = Event
def read(self, request, event_id=None):
base = Event.objects
if blogpost_id:
return base.get(pk=event_id)
else:
return base.... | 21.8 | 42 | 0.651376 |
6ea87e652a12e83d89d7c1c59f94debf25b3fc20 | 245 | py | Python | tests/model/test_pipeline.py | emptymalei/haferml | ba193ce1c022c89fb4e88924b7bb7a05b676929a | [
"MIT"
] | 11 | 2021-04-17T18:51:45.000Z | 2021-06-25T19:42:25.000Z | tests/model/test_pipeline.py | emptymalei/haferml | ba193ce1c022c89fb4e88924b7bb7a05b676929a | [
"MIT"
] | 3 | 2021-04-29T19:24:15.000Z | 2021-05-21T04:30:54.000Z | tests/model/test_pipeline.py | emptymalei/haferml | ba193ce1c022c89fb4e88924b7bb7a05b676929a | [
"MIT"
] | 2 | 2021-06-10T00:55:43.000Z | 2021-12-30T07:37:07.000Z | from nose import tools as _tools
from haferml.model.pipeline import *
conf = {
"artifacts": {
"model": {"local": "abc", "remote": ""},
"prediction": {"local": "abc", "remote": ""},
}
}
test_dsx = DataSetX(conf, "/tmp")
| 20.416667 | 53 | 0.555102 |
6e0ffa050aae8e7df7e056a57540dcde1daf2a01 | 788 | py | Python | Algorithms/2_Implementation/60.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/60.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/60.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/happy-ladybugs/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'happyLadybugs' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING b as parameter.
#
def happyLadybugs(b):
if(sum([1... | 21.297297 | 110 | 0.612944 |
95572023ce4f4984ae404d2ac5cee16452a605b7 | 1,927 | py | Python | Liter_Client/TPushButton.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/TPushButton.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/TPushButton.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QPushButton
from PyQt5.QtCore import Qt
from PyQt5.QtGui import (QImage, QBrush, QPainter, QColor)
from .TPath import RoundPath
class TPushButton(QPushButton):
'''
r 按钮圆角半径\n
img 按钮处于三种状态时图片\n
color 不选用 img 时三种状态下颜色\n
'''
def __init__(self, r=(0, 0, 0, 0), bid=0, ti... | 30.587302 | 140 | 0.596264 |
95cfec9c93bdf9d1c7e3427bd09b1e2af27fab6d | 9,465 | py | Python | tensorflow/basic-rl/tutorial5/tests/dqn-cartpole-rework.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial5/tests/dqn-cartpole-rework.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial5/tests/dqn-cartpole-rework.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | '''
Deep Q-learning approach to the cartpole problem
using OpenAI's gym environment.
As part of the basic series on reinforcement learning @
https://github.com/vmayoral/basic_reinforcement_learning
Inspired by https://github.com/VinF/deer
@author: Victor Mayoral Vilches <victor@erlerobotics.com>
'''
import ... | 40.105932 | 109 | 0.565346 |
95ea75ba9e6f49a1909491efa7b746ba23d856db | 1,639 | py | Python | codeit/oop/counter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/counter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/counter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class Counter:
"""
시계 클래스의 시,분,초를 각각 나타내는데 사용될 카운터 클래스
"""
def __init__(self, limit):
"""
인스턴스 변수 limit(최댓값), value(현재까지 카운트한 값)을 설정한다.
인스턴스를 생성할 때 인스턴스 변수 limit만 파라미터로 받고, value는 초깃값 0으로 설정한다.
"""
self.limit = limit
self._value = 0
@property... | 21.853333 | 65 | 0.52227 |
2529b5c86fddc1292cadecaff295d374e5322a1b | 504 | py | Python | Curso-Em-Video-Python/2Exercicios/060_fatorial_de_um_numero.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/060_fatorial_de_um_numero.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/060_fatorial_de_um_numero.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | fatorial = int(input('Digite um numero: '))
multiplicacao = 1
print('{}!= {}'.format(fatorial, fatorial), end="")
'''multiplicacao = 1
print('{}!= {}'.format(fatorial, fatorial), end="")
while fatorial != 1:
multiplicacao = multiplicacao * fatorial
fatorial = fatorial - 1
print('x{}'.format(fatorial), end="... | 36 | 51 | 0.623016 |
c2815eea5e0f1a9c9d97b76c6ed6e54d008bfe01 | 410 | py | Python | UMass/2021/crypto/malware/malware.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 9 | 2021-04-20T15:28:36.000Z | 2022-03-08T19:53:48.000Z | UMass/2021/crypto/malware/malware.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | UMass/2021/crypto/malware/malware.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 6 | 2021-06-24T03:25:21.000Z | 2022-02-20T21:44:52.000Z | from Crypto.Cipher import AES
from Crypto.Util import Counter
import binascii
import os
key = os.urandom(16)
iv = int(binascii.hexlify(os.urandom(16)), 16)
for file_name in os.listdir():
data = open(file_name, 'rb').read()
cipher = AES.new(key, AES.MODE_CTR, counter = Counter.new(128, initial_value=iv))
... | 24.117647 | 85 | 0.67561 |
dd416d08115106b92867928c69f023579118d41e | 1,648 | py | Python | PMIa/2015/NIKISHIN_P_S/task_8_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/NIKISHIN_P_S/task_8_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/NIKISHIN_P_S/task_8_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 8. Вариант 22.
# 1-50. Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки, отгадавши... | 28.912281 | 362 | 0.658374 |
06d68aa2761ef8299ac715a272f1a8a3841a0aca | 4,198 | py | Python | contest_server/pjkiserver/util.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/util.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/util.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import string
import random
import json
id_len = 16
token_len = 42
# Generate a random string of letters (uppercase + lowercase + digits)
# Not cryptographically random, but good enough
def randomString(n):
return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(n))
# Function to generate ... | 27.801325 | 86 | 0.707956 |
9fd62ba1fac16dbc0d8f5dcac37714df81f8ea8a | 331 | py | Python | src/fizzBuzz.py | ianxin/algorithm | 22214b6c81bee926f5a1c74c9417b2e7edd3ceed | [
"MIT"
] | 2 | 2018-03-13T08:59:14.000Z | 2018-03-13T08:59:25.000Z | src/fizzBuzz.py | ianxin/Algorithm | 22214b6c81bee926f5a1c74c9417b2e7edd3ceed | [
"MIT"
] | null | null | null | src/fizzBuzz.py | ianxin/Algorithm | 22214b6c81bee926f5a1c74c9417b2e7edd3ceed | [
"MIT"
] | null | null | null | def fizzBuzz(n):
# write your code here
a=[]
for i in range(1,n+1):
if i%3==0 and i%5==0:
a.append('fizz buzz')
elif i%3==0:
a.append('fizz')
elif i%5==0:
a.append('buzz')
else: a.append(str(i))
... | 25.461538 | 37 | 0.386707 |
b014cf9f7e11d4b54ffc3c6c739b0eca39a70bba | 130 | py | Python | EC3/jb.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | EC3/jb.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | EC3/jb.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | import jieba
string = open('paper','r',encoding='UTF-8').read()
result = jieba.lcut(string)
print(len(result), '/'.join(result))
| 21.666667 | 50 | 0.676923 |
b0323690f5ea84663b44d5c0cd2120f9c49aa300 | 47 | py | Python | aemter/__init__.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/aemter/__init__.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/aemter/__init__.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | default_app_config = 'aemter.apps.AemterConfig' | 47 | 47 | 0.851064 |
05a659d275978ff3036fa4b1590a13de5bbcb205 | 4,052 | py | Python | scripts/network.py | largelymfs/DeepFold | 9f723539e67d00230646cdb3b1ba706b46cee39b | [
"MIT"
] | 17 | 2017-05-15T07:44:18.000Z | 2021-12-23T02:06:12.000Z | scripts/network.py | afcarl/DeepFold | 9f723539e67d00230646cdb3b1ba706b46cee39b | [
"MIT"
] | null | null | null | scripts/network.py | afcarl/DeepFold | 9f723539e67d00230646cdb3b1ba706b46cee39b | [
"MIT"
] | 8 | 2017-08-10T15:40:00.000Z | 2021-09-29T19:40:34.000Z | #! /usr/bin/env python
#################################################################################
# File Name : network.py
# Created By : yang
# Creation Date : [2017-01-26 21:54]
# Last Modified : [2017-01-26 22:37]
# Description : ... | 50.024691 | 120 | 0.608342 |
05bca1b1538da1058d137804b380bfc1adb291a3 | 2,812 | py | Python | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/rendering_multiseries_StackedColumn2dline_using_json_example.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 30 | 2018-04-01T09:08:40.000Z | 2022-01-23T07:30:07.000Z | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/rendering_multiseries_StackedColumn2dline_using_json_example.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 14 | 2018-07-17T08:33:35.000Z | 2021-09-29T17:26:15.000Z | asset/integrations/django/samples/fusioncharts/samples/rendering_multiseries_StackedColumn2dline_using_json_example.py | Piusshungu/catherine-junior-school | 5356f4ff5a5c8383849d32e22a60d638c35b1a48 | [
"MIT"
] | 17 | 2016-05-19T13:16:34.000Z | 2021-04-30T14:38:42.000Z | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file that contains functions to embed the charts.
from ..fusioncharts import FusionCharts
# The `chart` function is defined to load data from a Python Dictionary. This data will be converted to
# JSON and the char... | 27.568627 | 118 | 0.395092 |
05eb5d46130735ede4ae9d478ed893fbf1353310 | 1,925 | py | Python | spider/get_Religion_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/get_Religion_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/get_Religion_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# '开放域'Religion事件查询列表获取,并存入数据库
# 查询列表构成{日期+地点+宗教名称+宗教触发词}
import pymongo
from pymongo import InsertOne
from pymongo.errors import BulkWriteError
import random
from pprint import pprint
from tqdm import tqdm
client = pymongo.MongoClient('54.161.160.206:27017') # 与服务器上的MongoDB数据库建立连... | 39.285714 | 137 | 0.645195 |
af6f166c527e6f9529eb5af9d6d5f2b347536fbb | 12,337 | py | Python | dash/migrations/0008_enveloppe.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/migrations/0008_enveloppe.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/migrations/0008_enveloppe.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-31 10:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('dash', '0007_dossier_mon... | 73.874251 | 118 | 0.585799 |
5912c3a694385a3fcb86a41e6792140893ed9a87 | 363 | py | Python | Python/Exercícios_Python/005_antecessor_e_sucessor.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/005_antecessor_e_sucessor.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/005_antecessor_e_sucessor.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""005 - Antecessor e Sucessor
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1wCss86IpAl3ri6KmESV_COg0wC7LHH7P
"""
x = int(input('Digite um número: '))
ant = x - 1
suc = x + 1
print('O antecessor de {} é {}'.format(x, ant))
pr... | 25.928571 | 77 | 0.674931 |
591fea62075419335400c4d8f57f6f3388f47a74 | 113 | py | Python | python/python_backup/PRAC_PYTHON/ab13.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab13.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab13.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #array declair
from array import*
a=array('i',[1,2,3,4,5])
print a
for i in a:
print(i)
| 10.272727 | 25 | 0.513274 |
3ca5816b172c311ce1aadc2a80cdb16bb2eb31e3 | 843 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/58_sets_conjuntos/sets_conjuntos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/58_sets_conjuntos/sets_conjuntos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/58_sets_conjuntos/sets_conjuntos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | # add(adiciona), update(atualiza), clear, discard
# Union | (une)
# interection & (todos os elementos presentes nos dois sets)
# differense - (elementos apenas no set da esquerda)
# symmetric_difference ^ (elementos que estão nos dois sets, mas não em ambos)
# Não adicona elementos duplicados
"""
s1 = {1 ,2, 3, 4, 5}
... | 22.184211 | 78 | 0.587189 |
59c08a17b64a5c83eb9c0e14d2e5b73d3f40319f | 531 | py | Python | nz_django/day2/db_demo2_curd/book/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/db_demo2_curd/book/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day2/db_demo2_curd/book/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
# Create your models here.
class Book(models.Model):
name = models.CharField(max_length=100,null=False,unique=True)
author = models.CharField(max_length=100,null=False)
price = models.FloatField(default=0,null=False)
pub_time = models.DateTimeField(auto_now_add=True)
d... | 37.928571 | 115 | 0.691149 |
ab8d8301e8ede8c2ec5253ec1b33af5741d0fac7 | 6,641 | py | Python | toolsparty-master/information-gathering/owt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | toolsparty-master/information-gathering/owt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | toolsparty-master/information-gathering/owt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python
# coding:utf-8
# Build By LandGrey
#
import re
import os
import ssl
import sys
import socket
import requests
import argparse
import HTMLParser
from requests.adapters import HTTPAdapter
from multiprocessing.dummy import Pool as ThreadPool
try:
requests.packages.urllib3.disable_warnings()
... | 33.205 | 133 | 0.585906 |
dda45271807ab1e8fcac4ab9ed43e9b392c70f2f | 656 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/constants.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/constants.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/constants.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 28.521739 | 147 | 0.809451 |
ddf5d2957e7913974f076d668e07e42616b31544 | 1,131 | py | Python | jobScanner/jobIntake.py | gordodev/Automation | 254ddce367f1369b7e4355f7d42af21090493aa1 | [
"Apache-2.0"
] | 2 | 2020-07-21T04:59:42.000Z | 2020-12-15T16:42:00.000Z | jobScanner/jobIntake.py | gordodev/Automation | 254ddce367f1369b7e4355f7d42af21090493aa1 | [
"Apache-2.0"
] | null | null | null | jobScanner/jobIntake.py | gordodev/Automation | 254ddce367f1369b7e4355f7d42af21090493aa1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#Take details of contacts
import csv
#Functions
#---------------
def readRecords():
print ('Here are your records')
global existingRecords
with open('jobsRecords.dat', newline='') as f:
reader = csv.reader(f)
existingRecords = list(reader)
def addRecord():
newReco... | 19.169492 | 56 | 0.546419 |
fb0e015a2df59bdfc8165c463949dd7c8e01a761 | 2,005 | py | Python | Keith/osm_merge1.py | FabianV1984/TheMostDangerousSwissRoad | e5ffdb6fae39c60d8b5d6247e9d2839f8103df98 | [
"MIT"
] | null | null | null | Keith/osm_merge1.py | FabianV1984/TheMostDangerousSwissRoad | e5ffdb6fae39c60d8b5d6247e9d2839f8103df98 | [
"MIT"
] | null | null | null | Keith/osm_merge1.py | FabianV1984/TheMostDangerousSwissRoad | e5ffdb6fae39c60d8b5d6247e9d2839f8103df98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import geopandas as gpd
from shapely.geometry import Point, LineString, Polygon
import networkx as nx
import osmnx as ox
from pyproj import Transformer
import folium
import numpy as np
# In[2]:
# get accident data
df_acc = pd.read_csv("RoadTraffi... | 11.656977 | 147 | 0.66384 |
9ba51c2e0e283e0f499bc7f57c36bcc408a790de | 1,544 | py | Python | research/cv/UNet3+/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/UNet3+/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/UNet3+/postprocess.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... | 34.311111 | 89 | 0.659326 |
2f452a5f4926c7a13fa9f0fde1dc01b71c53ece5 | 361 | py | Python | web/templatetags/web_filters.py | Daniel-Hoerauf/cs3240-f16-team11 | 0377bcb8ede9599c04daf7683b065abb2a47f893 | [
"MIT"
] | null | null | null | web/templatetags/web_filters.py | Daniel-Hoerauf/cs3240-f16-team11 | 0377bcb8ede9599c04daf7683b065abb2a47f893 | [
"MIT"
] | null | null | null | web/templatetags/web_filters.py | Daniel-Hoerauf/cs3240-f16-team11 | 0377bcb8ede9599c04daf7683b065abb2a47f893 | [
"MIT"
] | null | null | null | from django.views.decorators.http import require_http_methods
from django.contrib.auth.decorators import login_required
from django import template
register = template.Library()
@require_http_methods(['GET'])
@login_required
@register.filter(name="is_site_manager")
def is_site_manager(request):
return request.gro... | 32.818182 | 63 | 0.817175 |
2f8e4abc4652df42e7d8e6696bcb6390ec4ca065 | 5,696 | py | Python | pommeUI.py | YannThorimbert/Pomme | 1eb606b283769e5668449f895418037977625146 | [
"MIT"
] | null | null | null | pommeUI.py | YannThorimbert/Pomme | 1eb606b283769e5668449f895418037977625146 | [
"MIT"
] | null | null | null | pommeUI.py | YannThorimbert/Pomme | 1eb606b283769e5668449f895418037977625146 | [
"MIT"
] | null | null | null | import thorpy, pygame
import pomme
W_CARTE, H_CARTE = 100, 40
COULEUR_CARTE = 200,200,200
CARTE_FONT_SIZE = 20
couleur2texte = {"c":"<3", "p":">>", "l":"<>", "t":"*", "u":"?"}
couleur2couleur = {"c":(255,0,0), "l":(255,0,0), "p":(0,0,0), "t":(0,0,0), "u":(0,0,0)}
val2txt = {11:"J", 12:"Q", 13:"K", 14:"A", "-1":"?"}
d... | 32.735632 | 110 | 0.599017 |
8d194061e8ff0c0378262192e15a9176c97f53ca | 7,627 | py | Python | src/onegov/feriennet/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import random
from cached_property import cached_property
from onegov.activity import Period, PeriodCollection, InvoiceCollection
from onegov.activity.models.invoice_reference import Schema
from onegov.core import utils
from onegov.core.orm import orm_cached
from onegov.feriennet.const import DEFAULT_DONATION_AMOUNTS
... | 29 | 79 | 0.666973 |
f58f02962cdee857977024573fba38dccaf286da | 2,270 | py | Python | angstrom/2018/misc/slots/slots.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2018/misc/slots/slots.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2018/misc/slots/slots.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | # coding: utf8
import random
import signal
import SocketServer
flag = open('flag.txt').read()
PORT = 3002
FRUITS = ['🍌', '🍒', '🍐', '🍈', '🍇', '🍊', '🍉']
COMBOS = {
'🍌3': 1,
'🍒2': 1,
'🍐2': 3,
'🍈2': 3,
'🍇2': 3,
'🍊2': 3,
'🍉2': 3,
'🍒3': 3,
'🍐3': 10,
'🍈3': 10,
'🍇3': 10,
'🍊3': 10,
'🍉3': 10... | 20.636364 | 96 | 0.597357 |
27119dd0e6b84a3d48fa645d765123a339f0943c | 270 | py | Python | backend/app/models/course_members.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/models/course_members.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/models/course_members.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from sqlalchemy import Column, Integer, ForeignKey
from app.db.base_class import Base
class CourseMembers(Base):
course_id = Column(Integer, ForeignKey("course.id"), primary_key=True)
user_id = Column(Integer, ForeignKey("user.id"), primary_key=True)
| 30 | 75 | 0.740741 |
fd8bc5c1269e79328815274d2214640054952c91 | 5,527 | py | Python | _Dist/NeuralNetworks/b_TraditionalML/SVM.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/b_TraditionalML/SVM.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/b_TraditionalML/SVM.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../../../")
if root_path not in sys.path:
sys.path.append(root_path)
import numpy as np
import tensorflow as tf
from _Dist.NeuralNetworks.DistBase import Base, AutoBase, AutoMeta, DistMixin, DistMeta
class LinearSVM(Base):
def __init__(self, *args, **kwargs... | 40.343066 | 114 | 0.652072 |
fd92bea45825a0985fc28689598e46ee4ebd12fa | 877 | py | Python | example/intro/my_config.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | example/intro/my_config.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | example/intro/my_config.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | # my_config.py
import os
from typing import List
from pydantic import BaseModel
# define the schemas for the first and second worker nodes.
class InputMessage(BaseModel):
my_values: List[float]
class OutputMessage(BaseModel):
the_max: float
# define the configurations for the two queues, one in Kafka and... | 25.057143 | 119 | 0.618016 |
fddde8a3b5a48b6c6b89974723771993baf380a1 | 471 | py | Python | zencad/examples/1.GeomPrim/1.prim3d/torus.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/1.GeomPrim/1.prim3d/torus.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/1.GeomPrim/1.prim3d/torus.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: torus
"""
from zencad import *
tor_r1 = 5
tor_r2 = 2
tor_u = deg(135)
tor_v1 = deg(-90)
tor_v2 = deg(180)
m0 = torus(r1=tor_r1, r2=tor_r2)
m1 = torus(r1=tor_r1, r2=tor_r2, yaw=tor_u)
m2 = torus(r1=tor_r1, r2=tor_r2, pitch=(tor_v1, tor_v2))
m3 = torus(r1=tor_r1, r2=tor_r... | 18.84 | 67 | 0.66879 |
9a1f01ef69568884242ed039e11facb895b18570 | 158 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_5_Set/80. union of sets.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_5_Set/80. union of sets.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_5_Set/80. union of sets.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python program to find the union of two sets.
set1 = {1,2,3,4,5}
set2 = {4,5,6,7,8}
"""
def set_union(set1,set2):
return (set1 | set2)
| 14.363636 | 53 | 0.594937 |
9a6bd4319c0f62fa44f786a247147734eb969f00 | 4,962 | py | Python | respiratory/Processed Datasets/Processed Datasets/matrix.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 2 | 2020-06-08T19:17:10.000Z | 2020-06-08T20:45:07.000Z | respiratory/Processed Datasets/Processed Datasets/matrix.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 14 | 2015-10-07T09:31:50.000Z | 2022-02-23T07:34:10.000Z | respiratory/Processed Datasets/Processed Datasets/matrix.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | null | null | null | Test1 = [1,2,3,4,5,6,7,8]
Test = []
for i in range(0,len(Test1)):
Test.append([0,0,0,0,0,0,0,0])
for j in range(0,len(Test1)):
Test[i][j] += j/11.0+16/9.0 + i*22/19.6
y = [[4,5,6,7,2,3,4,5]]
# returns n by m matrix of zeros
def zeros(n,m):
output = []
for i in range(0,n):
output.append([])
for j in range(0,... | 23.855769 | 83 | 0.655179 |
d07e78dbd26956554b7071334cc4ae5054a5e629 | 1,320 | py | Python | _build/tags.py | kylebebak/kylebebak.github.io | 052cf14904d9991d5e035e6b8300c0231d839988 | [
"MIT"
] | 1 | 2017-11-26T21:56:11.000Z | 2017-11-26T21:56:11.000Z | _build/tags.py | kylebebak/kylebebak.github.io | 052cf14904d9991d5e035e6b8300c0231d839988 | [
"MIT"
] | null | null | null | _build/tags.py | kylebebak/kylebebak.github.io | 052cf14904d9991d5e035e6b8300c0231d839988 | [
"MIT"
] | 2 | 2016-07-11T16:05:40.000Z | 2020-04-16T01:51:44.000Z | import random
import click
import build
@click.command()
@click.option('--posts_dir', default='.', help='Path to posts directory')
@click.option('--tags_dir', default='.', help='Path to output tags directory')
@click.option('--tags_file', default='.', help='Output tags file')
def tags(posts_dir, tags_dir, tags_file):
... | 33 | 81 | 0.60303 |
ef070d1fdcae86fba1ce5e9b465fbc0b496e35e7 | 2,810 | py | Python | energielenker/energielenker/item/item.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | null | null | null | energielenker/energielenker/item/item.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | null | null | null | energielenker/energielenker/item/item.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | 1 | 2021-08-14T22:22:57.000Z | 2021-08-14T22:22:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore and contributors
# For license information, please see license.txt
import frappe
from frappe.desk.reportview import get_match_cond, get_filters_cond
from frappe.utils import nowdate
from collections import defaultdict
def item_query(doctype, txt, searchfield, st... | 42.575758 | 107 | 0.579715 |
3283b13aa1542d5421840a9b09781235f511d597 | 2,898 | py | Python | assignments/ps4-template/Set_AVL_Tree.py | tallamjr/mit-6006 | c2aa6bb48edef5800c0779ba2eebd697d44249b5 | [
"MIT"
] | 1 | 2022-02-26T13:52:31.000Z | 2022-02-26T13:52:31.000Z | assignments/ps4-template/Set_AVL_Tree.py | tallamjr/mit-6006 | c2aa6bb48edef5800c0779ba2eebd697d44249b5 | [
"MIT"
] | null | null | null | assignments/ps4-template/Set_AVL_Tree.py | tallamjr/mit-6006 | c2aa6bb48edef5800c0779ba2eebd697d44249b5 | [
"MIT"
] | null | null | null | from AVL_Tree import AVL_Node, AVL_Tree
class BST_Node(AVL_Node):
def subtree_find(A, k): # O(log n)
if k < A.item.key:
if A.left: return A.left.subtree_find(k)
elif k > A.item.key:
if A.right: return A.right.subtree_find(k)
else: return ... | 33.310345 | 61 | 0.5 |
f5c82282a44fa1423fef4adbc6e4e5f551173641 | 937 | py | Python | application/form.py | mariobp-NHH/Flask_Dashboard | 7c423078ee37037264031515cb98598a0b2e8d9b | [
"MIT"
] | null | null | null | application/form.py | mariobp-NHH/Flask_Dashboard | 7c423078ee37037264031515cb98598a0b2e8d9b | [
"MIT"
] | null | null | null | application/form.py | mariobp-NHH/Flask_Dashboard | 7c423078ee37037264031515cb98598a0b2e8d9b | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, SelectField, SubmitField, IntegerField
from wtforms.validators import DataRequired
class UserDataForm(FlaskForm):
type = SelectField('Type', validators=[DataRequired()],
choices=[('income', 'income'),
... | 55.117647 | 74 | 0.452508 |
eb255d094b8682e682ebfbedfa9d4a5781156ec8 | 2,698 | py | Python | exam_notes/exam_notes/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | exam_notes/exam_notes/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | exam_notes/exam_notes/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from exam_notes.web.forms import CreateProfileForm, CreateNoteForm, EditNoteForm, DeleteNoteForm
from exam_notes.web.helpers import get_profile, get_notes
from exam_notes.web.models import Note
def show_home(request):
profile = get_profile()
notes = get_notes()
... | 22.483333 | 96 | 0.600445 |
a0da81091ed3453f66c0119b3f004743071605cd | 154 | py | Python | diehard/Retention.py | esycat/diehard | 01baf115b050ab9239764f1742720d88c6083476 | [
"Apache-2.0"
] | 1 | 2018-05-02T21:25:20.000Z | 2018-05-02T21:25:20.000Z | diehard/Retention.py | esycat/diehard | 01baf115b050ab9239764f1742720d88c6083476 | [
"Apache-2.0"
] | null | null | null | diehard/Retention.py | esycat/diehard | 01baf115b050ab9239764f1742720d88c6083476 | [
"Apache-2.0"
] | null | null | null | from enum import Enum, unique
@unique
class Retention(Enum):
YEARLY = 'yearly'
MONTHLY = 'monthly'
WEEKLY = 'weekly'
DAILY = 'daily'
| 17.111111 | 29 | 0.623377 |
c2181c2971be291d0a0368f67f54390efebdbcc4 | 999 | py | Python | Crashkurs TensorFlow/02_tfconstant.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | 2 | 2020-03-23T14:57:50.000Z | 2021-03-24T18:12:07.000Z | Crashkurs TensorFlow/02_tfconstant.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs TensorFlow/02_tfconstant.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | # Unterdrückt die AVX2 Warnung
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
# number = float(input("Gib eine Zahl ein: "))
#
# number_tf = tf.constant(number)
#
# result = tf.pow(number_tf, 3.) # number**3
# print("{0}^3 = {1}".format(number, result))
#
# print(result)
# print(result.numpy... | 21.255319 | 65 | 0.55956 |
a0472d47317946437a7af497588cdedf4e4f8323 | 6,770 | py | Python | src/onegov/gazette/views/organizations.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/organizations.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/organizations.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import datetime
from io import BytesIO
from morepath import redirect
from morepath.request import Response
from onegov.core.security import Private
from onegov.gazette import _
from onegov.gazette import GazetteApp
from onegov.gazette.collections import OrganizationCollection
from onegov.gazette.forms imp... | 26.653543 | 78 | 0.624225 |
262eb0ebed605de809723261775d59c8bb8801c5 | 4,687 | py | Python | PIController.py | p4squ4lle/PI-Controller-Communication | fb18a7837ab1135ef5ae51b84d3b7a54bc24b42d | [
"MIT"
] | null | null | null | PIController.py | p4squ4lle/PI-Controller-Communication | fb18a7837ab1135ef5ae51b84d3b7a54bc24b42d | [
"MIT"
] | null | null | null | PIController.py | p4squ4lle/PI-Controller-Communication | fb18a7837ab1135ef5ae51b84d3b7a54bc24b42d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import serial
import subprocess
import logging
from datetime import datetime
from pipython import GCSDevice, pitools
from time import sleep
# Set-Up logging
dt = datetime.now()
dt_string = dt.strftime("%H-%M_%d%m%Y")
logging.basicConfig(level=logging.INFO,
form... | 35.778626 | 94 | 0.576275 |
5fa5a908def4f40888ab25c811710ef52aa4933b | 2,301 | py | Python | nz_django/day5/class_view_demo_01/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day5/class_view_demo_01/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day5/class_view_demo_01/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.shortcuts import render
from .models import Article
from django.http import HttpResponse
from django.views.generic import ListView
def add_article(request):
articles = []
for x in range(0,108):
article = Article(title='标题:%s'%x,content='内容:%s'%x)
articles.append(article)
Article.... | 34.343284 | 83 | 0.661017 |
39a1422db6afefd41b32dbe50750e50f997a8704 | 7,466 | py | Python | Pwn2Win/2021/misc/wspr_decoy/sendmsg.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Pwn2Win/2021/misc/wspr_decoy/sendmsg.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Pwn2Win/2021/misc/wspr_decoy/sendmsg.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from modulator import modulator
from hashlib import sha3_224
from datetime import datetime
import re
import time
import string
class WSPR:
""" https://github.com/brainwagon/genwspr """
syncv = [1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0,
1, 0, 1, 1, 1, 1,... | 29.164063 | 89 | 0.500402 |
081db5def530fe08d797f70f6623e780030fd4ee | 2,571 | py | Python | tests/onegov/reservation/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/reservation/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/reservation/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from datetime import date, datetime
from onegov.reservation import ResourceCollection
def test_resource_collection(libres_context):
collection = ResourceCollection(libres_context)
assert collection.query().count() == 0
resource = collection.add('Executive Lounge', 'Europe/Zurich')
ass... | 31.740741 | 73 | 0.730844 |
4b92ef6f577b98e3aedf145654461fd63f15d0bc | 674 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch04_strings/solutions/ex02_join.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch04_strings/solutions/ex02_join.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch04_strings/solutions/ex02_join.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from functools import reduce
def join(values, delimiter):
result = ""
for i, current_value in enumerate(values):
result += current_value
# no delimiter after last
if i < len(values) - 1:
... | 19.823529 | 69 | 0.620178 |
8a13af63752a348977f823fa26b86293893b3a68 | 1,274 | py | Python | features/startscreen.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | 1 | 2019-04-27T07:28:52.000Z | 2019-04-27T07:28:52.000Z | features/startscreen.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | features/startscreen.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | import time
from block import TetrisBlock
from features.feature import Feature
from field import Field
from painter import Led_Matrix_Painter, RGB_Field_Painter
class Startscreen(Feature):
def __init__(self, field_leds: Field, field_matrix: Field, rgb_field_painter: RGB_Field_Painter,
led_matrix... | 32.666667 | 106 | 0.705651 |
8a5e9fc5fe7caacb95e5ff71eb53189f88ee2b9b | 5,326 | py | Python | analysis/CaffeA.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | null | null | null | analysis/CaffeA.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | null | null | null | analysis/CaffeA.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from collections import OrderedDict
from .layers import *
from .roi import *
def profiling(net, input=None):
# input is either a Blob with the shape of (batch,h,w,c) or a dict of them
layers=[]
if isinstance(input,dict):
blob_dict = OrderedDict(input)
... | 48.862385 | 120 | 0.527976 |
8a625c4abbd992c0263bafeca47dc6c348652bce | 603 | py | Python | mergesort.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | 2 | 2017-12-22T20:03:30.000Z | 2017-12-24T20:55:38.000Z | mergesort.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | null | null | null | mergesort.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | null | null | null | def merge_sort(A):
if len(A) <= 1:
return A
middle = int(len(A)/2)
left = merge_sort(A[:middle])
right = merge_sort(A[middle:])
return merge(left, right)
def merge(left, right):
result = []
while len(left) > 0 and len(right) > 0:
if left[0] <= right[0]:
result.ap... | 24.12 | 49 | 0.524046 |
8abdfe82edbfab4b346469de0466fdacfc463c9b | 160 | py | Python | exercises/ja/solution_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/solution_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/solution_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # 英語の言語クラスをインポート
from spacy.lang.en import English
# nlpオブジェクトを作成
nlp = English()
# テキストを処理
doc = nlp("This is a sentence.")
# docのテキストをプリント
print(doc.text)
| 13.333333 | 33 | 0.73125 |
6ab97f4eaef1974e60554f8c7776d5c70bc8daf2 | 231 | py | Python | Python/UberX.py | NSpooky/CursoPOO | 4ca19221b1a596e43a8557140f1a640e12be2ae4 | [
"MIT"
] | null | null | null | Python/UberX.py | NSpooky/CursoPOO | 4ca19221b1a596e43a8557140f1a640e12be2ae4 | [
"MIT"
] | null | null | null | Python/UberX.py | NSpooky/CursoPOO | 4ca19221b1a596e43a8557140f1a640e12be2ae4 | [
"MIT"
] | null | null | null | from car import Car
class UberX(Car):
brand = str
model = str
def __init__(self, license, driver, brand, model):
super().__init__(license, driver)
self.brand = brand
self.model = model | 23.1 | 55 | 0.593074 |
0af91a106b69465aab16921f9844944c5fac01e7 | 16,814 | py | Python | Packs/FeedElasticsearch/Integrations/FeedElasticsearch/FeedElasticsearch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedElasticsearch/Integrations/FeedElasticsearch/FeedElasticsearch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedElasticsearch/Integrations/FeedElasticsearch/FeedElasticsearch.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 *
'''IMPORTS'''
from elasticsearch import Elasticsearch, RequestsHttpConnection
from elasticsearch_dsl import Search
from elasticsearch_dsl.query import QueryString
import requests
import warnings
# Disable insecure warn... | 43.335052 | 120 | 0.664684 |
86c3a218efdc813df195055c025b212e20c9db61 | 655 | py | Python | Python-Fundamentals/bonus_scoring_system.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | Python-Fundamentals/bonus_scoring_system.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | Python-Fundamentals/bonus_scoring_system.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | import math
students_count = int(input())
lectures_count = int(input())
initial_bonus = int(input())
highest_bonus = 0
best_student_attendances = 0
for x in range(students_count):
attendances_of_each_student = int(input())
total_bonus = attendances_of_each_student / lectures_count * (5 + initial_bonus)
... | 29.772727 | 94 | 0.758779 |
ed0bb180c150171902d3f87aa85c87cb1228356c | 5,378 | py | Python | official/nlp/lstm/src/imdb.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/lstm/src/imdb.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/lstm/src/imdb.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.922078 | 99 | 0.607661 |
ed10cbb604a8f7bf58f1248d7ad2f1a2f3582aca | 8,574 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/rundeck_acl_policy.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/rundeck_acl_policy.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/rundeck_acl_policy.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Loic Blot <loic.blot@unix-experience.fr>
# Sponsored by Infopro Digital. http://www.infopro-digital.com/
# Sponsored by E.T.A.I. http://www.etai.fr/
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import... | 37.116883 | 118 | 0.577327 |
ed1bbf368fa9517057fa3fda238d001875a65f71 | 4,249 | py | Python | deprecated/examples/dam/config.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/examples/dam/config.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/examples/dam/config.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2020 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 app... | 29.506944 | 74 | 0.585785 |
9c4b1b3f9974cc33286d5498e376be24665431a6 | 12,909 | py | Python | fea/FeatureExtractionAlgorithms.py | weidler/tyrex | 76a3d2c36405b1213f230a7a414c2741237933f8 | [
"MIT"
] | 1 | 2015-12-08T15:11:15.000Z | 2015-12-08T15:11:15.000Z | fea/FeatureExtractionAlgorithms.py | weidler/tyrex | 76a3d2c36405b1213f230a7a414c2741237933f8 | [
"MIT"
] | null | null | null | fea/FeatureExtractionAlgorithms.py | weidler/tyrex | 76a3d2c36405b1213f230a7a414c2741237933f8 | [
"MIT"
] | null | null | null | import sys
import json
import re
import pprint
import treetaggerwrapper as tt
from pathlib import Path
from collections import Counter
#from tyrex_lib import checkFileExistance
# -*- coding: utf-8 -*-
class FEA():
"""
Feature Extraction Algorithms Wrapper Class. Takes a file or text and calculates Vector for that ... | 30.735714 | 133 | 0.697885 |
b96e4c96cde8a250592215a14d982c000284c29f | 17,876 | py | Python | keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import pycparser
import re
class KeymapBeautifier:
justify_toward_center = False
filename_in = None
filename_out = None
output_layout = None
output = None
column_max_widths = {}
KEY_ALIASES = {
"KC_TRANSPARENT": "_______",
"KC_TRNS": ... | 44.69 | 217 | 0.520474 |
b9bfcea192108d4e99d8493ac60a307f2ef4bdb7 | 231 | py | Python | lib/python3.5/site-packages/numpy/version.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/numpy/version.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/numpy/version.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null |
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
short_version = '1.10.2'
version = '1.10.2'
full_version = '1.10.2'
git_revision = '5667fbafb5d84e3a412a07aac72c769baa590579'
release = True
if not release:
version = full_version
| 21 | 57 | 0.748918 |
169cbdfdc8b5037e0317fc60463fcb732a816a38 | 291 | py | Python | src/bo4e/enum/titel.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/titel.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/titel.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Titel(StrEnum):
"""
Übersicht möglicher Titel, z.B. eines Geschäftspartners.
"""
DR = "DR" #: Doktor*In
PROF = "PROF" #: Professor*In
PROF_DR = "PROF_DR" #: Professor*In Dr.
| 20.785714 | 60 | 0.649485 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.