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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df8424f222409c2cd454068f3ca5a2c343650c81 | 2,113 | py | Python | _scripts/make_committees_data.py | GCCR/GCCR.github.io | 9400e64ee1eb618bfaeaf7a1c927a04165db191b | [
"MIT"
] | 5 | 2020-03-27T20:01:18.000Z | 2021-06-06T12:41:20.000Z | _scripts/make_committees_data.py | GCCR/GCCR.github.io | 9400e64ee1eb618bfaeaf7a1c927a04165db191b | [
"MIT"
] | 39 | 2020-04-01T23:55:10.000Z | 2022-02-26T07:09:57.000Z | _scripts/make_committees_data.py | GCCR/GCCR.github.io | 9400e64ee1eb618bfaeaf7a1c927a04165db191b | [
"MIT"
] | 3 | 2020-03-29T16:06:02.000Z | 2020-04-07T19:23:37.000Z | import os
import re
import logging
import pandas as pd
from googleapiclient.discovery import build
import yaml
logging.getLogger('googleapiclient.discovery_cache').setLevel(logging.ERROR)
# load personal websites
with open("_data/websites.yml", "r") as f:
WEBSITES = yaml.load(f, Loader=yaml.BaseLoader)
def membe... | 32.015152 | 76 | 0.648367 |
10f1f7311325ff8b922534481812f358ca7b3651 | 235 | py | Python | PMIa/2015/ANDROS_D_A/task_5_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/ANDROS_D_A/task_5_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/ANDROS_D_A/task_5_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5.Вариант 2.
# Напишите программу, которая бы при запуске случайным образом отображала имя одного из трех поросят.
# Andros D.A.
# 14.04.2016
import random
pigs=["Naf-Naf","Nuf-Nuf","Nif-Nif"]
p=random.choice(pigs)
print(p)
| 23.5 | 101 | 0.731915 |
d51752bb875ccca282f100672e2eed6891f048dd | 789 | py | Python | docs_src/path_operation_advanced_configuration/tutorial007.py | jomue/fastapi | bee35f5ae1fc58e7ab125427ad4287210e99d8b3 | [
"MIT"
] | 53,007 | 2018-12-08T10:05:29.000Z | 2022-03-31T23:30:02.000Z | docs_src/path_operation_advanced_configuration/tutorial007.py | jomue/fastapi | bee35f5ae1fc58e7ab125427ad4287210e99d8b3 | [
"MIT"
] | 4,155 | 2019-01-05T05:07:49.000Z | 2022-03-31T21:25:38.000Z | docs_src/path_operation_advanced_configuration/tutorial007.py | jomue/fastapi | bee35f5ae1fc58e7ab125427ad4287210e99d8b3 | [
"MIT"
] | 4,092 | 2018-12-09T16:21:00.000Z | 2022-03-31T07:59:45.000Z | from typing import List
import yaml
from fastapi import FastAPI, HTTPException, Request
from pydantic import BaseModel, ValidationError
app = FastAPI()
class Item(BaseModel):
name: str
tags: List[str]
@app.post(
"/items/",
openapi_extra={
"requestBody": {
"content": {"applicati... | 22.542857 | 73 | 0.640051 |
7f57f6c832b3711e423cec6abd7c42e0c01e4580 | 1,381 | py | Python | api/db/redis_mq.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/db/redis_mq.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/db/redis_mq.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | 1 | 2022-02-11T04:44:37.000Z | 2022-02-11T04:44:37.000Z | # !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/7/1 下午4:19
# @Author : Latent
# @Email : latentsky@gmail.com
# @File : kafka.py
# @Software: PyCharm
# @class : 用于redis 的消息队列 -->生产消费者
import redis
class RedisMQ(object):
def __init__(self):
self.redis_mq = redis.Redis(host='127.0.0.1', port='6... | 23.016667 | 112 | 0.553222 |
1005d30b155932917243afde01f34bbe03c128da | 4,098 | py | Python | rbac/common/user/update_user.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | rbac/common/user/update_user.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | rbac/common/user/update_user.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 35.947368 | 88 | 0.667887 |
63f527bd2724ad07a375271eb260d585a44d04a7 | 274 | py | Python | src/onegov/org/views/person_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/person_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/person_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Private
from onegov.org import OrgApp
from onegov.org.models import PersonMove
@OrgApp.view(model=PersonMove, permission=Private, request_method='PUT')
def move_page(self, request):
request.assert_valid_csrf_token()
self.execute()
| 27.4 | 72 | 0.79562 |
122aa105608851f3a59daba6ab2867902a33dc5f | 522 | py | Python | python/unittest/test_invalid_input.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/test_invalid_input.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/test_invalid_input.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import unittest
class TestInvalidInput(unittest.TestCase):
# using a with block is the best way to assert errors
def test_string_function_failure(self):
with self.assertRaises(AttributeError):
x = None.lower()
# you can specify regex to handle the specific error message
def test_s... | 32.625 | 64 | 0.666667 |
d6206fd0e0680db8bae941c703e12c1c897b855d | 636 | py | Python | scripts/open_cv/open_cv_sw02_get_pixel_values.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/open_cv/open_cv_sw02_get_pixel_values.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/open_cv/open_cv_sw02_get_pixel_values.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
# ################################################################################
# edited WHS, OJ , 7.1.2022 #
import cv2
print(cv2.__version__)
# lese Bild von Festplatte
image = cv2.imread('/home/oj/catkin_ws/src/rtc/scripts/open_cv/test.png')
# lese Farbwerte an Position y, x
y = 100
x = ... | 21.931034 | 82 | 0.589623 |
d651de92c847d2506ab9d8514a8400ce98355ac1 | 822 | py | Python | tests/test_buendelvertrag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_buendelvertrag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_buendelvertrag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import pytest # type:ignore[import]
from bo4e.bo.buendelvertrag import Buendelvertrag, BuendelvertragSchema
from tests.serialization_helper import assert_serialization_roundtrip # type:ignore[import]
from tests.test_vertrag import TestVertrag # type:ignore[import]
class TestBuendelvertrag:
@pytest.mark.parame... | 35.73913 | 96 | 0.739659 |
c3d851a1dcc8577412b9a527562c32560864696c | 4,776 | py | Python | official/cv/ADNet/src/utils/augmentations.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/utils/augmentations.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/utils/augmentations.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... | 36.181818 | 109 | 0.613903 |
614e00aae487cf3d744eee81d1a5bc45e1919e33 | 2,526 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... | 35.083333 | 92 | 0.682898 |
619dfdc9cb9592291fd419e39bf5a2162c03dc62 | 457 | py | Python | Packs/CommonScripts/Scripts/IsListExist/IsListExist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/IsListExist/IsListExist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/IsListExist/IsListExist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
list_name = demisto.args()['listName']
res = demisto.executeCommand("getList", {"listName": list_name})
res = res[0]
if res['Type'] == entryTypes['error'] and "Item not found" in res['Contents']:
... | 26.882353 | 82 | 0.63895 |
9c8c791e6d197a6296f7914ad78462a1e5f0326b | 10,145 | py | Python | Packs/Campaign/Scripts/SetPhishingCampaignDetails/test_data/campaign_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/SetPhishingCampaignDetails/test_data/campaign_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/SetPhishingCampaignDetails/test_data/campaign_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | CAMPAIGN_INCIDENT_CONTEXT = {
"EmailCampaign": {
"firstIncidentDate": "2021-11-21T14:00:07.425185+00:00",
"incidents": [
{
"emailfrom": "examplesupport@example2.com",
"emailfromdomain": "example.com",
"id": "1",
"name": "Ver... | 33.592715 | 102 | 0.407097 |
9cb14aa80590cf8030edff4c353c93a4cee816cd | 4,539 | py | Python | src/onegov/org/views/imagesets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/imagesets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/imagesets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
from onegov.core.security import Public, Private
from onegov.file import File
from onegov.org import _, OrgApp
from onegov.org.elements import Link
from onegov.org.forms import ImageSetForm
from onegov.org.layout import ImageSetLayout, ImageSetCollectionLayout
from onegov.org.models import (
ImageF... | 28.910828 | 77 | 0.667548 |
9cd7843ba6ddf96feac2b4041d2fbfea8c209aad | 417 | py | Python | doc/examples/using_jit_diff_types.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/using_jit_diff_types.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/using_jit_diff_types.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic import jit, Type
T = Type(int, float)
@jit()
def func(a: T, b: T):
return a * b
if __name__ == "__main__":
from time import sleep
a_i = b_i = 1
a_f = b_f = 1.0
for _ in range(10):
print(_, end=",", flush=True)
func(a_i, b_i)
sleep(1)
print()
f... | 14.37931 | 37 | 0.508393 |
9ce7112e3604b827cf80c10d2509ef0d153fd9a1 | 3,778 | py | Python | extract_q.py | hoehermann/YDKJ4JS | 077013baf4299767954370482361cba952d0c16a | [
"MIT"
] | 2 | 2021-10-02T00:16:17.000Z | 2022-02-17T17:27:47.000Z | extract_q.py | hoehermann/YDKJ4JS | 077013baf4299767954370482361cba952d0c16a | [
"MIT"
] | null | null | null | extract_q.py | hoehermann/YDKJ4JS | 077013baf4299767954370482361cba952d0c16a | [
"MIT"
] | null | null | null | import sys
import re
import subprocess
import json
import os
import argparse
sid_re = re.compile('exports ([0-9]+) as "([^"]+)"')
smap_re = re.compile('Push String:"(S[^"]+)".*String:"(A[^"]+)"')
actionstring_re = re.compile('Push String:"_(?P<key>.+)" String:"(?P<value>.+)"')
def extract_assets(dat_filename, outpath)... | 42.449438 | 120 | 0.597935 |
1470b74d57070c459c579edd8ffa56d8aac38b93 | 5,655 | py | Python | deprecated/benchmark/ps/semantic_matching/nets.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/semantic_matching/nets.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/semantic_matching/nets.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2019 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... | 36.019108 | 93 | 0.663484 |
0d24e4d636a87ef845937fbdeee17cf92953a7ef | 6,403 | py | Python | 20-fs-ias-lec/groups/03-subChat/Prototyp/UI.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/03-subChat/Prototyp/UI.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/03-subChat/Prototyp/UI.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from tkinter import *
import datetime
import threading
import feed
import pcap
import string
import crypto
import event
import os
global username
class Chat(Frame):
def save(self, contend):
feed._appendIt(self.username, 'append', contend)
def add(self, username, contend, event=None):
self.t... | 39.524691 | 127 | 0.577386 |
b4ed1f9c08b3d97636868474b48c6b33ed05f66c | 560 | py | Python | main.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | main.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | main.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | #!/bin/env python
"""Start the bot."""
from ilswbot.ilswbot import updater
from ilswbot.config import config
if config['webhook']['enabled']:
updater.start_webhook(
listen='127.0.0.1',
port=config['webhook']['port'],
url_path=config['webhook']['token'],
)
domain = config['webhook'... | 26.666667 | 83 | 0.610714 |
2ee3ec79f4dde5dcaa341328384d0337c62fc38c | 1,234 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex08_power_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex08_power_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex08_power_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch03_recursion.solutions.ex08_power_of import is_power_of_2, power_of_iterative, power_of, power_of_optimized
@pytest.mark.parametrize("value, expected",
[(2, True), (3, False), (4, Tru... | 32.473684 | 114 | 0.659643 |
25ec149731928cd321f749e90b9c1f238cd4bac0 | 10,121 | py | Python | task_1/data_investigation/lda_topic_modeling.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | 1 | 2022-02-28T22:02:50.000Z | 2022-02-28T22:02:50.000Z | task_1/data_investigation/lda_topic_modeling.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | task_1/data_investigation/lda_topic_modeling.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | # %% Do LDA Topic Modeling
# Imports
from sklearn.decomposition import LatentDirichletAllocation as LDA
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import GridSearchCV
import pandas as pd
# %% Import Cleaned Documents
events = ['2020_Nov_Post', '2020_Nov', '2020_Nov_Pre', '... | 40.003953 | 463 | 0.668511 |
6cc07d4c91b8fd742b2edffeeecfd06f62dc0153 | 5,934 | py | Python | src/data_science/data_science/in_out/channels.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/in_out/channels.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/in_out/channels.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | from data_science.tools.threading_utilities import ThreadableClass
import data_science.tools.transformations as transf
from data_science.tools.classes import InstanceTraceable
from data_science.simulation.parameter import Parameter
class ChannelTypes():
"""Communication channel types."""
UNDEFINED = "undefin... | 34.300578 | 76 | 0.551904 |
9f730f4878c14150dfaac600c74ccb7f12c56d91 | 3,342 | py | Python | frappe-bench/apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, getdate
from frappe import _
from erpnext.stock.utils import get_valid_serial_nos
from erpnext.utilities... | 34.8125 | 105 | 0.744165 |
4ccdb1b95f5cdab0bdabb6bcee0e214064200f13 | 355 | py | Python | src/bo4e/enum/verbrauchsart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/verbrauchsart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/verbrauchsart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Verbrauchsart(StrEnum):
"""
Verbrauchsart einer Marktlokation.
"""
KL = "KL" #: Kraft/Licht
KLW = "KLW" #: Kraft/Licht/Wärme
KLWS = "KLWS" #: Kraft/Licht/Wärme/Speicherheizung
W = "W" #: Wärme
W... | 22.1875 | 55 | 0.639437 |
4cd24913c08e2cd1841af830403a1453a9f81a09 | 13,454 | py | Python | blockschaltbilder/tests/bsb_test.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 11 | 2016-08-19T18:11:19.000Z | 2020-07-27T07:04:52.000Z | blockschaltbilder/tests/bsb_test.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 8 | 2016-09-17T16:46:01.000Z | 2021-04-29T19:59:57.000Z | blockschaltbilder/tests/bsb_test.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 4 | 2016-09-21T18:45:09.000Z | 2020-07-27T07:08:17.000Z | """Test suit for the Blockschaltbild boilerplate generator."""
import unittest
from ..bsb import Blockschaltbild, BlockschaltbildCoordinate, Block
class TestBlock(unittest.TestCase):
def test_no_pars(self):
"""Test if a block is initialised correctly if no parameters are specified."""
x, y = 3.1... | 38.884393 | 90 | 0.535677 |
2cc78f46fcdda1bdaff840ecea0d19722cb2edab | 6,122 | py | Python | research/cv/wgan/src/cell.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/wgan/src/cell.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/wgan/src/cell.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.80117 | 114 | 0.63721 |
390b912d0628075627beb3e29bdb15a6c98e1460 | 923 | py | Python | .venv/Lib/site-packages/dexpy/tests/test_simplex_centroid.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/tests/test_simplex_centroid.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/tests/test_simplex_centroid.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | from unittest import TestCase
from dexpy.simplex_centroid import build_simplex_centroid
from dexpy.eval import det_xtxi
from dexpy.model import make_quadratic_model
import numpy as np
import patsy
class TestSimplexCentroid(TestCase):
@classmethod
def test_d_optimality(cls):
answer_d = [ 2.513455e3, 2.... | 35.5 | 73 | 0.595883 |
1ab4c7276d63c31305a0f58b3a30b10ad230ab33 | 725 | py | Python | Contests/CCC/CCC '06 S3 - Tin Can Telephone.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '06 S3 - Tin Can Telephone.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '06 S3 - Tin Can Telephone.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | # I have no idea if this is actually functioning.
def line_intersection(l1, l2):
xdiff = (l1[0][0] - l1[1][0], l2[0][0] - l2[1][0])
ydiff = (l1[0][1] - l1[1][1], l2[0][1] - l2[1][1])
def det(a, b):
return a[0] * b[1] - a[1] * b[0]
div = det(xdiff, ydiff)
if div == 0:
return False
... | 24.166667 | 128 | 0.489655 |
46e6e58e94f0e3a25d6fe545a26c83e5f8f5192a | 9,535 | py | Python | comp/pecoco/src/entry2json.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/pecoco/src/entry2json.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/pecoco/src/entry2json.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | """
This module is used to parse entries of personal information and write them as the formatted & valid JSON into an output file. Please check details of requirments from 'rolodex_instructions.pdf' in the root directory of this project.
"""
import json
import re
from collections import OrderedDict
ele_names = ['colo... | 29.611801 | 233 | 0.56581 |
03b1bdb95fcdfb32ef5d8620d14e914fa5b8814f | 13,470 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_fpga.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_fpga.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_fpga.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... | 45.201342 | 113 | 0.518486 |
208337278275bee9002af264c40fa5bf3f08d11d | 498 | py | Python | 2-resources/_PYTHON/code-examples-master/elasticsearch/python/es_index_document.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/elasticsearch/python/es_index_document.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/elasticsearch/python/es_index_document.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | from elasticsearch import Elasticsearch
es = Elasticsearch(
hosts = [{'host': 'es-domain.es.amazonaws.com', 'port': 443}],
use_ssl=True, verify_certs=True
)
document = {"name": "ruan", "surname": "bekker"}
response = es.index(index='my-index', doc_type='_doc', body=document)
# response
# {'_index': 'my-ind... | 35.571429 | 197 | 0.650602 |
b35829957542c4d9b959727d95d83e5c13e2f5b0 | 3,344 | py | Python | large_vocab_adt_dafx2018/features.py | mcartwright/dafx2018_adt | 057ac6b1e39cd0c80554d52535cc9d88b6316c74 | [
"BSD-2-Clause"
] | 6 | 2019-02-28T05:43:58.000Z | 2021-03-02T17:05:13.000Z | large_vocab_adt_dafx2018/features.py | mcartwright/dafx2018_adt | 057ac6b1e39cd0c80554d52535cc9d88b6316c74 | [
"BSD-2-Clause"
] | null | null | null | large_vocab_adt_dafx2018/features.py | mcartwright/dafx2018_adt | 057ac6b1e39cd0c80554d52535cc9d88b6316c74 | [
"BSD-2-Clause"
] | 1 | 2020-02-07T17:10:40.000Z | 2020-02-07T17:10:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
import librosa
import scipy.signal
import numpy as np
from .utils import read_audio
FRAME_INTERVAL = 0.01 # s
def cq_matrix(bins_per_octave, num_bins, f_min, fft_len, sr):
"""
Compute center frequencies of the log-spaced filter... | 31.54717 | 110 | 0.58134 |
2fc751a07689597eb520fe0eb4337776e6ff00df | 16 | py | Python | python/coursera_python/MICHIGAN/DataStructures/test/range.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/DataStructures/test/range.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/DataStructures/test/range.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | print(range(4))
| 8 | 15 | 0.6875 |
443364b93cce01dcca1b820f92bf7a1836a52bac | 318 | py | Python | python/en/archive/dropbox/miscellaneous_python_files/test.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/test.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/test.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 17 19:39:45 2019
@author: aimldl
"""
import numpy as np
print( np.random.choice(5, 3, replace=False ) )
a = ['pooh', 'rabbit', 'piglet', 'Christopher']
print( np.random.choice(a, 3, replace=False ) )
print( np.random.choice(8, 32, replace=False ) )
| 18.705882 | 49 | 0.603774 |
448f63f63da035112046dadf9a070bc75195cdd7 | 1,247 | py | Python | transonic/backends/test_cython.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/backends/test_cython.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/backends/test_cython.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from transonic import Array, const
from transonic.backends import backends
backend = backends["cython"]
type_formatter = backend.type_formatter
def compare(result, dtype, ndim, memview, mem_layout=None, positive_indices=None):
A = Array[dtype, ndim, memview, mem_layout, positive_indices]
... | 29 | 82 | 0.639936 |
928c78b0fe1b26f67912ffec8a40ea763b8c7622 | 2,173 | py | Python | jumeaux/addons/log2reqs/plain.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/log2reqs/plain.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/log2reqs/plain.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
import urllib.parse as urlparser
from typing import Dict, List
from owlmixin import OwlMixin, TOption
from owlmixin.owlcollections import TList
from jumeaux.addons.log2reqs import Log2ReqsExecutor
from jumeaux.logger import Logger
from jumeaux.models import Request, Log2ReqsAddOnPayload
logge... | 31.955882 | 88 | 0.591809 |
47289bd6c744dd7fccc3402945aabbba4a9bbc35 | 22,462 | py | Python | examples/test/generated/oss.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2015-10-26T10:38:32.000Z | 2015-10-26T10:38:32.000Z | examples/test/generated/oss.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | examples/test/generated/oss.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | from mongoengine import *
classes=[]
class oss_comment(Document):
comment = StringField(required=True)
time = IntField(required=True,help_text='epoch')
author = IntField(required=True,help_text=' who created comment')
author_name = StringField(required=True,help_text=' who created comment')
id = In... | 54.125301 | 190 | 0.747885 |
caebb177a6d5c87f8b09e0507f76b02ac300af12 | 185 | py | Python | init/CreateParam.py | Berni1557/MDDoc | 06dd3cae302e6f125ebfbb2fc513bb754d72f07d | [
"BSD-3-Clause"
] | null | null | null | init/CreateParam.py | Berni1557/MDDoc | 06dd3cae302e6f125ebfbb2fc513bb754d72f07d | [
"BSD-3-Clause"
] | null | null | null | init/CreateParam.py | Berni1557/MDDoc | 06dd3cae302e6f125ebfbb2fc513bb754d72f07d | [
"BSD-3-Clause"
] | null | null | null | # Import Param
import Param
xmlpath = 'H:/cloud/cloud_data/Projects/MDDoc/init/init.xml'
Param.param.init(xmlpath)
Param.param.create()
Param.param.write()
Param.param.printParams()
| 16.818182 | 60 | 0.767568 |
848f7764f06e631c725d13876bb49955114770d1 | 3,754 | py | Python | Extensions/Event-Handler.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | Extensions/Event-Handler.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | Extensions/Event-Handler.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | # Import
from discord.ext import commands
import discord
import asyncio
# Utils
import Utils
# Cog Initialising
class EventHandler(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_member_remove(self, user: discord.Member):
try:
... | 37.54 | 178 | 0.654502 |
ca8fd2ab0085b7b39f3bc5c5b751494c30581f73 | 617 | py | Python | setup.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | setup.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | setup.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | #!/usr/bin/env python
from distutils.core import setup
setup(name='Topology learning',
version='1.0',
description='Machine learning experiments for geospatial vector geometries',
author='Rein van \'t Veer',
author_email='rein.van.t.veer@geodan.nl',
url='https://github.com/reinvantveer/To... | 26.826087 | 82 | 0.581848 |
781951c110e1da5ffe988f55cbf188d9b7002060 | 633 | py | Python | top/clearlight/reptile/bilibili/bj_tech_mooc/reptile.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/reptile/bilibili/bj_tech_mooc/reptile.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/reptile/bilibili/bj_tech_mooc/reptile.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import requests
# url = 'http://wsjkw.hebei.gov.cn/list/zt_gzfy.html'
# # url = 'http://wjw.beijing.gov.cn/wjwh/ztzl/xxgzbd/gzbdzcfg/index.html'
# r = requests.get(url)
# print(r.status_code)
# # r.encoding = 'utf-8'
# print(r.encoding)
# print(r.apparent_encoding)
# # print(r.text)
def getHTMLTest(url):
try:
... | 25.32 | 74 | 0.655608 |
019e0fa2051265605135bf611124245d7171f35f | 5,874 | py | Python | synchroload/synchroload.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | null | null | null | synchroload/synchroload.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | null | null | null | synchroload/synchroload.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import storage
import downloader
import plugins.archive
import plugins.dropbox
import plugins.dailymotion
import plugins.openload
import plugins.twitch
import plugins.u6656
import plugins.vimeo
import plugins.youtube
import plugins.dummy
from makesprites import Sprite... | 29.079208 | 141 | 0.633299 |
01e5ab5afb36fac229d7dcc098109d6d110740ac | 20,853 | py | Python | phypidaq/BMPx80Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | phypidaq/BMPx80Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | phypidaq/BMPx80Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import numpy as np, time, sys, smbus
# default addresses and ChipIDs of Bosch BMP 085/180 and BMP/E 280 sensors
BMP_I2CADDR = 0x77
BMP_I2CADDR2 = 0x76
#BMP_I2CADDR = 0x76 # alternative dev... | 37.572973 | 115 | 0.625713 |
bf281cd951d471f8f3251ddfdd7f8a3865f06533 | 997 | py | Python | code/bp_chrono/pull.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | 2 | 2022-02-09T14:02:59.000Z | 2022-03-23T11:50:47.000Z | code/bp_chrono/pull.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | null | null | null | code/bp_chrono/pull.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | null | null | null | import urllib2
from bs4 import BeautifulSoup
import sys
import datetime
for year in range(2006, datetime.datetime.now().year+1):
yearposts=[]
for page in range(1, 1000):
url='http://bit-player.org/{}/page/{}'.format(year, page)
req=urllib2.Request(url, headers={'User-Agent' : "Firefox"})
try:
con=urllib2.ur... | 34.37931 | 95 | 0.677031 |
171490bbc4b54039d8da2749936c53a0a9bbab76 | 669 | py | Python | FuzzyACO.py | siej88/FuzzyACO | 989a58049c8417cd023cfc312fb99d2649333ca7 | [
"MIT"
] | null | null | null | FuzzyACO.py | siej88/FuzzyACO | 989a58049c8417cd023cfc312fb99d2649333ca7 | [
"MIT"
] | null | null | null | FuzzyACO.py | siej88/FuzzyACO | 989a58049c8417cd023cfc312fb99d2649333ca7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
UNIVERSIDAD DE CONCEPCION
Departamento de Ingenieria Informatica y
Ciencias de la Computacion
Memoria de Titulo Ingenieria Civil Informatica
DETECCION DE BORDES EN IMAGENES DGGE USANDO UN
SISTEMA HIBRIDO ACO CON LOGICA DIFUSA
Autor: Sebastian Ignacio Espinoza Jimenez
Patrocinant... | 23.892857 | 50 | 0.715994 |
da0b4162359d7b9c3db5245a001e7bac5fff4082 | 247 | py | Python | doc/examples/inlined/bug_beniget.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/inlined/bug_beniget.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/inlined/bug_beniget.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z |
import gast as ast
import beniget
mod = ast.parse("""
T = int
def func() -> T:
return 1
""")
fdef = mod.body[1]
node = fdef.returns
du = beniget.DefUseChains()
du.visit(mod)
du.chains[node]
ud = beniget.UseDefChains(du)
ud.chains[node]
| 11.227273 | 29 | 0.659919 |
da39dee0899ff76b9c89c9b7001253e79c5c01fc | 958 | py | Python | SPS-Variants/backup/top-k-overview/backup/preZhi/genData/1.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | related_projects/source_codes/top-k-overview/preZhi/genData/1.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | related_projects/source_codes/top-k-overview/preZhi/genData/1.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import networkx as nx
import sys
if __name__ == '__main__':
if len(sys.argv) < 3:
print 'Usage: genData <graphType [SF, ER]> <nodeNum> <perIndegree>'
sys.exit(1)
nodeN = int (sys.argv[2])
inDeg = int (sys.argv[3])
gtype = str (sys.argv[1])
graph_name = gtype + str(nodeN) + '-' + st... | 34.214286 | 86 | 0.577244 |
da70277ecbcd81adab1f454b961d582f033746d9 | 2,014 | py | Python | latex/creator.py | tworkool/HTW-Bachelorarbeit-Template-v2 | e0eb2d7ac5acf476d2b5a97407820017f098e6b3 | [
"MIT"
] | null | null | null | latex/creator.py | tworkool/HTW-Bachelorarbeit-Template-v2 | e0eb2d7ac5acf476d2b5a97407820017f098e6b3 | [
"MIT"
] | null | null | null | latex/creator.py | tworkool/HTW-Bachelorarbeit-Template-v2 | e0eb2d7ac5acf476d2b5a97407820017f098e6b3 | [
"MIT"
] | null | null | null | import os
import sys
import pyperclip
def find_file(directory, file_name):
for root, dirs, files in os.walk(directory):
for basename in files:
if file_name in basename:
extension = basename.split('.')
extension = extension[len(extension) - 1]
fl_... | 38.730769 | 198 | 0.531281 |
daf811fb4627374f08ea73bd18f5a54f1547e28c | 300 | py | Python | algorithms/strings/make_it_anagram.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/strings/make_it_anagram.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/strings/make_it_anagram.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | import collections, sys
if __name__ == '__main__':
A = sys.stdin.readline().strip()
B = sys.stdin.readline().strip()
a = collections.Counter(A)
b = collections.Counter(B)
length = sum(min(a[c], b[c]) for c in (set(A) & set(B)))
print((len(A) - length) + (len(B) - length)) | 25 | 60 | 0.59 |
97be418b689a696d71dd3d357d24703a7a55af3f | 1,370 | py | Python | tests/books/createbookssuite.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | tests/books/createbookssuite.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | 5 | 2019-03-19T22:21:28.000Z | 2020-09-16T03:08:56.000Z | tests/books/createbookssuite.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timezone
from tests.books import AbstractTestBook, Book
class CreateBooksSuite(AbstractTestBook):
def setUp(self):
self._ISBN = '978-0618968633'
def tearDown(self):
key = self._client.key(self._kind, self._ISBN)
self._client.delete(key)
def testCreate(self):
expec... | 27.959184 | 63 | 0.651825 |
c14a8b7609e410aa3047a1fea7a1b58cccdf07be | 359 | py | Python | simple-tensorflow-demo/3.neural network/tf_3rd_1_matplotlib.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-tensorflow-demo/3.neural network/tf_3rd_1_matplotlib.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-tensorflow-demo/3.neural network/tf_3rd_1_matplotlib.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 10, 1000)
y = np.sin(x)
z = np.cos(x**2)
plt.figure(figsize=(8, 4))
plt.plot(x, y, label="$sin(x)$", color="red", linewidth=2)
plt.plot(x, z, "b--", label="$cos(x^2)$")
plt.xlabel("Time(s)")
plt.ylabel("Volt")
plt.title("matplotlib example")
plt.yl... | 19.944444 | 58 | 0.635097 |
c15fb5cec0b5bcaf2823ab5f0b1bb6defefa7f3d | 10,555 | py | Python | Project Euler Qusetions 51 - 60/Project Euler Question 54.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 51 - 60/Project Euler Question 54.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 51 - 60/Project Euler Question 54.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 54
#Poker hands
poker_file = open(r"C:\Users\Clayton\Documents\Python Other Files\p054_poker.txt")
content = poker_file.read()
content = content.replace(" ", "")
content = content.split("\n")
card_values = {"2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9, "T": 10, "J": 11, "Q": ... | 30.417867 | 123 | 0.499005 |
c18f66e59681c1445680e3e28e060eb30be673e1 | 294 | py | Python | exercises/zh/solution_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/solution_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/solution_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # 导入spacy并创建中文nlp对象
import spacy
nlp = spacy.blank("zh")
# 处理文本
doc = nlp("我喜欢老虎和狮子。")
# 遍历打印doc中的内容
for i, token in enumerate(doc):
print(i, token.text)
# 截取Doc中"老虎"的部分
laohu = doc[2:3]
print(laohu.text)
# 截取Doc中"老虎和狮子"的部分(不包括"。")
laohu_he_shizi = doc[2:5]
print(laohu_he_shizi.text)
| 14.7 | 31 | 0.693878 |
e75ac09c2a77743163fc9a7eef60621ee4d5f737 | 73 | py | Python | geek/geek2.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | geek/geek2.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | geek/geek2.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | curso = 'Programacao em Python Essencial'
def funcao2():
return curso | 24.333333 | 41 | 0.739726 |
99c5a029da3e80813cafe7ce1eafb5c5709261cd | 1,442 | py | Python | backend/apps/iamstudent/custom_crispy.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/custom_crispy.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/custom_crispy.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | from crispy_forms.bootstrap import Field
from crispy_forms.utils import TEMPLATE_PACK
class InputButtonGroup(Field):
"""
Layout object for rendering radio and checkbox elements as button groups::.
RadioButtons('field_name', [option_label_class="btn blue text-white btn-lg"])
"""
template = "%s/la... | 29.428571 | 87 | 0.627601 |
823f28c32d2bd546b4cbff92817ad336d78d019e | 1,537 | py | Python | src/python3_learn_video/os_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/os_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/os_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | """
模块是一个包含所有你定义的函数和变量的文件,其后缀名是.py
模块可以被别的程序引入,以使用该模块中的函数等功能
OS:Operation System 操作系统
"""
import os
print('-------------------------------')
print(os.getcwd()) # 获取当前的目录位置
print('-------------------------------')
os.chdir('E:\\') # 改变当前目录位置
print(os.getcwd())
print('-------------------------------')
print(os.l... | 26.964912 | 57 | 0.476252 |
41a74400b4de35df5aeeefe5d76a35e9bb6146d7 | 2,084 | py | Python | marsyas-vamp/marsyas/scripts/Python/make-bextract-splits.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/make-bextract-splits.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/make-bextract-splits.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/global/scratch/sness/openmir/tools/python/bin/python
#
#
#
import sys
import os
import datetime
import commands
import re
import time
import simplejson as json
import random
import pprint
pp = pprint.PrettyPrinter(indent=4)
def run(inFilename,outPrefix,numFolds):
inFile = open(inFilename, "r")
line = inF... | 24.232558 | 86 | 0.518234 |
d43169921a12e287804bfbe3ee39625b50cfcf93 | 303 | py | Python | src/bo4e/enum/strenum.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/strenum.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/strenum.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
strenum contains an enum that inherits from the plain enum and string.
"""
from enum import Enum
# pylint: disable=too-few-public-methods
class StrEnum(str, Enum):
"""
An enum that has string values.
"""
# see https://docs.python.org/3/library/enum.html?highlight=strenum#others
| 20.2 | 78 | 0.69637 |
9931776b61aedd8331ad2a90cae76c20aba15482 | 276 | py | Python | demo.py | tlee753/sharing-sequence | 1aae08b5eacefd9b3d88e5befe2453151210922c | [
"MIT"
] | null | null | null | demo.py | tlee753/sharing-sequence | 1aae08b5eacefd9b3d88e5befe2453151210922c | [
"MIT"
] | null | null | null | demo.py | tlee753/sharing-sequence | 1aae08b5eacefd9b3d88e5befe2453151210922c | [
"MIT"
] | null | null | null | import sys
def demo(x):
output = "AB"
for i in range(x):
temp = ""
for l in output:
if (l == 'A'):
temp += "AB"
else:
temp += "BA"
output = temp
print(output)
demo(int(sys.argv[1]))
| 17.25 | 28 | 0.394928 |
993db96065f109d3d5d76b32a4d8be59528b6cb1 | 383 | py | Python | Weboffice/woa_contacts/models/crm_phonecall.py | whoedl61/webinaroctubre | a22048838062999753860995d21328cb9d53d652 | [
"MIT"
] | null | null | null | Weboffice/woa_contacts/models/crm_phonecall.py | whoedl61/webinaroctubre | a22048838062999753860995d21328cb9d53d652 | [
"MIT"
] | null | null | null | Weboffice/woa_contacts/models/crm_phonecall.py | whoedl61/webinaroctubre | a22048838062999753860995d21328cb9d53d652 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from functools import reduce
from odoo import api, fields, models, _
class CrmPhonecall(models.Model):
_inherit = 'crm.phonecall'
sale_order_ids = fields.Many2one(
comodel_name='sale.order',
)
class CrmPhonecall2(models.Model):
_inherit = 'crm.phonecall'
crm_lea... | 20.157895 | 39 | 0.668407 |
51e0e33ddbe206b0d56ce2aab6123557e1a4198f | 1,435 | py | Python | Utils/py/RL_ActionSelection/env_0/env.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/env.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/env.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #################################
# #
# /\/\/\/\/\/\/\/\/\/\/\/\ #
# \/\/\/\/\/\/\/\/\/\/\/\/ #
# #
# Environment wrapper #
# #
# /\/\/\/\/\/\/\/\/\/\/\/\ #
# \/\/\/\/\/\/\/\/\/\/\/\/ #
# ... | 29.285714 | 96 | 0.510801 |
7a63c3d9ac53f87b8ddb8e62f13c5bfc49d13609 | 8,366 | py | Python | fspke/icarthash.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | fspke/icarthash.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | fspke/icarthash.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Joseph deBlaquiere <jadeblaquiere@yahoo.com>
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 43.34715 | 80 | 0.596701 |
710180788e46fb9672dd2581b521808730d01041 | 347 | py | Python | src/onegov/ticket/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ticket/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ticket/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ticket.handler import Handler, HandlerRegistry
handlers = HandlerRegistry() # noqa
from onegov.ticket.model import Ticket
from onegov.ticket.model import TicketPermission
from onegov.ticket.collection import TicketCollection
__all__ = [
'Handler',
'handlers',
'Ticket',
'TicketCollection'... | 21.6875 | 58 | 0.755043 |
a4548570e9100b45dc7f3ed1d57f183d03d53890 | 2,624 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/chuck_like.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/chuck_like.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/chuck_like.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | import marsyas
import random
import math
def mtof(pitch):
return 440.0 * math.pow(2.0, (pitch-69.0) / 12.0)
def set_freq(control, freq):
control.setValue_real(freq)
def dispatch(time, times, f, control, freq):
if (len(times) > 0):
if (time > times[0]):
f(control,freq)
... | 29.818182 | 103 | 0.636814 |
a4691d17b47d44eb5109026ed6f99a3f1b2ed3dc | 614 | py | Python | algos/longest_path.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | 1 | 2021-07-22T10:28:40.000Z | 2021-07-22T10:28:40.000Z | algos/longest_path.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | null | null | null | algos/longest_path.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import algos.walker as wk
from helper_functions import graph_helper_functions as gh
def run(path, figsize=(20, 20), key=None):
G = gh.load_file(path, key=key)
G.greedy_cycle_removal()
G.longest_path_layering()
pos = wk.t... | 22.740741 | 57 | 0.659609 |
74c4772af7109ae98aa0b7f769064ee7dd9fb758 | 378 | py | Python | leetcode/319-Bulb-Switcher/BulbSwitcher_001_TLE.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/319-Bulb-Switcher/BulbSwitcher_001_TLE.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/319-Bulb-Switcher/BulbSwitcher_001_TLE.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def bulbSwitch(self, n):
"""
:type n: int
:rtype: int
"""
num_of_facs = [1 for i in range(n)]
for j in range(2, n + 1):
for k in range(1, n / j + 1):
num_of_facs[j * k - 1] += 1
res = 0
for num in nu... | 22.235294 | 43 | 0.42328 |
77e8ce286a904effb315a4c8fe17cdd31db3e301 | 7,990 | py | Python | Extensions/Error-Handler.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | Extensions/Error-Handler.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | Extensions/Error-Handler.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | # Import
import asyncio
import datetime
import traceback
from datetime import datetime
import aiohttp
import discord
from discord import Webhook, AsyncWebhookAdapter
from discord.ext import commands
# Utils
import Utils
# Cog Initialising
class ErrorHandling(commands.Cog):
def __init__(self, client):
se... | 41.185567 | 213 | 0.550313 |
7024b0db92aa1c93b80803e4a6fc27ce1bb052a4 | 915 | py | Python | frappe-bench/apps/erpnext/erpnext/tests/utils.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/tests/utils.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/tests/utils.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def create_test_contact_and_address():
frappe.db.sql('delete from tabContact')
frappe.db.sql('delete from tabAddress')
frappe.db.sql(... | 24.72973 | 68 | 0.725683 |
56444732817776a4ea0d7b414bb0febfe8d243dd | 6,331 | py | Python | src/test/tests/plots/multicolor.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/plots/multicolor.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/plots/multicolor.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# MODES: serial
# CLASSES: nightly
#
# Test Case: multicolor.py
#
# Tests: Tests setting colors using the multiColor field in some of
# our plots.
# Plots - Boundary, Contour, FilledBoundary, Subset
# ... | 27.526087 | 80 | 0.619491 |
8db59ad767ca866816a196da3a6146244ffa5d3c | 195 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C04TreesGraphs/questions/4.6-questions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C04TreesGraphs/questions/4.6-questions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C04TreesGraphs/questions/4.6-questions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 4.6 Successor
# Write an algorithm to find the "next" node (i.e. in-order successor) of a given node in a binary
# search tree.
# You may assume that each node has a link to its parent.
| 27.857143 | 98 | 0.697436 |
8df6b2cabed9326fb9ee9a6f9b03957c9522e72b | 1,211 | py | Python | Problems/BinarySearchTree/Medium/ConstructBTPreorderPostorder/construct_bt_preorder_post_order.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/BinarySearchTree/Medium/ConstructBTPreorderPostorder/construct_bt_preorder_post_order.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/BinarySearchTree/Medium/ConstructBTPreorderPostorder/construct_bt_preorder_post_order.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List, 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
# Recursive
def constructFromPrePost(self, preorder: List[int], postorder: List[int]) -> Optional[Tre... | 25.765957 | 98 | 0.573906 |
5c2e78f6ec9188752e839badd8479abebd9464c3 | 2,878 | py | Python | 015-C111-ZTests/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 015-C111-ZTests/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 015-C111-ZTests/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # 015-C111-ZTests
# This is a python script made by @somePythonProgrammer
# for a WhiteHat Junior project.
from os import name
from numpy.testing._private.utils import measure
import pandas as pd
import plotly.graph_objects as go
import plotly.figure_factory as ff
import statistics
import random
df = pd.read_csv('014... | 35.530864 | 131 | 0.704656 |
ebbaa666b451a8bcca6ea804702e3e76aeadfad1 | 2,775 | py | Python | 21-fs-ias-lec/03-BACnetCore/src/core/interface/feed.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/03-BACnetCore/src/core/interface/feed.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/03-BACnetCore/src/core/interface/feed.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from .event import Event
class FeedMeta:
"""
This class represents the Metadata for every feed.
"""
def __init__(self, feed_name, public_key, signature_info):
self.feed_name = feed_name
self.public_key = public_key
self.signature_info = signature_info
def get_feed_name(sel... | 32.267442 | 119 | 0.636396 |
ccdf8f1eac886bcd1157d7b5357039a843c4079e | 368 | py | Python | crypto/Shuffler/release/chall.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | crypto/Shuffler/release/chall.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | crypto/Shuffler/release/chall.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | import random, string
def encrypt(msg):
x = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
y = 'BXcjk7JCT5goWsq9Lhr2zvVISbKfGteauUHMlRiQ3Nd6A8p14OnmZ0xyYFPEwD'
z = string.maketrans(x, y)
return msg.translate(z)
pt = open('plaintext.txt').read().strip()
N = random.randint(21, 42)
ct = encrypt(pt... | 23 | 69 | 0.76087 |
6928501e2000846c0d8fc68cc04c0dfdb6116604 | 2,389 | py | Python | pwn/ezrop_revenge/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | pwn/ezrop_revenge/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | pwn/ezrop_revenge/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
from pwn import *
context.terminal = ['tmux', 'split-window', '-h']
context.log_level = ['debug', 'info', 'warn'][1]
BINARY = './chall'
HOST = '35.185.187.162'
PORT = 17005
# 0x08057bd2: mov dword ptr [edx], eax; ret;
# 0x0806ee8b: pop edx; ret;
# 0x080ab5ca: pop eax; ret;
# 0x0806eeb2: pop ecx... | 25.414894 | 79 | 0.616995 |
15c28f57a5f1b0090f228689a2392ab6c22ad488 | 48,172 | py | Python | tests/test_user_io.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | tests/test_user_io.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | tests/test_user_io.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""tests for user_io.py"""
import unittest
from unittest import mock
import sys
from io import StringIO
import test_frame
import user_io
import geocache
class TestGeneralOutput(unittest.TestCase):
def test_normaltext(self):
out = StringIO()
sys.st... | 44.936567 | 118 | 0.630096 |
bab3bada988756769c8b3327590eb6ad143eac63 | 35 | py | Python | DjangoStarter/DjangoStarter/__init__.py | QuinntyneBrown/DjangoStarter | 7c2f385546568604acbb4f18d8a473ecb3688202 | [
"MIT"
] | null | null | null | DjangoStarter/DjangoStarter/__init__.py | QuinntyneBrown/DjangoStarter | 7c2f385546568604acbb4f18d8a473ecb3688202 | [
"MIT"
] | null | null | null | DjangoStarter/DjangoStarter/__init__.py | QuinntyneBrown/DjangoStarter | 7c2f385546568604acbb4f18d8a473ecb3688202 | [
"MIT"
] | null | null | null | """
Package for DjangoStarter.
"""
| 8.75 | 26 | 0.657143 |
240a7bd5f59637ee67ddbee7e1ddd123e959d491 | 391 | py | Python | old/simple.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | old/simple.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | old/simple.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | from random import randrange
from Car import Car
car1 = Car("Porsche Cayman S",15, 250)
car1.drive(100)
for t in range(10):
print (t)
print(car1)
a=randrange(1,4)
if a == 1:
car1.brake(5)
print("breaking")
elif a == 2:
car1.acc(5)
print("acceleratione")
else... | 13.482759 | 38 | 0.544757 |
236804b13f6d0d6706e9d3a16451ccbf261c0e22 | 1,617 | py | Python | comunication.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:22:59.000Z | 2020-11-22T22:22:59.000Z | comunication.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | null | null | null | comunication.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:24:19.000Z | 2020-11-22T22:24:19.000Z | import asyncio
import websockets
import DisplayActions
import ctypes
import os
authenticated = True
dActions = DisplayActions.Actions()
reserved = ["load","fun"]
global websocket_pointer
async def commu(websocket, path):
async for message in websocket:
dActions.websocket_pointer = id(websocket)
tr... | 32.34 | 83 | 0.563389 |
23825cd9dfc310f9b5d988ee80f0a6b7747833c4 | 776 | py | Python | ProjectEuler_plus/euler_025.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_025.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_025.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from math import ceil, log10
from itertools import count
def fib_number_of_digits(n):
'''
http://www.geeksforgeeks.org/finding-number-of-digits-in-nth-fibonacci-number/
'''
PHI = 1.6180339887498948
if n == 1:
return 1
d = (n * log10(PHI)) - (log10(5) / 2)
ret... | 21.555556 | 82 | 0.550258 |
cc76ab83ee81f7e53e657e377715df89a15908d9 | 1,101 | py | Python | app/appdev.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/appdev.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/appdev.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | import streamlit as st
import pandas as pd
#import numpy as np
#import time
from api_tools import get_product_info
# load md text from file and display on page
path_to_md = "./intro.md"
with open(path_to_md, "r") as f:
md_text = f.read()
st.markdown(md_text)
# load and display cart
cart_csv = st.file_uploader('D... | 29.756757 | 82 | 0.603996 |
cc87991e668d4c05c3bd94d6016210d3ddbd3ed6 | 1,139 | py | Python | 0021merge-two-sorted-lists.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0021merge-two-sorted-lists.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0021merge-two-sorted-lists.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def __str__(self):
text = str()
node = self
while node != None:
text += "%d->" %node.val
node = node.next
text += "None"
... | 20.709091 | 68 | 0.461809 |
cc8c3bb1597e5b3ca5cdf3e9d3c20f30873bf602 | 3,638 | py | Python | skimind/kernel/useCases/buildTicket/dataFilter.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/useCases/buildTicket/dataFilter.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/useCases/buildTicket/dataFilter.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #-*-coding: utf-8 -*-
# interfacedb
from . import interfacedb
# gFunctions
from . import gFunctions
# tools
import pandas as pd
import numpy as np
# config
from . import config
def get_ticket_columns():
columns = [
*interfacedb.modelTables.matchs.get_primary_key(),
interfacedb.modelTables.mat... | 28.645669 | 102 | 0.64541 |
4e07aae04b48816df9b9ec4ed208675854d38c5b | 528 | py | Python | PMIa/2015/KOLOV_A_A/task_6_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/KOLOV_A_A/task_6_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/KOLOV_A_A/task_6_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 14.
# оздайте игру, в которой компьютер загадывает имя одного из трех официальных талисманов зимних Олимпийских игр 2014 года в Сочи, а игрок должен его угадать.
# Kolov A.A
# 25.05.2016
import random
mascots = ['Леопард','Белый Мишка','Зайка']
progSel = mascots[random.randint(0,2)]
userSel = inp... | 35.2 | 157 | 0.744318 |
4e3e8457ecaa37412f76888b6250fd5d05ed950d | 475 | py | Python | 559-maximum-depth-of-n-ary-tree/559-maximum-depth-of-n-ary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 559-maximum-depth-of-n-ary-tree/559-maximum-depth-of-n-ary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 559-maximum-depth-of-n-ary-tree/559-maximum-depth-of-n-ary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | """
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
"""
class Solution:
def maxDepth(self, root: 'Node') -> int:
if not root:
return 0
stack=[(root, 1)]
while(stack):
cur, l... | 25 | 48 | 0.509474 |
9d8e4cc86959dac85085503a187249ee7cb7a265 | 1,467 | py | Python | INBa/2015/Mitin_D_S/task_9_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Mitin_D_S/task_9_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Mitin_D_S/task_9_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать.
#Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать,
#есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет".
#Вслед за тем игрок должен попробовать отгадать слово.
# M... | 40.75 | 116 | 0.722563 |
9dde70e629b8e7cb82755d4576cc05f224e55128 | 11,275 | py | Python | tuta/train.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 36 | 2021-06-15T01:04:27.000Z | 2022-03-19T16:36:54.000Z | tuta/train.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 6 | 2021-09-03T11:29:36.000Z | 2021-12-15T11:33:57.000Z | tuta/train.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 8 | 2021-11-03T04:32:36.000Z | 2022-02-02T13:43:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Do Pre-Training of TUTA Model (variants)
"""
import torch
import argparse
import torch.distributed as dist
import torch.multiprocessing as mp
import tokenizer as tknr
import model.pretrains as ptm
import trainers as tnr
import dynamic_data as dymdata
... | 55 | 143 | 0.687007 |
d18c08465c1f32bc5c25cd258c304646ee1f9efc | 2,118 | py | Python | resources/mechanics_lib/Tetrahedron.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/Tetrahedron.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/Tetrahedron.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z | from api.component import Component
from connector import Tab
from api.shapes import Face
from api.edge import *
class Tetrahedron(Component):
def defParameters(self):
self.newParameter("perimeter")
self.newParameter("start", 0)
self.newParameter("end", 1)
self.newParameter("min", 1... | 32.584615 | 100 | 0.571766 |
c9c501e8a1f1ae12d26ca5df3e416c69e2ceb6a1 | 3,621 | py | Python | chapter5/mnistcnn.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | 1 | 2020-02-16T13:31:42.000Z | 2020-02-16T13:31:42.000Z | chapter5/mnistcnn.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | chapter5/mnistcnn.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2019/2/16 19:24
# @Author : LunaFire
# @Email : gilgemesh2012@gmail.com
# @File : mnistcnn.py
import os
import matplotlib.pyplot as plt
from keras import backend as K
from keras.datasets import mnist
from keras.utils import np_utils
from keras.models import Sequential, load_... | 30.686441 | 97 | 0.65921 |
4e625971225c80acdf439a7a8e8b15dc1f6e8b39 | 2,338 | py | Python | tests/test_collections.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 12 | 2021-02-26T08:19:00.000Z | 2022-01-26T14:00:16.000Z | tests/test_collections.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | null | null | null | tests/test_collections.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 3 | 2021-03-19T13:51:56.000Z | 2021-08-25T05:25:52.000Z | import modelindex
import pytest
from modelindex import Metadata
from modelindex.models.Collection import Collection
from modelindex.models.CollectionList import CollectionList
from modelindex.models.Model import Model
from modelindex.models.ModelList import ModelList
from modelindex.models.Result import Result
from mod... | 30.363636 | 70 | 0.696322 |
0118bbd621593dfd2ab53101f08164527bfdaec9 | 1,740 | py | Python | src/onegov/election_day/forms/upload/wabsti_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/wabsti_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/wabsti_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.forms.upload.common import ALLOWED_MIME_TYPES
from onegov.election_day.forms.upload.common import MAX_FILE_SIZE
from onegov.form import Form
from onegov.form.fields import UploadField
from onegov.form.validators import FileSizeLimit
from onegov.form.validators import WhitelistedMimeType
from wt... | 28.52459 | 70 | 0.651724 |
61f6d2a5f05b2d6ba499dd31b52ea17416beb70c | 12,746 | py | Python | wz/minion.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/minion.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/minion.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
minion.py - last updated 2021-05-27
Read MINION-formatted configuration data.
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | 35.904225 | 79 | 0.528323 |
fecb5c82863b05d04a7c6dd0172f1773db28b2f0 | 7,586 | py | Python | python/csv_value_copy.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 89 | 2015-02-13T13:46:06.000Z | 2022-03-13T16:42:44.000Z | python/csv_value_copy.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 91 | 2015-03-12T13:31:36.000Z | 2022-01-14T07:37:37.000Z | python/csv_value_copy.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
import csv
import sys
import openapc_toolkit as oat
ARG_HELP_STRINGS = {
"source_file": "The source csv file",
"source_file_key_column": "The numerical index of the key column " +
"in the source file",... | 47.710692 | 143 | 0.597284 |
e921f3f27b44858abfbec8e666ca9339e64d1af4 | 1,908 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/shapes/poi_at_stops.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/shapes/poi_at_stops.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/shapes/poi_at_stops.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 36.692308 | 96 | 0.689203 |
3aef051281f5976411fee95c029eafcddc32c493 | 63,307 | py | Python | evaluation.py | hoelzlmanuel/online-translator-evaluation | 52c83db6a3601f2888110e6bf4f23e95d052313f | [
"MIT"
] | null | null | null | evaluation.py | hoelzlmanuel/online-translator-evaluation | 52c83db6a3601f2888110e6bf4f23e95d052313f | [
"MIT"
] | null | null | null | evaluation.py | hoelzlmanuel/online-translator-evaluation | 52c83db6a3601f2888110e6bf4f23e95d052313f | [
"MIT"
] | null | null | null | from nltk.translate.bleu_score import corpus_bleu
from nltk.translate.nist_score import corpus_nist
from nltk.translate.meteor_score import meteor_score
from nltk.translate.gleu_score import corpus_gleu
import re
from nltk.translate.ribes_score import corpus_ribes
from nltk.translate.chrf_score import corpus_chrf
from ... | 97.846986 | 625 | 0.726634 |
a37d0692728b7b2bf7381bc45be509f6afdc4ea7 | 388 | py | Python | Python/Exercícios_Python/052_progressão_aritmética.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/052_progressão_aritmética.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/052_progressão_aritmética.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""052 - Progressão Aritmética
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1XxsY2LOjklht2ABKc1B0VXPOppV9E7Dh
"""
num = int(input('\nDigite o Primeiro número da PA: '))
razão = int(input('Digite a Razão da PA: '))
for c in ra... | 25.866667 | 77 | 0.688144 |
289c9a1594a760f168991c2dc18e5e74ce3cfb9d | 2,515 | py | Python | apps/user/admin.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/user/admin.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/user/admin.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | """ License
MIT License
Copyright (c) 2017 OpenAdaptronik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 34.930556 | 99 | 0.71332 |
95de10b35f36d0ae9b8107f3312c8a02cbd6a865 | 42,950 | py | Python | src/visuanalytics/server/api/api.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 1 | 2020-11-27T17:26:27.000Z | 2020-11-27T17:26:27.000Z | src/visuanalytics/server/api/api.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 85 | 2021-01-02T11:38:59.000Z | 2021-07-26T07:13:47.000Z | src/visuanalytics/server/api/api.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 1 | 2021-04-19T06:50:53.000Z | 2021-04-19T06:50:53.000Z | """
Enthält die API-Endpunkte.
Alle Endpunkte liefern im Fehlerfall einen Key 'err_msg'.
"""
import flask
import logging
from flask import (Blueprint, request, send_file, send_from_directory)
from werkzeug.utils import secure_filename
from os import path
from datetime import datetime
from visuanalytics.server.db im... | 33.898974 | 137 | 0.620652 |
c2d0f1f1858066ddbc5efc00de7b1529da6e06e4 | 2,172 | py | Python | saku/auction/migrations/0001_initial.py | Mehdi-MosTafavi/Saku-Backend | 348a1a676ffc8ddd9077f8c94733c5f6dce98fbd | [
"MIT"
] | null | null | null | saku/auction/migrations/0001_initial.py | Mehdi-MosTafavi/Saku-Backend | 348a1a676ffc8ddd9077f8c94733c5f6dce98fbd | [
"MIT"
] | null | null | null | saku/auction/migrations/0001_initial.py | Mehdi-MosTafavi/Saku-Backend | 348a1a676ffc8ddd9077f8c94733c5f6dce98fbd | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-04-23 09:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 38.105263 | 119 | 0.558471 |
66148cb9223c8b7fc9637bef4bdaade367fee468 | 2,939 | py | Python | Python/plotSurfaceMachContour.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | 1 | 2019-02-11T00:45:37.000Z | 2019-02-11T00:45:37.000Z | Python/plotSurfaceMachContour.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | Python/plotSurfaceMachContour.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | import tecplot
import numpy as np
import math
import string
from tecplot.exception import *
from tecplot.constant import *
class plotSurfaceMachContour(object):
def __init__(self, mySurfaceFlowFile, Type):
print("plotMachContour.................................................");
self.m... | 40.260274 | 98 | 0.536237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.