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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a0703523d6d75688982522807b6d02fea7e6fbcc | 932 | py | Python | bot/exts/backend/error_handler.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/backend/error_handler.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/backend/error_handler.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import random
import discord
from discord.ext import commands
from discord.ext.commands import errors
from bot.bot import Bot
from bot.constants import ERROR_REPLIES
class ErrorHandler(commands.Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot
@commands.Cog.listener()
async def on_comm... | 30.064516 | 82 | 0.695279 |
cd48a5449aca43e0ef0a71bc3ad4561bef072859 | 410 | py | Python | api/style/text_style.py | singhprincejeet/in_poster | 1b0e18631ebede94e679eb0aba6c8e7630a02aba | [
"MIT"
] | null | null | null | api/style/text_style.py | singhprincejeet/in_poster | 1b0e18631ebede94e679eb0aba6c8e7630a02aba | [
"MIT"
] | 4 | 2021-04-30T21:09:19.000Z | 2022-03-12T00:19:12.000Z | api/style/text_style.py | singhprincejeet/in_poster | 1b0e18631ebede94e679eb0aba6c8e7630a02aba | [
"MIT"
] | null | null | null | from PIL import ImageFont
class TextStyle:
def __init__(self, size, align, color):
self.size = size
self.align = align
self.color = color
def get_font(self):
return ImageFont.truetype('assets/fonts/TravelingTypewriter.ttf', size=self.size)
def get_align(se... | 19.52381 | 90 | 0.609756 |
cd7a6b7598a87f7c6ed8f2d928f4aae76f5dc846 | 12,364 | py | Python | tests/onegov/election_day/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os
import transaction
import yaml
from click.testing import CliRunner
from datetime import date
from datetime import datetime
from datetime import timezone
from onegov.ballot import Ballot
from onegov.ballot import BallotResult
from onegov.ballot import Vote
from onegov.core.cli.commands import cli as core_cli
... | 35.631124 | 78 | 0.579424 |
f8a9b9ae6da393eb8777726c89ba7c64697806f9 | 7,014 | py | Python | src/bias_mitigator/eval_triggers.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/bias_mitigator/eval_triggers.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/bias_mitigator/eval_triggers.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | """Script to evaluate generated triggers (with regard classifier)."""
import os, sys
import re
import hydra.utils
from transformers import AutoTokenizer
from omegaconf import DictConfig
from src.bias_mitigator.sample_from_gpt2 import sample
from src.bias_mitigator.get_model_distrib import get_distribution, plot_rati... | 39.852273 | 91 | 0.658825 |
3e8e67ffdb5978a97cc0ee408fb1ae0faeb5442a | 1,957 | py | Python | aMLpy/fetchAllData.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 15 | 2019-07-31T07:18:49.000Z | 2021-06-03T23:41:59.000Z | aMLpy/fetchAllData.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | null | null | null | aMLpy/fetchAllData.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 6 | 2019-08-01T19:33:16.000Z | 2020-08-27T13:01:15.000Z | """
Fetch all data files needed for examples chosen for SaoPaulo2019 bylectures by ZI, see
Sao Paulo School of Advanced Science on Learning from Data, July 31 - Aug 2, 2019
https://sites.usp.br/datascience/spsas-learning-from-data/
License: BSD; Zeljko Ivezic <ivezic@uw.edu>
"""
# *** SaoPaulo2019 participants: ***
# ... | 35.581818 | 89 | 0.768523 |
e4c4034fa27d4624b99deeb76b65b44f7f6eac25 | 1,449 | py | Python | src/server/app/endpoints/standby/workspace/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/endpoints/standby/workspace/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/endpoints/standby/workspace/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ...db.settings import db, oidc
from flask import Flask, Blueprint, render_template, abort, g, request
from oauth2client.client import OAuth2Credentials
from flask_jwt_extended import (create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_jwt_identity, get_raw_jwt, set_access_co... | 30.1875 | 176 | 0.753623 |
4b9e0d1fcf32f6dcc791e140bbd7be98de66ba04 | 2,079 | py | Python | resources/correctformatting.py | VanLoon/Dungeon-World | c661afa3fed32254205d8e621d9776967740c8f2 | [
"CC-BY-3.0"
] | 191 | 2015-01-06T09:37:05.000Z | 2022-02-26T19:51:41.000Z | original_files/resources/correctformatting.py | semiomant/Dungeon-World | 8301a97a5463a788e232ea9128f7960fbaedfabd | [
"CC-BY-3.0"
] | 9 | 2015-05-17T01:08:51.000Z | 2021-11-23T19:45:43.000Z | original_files/resources/correctformatting.py | semiomant/Dungeon-World | 8301a97a5463a788e232ea9128f7960fbaedfabd | [
"CC-BY-3.0"
] | 56 | 2015-01-12T18:56:00.000Z | 2022-02-27T09:50:22.000Z | #!/usr/bin/env python
# -*- coding: latin-1 -*-
import re
import sys
from optparse import OptionParser
# Setup options
parser = OptionParser(usage="Usage: %prog [options] files")
parser.add_option('-s', '--safe', action="store_true", dest="safe",
help="Instead of overwriting files, store output to a copy of each file... | 33.532258 | 106 | 0.671477 |
299e9a1c8b7450d453c82823ef2e8a56be909c30 | 734 | py | Python | zhi/member.py | Rustem/ZLU | 9e050bdbc317f6fbddb4eed64d9ebdec995a9add | [
"MIT"
] | 1 | 2017-08-26T14:47:48.000Z | 2017-08-26T14:47:48.000Z | zhi/member.py | Rustem/ZLU | 9e050bdbc317f6fbddb4eed64d9ebdec995a9add | [
"MIT"
] | null | null | null | zhi/member.py | Rustem/ZLU | 9e050bdbc317f6fbddb4eed64d9ebdec995a9add | [
"MIT"
] | null | null | null | import sys
from twopc import Member
from kazoo.client import KazooClient
def on_conn(evt):
print evt
if __name__ == '__main__':
client1 = KazooClient(hosts='znode1.zcluster.com:2181,znode2.zcluster.com:2181,znode3.zcluster.com:2181')
client1.add_listener(on_conn)
client1.start()
member1 = Member(c... | 30.583333 | 111 | 0.705722 |
6b486166d9e4ecac16ee384629b9c4157a5b1fb1 | 606 | py | Python | BoostGraph/DAGGen/tutorialnx.py | Arka2009/ita3e | 1b33e9a0ca167449c68596b7065ea84af2ed3942 | [
"BSD-2-Clause"
] | null | null | null | BoostGraph/DAGGen/tutorialnx.py | Arka2009/ita3e | 1b33e9a0ca167449c68596b7065ea84af2ed3942 | [
"BSD-2-Clause"
] | 1 | 2017-04-07T19:19:09.000Z | 2017-04-07T19:19:09.000Z | BoostGraph/DAGGen/tutorialnx.py | Arka2009/ita3e | 1b33e9a0ca167449c68596b7065ea84af2ed3942 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 2 11:20:05 2019
@author: amaity
"""
import numpy as np
import networkx as nx
import os
from networkx.drawing.nx_agraph import write_dot
def main():
G = nx.gnp_random_graph(4,0.5,directed=True)
H = nx.DiGraph([(u,v,{'weight':np.random.randi... | 26.347826 | 91 | 0.651815 |
86483e0ab5d24306f7df7763b7a7f4367a08ddb7 | 11,651 | py | Python | module/segmentation_package/src/utils.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | module/segmentation_package/src/utils.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | module/segmentation_package/src/utils.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import os
import cv2
import json
import shutil
import numpy as np
import pandas as pd
from tqdm import tqdm
from datetime import datetime
from os.path import isfile, join
from os import listdir
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.structures import BoxMode
from detectr... | 33.383954 | 117 | 0.57317 |
d4f8adb7bc190cbd222a112d9575d72311f37d79 | 6,358 | py | Python | AP_SS16/601/table.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/601/table.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/601/table.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import itertools
import codecs
import uncertainties
import numpy as np
import uncertainties.unumpy as unp
from uncertainties.unumpy import (
nominal_values as noms,
std_devs as stds,
)
from uncertainties import ufloat
def make_table(columns, figures=None):
assert hasattr(columns[0],'__iter__'), "Wenn nur e... | 35.719101 | 210 | 0.577068 |
be2a573dd20834a78ad2f05aa9b85e4c7c62310c | 1,189 | py | Python | demos/Multiscale/ThreeSidedBasic/model/parts/exogenous.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSidedBasic/model/parts/exogenous.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSidedBasic/model/parts/exogenous.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | import numpy as np
# Exogenous Mechanisms
def tx_volume_generator(params, step, sL, s, _input):
y = 'tx_volume'
x = s['tx_volume']*(1+2*params['eta']*np.random.rand()*(1-s['tx_volume']/params['tampw']))
return (y, x)
def product_cost_generator(params, step, sL, s, _input):
y = 'product_cost'
x =... | 28.309524 | 98 | 0.582843 |
079db1136994115946376ebcbf816039c3f14063 | 196 | py | Python | zencad/version.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/version.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/version.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import pkg_resources
try:
__version__ = pkg_resources.get_distribution("zencad").version
except:
__version__ = "Unresolved???"
__occt_version__ = "7.4.0"
__pythonocc_version__ = "7.4.1"
| 19.6 | 66 | 0.739796 |
ed32f0ee56af2f6f0b39050b42ef565feb01eeac | 7,787 | py | Python | wz/dispatch.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/dispatch.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/dispatch.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
dispatch.py - last updated 2021-05-24
Dispatcher for call to back-end functions from front-end.
==============================
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 Licen... | 32.045267 | 82 | 0.625915 |
9c61a056b64a775787f3924b03cd96cb0aad4737 | 2,129 | py | Python | Aufgaben/abgabe2/constants.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/constants.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/constants.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | __authors__ = "Rosario Allegro (1813064), Sedat Cakici (1713179), Joshua Joost (1626034)"
# maintainer = who fixes buggs?
__maintainer = __authors__
__date__ = "2020-04-23"
__version__ = "0.0"
__status__ = "Development"
##--- TODO
#- Datei ist fertig, wenn Projekt abgabebereit
# kernel imports
import scipy.special
im... | 26.283951 | 97 | 0.701738 |
138bdf7d76f598d184feb6c569b0489c6d467bb6 | 1,573 | py | Python | 361/tuwulisu_361_dp.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 361/tuwulisu_361_dp.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 361/tuwulisu_361_dp.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | class Solution:
def add_kill_count(self, queue, count):
for x,y in queue:
self.killable_enemy_count_grid[y][x]+=count
def maxKilledEnemies(self, grid: List[List[str]]) -> int:
height = len(grid)
width = len(grid[0])
self.killable_enemy_count_grid = [[0 for _ in range(... | 38.365854 | 91 | 0.502861 |
13f54a7ed5a43fa2a1d683bce52ae51c92a4c93f | 2,820 | py | Python | deploy/deployctl/subcommands/dataproc_cluster.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | deploy/deployctl/subcommands/dataproc_cluster.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | deploy/deployctl/subcommands/dataproc_cluster.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 12 | 2018-02-22T09:45:43.000Z | 2020-02-27T21:37:52.000Z | import argparse
import os
import subprocess
import sys
import typing
from deployctl.config import config
DATA_PIPELINE_DIRECTORY = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../data-pipeline"))
def list_clusters() -> None:
if not config.project:
raise RuntimeError("project configura... | 31.333333 | 111 | 0.647518 |
6a03c864bb2a12adb98306f316cbf12378eefb0e | 6,730 | py | Python | 10.3389/fevo.2021.762173/scripts/make_dragonfly_synthesis.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fevo.2021.762173/scripts/make_dragonfly_synthesis.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fevo.2021.762173/scripts/make_dragonfly_synthesis.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | import os
import sys
import glob
import shutil
import cv2
# from pandabox.imgUtils import imgUtils
import joblib
import random
import numpy as np
import skimage
import skimage.io
import skimage.transform
import skimage.filters
import matplotlib.pyplot as plt
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = ... | 30.452489 | 159 | 0.612779 |
160eccafd0ec0b68200cb5ffc4c9b6f9ae62e752 | 456 | py | Python | selfservice/migrations/0002_auto_20201009_1849.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | selfservice/migrations/0002_auto_20201009_1849.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | 5 | 2020-10-10T00:21:37.000Z | 2021-09-22T18:01:46.000Z | selfservice/migrations/0002_auto_20201009_1849.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-09 18:49
from django.db import migrations, models
import selfservice.models
class Migration(migrations.Migration):
dependencies = [
('selfservice', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='selfservicetoken',
... | 22.8 | 92 | 0.642544 |
4c691b99ed1f79ec5e885e23e149f19d50ddc342 | 1,300 | py | Python | abstract_pre_deal.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | abstract_pre_deal.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | abstract_pre_deal.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | import re
import codecs
fp = open('abstracts_clean.txt', 'wb')
with open('abstracts_small_test.txt', 'r') as f:
line_num = 0
for line in f:
if line_num > 100000:
pass
line_num += 1
if line_num % 2 == 0:
if line.strip() == 'Section None':
fp.write... | 34.210526 | 94 | 0.463077 |
d5c797dedc22815fc4f39687ddc175e14e9108c5 | 7,463 | py | Python | test/unit/v1beta1/suggestion/test_optuna_service.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 17 | 2018-04-04T08:44:06.000Z | 2018-04-19T18:02:05.000Z | test/unit/v1beta1/suggestion/test_optuna_service.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 58 | 2018-04-03T19:05:50.000Z | 2018-04-19T16:14:04.000Z | test/unit/v1beta1/suggestion/test_optuna_service.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 10 | 2018-04-04T02:06:20.000Z | 2018-04-19T08:53:04.000Z | # Copyright 2022 The Kubeflow Authors.
#
# 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 in ... | 39.278947 | 108 | 0.480772 |
5db25dc3f604f27100fb1fbe1b8ec8f883fabeab | 2,170 | py | Python | sketches/codingtrain_unicorn_rainbow_2/unicornrainbow.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/codingtrain_unicorn_rainbow_2/unicornrainbow.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/codingtrain_unicorn_rainbow_2/unicornrainbow.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class UnicornRainbow:
def __init__(self):
self.rainbow = []
self.side = 6
self.im = loadImage("unicorn.png")
self.d = 100 # Durchmesser
self.score = 0
self.x = 240
self.y = 100
self.offset_rainbow = self.x + 30
self.gravity = 0.6
... | 38.070175 | 121 | 0.539631 |
ab37ae1ccf58864a1dc504c4a561789b17f75217 | 1,810 | py | Python | research/nlp/dscnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/dscnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/dscnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.708333 | 86 | 0.653591 |
db5c2e307bd86c2bacacc29d32c2a6c7b1f69101 | 5,043 | py | Python | bigbench/benchmark_tasks/generate_task_headers.py | tanujdhiman/BIG-bench | 38f16ffb3d4cae77324a71d6b63c1a5bcdadc445 | [
"Apache-2.0"
] | null | null | null | bigbench/benchmark_tasks/generate_task_headers.py | tanujdhiman/BIG-bench | 38f16ffb3d4cae77324a71d6b63c1a5bcdadc445 | [
"Apache-2.0"
] | null | null | null | bigbench/benchmark_tasks/generate_task_headers.py | tanujdhiman/BIG-bench | 38f16ffb3d4cae77324a71d6b63c1a5bcdadc445 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.093023 | 442 | 0.573666 |
dbdd7d2a27d19cd732b6f32a76ec64a7ab250ef2 | 3,034 | py | Python | simple-tensorflow-demo/4.demos/structural demo/backward.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-tensorflow-demo/4.demos/structural demo/backward.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-tensorflow-demo/4.demos/structural demo/backward.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | """
反向传播
def backward():
x = tf.placeholder()
y_ = tf.placeholder()
# 使用前向传播的网络结构求预测值y
y = forward.forward(x, r)
# 训练轮数计数器 global_step
global_step = tf.Variable(0, trainable=False)
# 定义损失函数, 可以是:
# > test4/lossTest
# 均方误差 loss_base = tf.reduce_mean(tf.square(y - y_))
# 交叉熵 los... | 28.622642 | 118 | 0.625906 |
91957addce1cad2f164316955a7cd1c1af30ab4e | 455 | py | Python | Algorithms/DynamicProgramming/Edit Distance/edit_distance.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 26 | 2019-07-17T11:05:43.000Z | 2022-02-06T08:31:40.000Z | Algorithms/DynamicProgramming/Edit Distance/edit_distance.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 7 | 2019-07-16T19:52:25.000Z | 2022-01-08T08:03:44.000Z | Algorithms/DynamicProgramming/Edit Distance/edit_distance.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 19 | 2020-01-14T02:44:28.000Z | 2021-12-27T17:31:59.000Z | def edit(s1, s2, x, y):
if x==0:
return y
if y==0:
return x
if s1[x-1] == s2[y-1]:
return edit(s1, s2, x-1, y-1)
return min(edit(s1, s2, x-1, y), edit(s1, s2, x, y-1), edit(s1, s2, x-1, y-1)) + 1
input_string_1 = 'sunday'
input_string_2 = 'saturday'
import time
init = time.... | 19.782609 | 86 | 0.591209 |
91a1dda7031a3da33d6838d319c69eb0cddd1905 | 579 | py | Python | geol/geol_logger/geol_logger.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | geol/geol_logger/geol_logger.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | geol/geol_logger/geol_logger.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | import logging
import os
import sys
LOG_FORMAT = '%(asctime)s -[%(filename)s:%(lineno)s] - %(name)s - %(funcName)2s() - %(levelname)s - %(message)s'
INFO = logging.INFO
DEBUG = logging.DEBUG
ERROR = logging.ERROR
# set up logging to console
console = logging.StreamHandler(sys.stdout)
console.setLevel(DEBUG)
# set... | 23.16 | 114 | 0.747841 |
53319620a127c8b4a1bc7da46d69bb010376b0fc | 3,912 | py | Python | Python-BlueEdTech-main/projeto-exemplo/main.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | 3 | 2021-05-30T20:01:06.000Z | 2021-07-07T00:46:37.000Z | Python-BlueEdTech-main/projeto-exemplo/main.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | Python-BlueEdTech-main/projeto-exemplo/main.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | from relogio import Relogio
from personagem import Personagem
from casa import Casa
if(__name__ == "__main__"): # Pesquisar significado desse if
dia = 1
relogio = Relogio()
personagem = Personagem()
casa = Casa()
cafe_da_manha = False
while True:
print("---")
print("São "+str(r... | 35.563636 | 79 | 0.471626 |
72ece225ef89b3d5fa0628c4f66cdfe80d59a594 | 485 | py | Python | LoremPizzum/products/models.py | BruhMano/LoremPizzum | 8909a9f21ea2878cf9accf035989edbd15c3d285 | [
"BSD-3-Clause"
] | null | null | null | LoremPizzum/products/models.py | BruhMano/LoremPizzum | 8909a9f21ea2878cf9accf035989edbd15c3d285 | [
"BSD-3-Clause"
] | null | null | null | LoremPizzum/products/models.py | BruhMano/LoremPizzum | 8909a9f21ea2878cf9accf035989edbd15c3d285 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.utils.translation import gettext_lazy as _
class Product(models.Model):
id = models.AutoField(primary_key=True)
title = models.CharField(_('title'),max_length = 30, null = False)
describtion = models.CharField(_('describtion'),max_length = 150, null = False)
pri... | 37.307692 | 83 | 0.701031 |
22bbf9e07c40582fefd2401f136cc19df82b73b1 | 1,416 | py | Python | datenfinder/gui/forms.py | digitalfabrik/buergerinnendatenfinder | ff0a27b068f568e9e8c6a8a70b81251dbde0b7e6 | [
"Apache-2.0"
] | 2 | 2021-05-12T21:52:48.000Z | 2021-10-30T13:01:03.000Z | datenfinder/gui/forms.py | digitalfabrik/buergerinnendatenfinder | ff0a27b068f568e9e8c6a8a70b81251dbde0b7e6 | [
"Apache-2.0"
] | null | null | null | datenfinder/gui/forms.py | digitalfabrik/buergerinnendatenfinder | ff0a27b068f568e9e8c6a8a70b81251dbde0b7e6 | [
"Apache-2.0"
] | null | null | null | """
Citizen Date Search / Input form
"""
from django.forms import ModelForm, CharField, ChoiceField
from .models import CitizenDate
import hashlib
DATE_TYPES = [
('telephone', 'Telefonnummer'),
('e-mail', 'E-Mail-Adresse'),
('zipcode', 'Postleitzahl'),
]
class CitizenDateForm(ModelForm):
"""
Searc... | 28.897959 | 105 | 0.622881 |
a3e9fed1f9d45ff68cfa51429f8de4e5fd2fd71a | 1,376 | py | Python | python/faulhaber_const.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | python/faulhaber_const.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | python/faulhaber_const.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | commands = ['SOR', 'CONTMOD', 'STEPMOD', 'APCMOD', 'ENCMOD', 'HALLSPEED', 'ENCSPEED', 'GEARMOD', 'VOLTMOD', 'IXRMOD', 'ENCRES', 'KN', 'RM',
'STW', 'STN', 'MV', 'MAV', 'ADL', 'ADR', 'SIN', 'NET', 'BAUD', 'NODEADR', 'ANSW', 'POLNUM', 'SENSTYP', 'LL', 'APL', 'SP', 'AC',
'DEC', 'SR', 'POR', 'I', 'PP... | 125.090909 | 141 | 0.453488 |
433d8fb6ec2bca5be86c1e94a013b885621fc12b | 5,147 | py | Python | tests/test_kostenposition.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_kostenposition.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_kostenposition.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.betrag import Betrag
from bo4e.com.kostenposition import Kostenposition, KostenpositionSchema
from bo4e.com.preis import Preis
from bo4e.enum.mengeneinheit import Mengeneinheit
from bo4e.enum.preisst... | 43.991453 | 114 | 0.540509 |
4a5b3743113064cd6a4da0564f5df356e4b7e40f | 4,868 | py | Python | Utils/py/TeamCommGenerator/utils/TeamCommGenerator.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/TeamCommGenerator/utils/TeamCommGenerator.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/TeamCommGenerator/utils/TeamCommGenerator.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import json
import sys
import threading
import socket
import time
from naoth.SPLMessage import SPLMessage
from utils.TeamCommReceiver import TeamCommReceiver
from utils.TeamCommSender import TeamCommSender
class TeamCommGenerator(threading.Thread):
def __init__(self, host='localhost', port=10004, delay=0.4):
... | 34.524823 | 117 | 0.583607 |
4a936dd04bd542b018a3bbd5aba9b99cabe31111 | 25,078 | py | Python | Packs/SymantecDLP/Integrations/SymantecDLPV2/SymantecDLPV2_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/SymantecDLP/Integrations/SymantecDLPV2/SymantecDLPV2_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/SymantecDLP/Integrations/SymantecDLPV2/SymantecDLPV2_test.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
from freezegun import freeze_time
from pytest import raises
from CommonServerPython import *
import io
import copy
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
SINGLE_INCIDENTS_MOCK_RESPONSE = util_load_json('test_data/fetch_sin... | 46.874766 | 120 | 0.672661 |
435e190acd50fb9e2c948013643071e00d3fd0c6 | 2,884 | py | Python | pk/data/old/createDataSet.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/old/createDataSet.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/old/createDataSet.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | from PIL import Image
from numpy import genfromtxt
import gzip, pickle
from glob import glob
import numpy as np
import pandas as pd
import theano
class pcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1... | 27.207547 | 79 | 0.619626 |
6015417ce82be63619e676f4a407890b45187ae2 | 875 | py | Python | INBa/2015/Perepyelkov_Y_A/task_4_33.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Perepyelkov_Y_A/task_4_33.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Perepyelkov_Y_A/task_4_33.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 4. Вариант 33
#Напишите программу, которая выводит имя, под которым скрывается Мария Магдалена фон Лош. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти). Для хранения всех нео... | 51.470588 | 443 | 0.774857 |
880d18ac636e7f98b6355b85ad08e84acae74e3b | 19,119 | py | Python | mumath/context/base.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/context/base.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/context/base.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | attrib = dict
def atomic(*args): return dict.fromkeys(args)
# no functions in this file; this should be easily convertible to json/xml
# group = lambda l: re.match(r'.*(r"\\.*?").*(&.*?;|\w+)"\)', l).groups()
# fmt = lambda t: f' {t[0]}: "{unescape(t[1])}", # {t[1]}'
# lambda ls: "\n".join(map(fmt, map(group, fil... | 30.492823 | 107 | 0.476646 |
1ce9a981d756530e3947f38ef8766f08656cf8b6 | 2,003 | py | Python | python/oneflow/test/modules/test_ones_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/test/modules/test_ones_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_ones_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 33.383333 | 88 | 0.719421 |
c70ec3e55a715e308b1e479269880b43b3b6ba18 | 5,056 | py | Python | merkur_orbit_loesung.py | jl-wynen/Schuelerakademie-Merkur | dc6462a1ba602ee8bc90d74a826efa89917fdaeb | [
"MIT"
] | null | null | null | merkur_orbit_loesung.py | jl-wynen/Schuelerakademie-Merkur | dc6462a1ba602ee8bc90d74a826efa89917fdaeb | [
"MIT"
] | null | null | null | merkur_orbit_loesung.py | jl-wynen/Schuelerakademie-Merkur | dc6462a1ba602ee8bc90d74a826efa89917fdaeb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
### Darstellung des Merkurorbits mit VPython
# ----------------------------------
## Laden des Grafikmoduls
# ----------------------------------
# Da es unglaublich viel Zeit kostet ein Programm für 3-dimensionale grafische
# Darstellung selber zu schreiben, lassen wir uns die Arbe... | 32.203822 | 86 | 0.624407 |
c74b01b724c12c8ce62dd2d13ca91851bd7fe08c | 3,721 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/Authentication.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Authentication.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Authentication.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | 52.408451 | 137 | 0.520828 |
c7d9e2208211a5e134c699cde716b1db513bf1dc | 692 | py | Python | query.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | 1 | 2021-05-24T06:16:49.000Z | 2021-05-24T06:16:49.000Z | query.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | query.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | import argparse
import os
import pickle
import re
from config import PICKLE_DIRECTORY, PICKLE_FILENAME
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='IPs by country')
parser.add_argument('--country', dest='country', action='store', required=True)
parser.add_argument('--search', d... | 31.454545 | 93 | 0.67341 |
408f5e1b4042c892024e8176ea6c967b46b58522 | 295 | py | Python | showcase6/com/aaron/demo7.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase6/com/aaron/demo7.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase6/com/aaron/demo7.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | import wx
class ExampleFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent)
panel = wx.Panel(self)
self.quote = wx.StaticText(panel, label="Your quote: ", pos=(20, 30))
self.Show()
app = wx.App(False)
ExampleFrame(None)
app.MainLoop() | 26.818182 | 77 | 0.640678 |
90e5dc4bd6e4cdf079f643640ae6c6680a9aa50f | 310 | py | Python | nz_crawl_demo/day2/requests/download.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/requests/download.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/requests/download.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | import requests
from urllib import request
url = "http://www.baidu.com"
headers = {
'User-Agent':"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0"
}
res = requests.get(url,headers=headers)
print(res.status_code)
if res.status_code == 200:
request.urlretrieve(url,'baidu.html') | 28.181818 | 91 | 0.719355 |
7354eee413082cc29228eefb210169a238b0dfb8 | 2,863 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, cint, getdate
def execute(filters=None):
if not filters: filters = {}
float_precision = cin... | 30.136842 | 113 | 0.713238 |
b426682ea899b62a9307c8778914c1ce3b270c28 | 3,374 | py | Python | hyperts/estimators.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | hyperts/estimators.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | hyperts/estimators.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | import numpy as np
try:
from prophet import Prophet
except:
from fbprophet import Prophet
from statsmodels.tsa.vector_ar.var_model import VAR
from sktime.classification.interval_based import TimeSeriesForestClassifier
from hypernets.core.search_space import ModuleSpace
from hypernets.utils import logging
fro... | 28.837607 | 91 | 0.659455 |
c32b2f12268516d1c30d39e0f52551001d6a8148 | 394 | py | Python | chapter1/small_web.py | Baw25/MongoStuff | 0a6f35505948d36b3bf1b07a1a75709babaeca71 | [
"MIT"
] | null | null | null | chapter1/small_web.py | Baw25/MongoStuff | 0a6f35505948d36b3bf1b07a1a75709babaeca71 | [
"MIT"
] | null | null | null | chapter1/small_web.py | Baw25/MongoStuff | 0a6f35505948d36b3bf1b07a1a75709babaeca71 | [
"MIT"
] | null | null | null | import pymongo
import bottle
# from pymongo import MongoClient
# from bottle import route, run, template
@bottle.route('/home')
def index():
connection = pymongo.MongoClient('localhost', 27017)
db = connection.mongo_test
teams = db.teams
team = teams.find_one()
return "<b>The %s is the best tea... | 20.736842 | 69 | 0.690355 |
6f2eb26eaddd2d659f588da0e5ea642a1bc5eb84 | 941 | py | Python | leetcode/210-Course-Schedule-II/CourseSchedueII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/210-Course-Schedule-II/CourseSchedueII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/210-Course-Schedule-II/CourseSchedueII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Based on the solution of CouseScheduleI
# However, I need to figure out my own solution
class Solution(object):
def findOrder(self, numCourses, prerequisites):
"""
:type numCourses: int
:type prerequisites: List[List[int]]
:rtype: List[int]
"""
indegrees = [0] * n... | 29.40625 | 71 | 0.494155 |
6f72a5b74caeb9e377172986bbf1586df10d6ebe | 9,195 | py | Python | dircheck/dircheck.py | shaneoc/dircheck | 4fd5d3943feb5e052f3b2beb0842b8e9f2c6fc7e | [
"MIT"
] | 1 | 2020-07-30T19:33:10.000Z | 2020-07-30T19:33:10.000Z | dircheck/dircheck.py | shaneoc/dircheck | 4fd5d3943feb5e052f3b2beb0842b8e9f2c6fc7e | [
"MIT"
] | null | null | null | dircheck/dircheck.py | shaneoc/dircheck | 4fd5d3943feb5e052f3b2beb0842b8e9f2c6fc7e | [
"MIT"
] | null | null | null | import sys
import os
import argparse
import subprocess
import stat
import csv
import datetime
import io
import hashlib
csv_fieldnames = [
'filename',
'type',
'mtime',
'link',
'size',
'md5',
'sha256'
]
csv_humanfieldnames = {
'filename': 'filename',
'type': 'type',
'mtime': ... | 38.961864 | 109 | 0.505927 |
489325e28ef7becd5c6685183c29d7aba8f0eb07 | 1,032 | py | Python | year_3/databases_sem2/lab1/lab1/spiders/products_spider.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem2/lab1/lab1/spiders/products_spider.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem2/lab1/lab1/spiders/products_spider.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | import scrapy
class ProductsSpider(scrapy.spiders.CrawlSpider):
name = "products"
start_urls = ["https://www.moyo.ua/telecommunication/smart/samsung/"]
def parse(self, response):
for product in response.css('div.goods_list div.goods_item'):
yield {
'title': product.css... | 49.142857 | 129 | 0.635659 |
48e81499090376bdc9e4c42c5c3724946a422814 | 1,190 | py | Python | tests/test_models.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 1 | 2019-07-30T14:39:43.000Z | 2019-07-30T14:39:43.000Z | tests/test_models.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 11 | 2019-07-31T13:40:30.000Z | 2019-08-07T21:54:52.000Z | tests/test_models.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | null | null | null | from web.models import Product, StockMovement
from web import db
def test_product_model(app):
products = Product.query.order_by(Product.id).all()
assert len(products) == 3
def test_create_product(app):
db.session.add(Product(name='new', wanted_amount=5))
db.session.commit()
products = Product.que... | 30.512821 | 87 | 0.734454 |
d2fc088341fb696f33e31c7e5dd48f8ba025ee57 | 2,226 | py | Python | 1_DeepLearning-Basics/01_Perceptron/perceptron.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/01_Perceptron/perceptron.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/01_Perceptron/perceptron.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def get_dataset():
x = np.array([[0,0], [0,1], [1,0], [1,1]])
y = np.array([0, 1, 1, 1])
return x, y
class Perceptron():
def __init__(self, epochs, learnrate):
self.epochs = epochs
self.learnrate = learnrate
self.w = list()
... | 30.081081 | 87 | 0.531447 |
81bee40d849e6897b5e89645d2c6939bd043fca9 | 683 | py | Python | ___Python/Thomas/pycurs_180625/p12_nachrichten/m01_email.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p12_nachrichten/m01_email.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p12_nachrichten/m01_email.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # Import smtplib for the actual sending function
import smtplib
# Import the email modules we'll need
from email.message import EmailMessage
# Open the plain text file whose name is in textfile for reading.
msg = EmailMessage()
msg.set_content("""textanfang
textende
""")
# me == the sender's email addr... | 24.392857 | 66 | 0.698389 |
1efe67e1ef2ad77c9b5b915cde834917c91c1b8c | 11,160 | py | Python | official/recommend/wide_and_deep/src/process_data.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/wide_and_deep/src/process_data.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/wide_and_deep/src/process_data.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.64 | 119 | 0.598029 |
73b6a2f3db134ce9e827f14601fecd2e1695c677 | 2,119 | py | Python | src/test/tests/hybrid/sil.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/sil.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/hybrid/sil.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: sil.py
#
# Tests: mesh - 3D curvilinear,multi-domain,ghost zones replicated.
# plots - mat subset, domain subset
#
# Defect ID: none
#
# Programmer: Hank Childs
# Date: ... | 23.808989 | 78 | 0.652194 |
fb5e1885c9096b79b6895095e32b8c1f256e2a3c | 1,038 | py | Python | set.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | 2 | 2017-12-22T20:03:30.000Z | 2017-12-24T20:55:38.000Z | set.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | null | null | null | set.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | null | null | null | class Set():
def __init__(self):
self.data = dict()
self.values = []
def append(self, k):
if k not in self.values:
self.data[k] = True
self.values = list(self.data.keys())
def update(self, s):
for i in s:
self.data[i] = True
... | 24.139535 | 45 | 0.533719 |
fb6dc5f5b2ca4b255452df2dd46161731208820e | 1,030 | py | Python | 2019/finals/sandbox-procbox/exploit/doit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/finals/sandbox-procbox/exploit/doit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/finals/sandbox-procbox/exploit/doit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#Copyright 2019 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 b... | 22.391304 | 73 | 0.704854 |
83a315d82b9d3179fd3e1f47f9452d0ddc2a6d1b | 4,368 | py | Python | examples/machine_translation/transformer/deploy/serving/transformer_web_server.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/transformer_web_server.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/transformer_web_server.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import argparse
import yaml
from attrdict import AttrDict
from pprint import pprint
import sys
import numpy as np
import os
from paddle_serving_client import Client
try:
from paddle_serving_server_gpu.web_service import WebService
except:
from paddle_serving_server.web_service import WebService
from transfor... | 31.42446 | 115 | 0.56891 |
f7aea6204430bcc0dfb73cc9e3532ab2892b91b3 | 836 | py | Python | exercises/es/exc_01_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/exc_01_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/exc_01_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("es_core_news_sm")
matcher = Matcher(nlp.vocab)
doc = nlp(
"Después de hacer la actualización de iOS no notarás un rediseño "
"radical del sistema: no se compara con los cambios estéticos que "
"tuvimos con el iOS 7. La mayoría de las funcion... | 32.153846 | 73 | 0.7189 |
54680250c1a567508e4416c5010541db4bdf8266 | 3,495 | py | Python | setupdialog.py | malteschmitz/gameoflife | defdc1acd7f8453f8b759d2aa574ef4d19bd61c4 | [
"MIT"
] | null | null | null | setupdialog.py | malteschmitz/gameoflife | defdc1acd7f8453f8b759d2aa574ef4d19bd61c4 | [
"MIT"
] | null | null | null | setupdialog.py | malteschmitz/gameoflife | defdc1acd7f8453f8b759d2aa574ef4d19bd61c4 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import messagebox
class SetupDialog(object):
def __init__(self, parent):
# neues Fenster erzeugen
self.top = Toplevel(parent)
# Validierungskommando für positive Ganzzahlen registrieren
vcmd = (parent.register(self.validate), '%P')
# Eing... | 39.715909 | 104 | 0.593991 |
548203b7a7cf2adb160fba525f288c36fae1d592 | 212 | py | Python | Problems/Dynamic Programming/Easy/MaxGeneratedArray/max_generated_array.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Easy/MaxGeneratedArray/max_generated_array.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Easy/MaxGeneratedArray/max_generated_array.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | def getMaximumGenerated(n: int) -> int:
dt, res = [i for i in range(n + 2)], 0
for i in range(n + 1):
dt[i] = dt[i >> 1] + dt[(i >> 1) + 1] * (i % 2)
res = max(dt[i], res)
return res
| 26.5 | 55 | 0.457547 |
3fa1ef497a3b6e93c53c8a749083aa3598f774ce | 27,447 | py | Python | tests/onegov/election_day/formats/election/test_internal_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_internal_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_internal_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from io import BytesIO
from onegov.ballot import Election
from onegov.core.csv import convert_list_of_dicts_to_csv
from onegov.election_day.formats import import_election_internal_majorz
from onegov.election_day.models import Canton
from tests.onegov.election_day.common import create_principa... | 37.24152 | 78 | 0.484461 |
3fcb9aa948f68036b2b6e0056bfcf04492ca7ef7 | 10,158 | py | Python | stepcharacteristics.py | NREL/scc | 3ec4f8801dc904732389c06e1e2ce77fefe136e7 | [
"BSD-3-Clause"
] | null | null | null | stepcharacteristics.py | NREL/scc | 3ec4f8801dc904732389c06e1e2ce77fefe136e7 | [
"BSD-3-Clause"
] | null | null | null | stepcharacteristics.py | NREL/scc | 3ec4f8801dc904732389c06e1e2ce77fefe136e7 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy as sp
import pandas as pd
import math
import cmath
import random
from scipy.io import loadmat
import time
from datetime import datetime
from datetime import timedelta
import plotly.graph_objects as go
import cufflinks as cf
cf.go_offline()
def plot_stepcharacteristics(ddf,yfinal, zerol... | 39.525292 | 147 | 0.559362 |
4d3fb8ae7ccafbb0caef7fddf4169b6fcd9181f9 | 7,386 | py | Python | deprecated/examples/fast_imagenet/dali.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/examples/fast_imagenet/dali.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/examples/fast_imagenet/dali.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 appli... | 36.384236 | 109 | 0.504739 |
4d5880a64b295ec82bb5739450a819fc8e895b80 | 390 | py | Python | game1/Skrambles.py | JordanG8/Bahr | 03911f3ac7275f46abc510cf85c8850c31572203 | [
"MIT"
] | null | null | null | game1/Skrambles.py | JordanG8/Bahr | 03911f3ac7275f46abc510cf85c8850c31572203 | [
"MIT"
] | null | null | null | game1/Skrambles.py | JordanG8/Bahr | 03911f3ac7275f46abc510cf85c8850c31572203 | [
"MIT"
] | null | null | null | #from Players import real_player_list Bring back when finished!!
from Players import player_class
real_player_list = []
real_player_list.append(player_class())
real_player_list.append(player_class())
real_player_list.append(player_class())
real_player_list[0].name = "Bahr"
real_player_list[1].name = "Gadi"
rea... | 32.5 | 66 | 0.779487 |
4d9e8a7a66e563265fb4ba0d8917a25f08f69b39 | 11,337 | py | Python | core/functions.py | dimkaart/Machine-Learning-in-Produktion-und-Logistik | 2d32ee2a7cd3f5b88ca86178018c40a76db6edd5 | [
"MIT"
] | null | null | null | core/functions.py | dimkaart/Machine-Learning-in-Produktion-und-Logistik | 2d32ee2a7cd3f5b88ca86178018c40a76db6edd5 | [
"MIT"
] | null | null | null | core/functions.py | dimkaart/Machine-Learning-in-Produktion-und-Logistik | 2d32ee2a7cd3f5b88ca86178018c40a76db6edd5 | [
"MIT"
] | null | null | null | import os
import cv2
import random
import numpy as np
import tensorflow as tf
import pytesseract
from core.utils import read_class_names
import core.utils as utils
from core.config import cfg
from tensorflow.python.saved_model import tag_constants
from PIL import Image
import re
from scipy import ndimage
pytesseract.... | 43.436782 | 274 | 0.633236 |
4de0818d63020261423e3d4324e5995cff335f42 | 2,257 | py | Python | Tutorials/Statistics/Normal_Approximation.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Tutorials/Statistics/Normal_Approximation.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Tutorials/Statistics/Normal_Approximation.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://towardsdatascience.com/how-to-use-and-create-a-z-table-standard-normal-table-240e21f36e53
# https://www.hackerrank.com/challenges/s10-normal-distribution-1/problem
"""Lesson"""
# https://www.hackerrank.com/challenges/s10-normal-distribution-1/tutorial
import numpy as np
from scipy.integrate import quad
from... | 26.244186 | 99 | 0.595924 |
1285fd26a01578bd1f8c3f87a3facd598c44a433 | 8,606 | py | Python | THC/2021/crypto/weebox.py/weebox.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | THC/2021/crypto/weebox.py/weebox.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | THC/2021/crypto/weebox.py/weebox.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import hashlib
import sys
#
# weebox.py
# - written by plcp
# - owned by quarkslab
# - only engages its author for code quality :)
#
nb_bits = 256
nb_bytes = 32
nb_words = 64
word_len = 4
word_mask = (2**word_len) - 1
ladder_size = 2**word_len
group = 11579208921035624876269744694940757353008614341529031419553363130... | 23.642857 | 87 | 0.618987 |
4259e59a9d3f88d4ff28560e250004b74adb0e7c | 1,446 | py | Python | Tests/tests/test_integration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/tests/test_integration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/tests/test_integration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from Tests.test_integration import __print_investigation_error
import demisto_client
@pytest.mark.parametrize('command, output', [
('!create account name="User" mail="Test" password="123123!"',
' Command: !create account name="User" mail="Test" password=******'),
('!create account name="U... | 43.818182 | 101 | 0.681189 |
c05fb18efe587e7a1b0997d89df163bf75c69ade | 370 | py | Python | year_3/comppi_1/puborgs/admin.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_1/puborgs/admin.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_1/puborgs/admin.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Organization, GoverningBody, SubDivision, Founder, Location, Certificate, ActionReport
admin.site.register(Organization)
admin.site.register(GoverningBody)
admin.site.register(SubDivision)
admin.site.register(Founder)
admin.site.register(Location)
admin.site.regist... | 30.833333 | 106 | 0.840541 |
97e833de3649c7646072612b65bbf5d04acabe5a | 721 | py | Python | common/models/member/MemberCart.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 2 | 2019-06-10T08:57:47.000Z | 2021-06-12T16:22:15.000Z | common/models/member/MemberCart.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | common/models/member/MemberCart.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from sqlalchemy import BigInteger, Column, DateTime, Integer
from sqlalchemy.schema import FetchedValue
from application import db
class MemberCart(db.Model):
__tablename__ = 'member_cart'
id = db.Column(db.Integer, primary_key=True)
member_id = db.Column(db.BigInteger, nullable=False, in... | 45.0625 | 102 | 0.768377 |
3f03c172cf9f3af32732816d2ab9b2e47b73dd07 | 13,998 | py | Python | Utils/py/RL_ActionSelection/env_0/world.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/world.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/world.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | ##############
#
# This skript specifies the rules of the RoboCup Standard Platform League (2017) [regarding the ball position]
#
# The world.py skript uses these rules to check ball positions and/or to move
# the ball according to the given rules
#
#############
#############
#
# in general the ball is represented as... | 33.408115 | 137 | 0.610587 |
451e448f914504e5accd75c9927f7ba9ebe5ce79 | 8,641 | py | Python | oneflow/python/framework/ofblob.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2020-12-24T09:26:36.000Z | 2020-12-24T09:26:36.000Z | oneflow/python/framework/ofblob.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/framework/ofblob.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 39.637615 | 89 | 0.695058 |
188e67d233c65c2243fcaaec023bfa55ce3dd0a2 | 1,558 | py | Python | tmp/analyses/examples/4_class_blocks.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | tmp/analyses/examples/4_class_blocks.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | tmp/analyses/examples/4_class_blocks.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 Transonic
ts = Transonic()
class MyClass:
def __init__(self, a, b):
self.a = a
self.b = b
def compute(self, n: int):
a = self.a
b = self.b
if ts.is_transpiled:
result = ts.use_block("block0")
else:
... | 21.943662 | 108 | 0.469833 |
18ced99a61e07491d1af46429114e71dfed0a2c7 | 68,562 | py | Python | vizdoom.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | vizdoom.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | vizdoom.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | 1 | 2019-11-29T12:28:33.000Z | 2019-11-29T12:28:33.000Z | # encoding: utf-8
# module vizdoom.vizdoom
# from /home/bjoern/anaconda3/lib/python3.6/site-packages/vizdoom/vizdoom.so
# by generator 1.145
# no doc
# imports
import pybind11_builtins as __pybind11_builtins
# Variables with simple values
BINARY_BUTTON_COUNT = 38
BUTTON_COUNT = 43
DEFAULT_TICRATE = 35
DELTA_BUTT... | 39.426107 | 119 | 0.634112 |
e1356464a7a1b146c16c3dc8c259ee21930fc9f8 | 6,199 | py | Python | resources/mechanics_lib/EDevice.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/EDevice.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/EDevice.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z |
from api.EComponent import EComponent
class EDevice(EComponent):
"""
A class representing an electrical device.
For example, an EDevice may be an LED, a servo, a light sensor, etc.
It stores the name of the device and the type of pin(s) it needs.
@cvar PIN_TYPES: A list of possible pin types... | 29.660287 | 88 | 0.571866 |
e13d22ab576b98e0235bad810c063c06cffed9a9 | 9,600 | py | Python | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import throw, _
from frappe.model.document import Document
import time
from datetime import timedelta
from fra... | 36.501901 | 148 | 0.713021 |
362acec4ca557fb941a8498c0148cdc13a5887da | 18 | py | Python | .venv/Lib/site-packages/dexpy/tests/__init__.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/__init__.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/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | """dexpy tests"""
| 9 | 17 | 0.555556 |
3687439791dea80b470b78a3d8491ac9fc01ecaf | 37,585 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_firmware.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_firmware.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_firmware.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
try:
from unittest.mock import patch, mock_open
except ImportError:
from mock import patch, mock_open
from ... | 67.598921 | 160 | 0.595903 |
368dc1b89ca2b25657b11030d346effa0c5c94b5 | 912 | py | Python | app/views/landing.py | davidkoojohn/SPA-weapp | 5b8770054434010c5da3cd950b5dadd26869343e | [
"MIT"
] | null | null | null | app/views/landing.py | davidkoojohn/SPA-weapp | 5b8770054434010c5da3cd950b5dadd26869343e | [
"MIT"
] | null | null | null | app/views/landing.py | davidkoojohn/SPA-weapp | 5b8770054434010c5da3cd950b5dadd26869343e | [
"MIT"
] | null | null | null |
from flask import Blueprint, render_template
from flask.ext.login import login_required
from ..decorators import admin_required, permission_required
from ..models import Permission
landing = Blueprint('landing', __name__)
@landing.route('')
def index():
return render_template('landing.html', name='davidkoojohn'... | 21.714286 | 63 | 0.773026 |
368f026e96589bc94efb5ffccef3474131f6a844 | 435 | py | Python | apps/projects/migrations/0004_auto_20180517_1028.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/projects/migrations/0004_auto_20180517_1028.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/projects/migrations/0004_auto_20180517_1028.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2018-05-17 10:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0003_auto_20180427_0823'),
]
operations = [
migrations.AlterField(
model_name='experiment',
name='descript... | 22.894737 | 91 | 0.627586 |
7fc6f8e95f08d9c07f670b2ca49d92c110aa71f7 | 181 | py | Python | src/scheduler/handlers/base.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/scheduler/handlers/base.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/scheduler/handlers/base.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from flask_restful import Resource
class BaseResource(Resource):
def app_db(self):
from scheduler.manager import JobManager
return JobManager.jobstore().engine
| 25.857143 | 48 | 0.745856 |
e9f0f855d2f316ee9aa130f2fb2de4057a637f68 | 2,708 | py | Python | tikz/gpx-gps-elevation-chart-generator/elevation_chart_gen.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/gpx-gps-elevation-chart-generator/elevation_chart_gen.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/gpx-gps-elevation-chart-generator/elevation_chart_gen.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generate an elevation chart from a GPX file."""
import gpxpy
import logging
import sys
from math import sin, cos, sqrt, atan2, radians
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG,
stre... | 30.426966 | 79 | 0.578287 |
18241e3c3313a8fe7c6deef99e1779d13c4e75f3 | 331 | py | Python | individual.py | turutle/rep | 7932c6889021fa0359ffe3931e731ef5b940f257 | [
"MIT"
] | null | null | null | individual.py | turutle/rep | 7932c6889021fa0359ffe3931e731ef5b940f257 | [
"MIT"
] | null | null | null | individual.py | turutle/rep | 7932c6889021fa0359ffe3931e731ef5b940f257 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 25 23:15:01 2021
@author: turtl
"""
X = int (input ( "Input age of Tanya --> "))
Y = int (input ( "Input age of Mitya --> "))
print( "Middle age: %.2f" % ((X+Y)/2))
print( "Difference of Tanya: %.2f" % abs(X - ((X + Y)/2)))
print( "Difference of Mitya: %.2f" % abs(Y - ((... | 27.583333 | 58 | 0.534743 |
a17336fb865e618eec5ab074627d9c63972a9c39 | 794 | py | Python | exercises/ja/exc_02_13.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/exc_02_13.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/exc_02_13.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("ja_core_news_sm")
doc = nlp(
"Amazon Prime会員向けの特典プログラムであるTwitch Primeは、"
"無料の戦利品、ゲーム、その他の特典を提供していますが、最大の特徴である"
"ad-free視聴を廃止します。本日Amazon Prime会員に送られたメールに"
"よると、9月14日以降、ad-free視聴はTwitch Primeに含まれなくなる予定"
"です。ただし、年間契約をしている既存の会員は、契約更新まで"
... | 28.357143 | 67 | 0.717884 |
b821cea65dd0b8f070a6f670290863ccc9f9b790 | 2,401 | py | Python | aecb/api/management/commands/sample_db.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/management/commands/sample_db.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/management/commands/sample_db.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | import random
import string
from ...models import *
from django.core.management.base import BaseCommand
from django.core import management
from django_seed import Seed
class Command(BaseCommand):
"""
"""
def add_arguments(self, parser):
parser.add_argument('number', type=int)
def random_arr... | 39.360656 | 155 | 0.626822 |
c52b0d4ab6bf99feaa8be66964e99ee17bb6b238 | 1,808 | py | Python | main.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | main.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | main.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | #import sys
# insert at 1, 0 is the script path (or '' in REPL)
#sys.path.insert(1, '/home/pi/bigBrother/sensoro/functions')
#import functions
from threading import Thread
import time
import RPi.GPIO as GPIO
import dht11
import Database
from Database import Database
from sensoro.functions.days import days
from sensoro.... | 19.868132 | 61 | 0.615597 |
c55a30dc42300c3e99dd120dc1f26b25b82f7323 | 4,253 | py | Python | animator-2021-04-13.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | animator-2021-04-13.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | animator-2021-04-13.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | import math
import logging
from tkinter import Tk, Canvas
import time
import random
import json
BLACK = "black"
WHITE = "white"
SEED = 0
auto = False
# logging.basicConfig(level=logging.DEBUG)
class Cell:
def __init__(self, x, y, state=BLACK):
self.x, self.y, self.state = x, y, state
def switchSta... | 22.62234 | 78 | 0.575123 |
3d993905b648411539bf1aa9f4510a59eb740798 | 1,993 | py | Python | MySql.py | whde/Movie | 5d712642242042b0fa2e43f526605def9a6a4343 | [
"MIT"
] | 1 | 2018-12-03T06:08:46.000Z | 2018-12-03T06:08:46.000Z | MySql.py | whde/Movie | 5d712642242042b0fa2e43f526605def9a6a4343 | [
"MIT"
] | null | null | null | MySql.py | whde/Movie | 5d712642242042b0fa2e43f526605def9a6a4343 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import pymysql
import threading
mu = threading.Lock()
class MySql:
def __init__(self):
print('mysql __init__')
self.db1 = pymysql.connect(
host="localhost",
user="root",
passwd="Whde8751643",
port=3306,
... | 24.9125 | 65 | 0.513297 |
4928e9569da63ac4704cad95beb9f86184a6cab2 | 217 | py | Python | MAIN/STM32F405/V16/main.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405/V16/main.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405/V16/main.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | import system
import machine
import sys
if __name__ == "__main__":
while True:
try:
system.loop()
except:
#machine.reset()
pass
else:
#sys.exit()
pass
| 13.5625 | 28 | 0.511521 |
4929dba2892ebec58db5037c0c191c8451983870 | 5,111 | py | Python | test/test_npu/test_network_ops/test_frac.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_frac.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_frac.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# 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 app... | 33.847682 | 74 | 0.614166 |
4989363b2880dd3b86021b7d3b79c29b100ba445 | 489 | py | Python | script.py | doorlay/spongebobMemeGenerator | dce3e260e4c68b21db02ddcabb9aed4dd6a8c03c | [
"MIT"
] | null | null | null | script.py | doorlay/spongebobMemeGenerator | dce3e260e4c68b21db02ddcabb9aed4dd6a8c03c | [
"MIT"
] | null | null | null | script.py | doorlay/spongebobMemeGenerator | dce3e260e4c68b21db02ddcabb9aed4dd6a8c03c | [
"MIT"
] | null | null | null | # Main file for my spongebob meme generator
import random
def alterSentence():
sentence = input("Enter your sentence: ")
s = sentence.lower()
lengthOfString = len(s)
# An average of 1/2 of letters will become capital
length = lengthOfString / 2
indices = set()
for x in range(1,int(length))... | 27.166667 | 77 | 0.658487 |
620687bcd2151181e20393f086d4ddd5dad87c17 | 2,764 | py | Python | examples/machine_translation/transformer/deploy/serving/transformer_web_client.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/transformer_web_client.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/transformer_web_client.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import argparse
import yaml
from attrdict import AttrDict
from pprint import pprint
import requests
import json
import os, sys
import time
from paddlenlp.datasets import load_dataset
from paddle_serving_client.utils import MultiThreadRunner
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argu... | 30.373626 | 88 | 0.596599 |
626ad35452c1dc25863be1eddb434731de097055 | 6,076 | py | Python | src/test/tests/hybrid/selections_pp.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/selections_pp.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/hybrid/selections_pp.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: selection_pp.py
#
# Tests: filter - named selection
# operator - persistent particles
# plot - pseudocolor
#
# Defect ID: -
#
# Programmer: Allen Sa... | 28.660377 | 96 | 0.714779 |
02fb9dbd079999a7e3771d1b7600d85e096b9806 | 453 | py | Python | elements/python/6/20/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/6/20/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/6/20/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import random
import collections
def weighted_random_choice(weights):
r = random.randrange(sum(weights))
for i, w in enumerate(weights):
if r < w:
return i
r -= w
def counts(weights, trials=1000):
c = collections.Counter()
for _ in xrange(trials):
i = weighted_ran... | 16.777778 | 43 | 0.593819 |
b265ac6d885fe39c38e19b813d153eb7203a9962 | 819 | py | Python | Produkte/migrations/0004_auto_20170508_1018.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Produkte/migrations/0004_auto_20170508_1018.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Produkte/migrations/0004_auto_20170508_1018.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-05-08 08:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Produkte', '0003_auto_20170504_1503'),
]
operations = [
migrations.RemoveFi... | 24.088235 | 62 | 0.559219 |
b268c9d594ba900c7a94fcd7c3d3ecd51690dab9 | 2,010 | py | Python | src/ingestion/sources/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/ingestion/sources/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/ingestion/sources/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from typing import Any, Dict, Type
import json
from .base import (
Extractor,
Source,
SourceConfiguration,
SQLAlchemyExtractor,
)
from .postgresql import PostgreSQLSource, PostgreSQLSourceConfiguration
from .snowflake import SnowflakeSource, SnowflakeSourceConfiguration
from .redshift import RedshiftSour... | 34.067797 | 97 | 0.68607 |
a284b91efec3dfecfdbba3c7e23b0eaa121119a1 | 937 | py | Python | tests/test_connectors/test_zmq.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | tests/test_connectors/test_zmq.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | tests/test_connectors/test_zmq.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | from unittest.mock import MagicMock, patch
from volley.connectors.zmq import ZMQConsumer, ZMQProducer
from volley.data_models import QueueMessage
@patch("volley.connectors.zmq._socket")
def test_zmqconsumer(mocked_zsmq: MagicMock) -> None:
msg = "test-message"
mocked_zsmq.recv.return_value = msg
consumer... | 34.703704 | 82 | 0.734258 |
a2da2d868c76a700e5f03eef04f7a89b8c125d7e | 1,289 | py | Python | analysis/streaming.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | 1 | 2018-08-31T07:16:40.000Z | 2018-08-31T07:16:40.000Z | analysis/streaming.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | null | null | null | analysis/streaming.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | 1 | 2018-07-01T18:03:01.000Z | 2018-07-01T18:03:01.000Z | """
__author__ = Yash Patel
__name__ = streaming.py
__description__ = Runs spectral clustering for deanonymization on the BTC network,
in a streaming fashion (as opposed to batch processing as done in spectral.py). This
follows the implementation described in full by:
http://www.shivakasiviswanathan.com/ICDE16a... | 26.306122 | 86 | 0.649341 |
ce1d01562620a7f5e6a30f5bf4c21f20f451d3f5 | 554 | py | Python | Build with a Cloud Technology/main.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-05T14:30:34.000Z | 2021-07-05T14:30:34.000Z | Build with a Cloud Technology/main.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-02T15:36:02.000Z | 2021-07-02T15:37:25.000Z | Build with a Cloud Technology/main.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-02T15:15:17.000Z | 2021-07-02T15:15:17.000Z | # IoT Weather Station
import helpers
from time import sleep
sleepTime = 5 # seconds
eventName = "weather" # the name of the event as registered on the cloud
# main program
def __main__():
while True:
# read the weather data from the arduino dock
weatherData = helpers.getWeatherData()
... | 24.086957 | 74 | 0.620939 |
02317cb5ab5a404605c246ea077bb06b52d07267 | 1,244 | py | Python | backend/apps/iamstudent/migrations/0010_custom_migration.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/iamstudent/migrations/0010_custom_migration.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/iamstudent/migrations/0010_custom_migration.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from django.db import migrations, transaction
import logging
def update_emails(apps, schema_editor):
EmailToSend = apps.get_model('iamstudent', 'EmailToSend')
EmailGroup = apps.get_model('iamstudent', 'EmailGroup')
with transaction.atomic():
groups = {}
for email in EmailToSend.objects.a... | 29.619048 | 108 | 0.595659 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.