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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48781b39dfebdde7859d861bed84a0ee19ca04fc | 10,574 | py | Python | prova2poo/prova2.py | samcost/POO | 5c280407abb7aa9db1c82e52c34fd372465e8fe2 | [
"MIT"
] | null | null | null | prova2poo/prova2.py | samcost/POO | 5c280407abb7aa9db1c82e52c34fd372465e8fe2 | [
"MIT"
] | null | null | null | prova2poo/prova2.py | samcost/POO | 5c280407abb7aa9db1c82e52c34fd372465e8fe2 | [
"MIT"
] | null | null | null | import math
from abc import ABC, abstractmethod
class Poligono (ABC):
"""
Classe Base Abstrata utilizada para representar um polígono qualquer.
Um polígono é representado pelas coordenadas do seu centro
e pelos comprimentos dos seus lados.
Esta classe não deve ser instanciada.
"""
... | 27.252577 | 106 | 0.543219 |
d27ee091cefc8eef0da579a7303d443d6f05fdcb | 432 | py | Python | teams/codeing_crazy/src/testplay.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 19 | 2017-10-08T03:18:38.000Z | 2020-07-07T02:34:18.000Z | teams/codeing_crazy/src/testplay.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 2 | 2017-10-08T03:15:10.000Z | 2017-10-10T16:10:32.000Z | teams/codeing_crazy/src/testplay.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 28 | 2017-10-07T23:24:36.000Z | 2022-03-29T08:03:40.000Z | from pynq.overlays.base import BaseOverlay
from time import sleep
base = BaseOverlay("base.bit")
pAudio = base.audio
pAudio.load("notes/Gb3.pdm")
pAudio.play()
sleep(2)
pAudio.load("notes/Ab4.pdm")
pAudio.play()
sleep(2)
pAudio.load("notes/Bb4.pdm")
pAudio.play()
sleep(2)
pAudio.load("notes/Db4.pdm")
pAudio.play... | 12.705882 | 42 | 0.715278 |
9662d07d47e37e30d3ee655840119577616d3bb3 | 2,989 | py | Python | Packs/ShiftManagement/Scripts/GetUsersOnCall/GetUsersOnCall_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ShiftManagement/Scripts/GetUsersOnCall/GetUsersOnCall_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/ShiftManagement/Scripts/GetUsersOnCall/GetUsersOnCall_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from GetUsersOnCall import main
USERS_ON_CALL_RESULTS = [
{
'Type': 1,
'Contents': [
{
'email': 'batman@demisto.com', 'name': 'Batman',
'phone': '+650-123456', 'roles': {'demisto': ['AnalystShift']},
'username... | 41.513889 | 118 | 0.559719 |
736d5fbdbf1a8e44cd3453cf41113fef125e0634 | 2,838 | py | Python | tests/addons/log2reqs/test_yaml.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | tests/addons/log2reqs/test_yaml.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | tests/addons/log2reqs/test_yaml.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import pytest
from owlmixin import RequiredError
from jumeaux.addons.log2reqs.yaml import Executor
from jumeaux.models import Log2ReqsAddOnPayload
class TestFromFormat:
@classmethod
def teardown_class(cls):
os.path.exists("tmp") and os.remove("t... | 24.894737 | 98 | 0.414024 |
73c542abb6fced71c099fd0efda82f9f88fa4e18 | 13,200 | py | Python | Packs/Lansweeper/Integrations/Lansweeper/Lansweeper_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/Lansweeper/Integrations/Lansweeper/Lansweeper_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/Lansweeper/Integrations/Lansweeper/Lansweeper_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import io
import json
import os
import time
from unittest.mock import patch
import pytest
from CommonServerPython import (DemistoException, set_integration_context, get_integration_context)
from Lansweeper import MESSAGES
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
re... | 32.917706 | 114 | 0.664318 |
fb41c0a767b5ad87cf8b7cf6a62fc56566a9c379 | 3,814 | py | Python | migrations/versions/a75bd9c8ad3a_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/a75bd9c8ad3a_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/a75bd9c8ad3a_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: a75bd9c8ad3a
Revises: 51c47c7f0bdb
Create Date: 2020-09-29 16:53:02.520125
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from project import dbtypes
from project.models import (
EventReferenceRequestRejectionReason,
EventReferenceR... | 34.053571 | 88 | 0.612743 |
fb9ad5a6ef22a12e74c019782bb393c9a06d14f9 | 1,186 | py | Python | DataProcess/my_paper/auth_utils.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | 3 | 2021-12-24T04:52:03.000Z | 2021-12-27T02:14:49.000Z | DataProcess/my_paper/auth_utils.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | DataProcess/my_paper/auth_utils.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project :DataProcess
@File :auth_utils.py
@Author :Zhang Qihang
@Description: 与认证阶段以及认证矩阵有关的函数
@Date :2021/12/23 14:44
"""
import pandas as pd
from config import *
import numpy as np
import scipy.constants as C
from filters import *
from myunwrap ... | 27.581395 | 69 | 0.633221 |
793d78c5d1ab8c0dae060e94d373b9db352e9165 | 2,184 | py | Python | geoanalytics/urls.py | m-atisa/Standard-Answer-App | 28ad940925f794b1ca0cfd66f850f780aa43b4f8 | [
"Apache-2.0"
] | null | null | null | geoanalytics/urls.py | m-atisa/Standard-Answer-App | 28ad940925f794b1ca0cfd66f850f780aa43b4f8 | [
"Apache-2.0"
] | null | null | null | geoanalytics/urls.py | m-atisa/Standard-Answer-App | 28ad940925f794b1ca0cfd66f850f780aa43b4f8 | [
"Apache-2.0"
] | null | null | null | """geoanalytics URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 43.68 | 107 | 0.72619 |
543c3bd4403f1768596661774aae3d111b6120b3 | 378 | py | Python | pynanz/Downloader.py | salemileandro/pynanz | 5e22f4c4a0914714d1df668d3d0be54c90a8ff6d | [
"MIT"
] | null | null | null | pynanz/Downloader.py | salemileandro/pynanz | 5e22f4c4a0914714d1df668d3d0be54c90a8ff6d | [
"MIT"
] | null | null | null | pynanz/Downloader.py | salemileandro/pynanz | 5e22f4c4a0914714d1df668d3d0be54c90a8ff6d | [
"MIT"
] | null | null | null | import yfinance as yf
import pandas as pd
from pandas import Timestamp, Timedelta
import os
class Downloader:
CACHE_DIRECTORY = os.path.join(os.path.join(os.path.expanduser('~'), ".cache"), "pynanz")
os.makedirs(CACHE_DIRECTORY, exist_ok=True)
def __init__(self):
print("Initialization")
p... | 23.625 | 93 | 0.679894 |
5493d0ea2bf91aa15d523c311d2320570fa424f1 | 511 | py | Python | SC101_Assignments/SC101_Assignment2/breakout.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment2/breakout.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment2/breakout.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | """
stanCode Breakout Project
Adapted from Eric Roberts's Breakout by
Sonja Johnson-Yu, Kylie Jue, Nick Bowman,
and Jerry Liao.
YOUR DESCRIPTION HERE
"""
from campy.gui.events.timer import pause
from breakoutgraphics import BreakoutGraphics
from campy.gui.events.mouse import onmouseclicked
FRAME_RATE = 1000 / 120 #... | 18.25 | 49 | 0.745597 |
54acfa8406e93b3e0bc3d58c0e80a6e9c45c7d62 | 2,049 | py | Python | basketball/player/UI_CentralWindow.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | basketball/player/UI_CentralWindow.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | basketball/player/UI_CentralWindow.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | import PyQt5
import PyQt5.QtWidgets
import UI_CommonInfo
class UI_CentralWindow(PyQt5.QtWidgets.QDialog):
"""
This class hold the UI elements
"""
def __init__(self, parent=None):
super(UI_CentralWindow, self).__init__(parent)
# Enter the player's name
playerNameLabel = PyQt5.... | 34.15 | 101 | 0.653978 |
b75b1b66870cd7515f3dc5122fa731b89ccefc0a | 1,298 | py | Python | usc-20203-phys-151-50380/hw01/fig.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | usc-20203-phys-151-50380/hw01/fig.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | usc-20203-phys-151-50380/hw01/fig.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | import matplotlib.pyplot as plt
from typing import List
X0 = 4.00
V0 = 2.00
V1 = 1.00
def x(t: float) -> float:
return (V1/4)*t**4 + V0*t + X0
def v(t: float) -> float:
return V1*t**3 + V0
def a(t: float) -> float:
return 3*V1*t**2
def linspace(start: float, stop: float, n: int) -> List[float]:
"""Returns a ... | 22.37931 | 63 | 0.641757 |
b779d8bc014085cd40c7f62fbb4ffea27d27d783 | 2,393 | py | Python | python/en/_numpy/python_numpy_tutorial/python_numpy_tutorial-python-basic_data_types.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/python_numpy_tutorial/python_numpy_tutorial-python-basic_data_types.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/python_numpy_tutorial/python_numpy_tutorial-python-basic_data_types.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CS231n Convolutional Neural Networks for Visual Recognition
http://cs231n.github.io/
Python Numpy Tutorial
http://cs231n.github.io/python-numpy-tutorial/
 ̄
python_numpy_tutorial-python-basic_data_types.py
2019-07-03 (Wed)
"""
# Python Numpy Tutorial > Python > Basic ... | 19.77686 | 85 | 0.647305 |
4d200e1c3e2135b0c7410e10dd74571736dda291 | 3,191 | py | Python | robot/meizitu/mzt.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | robot/meizitu/mzt.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | robot/meizitu/mzt.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
import time
import requests
from bs4 import BeautifulSoup
class mzitu():
def __init__(self):
self.headers = {'User-Agent': "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24"}
... | 37.104651 | 148 | 0.577249 |
4d4902c589fcd61c2c3e0d519b3ead4d22e574de | 1,154 | py | Python | hausse/plugins/data/markdown.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | hausse/plugins/data/markdown.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | hausse/plugins/data/markdown.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | from typing import List
from hausse.lib import Project, SelectorPlugin
from hausse.lib.selector import Extensions
from markdown2 import markdown
class Markdown(SelectorPlugin):
"""
Markdown
========
Parse Markdown files to HTML.
Parameters
----------
selection
Files to parse. By... | 25.086957 | 96 | 0.617851 |
12f9790448e296e1b507e9ffce837283227718f9 | 3,650 | py | Python | 6.Tree/Binary Tree/binary_tree.py | Vinaypatil-Ev/vinEvC_datastructure | 3e02e49c03a2b7d2e09af9a2dce080e6d9abbf74 | [
"MIT"
] | 3 | 2020-09-10T18:40:40.000Z | 2020-09-15T17:32:12.000Z | 6.Tree/Binary Tree/binary_tree.py | Vinaypatil-Ev/vinEvC_datastructure | 3e02e49c03a2b7d2e09af9a2dce080e6d9abbf74 | [
"MIT"
] | null | null | null | 6.Tree/Binary Tree/binary_tree.py | Vinaypatil-Ev/vinEvC_datastructure | 3e02e49c03a2b7d2e09af9a2dce080e6d9abbf74 | [
"MIT"
] | null | null | null | # Create Node class containing
# data
# left pointer
# right pointer
class Node:
def __init__(self, value):
self.value = value
self.right = None
self.left = None
class BinaryTree:
def __init__(self):
self.root = None
def insert(self, value):
if not self.ro... | 24.333333 | 54 | 0.428219 |
67614c7c35d69d3911e54c8ba6037d45005c128c | 406 | py | Python | exercises/ja/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Doc.has_extension("has_number"), "docに拡張属性を登録しましたか?"
ext = Doc.get_extension("has_number")
assert ext[2] is not None, "ゲッターをきちんと設定しましたか?"
assert "getter=get_has_number" in __solution__, "get_has_numberを拡張プロパティとして登録しましたか?"
assert "doc._.has_number" in __solution__, "カスタム属性にアクセスしました... | 40.6 | 87 | 0.73399 |
e1ef414747878738790cff41c8a0a361ba7b26a6 | 2,495 | py | Python | Packs/PrismaCloudCompute/Scripts/PrismaCloudComputeParseCloudDiscoveryAlert/PrismaCloudComputeParseCloudDiscoveryAlert_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PrismaCloudCompute/Scripts/PrismaCloudComputeParseCloudDiscoveryAlert/PrismaCloudComputeParseCloudDiscoveryAlert_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PrismaCloudCompute/Scripts/PrismaCloudComputeParseCloudDiscoveryAlert/PrismaCloudComputeParseCloudDiscoveryAlert_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from PrismaCloudComputeParseCloudDiscoveryAlert import parse_cloud_discovery
import pytest
import json
def test_parse_cloud_discovery():
valid_raw_json = json.dumps({
"_id": "ID",
"time": "1970-01-01T00:00:00.000Z",
"kind": "cloudDiscovery",
"credentialId": "koko",
"provide... | 32.828947 | 116 | 0.528657 |
58f9911b9149552edfe39be0afd19fde4fe2be4d | 4,609 | py | Python | program.py | RenkoT97/Projekt2017 | 2f3503603b8462f008295ea7b1c4b7f3e66b5548 | [
"MIT"
] | null | null | null | program.py | RenkoT97/Projekt2017 | 2f3503603b8462f008295ea7b1c4b7f3e66b5548 | [
"MIT"
] | null | null | null | program.py | RenkoT97/Projekt2017 | 2f3503603b8462f008295ea7b1c4b7f3e66b5548 | [
"MIT"
] | null | null | null | import tkinter as tk
import random
import sys
import os
def pretvori_dat_v_sez(ime_dat):
with open(ime_dat) as dat:
datoteka = dat.readlines()
seznam = [[[crka.strip() for crka in crke.split(',') if crka.strip() not in [" ", ","]] for crke in vrstica.split("~")[1:-1] if vrstica.strip()] for... | 36.579365 | 337 | 0.622695 |
e1770742c280e59e6d4b842bb8d2ddd17ec93a8a | 1,005 | py | Python | config/default.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | null | null | null | config/default.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | null | null | null | config/default.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | null | null | null | """
AUTOR: Juanjo
FECHA DE CREACIÓN: 08/07/2019
"""
import os
from os.path import abspath, dirname, join
# Define the application directory
BASE_DIR = dirname(dirname(abspath(__file__)))
# Media dir
MEDIA_DIR = join(BASE_DIR, 'media')
POSTS_IMAGES_DIR = join(MEDIA_DIR, 'posts')
FACE_IMAGES_DIR = join(MEDIA_DIR, '... | 21.382979 | 96 | 0.776119 |
55c7a9c8bbcc5237df174337a35dffc956e51b6a | 123 | py | Python | projects/g3h1-cp-fml-interpreter/src/fml_parser/__init__.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/fml_parser/__init__.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/fml_parser/__init__.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from .grammar import NonTerminals, Terminals
from .parser import Parser
__all__ = ['NonTerminals', 'Terminals', 'Parser']
| 24.6 | 49 | 0.764228 |
55f4cb6c909e945ae46108fdf8b36201d11ebdc1 | 9,621 | py | Python | schmetterling.py | krillr/pfsk | 8957ae07443155464bf01337c8e5ca5960fd17f9 | [
"Apache-2.0"
] | null | null | null | schmetterling.py | krillr/pfsk | 8957ae07443155464bf01337c8e5ca5960fd17f9 | [
"Apache-2.0"
] | null | null | null | schmetterling.py | krillr/pfsk | 8957ae07443155464bf01337c8e5ca5960fd17f9 | [
"Apache-2.0"
] | null | null | null | from colorama import init, Fore, Back, Style
from scipy.io import wavfile
import audio, argparse, json, ntplib, numpy as np, os, pfsk, reedsolo, select, sys, time, util, warnings
warnings.simplefilter('ignore')
TX_LENGTH = 16
class Schmetterling:
options = argparse.ArgumentParser()
options.add_argument('--in... | 45.597156 | 184 | 0.590167 |
3687ee648d3f03f7dc57e1a4e3b85db56d538e48 | 5,853 | py | Python | Packs/GoogleCalendar/Integrations/GoogleCalendar/GoogleCalendar_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleCalendar/Integrations/GoogleCalendar/GoogleCalendar_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleCalendar/Integrations/GoogleCalendar/GoogleCalendar_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
from unittest.mock import patch
import pytest
from GoogleCalendar import MESSAGES, OUTPUT_PREFIX, GSuiteClient
with open('test_data/service_account_json.txt') as f:
TEST_JSON = f.read()
MOCKER_HTTP_METHOD = 'GSuiteApiModule.GSuiteClient.http_request'
@pytest.fixture
def gsuite_client():
header... | 30.170103 | 120 | 0.720827 |
e9ee3ee8496082e7afe28d36b14c10bc8e9ff499 | 1,419 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/111_metaclasses/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/111_metaclasses/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/111_metaclasses/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | # class Meta(type):
# def __new__(mcs, name, bases, namespace):
# if name == 'A':
# return type.__new__(mcs, name, bases, namespace)
#
# if 'b_fala' not in namespace:
# print(f'Oi, você precisa criar o metodo b_fala em {name}')
# else:
# if not callable(na... | 23.262295 | 81 | 0.563777 |
a1508371a81a6355551d2a86206b8935cbe27e0a | 1,661 | py | Python | add_ons/sortBonesAlphabetically.py | lars-wobus/blender_2.80_workshop_2019 | 5d87f6d4a262898a0c48cc6bce9fdd915328e607 | [
"MIT"
] | null | null | null | add_ons/sortBonesAlphabetically.py | lars-wobus/blender_2.80_workshop_2019 | 5d87f6d4a262898a0c48cc6bce9fdd915328e607 | [
"MIT"
] | null | null | null | add_ons/sortBonesAlphabetically.py | lars-wobus/blender_2.80_workshop_2019 | 5d87f6d4a262898a0c48cc6bce9fdd915328e607 | [
"MIT"
] | null | null | null | bl_info = {
"name": "Sort Bones Alphabetically",
"blender": (2, 80, 0),
"author": "Lars Wobus",
"category": "Rigging"
}
import bpy
from collections import deque
class BoneSorting(bpy.types.Operator):
"""Sort bones of active armature alphabetically"""
bl_idname = "armature.bone_sorting"
bl_... | 29.660714 | 60 | 0.668272 |
62ffb79822d981638875c2c96fc9a9e675c79748 | 3,715 | py | Python | app/page.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/page.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/page.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.wait import WebDriverWait
from time import sleep
from locator import SearchPageLocators
from selenium.webdriver.support import expected_conditions as EC
import re
import logging
class BasePage(object):
"""Base class to initial... | 32.587719 | 104 | 0.616958 |
9ab3676f39fabd4469aacfb010690ee47a66a011 | 1,780 | py | Python | rateable/models.py | TheKiddos/StaRat | 33807d73276563f636b430e1bbfcb65b645869f7 | [
"MIT"
] | 1 | 2021-05-18T16:33:10.000Z | 2021-05-18T16:33:10.000Z | rateable/models.py | TheKiddos/StaRat | 33807d73276563f636b430e1bbfcb65b645869f7 | [
"MIT"
] | 3 | 2021-05-18T16:02:32.000Z | 2021-05-21T15:20:12.000Z | rateable/models.py | TheKiddos/StaRat | 33807d73276563f636b430e1bbfcb65b645869f7 | [
"MIT"
] | 1 | 2021-09-12T22:56:09.000Z | 2021-09-12T22:56:09.000Z | from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.db.models import Avg
from django.conf import settings
from rest_framework.reverse import reverse
class Rateable(models.Model):
"""An entity that can have ratings"""
owner = models.ForeignKey(
... | 30.169492 | 122 | 0.655056 |
9ab76bacc8fb751faa0409192bd916090f58cf3c | 617 | py | Python | src/onegov/core/security/permissions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/permissions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/permissions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ OneGov uses a very simple permissions model by default. There are no
read/write permissions, just intents. That means a permission shows the
intended audience.
This is the default however, any application building on top of onegov.core
may of course introduce its own byzantine permission system.
"""
class Publi... | 24.68 | 75 | 0.719611 |
491afa5c6dbe5f07f02c01bc737c15ae32abfcd1 | 10,108 | py | Python | zugdaten/upload_zugdaten_db.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | zugdaten/upload_zugdaten_db.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | zugdaten/upload_zugdaten_db.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | """ Importiert die Backups aus dem Speicher und
uploaded tageweise in amazon s3 """
import os
import re
import pandas as pd
from datetime import datetime
# compatibility with ipython
try:
__IPYTHON__
os.chdir(os.path.dirname(__file__))
except: pass
from db import DatabaseWrapper
import json
import boto3
from pa... | 33.359736 | 118 | 0.64167 |
625e8653e9d2e4cfd12317067482daeb64b853bd | 371 | py | Python | scripts/fabsp/mariadb.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/mariadb.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/mariadb.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*
from fabric.api import sudo, settings
def install():
"""
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
yum install -y MariaDB-server
"""
with settings(warn_only=True):
for line in install.__doc__.split("\n"):
... | 18.55 | 81 | 0.601078 |
f3206b885f9ac6e52e93d4b6269dff34b13370c9 | 354 | py | Python | PINp/2015/DANILENKOV_M_A/task_5_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/DANILENKOV_M_A/task_5_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/DANILENKOV_M_A/task_5_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5. Вариант 27.
#Напишите программу, которая бы при запуске случайным образом отображала название одного из семи дней недели.
# Danilenkov M.A.
import random
week = ("Понедельник", "Вторник","Среда", "Четверг",
"Пятница", "Суббота","Воскресенье")
randmonth = random.choice(week)
print(randweek)
inpu... | 27.230769 | 109 | 0.725989 |
b2a12594eedc21de62ffa561a552f418f628639c | 1,844 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/tunning.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/tunning.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/tunning.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import time
from visual import *
import math
import argparse
import marsyas
import marsyas_util
if __name__ == "__main__":
notenames = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#']
pitch=440.0
parser = argparse.ArgumentParser(description='Instrument tunning software built... | 32.928571 | 96 | 0.706074 |
a24b06add70c9b4c6c3107d76744ec673da3b772 | 334 | py | Python | 01_class/base_model.py | wuyueCreator/python-test | 6072ac9264a257c89925469238c14fff3bda5630 | [
"MIT"
] | 1 | 2019-03-25T03:44:54.000Z | 2019-03-25T03:44:54.000Z | 01_class/base_model.py | wuyueCreator/python-test | 6072ac9264a257c89925469238c14fff3bda5630 | [
"MIT"
] | null | null | null | 01_class/base_model.py | wuyueCreator/python-test | 6072ac9264a257c89925469238c14fff3bda5630 | [
"MIT"
] | null | null | null | from abc import abstractmethod
class BaseModel:
_subclass_basename = ''
@property
def name(self):
return self._subclass_basename[:-3]
@abstractmethod
def init_subclass_basename(self):
pass
def __call__(self, *args, **kwargs):
self.init_subclass_basename()
ret... | 18.555556 | 43 | 0.655689 |
0c20d8fd5064bd0f0a2a30d7f5a115da93357f5e | 1,346 | py | Python | SoSe-21/Uebung-3/A2-BMI-extended.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-3/A2-BMI-extended.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-3/A2-BMI-extended.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Aufgabe 2 - Übung 3
#
# Erweitern Sie das BMI-Programm aus der Vorlesung und geben Sie zusätzlich die folgende Interpretation aus:
# BMI < 18.5 Untergewicht
# BMI 18.5 - 24.9 Normalgewicht
# BMI 25.0 - 29.9 Übergewicht
# BMI > 30.0 Adipositas
#
# BMI = masse / (körpergröße zum quadrat in m)
untergewicht = 18.5
norma... | 33.65 | 108 | 0.739227 |
ce14a362640cec10ec643cffad8d61cc00fbcc6a | 6,373 | py | Python | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/lora_link_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/lora_link_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/lora_link_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from network import LoRa
#from gossip_layer import Gossip
import socket
import time
import os
import _thread
import binascii
class Lora_Link_Layer:
def __init__(self, receive_msg_cb):
print("Initializing Link Layer...")
self.receive_msg_cb = receive_msg_cb
self.msg_buffer_list = []
... | 36.83815 | 182 | 0.613526 |
5a15089b2990c312c36a0f1524cf6d1a7932dd9a | 876 | py | Python | generate_mkdocs_yml.py | SaschaMzH/hucon | 830b6c5e21c2c7316c61e8afdf708066374b9b62 | [
"BSD-3-Clause"
] | 2 | 2019-09-25T13:39:22.000Z | 2019-09-26T10:06:13.000Z | generate_mkdocs_yml.py | SaschaMzH/hucon | 830b6c5e21c2c7316c61e8afdf708066374b9b62 | [
"BSD-3-Clause"
] | 44 | 2019-09-25T14:35:48.000Z | 2021-08-20T17:26:12.000Z | generate_mkdocs_yml.py | SaschaMzH/hucon | 830b6c5e21c2c7316c61e8afdf708066374b9b62 | [
"BSD-3-Clause"
] | 8 | 2019-09-25T13:53:07.000Z | 2022-02-24T19:23:44.000Z | #!/usr/bin/env python3
""" generate_mkdocs_yml.py - Generate the mkdocs config files for the different
languages based on the config template and doc config json file.
Copyright (C) 2020 Basler AG
All rights reserved.
This software may be modified and distributed under the ter... | 32.444444 | 93 | 0.649543 |
0caa775e1ef26794c6295f90e2b9ebc5b2b107cc | 14,977 | py | Python | mbman.py | ingank/MBManPy | 1f136f474d92ca81e87ab8e785b44655c2607d68 | [
"MIT"
] | null | null | null | mbman.py | ingank/MBManPy | 1f136f474d92ca81e87ab8e785b44655c2607d68 | [
"MIT"
] | null | null | null | mbman.py | ingank/MBManPy | 1f136f474d92ca81e87ab8e785b44655c2607d68 | [
"MIT"
] | null | null | null | #
# mbman.py
#
# Eine Mailbox Management API in Python.
#
# 2021 by Ingolf Ankert
#
import imaplib
import email
import os
import re
#import dumper
class MBMan:
special_use = (
# have a look at RFC 6154
'All',
'Archive',
'Drafts',
'Flagged',
'Junk',
'Sent',... | 36.889163 | 139 | 0.583294 |
0b6dd175e44dc3810f109dba9813a4b5584b9568 | 2,336 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/remote_management/oneview/test_oneview_san_manager_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/remote_management/oneview/test_oneview_san_manager_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/remote_management/oneview/test_oneview_san_manager_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible_collections.community.general.tests.unit.compat import unittest
from .oneview_module_loader import SanManagerInfoModule
from .hpe_test_utils impo... | 33.855072 | 98 | 0.729452 |
f0415e199473fcca4b109fe91690a8d2bbf2b31e | 927 | py | Python | PMIa/2015/NIKISHIN_P_S/task_4_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/NIKISHIN_P_S/task_4_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/NIKISHIN_P_S/task_4_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 4. Вариант 22.
# Напишите программу, которая выводит имя, под которым скрывается Самюэл Ленгхорн Клеменс. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти). Для хранения всех... | 42.136364 | 444 | 0.768069 |
b2d0cf015ec90cb9bc59fa61038f1efc74578f9b | 2,551 | py | Python | official/cv/centerface/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/centerface/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/centerface/src/dataset.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... | 44.754386 | 127 | 0.646805 |
e8f8e3d32403bd8f1b78903adbfae34034614740 | 1,191 | py | Python | tarefas-poo/lista-03/enigma/view/paineis/painel_cria_tabela.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/enigma/view/paineis/painel_cria_tabela.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/enigma/view/paineis/painel_cria_tabela.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5663
# Exercício Enigma
# --------------------------
# Classe que permite a criação de uma Tabela de Códigos.
#
from model.tabela_de_codigos import TabelaDeCodigos
class PainelCriaTabela:
def crie_pre_definida(self, iu):
print('- - - Criando Tabela de ... | 33.083333 | 75 | 0.580185 |
6845b2d9fc89a8b4bfeff3ccf7e332158ec4c90c | 14,667 | py | Python | python/DeepLearning/lesson1/week4/main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/DeepLearning/lesson1/week4/main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/DeepLearning/lesson1/week4/main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # 用于获取数据
import random
import matplotlib.pyplot as plt
import numpy as np
import lr_utils # 参见资料包,或者在文章底部copy
from dnn_utils import sigmoid, sigmoid_backward, relu, relu_backward # 参见资料包
np.random.seed(1)
def initialize_parameters(n_x, n_h, n_y):
"""
此函数是为了初始化两层网络参数而使用的函数。
参数:
n_x - 输入层节点数量
... | 26.911927 | 117 | 0.565896 |
6860336c83fa0b137dbb8fce287ac247bea03eac | 1,147 | py | Python | src/classifiers/itfidf_classifier.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/classifiers/itfidf_classifier.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/classifiers/itfidf_classifier.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from extras import Logger
from nltk import PorterStemmer
# Classify according to ITFIDF
class ITFIDFClassifier:
# Constructor for the ITFIDFClassifier
def __init__(self, dict_file):
dictionary_file = open... | 26.674419 | 78 | 0.651264 |
689d94e751ef30d69da55d49addb2bc5f6e26480 | 373 | py | Python | INBa/2015/Semyenov_A_N/task_5_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Semyenov_A_N/task_5_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Semyenov_A_N/task_5_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 5. Вариант 24
#Напишите программу, которая бы при запуске случайным образом отображала название одной из шести шахматных фигур.
#Semyenov A.N.
#28.03.2016
print("Программа выводит на экран название одной из шести шахматных фигур.")
import random
a = random.choice(['король', 'пешка', 'ферзь', 'ладья', 'конь', '... | 37.3 | 113 | 0.747989 |
041d68ff1de7bd9e12c256034ccdb2bbcfedb37a | 3,247 | py | Python | test/test_npu/test_network_ops/test_gather.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_gather.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_gather.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 42.168831 | 93 | 0.650755 |
5059f2c4b23ddea15cfe6f48d7368a244cba1c0a | 1,798 | py | Python | plugins/tff_backend/api/flow_statistics.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/api/flow_statistics.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/api/flow_statistics.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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... | 37.458333 | 105 | 0.754171 |
acc7233d5b60882691e40cfa213ab70523fe61f4 | 708 | py | Python | 112-path-sum/112-path-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 112-path-sum/112-path-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 112-path-sum/112-path-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # 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
class Solution:
def hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
ret... | 35.4 | 75 | 0.543785 |
a8c01691870ba42190c7a39fc016d408d69769f6 | 10,190 | py | Python | Classes/Screen_codes/Application.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Screen_codes/Application.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Screen_codes/Application.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z |
from PyQt5.QtWidgets import QApplication
import sys
import pygame
import ast
from Classes.Screen_codes.Bad_data_screen import Bad_data
from Classes.Screen_codes.Game_screen import Game
from Classes.Screen_codes.Login_screen import Login_screen
from Classes.Screen_codes.Options_screen import Options
from Classes.Screen... | 30.327381 | 75 | 0.620412 |
4f6de1a478c18c18b078bc1ad317d90747e10ce2 | 88 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/utils/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/utils/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/utils/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .variable_helper import MightAVariable, parse_function_in_variable, parse_variable
| 44 | 87 | 0.897727 |
4f8bd8705d504c660dbd998a20d77c6bd669df50 | 3,870 | py | Python | src/onegov/ballot/models/mixins.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/models/mixins.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/models/mixins.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import increment_name
from onegov.core.utils import normalize_for_url
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.hybrid import hybrid_property
class DomainOfInfluenceMixin(object):
""" Defines the scope ... | 28.666667 | 79 | 0.609044 |
50b10866ea39ecbd30c00f788c126bb4d0c79dbd | 4,270 | py | Python | Adaboost/adaboostMultiDimension.py | lance52587/MachineLearningNote | 0184f8de178990ee31ace2a43809830874313697 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | Adaboost/adaboostMultiDimension.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | Adaboost/adaboostMultiDimension.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | # -*- coding: utf-8 -*-
# @Author: Alan Lau
# @Date: 2018-09-24 17:05:38
import math
import numpy as np
from pprint import pprint
def load_simp_data():
data = np.matrix([[1, 2.1, 1],
[2, 1.1, 5],
[1.3, 1, 9],
[1, 1, 6],
[2, 1... | 31.62963 | 76 | 0.497892 |
50c79bd880866b16213bda7acc87feb80e2705ed | 307 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C07ObjectOrientedDesign/questions/7.12-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C07ObjectOrientedDesign/questions/7.12-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C07ObjectOrientedDesign/questions/7.12-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null |
'''
3. Design an ATM
Interviewers would want to see you discuss things like:
Overdrawing: What would you do when the ATM doesn’t have any cash left?
Pin Verification: What if a user enters a wrong PIN multiple times?
Card Reading: How would you detect if the card has been correctly inserted or not?
'''
| 27.909091 | 82 | 0.762215 |
e85a36d3d60ba142193872201e1b8d8751935cb6 | 22,649 | py | Python | Packs/Ansible_Powered_Integrations/Integrations/MicrosoftWindows/MicrosoftWindows.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Ansible_Powered_Integrations/Integrations/MicrosoftWindows/MicrosoftWindows.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Ansible_Powered_Integrations/Integrations/MicrosoftWindows/MicrosoftWindows.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import traceback
from typing import Dict, cast
import ansible_runner
import demistomock as demisto # noqa: F401
import ssh_agent_setup
from CommonServerPython import * # noqa: F401
# Dict to Markdown Converter adapted from https://github.com/PolBaladas/torsimany/
def dict2md(json_block, depth=0):
m... | 52.186636 | 110 | 0.641397 |
fa34cb7f897e5911d3b1d1681102670bf2ea2168 | 709 | py | Python | source/pkgsrc/lang/python36/patches/patch-Lib_ctypes_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python36/patches/patch-Lib_ctypes_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python36/patches/patch-Lib_ctypes_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_ctypes_____init____.py,v 1.1 2020/09/01 09:26:54 schmonz Exp $
Avoid MemoryError from "import ctypes" on OpenBSD.
--- Lib/ctypes/__init__.py.orig Sat Aug 15 06:43:26 2020
+++ Lib/ctypes/__init__.py
@@ -270,7 +270,8 @@ def _reset_cache():
# function is needed for the unittests on Win64 to succe... | 41.705882 | 81 | 0.713681 |
d704556d98320d6875213dfe2ee9bf0b52fcd15f | 3,531 | py | Python | bigbench/benchmark_tasks/program_synthesis/test.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 460 | 2021-01-26T21:23:37.000Z | 2022-03-31T15:55:10.000Z | bigbench/benchmark_tasks/program_synthesis/test.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 475 | 2021-01-27T01:29:01.000Z | 2022-03-30T20:23:56.000Z | bigbench/benchmark_tasks/program_synthesis/test.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 305 | 2021-01-26T23:28:11.000Z | 2022-03-31T14:51:26.000Z | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 34.617647 | 111 | 0.73407 |
0f3930a14b53220a99b110be70feecb035cb07b9 | 1,800 | py | Python | src/Raspberry Pi/Sensors/SensorTest.py | Air92/AtmosphericPollutionCollecting | 9c152b2d961535fa1e1b87f1d7c47f25573f7ca7 | [
"MIT"
] | 1 | 2018-06-07T21:54:56.000Z | 2018-06-07T21:54:56.000Z | src/Raspberry Pi/Sensors/SensorTest.py | Air92/AtmosphericPollutionCollecting | 9c152b2d961535fa1e1b87f1d7c47f25573f7ca7 | [
"MIT"
] | 1 | 2018-01-26T16:13:15.000Z | 2018-01-26T18:39:26.000Z | src/Raspberry Pi/Sensors/SensorTest.py | Air92/AtmosphericPollutionCollecting | 9c152b2d961535fa1e1b87f1d7c47f25573f7ca7 | [
"MIT"
] | 5 | 2017-11-20T09:39:07.000Z | 2019-10-28T13:10:50.000Z | from gasSensor import gasDensity
from tempSensor import getTemperature, getHumidity
from LCDScreen import LCDSetText, ClearScreen
from LightSensor import LightSensor
import time
def setText(t):
try:
LCDSetText(t)
except IOError:
print "error"
print ("===========TESTING GAS SENSOR=============")
setText("TESTI... | 29.032258 | 67 | 0.533333 |
7e283bc237f7ef95f43d557c3a6b62ff5cbb9ea6 | 635 | py | Python | novel/swallows/the_swallows.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/swallows/the_swallows.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/swallows/the_swallows.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # coding=utf-8
# !/usr/bin/env python
# swallows 信以为真的
import sys
from os.path import realpath, dirname, join
# 把 ../src/ 文件夹加入python模块搜索路径
sys.path.insert(0, join(dirname(realpath(sys.argv[0])), '..', 'src'))
from novel.swallows.engine.events import Publisher
# 在world中构建了整个世界
from novel.swallows.story.world impor... | 17.162162 | 69 | 0.669291 |
7e3d8855245b03548c9d90dd7d8de379090c0cd7 | 12,272 | py | Python | Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/NationalVulnerabilityDatabaseFeed/Integrations/NationalVulnerabilityDatabaseFeed/NationalVulnerabilityDatabaseFeed.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
from typing import Dict, Any, List
from datetime import datetime, timedelta
from time import sleep
# Disable insecure warnings
requests.packages.urllib3.disable... | 35.062857 | 119 | 0.53618 |
0e4b4b98373961b8287cc445e5df2453afe531a7 | 762 | py | Python | etc code/graph.py | gusghrlrl101/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 11 | 2019-06-17T02:59:01.000Z | 2021-05-24T14:10:04.000Z | etc code/graph.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | null | null | null | etc code/graph.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 3 | 2019-06-17T02:59:32.000Z | 2019-07-03T04:31:30.000Z | # -*- Encoding:UTF-8 -*- #
import pickle
import sys
import json
import os
from glob import glob
num = []
txt_paths = sorted(glob.glob('*[0-9].pkl'))
for ind, txt_path in enumerate(txt_paths):
#file isn't exist
if(os.path.isfile(txt_path[:-4] + '.txt') == False):
with open(txt_path,'rb') as f:
data = pickle.load... | 23.090909 | 53 | 0.624672 |
7ed62b5f7a25c1085234a17fac768f51f91a994f | 595 | py | Python | src/lecture3_new/exp_svm/main.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture3_new/exp_svm/main.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture3_new/exp_svm/main.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import configparser
import sys
sys.path.append("..")
from exp_svm import test_svm
def set_config():
#read config file
config = configparser.ConfigParser()
config.readfp(open('config.ini'))
ipath = config.get("user_para","ipath")
lpath = config.get("user_para","lpath")
save_fig_path = config.get... | 28.333333 | 60 | 0.707563 |
70e8c441da5b99934cc7b99309c23bbe984f94ee | 3,691 | py | Python | workspace/cogrob/service_manager/util/errors.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 8 | 2019-05-07T02:30:58.000Z | 2021-12-10T18:44:45.000Z | workspace/cogrob/service_manager/util/errors.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 1 | 2021-03-17T07:18:23.000Z | 2021-03-17T07:18:23.000Z | workspace/cogrob/service_manager/util/errors.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 2 | 2019-05-21T14:15:24.000Z | 2022-02-09T12:50:24.000Z | # Copyright (c) 2019, The Regents of the University of California
# 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, thi... | 43.423529 | 79 | 0.791655 |
cb8842f402cb485965e13689415ce8c254cc0e43 | 30,325 | py | Python | APS/scripts/draw_figs.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | APS/scripts/draw_figs.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | APS/scripts/draw_figs.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import subprocess
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
import matplotlib.ticker as ticker
import random
matplotlib.use("pdf")
from tabulate import tabulate
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import os
from sklearn import linear_model
datasets = [
"ca... | 34.657143 | 123 | 0.618895 |
383ca5a14becdbb38255c09f75804f0b6c46a769 | 9,275 | py | Python | python-bildungslogin/ucs-test/97_bildungslogin_python/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/ucs-test/97_bildungslogin_python/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/ucs-test/97_bildungslogin_python/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | #!/usr/share/ucs-test/runner /usr/bin/py.test -s
# -*- coding: utf-8 -*-
#
# Copyright 2021 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by t... | 29.258675 | 96 | 0.637736 |
0e0f44bc0a6a96c492532ce49293e2f9d04673ea | 592 | bzl | Python | tools/platforms/configs/empty-versions.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 703 | 2018-11-05T22:51:58.000Z | 2022-03-31T21:54:22.000Z | tools/platforms/configs/empty-versions.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 720 | 2018-11-05T21:29:49.000Z | 2022-03-29T19:43:50.000Z | tools/platforms/configs/empty-versions.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 99 | 2018-11-06T22:20:08.000Z | 2022-03-16T12:50:35.000Z | # Generated file, do not modify by hand
"""Definitions to be used in rbe_repo attr of an rbe_autoconf rule """
_TOOLCHAIN_CONFIG_SPECS = []
_BAZEL_TO_CONFIG_SPEC_NAMES = {}
LATEST = ""
CONTAINER_TO_CONFIG_SPEC_NAMES = {}
_DEFAULT_TOOLCHAIN_CONFIG_SPEC = ""
TOOLCHAIN_CONFIG_AUTOGEN_SPEC = struct(
bazel_to_config_sp... | 39.466667 | 72 | 0.8125 |
388183451d37db4722d527b99e7842998cf6dd9a | 6,996 | py | Python | main.py | Salafi9/imeisender | 45071809dd1a0f1205ba4fb7d00cb17c6a530d23 | [
"MIT"
] | 1 | 2018-06-30T17:47:55.000Z | 2018-06-30T17:47:55.000Z | main.py | Salafi9/imeisender | 45071809dd1a0f1205ba4fb7d00cb17c6a530d23 | [
"MIT"
] | null | null | null | main.py | Salafi9/imeisender | 45071809dd1a0f1205ba4fb7d00cb17c6a530d23 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 by your name. All Rights Reserved.
__author__ = 'Ahmad Abdulnasir <dabolinux@gmail.com> www.dabolinux.com'
__copyright__ = 'Copyright (c) 2016, salafi'
__version__ = "3.1"
import sqlite3
import sys
import os
import time
import android
from random import randint as ran
droid = android.Android()
d... | 27.116279 | 80 | 0.565037 |
2a4e028d8942a3de2eeb5d9ca3d5318c0af17ec2 | 619 | py | Python | src/Sephrasto/CharakterNotizWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterNotizWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterNotizWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | from PyQt5 import QtWidgets, QtCore
import UI.CharakterNotiz
import lxml.etree as etree
import logging
from Wolke import Wolke
class CharakterNotizWrapper(QtCore.QObject):
modified = QtCore.pyqtSignal()
def __init__(self):
super().__init__()
self.form = QtWidgets.QWidget()
self.ui = UI... | 29.47619 | 62 | 0.704362 |
2a50e22eb669c8afc6ca51ef1e56ae7fb968aade | 1,162 | py | Python | BITs/2014/Kozlov_A_D/task_9_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Kozlov_A_D/task_9_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Kozlov_A_D/task_9_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 9. Вариант 11.
#1-50. Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробов... | 33.2 | 316 | 0.618761 |
aab188626b1a93ac2e0c1d33598c80c765eaeecf | 22 | py | Python | RDS/circle3_central_services/token_storage/src/api/Service/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/port/src/api/User/Service/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/token_storage/src/api/Service/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from .Service import * | 22 | 22 | 0.772727 |
2aa9cf56ae953d5ce43ea2903d77fb362285bd15 | 4,094 | py | Python | migrations/versions/1fb9f679defb_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/1fb9f679defb_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/1fb9f679defb_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: 1fb9f679defb
Revises: b1a6e7630185
Create Date: 2021-02-07 17:54:44.257540
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "1fb9f679defb"
down_revision = "b1a6e7630185"
branch_lab... | 40.94 | 88 | 0.656326 |
63093e5f9187c1f940f95f42ea45b37fa00b707d | 2,120 | bzl | Python | tools/build_rules/shims.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 1,168 | 2015-01-27T10:19:25.000Z | 2018-10-30T15:07:11.000Z | tools/build_rules/shims.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 2,811 | 2015-01-29T16:19:04.000Z | 2018-11-01T19:48:06.000Z | tools/build_rules/shims.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 165 | 2015-01-27T19:06:27.000Z | 2018-10-30T17:31:10.000Z | load("@bazel_gazelle//:deps.bzl", _go_repository = "go_repository")
load("@io_bazel_rules_go//go:def.bzl", _go_binary = "go_binary", _go_library = "go_library", _go_test = "go_test")
def go_repository(name, **kwargs):
"""Macro wrapping the Gazelle go_repository rule.
This conditionally defines the repository ... | 32.615385 | 114 | 0.666038 |
933ce2281df6f3a3769b6166d0e67f943e0d46fa | 18,866 | py | Python | ETL.py | HerrMoch/ETL-SCD-prototype | 01d983c69cf4e51c7b94514bfe22791edb48566e | [
"MIT"
] | null | null | null | ETL.py | HerrMoch/ETL-SCD-prototype | 01d983c69cf4e51c7b94514bfe22791edb48566e | [
"MIT"
] | null | null | null | ETL.py | HerrMoch/ETL-SCD-prototype | 01d983c69cf4e51c7b94514bfe22791edb48566e | [
"MIT"
] | null | null | null | from datetime import date, timedelta
from decimal import Decimal
from sqlalchemy import Table, Column
from sqlalchemy import create_engine, and_, func
from sqlalchemy.engine.base import Connection
import pandas as pd
from DatabaseMeta import DatabaseMeta
class ETLPipeline:
# TWODIGITS = Decimal('0.01')
def ... | 52.551532 | 120 | 0.555338 |
faa4ecf2b752e8fa7143b923d0d95fff8c499ead | 8,947 | py | Python | library/core/controls.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | 1 | 2017-08-09T23:15:15.000Z | 2017-08-09T23:15:15.000Z | library/core/controls.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | library/core/controls.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | import os
from PySide.QtCore import QObject,QThread
from .ptprocess import PtProcess
from .utils import PtSignal,makeDir,unzip
from PySide.QtCore import *
import zipfile
cmd_list_port = 'netstat -nao | findstr ":%d.*LISTENING"'
cmd_kill_port = "taskkill /PID %d /F"
cmd_chek_running = 'tasklist /FO csv /FI "IMAGENAME eq... | 35.503968 | 105 | 0.598413 |
87a9720ddfd20367b78eb2ebb8ef3cf717897483 | 7,023 | py | Python | backend/api/permissions.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/permissions.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/permissions.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | import json
import base64
from django.conf import settings
from rest_framework import permissions
from rest_framework import exceptions
class KeycloakRolePermissions(permissions.BasePermission):
def has_permission(self, request, view):
#region (A) Get jwt out of http-header...
# -----------------... | 58.041322 | 312 | 0.515449 |
ea0302b3d448973149909d599a7f422349265f6e | 1,226 | py | Python | Guehring/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | Guehring/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | Guehring/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | import numpy as np
import sys
def RepresentsInt(s):
try:
int(s)
return True
except ValueError:
return False
def RepresentsFloat(s):
try:
float(s)
return True
except ValueError:
return False
filename = sys.argv[1]
f = open(filename)
loc1 = []
loc2 = []
c... | 28.511628 | 76 | 0.550571 |
ea1134cffe513bba8d0f6e4859589ec7a3877e18 | 675 | py | Python | myems-api/test_database.py | 18600575648/myems | 38ab7d509b5ab275a4df0333e6256c586abdfbf9 | [
"MIT"
] | null | null | null | myems-api/test_database.py | 18600575648/myems | 38ab7d509b5ab275a4df0333e6256c586abdfbf9 | [
"MIT"
] | null | null | null | myems-api/test_database.py | 18600575648/myems | 38ab7d509b5ab275a4df0333e6256c586abdfbf9 | [
"MIT"
] | null | null | null | import mysql.connector
import config
if __name__ == "__main__":
cursor = None
cnx = None
try:
cnx = mysql.connector.connect(**config.myems_system_db)
cursor = cnx.cursor()
query = (" SELECT version "
" FROM tbl_versions "
" WHERE id = 1 ")
... | 25 | 65 | 0.536296 |
576095c2c70f9d9c5fcdfb66c981c9706c834ab8 | 2,262 | py | Python | handlemoursedata/com/aaron/dao/base_dao.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | handlemoursedata/com/aaron/dao/base_dao.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | handlemoursedata/com/aaron/dao/base_dao.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Created on 2019-04-20
@FileName: base_dao.py
@Description: 基础dao
@author: 'Aaron.Qiu'
@version V1.0.0
'''
from sqlalchemy import create_engine,Column,String,Integer,ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker,relationship
'''
#... | 29 | 190 | 0.731211 |
57a0a7b30e40b0704b79fffcee376465eed89aca | 1,796 | py | Python | test/test_npu/test_network_ops/test_yolo_boxes_encode.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_yolo_boxes_encode.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_yolo_boxes_encode.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 44.9 | 105 | 0.722717 |
17af8efaa375cd4a84b8daa1fbc9a7bd018e1911 | 2,488 | py | Python | project/api/news_feed/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/news_feed/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/news_feed/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from marshmallow import fields, validate
from marshmallow_enum import EnumField
from project.api import marshmallow
from project.api.place.schemas import PlaceRefSchema, PlaceWriteIdSchema
from project.api.schemas import (
IdSchemaMixin,
PaginationRequestSchema,
PaginationResponseSchema,
SQLAlchemyBase... | 28.272727 | 84 | 0.749196 |
109f35cee647467d40c4e84b4652953a21497dcb | 683 | py | Python | lego/calculus/nodes/negate.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/negate.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/negate.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | """Negation node"""
from . import node, number
class Negate(node.Node):
"""Negation node"""
def __init__(self, arg):
self.arg = arg
def copy(self):
return Negate(self.arg.copy())
def evaluate(self, value):
return -self.arg.evaluate(value)
def diff(self):
return... | 20.088235 | 50 | 0.578331 |
5e077034a2ed0457255487bc26f11e1b4156a50d | 8,543 | py | Python | brick/template.py | xsank/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 9 | 2015-01-06T01:32:43.000Z | 2017-03-01T18:34:54.000Z | brick/template.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | null | null | null | brick/template.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 4 | 2015-02-05T09:48:43.000Z | 2016-02-22T15:04:35.000Z | '''
Created on 2013-4-21
@author: Xsank
'''
import os
import re
import tokenize
from exception import TemplateError
from util import tou,abort,html_escape
from config import TEMPLATES,TEMPLATE_PATH,DEBUG
class BaseTemplate(object):
extentions = ['tpl','html']
settings = {}
defaults = {}
def __ini... | 38.309417 | 93 | 0.507199 |
dc575214be056a34862bfb248350f2397e340ecf | 1,527 | py | Python | poisonous-plants.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | poisonous-plants.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | poisonous-plants.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | #!/bin/python3
def poisonousPlants(p):
# Complete this function
survives = list()
survives.append(p[0])
dies = list()
num_plants = len(p)
p_killed = [0]*num_plants
killed_day = [0]*num_plants
for i in range(1,num_plants):
if(p[i] > p[i - 1]):
if(p_killed[i - 1] == 1)... | 29.941176 | 80 | 0.43353 |
87051dbe198e19b1386c159424b19852c7e6d069 | 295 | py | Python | Crashkurs Python/12_Sets Lottozahlen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | 2 | 2020-03-23T14:57:50.000Z | 2021-03-24T18:12:07.000Z | Crashkurs Python/12_Sets Lottozahlen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs Python/12_Sets Lottozahlen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | a = [1, 2, 4, 2, 8, 1, 1]
# Sets speichern nichts doppelt
s = set()
for i in a:
s.add(i)
print(s)
s2 = set(a)
print(s2)
# Lottozahlen 6 aus 45:
import random as rnd
lotto = set()
#randrange ist wie in C# und Java
while len(lotto) != 6:
lotto.add(rnd.randint(1,45))
print(lotto)
| 11.8 | 33 | 0.613559 |
1d1bfff2c29bbdbbaf1080aa928296ebdf07c8d8 | 217 | py | Python | Licence 2/I33/TP 3/ex_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 3/ex_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 3/ex_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | log_table = []
alpha_table = []
def multiplie(x, y, P):
if x == 0 or y == 0:
return 0
P_deg = len(bin(P)) - 3
i, j = log_table[x], log_table[y]
return alpha_table[(i + j) % ((1 << P_deg)-1)]
| 19.727273 | 50 | 0.511521 |
8991102eec6934df32d2c4e8b5e09eb2855fadde | 1,030 | py | Python | exercises/pt/exc_04_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/exc_04_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/exc_04_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import json
from spacy.matcher import Matcher
from spacy.lang.en import English
with open("exercises/en/iphone.json", encoding="utf8") as f:
TEXTS = json.loads(f.read())
nlp = English()
matcher = Matcher(nlp.vocab)
pattern1 = [{"LOWER": "iphone"}, {"LOWER": "x"}]
pattern2 = [{"LOWER": "iphone"}, {"IS_DIGIT": True... | 36.785714 | 100 | 0.708738 |
f6b66be55f9ff3124a1d737ae76bd5fb7c73d53c | 19,445 | py | Python | src/onegov/ballot/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains upgrade tasks that are executed when the application is being
upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`.
"""
from onegov.ballot import Election
from onegov.ballot import Vote
from onegov.ballot.models.election.election_compound import \
ElectionCompoundAssociation, Election... | 35.744485 | 79 | 0.640885 |
d61130d84be24316e5e228d1e98b20d1ab31480a | 6,091 | py | Python | ppi_finder.py | LCBRU/ppi_finder | cc76c6fd693ce16efa85fea884a2054ef892dc29 | [
"MIT"
] | null | null | null | ppi_finder.py | LCBRU/ppi_finder | cc76c6fd693ce16efa85fea884a2054ef892dc29 | [
"MIT"
] | null | null | null | ppi_finder.py | LCBRU/ppi_finder | cc76c6fd693ce16efa85fea884a2054ef892dc29 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import csv
import re
from datetime import datetime, date
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
def main():
parser = argparse.ArgumentParser()
parser.add_argument('inputfile', nargs=1, type=argparse.FileType('r'))
parser.ad... | 31.076531 | 204 | 0.548678 |
f61a6fcbb61b4d528e6e0555484bf55886e2dcd8 | 1,150 | py | Python | Txt.BoardGame/tools/genSingleView.py | okard/depot | ac10c2388799a76bfabf9ddf20b11cd2c516bcab | [
"MIT"
] | null | null | null | Txt.BoardGame/tools/genSingleView.py | okard/depot | ac10c2388799a76bfabf9ddf20b11cd2c516bcab | [
"MIT"
] | null | null | null | Txt.BoardGame/tools/genSingleView.py | okard/depot | ac10c2388799a76bfabf9ddf20b11cd2c516bcab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import re
from lib.SvgWriter import SvgWriter
from lib.Token import TokenDB, Token
from lib.TokenWriter import writeTokenFront, writeTokenBack
if len(sys.argv) < 3:
sys.exit("Usage: genLibrary TokenDB.txt path/template_{id}.svg")
print("Create svg library...")
#the f... | 23.958333 | 124 | 0.678261 |
9cdfa0781c58f28772a5c23b9f49c789558dcf54 | 1,266 | py | Python | flask/microblog-db/app/main/errors.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | flask/microblog-db/app/main/errors.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | flask/microblog-webform/app/main/errors.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Created on 2016年04月15日
@FileName: errors.py
@Description: (描述)
@author: 'Aaron.Qiu'
@version V1.0.0
File main/errors.py
'''
import os
from flask import render_template
from . import main
def site_get():
meminfo = {}
# with open('/proc/meminfo') as f:
# for line in f:
... | 23.018182 | 88 | 0.618483 |
2efe6fb7b9a20f90af96afb8fd417879a180fe2b | 308 | py | Python | storage/emulated/0/qpython/scripts3/testcurses.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/scripts3/testcurses.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/scripts3/testcurses.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | import androidhelper
import curses
droid = androidhelper.Android()
win=curses.initscr()
result="No result"
try:
win.box()
w,h=win.getmaxyx()
win.addstr(2,2,"Curses Test %sx%s" % (w,h))
win.addstr(10,10,"Hit a key")
win.getch()
finally:
curses.endwin()
print("Result=",result)
| 18.117647 | 46 | 0.642857 |
25909b63de1173e30fafe12e64a1c96a630f768a | 27,871 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_ocspower.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_ocspower.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_ocspower.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... | 43.822327 | 159 | 0.583653 |
d3625c9bf4b716f72a33f364650807bf907cddb6 | 1,907 | py | Python | m0leCon/2021/Quals/web/Waffle/waf.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | m0leCon/2021/Quals/web/Waffle/waf.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | m0leCon/2021/Quals/web/Waffle/waf.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from flask import Flask, Response, request, jsonify
from urllib.parse import unquote
import requests
import json
import os
app = Flask(__name__)
appHost = 'http://'+os.environ['APP_HOSTNAME']+':10000/'
@app.route('/', defaults={'path': ''}, methods=['GET'])
@app.route('/<path:path>', methods=['GET'])
... | 28.462687 | 91 | 0.576822 |
9f1fc410d5cc2b8ab459e7e6e6bc92d02ce72ca6 | 919 | py | Python | note/regex.py | Jeson1g/Dawson | b65f2347110cf56d13e9fcf8f08a3b38af53af77 | [
"MIT"
] | 2 | 2018-06-19T08:46:10.000Z | 2018-11-05T02:15:34.000Z | note/regex.py | Jeson1g/Dawson | b65f2347110cf56d13e9fcf8f08a3b38af53af77 | [
"MIT"
] | null | null | null | note/regex.py | Jeson1g/Dawson | b65f2347110cf56d13e9fcf8f08a3b38af53af77 | [
"MIT"
] | null | null | null | import re
# 正则表达式的分组
ret = re.match(r"<(?P<regex1>\w*)>\w*</(?P=regex1)>", "<html>books</html>")
print(ret.group())
# search只匹配一个
ret = re.search(r"\d+", "阅读次数为 9999")
# findall匹配全文,返回的是一个列表
ret1 = re.findall(r"\d+", "python = 9999, c = 7890, c++ = 12345")
# sub将匹配到的数据进行替换,第二个参数还可以接收一个函数对象
ret2 = re.sub(r"\d+", '9... | 22.975 | 75 | 0.611534 |
e278137091601af227c885cd216da8ebc16d98a3 | 1,680 | py | Python | AP8/paper/csv-line-plot/get_correlation.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 6 | 2016-08-15T17:57:45.000Z | 2019-03-19T05:08:29.000Z | AP8/paper/csv-line-plot/get_correlation.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 10 | 2016-04-11T10:20:34.000Z | 2016-08-09T21:47:48.000Z | AP8/paper/csv-line-plot/get_correlation.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 7 | 2016-06-21T04:08:58.000Z | 2018-09-01T14:02:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Get the correlation of F1 score and accuracy."""
import os
import csv
from scipy.stats.stats import pearsonr
from os import listdir
from os.path import isfile, join
def main(filename):
onlyfiles = [f for f in listdir(filename) if isfile(join(filename, f)) and f.e... | 25.846154 | 98 | 0.58631 |
2cbaacf021f85472c578fa730b7e198ba981dd8e | 1,511 | py | Python | 7-assets/_SNIPPETS/bryan-guner-gists/_python/unique.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 3 | 2021-04-25T20:07:31.000Z | 2021-08-31T00:57:44.000Z | 7-assets/_SNIPPETS/bryan-guner-gists/_python/unique.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 28 | 2021-04-06T06:17:02.000Z | 2021-05-07T10:03:43.000Z | 7-assets/_SNIPPETS/bryan-guner-gists/_python/unique.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Playing around with slightly various ways to simulate uniq in Python.
The different strategies are timed.
Only m1() and m2() do not change the order of the data.
`in` is the input file, `out*` are output files.
"""
infile = 'in' # Change filename to suit your needs.
def m1():
s = set()
... | 24.770492 | 83 | 0.583058 |
3928bf71741e47a34055d030c531443abfbb1ac6 | 1,558 | py | Python | MageClass.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | MageClass.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | MageClass.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | from Character import Character
from data import features
class MageClass(Character):
def __init__(self, params):
super().__init__(params)
# self.spell_book = params['spell_book']
# self.mana = params['mana']
# # ######################### Methoden ###############################
... | 33.148936 | 112 | 0.471759 |
03cbb365c4700ea5643d0c5410f434a67832ba83 | 247 | py | Python | leetcode/217-Contains-Duplicate/ContainDup_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/217-Contains-Duplicate/ContainDup_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/217-Contains-Duplicate/ContainDup_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[]} nums
# @return {boolean}
def containsDuplicate(self, nums):
tb = set()
for n in nums:
if n in tb:
return True
tb.add(n)
return False
| 20.583333 | 38 | 0.481781 |
20eaf5013ce938efa5ce9d00ec7acc9bf873f55b | 3,086 | py | Python | zencad/animate.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/animate.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/animate.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import time
import traceback
import sys
import zencad
class AnimationState:
def __init__(self, widget):
self.widget = widget
self.start_time = time.time()
self.time = time.time()
self.last_time = t... | 27.309735 | 69 | 0.553791 |
440b8b8e8c579c9846e1a0715053c8f01d188fa7 | 645 | py | Python | sum-of-left-leaves/sum-of-left-leaves.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | sum-of-left-leaves/sum-of-left-leaves.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | sum-of-left-leaves/sum-of-left-leaves.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # 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
class Solution:
def sumOfLeftLeaves(self, root: Optional[TreeNode]) -> int:
stack=[(root, 1)]
output=0
... | 32.25 | 63 | 0.527132 |
446aed2700b3b0680f4b9fbc23689e3d28a403ea | 766 | py | Python | Course_1/Week_01/MySort_Zhiyuan.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | Course_1/Week_01/MySort_Zhiyuan.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | 1 | 2020-07-16T08:03:22.000Z | 2020-07-16T08:09:34.000Z | Course_1/Week_01/MySort_Zhiyuan.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | def MySort(UnsortedArray):
n=len(UnsortedArray)
if n==1:
SortedArray=UnsortedArray
else:
midpoint=n//2
Array1=MySort(UnsortedArray[0:midpoint])
Array2=MySort(UnsortedArray[midpoint:n])
i=0;
j=0;
SortedArray=[]
while i<midpoint and j<n-midpoint:... | 28.37037 | 79 | 0.544386 |
4496853402fd23eae582d24fbf71eceb5ea2cc61 | 407 | py | Python | exercises/ja/exc_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.ja import Japanese
nlp = Japanese()
# テキストを処理
doc = nlp(
"1990年には東アジアの60%以上の人々が極度の貧困状態に陥っていました。"
"今では4%以下になっています。"
)
# docに含まれるトークンを処理
for token in doc:
# トークンが数字に似ているかどうかをチェック
if ____.____:
# docの次のトークンを取得
next_token = ____[____]
# 次のトークンの文字列が「%」に一致するかどうかをチェック... | 20.35 | 50 | 0.641278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.