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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6aee86de95ce7256a515f3d51114045440c5747d | 4,443 | py | Python | egs/dns_challenge/baseline/train.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | egs/dns_challenge/baseline/train.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | egs/dns_challenge/baseline/train.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | import argparse
import json
import os
from functools import partial
import pytorch_lightning as pl
import torch
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader, random_split
from asteroid.data import ... | 37.336134 | 99 | 0.701778 |
e4026bb7bc894b5c06b24233de07077fb8bd08bf | 22,762 | py | Python | modules/genetic_algorithm.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | modules/genetic_algorithm.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | modules/genetic_algorithm.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | """
RL MODULE WITH GENETIC ALGORITHMS
CALL BY: <genetic_algorithm.py>
RETURN: Parameter Matrices for the inverted Pendulum Problem
Stores Data of best Parameters in '<date>_ga_<reward>.hkl'
INFO: Still under development
"""
# Some dependencies
import os
import numpy as np # Maths and stuff... | 44.37037 | 270 | 0.602232 |
7c25ca7f16e27629f6dc956408a6fd7c032d694e | 1,436 | py | Python | ___Python/Thomas/pycurs_180625/p09_isbn/isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p09_isbn/isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p09_isbn/isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # Aufgabe:
# http://exercism.io/exercises/python/isbn-verifier/readme
# Prüfe, ob isbn eine gültige ISBN-Nummer ist
import re
def verify(isbn):
print(isbn)
list_isbn = []
for chr_isbn in isbn:
try:
i_isbn = int(chr_isbn)
if i_isbn in range(10):
... | 23.933333 | 64 | 0.489554 |
7cc52dec871a3e5127d95306c8ff9d3d9aa9df44 | 4,443 | py | Python | beispielanwendungen/hallowelt/hallowelt10_eingabedialoge.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/hallowelt/hallowelt10_eingabedialoge.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/hallowelt/hallowelt10_eingabedialoge.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MainWindow(QtGui.QMainWindow):
meinSignal = QtCore.pyqtSignal()
def __init__(self, *args):
QtGui.... | 35.830645 | 104 | 0.63133 |
860e46f2493c52e755d847fb2538b0e9b741ea24 | 47 | py | Python | Python/Courses/Crash-Course-on-Python.Google/week-1-Hello-Python/02-hello-world-10-time-in-python.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-1-Hello-Python/02-hello-world-10-time-in-python.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-1-Hello-Python/02-hello-world-10-time-in-python.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | for i in range(10):
print("Hello, World!")
| 15.666667 | 26 | 0.595745 |
86a1fe0ab17b13d9e0646e9ebd782a0e464d4c35 | 1,667 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/output/convert/gpx.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/output/convert/gpx.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/output/convert/gpx.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2014-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 40.658537 | 86 | 0.691662 |
86dbbbf8ed80d3ccc499560ebb2eae3a4eeeeffb | 1,938 | py | Python | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE/guess_the_no.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE/guess_the_no.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE/guess_the_no.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # template for "Guess the number" mini-project
# input will come from buttons and an input field
# all output for the game will be printed in the console
import random
import simplegui
import math
global secret_number
chances = 8
num_range = 100
# helper function to start and restart the game
def new_game():
# in... | 25.84 | 76 | 0.682663 |
86fc5a86ad83611cfd57d5f724076c493072889b | 951 | py | Python | python/svadagenerator.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | python/svadagenerator.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | python/svadagenerator.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import sys
import csv
from random import choice
from urllib.parse import quote_plus as quote
from difflib import SequenceMatcher
svada = {}
with open('svadagenerator.csv', 'r', encoding='utf-8') as csvfile:
svadareader = csv.reader(csvfile, delimiter=';', quotechar="'")
key = None
for row in svadareader:
... | 30.677419 | 108 | 0.597266 |
07990a87e32f6b7b6dce1e52f48ce1df5ef580d2 | 672 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/63c1/single_number/single_number.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63c1/single_number/single_number.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63c1/single_number/single_number.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | '''
Input: a List of integers where every int except one shows up twice
Returns: an integer
'''
def single_number(arr):
# return the single number; all others appear twice
# FIRST: sort array
arr.sort()
# SECOND: loop through each item in array
for x in range(0, len(arr), 2):
# THIRD: if... | 25.846154 | 67 | 0.581845 |
07d506cb1a420efaef0db626cffc75ec8f1ab2b9 | 4,608 | py | Python | __main__1.0.py | superbe/PizDB | 478e9efb4754364a3ceb48a059ec53f8e54f3cbf | [
"MIT"
] | null | null | null | __main__1.0.py | superbe/PizDB | 478e9efb4754364a3ceb48a059ec53f8e54f3cbf | [
"MIT"
] | null | null | null | __main__1.0.py | superbe/PizDB | 478e9efb4754364a3ceb48a059ec53f8e54f3cbf | [
"MIT"
] | null | null | null | import collections
class Arg:
"""
Данные запроса.
"""
def __init__(self, command_line):
"""
Конструктор.
:param command_line: строка запроса.
"""
if command_line is None:
raise ValueError(f'no argument specified: \'{command_line}\'')
self.__... | 26.947368 | 97 | 0.557075 |
ed0177ffc21fe16d95bff7ea7cf54e6bf20f47ad | 1,522 | py | Python | official/recommend/deepfm/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/deepfm/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/deepfm/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.382979 | 82 | 0.659001 |
ed4276b1ef3c5461950a2263a96a5660f929c053 | 1,014 | py | Python | tests/performance_test/read_write_test_v2.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | tests/performance_test/read_write_test_v2.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | tests/performance_test/read_write_test_v2.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Auslesen einer Datei
import sys
import time
print("access-Test start")
# Messen der Lesezeiten
readStart = time.time()
# Testdatei
readFile = "passwords.txt"
# Datei wird in f geoeffnet und gelesen
with open(readFile) as f:
content = f.readlines()
f.close()
# Berechnung der Lesezeiten
r... | 19.882353 | 72 | 0.740631 |
b9241776878badd5fc1c4918edff91d696223db1 | 188 | py | Python | env/bin/django-admin.py | javiervar/SurveyManager | bbe2ed356654c32586c587f58c609c8ce014e96b | [
"MIT"
] | null | null | null | env/bin/django-admin.py | javiervar/SurveyManager | bbe2ed356654c32586c587f58c609c8ce014e96b | [
"MIT"
] | null | null | null | env/bin/django-admin.py | javiervar/SurveyManager | bbe2ed356654c32586c587f58c609c8ce014e96b | [
"MIT"
] | null | null | null | #!/Users/retina/Documents/escuela/ProgramacionWeb/SurveyManager/env/bin/python3.7
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 31.333333 | 81 | 0.808511 |
e059ea34b9f46f228d30b009aadc777ef53c3562 | 3,291 | py | Python | Website/backend/main.py | nachgeradelt/nachgeradelt | d45ed6b3c9088d58cdd315e26b932b5da8b5f130 | [
"MIT"
] | 3 | 2018-06-16T12:49:20.000Z | 2021-01-26T16:15:11.000Z | Website/backend/main.py | nachgeradelt/nachgeradelt | d45ed6b3c9088d58cdd315e26b932b5da8b5f130 | [
"MIT"
] | 2 | 2019-11-01T09:36:31.000Z | 2020-11-20T13:27:42.000Z | Website/backend/main.py | nachgeradelt/nachgeradelt | d45ed6b3c9088d58cdd315e26b932b5da8b5f130 | [
"MIT"
] | 1 | 2019-04-23T06:46:45.000Z | 2019-04-23T06:46:45.000Z | # -*- coding: utf-8 -*-
from flask import Flask
from databasemanager.DatabaseManager import DatabaseManager
from api.queries.readqueries import SELECTS
from flask import request
from flasgger import Swagger
import yaml
app = Flask(__name__)
configfile = "config.yml"
datamanger = DatabaseManager(configfile=configf... | 25.913386 | 99 | 0.631419 |
0ef5511a7fec2cea6cfa4109a30be7bf35cb9f2e | 740 | py | Python | src/bo4e/enum/messgroesse.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/messgroesse.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/messgroesse.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Messgroesse(StrEnum):
"""
Gibt die physikalische Größe an, die gemessen wurde.
"""
STROM = "STROM" #: Strom
SPANNUNG = "SPANNUNG" #: Spannung
WIRKLEISTUNG = "WIRKLEISTUNG" #: Wirkleistung
BLINDLEISTU... | 32.173913 | 58 | 0.666216 |
1635d38cc762a4cff9ae66e25368f4c2a6f855aa | 4,019 | py | Python | research/nlp/senta/src/data/data_set_reader/basic_dataset_reader.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/senta/src/data/data_set_reader/basic_dataset_reader.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/senta/src/data/data_set_reader/basic_dataset_reader.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... | 31.896825 | 102 | 0.56009 |
bcb7b22d6e146ea466b5a67a79eb8d784b86f301 | 7,819 | py | Python | train_gs_gsovspgso.py | gdasoulas/PGSO | 0fa02c626c9c9cf7e046f11ccbfd3bd6dc329a8d | [
"MIT"
] | 1 | 2022-03-08T15:23:26.000Z | 2022-03-08T15:23:26.000Z | train_gs_gsovspgso.py | gdasoulas/PGSO | 0fa02c626c9c9cf7e046f11ccbfd3bd6dc329a8d | [
"MIT"
] | null | null | null | train_gs_gsovspgso.py | gdasoulas/PGSO | 0fa02c626c9c9cf7e046f11ccbfd3bd6dc329a8d | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
from datetime import datetime
from pathlib import Path
from plot_utils import plot_accs_per_initialization, plot_scalar_params_per_initialization
import time
import argparse
import numpy as np
import os.path as osp
import torch
import tor... | 42.264865 | 119 | 0.628981 |
e683c37d822a90779beaf1eee98c262316bd6a19 | 3,136 | py | Python | project/views/event_suggestion.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/views/event_suggestion.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/views/event_suggestion.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask import flash, redirect, render_template, url_for
from flask_babelex import gettext
from flask_security import auth_required
from sqlalchemy.exc import SQLAlchemyError
from project import app, db
from project.access import access_or_401
from project.forms.event_suggestion import RejectEventSuggestionForm
fro... | 34.461538 | 88 | 0.732462 |
5d6c7585740faf0ae43c8e9d5a4f810f20b5e4b5 | 2,064 | py | Python | official/cv/simclr/src/simclr_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/simclr/src/simclr_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/simclr/src/simclr_model.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... | 29.913043 | 78 | 0.622578 |
ab5ba477558ea6c717c8aa143e504fe04078bfa4 | 937 | py | Python | IVTa/2014/SHCHUKIN_F_O/task_2_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | 1 | 2021-04-02T17:43:48.000Z | 2021-04-02T17:43:48.000Z | IVTa/2014/SHCHUKIN_F_O/task_2_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/SHCHUKIN_F_O/task_2_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | 1 | 2020-12-18T18:04:49.000Z | 2020-12-18T18:04:49.000Z | # Задача 1. Вариант 30.
'''
Напишите программу, которая будет выводить на экран
наиболее понравившееся вам высказывание, автором которого
является Али ибн Абу Талиб. Не забудьте о том, что автор
должен быть упомянут на отдельной строке.
'''
# SHCHUKIN F. O.
# 24.02.2016
from sys import stdout as c
from time import sle... | 24.657895 | 70 | 0.677695 |
ab60ee58045fd3a398bcd41af48b9ce549d6429f | 5,871 | py | Python | prototype/examples/accessing_api/api.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/accessing_api/api.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/accessing_api/api.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | 1 | 2021-09-26T12:09:52.000Z | 2021-09-26T12:09:52.000Z | from flask import Flask, make_response, request
from distutils.util import strtobool
import requests
import os
import logging
from template_engine import TemplateEngine
from ws_proxy import WebsocketProxy, add_token
app = Flask(__name__)
class KubernetesAPI:
def __init__(self, base_uri, service_account_token=No... | 34.739645 | 126 | 0.682678 |
db623f101c398bdb2a613e36b708f9339a75d511 | 1,320 | py | Python | recherche_youtube.py | K-A-R-I-M/SonKa | 3ff5b95afa2f3c968cdaf670f27e6abc813907e4 | [
"MIT"
] | 1 | 2020-07-30T15:46:06.000Z | 2020-07-30T15:46:06.000Z | recherche_youtube.py | K-A-R-I-M/SonKa | 3ff5b95afa2f3c968cdaf670f27e6abc813907e4 | [
"MIT"
] | null | null | null | recherche_youtube.py | K-A-R-I-M/SonKa | 3ff5b95afa2f3c968cdaf670f27e6abc813907e4 | [
"MIT"
] | null | null | null | import asyncio
from pyppeteer import launch
from time import sleep
class RechercheLienYoutube():
def __init__(self):
self.nb_recherche = 0
async def recherche_lien(self, url):
browser = await launch()
page = await browser.newPage()
await page.goto(url)
tag = 'h3 > a'... | 21.639344 | 96 | 0.584848 |
dbbf21828e509dabf6d5e3e79482681d70c069fa | 3,872 | py | Python | Imagenes/Stefan/2D/CasoB/Allpost.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/Stefan/2D/CasoB/Allpost.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/Stefan/2D/CasoB/Allpost.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | import vdWColumn as vdw
import vdWColumn.postLBRun as post
import numpy as np
import matplotlib.pyplot as plt
import argparse
import os
from paraview.simple import *
import stefanFlow as stf
import matplotlib.ticker as mticker
import locale
# Extraccion de arreglos en linea desde el centro (xmax/2) hasta x... | 18.178404 | 109 | 0.512913 |
f42776ecc0e1b167e8f721f7a692e9f5c4a06e70 | 3,045 | py | Python | src/bo4e/com/angebotsvariante.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/angebotsvariante.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/angebotsvariante.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Angebotsvariante and corresponding marshmallow schema for de-/serialization
"""
from datetime import datetime
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.angebotsteil import Angebotsteil, Angebots... | 37.134146 | 187 | 0.750411 |
f4913c115887be8ce1bc91f82d8a413f1caed0b5 | 2,572 | py | Python | sensoro/writeRFID/Read.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | sensoro/writeRFID/Read.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | sensoro/writeRFID/Read.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright 2014,2018 Mario Gomez <mario.gomez@teubi.co>
#
# This file is part of MFRC522-Python
# MFRC522-Python is a simple Python implementation for
# the MFRC522 NFC Card Reader for the Raspberry Pi.
#
# MFRC522-Python is free software: you can redistrib... | 31.365854 | 89 | 0.68818 |
be9d4b08e61f0853636ef700600d83c6e1cf9181 | 178 | py | Python | Online-Judges/CodingBat/Python/Logic-02/Logic_2-05-round_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Logic-02/Logic_2-05-round_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Logic-02/Logic_2-05-round_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def round_sum(a, b, c):
return round10(a) + round10(b) + round10(c)
def round10(num):
if num % 10 < 5:
return num - (num % 10)
return num + (10 - num % 10)
| 19.777778 | 47 | 0.539326 |
4ac6462a60f24eaf094b3a0e33a01dfd1b65e3ea | 263 | py | Python | sentinel/node/__init__.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | 342 | 2017-08-21T20:12:56.000Z | 2022-03-19T17:58:25.000Z | sentinel/node/__init__.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | 57 | 2017-11-13T11:16:47.000Z | 2022-03-01T13:54:31.000Z | vpn-node-cosmos/sentinel/node/__init__.py | smtcrms/sentinel | ff65bc9200f6c940aa184c0ec0872fdcfef25363 | [
"MIT"
] | 72 | 2017-11-23T05:13:24.000Z | 2022-02-25T14:18:33.000Z | # coding=utf-8
from .controllers import add_tx
from .controllers import get_free_coins
from .controllers import list_node
from .controllers import update_node
from .controllers import update_session
from .controllers import update_sessions
from .node import node
| 29.222222 | 40 | 0.847909 |
601188a95c23a883ac514e94019a7beb22c23969 | 4,530 | py | Python | feedcrawler/notifiers.py | rix1337/RSScrawler | 5a1c067148310c03321329d3fa409a4e4144fce7 | [
"MIT"
] | 63 | 2016-03-21T21:35:07.000Z | 2021-03-20T22:50:34.000Z | feedcrawler/notifiers.py | rix1337/RSScrawler | 5a1c067148310c03321329d3fa409a4e4144fce7 | [
"MIT"
] | 200 | 2016-03-15T21:45:26.000Z | 2021-04-03T10:47:45.000Z | feedcrawler/notifiers.py | rix1337/RSScrawler | 5a1c067148310c03321329d3fa409a4e4144fce7 | [
"MIT"
] | 25 | 2016-03-15T20:44:33.000Z | 2020-10-25T09:43:48.000Z | # -*- coding: utf-8 -*-
# FeedCrawler
# Projekt von https://github.com/rix1337
# Enthält Code von:
# https://github.com/Gutz-Pilz/pyLoad-stuff/blob/master/SJ.py
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen, Request
import simplejson as json
from feedcrawler... | 35.116279 | 84 | 0.642605 |
6015bd691735c3f845e6db95e98993bddc3be3a9 | 9,319 | py | Python | frappe-bench/apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import add_days, getdate, cint, cstr
from frappe import throw, _
from erpnext.utilities.transaction_base import Transa... | 34.261029 | 129 | 0.713274 |
60cf70a2362fb6aa634a51a567c4ee2e5dae4d27 | 319 | py | Python | BITs/2014/Shmireychik_S_V/task_1_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Shmireychik_S_V/task_1_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Shmireychik_S_V/task_1_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 1. Вариант 17.
#Программа,которая сообщает род деятельности и псевдоним под которым скрывается Алексей Максимович Пешков
#Шмирейчик С.В.
#29.02.2016
print("Алексей Максимович Пешков - литературный псевдоним Максима Горького. Род деятельности - писатель, прозаик, драматург")
input("Нажмите Enter для выхода")
| 35.444444 | 125 | 0.802508 |
71b79b2a7b488b78fb6c737fcb1a0a834b299c83 | 505 | py | Python | config.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | 1 | 2021-05-24T06:16:49.000Z | 2021-05-24T06:16:49.000Z | config.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | config.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | import json
import os
CIDR_MAX_SUBNETS = {}
CONFIG_DIRECTORY = 'config'
COUNTRIES = json.load(open(os.path.join(CONFIG_DIRECTORY, 'countries.json'), 'r'))
cidr_max_subnets_dict = json.load(open(os.path.join(CONFIG_DIRECTORY, 'cidr_max_subnets.json'), 'r'))
config_dict = json.load(open(os.path.join(CONFIG_DIRECTORY, '... | 31.5625 | 101 | 0.736634 |
c76eb2ddbd4be5728ea8021915e8a1310b41fbe2 | 516 | py | Python | Tutorials/10 Days of Statistics/Day 4/binomial_distribution1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Tutorials/10 Days of Statistics/Day 4/binomial_distribution1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/10 Days of Statistics/Day 4/binomial_distribution1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
from math import factorial as fac
def binomial(x, y):
try:
return fac(x) // fac(y) // fac(x - y)
except ValueError:
return 0
def bin_dist(n, k, p, q):
return binomial(n, k) * p**k * q**(n-k)
def f(p, q):
p1 = bin_dist(6, 0, p, q)
p2 = bin_dist(6, 1, p, q... | 17.2 | 60 | 0.527132 |
1bed5d10f72be8fb3f46eef6a4c2351c1ea55817 | 313 | py | Python | nz_django/day4/orm_queryset_demo/front/migrations/0002_auto_20200221_1505.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day4/orm_queryset_demo/front/migrations/0002_auto_20200221_1505.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day4/orm_queryset_demo/front/migrations/0002_auto_20200221_1505.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # Generated by Django 2.0 on 2020-02-21 07:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('front', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='bookorder',
options={},
),
]
| 17.388889 | 45 | 0.57508 |
1bf0292d960590d34df1417ac53193651eecc50e | 680 | py | Python | setup.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 235 | 2017-03-01T14:34:29.000Z | 2021-06-03T16:16:16.000Z | setup.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 39 | 2017-03-25T01:20:25.000Z | 2020-10-30T11:51:47.000Z | setup.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 105 | 2017-04-13T21:31:46.000Z | 2021-11-01T17:25:48.000Z | """Setup script."""
import setuptools
setuptools.setup(
author="Jihong Ju",
author_email="daniel.jihong.ju@gmail.com",
extras_require={
"test": [
'keras>=2.0.0',
"pandas==0.19.2",
"tensorflow",
"codecov",
"mock",
"pytest",
... | 22.666667 | 71 | 0.501471 |
90da493123158501e4e90d998beec4d7bda667a8 | 447 | py | Python | scripts/scandb.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T22:29:44.000Z | 2022-01-28T22:29:44.000Z | scripts/scandb.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | null | null | null | scripts/scandb.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T21:10:41.000Z | 2022-01-28T21:10:41.000Z | from censys.search import CensysHosts
import time
h = CensysHosts()
ip_result = []
for count in range(10, 1000):
for page in h.search('services.http.response.html_title:"Outlook" and location.country=`Germany`', pages=count):
for result in page:
print(result["ip"])
ip_result.append... | 29.8 | 116 | 0.662192 |
2914bf2da52c18098f616ef3328aeb37a40b2ba9 | 5,125 | py | Python | applications/experimental/pipelines/pipelines/nodes/ranker/ernie_ranker.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/experimental/pipelines/pipelines/nodes/ranker/ernie_ranker.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/experimental/pipelines/pipelines/nodes/ranker/ernie_ranker.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 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... | 39.122137 | 207 | 0.656195 |
31af215b5e77b5e61d0d1edaaf4a70b6e7f5599d | 4,016 | py | Python | WiSe-2122/Bot-Automation/impftermin-buchen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Bot-Automation/impftermin-buchen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Bot-Automation/impftermin-buchen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # 1. Herunterladen von Google Chrome https://www.google.com/intl/de/chrome/
# 2. Google Chrome Version herausfinden
# 3. Passende Chromedriver herunterladen https://chromedriver.chromium.org/downloads
# 4. Selenium installieren
# Windows: py -m pip install selenium
# MacOS: python3 -m pip install selenium
# 5. Au... | 34.62069 | 357 | 0.678785 |
b40e9142bdbd32e9889261269aa913108d359ba9 | 313 | py | Python | python/loginputloop.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | python/loginputloop.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | python/loginputloop.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import os
from time import strftime as now
FORMAT = '%Y-%m-%d %H:%M:%S'
if __name__ == '__main__':
print(now(FORMAT), os.path.dirname(__file__))
s = input()
while s:
with open('log.txt', 'a+') as f:
f.write(now(FORMAT) + ' ' + s + '\n')
f.close()
s = input() | 22.357143 | 49 | 0.507987 |
48a48e8a12f3f2b3b3eb1282abd336cefc8bcf19 | 535 | py | Python | exercises/de/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Definiere die benutzerdefinierte Komponente
def length_component(doc):
# Berechne die Länge des Dokuments
doc_length = len(doc)
print(f"Dieses Dokument ist {doc_length} Tokens lang.")
# Gib das Doc zurück
return doc
# Lade das kleine deutsche Modell
nlp = spacy.load("de_core_news_s... | 25.47619 | 87 | 0.753271 |
48bed1c304d82cbfa460f38aa164c4906a93f466 | 503 | py | Python | influx-demo/db_producer.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | influx-demo/db_producer.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | influx-demo/db_producer.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null |
from influxdb import InfluxDBClient
'''
json_body = [
{
"measurement": "cpu_load_short",
"tags": {
"host": "server01",
"region": "us-west"
},
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
}
]
'''
client = Inf... | 17.344828 | 59 | 0.558648 |
7d5d0e0a72107f3ac4bc71903551ee3e318a769c | 2,784 | py | Python | Utils/tests/old_content_branch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Utils/tests/old_content_branch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Utils/tests/old_content_branch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
from Utils.old_content_branch import should_keep_json_file, should_keep_yml_file, edit_playbooks_directory, ryaml
import json
import shutil
TEST_VERSION = "5.1.9"
JSON_SHOULD_STAY = 'Packs/CommonReports/Reports/report-MTTRbyIncidentType2Quar.json'
YML_SHOULD_STAY = 'Packs/ThinkstCanary/Integrations/ThinkstCanary/Think... | 28.701031 | 113 | 0.72306 |
7db6c61b4b486fd81c364e8df7c77eb7f0889b15 | 731 | py | Python | Python/Tipos e comandos/RaizQuadrada.py | gianvstheworld/POO | f6b9d3d351d703d974a6ca031ee636aea7119367 | [
"MIT"
] | null | null | null | Python/Tipos e comandos/RaizQuadrada.py | gianvstheworld/POO | f6b9d3d351d703d974a6ca031ee636aea7119367 | [
"MIT"
] | null | null | null | Python/Tipos e comandos/RaizQuadrada.py | gianvstheworld/POO | f6b9d3d351d703d974a6ca031ee636aea7119367 | [
"MIT"
] | null | null | null | '''
-- Nome: Gianluca Capezzuto Sardinha
-- NUSP: 11876933
-- Exercício 1
'''
def main():
x = leu()
erro = 1
if(x > 10):
x0 = x/5
else:
x0 = x/2
xi = x0
yi = xi - 1
while(erro > 0.00000001):
xi = (yi+(x/yi))/2
erro = abs(xi - yi)
yi = xi
p... | 14.333333 | 65 | 0.451436 |
81bd9e42d638dfc395c0e0fc5f1bdd497f537acf | 1,213 | py | Python | functions/utils.py | RodrigoLima82/workshop_health | b69324aaf3940f4a4b738d6575137849543e7aa0 | [
"MIT"
] | 1 | 2021-02-28T20:50:11.000Z | 2021-02-28T20:50:11.000Z | functions/utils.py | innovation4health/workshop_i4h | cf072071c3e788297180e86cd5c3f297d8a76bce | [
"MIT"
] | null | null | null | functions/utils.py | innovation4health/workshop_i4h | cf072071c3e788297180e86cd5c3f297d8a76bce | [
"MIT"
] | null | null | null | # Import de bibliotecas
import pandas as pd
import numpy as np
import glob
import random
from scipy.io import loadmat
import matplotlib.pyplot as plt
# Deep Learning
import tensorflow as tf
import keras
import keras.backend as K
from keras.models import load_model
from keras.utils.np_utils import to_categorical
# Imp... | 23.326923 | 79 | 0.642209 |
c48f27cd61d30e6a8a31d2dbdd703f56cfc05ce5 | 3,430 | py | Python | test/test_npu/test_network_ops/test_masked_scatter.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_masked_scatter.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_masked_scatter.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 39.425287 | 82 | 0.672012 |
482aaec439195afc4bb1c655a4e9c37aab676bce | 395 | py | Python | lintcode/162-[DUP]-Find-Peak-Element/FindPeakELement_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/162-[DUP]-Find-Peak-Element/FindPeakELement_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/162-[DUP]-Find-Peak-Element/FindPeakELement_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param A: An integers list.
# @return: return any of peek positions.
def findPeak(self, A):
# write your code here
l, r = 1, len(A) - 2
while l <= r:
m = (l + r) / 2
if A[m - 1] >= A[m]:
r = m - 1
elif A[m] <= A[m ... | 26.333333 | 44 | 0.374684 |
483edb028de3e0ec6374bebcbd01f67d56706c76 | 7,298 | py | Python | TreeOutputLib/OneTimestepOneFile/OneTimestepOneFile.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeOutputLib/OneTimestepOneFile/OneTimestepOneFile.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeOutputLib/OneTimestepOneFile/OneTimestepOneFile.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
from TreeOutputLib.TreeOutput import TreeOutput
import os
## Output class. This class creates one file per timestep at a defined
# location. A line containing time, position, desired geometric measures and
# des... | 46.484076 | 78 | 0.59345 |
48439a7d141690050f60cf03708c36507138af33 | 187 | py | Python | exercises/ja/exc_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/exc_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/exc_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # spaCyをインポートして、日本語のnlpオブジェクトを作成
import ____
nlp = ____
# テキストを処理
doc = ____("私はツリーカンガルーとイッカクが好きです。")
# 最初のトークンを選択
first_token = doc[____]
# 最初のトークンのテキストをプリント
print(first_token.____)
| 13.357143 | 35 | 0.775401 |
6f820b9982903ee83c2d6ec98f30ce9e18207a92 | 60 | py | Python | samt/__init__.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2020-01-16T08:40:00.000Z | 2020-01-16T08:40:00.000Z | samt/__init__.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | null | null | null | samt/__init__.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2019-10-16T08:11:51.000Z | 2019-10-16T08:11:51.000Z | from .samt import Bot, Answer, logger
from .helper import *
| 20 | 37 | 0.75 |
6fa64af864be6c4be8aa4eb590bef8b2954fd1e4 | 9,049 | py | Python | Utils/py/PathPlanner/simulate_both.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/PathPlanner/simulate_both.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/PathPlanner/simulate_both.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from __future__ import division
import LPG
import BISEC as B
from random import uniform as rand
import math
import sys
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
import matplotlib as mpl
import Queue as Q
import copy
import select
from sys import argv
import os.path
im... | 32.433692 | 284 | 0.591557 |
5849a5285404f54763988871948637f2c0fa1643 | 8,990 | py | Python | DDPG/DDPG_agent.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | 2 | 2021-01-06T09:45:23.000Z | 2021-04-21T09:39:14.000Z | DDPG/DDPG_agent.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | DDPG/DDPG_agent.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@File : DDPG_agent.py
@Time : 2020/12/12
@Author : Yuan Yifu
"""
from gym import Env
from utils import OrnsteinUhlenbeckActionNoise, hard_update, soft_update
from DDPG_net import Actor, Critic
import torch
import numpy as np
import torch.nn.functional as F
import random
from collec... | 33.670412 | 241 | 0.582759 |
585fa642e937fcf9127030822a7313deb8dc4a9a | 4,394 | py | Python | src/test/tests/queries/queryMultiWindow.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/queries/queryMultiWindow.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/queries/queryMultiWindow.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: queryMultiWindow.py #
# Tests: queries - Database
#
# Defect ID: none
#
# Programmer: Kathleen Bonnell
# Date: May 19, 2004
#
# Modifications:
# Kathleen Bonnell, Mon Dec 20 15:... | 28.348387 | 79 | 0.604233 |
5499ef2d22bffe32560bb21773e6a84a5a234d4b | 1,404 | py | Python | analyzer/convertcerts.py | ringvorlesung2019mgm/twitter-bingo | f0a1f40024e335977b395049618dafda123e7a8f | [
"Apache-2.0"
] | 2 | 2019-01-15T12:22:43.000Z | 2021-09-08T15:58:49.000Z | analyzer/convertcerts.py | ringvorlesung2019mgm/twitter-bingo | f0a1f40024e335977b395049618dafda123e7a8f | [
"Apache-2.0"
] | 47 | 2018-11-08T14:06:13.000Z | 2019-01-05T17:40:26.000Z | analyzer/convertcerts.py | ringvorlesung2019mgm/twitter-bingo | f0a1f40024e335977b395049618dafda123e7a8f | [
"Apache-2.0"
] | null | null | null | from OpenSSL import crypto
import os.path
"""
Converts a x509 certificate to a PEM-encoded string
"""
def dump_cert(cert):
out = ""
out += "Subject: "+ ", ".join(x[0].decode()+":"+x[1].decode() for x in cert.get_subject().get_components())+"\n"
out += "Issuer: "+ ", ".join(x[0].decode()+":"+x[1].decode() f... | 39 | 154 | 0.62963 |
549c0e1a3ee8ef15b233d93b99c55deaaab5f2a1 | 14,657 | py | Python | tpl/wbs_export.py | nussbrot/code-exchange | 3427798c4391e5f9c17cd19399ac56997c091ee2 | [
"MIT"
] | null | null | null | tpl/wbs_export.py | nussbrot/code-exchange | 3427798c4391e5f9c17cd19399ac56997c091ee2 | [
"MIT"
] | null | null | null | tpl/wbs_export.py | nussbrot/code-exchange | 3427798c4391e5f9c17cd19399ac56997c091ee2 | [
"MIT"
] | null | null | null | """
This module can export a Wishbone slave to VHDL from an SXL 'block' description
@author rhallmen
@date 20.06.2017
"""
import sys
import math
import re
from string import Template
from getpass import getuser
import datetime
import argparse
from os.path import basename, splitext
from antlr4 import *
sys.path.appen... | 32.284141 | 97 | 0.641536 |
3fc9fea0355688e95f8f4a2ede2fbdbde10c263d | 207 | py | Python | extract.py | LosWochos76/haushalt_wetter_extractor | 1132c38ed3fd132262b7263368db7a7eebe6086d | [
"MIT"
] | null | null | null | extract.py | LosWochos76/haushalt_wetter_extractor | 1132c38ed3fd132262b7263368db7a7eebe6086d | [
"MIT"
] | null | null | null | extract.py | LosWochos76/haushalt_wetter_extractor | 1132c38ed3fd132262b7263368db7a7eebe6086d | [
"MIT"
] | null | null | null | from budget import Budget
budget = Budget('Haushaltsplan_2021.pdf', 2021)
budget.extract_text_from_pdf()
budget.read_pages_from_text_files()
budget.write_data_to_excel()
budget.write_product_list_to_excel() | 29.571429 | 47 | 0.850242 |
3fd944be9f21071550244a4c3c268e476893db52 | 998 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/88-89-90_desafio_valide_um_cnpj/validando_cnpj/__init__.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/88-89-90_desafio_valide_um_cnpj/validando_cnpj/__init__.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/88-89-90_desafio_valide_um_cnpj/validando_cnpj/__init__.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import re
import random
def remover_caracteres(cnpj):
return re.sub(r'[^0-9]', '', cnpj)
def total(lista):
lista1 = '6543298765432'
total1 = 0
total2 = 0
for c in range(11):
total1 += int(lista[c]) * int(lista1[1:][c])
formula(total1)
for c in range(12):
total2 += int(lis... | 21.234043 | 92 | 0.60521 |
b76d625f9283b0541db5c61df706d5169aea9228 | 1,668 | py | Python | scripts/docker/download_models.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 460 | 2021-01-26T21:23:37.000Z | 2022-03-31T15:55:10.000Z | scripts/docker/download_models.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 475 | 2021-01-27T01:29:01.000Z | 2022-03-30T20:23:56.000Z | scripts/docker/download_models.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.888889 | 80 | 0.628897 |
b7ce93f0188e14affaf70b9887f9bce3ebda89c6 | 1,362 | py | Python | source/pkgsrc/devel/py-hash/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/py-hash/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/py-hash/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.3 2018/06/30 19:01:52 fhajny Exp $
print is a function in Python 3.
--- setup.py.orig 2014-07-29 06:26:59.000000000 +0000
+++ setup.py
@@ -3,6 +3,7 @@
import sys
import os
import math
+import platform
from ez_setup import use_setuptools
use_setuptools()
@@ -56,14 +57,16 @@ elif os.n... | 36.810811 | 122 | 0.638767 |
4d5ba76b2b632ee48b8b2b1a76937e16f5495c09 | 26,449 | py | Python | toolsederhana2-master/sederhana.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | toolsederhana2-master/sederhana.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | toolsederhana2-master/sederhana.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python
########-NGAPAI GAN MAU RECODE YA?-################################
#######-YAUDAH SILAHKAN TAPI INGAT KATA PEPATAH "BANGSAD KAO"-####
import time, sys, threading, os, urllib, httplib, json
from os import system
def menu():
print "\033[1;91m"
print """+=============================... | 29.818489 | 315 | 0.661084 |
12ee5bfabbf4640b29ca5d150fe2b97e94eb7d05 | 416 | py | Python | Django-Curso/tasks/migrations/0002_auto_20210121_1728.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Django-Curso/tasks/migrations/0002_auto_20210121_1728.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Django-Curso/tasks/migrations/0002_auto_20210121_1728.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-21 20:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tasks', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='task',
name='done',
field=m... | 21.894737 | 97 | 0.572115 |
67b1d7f0385778a6093c1bcd9f7fc379f82f659d | 218 | py | Python | bot/__init__.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/__init__.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/__init__.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import asyncio
import os
from bot import log
log.setup()
# On Windows, the selector event loop is required for aiodns.
if os.name == "nt":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
| 19.818182 | 75 | 0.770642 |
67d43eab7be6b520667d5d42cc6ca9caa2310d4c | 4,901 | py | Python | doc/precursers/2019_09-Sneakernet/Sneakernet/lib/gg.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | doc/precursers/2019_09-Sneakernet/Sneakernet/lib/gg.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | doc/precursers/2019_09-Sneakernet/Sneakernet/lib/gg.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | # sn/lib/gg.py
# GabbyGrove binary encoding
import cbor2
import hashlib
import lib.crypto as crypto
GG_TAG_CIPHERLINK = 1050
GG_CIPHERLINK_FEED_V1 = b'\x01' # ed25519
GG_CIPHERLINK_EVENT_V1 = b'\x02' # sha256
GG_CIPHERLINK_CONTENT_v1 = b'\x03' # sha256
GG_CIPHERLINK_FEED_SSB_V1 = b'\x04'
GG_CI... | 33.340136 | 80 | 0.583554 |
3f30570d7975a6c145605e13b9c8b1de2bf8effc | 409 | py | Python | tests/utils/tensorflow/test_tf_environment.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 9,701 | 2019-04-16T15:46:27.000Z | 2022-03-31T11:52:18.000Z | tests/utils/tensorflow/test_tf_environment.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 6,420 | 2019-04-16T15:58:22.000Z | 2022-03-31T17:54:35.000Z | tests/utils/tensorflow/test_tf_environment.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3,063 | 2019-04-16T15:23:52.000Z | 2022-03-31T00:01:12.000Z | import pytest
from typing import Text, Dict
from rasa.utils.tensorflow.environment import _parse_gpu_config
@pytest.mark.parametrize(
"gpu_config_string, parsed_gpu_config",
[("0: 1024", {0: 1024}), ("0:1024, 1:2048", {0: 1024, 1: 2048})],
)
def test_gpu_config_parser(gpu_config_string: Text, parsed_gpu_confi... | 34.083333 | 87 | 0.753056 |
58e92b9c56182240321483bada385fd0a129683c | 477 | py | Python | INBa/2015/ORSHONOVA_E_G/task_2_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/ORSHONOVA_E_G/task_2_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/ORSHONOVA_E_G/task_2_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 2. Вариант 17.
#Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Ас-Cамарканди. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
#Orshonova. E. G.
#23.05.2016
print ("Если болезнь не определена, невозможно и лечить ее. ... | 59.625 | 205 | 0.779874 |
7a0b0b6446e3627896fda21d031f5cc1f5ac01c3 | 1,547 | py | Python | Hackerrank_problems/kangaroo/kangaroo_solution3.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 205 | 2021-09-30T15:41:05.000Z | 2022-03-27T18:34:56.000Z | Hackerrank_problems/kangaroo/kangaroo_solution3.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 566 | 2021-09-30T15:27:27.000Z | 2021-10-16T21:21:02.000Z | Hackerrank_problems/kangaroo/kangaroo_solution3.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 399 | 2021-09-29T05:40:46.000Z | 2022-03-27T18:34:58.000Z | """ There are two cases:
case 1: When both kangaroo meets at the same location then we have to say "YES".
case 2: If they are not going to meet in the given distance then "NO".
"""
import math
import os
import random
import re
import sys
""" "kangaroo" function takes 4 parameters i.e.
1st kangaroo's start location... | 32.914894 | 119 | 0.588882 |
3628a86c6ac0638371cae72ebd0cf6a2b98e7c89 | 1,812 | py | Python | practices/practice_3/lab_3_sim.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_3/lab_3_sim.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_3/lab_3_sim.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | from time import perf_counter, sleep
from multiprocessing import Process, Manager
from numpy import array, zeros, sin, pi
# Set the control loop timings
frequency = 500
sampling_time = 1/frequency
sim_ratio = 5
pendulum = Manager().Namespace()
# SET INITIAL STATE
pendulum.state = zeros(2)
pendulum.state = array([... | 27.044776 | 74 | 0.571192 |
3d1ad56533ff84a58d6310ec42a935960bde755a | 7,056 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/misopy/test_miso.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/misopy/test_miso.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/misopy/test_miso.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/env python
import os
import sys
import unittest
import pysam
import sam_utils
class TestMISO(unittest.TestCase):
"""
Test MISO functionality.
"""
def setUp(self):
# Find out the current directory
self.miso_path = \
os.path.dirname(os.path.abspath(os.path.expandus... | 39.2 | 81 | 0.49263 |
b132049a2539fda627b5895723e804824d3b0a67 | 1,012 | py | Python | DesignPatterns/CreationalPattern/ObjetPool/object_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | DesignPatterns/CreationalPattern/ObjetPool/object_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | DesignPatterns/CreationalPattern/ObjetPool/object_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | ####################################
# Author: "BALAVIGNESH" #
# Maintainer: "BALAVIGNESH" #
# License: "CC0 1.0 Universal" #
# Date: "10/05/2021" #
####################################
class Calculator:
def add(*args):
return sum(args)
def multiply(*args):
... | 20.653061 | 55 | 0.534585 |
b1616e59b6759e1cb7a159f43db5fed76778c868 | 853 | py | Python | leetcode/173-Binary-Search-Tree-Iterator/BinSearchTreeIterator_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/173-Binary-Search-Tree-Iterator/BinSearchTreeIterator_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/173-Binary-Search-Tree-Iterator/BinSearchTreeIterator_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class BSTIterator:
# @param root, a binary search tree's root node
def __init__(self, root):
self.curt = root
self.stack = []
# ... | 26.65625 | 63 | 0.583822 |
772bdaf9d8dedfa661c1404c477bcf0ea20558d1 | 2,318 | py | Python | Prototype/main prototype/VisualizeWidget.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/VisualizeWidget.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/VisualizeWidget.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | # This Python file uses the following encoding: utf-8
from PyQt5 import QtCore
from PyQt5 import QtWidgets
import pyqtgraph as pg
from pyqtgraph import exporters
class VisualizeWidget(QtWidgets.QWidget):
def __init__(self):
QtWidgets.QWidget.__init__(self)
layout = QtWidgets.QVBoxLayout()
... | 33.594203 | 118 | 0.636756 |
b2a824978b46fce09e6c66963f72b579d40bfa6b | 625 | py | Python | matbench/metadata.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 15 | 2021-11-01T09:02:19.000Z | 2022-03-19T10:59:41.000Z | matbench/metadata.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 62 | 2021-09-20T14:09:59.000Z | 2022-03-30T19:03:22.000Z | matbench/metadata.py | ardunn/matbench | 7d11a2d63766339ec00e610e2255be29b81544d3 | [
"MIT"
] | 4 | 2021-03-22T10:37:42.000Z | 2021-07-20T14:11:28.000Z | """
Metadata for matbench.
"""
from matminer.datasets.utils import _load_dataset_dict
from monty.serialization import loadfn
from matbench.constants import (
MBV01_DATASET_METADATA_PATH,
MBV01_VALIDATION_DATA_PATH,
)
from matbench.util import RecursiveDotDict
MATMINER_DATASET_METADATA = _load_dataset_dict()
... | 26.041667 | 58 | 0.8336 |
0c2b2c8613c9c3c2a3344d953046edbbdd17ac25 | 5,933 | py | Python | Packs/PaloAltoNetworks_IoT3rdParty/Scripts/SendPANWIoTDevicesToCiscoISE/SendPANWIoTDevicesToCiscoISE.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworks_IoT3rdParty/Scripts/SendPANWIoTDevicesToCiscoISE/SendPANWIoTDevicesToCiscoISE.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworks_IoT3rdParty/Scripts/SendPANWIoTDevicesToCiscoISE/SendPANWIoTDevicesToCiscoISE.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
PANW_IOT_INSTANCE = demisto.args().get('panw_iot_3rd_party_instance')
CISCO_ISE_ACTIVE_INSTANCE = demisto.args().get("active_ise_instance")
GET_EP_ID_CMD = 'cisco-ise-get-endpoint-id-by-name'
def send_status_to_panw_iot_cloud(... | 35.106509 | 108 | 0.668127 |
ac8047b5bfb02c7bed68608fef966c365cce9679 | 3,796 | py | Python | addition_module/DMUE/preprocess/crop_align.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | addition_module/DMUE/preprocess/crop_align.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | addition_module/DMUE/preprocess/crop_align.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | import os
import cv2
import numpy as np
from tqdm import tqdm
from skimage import transform as trans
from mtcnn import MTCNN
from face_alignmenet.get_landmark import *
img_root = '/path/to/your/AffectNet_root'
save_root = '/path/to/your/align_larger_256'
missed_img_txt = '/path/to/your/missed_img.txt'
lb_txt = '... | 31.371901 | 119 | 0.567439 |
0248a795a319d86c9c606ab8d42a9eaeb7f9ee3f | 634 | py | Python | hausse/plugins/layout/discover_partials.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | hausse/plugins/layout/discover_partials.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | hausse/plugins/layout/discover_partials.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | import glob
import os
from pathlib import Path, PurePath
from typing import List
from hausse.lib import PathPlugin, Project
class DiscoverPartials(PathPlugin):
"""
Register layouts partials before layout engine plugin execution.
"""
def __init__(self, path: str = "partials", pattern: str = "*.hbs"):... | 23.481481 | 73 | 0.643533 |
0c8a86c7470ae2cb4b0c64de9522035291d90985 | 234 | py | Python | Language Proficiency/Python/Sets/Set .discard(), .remove() & .pop()/set_remove.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Sets/Set .discard(), .remove() & .pop()/set_remove.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Sets/Set .discard(), .remove() & .pop()/set_remove.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
n = int(input())
s = set(map(int, input().split()))
N = int(input())
for _ in range(N):
eval("s.{0}({1})".format(*input().split()+['']))
print(sum(s))
| 16.714286 | 56 | 0.495726 |
0b5b0cc86c95ed34d72265cdaa420fb678375341 | 1,591 | py | Python | simulation.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | simulation.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | simulation.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | """
Simulates a bad driving vehicle
"""
import Image_Recognition.Find_Car as find_car
import Image_Recognition.Find_Box as find_box
import Image_Recognition.Find_Rotation as find_rot
import Simplification.Image_Greyscaling as img_greyscale
import U_Generate_Image as generate_image
import numpy
import time
impor... | 26.966102 | 108 | 0.705845 |
6549b5f8b82cef7e4fe5c25ba22fb3c2be72630b | 210 | py | Python | sso-db/ssodb/common/models/__init__.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-db/ssodb/common/models/__init__.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-db/ssodb/common/models/__init__.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | """SMS SSO Mongoengine Database Models.
"""
from .country_model import Country
from .city_model import City
from .service_model import Service
from .user_model import User
from .activity_model import Activity
| 23.333333 | 39 | 0.814286 |
0bf18861b086baa1885c836f1171decb42edbcb4 | 2,500 | py | Python | scripts/qt1/pyqt_sw09_LCD_Slider_Button_Vererbung.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt1/pyqt_sw09_LCD_Slider_Button_Vererbung.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt1/pyqt_sw09_LCD_Slider_Button_Vererbung.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QWidget, QLCDNumber, QSlider,
QPushButton, QVBoxLayout,
QHBoxLayout, QApplication, QLabel)
class myButton(QPushButton):
# Konstruktor
# benötigt Zugriff auf str '<'... | 30.120482 | 68 | 0.596 |
500e7782331758cc040bde2af424c471c941b0c9 | 145 | py | Python | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/tmp.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/tmp.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/tmp.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | sum = 0
first_num = 1000
last_num = 1200
num = first_num
while num <= last_num:
if num%2 == 0:
sum += num
num += 1
print(sum)
| 11.153846 | 22 | 0.565517 |
68090ea695d85274aea136d2363541ea902a9b2c | 960 | py | Python | app/api/v1/ticket.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | app/api/v1/ticket.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | app/api/v1/ticket.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | from flask_login import current_user, login_required
from app.libs.red_print import RedPrint
from app.libs.error_code import Success, NotFound, Forbidden
from app.validators.ticket import CheckTicketForm
from app.models.user import User
from app.libs.helper import get_ticket, renew_ticket
api = RedPrint('ticket')
@a... | 29.090909 | 60 | 0.708333 |
96ce9fc536517ec8d08ce59e4a8421af856d9a59 | 4,765 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 38.12 | 128 | 0.556348 |
4fd30062df6f81fe3f86f498957c201ebe2b7e16 | 37 | py | Python | main.py | yunyuyuan/wuziqi-back | 448632e4eee81f411564e2e9199fb603029e8008 | [
"MIT"
] | null | null | null | main.py | yunyuyuan/wuziqi-back | 448632e4eee81f411564e2e9199fb603029e8008 | [
"MIT"
] | null | null | null | main.py | yunyuyuan/wuziqi-back | 448632e4eee81f411564e2e9199fb603029e8008 | [
"MIT"
] | null | null | null | from src import start
app = start()
| 9.25 | 21 | 0.702703 |
8c68502f7d1f6630be38cda4c3bbd5df310c61a9 | 1,961 | py | Python | apps/mail/views.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/mail/views.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/mail/views.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_http_methods
from apps.mail import snt
from apps.mail.forms import GroupForm
from apps.mail.models import Group... | 22.802326 | 88 | 0.684345 |
ad53984bafc8c52b5f31f270f18ef6afb516d1ba | 2,854 | py | Python | travelplanner/Route.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | travelplanner/Route.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | travelplanner/Route.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from travelplanner.read_passengers import Read_route
class Route:
def __init__(self, route, speed=10):
self.speed = speed
self.route = Read_route(route)
self.xcoord = []
self.ycoord = []
self.bstop = []
for points ... | 33.97619 | 78 | 0.475123 |
0e18f8cacecf92502af41e78b61d3b90a32d0a83 | 1,630 | py | Python | my-cs/intern/visuality/graphs/pygraph_sample.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/intern/visuality/graphs/pygraph_sample.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | 15 | 2015-03-07T12:46:41.000Z | 2015-04-11T09:08:36.000Z | intern/visuality/graphs/pygraph_sample.py | zaqwes8811/micro-apps | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2007-2008 Pedro Matiello <pmatiello@gmail.com>
# License: MIT (see COPYING file)
# Import pygraph
from pygraph.classes.graph import graph
from pygraph.classes.digraph import digraph
from pygraph.algorithms.searching import breadth_first_search
from pygraph.readwrite.dot import wr... | 33.265306 | 96 | 0.715337 |
adbdfa1cb0a518e39f2d57202650471a8d22cd4c | 1,183 | py | Python | event_detector/gttm/word_cloud/wordcloud.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/word_cloud/wordcloud.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/word_cloud/wordcloud.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import pandas as pd
import os
from wordcloud import WordCloud
def generate_wordcloud(series: pd.Series, stop_words=None, save_wc=False, max_words=20,
filepath_wc=""):
wc = WordCloud(background_color="white", max_words=max_words,
stopwords=stop_wo... | 35.848485 | 109 | 0.682164 |
adbdfae8853d93cd0e713932e6776bff1b06ce9b | 339 | py | Python | project/services/location.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/services/location.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/services/location.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | def assign_location_values(target, origin):
if origin:
target.street = origin.street
target.postalCode = origin.postalCode
target.city = origin.city
target.state = origin.state
target.country = origin.country
target.latitude = origin.latitude
target.longitude ... | 33.9 | 45 | 0.669617 |
70b4e427d5e013b3e9efcf401242df098f538261 | 6,079 | py | Python | research/cv/midas/infer/sdk/eval/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/midas/infer/sdk/eval/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/midas/infer/sdk/eval/util.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... | 30.70202 | 106 | 0.576082 |
1dff43116c71f64c4eb3ee0f3a5aecd11539dd4e | 10,138 | py | Python | source/pkgsrc/lang/python37/patches/patch-Lib_test_test__posix.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python37/patches/patch-Lib_test_test__posix.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python37/patches/patch-Lib_test_test__posix.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_test_test__posix.py,v 1.1 2020/11/17 19:33:26 sjmulder Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
--- Lib/test/test_posix.py.orig 2020-08-15 05:20:16.000000000 +0000
+++ Lib/test/test_posix.py
@@ -1502,9 +1502,239 @@ clas... | 40.714859 | 123 | 0.620043 |
384a3eaed8eee9fb82703b0ca9675bf087bbd48c | 4,308 | py | Python | Session09_AWSSagemakerAndLargeScaleModelTraining/CIFAR100Classifier.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session09_AWSSagemakerAndLargeScaleModelTraining/CIFAR100Classifier.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session09_AWSSagemakerAndLargeScaleModelTraining/CIFAR100Classifier.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | import os
import math
import random
import numpy
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from torchvision import transforms as T, datasets, models
import pytorch_lightning as pl
def accurac... | 39.522936 | 248 | 0.620241 |
2da6286c59a2654a43f2341b8cbab89645c02985 | 1,874 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/docs/tutorial/quickstart/runner.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | Co-Simulation/Sumo/sumo-1.7.0/docs/tutorial/quickstart/runner.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | Co-Simulation/Sumo/sumo-1.7.0/docs/tutorial/quickstart/runner.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 37.48 | 105 | 0.731057 |
2dbae5edb8a4b121491015707f99aafed1ef500a | 198 | py | Python | nz_django/day7/middle_ware_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day7/middle_ware_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day7/middle_ware_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
class User(models.Model):
telephone = models.CharField(max_length=11)
password = models.CharField(max_length=50)
username = models.CharField(max_length=50)
| 28.285714 | 47 | 0.757576 |
35707622aa43bdf303238809cc191637a145ceca | 4,056 | py | Python | chord_rec/models/seq2seq/Seq2Seq.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/models/seq2seq/Seq2Seq.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/models/seq2seq/Seq2Seq.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | import random
import torch
import torch.nn as nn
import torch.optim as optim
class BaseSeq2Seq(nn.Module):
""" The Sequence to Sequence model. """
def __init__(self, encoder, decoder, device):
super().__init__()
self.device = device
self.encoder = encoder.to(device)
self.deco... | 36.872727 | 138 | 0.605523 |
105412c0423945d83d12f7bfed4193828ea34730 | 1,677 | py | Python | IVTa/2014/EGOROV_V_I/task_10_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/EGOROV_V_I/task_10_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/EGOROV_V_I/task_10_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 10. Вариант 8
'''
Напишите программу "Генератор персонажей" для игры.
Пользователю должно быть предоставлено 30 пунктов,
которые можно распределить между четырьмя характеристиками:
Сила, Здоровье, Мудрость и Ловкость.
Надо сделать так, чтобы пользователь мог не только брать
эти пункты из общего "пула", но и во... | 20.45122 | 61 | 0.628503 |
106cc8e093db25fa4d34d1670d65780759b88903 | 1,579 | py | Python | roboraptorz/client/mqttApp/testRoboDriver.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | roboraptorz/client/mqttApp/testRoboDriver.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | roboraptorz/client/mqttApp/testRoboDriver.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | 1 | 2019-10-22T07:47:51.000Z | 2019-10-22T07:47:51.000Z | #!/usr/bin/env python
import logging
import time
from RoboDriver import RoboDriver
from MqttClient import MqttClient
logger = logging.getLogger(__name__)
client = None
def _initializeLogging(loglevel):
numeric_level = getattr(logging, loglevel.upper(), None)
if not isinstance(numeric_level, int):
numeric_lev... | 23.924242 | 129 | 0.708043 |
eaec04c28b335317f1142550ab9e84932d803567 | 4,513 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/third_party/LVM2/daemons/lvmdbusd/request.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/request.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/request.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# a... | 28.745223 | 72 | 0.696433 |
dcbbd16af6f8f1b4fa8e7b8638207106a8560e05 | 1,240 | py | Python | essensplan/customFunctions.py | jkopka/Essensplan | a7abb2f1c4892f89aa19b002dd334cdd619fb43a | [
"MIT"
] | null | null | null | essensplan/customFunctions.py | jkopka/Essensplan | a7abb2f1c4892f89aa19b002dd334cdd619fb43a | [
"MIT"
] | null | null | null | essensplan/customFunctions.py | jkopka/Essensplan | a7abb2f1c4892f89aa19b002dd334cdd619fb43a | [
"MIT"
] | null | null | null | from datetime import date
from datetime import time
from datetime import datetime
from datetime import timedelta
def getMonday(choosenDate):
"""
getMonday() gibt das Datum des letzten Montag des gegebenen Datum zurück
"""
choosenDate
today = choosenDate.weekday()
dateMonday = choosenDate-time... | 29.52381 | 107 | 0.683065 |
f4aa23f109b39276b081b725e458a066217def7d | 793 | py | Python | backend/apps/ineedstudent/urls.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/ineedstudent/urls.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/ineedstudent/urls.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
from apps.iamstudent.views import student_list_view
urlpatterns = [
path('students/<countrycode>/<plz>/<int:distance>', student_list_view, name='list_by_plz'),
#path('students_testing/<countrycode>/<plz>/<int:distance>', views.student_list_view, name='student_l... | 49.5625 | 116 | 0.747793 |
8705afbdf336be2dc9e12ddf4f1eeb36b0785133 | 2,357 | py | Python | research/cv/ESRGAN/src/vgg19/define.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ESRGAN/src/vgg19/define.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ESRGAN/src/vgg19/define.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.15942 | 113 | 0.593975 |
21e118bdf6784ff3e780c861140736ce6b1d6eeb | 603 | py | Python | Raspberry Pi Pico/Ri_Pico_Display_Test.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-03-22T18:38:43.000Z | 2021-03-22T18:38:43.000Z | Raspberry Pi Pico/Ri_Pico_Display_Test.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | null | null | null | Raspberry Pi Pico/Ri_Pico_Display_Test.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-02-06T10:07:36.000Z | 2021-02-06T10:07:36.000Z | import time
import picodisplay as display
width = display.get_width()
height = display.get_height()
display_buffer = bytearray(width * height * 2) # 2-bytes per pixel (RGB565)
display.init(display_buffer)
display.set_backlight(1)
display.set_pen(0, 0, 0) # black
display.clear()
display.set_pen(100, 100, 100) ... | 24.12 | 76 | 0.73466 |
21fd39e97a26098c032f5b956601539944fee179 | 7,626 | py | Python | bildungslogin-plugin/tests/unittests/test_backend_udm_rest_api.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/tests/unittests/test_backend_udm_rest_api.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/tests/unittests/test_backend_udm_rest_api.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
from unittest.mock import patch, Mock
import faker
import nest_asyncio
import pytest
from bildungslogin_plugin.backend import ConfigurationError, DbConnectionError
from bildungslogin_plugin.backend_udm_rest_api import UdmRestApiBackend
from bildungslogin_plugin.models import Class... | 34.981651 | 102 | 0.648702 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.