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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
af9ba867ab002343e923aa58624708062252c393 | 2,296 | py | Python | yapub.py | ahmad88me/YaPub | a370aed2f75b5b35d2a1785429f8c7a6960c1754 | [
"Apache-2.0"
] | null | null | null | yapub.py | ahmad88me/YaPub | a370aed2f75b5b35d2a1785429f8c7a6960c1754 | [
"Apache-2.0"
] | null | null | null | yapub.py | ahmad88me/YaPub | a370aed2f75b5b35d2a1785429f8c7a6960c1754 | [
"Apache-2.0"
] | null | null | null | import yaml
document = """
a: 1
b:
c: 3
d: 4
"""
# print yaml.dump(yaml.load(document))
document = """
title: My awesome paper
authors:
- name: AAA
organization: ORAAA
email: a@a.com
id: a_id
- name: BBB
organization: ORBBB
... | 22.291262 | 83 | 0.530052 |
3cc74a52969ed4e57772561edf919f0c94c48b7f | 82 | py | Python | scripts/import_sega_classics.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | scripts/import_sega_classics.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | scripts/import_sega_classics.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | #!/usr/bin/env python
from retro.scripts.import_sega_classics import main
main()
| 16.4 | 51 | 0.792683 |
3ce0f30a7c6510f65a159e542cd9b452d0235af6 | 191 | py | Python | apps/tess/urls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/tess/urls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/tess/urls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.urls import path
from apps.tess import views
app_name = 'tess'
urlpatterns = [
path('', views.index, name='index'),
path('refresh', views.refresh_data, name='refresh'),
] | 23.875 | 56 | 0.691099 |
3cf6c2677ee56a2e6887a5f2946d46ec0641a103 | 6,872 | py | Python | Shiva-master/shiva.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Shiva-master/shiva.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Shiva-master/shiva.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/env python
# -*- coding: utf-8 -*-
import threading
import requests
import proxify
import random
import argparse
import sys
requests.packages.urllib3.disable_warnings()
# Just some colors and shit
white = '\x1b[1;97m'
green = '\x1b[1;32m'
red = '\x1b[1;31m'
red = '\x1b[31m'
yellow = '\x1b[1;33m'
end = '\x1b... | 53.6875 | 173 | 0.677969 |
e64a424a5a2addbd82d26a27d59052e92a5487a6 | 2,774 | py | Python | official/cv/MCNN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/MCNN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/MCNN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.486486 | 105 | 0.653569 |
553ee044f402c58c751828225c57b11bf8dff55b | 303 | py | Python | codeit/oop/vehicle.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/vehicle.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/vehicle.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Vehicle(ABC):
@abstractmethod
def start(self):
pass
@property
@abstractmethod
def speed(self):
pass
def stop(self):
self.speed = 0
if __name__ == '__main__':
print(Vehicle.mro())
print(dir(Vehicle))
| 14.428571 | 35 | 0.60066 |
e9bc6dec48ad14d628b2c3a50d8ac08e25c6e854 | 1,865 | py | Python | finbyz_dashboard/finbyz_dashboard/dashboard_chart_source/top_sales_item_to_deliver/top_sales_item_to_deliver.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 1 | 2021-11-19T05:27:11.000Z | 2021-11-19T05:27:11.000Z | finbyz_dashboard/finbyz_dashboard/dashboard_chart_source/top_sales_item_to_deliver/top_sales_item_to_deliver.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | null | null | null | finbyz_dashboard/finbyz_dashboard/dashboard_chart_source/top_sales_item_to_deliver/top_sales_item_to_deliver.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 2 | 2021-08-21T10:41:38.000Z | 2021-11-19T05:27:13.000Z | # 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, json
from frappe import _
# from frappe.utils.dashboard import cache_source
from finbyz_dashboard.finbyz_dashboard.dashboard_overrides.da... | 32.719298 | 123 | 0.714745 |
f99d229160605666dd380df5b23b006a90978214 | 95 | py | Python | Licence 2/I33/TP 2/ex_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 2/ex_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 2/ex_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def pgcd(a, b):
while b > 0:
a, b = b, a % b
return a
print(pgcd(5, 0))
print(pgcd(5, 36)) | 13.571429 | 18 | 0.536842 |
32f94890b01583268d59c47009f251c5a21f1776 | 68 | py | Python | cs/lambda_cs/06_graphs/notes/randomish.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/06_graphs/notes/randomish.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/06_graphs/notes/randomish.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Graphs :: Day 3
"""
import random
print(random.randrange(10))
| 8.5 | 27 | 0.647059 |
bd0368414ab40f91df33590514abe1342ff71b01 | 2,013 | py | Python | codeit/oop/dependency_inversion_principle/gamecharacter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/dependency_inversion_principle/gamecharacter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/dependency_inversion_principle/gamecharacter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class IWeapon(ABC):
"""무기 클래스"""
@abstractmethod
def use_on(self, other_character):
pass
class Sword(IWeapon):
"""검 클래스"""
def __init__(self, damage):
self.damage = damage
def use_on(self, other_character):
"""검 사용 메소드"""
ot... | 24.851852 | 65 | 0.594138 |
8d0b57e007c633ec698ceec9c2b0d2e876fa788a | 75,848 | py | Python | module/twitter.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | module/twitter.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | module/twitter.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import queue
import threading
import os
import time
import string
# 图片缓存
import urllib
import traceback
# 引入配置
from load_config import config
from datetime import datetime, timedelta, timezone
from module.msgStream import SendMessage
import module.msgStream as msgStream
from helper import dictI... | 38.095429 | 215 | 0.493817 |
f1b786eddddf489fa1c1fb866e20e6b8cbdc151f | 1,248 | py | Python | docker/django/restaurant/restapi/migrations/0003_auto_20211227_1423.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapi/migrations/0003_auto_20211227_1423.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapi/migrations/0003_auto_20211227_1423.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | # Generated by Django 3.2 on 2021-12-27 14:23
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('restapi', '0002_restaurantmodel_contact'),
]
operations = [
migrations.CreateMod... | 32 | 117 | 0.585737 |
7b5bf15fcb5dc57c6820ec94c9b053130bc88bb2 | 820 | py | Python | python/en/_matplotlib/gallery/text_labels_and_annotations/simple_axes_labels.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/text_labels_and_annotations/simple_axes_labels.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/text_labels_and_annotations/simple_axes_labels.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
text_labels_and_annotations/simple_axes_labels.py
Matplotlib > Gallery > Text, labels and annotations> Simple axes labels
https://matplotlib.org/3.1.1/gallery/pyplots/fig_axes_labels_simple.html#sphx-glr-gallery-pyplots-fig-axes-labels-simple-py
"""
import numpy as np... | 28.275862 | 123 | 0.708537 |
cd9ce8e1bddfcd508892755ae174c2371a92b40b | 737 | py | Python | workshop_petstagram/workshop_petstagram/main/validators.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | workshop_petstagram/workshop_petstagram/main/validators.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | workshop_petstagram/workshop_petstagram/main/validators.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from datetime import date
from django.core.exceptions import ValidationError
def validate_only_letters(value):
if not value.isalpha():
raise ValidationError('Value must contain only letters!')
def validate_file_max_size_in_mb(image):
limit_mb = 5
file_size = image.file.size
if file_size > ... | 23.774194 | 73 | 0.702849 |
a82e0733af1af159f586875c9fc4897c09c9573d | 1,862 | py | Python | Crawler/db_config.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Crawler/db_config.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Crawler/db_config.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | import psycopg2
DATABASE_FILE = 'corona_app'
SQLALCHEMY_DATABASE_URI = 'postgresql://' # Fallback to Zero
SQLALCHEMY_ECHO = True
import logging
import os
from urllib.parse import quote
import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
logger = logging.getLogger(__name__)
logging... | 33.854545 | 179 | 0.692803 |
93b644fb25614d8192f74ddc532638633f5502cb | 351 | py | Python | Python/Exercícios_Python/021_tocando_um_mp3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/021_tocando_um_mp3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/021_tocando_um_mp3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""021 - Tocando um Mp3
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/16qXv5jjokZErtaz_KTAWsi6V9EKJuDvg
"""
"""
Não tive paciência de terminar
"""
from pygame import mixer
mixer.init()
mixer.music.load('ex021.mp3')
mixer.music... | 20.647059 | 77 | 0.732194 |
f534312ca8d9426effa56b5bec2b804c2fbe6a9f | 3,286 | py | Python | zencad/gui/mainwindow.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/gui/mainwindow.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/gui/mainwindow.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import sys
import os
import time
import signal
import json
import zencad.gui.actions
from zencad.gui.info_widget import InfoWidget
from zencad.settings import Settings
from PyQt5 import QtCore, QtGui, QtWidgets, QtOpenGL
from zenframe.mainwindow import ZenFrame
from zenframe.util import print_to_stderr
class MainW... | 31.902913 | 89 | 0.585819 |
1965f0ec498b2c59bfdea7ad4339189047f3f1bf | 7,483 | py | Python | Apps/Model Evaluation/maxent_chunker.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | 1 | 2021-04-13T10:00:46.000Z | 2021-04-13T10:00:46.000Z | Apps/Model Evaluation/maxent_chunker.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | Apps/Model Evaluation/maxent_chunker.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | # Natural Language Toolkit: Chunk parsing API
#
# original file: http://www.nltk.org/_modules/nltk/chunk/named_entity.html
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Named entity chunker
"""
from __future_... | 31.978632 | 78 | 0.56782 |
275297b739edb2aa7a27b7b6c2f9475d8b5cd5e4 | 126 | py | Python | WD/Cwiczenia/Liczenie/SlownikKlucze.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | 1 | 2020-02-29T14:38:33.000Z | 2020-02-29T14:38:33.000Z | WD/Cwiczenia/Liczenie/SlownikKlucze.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | WD/Cwiczenia/Liczenie/SlownikKlucze.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | def SlownikKlucze(ile):
Slownik={}
for i in range(5,5*ile+5,5):
Slownik[i]='a'+str(i)
return Slownik
| 21 | 33 | 0.555556 |
27889657525540ab5e6e4112b189fc99c50eb02c | 385 | py | Python | leetcode/0624-Maximum-Distance-in-Arrays/py3/Solution.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/0624-Maximum-Distance-in-Arrays/py3/Solution.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/0624-Maximum-Distance-in-Arrays/py3/Solution.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
def maxDistance(self, arrays: List[List[int]]) -> int:
res, min_val, max_val = 0, arrays[0][0], arrays[0][-1]
for i in range(1, len(arrays)):
l, r = arrays[i][0], arrays[i][-1]
res = max([res, abs(r - min_val), abs(l - max_val)])
min_val = min(min_... | 38.5 | 64 | 0.519481 |
8bab499b165ae938fa1270039d7964a794706faf | 1,965 | py | Python | notebooks/util/vespa_helper/queries.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | notebooks/util/vespa_helper/queries.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | notebooks/util/vespa_helper/queries.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | import re
from sentence_transformers import SentenceTransformer
from vespa.application import Vespa
model = SentenceTransformer('distiluse-base-multilingual-cased')
def get_facets(vespa_url: str, facet_field: str):
app = Vespa(url=vespa_url)
response = app.query(
body={
"yql": f"select *... | 35.089286 | 228 | 0.602545 |
d0d90180504ea74a67b6daec55c1082e630a1386 | 1,835 | py | Python | Crashkurs Python/Sigmoide_Funktionen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | 2 | 2020-03-23T14:57:50.000Z | 2021-03-24T18:12:07.000Z | Crashkurs Python/Sigmoide_Funktionen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs Python/Sigmoide_Funktionen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
xlim = 10
x = np.linspace(-xlim, xlim, 500)
plt.figure(figsize=(3,3)) # 400x400 Pixel
plt.title('Heaviside Funktion', fontsize=20)
plt.plot(x, np.heaviside(x, 1.0), linewidth=10, color='red')
plt.xlim([-10, 10])
plt.grid(True)
plt.show()
input("Drück eine Taste..."... | 25.136986 | 90 | 0.640872 |
f5adaca2a99c7c053b7ff1a9ef0841a91f895972 | 1,275 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/06_erstellen_von_diagrammen/06_erstellen_von_diagrammen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/06_erstellen_von_diagrammen/06_erstellen_von_diagrammen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/06_erstellen_von_diagrammen/06_erstellen_von_diagrammen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 06_erstellen_von_diagrammen.py
# In diesem Beispiel geht es darum automatisch Diagramme in ein Excelsheet einzufügen.
import os, openpyxl
from openpyxl.styles import Font, Alignment
from math import pi, sin
os.chdir(os.path.dirname(__file__))
target_file='.\\excel_with_diagrams.xlsx'
excel_file=openpyxl.Workbook(... | 34.459459 | 157 | 0.810196 |
eb051ac4c9e41689b740406672bd2e35d05ccf1d | 1,488 | py | Python | CS303/lab4-6/work/algorithm_ncs/stm.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS303/lab4-6/work/algorithm_ncs/stm.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS303/lab4-6/work/algorithm_ncs/stm.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import json
from algorithm_ncs import ncs_c as ncs
import argparse
import random
parser = argparse.ArgumentParser(description="This is a NCS solver")
parser.add_argument("-c", "--config", default="algorithm_ncs/parameter.json",
type=str, help="a json file that contains parameter")
parser.add_argum... | 31 | 77 | 0.579301 |
19f246915da6d66dee4beaf7504f693810e4c2e6 | 162 | py | Python | begin-python/cp14/client.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp14/client.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp14/client.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
import socket
s = socket.socket()
host = socket.gethostname()
port = 1234
s.connect((host, port))
print s.recv(1024) | 16.2 | 27 | 0.67284 |
dfb102a0776d573d2a9609bdfb29cd0c18682418 | 16,456 | py | Python | md5crack/md5crack.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | md5crack/md5crack.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | md5crack/md5crack.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python3
#author : Dxvistxr - LSD
#coding:utf-8
import requests
import json
import time
from datetime import datetime
import platform
import subprocess
import os
import sys
import argparse
import hashlib
class config():
#API_LINK = https://md5decrypt.net/en/Api/
email = 'youremail@gmail.co... | 61.632959 | 217 | 0.414621 |
a03c59774d428ae3470f144d56857de68ab46d35 | 1,397 | py | Python | assignments/Chat/tools.py | oliverguhr/htw-nlp-lecture | 371042ef360510d12ac454198056656967317cc1 | [
"MIT"
] | 11 | 2019-04-10T14:26:58.000Z | 2021-04-21T06:10:51.000Z | assignments/Chat/tools.py | oliverguhr/htw-nlp-lecture | 371042ef360510d12ac454198056656967317cc1 | [
"MIT"
] | null | null | null | assignments/Chat/tools.py | oliverguhr/htw-nlp-lecture | 371042ef360510d12ac454198056656967317cc1 | [
"MIT"
] | 1 | 2021-06-10T13:05:12.000Z | 2021-06-10T13:05:12.000Z | import numpy as np
from termcolor import colored
from typing import List
import random
import pickle
import os
import re, locale
class Pattern:
def __init__(self,name:str):
self.input:List[str] = list()
self.response:List[str] = list()
self.name = name
self.input_vectors: List... | 32.488372 | 97 | 0.568361 |
a06b2c548bff50de8fb66277f1d3acb21b5f7431 | 2,688 | py | Python | examples/LaTeX/tst_LaTeX_grammar.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | examples/LaTeX/tst_LaTeX_grammar.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | examples/LaTeX/tst_LaTeX_grammar.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""tst_LaTeX_grammar.py - runs the unit tests for the LaTeX grammar
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2017 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licens... | 34.025316 | 93 | 0.6875 |
26866375929dd9995f6ee7c7f282628bc2eb2b8f | 8,233 | py | Python | py/main.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | py/main.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | py/main.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import ask_db
import ask_util
import json
import requests
import time
import urllib.request
import xml.etree.ElementTree as ET
from urllib.parse import parse_qs
from urllib.parse import urlparse
from int... | 31.423664 | 567 | 0.666707 |
26a58a0556aa8c0ab249c7dae8241468f0a6c3f3 | 4,391 | py | Python | movies/project/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | movies/project/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | movies/project/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | """
This is the top level UI for the Python Movies Project
At this level we instantiate the Central Window which has the
GUI elements. This is also the level of handling signal/slot connections.
"""
import datetime
import json
import logging
import traceback
import numpy as np
import pandas as pd
import PyQt5
import... | 37.211864 | 104 | 0.6798 |
39c8f2a7ce7e2b09dcacd3d66934a2c491d45e32 | 1,084 | py | Python | chapter2/problem2.py | Baw25/MongoStuff | 0a6f35505948d36b3bf1b07a1a75709babaeca71 | [
"MIT"
] | null | null | null | chapter2/problem2.py | Baw25/MongoStuff | 0a6f35505948d36b3bf1b07a1a75709babaeca71 | [
"MIT"
] | null | null | null | chapter2/problem2.py | Baw25/MongoStuff | 0a6f35505948d36b3bf1b07a1a75709babaeca71 | [
"MIT"
] | null | null | null | # Write a program in the language of your choice
# that will remove the grade of type "homework"
# with the lowest score for each student from the dataset in the handout.
# Since each document is one grade, it should remove one document per student.
# This will use the same data set as the last problem, but if you... | 29.297297 | 81 | 0.602399 |
f2d6f99a0a1f32f986a894267b46e427da9b404d | 473 | py | Python | movies/tmdb/example.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | movies/tmdb/example.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | movies/tmdb/example.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import os
import tmdbv3api
if __name__ == "__main__":
tmdb = tmdbv3api.TMDb()
tmdb.api_key = os.environ['TMDB_API_KEY']
movie = tmdbv3api.Movie()
movieTitle = "Clerks"
movieID = 2292
details = movie.details(movieID)
search = movie.search(movieTitle)
print(se... | 19.708333 | 45 | 0.646934 |
083b15083e28ad18467ee83111c6f2a0900c5c71 | 1,808 | py | Python | xiaohongshu/xhs_note_search.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | xiaohongshu/xhs_note_search.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | xiaohongshu/xhs_note_search.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | # 小红书笔记在线查询
import redis
import json
import requests
import hashlib
from urllib.parse import quote
import CralwerSet.connect_mysql as connect_mysql
def get_Xsign(keyword, page):
data = "/fe_api/burdock/weixin/v2/search/notes?keyword=%s&sortBy=general&page=%s&pageSize=40&needGifCover=trueWSUDD" % (
quot... | 40.177778 | 289 | 0.733407 |
4bae67801d7b878d2075190a20d8d058bd2a2f99 | 6,299 | py | Python | nodes/p4_Qt_Move2Goal_Obstacle/Qt_Move_to_Goal_Obstacle_360Grad.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/p4_Qt_Move2Goal_Obstacle/Qt_Move_to_Goal_Obstacle_360Grad.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/p4_Qt_Move2Goal_Obstacle/Qt_Move_to_Goal_Obstacle_360Grad.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
# --- Qt_Move_to_Goal_Obstacle.py ------
# Version vom 28.10.2021 by OJ
# -------------------------------------------------
# TurtleBot fährt zum Ziel und stoppt bei Hindernis
# rtc P4
# -------------------------------------------------
import sys
import rospy
import math
from TurtleBotClassFile ... | 31.495 | 77 | 0.574694 |
4b094e3fa9a8d0efe91ddaefc3641171d9d28e24 | 2,415 | py | Python | web_blog/src/models/user.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | web_blog/src/models/user.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | web_blog/src/models/user.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | import uuid
import datetime
from flask import session
from common.database import Database
from models.blog import Blog
import sys
class User(object):
def __init__(self, email, password, _id=None):
self.email = email
self.password = password
self._id = uuid.uuid4().hex if _id is None else... | 27.134831 | 75 | 0.569772 |
8a1803fda9ccf21c75eb7aad898d90dccea028f2 | 3,784 | py | Python | v702/python/Rhodium.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v702/python/Rhodium.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v702/python/Rhodium.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
import scipy.constants as const
import uncertainties.unumpy as unp
N = np.genfromtxt("python/rhodium.txt", unpack=True)
fehler = 13
lenN = len(N)
t = np.linspace(1, lenN, lenN)
t *= 20
N -= -fehler
fehlerN = ... | 27.223022 | 117 | 0.671512 |
8a972fff1212ce62130748ea6332743bede08e9c | 3,507 | py | Python | NeuralNet/Oli/libs/ModelSerializer.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | NeuralNet/Oli/libs/ModelSerializer.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | NeuralNet/Oli/libs/ModelSerializer.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | import json
import uuid
from pathlib import Path
from keras.models import model_from_json
from numpy.core.multiarray import ndarray
class ModelSerializer:
"""
Manages the saving and loading of a keras NN model from and to disk.
Also allows saving of additional metadata about a trained NN model
"""
... | 32.775701 | 95 | 0.645851 |
0a03aa7ee0621ecd997c9424ed20d18c79f34164 | 4,398 | py | Python | Apps/Dalphi Service/lib/merge_processing.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | 1 | 2021-04-13T10:00:46.000Z | 2021-04-13T10:00:46.000Z | Apps/Dalphi Service/lib/merge_processing.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | Apps/Dalphi Service/lib/merge_processing.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3.5
# -*- coding: utf-8 -*-
# import python libs
from pprint import pprint as pp
import base64
import json
import os
from datetime import datetime
# import project libs
# -
# defining globals & constants
SAVE_DOCUMENTS_TO_FILE = True
SAVE_CORPUS_TO_FILE = True
SAVE_ANNOTATION_DURATIONS = Tru... | 34.359375 | 92 | 0.671214 |
7c5556e6c7c88e7ababa579eb7a6df37f94e8556 | 466 | py | Python | pacman-arch/test/pacman/tests/sync031.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sync031.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sync031.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sync packages explicitly"
lp1 = pmpkg("pkg1")
lp1.reason = 1
self.addpkg2db("local", lp1)
p1 = pmpkg("pkg1", "1.0-2")
p2 = pmpkg("pkg2", "1.0-2")
for p in p1, p2:
self.addpkg2db("sync", p)
self.args = "-S --asexplicit %s" % " ".join([p.name for p in (p1, p2)])
self.addrule("PACMAN_RETCODE=0")
... | 23.3 | 71 | 0.667382 |
7c6f114f99d7f0de3c5893d004c6c0bcc4cc5fc9 | 25,524 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/bladeinfo_lib.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/bladeinfo_lib.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/bladeinfo_lib.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 41.637847 | 135 | 0.490284 |
7ccc55daaf7df835c114d5ce22ec0fb45bb9ec75 | 716 | py | Python | source-code/Pseudocode/Euklidischer-Algorithmus/basiswechsel.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | source-code/Pseudocode/Euklidischer-Algorithmus/basiswechsel.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | source-code/Pseudocode/Euklidischer-Algorithmus/basiswechsel.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def euklid(b, Z):
"""
Euclids algorithm to change the basis.
Returns
-------
dict
A dictionary mapping the i-th position of the new number to its value,
where higher numbers are more significant.
Examples
--------
>>> eukl... | 18.842105 | 78 | 0.467877 |
6b043990a4894069748ec98f66aeda8285a96893 | 1,183 | py | Python | Classes/Player_object_board.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Player_object_board.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Player_object_board.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | import pygame
import time
class Player_object_board(object):
x, y = '', ''
desc = ''
bombs = ''
speed = ''
range_bomb = ''
def __init__(self, pos, player, bombs, range, speed):
self.x = pos[0]
self.y = pos[1]
self.desc = player
self.rect = pygame.Rect(self.x, se... | 21.509091 | 57 | 0.578191 |
863658646ab6fb5c4c378212005946265472f592 | 422 | py | Python | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/printf.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/printf.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/printf.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | x = 10
y = 2.24552
z = "I like turtles!"
# Using the printf operator (%), print the following feeding in the values of x,
# y, and z:
# x is 10, y is 2.25, z is "I like turtles!"
print('x is %d, y is %.2f, z is \'%s\'' % (x, y, z))
# x + z
# Use the 'format' string method to print the same thing
print('x is {}, y is ... | 28.133333 | 80 | 0.556872 |
86dfb1116f22e6bbf4cc2e7490ae7d4a13f30b24 | 5,788 | py | Python | suds/sax/attribute.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | suds/sax/attribute.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | suds/sax/attribute.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | 31.802198 | 76 | 0.579129 |
810a8ec4bb5c8697b971aa821e355848fe41723f | 908 | py | Python | aoc2020/day_04/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_04/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_04/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
class Solution(SolutionABC):
expected = 2
def solve(self) -> any:
ret, buffer = 0, []
for line in self.resource_lines("input"):
if line != "":
[buffer.append(_) for _ in line.split(" ")]
continue
elif self.is_valid(... | 23.894737 | 60 | 0.461454 |
d4979968e61ee394a92bddfc3c11bef716c997d2 | 1,725 | py | Python | frappe-bench/apps/erpnext/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- 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.hotels.doctype.hotel_room_reservation.hotel_room_reservation import HotelRoomPricingNotSetError, HotelRoomUnavailableError
te... | 27.822581 | 135 | 0.728696 |
1332073eee4498db66544add68b2a0724b8588df | 1,124 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/check-vamp-fixed.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/check-vamp-fixed.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/check-vamp-fixed.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import glob
import eval_manager
#import mar_collection
import sonic
def vamp_fixed(queue, data):
plugin = "vamp:vamp-example-plugins:fixedtempo:tempo"
detected_mf_template = "fixed_tempo"
sonic.vamp_collection(queue, data, plugin, detected_mf_template)
def main... | 22.48 | 68 | 0.650356 |
13eb034697be05a4c8030e4c1f93ece73a5bab1e | 5,612 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/ava_evaluation/metrics.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/ava_evaluation/metrics.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/ava_evaluation/metrics.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:51:21.000Z | 2022-03-07T10:51:21.000Z | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applic... | 38.972222 | 78 | 0.68407 |
6a0741d1ca8a12e37fc665ecb73a69b7de4d39c4 | 5,764 | py | Python | src/Sephrasto/DatenbankEditFertigkeitWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/DatenbankEditFertigkeitWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/DatenbankEditFertigkeitWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 18 11:21:32 2017
@author: Aeolitus
"""
import Fertigkeiten
from Hilfsmethoden import Hilfsmethoden, VoraussetzungException
import UI.DatenbankEditFertigkeit
from PyQt5 import QtWidgets, QtCore
class DatenbankEditFertigkeitWrapper(object):
def __init__(self, datenbank... | 46.861789 | 144 | 0.661173 |
dbed63da1e9779b3070b748e1b50f2a2077ffecb | 1,471 | py | Python | python/oneflow/boxing/nccl/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/boxing/nccl/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/boxing/nccl/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 39.756757 | 82 | 0.828008 |
160c1d2c2011e1c60832b10097a766a450760842 | 2,240 | py | Python | Simple Wave Analysis/mgmt4[Jul.15th,2019].py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/mgmt4[Jul.15th,2019].py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/mgmt4[Jul.15th,2019].py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | import os
import os.path
Datadir_path = "./data/"
Target_dir = "Pedometer_test1[Jul.15th,2019]/"
Datafile_path = Datadir_path + Target_dir
File_prefix = "Pedometer_test"
#str_compass = "Info: MAG:"
Str_accelerator_prefix = "Info:ACC: "
Append_prefix = "acc_"
Child_path = "Processed_data/"
Innerfile_prefix = 'Pedometer... | 38.62069 | 118 | 0.616518 |
bca132b3b8f08597cbd7d103bd7fca53feb5b794 | 199 | py | Python | ___Python/Thomas/pycurs_180625/p09_isbn/m01_genauigkeit.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p09_isbn/m01_genauigkeit.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p09_isbn/m01_genauigkeit.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import fractions
import math
potenz = 2 ** 4096
print(potenz)
a = fractions.Fraction(3,4)
b = fractions.Fraction(1,8)
c = a+b+1
print(c)
print(float(c))
c = math.sin(c)
print(c)
| 11.705882 | 28 | 0.61809 |
4c6c132cdacc324ea3739bd487a7cafca599c155 | 1,732 | py | Python | 016-C124-FlaskAPI/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 016-C124-FlaskAPI/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 016-C124-FlaskAPI/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | from flask import Flask, request, jsonify
import os, pickle, faker
from numpy import number
app = Flask(__name__)
# generate virtual person
details = faker.Faker()
name = details.name()
# load data
if not os.path.exists('data.pkl'):
data = [
{
"number": "9096979834",
"name": name,... | 26.242424 | 70 | 0.560046 |
914b042d18add8182c8de4e2fc53f9bf98c76d23 | 569 | py | Python | musterloesungen/3.4/reisen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/3.4/reisen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/3.4/reisen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Aufgabe: 3.4
def vorschlag_reise(anzahl_kilometer):
if anzahl_kilometer < 3.2... | 31.611111 | 76 | 0.666081 |
e69d4e3c9374c6ed6813f77ec049f160f9afad14 | 1,421 | py | Python | eda/compress_eda.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | eda/compress_eda.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | eda/compress_eda.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | from turbojpeg import TurboJPEG
from PIL import Image
import numpy as np
import os
from tqdm import tqdm
from datetime import datetime
LIB_PATH = r'turbojpeg.dll' # path to turbojpeg dll
def compress_image(jpeg, in_file_path, out_file_path, qf):
"""Compresses the given image with the given quality factor.
Ar... | 33.046512 | 86 | 0.677692 |
fc8da364a3b1dbc41bfe04a764581f6e186605a2 | 1,415 | py | Python | flows/pose_estimators/articulation/articulation_estimator.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | flows/pose_estimators/articulation/articulation_estimator.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | flows/pose_estimators/articulation/articulation_estimator.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | model = dict(type='ArticulationEstimator')
data_root = '/disk4/data/arti_data/real_data/box/'
data = dict(
samples_per_gpu=1,
workers_per_gpu=1,
train=dict(
type='ArticulationDataset',
ann_file=data_root + 'train_meta.txt',
img_prefix=data_root,
intrinsics_path=data_root + 'c... | 29.479167 | 81 | 0.677739 |
5dcc3559770a5b57ec1649d3a5aed7a0c5b3e1e4 | 10,655 | py | Python | bigbench/bbseqio/task_api.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/bbseqio/task_api.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/bbseqio/task_api.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 34.820261 | 96 | 0.717034 |
4accdac004b2a73221766fd5e93c63abb56e662d | 13,066 | py | Python | python/tutlibs/dataset.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-11-22T10:32:49.000Z | 2021-11-22T10:32:49.000Z | python/tutlibs/dataset.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-12-09T14:39:51.000Z | 2021-12-09T14:39:51.000Z | python/tutlibs/dataset.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | null | null | null | import os
from os.path import join as opj
import numpy as np
import json
import cv2
import scipy.io
import requests
import re
from requests.models import Response
import zipfile
import glob
from typing import List, Tuple
from dataclasses import dataclass
from .io import Mesh
def download_data(
url: str, output_d... | 36.294444 | 136 | 0.647941 |
72d091f9271564561d20421f62780372791b0cf5 | 681 | py | Python | data_tests/saved__backend__/cython/row_sum_boost.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/cython/row_sum_boost.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__/cython/row_sum_boost.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | try:
import cython
except ImportError:
from transonic_cl import cython
import numpy as np
def row_sum(arr, columns):
return arr.T[columns].sum(0)
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
@cython.noneckeck(False)
def row_sum_loops(arr, columns):
# locals type anno... | 21.967742 | 54 | 0.651982 |
2294224d6ad7bb72c37b004f9a253add1ff9b909 | 1,981 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex07_spiral_traversal_optimized.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex07_spiral_traversal_optimized.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex07_spiral_traversal_optimized.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from enum import Enum
from ch06_arrays.intro.intro import get_dimension
class Direction(Enum):
RIGHT = (1, 0)
DOWN = (0, 1)
LEFT = (-1, 0)
UP = (0, -1)
def next(self):
keys = list(Direction.__members... | 21.532609 | 74 | 0.504796 |
22a8f362efc7089d0faa1f9f67d2dd8d4989e454 | 1,412 | py | Python | sketches/Bouncing_Ball_Simulator_Stage_4/bouncingball.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/Bouncing_Ball_Simulator_Stage_4/bouncingball.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/Bouncing_Ball_Simulator_Stage_4/bouncingball.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | import random as r
class BouncingBall(object):
def __init__(self):
self.x = r.randint(20, width - 20)
self.y = r.randint(20, 200)
self.location = PVector(self.x, self.y)
self.velocity = PVector(0, 0)
self.d = r.randint(15, 30)
a = 200
colors = [color(230, 96... | 31.377778 | 65 | 0.484419 |
fe144ee6367fc8208f408c8ed22d2e081abcda47 | 1,039 | py | Python | leetcode/054-Spiral-Matrix/SpiralMatrix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/054-Spiral-Matrix/SpiralMatrix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/054-Spiral-Matrix/SpiralMatrix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[][]} matrix
# @return {integer[]}
def spiralOrder(self, matrix):
if len(matrix) == 0 or len(matrix[0]) == 0:
return []
res = []
top, bottom = 0, len(matrix) - 1
left, right = 0, len(matrix[0]) - 1
while left < right and to... | 33.516129 | 51 | 0.455245 |
431481f6a6bbd8b4a3ccf5441242f68e176dfd72 | 1,519 | py | Python | Packs/CommonScripts/Scripts/VerifyIPv6Indicator/VerifyIPv6Indicator_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/VerifyIPv6Indicator/VerifyIPv6Indicator_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/VerifyIPv6Indicator/VerifyIPv6Indicator_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from hypothesis import HealthCheck, given, settings, strategies
import demistomock as demisto
from VerifyIPv6Indicator import is_valid_ipv6_address, main
@pytest.mark.parametrize(
"address, expected",
[
('12::34::56', False),
('1:2:3:4:5:6:7:8', True),
('1:2:3:4::5::7', ... | 26.649123 | 85 | 0.640553 |
4a54893ab9e36c621dae7e6e2000e448c9067853 | 722 | py | Python | Data Structures/Python/Trees/preorder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Data Structures/Python/Trees/preorder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Data Structures/Python/Trees/preorder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | """
Complete the preOrder function in your editor below, which has parameter: a pointer to the root of a binary tree. It must print the values in the tree's preorder traversal as a single line of space-separated values.
Input Format
Our hidden tester code passes the root node of a binary tree to your preOrder funct... | 23.290323 | 216 | 0.700831 |
43cf2ac4c3035e8f99da4f392cd268a8d827dcf5 | 770 | py | Python | Python-Fundamentals/array_modifier.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | Python-Fundamentals/array_modifier.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | Python-Fundamentals/array_modifier.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | initial_array = list(map(int, input().split(" ")))
array = initial_array
res = list()
command = input()
while command != "end":
if command == "decrease":
decreased_array = [x - 1 for x in array]
res = decreased_array
else:
tokens = command.split(" ")
action = tokens[0]
... | 27.5 | 101 | 0.606494 |
78eba61ee73c1d18cb4a3bb58d6d0aa9038d4d45 | 1,245 | py | Python | elements/python/7/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/7/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/7/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import sys
def tail_rolling_window(f, n, out=sys.stdout):
"""
tail_rolling_window implements tail by reading the whole file and keeping
the last n lines in a ring buffer.
"""
lines = [None]*n
i = 0
for line in f:
lines[i%n] = line
i += 1
for _ in xrange(n):
line... | 21.465517 | 77 | 0.527711 |
6056fcc38a81c1216fc9fa4e4f971888dd6c7e6c | 6,324 | py | Python | venv/lib/python3.7/site-packages/twilio/rest/api/v2010/account/validation_request.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 3 | 2020-12-14T03:29:02.000Z | 2020-12-24T22:04:48.000Z | venv/lib/python3.7/site-packages/twilio/rest/api/v2010/account/validation_request.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 1 | 2021-08-21T22:54:01.000Z | 2021-08-23T19:39:42.000Z | venv/lib/python3.7/site-packages/twilio/rest/api/v2010/account/validation_request.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class ValidationReques... | 34 | 126 | 0.659393 |
60929449f85edc033b2bb4c21bd67ea5d0037ba3 | 4,596 | py | Python | myems-modbus-tcp/main.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 82 | 2021-02-19T10:24:31.000Z | 2022-03-28T06:30:18.000Z | myems-modbus-tcp/main.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 188 | 2021-02-22T07:08:30.000Z | 2022-03-02T04:11:03.000Z | myems-modbus-tcp/main.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 54 | 2021-02-19T08:48:46.000Z | 2022-03-30T06:21:34.000Z | import json
import mysql.connector
import config
from multiprocessing import Process
import time
import logging
from logging.handlers import RotatingFileHandler
import gateway
import acquisition
def main():
"""main"""
# create logger
logger = logging.getLogger('myems-modbus-tcp')
# spec... | 41.405405 | 121 | 0.564621 |
461aff404fdf585255cf453cbb2532b77092a95d | 1,077 | py | Python | source/pkgsrc/graphics/py-cairocffi/patches/patch-cairocffi_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/graphics/py-cairocffi/patches/patch-cairocffi_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/graphics/py-cairocffi/patches/patch-cairocffi_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-cairocffi_____init____.py,v 1.1 2018/07/18 00:24:30 joerg Exp $
--- cairocffi/__init__.py.orig 2017-02-03 11:41:24.000000000 +0000
+++ cairocffi/__init__.py
@@ -12,6 +12,7 @@
import sys
import ctypes.util
+import sysconfig
from . import constants
from .compat import FileNotFoundError
@@ -25,6 +2... | 33.65625 | 95 | 0.616527 |
e8373330c8304a2a2b94b16c0c5a554caf1e01e5 | 2,173 | py | Python | official/recommend/deep_and_cross/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/deep_and_cross/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/deep_and_cross/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.048387 | 78 | 0.637368 |
c7cb650614545042ea4c0374edeef24c77cc25af | 749 | py | Python | ___Python/Thomas/pycurs_180625/p03_lamda/m04_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p03_lamda/m04_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p03_lamda/m04_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | temp_celsius = [0.7, 2.1, 4.2, 8.2, 12.5, 15.6, 16.9, 16.3, 13.6, 9.5, 4.6, 2.3] #Durschnittstemperaturen Bielefeld
# Funktion
# def mindestens15(temperatur):
# return temperatur >=15 # Boolean temp>=15 -> TRUE
# ->
# umgewandelt in lambda
# mindestens15 = lambda temperatur: temperatur >= 15
def zwisch... | 32.565217 | 116 | 0.667557 |
29234b50bd6b20d0adcd3dc984d543642c1530e4 | 158 | py | Python | Licence 2/I33/TP 3/ex_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 3/ex_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 3/ex_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def multbyalpha(b, f):
resultat = b << 1
taille = len(bin(f)) - 3
if ((resultat & (1 << taille)) != 0):
resultat ^= f
return resultat
| 22.571429 | 41 | 0.512658 |
297ccda5511a76fd9505fa76f31bd8691abfe64e | 6,953 | py | Python | rdlcompiler/systemrdl/rdl_ast.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | 4 | 2016-05-10T20:40:34.000Z | 2020-04-09T13:23:33.000Z | rdlcompiler/systemrdl/rdl_ast.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | rdlcompiler/systemrdl/rdl_ast.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | __author__ = 'MegabytePhreak'
import types
def _indent(level):
if level > 0:
return ' '*level
return ''
class AstNode(object):
pass
def pprint(self, level=0):
pass
def __str__(self):
return self.pprint(0)
class Subscript(AstNode):
def __init__(self, name, inde... | 28.613169 | 113 | 0.539479 |
314e2a6f4229714b48961df809128357118dd412 | 468 | py | Python | contracts/tests/test_LibSignaturesMock.py | PerunEthereum/Perun | 0704f481e8747f6f4405e67abe1cafd5d96d2ab8 | [
"MIT"
] | 64 | 2018-04-10T19:28:59.000Z | 2020-11-10T02:56:57.000Z | contracts/tests/test_LibSignaturesMock.py | PerunEthereum/Perun | 0704f481e8747f6f4405e67abe1cafd5d96d2ab8 | [
"MIT"
] | 2 | 2018-05-18T15:39:10.000Z | 2018-12-17T19:00:50.000Z | contracts/tests/test_LibSignaturesMock.py | PerunEthereum/Perun | 0704f481e8747f6f4405e67abe1cafd5d96d2ab8 | [
"MIT"
] | 9 | 2018-04-10T21:17:41.000Z | 2019-12-10T11:42:34.000Z | import pytest
account = '0xd0edc0d7073c2931edbadbdcab6b67ea4929a110'
message = '0xdeadbeef'
@pytest.fixture()
def libSignaturesMock(chain):
return chain.provider.get_or_deploy_contract('LibSignaturesMock')[0]
def test_LibSignatures_ok(libSignaturesMock):
assert libSignaturesMock.call().verify(account, messag... | 29.25 | 77 | 0.788462 |
3168e723bca4c6d40c4d98aafa98d568c7e704f2 | 136 | py | Python | django-admin-readonly-permission/proj/accounts/models.py | TakesxiSximada/pens | 93d7b12330fa4f3e3ce913239ca2891212dabaf2 | [
"Apache-2.0"
] | null | null | null | django-admin-readonly-permission/proj/accounts/models.py | TakesxiSximada/pens | 93d7b12330fa4f3e3ce913239ca2891212dabaf2 | [
"Apache-2.0"
] | null | null | null | django-admin-readonly-permission/proj/accounts/models.py | TakesxiSximada/pens | 93d7b12330fa4f3e3ce913239ca2891212dabaf2 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class Account(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
| 19.428571 | 43 | 0.735294 |
31eec97adc227e118ab0c5489af63b70d3baf59a | 6,292 | py | Python | rasa/nlu/tokenizers/tokenizer.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 37 | 2019-06-07T07:39:00.000Z | 2022-01-27T08:32:57.000Z | rasa/nlu/tokenizers/tokenizer.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 209 | 2020-03-18T18:28:12.000Z | 2022-03-01T13:42:29.000Z | rasa/nlu/tokenizers/tokenizer.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 65 | 2019-05-21T12:16:53.000Z | 2022-02-23T10:54:15.000Z | import logging
import re
from typing import Text, List, Optional, Dict, Any
from rasa.nlu.config import RasaNLUModelConfig
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
from rasa.nlu.components import Component
from rasa.nlu.constants im... | 32.770833 | 88 | 0.59377 |
7df3e4355d8a664fc10e5af4222c9acd8568b7e0 | 1,638 | py | Python | methods/transformers/scripts/fsmt/fsmt-make-tiny-model.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/scripts/fsmt/fsmt-make-tiny-model.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/scripts/fsmt/fsmt-make-tiny-model.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# This script creates a super tiny model that is useful inside tests, when we just want to test that
# the machinery works, without needing to the check the quality of the outcomes.
#
# This version creates a tiny model through reduction of a normal pre-trained model, but ke... | 34.851064 | 115 | 0.750305 |
b4413d5849e186ae2b059620db88f357642b2d20 | 931 | py | Python | user/usecases/register_user.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | user/usecases/register_user.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | user/usecases/register_user.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | from user.exceptions import UserAlreadyExistError
from user.models import User
class RegisterUser:
def __init__(self, email, password, first_name, last_name):
self._email = email
self._password = password
self._first_name = first_name
self._last_name = last_name
def execute(se... | 28.212121 | 83 | 0.627282 |
7da34ecd607f4f165b206b939a0c39b725c30d86 | 3,365 | py | Python | weibo/testMySQL/transfer_money.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/testMySQL/transfer_money.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/testMySQL/transfer_money.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #coding:utf8
'''
Created on 2016年4月20日
@author: wb-zhaohaibo
'''
import sys
import MySQLdb
class TransferMoney(object):
#银行转账操作流程
def __init__(self, conn):
self.conn = conn
def check_acct_available(self, acctid):
'''检查账户 有效性'''
cursor = self.conn.cursor... | 29.26087 | 94 | 0.475483 |
f20734887f1540060193d3f4a102f19a37ec1006 | 1,401 | py | Python | 7-assets/past-student-repos/data_struct_and_algo-master/Kth_smallest_element.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 4 | 2021-08-31T00:56:40.000Z | 2021-11-29T03:08:55.000Z | 7-assets/past-student-repos/data_struct_and_algo-master/Kth_smallest_element.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 3 | 2022-02-14T18:48:11.000Z | 2022-03-30T05:26:26.000Z | 7-assets/past-student-repos/data_struct_and_algo-master/Kth_smallest_element.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-08-31T00:54:51.000Z | 2021-08-31T00:54:51.000Z | # Input:
# N = 6
# arr[] = 7 10 4 3 20 15
# K = 3
# Output : 7
# Explanation :
# 3rd smallest element in the given
# array is 7.
# def kthSmallest(arr, l, r, k):
# '''
# arr : given array
# l : starting index of the array i.e 0
# r : ending index of the array i.e size-1
# k : find kth smallest ele... | 22.596774 | 66 | 0.468237 |
6f95a0939debb8f34d3bb653ed8ac5201ac36a55 | 5,488 | py | Python | gshiw/quotes_web/quotes/models.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/quotes/models.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/quotes/models.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.admin import User
class Quotes(models.Model):
owner = models.ForeignKey(User, verbose_name=u'创建人')
category = models.ForeignKey('Categories', verbose_name=u'分类')
speaker = models.ForeignK... | 43.904 | 138 | 0.734147 |
6fadf9defd8aafad7360e60ccd3922b76e83a751 | 153 | py | Python | docker/django/restaurant/restapi/views/__init__.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapi/views/__init__.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapi/views/__init__.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | from .restaurant_views import RestaurantView
from .user_view import UserView
from .logout_view import LogoutView
from .foodmenu_views import FoodMenuView | 38.25 | 44 | 0.875817 |
d206742692fbcd050e177b17d113198771ce7a43 | 2,933 | py | Python | code/fetch_nowcasts/fetch-RKI.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | code/fetch_nowcasts/fetch-RKI.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | code/fetch_nowcasts/fetch-RKI.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | import pandas as pd
abbreviations = ['DE', 'DE-BW', 'DE-BY', 'DE-HB', 'DE-HH', 'DE-HE',
'DE-NI', 'DE-NW', 'DE-RP', 'DE-SL', 'DE-SH', 'DE-BB',
'DE-MV', 'DE-SN', 'DE-ST', 'DE-TH', 'DE-BE']
regions = ['Bundesgebiet', 'Baden-Württemberg', 'Bayern', 'Bremen', 'Hamburg', 'Hessen',
... | 44.439394 | 119 | 0.680873 |
d21ab08b82be9a4237c7a94fd4d807ef22f7d948 | 1,423 | py | Python | NeuralNet/Alex/dataloader/test.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | NeuralNet/Alex/dataloader/test.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | NeuralNet/Alex/dataloader/test.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | #testclass for dataloader
import loader
import serialize
import cv2 as cv
import numpy as np
#data
data = "C:/Users/Alex/Documents/Fontinator/NeuralNet/Alex/dataloader/test_img"
# load dataset
dataset = loader.read_to_dataset(data, 1);
print(dataset[0].get_name())
print(dataset[0].get_data()[0][0].get_name())
print(d... | 29.040816 | 119 | 0.754743 |
83d82891514de3628a3be1b98eb3de1737741b49 | 181 | py | Python | python/arguments parsing/with argparse.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | python/arguments parsing/with argparse.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | python/arguments parsing/with argparse.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Python 3.7.3
# Argparse test
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo")
args = parser.parse_args()
print(args.echo)
| 12.928571 | 34 | 0.734807 |
58686f6be79741aecfa3c682d1bb7bede077a3dd | 2,176 | py | Python | jumeaux/addons/reqs2reqs/rename.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/reqs2reqs/rename.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/reqs2reqs/rename.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from owlmixin import OwlMixin, TOption
from owlmixin.owlcollections import TList
from jumeaux.logger import Logger
from jumeaux.addons.reqs2reqs import Reqs2ReqsExecutor
from jumeaux.utils import when_optional_filter, jinja2_format, get_jinja2_format_error
from jumeaux.domain.config.vo import C... | 35.672131 | 99 | 0.671415 |
54a852d25e7c649efafce941ecadf7669410f17e | 1,018 | py | Python | gdp1/assignment_3/max_list.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_3/max_list.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_3/max_list.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | from gdp1.common.input_helpers import int_input, float_input
def request_floats(count):
"""Requests the given amount of floats from the user.
@param int count: The amount of floats to request.
@return list: A list of floats that the user entered.
"""
numbers = []
digits = "%" + str(len(str(co... | 24.829268 | 84 | 0.625737 |
3f9f870f7b52136aa01b0010c93c3056cd82837e | 1,488 | py | Python | pages/extensions/log_beautifier/log_beautifier.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 300 | 2015-12-09T20:35:37.000Z | 2019-07-16T06:41:29.000Z | pages/extensions/log_beautifier/log_beautifier.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 2,099 | 2019-07-16T13:24:27.000Z | 2022-03-26T12:31:51.000Z | pages/extensions/log_beautifier/log_beautifier.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 543 | 2019-07-18T09:06:14.000Z | 2022-03-31T02:43:10.000Z | import logging
from grow import extensions
from grow.common import logger
from grow.server import manager
logger._get_logger = logger.get_logger
def get_logger(name='pod'):
_formatter = logging.Formatter('%(message)s')
logger = logging.getLogger(name)
logger.propagate = False
# get_logger has alread... | 31 | 78 | 0.739247 |
b76d1c53c0649f4fe65b948f8b3ca35777be7bb6 | 36,901 | py | Python | deutschland/dwd/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/dwd/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/dwd/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Deutscher Wetterdienst: API
Aktuelle Wetterdaten von allen Deutschen Wetterstationen # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from deutschland.dwd.api_client import ApiClient, Endpo... | 42.808585 | 168 | 0.55069 |
1298a14dc000de601e5169c00a6c2fb3274e52d1 | 7,146 | py | Python | src/onegov/ticket/handler.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ticket/handler.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ticket/handler.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ticket.errors import DuplicateHandlerError
from sqlalchemy.orm import object_session
class Handler(object):
""" Defines a generic handler, responsible for a subset of the tickets.
onegov.ticket is meant to be a rather generic bucket of tickets, to which
varying modules submit tickets with var... | 30.279661 | 79 | 0.642177 |
c4834629942f11de9ee57db5303ffd134be26225 | 330 | py | Python | elements/python/7/9/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/7/9/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/7/9/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def sinusoidal(s):
n = len(s)
result = ''
for i in xrange(1, n, 4): result += s[i]
for i in xrange(0, n, 2): result += s[i]
for i in xrange(3, n, 4): result += s[i]
return result
def main():
assert sinusoidal('Hello_World!') == 'e_lHloWrdlo!'
print 'pass'
if __name__ == '__main__':
... | 19.411765 | 55 | 0.551515 |
67f3c78ef44d2c51ea48979ab7f10fbfc45845f8 | 445 | py | Python | codeit/algorithm/fib_optimized.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/algorithm/fib_optimized.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/algorithm/fib_optimized.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def fib_optimized(n):
if n in [1, 2]:
return 1
previous = 1
current = 1
for _ in range(3, n + 1):
result = previous + current
previous = current
current = result
return result
if __name__ == '__main__':
assert fib_optimized(10) == 55, 'fib(10) error'
asse... | 23.421053 | 72 | 0.606742 |
fbf46f74caeea4baab6635172f14d59c58153be5 | 1,093 | py | Python | src/classifier/sent_transformer/sbert_classifier.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/classifier/sent_transformer/sbert_classifier.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/classifier/sent_transformer/sbert_classifier.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | import torch.nn as nn
from torch import tanh
from src.classifier.torch_helpers.regard_classifier import RegardClassifier
class RegardBERT(RegardClassifier):
def __init__(
self, n_embed, n_hidden_lin, n_hidden_lin_2, n_output, lr, weight_vector, drop_p
):
RegardClassifier.__init__(
... | 34.15625 | 88 | 0.646844 |
97e36b7122d61944908a4054fd7714216e59e3c6 | 755 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/03_chapter_08_repetition_task_05.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/03_chapter_08_repetition_task_05.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/03_chapter_08_repetition_task_05.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 03_chapter_08_repetition_task_05.py
# Project: Kapitel_08_Dictionaries
# Created Date: Sunday 10.03.2019, 12:30
# Author: Apop85
# -----
# Last Modified: Sunday 10.03.2019, 12:39
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MIT lice... | 30.2 | 87 | 0.707285 |
36a2177cf7ab7d71ff462a743f55f85af84514d2 | 1,310 | py | Python | toilet/predict.py | kazunori279/ml-misc | 6cf25dd44522cd49e6a1c3edff38f7dfc70cba33 | [
"Apache-2.0"
] | 31 | 2017-08-30T23:27:33.000Z | 2022-01-18T19:37:40.000Z | toilet/predict.py | kazunori279/ml-misc | 6cf25dd44522cd49e6a1c3edff38f7dfc70cba33 | [
"Apache-2.0"
] | null | null | null | toilet/predict.py | kazunori279/ml-misc | 6cf25dd44522cd49e6a1c3edff38f7dfc70cba33 | [
"Apache-2.0"
] | 15 | 2017-10-16T01:15:44.000Z | 2021-12-24T03:36:11.000Z | #
# predict.py
#
# checks the captured picture to calculate probability of wet floor
#
from keras import applications, optimizers
from keras.preprocessing import image
from keras.models import Sequential, Model
from keras.layers import Dropout, Flatten, Dense
import numpy as np
filename = 'toilet.jpg'
img_height, img... | 27.291667 | 97 | 0.732061 |
3d0034e672559446077cf59d2552ec9afe955c17 | 71 | pyde | Python | sketches/pvecrandom2d/pvecrandom2d.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/pvecrandom2d/pvecrandom2d.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/pvecrandom2d/pvecrandom2d.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | def setup():
v = PVector.random2D()
print v
print(v.mag())
| 14.2 | 26 | 0.549296 |
183a5da1120811f2cbdb2a4062fa55e973141053 | 359 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/44. replace elements in a list.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/44. replace elements in a list.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/44. replace elements in a list.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function that finds the value 'd' in the given list and then replaces the string 'd' with the string 'c'.
input_list = ['a', 'b', 'd', 'd', 'e', 'd', 'g']
expected output = ['a', 'b', 'c', 'c', 'e', 'c', 'g']
"""
def replace_value(input_list):
modified_list = ["c" if x == "d" else x for x in inp... | 25.642857 | 113 | 0.576602 |
a1f19ff800aa5b013d30f424c3d4e0aab7c50965 | 3,661 | py | Python | Kapitel_6/_2_Meta_Method_Callorder.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | 1 | 2020-12-24T15:42:54.000Z | 2020-12-24T15:42:54.000Z | Kapitel_6/_2_Meta_Method_Callorder.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | Kapitel_6/_2_Meta_Method_Callorder.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | """ Dieses File soll zum Erkunden einer Metaklasse sein. Es soll dazu dienen, ein
Verständnis dafür schaffen, welche Abläufe mit welchen Argumenten wann gestartet werden.
Als ersten Schritt empfehle ich: Startet das Skript einmal ohne euch den Code anzusehen
und seht euch zu erst an, was der Output ist. Ich habe hier ... | 38.135417 | 92 | 0.58372 |
1a0d0174b38458771e8cb4f5a35e5c2571b8c711 | 2,709 | py | Python | Jahr 1/CS/IoT/MQTT/client.py | BackInBash/Technikerschule | 6e30654417732fae065e36a40789866ccca6aa7e | [
"MIT"
] | 2 | 2021-01-20T16:16:41.000Z | 2022-01-12T15:37:53.000Z | Jahr 1/CS/IoT/MQTT/client.py | BackInBash/Technikerschule | 6e30654417732fae065e36a40789866ccca6aa7e | [
"MIT"
] | 2 | 2020-06-17T21:55:24.000Z | 2021-09-08T20:40:41.000Z | Jahr 1/CS/IoT/MQTT/client.py | BackInBash/Technikerschule | 6e30654417732fae065e36a40789866ccca6aa7e | [
"MIT"
] | 1 | 2020-12-28T13:03:34.000Z | 2020-12-28T13:03:34.000Z | # Copyright (c) 2010,2011 Roger Light <roger@atchoo.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this li... | 36.12 | 77 | 0.7512 |
3d767aba5d551664a52311197c05753a8cae9850 | 1,002 | py | Python | official/cv/deeplabv3plus/src/tools/get_pretrained_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/deeplabv3plus/src/tools/get_pretrained_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/deeplabv3plus/src/tools/get_pretrained_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | import torch
from mindspore import Tensor, save_checkpoint
def torch2ms(pth_path, ckpt_path):
pretrained_dict = torch.load(pth_path)
print('--------------------pretrained keys------------------------')
for k in pretrained_dict:
print(k)
print('---------------------torch2ms keys---------------... | 31.3125 | 72 | 0.53992 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.