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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
49fcbb0212a61482f366b40f32bd1dd9bb9b1fe4 | 4,880 | py | Python | python/oneflow/autograd/autograd_mode.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/autograd/autograd_mode.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/autograd/autograd_mode.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.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... | 28.705882 | 97 | 0.63668 |
b74d6d6a82092091b6ba056ae5abad6462d767bd | 2,984 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/share_transfer/test_share_transfer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/share_transfer/test_share_transfer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/share_transfer/test_share_transfer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.accounts.doctype.share_transfer.share_transfer import ShareDontExists
test_dependencies = ["Share Type", "Shareholder"]
cla... | 26.40708 | 82 | 0.569035 |
b75fa5652d73ae2f70fba97edee70d685d890a72 | 2,608 | py | Python | pythonDemo/main.py | SteveWooo/ethnet | 34855b621d1933c0258443cd785ef942906aad58 | [
"Apache-2.0"
] | null | null | null | pythonDemo/main.py | SteveWooo/ethnet | 34855b621d1933c0258443cd785ef942906aad58 | [
"Apache-2.0"
] | 1 | 2021-03-10T17:14:42.000Z | 2021-03-10T17:14:42.000Z | pythonDemo/main.py | SteveWooo/ethnet | 34855b621d1933c0258443cd785ef942906aad58 | [
"Apache-2.0"
] | null | null | null | import socket
import threading
import time
import struct
import rlp
from secp256k1 import PrivateKey
from ipaddress import ip_address
import hashlib
import _pysha3
# from _pysha3 import keccak_256
import math
def keccak256(s):
k = _pysha3.keccak_256()
k.update(s)
return k.digest()
class EndPoint(object):
... | 29.977011 | 82 | 0.656058 |
b78de6d1f5734c30badc9941466554aecc67e28e | 2,623 | py | Python | testsplit.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | 1 | 2020-12-31T01:57:33.000Z | 2020-12-31T01:57:33.000Z | testsplit.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | null | null | null | testsplit.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | null | null | null | import json
def clear_string(color_string):
#we have two cases red is
returnstring=''
split_string = color_string.split("-")
#['', 'r123', 'g456', 'b789']
#if the colors dont contain 3 digits then we have to do fillings with the zero.
for substring in split_string:
if substring.startswi... | 34.513158 | 159 | 0.638963 |
4d79dba34acaee69e64f286cfa085abbe1a05bcb | 25,727 | py | Python | convertx/styles.py | VolkerBergen/convertx | 3d11f94e5ff20b17381c626848fe26e82a5c9cb7 | [
"BSD-2-Clause"
] | null | null | null | convertx/styles.py | VolkerBergen/convertx | 3d11f94e5ff20b17381c626848fe26e82a5c9cb7 | [
"BSD-2-Clause"
] | 5 | 2022-01-06T20:34:22.000Z | 2022-01-17T14:58:05.000Z | convertx/styles.py | VolkerBergen/convertx | 3d11f94e5ff20b17381c626848fe26e82a5c9cb7 | [
"BSD-2-Clause"
] | 1 | 2022-01-05T13:17:57.000Z | 2022-01-05T13:17:57.000Z | import re
import os
import random
from copy import copy
import pycld2
import zipfile
from lxml import etree
from .book_ids import BOOK_DICT
ooXMLns = {'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'}
BOOKS = re.sub(r'([1-5]\s)', r'', '|'.join(list(BOOK_DICT.values())))
BOOKS_NT = re.sub(r'([1-5]\s)... | 43.093802 | 208 | 0.497532 |
4d869d47cbbb2e5165d60417a2ed16d84a4602ed | 40,134 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/cluster.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/cluster.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/cluster.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | """Distributed execution using an IPython cluster.
Uses IPython parallel to setup a cluster and manage execution:
http://ipython.org/ipython-doc/stable/parallel/index.html
Borrowed from Brad Chapman's implementation:
https://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/distributed/ipython.py
"""
import context... | 39.736634 | 110 | 0.616933 |
1508c59d6c207f1e3e29ecf0dd0a5fcbf324aeac | 455 | py | Python | verto/errors/ImageMissingCaptionError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/errors/ImageMissingCaptionError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/errors/ImageMissingCaptionError.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from verto.errors.Error import Error
class ImageMissingCaptionError(Error):
'''Exception raised when an image is missing a subtitle.
Attributes:
tag: tag which was not matched
argument: the argument that was not found
'''
def __init__(self, tag, argument):
self.tag = tag
... | 26.764706 | 66 | 0.648352 |
67113c140a38da9be6101192457d0cc8a191bbe7 | 5,124 | py | Python | layout.py | ascanio73/fotobox | e18f998e6856d1f661db65f723274e2da2c90c79 | [
"MIT"
] | null | null | null | layout.py | ascanio73/fotobox | e18f998e6856d1f661db65f723274e2da2c90c79 | [
"MIT"
] | null | null | null | layout.py | ascanio73/fotobox | e18f998e6856d1f661db65f723274e2da2c90c79 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'layout.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form... | 48.339623 | 211 | 0.671936 |
6722ace0153b3db77de17dc09d9e0da476208bc5 | 1,443 | py | Python | Imaginary/2021/web/aMAZEing-challenge/client.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/web/aMAZEing-challenge/client.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/web/aMAZEing-challenge/client.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import json
import requests
from os import system
from pprint import pprint
from maze import Maze
from cookie_decoder import cookie_decode
API = "http://127.0.0.1:9001"
# IMPORTANT:
# This is just a template, you can change it or create your own client to talk to the server.
# It's almost impossible to get the flag... | 22.2 | 118 | 0.697159 |
97ff18506988a2a640b4578ce63901fb4ee44040 | 136 | py | Python | lib/python3.5/site-packages/GPSReader/__init__.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/GPSReader/__init__.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/GPSReader/__init__.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | # -*- coding: cp1252 -*-
# $Id: __init__.py 33 2010-05-06 17:21:14Z cfluegel $
from GPSReader import *
from GPSError import *
| 19.428571 | 55 | 0.632353 |
3f27f13c1b75e4d2d725e5b802149aadda6a35ce | 6,451 | py | Python | main.py | MrHallway0/MazeGenerator | e3cdae67e1ed1b64816beb488e73ada467141f42 | [
"MIT"
] | null | null | null | main.py | MrHallway0/MazeGenerator | e3cdae67e1ed1b64816beb488e73ada467141f42 | [
"MIT"
] | null | null | null | main.py | MrHallway0/MazeGenerator | e3cdae67e1ed1b64816beb488e73ada467141f42 | [
"MIT"
] | null | null | null | import random
from colorama import init
from colorama import Fore
def printMaze(maze):
for i in range(0, height):
for j in range(0, width):
if (maze[i][j] == 'u'):
print(Fore.WHITE + str(maze[i][j]), end=" ")
elif (maze[i][j] == 'c'):
print(Fore.GREEN + str(maze[i][j]), end=" ")
else:
print(For... | 29.456621 | 95 | 0.594792 |
58d23ca678c575e4f27938e5347c0cd001302188 | 92 | py | Python | 2014/05/table-fees-by-phase/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/05/table-fees-by-phase/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/05/table-fees-by-phase/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1zBSuHJFZhfREvV9_7aQaDAM9q_OoJExgEb0uw-xnnWk'
| 23 | 68 | 0.836957 |
58fcb9fc401329eb3f329cbb758f61cf27311d2a | 2,845 | py | Python | src/test/tests/databases/FITS.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/FITS.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/databases/FITS.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: FITS.py
#
# Tests: mesh - 2D structured, 3D structured
# plots - Pseudocolor, TrueColor
#
# Programmer: Brad Whitlock
# Date: Thu Jul 20 14:07:49 PST 2006
#
# Modifica... | 22.943548 | 78 | 0.603515 |
18c2001404a557eb0bfee8a71ecc0a1e111d0723 | 38 | py | Python | .tools/pagan.py | XLAR-8/M-KIT | 19952ebe92e61b1733d63b8e59b107bc9c9e6f64 | [
"Apache-2.0"
] | null | null | null | .tools/pagan.py | XLAR-8/M-KIT | 19952ebe92e61b1733d63b8e59b107bc9c9e6f64 | [
"Apache-2.0"
] | null | null | null | .tools/pagan.py | XLAR-8/M-KIT | 19952ebe92e61b1733d63b8e59b107bc9c9e6f64 | [
"Apache-2.0"
] | null | null | null | msg = "Hello "
subject = "Hello world" | 19 | 23 | 0.657895 |
e14873437937537b2a8e75535302c8baf1cdbcdf | 2,866 | py | Python | 3_DeepLearning-CNNs/04_CNN_Optimization/1-Preprocessing/Dataset_class.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 3_DeepLearning-CNNs/04_CNN_Optimization/1-Preprocessing/Dataset_class.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 3_DeepLearning-CNNs/04_CNN_Optimization/1-Preprocessing/Dataset_class.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | '''
Preprocessing sollte auf Daten immer angewandt werden, da es nur bessere Ergebnisse liefern kann.
wird nur auf die Trainingsdaten angewandt - wenn das Netz auf neue unbekannte Daten
angewandt wird müssen diese davor auch preprocessing durchlaufen, da das Netz die Daten sonst nicht einordnen kann.
'''
import numpy... | 42.776119 | 115 | 0.692952 |
e17f92b152f7caaa238fbfbe1b2d2982ea8211e5 | 402 | py | Python | Curso_Python/Secao9-Django-Projeto-Agenda-163-183/projeto_agenda/contatos/migrations/0004_auto_20201022_0914.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao9-Django-Projeto-Agenda-163-183/projeto_agenda/contatos/migrations/0004_auto_20201022_0914.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao9-Django-Projeto-Agenda-163-183/projeto_agenda/contatos/migrations/0004_auto_20201022_0914.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-22 12:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contatos', '0003_contato_foto'),
]
operations = [
migrations.AlterField(
model_name='contato',
name='foto',
... | 21.157895 | 72 | 0.59204 |
3656de46dc310b0d5e5a25c5939fe00806f40b5d | 298 | py | Python | PythonPro/demo/module.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | PythonPro/demo/module.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | PythonPro/demo/module.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | #coding=utf-8
#模块
# 导入内置math模块
import math
content = dir(math)
print content;
# Money = 2000
# def AddMoney():
# # 想改正代码就取消以下注释:
# global Money
# Money = Money + 1
#
# print Money
# AddMoney()
# print Money
# 导入模块
# import support
#
# # 现在可以调用模块里包含的函数了
# support.print_func("Runoob")
| 11.461538 | 30 | 0.654362 |
366f62a6b0edbc07bb69095d0a84a71c3f0f2c2f | 3,673 | py | Python | skil/resources/common.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | skil/resources/common.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | skil/resources/common.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | from .base import Resource
from .compute import *
from .storage import *
def get_all_resources(skil):
'''Get all current SKIL resources as a list of
skil.resources.base.Resource instances.
'''
resource_list = skil.api.get_resources()
resources = []
for resource_obj in resource_list:
r... | 40.811111 | 103 | 0.658862 |
7fcbbc48a201f048ad35fee2f7de10348ab25ff2 | 1,139 | py | Python | src/visitpy/visit_utils/tests/test_status.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_utils/tests/test_status.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_utils/tests/test_status.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: test_status.py
author: Cyrus Harrison (cyrush@llnl.gov)
created: 8/4/2011
description... | 26.488372 | 73 | 0.682177 |
3d048e1fb97fef053a00d1894a69a64b6726a784 | 11,881 | py | Python | Packs/PhishLabs/Integrations/PhishLabsIOC_EIR/PhishLabsIOC_EIR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PhishLabs/Integrations/PhishLabsIOC_EIR/PhishLabsIOC_EIR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PhishLabs/Integrations/PhishLabsIOC_EIR/PhishLabsIOC_EIR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from PhishLabsIOC_EIR import Client
'''Globals'''
INDICATORS_EC = [
(
'url-phishlabs',
{
"url": "https://google.com/",
"malicious": "false",
"maliciousDomain": "false"
},
{
'URL': "https://google.com/",
'Malic... | 34.140805 | 117 | 0.427658 |
6294efc6833b29594557b4474c791fb9ba0dd9f4 | 242 | py | Python | Online-Judges/DimikOJ/Python/40-darar-sum-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/40-darar-sum-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/40-darar-sum-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def darar_sum(x, k):
sumition = 0
for i in range(k+1):
sumition += (x ** i)
return sumition
t = int(input())
for _ in range(t):
x, k = input().split()
x, k = int(x), int(k)
print("Result =", darar_sum(x, k))
| 18.615385 | 38 | 0.516529 |
1a03c51edfed1899bc0c5a0a86aec5931d0d6d1c | 429 | py | Python | BITs/2014/Kozlov_A_D/task_2_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Kozlov_A_D/task_2_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Kozlov_A_D/task_2_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 2. Вариант 11.
#Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является О. Генри. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
#Козлов А.Д.
#21.02.2016
input("Дело не в дороге, которую мы выбираем; то, что внутри нас, заст... | 71.5 | 200 | 0.773893 |
c53d22d48b7be5d9b47f38e24e7d668f2e878927 | 284 | py | Python | src/bo4e/enum/preismodell.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/preismodell.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/preismodell.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Preismodell(StrEnum):
"""
Bezeichnung der Preismodelle in Ausschreibungen für die Energielieferung.
"""
FESTPREIS = "FESTPREIS" #: FESTPREIS
TRANCHE = "TRANCHE" #: TRANCHE
| 23.666667 | 77 | 0.714789 |
3ddeb90eec496c37ac90b5cbd8d655c254a52bde | 3,034 | py | Python | manager/cli.py | suvambasak/fog-service-orchestration | 8404484c32b2f6c0bfb2ed820dc46d56f055141d | [
"Apache-2.0"
] | null | null | null | manager/cli.py | suvambasak/fog-service-orchestration | 8404484c32b2f6c0bfb2ed820dc46d56f055141d | [
"Apache-2.0"
] | null | null | null | manager/cli.py | suvambasak/fog-service-orchestration | 8404484c32b2f6c0bfb2ed820dc46d56f055141d | [
"Apache-2.0"
] | 1 | 2022-02-02T14:49:40.000Z | 2022-02-02T14:49:40.000Z | import asyncio
import websockets
import multiprocessing
import json
import os
import shlex
from orchestration_manager import OrchestrationManager
from printer import ColorPrint
async def cli(host="localhost", port=80):
"CLI for Orchestration Manager"
def orchestration_manager() -> None:
"Orchestratio... | 28.622642 | 90 | 0.511536 |
9a88b915ba7a196d334f5279ef797afdd6de8e47 | 224 | py | Python | src/onegov/gazette/translations.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/translations.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/translations.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains a list of manual translations. Those are usually messages that
exist in external packages which provide no translations.
"""
from onegov.gazette import _
# messages defined in wtforms
_("CSRF token expired")
| 22.4 | 75 | 0.776786 |
9aae384510707d307e766b20c30c46a236a4f5f5 | 3,122 | py | Python | official/cv/simple_pose/src/network_define.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/simple_pose/src/network_define.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/simple_pose/src/network_define.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... | 36.302326 | 78 | 0.639974 |
b103f8e13ab92d772a5049725a5fbcc937dc462d | 142 | py | Python | 02.Sort/HG/P42748.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 02.Sort/HG/P42748.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 02.Sort/HG/P42748.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | def solution(array, commands):
answer = []
for i, j, k in commands:
answer.append(sorted(array[i-1:j])[k-1])
return answer | 28.4 | 48 | 0.605634 |
b11a96bfc27ec896913c08798231586218ee14ec | 423 | py | Python | resizer.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | 1 | 2020-06-29T12:33:15.000Z | 2020-06-29T12:33:15.000Z | resizer.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | null | null | null | resizer.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from PIL import Image
def resize (img, origin, result ,width, height):
size = (width, height)
imgpath = origin + img
im = Image.open(imgpath)
im.save(result+img)
outfile = result + img[:img.rfind(".")] + "_"+ unicode(width)+"x"+unicode(height)+".png"
im = im.resize(size)
im... | 23.5 | 89 | 0.628842 |
77226f0379a67e086a1cdcff92750947a5e7362f | 332 | py | Python | python/pyqt/pyqt_designer_example/first_steps_with_qt_designer/ui_loading.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/pyqt_designer_example/first_steps_with_qt_designer/ui_loading.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/pyqt_designer_example/first_steps_with_qt_designer/ui_loading.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import uic
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
uic.loadUi('mainwindow.ui', self)
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()... | 22.133333 | 42 | 0.707831 |
65728be5bc68345f83db6c55429e699d677fb1f5 | 1,568 | py | Python | tf/old_clasificador/clasifica_dir.py | alffore/lokroids-python | ac3bbc328140e53ab181034d2e3d5d5d17dc9203 | [
"MIT"
] | null | null | null | tf/old_clasificador/clasifica_dir.py | alffore/lokroids-python | ac3bbc328140e53ab181034d2e3d5d5d17dc9203 | [
"MIT"
] | null | null | null | tf/old_clasificador/clasifica_dir.py | alffore/lokroids-python | ac3bbc328140e53ab181034d2e3d5d5d17dc9203 | [
"MIT"
] | null | null | null | ##
## Código que clasifica un conjunto de imagenes
##
## AAFR <alffore@gmail.com> 28 de marzo de 2018
import json
import glob
import tensorflow as tf
import sys
def clasifica_image(image_path):
"""Funcion que clasifica imagenes de un directorio"""
# lee la imagen en image_data
image_data = tf.gfile.FastG... | 25.704918 | 85 | 0.664541 |
658691ab0331d6d7d62d537a45bbed9bfecbb09f | 470 | py | Python | 2020-09-03-1234-gma_Klassen_main_becher.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-03-1234-gma_Klassen_main_becher.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-03-1234-gma_Klassen_main_becher.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
os.chdir("D:\Selfcoding\WillmsBis040920\scara64anaconda\Klassen")
from becher import *
# Test Becher
a = Becher(500, 200)
a.ausgabe()
b = Becher(300)
b.ausgabe()
# c = Becher(-100)
# d = Becher(100, -200)
# Test auffuellen()
## Menge passt
a = Becher(200, 0)
men... | 13.823529 | 66 | 0.610638 |
659397b5e425e0cf090317e76922ab6984e9b471 | 396 | py | Python | microblog.py | YangWang1231/FlaskWeb | 7d1f53f1b3e69781cba3c850bfd9e10cd6e4b088 | [
"MIT"
] | null | null | null | microblog.py | YangWang1231/FlaskWeb | 7d1f53f1b3e69781cba3c850bfd9e10cd6e4b088 | [
"MIT"
] | null | null | null | microblog.py | YangWang1231/FlaskWeb | 7d1f53f1b3e69781cba3c850bfd9e10cd6e4b088 | [
"MIT"
] | null | null | null | from app import app, db
from app.models import User, Post
from os import environ
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'User': User, 'Post': Post}
if __name__ == '__main__':
HOST = environ.get('SERVER_HOST', 'localhost')
try:
PORT = int(environ.get('SERVER_PORT',... | 26.4 | 54 | 0.661616 |
0c203311fd1e736fba1659825f7ad2cea7a9831f | 835 | py | Python | books/PythonCleanCode/ch5_decorator/decorator_side_effect_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch5_decorator/decorator_side_effect_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch5_decorator/decorator_side_effect_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 5: Decorators
> Example of desired side effects on decorators
"""
EVENTS_REGISTRY = {}
def register_event(event_cls):
"""Place the class for the event into the registry to make it accessible in
the module.
"""
EVENTS_REGISTRY[event_cls.__name__] = ev... | 19.880952 | 88 | 0.653892 |
0c540fd9a5142170828eba7ba43cee41cf38619e | 2,434 | py | Python | huTools/async.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/async.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/async.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
async.py - functions for asyncrounous code
Created by Maximillian Dornseif on 2009-02-15.
Copyright (c) 2009 HUDORA. All rights reserved.
parts based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/84317
"""
from __future__ import unicode_literals
from builtins i... | 31.61039 | 107 | 0.644618 |
3bc7f7221ceb22b5a7c596f5da389ac9b551e816 | 801 | py | Python | src/onegov/people/collections/people.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/people/collections/people.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/people/collections/people.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core import utils
from onegov.core.collection import GenericCollection
from onegov.people.models import Person
class PersonCollection(GenericCollection):
""" Manages a list of people.
Use it like this::
from onegov.people import PersonCollection
people = PersonCollection(session)... | 22.885714 | 73 | 0.635456 |
5a5db34de33258712b83c4307d4246c1b43bde15 | 332 | py | Python | src/labtest/urls.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/labtest/urls.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/labtest/urls.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | # from django.urls import path
# from django.urls import include
# from rest_framework import routers
# from . import views
# router = routers.DefaultRouter()
# router.register(r'locations', views.LocationViewSet)
# urlpatterns = [
# path('locations', views.locations),
# path('blackout-dates', views.blackout_... | 25.538462 | 54 | 0.725904 |
ceb817f6822ccd7dc5955d516d92b81a98304ddd | 2,576 | py | Python | src/visitpy/examples/setview2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/examples/setview2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/examples/setview2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# Test script that changes animates an isosurface by changing its iso-value.
#
# Modifications:
# Hank Childs, Tue May 7 09:27:44 PDT 2002
# Updated for 0.9.9. Made it use a file in the /data directory.
# Also update view settin... | 30.305882 | 102 | 0.580745 |
b2d7925f50c422c14441b7ef59f8f7a56d02b693 | 5,922 | py | Python | SP2WS.py | RiceChen/SP2WS | 0ead8869073769f473c5f649ce37f7466c4f146c | [
"Apache-2.0"
] | null | null | null | SP2WS.py | RiceChen/SP2WS | 0ead8869073769f473c5f649ce37f7466c4f146c | [
"Apache-2.0"
] | null | null | null | SP2WS.py | RiceChen/SP2WS | 0ead8869073769f473c5f649ce37f7466c4f146c | [
"Apache-2.0"
] | null | null | null | import win32pipe, win32file
import time, datetime
import struct
import serial
import sys
class sp2ws_serial():
def __init__(self, port, baudrate):
self.port = port
self.baudrate = baudrate
def open(self):
self.ser = serial.Serial(self.port, self.baudrate, timeout = 0.5)
def close(... | 33.083799 | 109 | 0.500338 |
0bcea1fa4b93cb1955dbb6c93eb5b2292e457be4 | 527 | py | Python | games/fixed/q_table/basic.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | games/fixed/q_table/basic.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | games/fixed/q_table/basic.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | # Game controller implementation
from games.fixed.base import FixedGame
from envs.fixed.basic import BasicFixedEnvironment, StateFormat
from agents.q_table import QTable
from renderers.fixed.text import TextFixedRenderer
if __name__ == "__main__":
# 初始化环境、智能体、渲染器、游戏控制器
env = BasicFixedEnvironment()
agent =... | 35.133333 | 65 | 0.755218 |
501411aaa613fbab6b8b5d2e6e5fe11607d828e3 | 202 | py | Python | Beginner/03. Python/string_reverse.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-04T05:41:43.000Z | 2021-10-04T05:41:43.000Z | Beginner/03. Python/string_reverse.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/string_reverse.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | def strreverse(s):
if len(s) == 0:
return s
else:
return strreverse(s[1:]) + s[0]
s = "Mustafa"
print ("original: ",end="")
print (s)
print ("reversed: ",end="")
print (strreverse(s))
| 14.428571 | 34 | 0.564356 |
50b3e2d8c7e85b5418320a5bf83c71564181b8e8 | 13,513 | py | Python | Classes/Game_state.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Game_state.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Game_state.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | import Classes.Wall as w
import Classes.Brick as b
import Classes.Bomb as bomb
import Classes.Player_object_board as Player_ob
import json
from PyQt5 import QtCore
import random
from Classes.Powerup import Powerup
import time
from threading import Thread
class Game_state(QtCore.QObject):
bomb_must_blow = QtCore.p... | 33.44802 | 249 | 0.519204 |
a8ef8a7fb71e96c3be4ade7c1fe201b4d236202e | 6,023 | py | Python | bigbench/benchmark_tasks/multistep_arithmetic/task.py | lintangsutawika/BIG-bench | 230057960f8682b0051b2a1c4c3c6e0830f72769 | [
"Apache-2.0"
] | 460 | 2021-01-26T21:23:37.000Z | 2022-03-31T15:55:10.000Z | bigbench/benchmark_tasks/multistep_arithmetic/task.py | lintangsutawika/BIG-bench | 230057960f8682b0051b2a1c4c3c6e0830f72769 | [
"Apache-2.0"
] | 475 | 2021-01-27T01:29:01.000Z | 2022-03-30T20:23:56.000Z | bigbench/benchmark_tasks/multistep_arithmetic/task.py | lintangsutawika/BIG-bench | 230057960f8682b0051b2a1c4c3c6e0830f72769 | [
"Apache-2.0"
] | 305 | 2021-01-26T23:28:11.000Z | 2022-03-31T14:51:26.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 43.963504 | 218 | 0.607173 |
d11f92bb28b7678eb4e1977fc5e14e120fa3a456 | 2,017 | py | Python | whatsapp-hacking-master/grabber.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | whatsapp-hacking-master/grabber.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | whatsapp-hacking-master/grabber.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import base64
import os
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
browser = webdriver.Firefox() # init browser
browser.get("https://web.what... | 43.847826 | 111 | 0.66237 |
0e76a8eec952349b250b4b91459f2d041bff347f | 2,082 | py | Python | wz/timetable0/dep2tsv.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/timetable0/dep2tsv.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/timetable0/dep2tsv.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
timetable/dep2tsv.py
Last updated: 2021-07-22
Convert PB's Deputatspläne to something like tsv so that they can be
compared using a diff utility.
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.... | 32.53125 | 79 | 0.639289 |
7eee899008cbae7ed3dc1142c22b6b742aaa33a2 | 483 | py | Python | rabbitmq/tutorial/emit_log.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/emit_log.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/emit_log.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pika
import sys
credentials = pika.PlainCredentials('admin', '1q2w3e')
parameters = pika.ConnectionParameters('192.168.1.197', 5672, '/', credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.exchange_declare(exchange='logs', exchange_type='fanout')
message = ' '... | 34.5 | 79 | 0.749482 |
cb243ae1ee70ab7c8dccec41b71062d7a6ee05ce | 4,166 | py | Python | src/classifier/data_processing/text_embedding/vectorizer.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/classifier/data_processing/text_embedding/vectorizer.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/classifier/data_processing/text_embedding/vectorizer.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | import os
import logging
from abc import ABC, abstractmethod
from sklearn.feature_extraction.text import TfidfVectorizer
from collections import defaultdict
import numpy as np
# https://nadbordrozd.github.io/blog/2016/05/20/text-classification-with-word2vec/
# Get mean sentence embeddings
class Vectorizer(ABC):
... | 34.716667 | 83 | 0.523044 |
cb7dcd605cbc0dca2192d4abbb044a0dacc31139 | 1,730 | py | Python | Problems/Dynamic Programming/Medium/MinFallingPathSum/min_falling_path_sum.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/MinFallingPathSum/min_falling_path_sum.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/MinFallingPathSum/min_falling_path_sum.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from functools import lru_cache
from typing import List, Union
# Top-down (Memoization)
# TC: O(M * N); SC: O(M * N)
def minFallingPathSum(self, matrix: List[List[int]]) -> int:
m, n = len(matrix), len(matrix[0])
@lru_cache(None)
def dp(i: int, j: int) -> Union[float, int]:
if j < 0 or j == n:
... | 29.322034 | 95 | 0.486127 |
1dac6309eee7fde3b476e6b047a2e818af68f022 | 1,263 | py | Python | example/simple.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | example/simple.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | example/simple.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | from typing import List, Tuple
from pydantic import BaseModel
from volley.engine import Engine
# define data models for the incoming and outgoing data
class InputMessage(BaseModel):
"""validate the incoming data"""
list_of_values: List[float]
class OutputMessage(BaseModel):
"""validate the outgoing d... | 21.775862 | 65 | 0.673793 |
38451fa393285b8a6fdba43ea84b0642a846e00a | 575 | py | Python | 2015/08/nola-publichousing-20150812/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/08/nola-publichousing-20150812/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/08/nola-publichousing-20150812/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1J5zo2QbvEh73-p7uPagI0ppWAiNdIwbCUIpgXz7fraA'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
DEVELOPMENTS =... | 27.380952 | 77 | 0.732174 |
38e7cb587d6fe61e623007e4d05fa174431a50bf | 2,485 | py | Python | tikz/validation-curve/edit_curve.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/validation-curve/edit_curve.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/validation-curve/edit_curve.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | #!/usr/bin/env python
import csv
import glob
import numpy as np
history_files = glob.glob("cifar100_*.csv")
print(history_files)
data = []
loss = []
for filename in history_files:
print(filename)
with open(filename) as f:
reader = csv.reader(f)
datathis = [row for row in reader]
if len(d... | 28.238636 | 77 | 0.565795 |
2a317f9be08174ecf02f1c07980a42423af56896 | 487 | py | Python | python/generator_tricks_for_systemprogrammer/genmessages.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genmessages.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genmessages.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # genmessages.py
#
# A generator that yields messages on a UDP socket
import socket
def receive_messages(addr, maxsize):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(addr)
while True:
msg = s.recvfrom(maxsize)
yield msg
# Example use
# To send a message to... | 22.136364 | 65 | 0.638604 |
2a60cacb13bd91e947240b290c7d13954bc926d8 | 1,318 | py | Python | scratch/asycio_and_streams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | scratch/asycio_and_streams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | scratch/asycio_and_streams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | import asyncio
import os
import sys
logfile = open('log_asyncio_and_streams.txt', 'w')
def log(txt: str):
logfile.write(txt)
logfile.flush()
log('asyncio_and_streams progress log:\n\n')
async def long_running():
log('enter long_running()\n')
await asyncio.sleep(0.05)
log('long_running: 1\n')
... | 22.338983 | 63 | 0.663885 |
630a1535f521cf7ae1ebd66439190bf53a99f787 | 3,407 | py | Python | module_5/pytech_insert.py | RandyGoodnight/TEST | 0a24db0d4914b046f768543203c761dd0fb02721 | [
"MIT"
] | null | null | null | module_5/pytech_insert.py | RandyGoodnight/TEST | 0a24db0d4914b046f768543203c761dd0fb02721 | [
"MIT"
] | null | null | null | module_5/pytech_insert.py | RandyGoodnight/TEST | 0a24db0d4914b046f768543203c761dd0fb02721 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
# MongoDB connection string
url = "mongodb+srv://admin:admin@cluster0.gg85n.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"
# connect to the MongoDB cluster
client = MongoClient(url)
# connect pytech database
db = client.pytech
# Jimmy Document
jimmy = {
"student_id": ... | 30.693694 | 122 | 0.492222 |
4f059904f12202b18ff6080d6e9a6229a67287cb | 644 | py | Python | Chapter2_Python/17-TypeAnnotations.py | olebause/TensorFlow2 | 70fcb7c85c7ead0dc4f88ffa35be5f2eb93e618e | [
"MIT"
] | 2 | 2021-02-13T19:18:00.000Z | 2021-11-10T09:54:49.000Z | Chapter4_Intermediate/TypeAnnotations.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | Chapter4_Intermediate/TypeAnnotations.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | from typing import List
def list_max(input_list: List):
max_value = input_list[0]
for i in range(1, len(input_list)):
if input_list[i] > max_value:
max_value = input_list[i]
print(max_value)
def list_min(input_list: List):
max_value = input_list[0]
for i in range(1, len(in... | 18.4 | 42 | 0.600932 |
87a0900d750d3ed936cb7cde30f06f57c6ca433b | 1,564 | py | Python | python/psl.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | python/psl.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | python/psl.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | """pplsftlct - peoplesoft leave and compensatory time"""
path = r'C:\Users\USER\Desktop\info.txt'
import re
from time import strptime, strftime
FORMAT = '%Y-%m-%d'
# accepts ISO 8601, DD.MM.YYYY, MM/DD/YYYY dates
pattern = r'([\w]{3})[\w ]+\n[\w ]+\n\w+\n\d+[-./]\d+[-./]\d+\n([-\d.,]+)\n([\d.,]+)\n([\d.,]+)\n\t([-\... | 29.509434 | 133 | 0.539642 |
575c367a2bef56d66bf97a5bdd2b5cf218180ef7 | 12,475 | py | Python | converter/uni2win.py | joy-mdy-geo/ufc-old | c3b4ab63c21984f57f802ae8d6680ddcf32af220 | [
"MIT"
] | null | null | null | converter/uni2win.py | joy-mdy-geo/ufc-old | c3b4ab63c21984f57f802ae8d6680ddcf32af220 | [
"MIT"
] | 3 | 2018-08-25T06:01:34.000Z | 2018-08-25T06:01:51.000Z | converter/uni2win.py | joy-mdy-geo/ufc-old | c3b4ab63c21984f57f802ae8d6680ddcf32af220 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
def replace(input):
output = input
output = re.sub(u'\u1000', u'\u0075', output) # ka_gyi
output = re.sub(u'\u1001', u'\u0063', output) # ka_kway
output = re.sub(u'\u1002', u'\u002a', output) # ga_nge
output = re.sub(u'\u1003', u'\u0043', output) # ga_gyi
... | 54.475983 | 160 | 0.584609 |
17dc8c389c0793a7ad87089c8de52ba6a98a18f6 | 1,886 | py | Python | head/MV_Softmax.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | head/MV_Softmax.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | head/MV_Softmax.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Jun Wang
@date: 20201019
@contact: jun21wangustc@gmail.com
"""
# based on:
# https://github.com/xiaoboCASIA/SV-X-Softmax/blob/master/fc_layers.py
import math
import torch
import torch.nn.functional as F
from torch.nn import Module, Parameter
class MV_Softmax(Module):
"""Implementation for "Mis-class... | 36.980392 | 90 | 0.627784 |
1091cc765b827c43563d32efaf9436e459772792 | 2,113 | py | Python | Packs/CommonScripts/Scripts/GetDuplicatesMlv2/GetDuplicatesMlv2_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/CommonScripts/Scripts/GetDuplicatesMlv2/GetDuplicatesMlv2_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/CommonScripts/Scripts/GetDuplicatesMlv2/GetDuplicatesMlv2_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from GetDuplicatesMlv2 import main, Utils
from CommonServerPython import entryTypes
def test_main(mocker):
def executeCommand(name, args=None):
if name == 'findIndicators':
return [
{
'Type': entryTypes['note'],
... | 38.418182 | 117 | 0.623758 |
eabfa74bd8948bf824f06fb154765788a20a6b97 | 334 | py | Python | Shivani/vowel.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/vowel.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/vowel.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | ch = input("enter a character\n")
if(ch=='a' or ch=='A'):
print(ch,"is a vowel")
elif(ch=='e' or ch=='E'):
print(ch,"is a vowel")
elif(ch=='i' or ch=='I'):
print(ch,"is a vowel")
elif(ch=='o' or ch=='O'):
print(ch,"is a vowel")
elif(ch=='u' or ch=='U'):
print(ch,"is a vowel")
else:
print(ch,"is ... | 23.857143 | 33 | 0.535928 |
dc8fe8c480348f611addf137a07cf71aaf72e115 | 3,742 | py | Python | Hackergame_2020/超精巧的数字论证器/XD.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | Hackergame_2020/超精巧的数字论证器/XD.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | Hackergame_2020/超精巧的数字论证器/XD.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z |
from functools import reduce
class Expression():
maxValue = 1000000
operators = ['*', '+', '-']
priority = {
'!': 1,
# '**': 2,
'*': 3,
'+': 4,
'-': 4
}
operation = {
# '**': lambda a, b: a ** b,
'*': lambda a, b: a * b,
'-': lambda ... | 31.711864 | 97 | 0.433725 |
5244e23e4919678dae74bc50fe0d74bcffa64472 | 239 | py | Python | BITs/2014/Shmireychik_S_V/task_2_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Shmireychik_S_V/task_2_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Shmireychik_S_V/task_2_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача №2. Вариант 17
#Компьютер выводит понравившееся высказывание Ас-Cамарканди
#Шмирейчик С.В.
#29.02.2016
print("Любовь - это то, что запрещает слова и речи.\n" + "\t\t\t\t\t Ас-Cамарканди")
input("Нажмите Еnter для выхода.") | 29.875 | 85 | 0.711297 |
5eb6695fe731bf5cfee7ab22e70cf7cf72d28efc | 15,906 | py | Python | warp/graph/graph.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | warp/graph/graph.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | warp/graph/graph.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | # std
from importlib import import_module
import inspect
import functools
# extern
import networkx as nx
# warp
from warp.utils import pickle, unpickle
from warp.pipes import Pipe, Source
import warp.constants as constants
# types
from typing import Union, List, Set, Dict, Optional, Any
from types import ModuleType
... | 42.529412 | 333 | 0.586131 |
df6f9640cc9d491dd5de1ee701f3d39f1585252f | 21,138 | py | Python | Properties/analysis/ClassLevel/classLevel.py | NazaninBayati/SCA | 74e670462dd0da5e24147aab86df393b38405176 | [
"MIT"
] | null | null | null | Properties/analysis/ClassLevel/classLevel.py | NazaninBayati/SCA | 74e670462dd0da5e24147aab86df393b38405176 | [
"MIT"
] | null | null | null | Properties/analysis/ClassLevel/classLevel.py | NazaninBayati/SCA | 74e670462dd0da5e24147aab86df393b38405176 | [
"MIT"
] | null | null | null | modified_cls_name_add=[]
class_address=[]
def contained_function(class_address):
cls_func = open('cephdb._dictionary.txt', 'r')
cls_func = cls_func.read()
cls_int = []
used_funcs = []
db_cls_fun=[]
cls_int = cls_func.split("\n\n")
db_cls_fun = cls_int[1:cls_int.__len__()]
# print(db_cls_... | 32.52 | 166 | 0.619311 |
33f12f56660155fda739ff5c61fe26ab440c3b01 | 45,685 | py | Python | parse_ecli/parse_ecli.py | kiersch/parse_ecli | ae2bfe0003e625a33845abc262480f81166aea92 | [
"MIT"
] | 2 | 2020-05-05T13:08:15.000Z | 2020-05-05T14:12:16.000Z | parse_ecli/parse_ecli.py | kiersch/parse_ecli | ae2bfe0003e625a33845abc262480f81166aea92 | [
"MIT"
] | 1 | 2020-05-13T10:09:48.000Z | 2020-05-13T10:09:48.000Z | parse_ecli/parse_ecli.py | kiersch/parse_ecli | ae2bfe0003e625a33845abc262480f81166aea92 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Type
import json
import re
import argparse
import sys
import warnings
from pathlib import Path
from parse_ecli import pattern
def match_ecli(ecli_string):
"""Bestimmt, welche Klasse (=Gericht) auf den ECLI passt."""
# Reihenfolge der Überprüfung n... | 50.093202 | 147 | 0.592799 |
63cfdcdb036d961c7ef44a7afe9560e0d9822aa5 | 1,876 | py | Python | us1/python/mess_schall_daempf.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | us1/python/mess_schall_daempf.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | us1/python/mess_schall_daempf.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
from uncertainties import ufloat
from scipy import optimize
from scipy.stats import sem
print("------------Messung der schallgeschwindigkeit------------")
t1 = 30.1e-6 # t1 in sekunden
t2 = 59.2e-6 # t2 in sekunden
A1 = 1.2 # Amplitude in volt
A2 = 0.15 # auch in ... | 30.754098 | 86 | 0.635394 |
899995b261c741df4efa503fdab9aeeacd85d1ad | 2,081 | py | Python | tools/pythonpkg/tests/fast/pandas/test_pandas_types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/pandas/test_pandas_types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/pandas/test_pandas_types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
import pandas as pd
import numpy
def round_trip(data,pandas_type):
df_in = pd.DataFrame({
'object': pd.Series(data, dtype=pandas_type),
})
df_out = duckdb.query_df(df_in, "data", "SELECT * FROM data").df()
print (df_out)
print (df_in)
assert df_out.equals(df_in)
class Te... | 33.564516 | 83 | 0.594426 |
f69f2ffaff37dbde8f3e8468daf649327a67b063 | 22,706 | py | Python | myspiders/ruia/spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/ruia/spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/ruia/spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | # 仿照Scrapy的Spider类,允许Spider子类增加form_data实例属性,类型为list,用来发起POST请求
# 不管是默认运行,还是自定义运行,只要存在form_data,则默认request的method是POST
# 只要form_data存在,没有start_urls,或者start_urls长度大于1,都会抛出错误
# 不存在form_data,也不存在start_urls,则执行自定义请求start_manual()方法来生成request实例
import asyncio
import collections
import typing
import weakref
import time
from ... | 41.970425 | 179 | 0.623359 |
f61c00bd01eead3096e6fcf5fc9ba0816bd0401b | 1,111 | py | Python | mlfl.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 1 | 2021-03-22T22:25:54.000Z | 2021-03-22T22:25:54.000Z | mlfl.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 6 | 2017-01-16T09:53:21.000Z | 2017-01-18T12:20:09.000Z | mlfl.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | null | null | null | import util
import config
import time
from datetime import datetime
def test_run():
print "Welcome to MLFL {}".format(config.version)
print "Start date: {}".format(config.start_date)
print ""
print "Select action:"
print "1. Select portfolio"
print "0. Exit"
choice = '1' #raw_input()
... | 30.027027 | 129 | 0.624662 |
140bc2d2b06a2d39d98ef34ec8a1ebd1e9131dfa | 6,523 | py | Python | frappe-bench/env/lib/python2.7/site-packages/stdnum/do/rnc.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/do/rnc.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/do/rnc.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # rnc.py - functions for handling Dominican Republic tax registration
# coding: utf-8
#
# Copyright (C) 2015-2017 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
#... | 34.331579 | 81 | 0.655833 |
215558af89e429a8dc3f74b0d334000ecf71f777 | 242 | py | Python | MiniProjects/Python-Challenges/powerof.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Python-Challenges/powerof.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Python-Challenges/powerof.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | def calcPower(base, power):
base = float(input("Enter The Base : "))
power = float(input("Enter The Power : "))
ans = print("The power of", base, "to the power", power, "is: ", pow(base, power))
return ans
calcPower(2, 5) | 40.333333 | 87 | 0.603306 |
0d0d6008958a711fc034752c1bb657cda55c18b7 | 1,799 | py | Python | website/apps/gallery/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/gallery/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/gallery/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | # encoding: utf-8
import os
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django_extensions.db.fields import *
from django.db.models.signals import post_delete, pre_save
from django.disp... | 29.491803 | 94 | 0.692051 |
25d38f9d87bb397752f53797e32294e8fde0dcdd | 366 | py | Python | sources/stage06/vector3.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage06/vector3.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage06/vector3.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | class Vector():
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
self.x += other.x
self.y += other.y
return(self)
def __str__(self):
return("(" + str(self.x) + ", " + str(self.y) + ")")
p1 = Vector(3, 4)
p2 = Vector(5.0... | 18.3 | 60 | 0.472678 |
d36fd678f43343a6f1dbbc42fb5ca72d7f716bb6 | 1,741 | py | Python | example/poodle1.py | SameerPr/Padding_Oracle_attack | 875706ca7dbda70d8facf51003848cea3f7bbc83 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | ICHSA/2021/crypto/Poodle1/poodle1.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | ICHSA/2021/crypto/Poodle1/poodle1.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from binascii import hexlify, unhexlify
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
import sys, traceback
def encrypt(msg, key):
iv = get_random_bytes(AES.block_size)
cipher = AES.new(key, AES.MODE_CBC, iv)
return iv + cipher.... | 30.54386 | 68 | 0.599081 |
6ce456c737a2e59e0c6dbc6cc7f5b7e5e5f102b6 | 2,429 | py | Python | tests/onegov/pay/test_collections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/pay/test_collections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/pay/test_collections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm import SessionManager
from onegov.core.orm.types import UUID
from onegov.pay import Payable, PayableCollection
from onegov.pay import PaymentCollection
from onegov.pay import PaymentProvider
from sqlalchemy import Column
from sqlalchemy import Text
from sqlalchemy.e... | 27.91954 | 71 | 0.712227 |
9f45549a3db86130bb2265ca90f1400c08c53574 | 10,598 | py | Python | src/onegov/gazette/views/notice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/notice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/notice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from morepath.request import Response
from onegov.core.security import Personal
from onegov.core.security import Private
from onegov.core.utils import normalize_for_url
from onegov.gazette import _
from onegov.gazette import GazetteApp
from onegov.gazette.collections import GazetteNoticeCo... | 29.115385 | 78 | 0.592942 |
4cbd5a29e921b789409a4f9de452e2510faf64d4 | 8,369 | py | Python | apps/calc/measurement/measurement_obj.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/calc/measurement/measurement_obj.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/calc/measurement/measurement_obj.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from scipy import interpolate, signal,ndimage
import scipy as sci
import json
import numpy as np
from collections import Counter
from apps.calc.measurement.calculus import get_average_delta,get_decimal_delta
from apps.calc.tess_module.tess import tess
class Measurement(object):
def __init__(self, raw, Column_Nam... | 40.043062 | 125 | 0.591946 |
e25530f6b6d053e6f96a7e8db0ba9d5f27ea6d4c | 41,140 | py | Python | .vscode/extensions/ms-python.vscode-pylance-2021.7.4/dist/scripts/scrape_module.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | 6 | 2021-12-26T13:34:32.000Z | 2022-02-08T22:09:38.000Z | .vscode/extensions/ms-python.vscode-pylance-2021.7.4/dist/scripts/scrape_module.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | .vscode/extensions/ms-python.vscode-pylance-2021.7.4/dist/scripts/scrape_module.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# WARNING: DO run scraper from 32-bit command line or else output may be UTF-16.
#
# Scraping most modules does not require search path. Example:
# c:\python3\python -W ignore -B -E scrape_module.py lxml.etree > etree.pyi... | 31.965812 | 107 | 0.543243 |
20553f4d203531c69bb0e4a1f4f951ec9b2b2ca9 | 247 | py | Python | letspuppet/__init__.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | 15 | 2018-05-16T02:39:01.000Z | 2021-05-22T13:12:55.000Z | letspuppet/__init__.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | null | null | null | letspuppet/__init__.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | 9 | 2018-05-16T00:47:34.000Z | 2021-11-26T05:39:48.000Z | from . import floatdataframe, LogAll
from . import alphatrade
from . import letspuppetTrade
from .letspuppetTrade import CTRADEEXETITLE
from .tradetools import gettoday, getweekday, strprice, getsignal, getlimit, getallyesterdayc, getsignaldbname
| 41.166667 | 110 | 0.842105 |
038dfb7c6fafcbaeba4c32150e32ef6283e2880e | 1,581 | py | Python | day23/car_manager.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day23/car_manager.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day23/car_manager.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | import random
from turtle import Turtle
COLORS = ["red", "orange", "yellow", "green", "blue", "purple"]
STARTING_MOVE_DISTANCE = 5
MOVE_INCREMENT = 5
class CarManager:
def __init__(self) -> None:
self.active_cars = []
self.move_distance = STARTING_MOVE_DISTANCE
self.start_positions = [in... | 23.954545 | 73 | 0.590765 |
ff08de3e92f2c3d587f156a987d6d1175361e707 | 1,726 | py | Python | app/core/models.py | Sahinovic/Kuhar | b01cef5f6f0013196d96c8b71f3cf39a8cc149de | [
"MIT"
] | null | null | null | app/core/models.py | Sahinovic/Kuhar | b01cef5f6f0013196d96c8b71f3cf39a8cc149de | [
"MIT"
] | null | null | null | app/core/models.py | Sahinovic/Kuhar | b01cef5f6f0013196d96c8b71f3cf39a8cc149de | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
from django.conf import settings
class UserManager(BaseUserManager):
def create_user(self, email, password = None, **extra_fields):
"""creates and saves a new user """
if not e... | 33.192308 | 91 | 0.670336 |
5bf365133e45e88442b1a8991d1cc1854f9ea022 | 396 | py | Python | Algorithms/Warmup/forming_a_magic_square.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Warmup/forming_a_magic_square.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Warmup/forming_a_magic_square.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
s = []
for s_i in range(3):
s_t = [int(s_temp) for s_temp in input().strip().split(' ')]
s.append(s_t)
res = 0
l1 = []
l2 = sorted([num for n in s for num in n])
for i in range(1, 10):
if i in l2:
l2.remove(i)
else:
l1.append(i)
print(l1)
print(l2)
len_... | 16.5 | 63 | 0.565657 |
f3a080744308421634cadfc8b81bdb8797cb66f2 | 2,473 | py | Python | official_examples/Using_Spark_MLlib_to_Create_a_Car_Evaluation_Application/code/customize_service.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 3 | 2019-07-15T03:10:15.000Z | 2019-07-19T07:25:32.000Z | official_examples/Using_Spark_MLlib_to_Create_a_Car_Evaluation_Application/code/customize_service.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 2 | 2019-10-15T09:05:21.000Z | 2019-10-15T09:18:27.000Z | official_examples/Using_Spark_MLlib_to_Create_a_Car_Evaluation_Application/code/customize_service.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 3 | 2019-09-17T06:35:08.000Z | 2019-09-21T04:38:58.000Z | # -*- coding:utf-8 -*-
import copy
import json
from modelarts_pyspark import KNNClassificationModel
from modelarts_pyspark.common import DfUtils
from model_service.spark_model_service import SparkServingBaseService
import model_service.log as log
import traceback
logger = log.getLogger(__name__)
class CustomerServic... | 36.910448 | 110 | 0.680146 |
3443ae39fab9336094edb5fffbaf591f2eb887be | 1,562 | py | Python | research/nlp/hypertext/create_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/hypertext/create_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/hypertext/create_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... | 36.325581 | 98 | 0.714469 |
9401abc4c75bf4060a9a54607c45e5dc96611170 | 452 | py | Python | Scholien/migrations/0005_auto_20170510_1631.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Scholien/migrations/0005_auto_20170510_1631.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Scholien/migrations/0005_auto_20170510_1631.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-10 14:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Scholien', '0004_buechlein_alte_nr'),
]
operations = [
migrations.AlterModelOptions... | 22.6 | 82 | 0.626106 |
ca365c90654eeedc6b48d773edb6f1e83c66e47d | 5,033 | py | Python | wz/ui_modules/COVER.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui_modules/COVER.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui_modules/COVER.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ui_modules/COVER.py
Last updated: 2021-05-23
Manage (text) report cover sheets
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Y... | 31.654088 | 76 | 0.627061 |
04a47205603b1061aa069bded16c7b146795bee1 | 275 | py | Python | src/Shape.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/Shape.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/Shape.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | class Shape:
def __init__(self, shape, id, kind=None, context=None):
self.shape = shape
self.id = id
self.kind = kind
self.context = context
def __str__(self):
return f"id:{self.id} kind:{self.kind} Shape:{str(self.shape)}"
| 22.916667 | 71 | 0.585455 |
04b12291faf1c90dcb9485dd8e8344fa58c58553 | 1,900 | py | Python | Computerorietierte_Mathematik/selflearning_numpy.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | Computerorietierte_Mathematik/selflearning_numpy.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | Computerorietierte_Mathematik/selflearning_numpy.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | import numpy as np
g = list(range(10))
# sum of array
g_array = np.sum(g)
print(g_array)
# Constructor of array
a = np.array([1,2,3,4])
# a.shape = (4,)
b = np.array([10,11,12,13])
# a + b => array([11,13,15,17])
"""
In normal python: a + b -> [1,2,3,4,10,11,12,13]
"""
a.fill(1)
# a = [1,1,1,1]
###################... | 21.348315 | 85 | 0.443684 |
8e0dd64932e2580b56812934e3f46f335beb8316 | 3,773 | py | Python | docs/moxing_api_doc/scripts/mox_flowers_advanced.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | docs/moxing_api_doc/scripts/mox_flowers_advanced.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | docs/moxing_api_doc/scripts/mox_flowers_advanced.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | import sys
import tensorflow as tf
from tensorflow.contrib import slim
import moxing.tensorflow as mox
from moxing.tensorflow.optimizer import learning_rate_scheduler
tf.flags.DEFINE_string('data_url',
None, 'Necessary. dataset dir')
tf.flags.DEFINE_string('model_name',
'... | 35.933333 | 106 | 0.639014 |
eda246e63805605b976b9e2f21045ba4d541dfbc | 622 | py | Python | src/lcdoc/mkdocs/lp/plugs/flowchart/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/mkdocs/lp/plugs/flowchart/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/mkdocs/lp/plugs/flowchart/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
### `lightbox`
"""
from lcdoc.tools import app
page_assets = {
'mode': 'raphael',
'header': '//flowchart.js.org/flowchart-latest.js',
}
C = '''<div id="%(id)s"></div>'''
S = '''
<script>
var code = '%(body)s';
var diag = flowchart.parse(code);
diag.drawSVG('%(id)s', %(opts)s);
</script>
'''
def run... | 17.771429 | 65 | 0.511254 |
fcb0d2886457e951f986afe7e1a039449b3a9c17 | 62 | py | Python | app/views/__init__.py | davidkoojohn/SPA-weapp | 5b8770054434010c5da3cd950b5dadd26869343e | [
"MIT"
] | null | null | null | app/views/__init__.py | davidkoojohn/SPA-weapp | 5b8770054434010c5da3cd950b5dadd26869343e | [
"MIT"
] | null | null | null | app/views/__init__.py | davidkoojohn/SPA-weapp | 5b8770054434010c5da3cd950b5dadd26869343e | [
"MIT"
] | null | null | null |
from .landing import landing as landing_view
import errors
| 10.333333 | 44 | 0.806452 |
44f51808af8e105b9b00aea6adff17dd45ac2fb5 | 1,204 | py | Python | INBa/2015/KURCHATOV_N_V/z8_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/KURCHATOV_N_V/z8_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/KURCHATOV_N_V/z8_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 8. Вариант 11.
#1-50. Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки, отгадавшие с... | 30.871795 | 361 | 0.673588 |
78419363f35d97962f93ee76b867e5424aa3a821 | 4,456 | py | Python | python/system/config.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | 1 | 2020-09-29T17:44:31.000Z | 2020-09-29T17:44:31.000Z | python/system/config.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | null | null | null | python/system/config.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | null | null | null | from xml.dom import minidom
from system.log import log
import os
class Config(object):
singleton = None
workingpath = "../gamedata"
xmlconfig = None
configdict = dict()
config = {
"gui.show" : { "default": "false", "type": "bool", "label":"", "showgui":"false", "order": 0 },
... | 37.445378 | 107 | 0.567998 |
ec7f0767f10f43bf801420cf221dd56cd3c39288 | 2,175 | py | Python | BIZa/2014/Zyabko_A_A/Task_10_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Zyabko_A_A/Task_10_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Zyabko_A_A/Task_10_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 10
#Напишите программу "Генератор персонажей" для игры. Пользователю должно быть предоставлено 30 пунктов, которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но и возвращать их туд... | 31.985294 | 372 | 0.702069 |
17118e3f13339ac65815e507b30be17cc7b66747 | 13,878 | py | Python | RDS/circle3_central_services/research_manager/src/tests/test_projectservice.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/tests/test_projectservice.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/tests/test_projectservice.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import unittest
from lib.ProjectService import ProjectService
from lib.Port import Port
from lib.Project import Project
from lib.EnumStatus import Status
from RDS import Util
from fakeredis import FakeStrictRedis
def get_opts(use_redis=False):
if use_redis:
return {
"rc": FakeStrictRedis(deco... | 34.436725 | 91 | 0.501801 |
9754f16aeb2cdd0703aa722e363a35ac22fc5925 | 651 | py | Python | exercises/python/data-types/collections/counter.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/collections/counter.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/collections/counter.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | # How much did Raghu earned form his shoes?
# Sample Input
# 10
# 2 3 4 5 6 8 7 6 5 18
# 6
# 6 55
# 6 45
# 6 55
# 4 40
# 18 60
# 10 50
# Sample Output
# 200
from collections import Counter
if __name__ == '__main__':
shoes_number = int(input())
shoes_sizes = list(map(int, input().split()))
customers_n... | 18.6 | 50 | 0.62212 |
a9e11ba1c6dff7f766be013a7f4efea74ccf9e6e | 48,178 | py | Python | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/subject_storage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/subject_storage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/subject_storage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from abc import abstractmethod
from datetime import date
from decimal import Decimal
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from watchmen_auth import PrincipalService
from watchmen_data_kernel.common import ask_all_date_formats, ask_date_formats, ask_time_formats
from watchmen_data_kernel... | 43.758401 | 119 | 0.784819 |
e7766df4a6c97ae13ff2cff4346c123ec36f0161 | 4,491 | py | Python | hisim/components/gas_heater.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 12 | 2021-10-05T11:38:24.000Z | 2022-03-25T09:56:08.000Z | hisim/components/gas_heater.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 6 | 2021-10-06T13:27:55.000Z | 2022-03-10T12:55:15.000Z | hisim/components/gas_heater.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 4 | 2022-02-21T19:00:50.000Z | 2022-03-22T11:01:38.000Z | # Owned
from hisim.component import Component, SingleTimeStepValues, ComponentInput, ComponentOutput
from hisim.simulationparameters import SimulationParameters
from hisim import loadtypes as lt
__authors__ = "Frank Burkrad, Maximilian Hillen"
__copyright__ = "Copyright 2021, the House Infrastructure Project"
__credit... | 44.029412 | 159 | 0.686929 |
99f9a01961a7c15dbfa3e3fb4a77364d7417c989 | 2,848 | py | Python | python/sql_alchemy/orm-tutorial/basic_relationship_patterns.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/sql_alchemy/orm-tutorial/basic_relationship_patterns.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/sql_alchemy/orm-tutorial/basic_relationship_patterns.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """ Example from
https://docs.sqlalchemy.org/en/13/orm/basic_relationships.html#one-to-many
"""
from sqlalchemy import Table, Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
"""One to Many
Parent : Child = 1... | 28.48 | 74 | 0.69382 |
6b5493a7f787005ea9cd3a1ec44028019021eafb | 1,474 | py | Python | pandas/plotting/QtMpl.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | pandas/plotting/QtMpl.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | pandas/plotting/QtMpl.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null |
from PyQt5 import QtGui
import matplotlib
import matplotlib.dates as mdates
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
class QtMpl(FigureCanvasQTAgg):
'''
'''
def __init__(self, parent):
self.fig = matplotlib.figure.Figure()
FigureCanvasQTAgg.__init__(self, self.... | 29.48 | 77 | 0.597015 |
cf52d3a70ffa130e01d63d61c2c44ab4427e18d3 | 5,259 | py | Python | V01 Myonen/plots/plot.py | Ninilini/FP-Bachelor | 0ca4d45efb211278793d1667731b09d35cfc94aa | [
"MIT"
] | 1 | 2019-11-27T07:01:08.000Z | 2019-11-27T07:01:08.000Z | V01 Myonen/plots/plot.py | Ninilini/FP-Bachelor | 0ca4d45efb211278793d1667731b09d35cfc94aa | [
"MIT"
] | null | null | null | V01 Myonen/plots/plot.py | Ninilini/FP-Bachelor | 0ca4d45efb211278793d1667731b09d35cfc94aa | [
"MIT"
] | 1 | 2022-02-20T09:24:16.000Z | 2022-02-20T09:24:16.000Z | # coding=utf-8
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit, minimize
import uncertainties.unumpy as unp
from uncertainties import ufloat
import sympy
from uncertainties import correlated_values, correlation_matrix
import scipy.integrate as int
from un... | 29.055249 | 99 | 0.673892 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.