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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d92ebd30bcb4ee422406f89e29b6fa36aae6d9e3 | 1,156 | py | Python | SentiWordNet/SWNReader.py | dxmahata/TwitterSentimentAnalysis | b228747dfa74266853d4f8e6d4bc4eb29c080dd3 | [
"MIT"
] | null | null | null | SentiWordNet/SWNReader.py | dxmahata/TwitterSentimentAnalysis | b228747dfa74266853d4f8e6d4bc4eb29c080dd3 | [
"MIT"
] | null | null | null | SentiWordNet/SWNReader.py | dxmahata/TwitterSentimentAnalysis | b228747dfa74266853d4f8e6d4bc4eb29c080dd3 | [
"MIT"
] | null | null | null | import sys
def split_line(line):
cols = line.split("\t")
return cols
def get_words(cols):
words_ids = cols[4].split(" ")
words = [w.split("#")[0] for w in words_ids]
return words
def get_positive(cols):
return cols[2]
def get_negative(cols):
return cols[3]
def get_objective(cols):
... | 25.688889 | 79 | 0.574394 |
d945224bdfb346d402b2826e65c8fdd1209563e1 | 272 | py | Python | Licence 1/I11/TP2/tp2_7_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP2/tp2_7_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP2/tp2_7_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | for value in range(1, 10001):
sqrt_value = int(value ** .5)
dividers_sum = 1
for i in range(2, sqrt_value + 1):
if value % i == 0:
dividers_sum += i + value // i
if dividers_sum == value:
print(value, "est un nombre parfait")
| 24.727273 | 45 | 0.555147 |
8dede9158993143429f0d1099d4ed1867baf4c9d | 2,405 | py | Python | program/environment/graphical_output.py | SimonSkade/BwKI_autonome_Verkehrslenkung | 41d84ce2103a4338893dc610a46f7b115d584635 | [
"MIT"
] | 4 | 2019-08-22T19:16:28.000Z | 2019-10-27T07:09:09.000Z | program/environment/graphical_output.py | SimonSkade/BwKI_autonome_Verkehrslenkung | 41d84ce2103a4338893dc610a46f7b115d584635 | [
"MIT"
] | null | null | null | program/environment/graphical_output.py | SimonSkade/BwKI_autonome_Verkehrslenkung | 41d84ce2103a4338893dc610a46f7b115d584635 | [
"MIT"
] | null | null | null |
#import plotly.graph_objects as go
def convert_to_hex(color_red):
color_green = 255-color_red
color_blue = 0
return '#%02x%02x%02x' % (color_red, color_green, color_blue)
def plot_static_plotly(all_edges_x, all_edges_y, all_nodes_x, all_nodes_y, vertexes, edges):
edge_trace = go.Scatter(
x=all... | 28.294118 | 151 | 0.607484 |
eb9e7592ef825229dfd72d4f7af47398452fcdb4 | 778 | py | Python | pythonProj/FZPython/pyquant/models/reporter.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/models/reporter.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/models/reporter.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z |
class Reporter(object):
"""
"""
_backtest = None
fromdate = None
todate = None
strategy = None
starting_cash = 1000
end_cash = 1000
commission = 0
end_cash = 0
total_value = 0
strategy_name = None
strategy_params = None
symbol_ticker = None
symbol_name = N... | 17.288889 | 71 | 0.568123 |
15c206b111830abd98ff7bdd2e95ba37109ceef5 | 7,215 | py | Python | ui/ecShareWizard.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | ui/ecShareWizard.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | ui/ecShareWizard.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | '''
Created on Feb 22, 2019
provides Wizard to traverse SMB shares and select appropriate entries
@author: sven
'''
import re
from PySide2.QtWidgets import QLabel, QWizard, QWizardPage, QVBoxLayout, QHBoxLayout, QListWidget, QWidget, QTreeWidget, \
QTreeWidgetItem, QListWidgetItem, QStyle
from PySide2.QtCore impor... | 39.42623 | 129 | 0.62176 |
033c46ca3f6f475950c89532006f6c8909e8f88a | 210 | py | Python | Pythonjunior2020/Woche1/Aufgabe_1_5_2.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche1/Aufgabe_1_5_2.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche1/Aufgabe_1_5_2.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | # 1.5.2, Woche 1, Block 5, Aufgabe 2
# Dekleration
reihen = 32
sitze_pro_reihe = 6
freie_sitze = 73
# Berechnung
leute = reihen * sitze_pro_reihe - freie_sitze
# Ausgabe
print("Es gibt",leute,"im Flugzeug") | 17.5 | 46 | 0.719048 |
066ed20c0f67c8385522f187489042d5291621cb | 1,310 | py | Python | mod/lecture/handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 1 | 2015-06-28T15:26:52.000Z | 2015-06-28T15:26:52.000Z | mod/lecture/handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | null | null | null | mod/lecture/handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 6 | 2015-03-20T16:36:22.000Z | 2021-08-28T07:58:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-03-07 12:46:36
# @Author : jerry.liangj@qq.com
from ..models.lecturedb import LectureDB
from sqlalchemy.orm.exc import NoResultFound
from time import time,mktime,strftime,localtime,strptime
import tornado.web
import tornado.gen
import json
class LectureH... | 29.772727 | 85 | 0.548092 |
88da59bbdf0438f8e800ea7deb03c4c38b3b6426 | 791 | py | Python | migrations/versions/b1a6e7630185_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/b1a6e7630185_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/b1a6e7630185_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: b1a6e7630185
Revises: 35a6577b6af8
Create Date: 2021-01-25 11:38:36.483434
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "b1a6e7630185"
down_revision = "35a6577b6af8"
branch_lab... | 23.264706 | 86 | 0.707965 |
aef173672a5d1a44f7970696ba0b1237f0510dc1 | 1,303 | py | Python | src/SurfaceInfos/SurfaceInfoArithContext.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/SurfaceInfos/SurfaceInfoArithContext.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/SurfaceInfos/SurfaceInfoArithContext.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | from src.Texture import Texture
import json
from src.SurfaceInfos.SurfaceInfo import SurfaceInfo
class SurfaceInfoArithContext(SurfaceInfo):
"""
SurfaceInfo is a class to store information about the surface of a FESS
"""
def __init__(self, function_name, args):
super().__init__(function_name,... | 30.302326 | 106 | 0.634689 |
9d852219328c10e22f183315738722d9f28a85a9 | 10,119 | py | Python | quant/observers/maker_zrx.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/maker_zrx.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/maker_zrx.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import division
import logging
import time
from quant import config
from quant.brokers import broker_factory
from quant.common import constant
from quant.tool import email_box
from .basicbot import BasicBot
class Maker_ZRX(BasicBot):
"""
./venv/... | 39.069498 | 113 | 0.614389 |
d1f606c85cc391a87d696836508f3681d09a0bbb | 1,065 | py | Python | python/pyqt/LearnPyQt/q_combo_box.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/q_combo_box.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/q_combo_box.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QApplication,
QMainWindow,
QComboBox,
)
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowTitle("Jayone's Awesome App")
widg... | 23.152174 | 69 | 0.660094 |
0600f2e4cb001f1184fd2914c414309ef16fdd81 | 177 | py | Python | rectangle.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | rectangle.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | rectangle.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | l=int(input("enter length"))
b=int(input("enter breath\n"))
area=l*b
print(area)
l=int(input("enter length"))
b=int(input("enter breath\n"))
perimeter=2*(l+b)
print(perimeter)
| 17.7 | 30 | 0.694915 |
31f380bed2c9414ba4bb9a7e8adb5b11793abfae | 15,599 | py | Python | src/Sephrasto/CharakterPrintUtility.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterPrintUtility.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterPrintUtility.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | from Wolke import Wolke
from Fertigkeiten import VorteilLinkKategorie
import Talentbox
import re
from difflib import SequenceMatcher
from fractions import Fraction
class CharakterPrintUtility:
@staticmethod
def getVorteile(char):
return sorted(char.vorteile, key = lambda v: (Wolke.DB.vorteile[v].typ, ... | 42.504087 | 135 | 0.581319 |
ee3eb41de3ea4471f4ce48eff9a0f56554a0a105 | 3,891 | py | Python | nlp2go/test/test_model.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 25 | 2020-02-20T14:25:58.000Z | 2022-01-05T03:32:37.000Z | nlp2go/test/test_model.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 3 | 2020-10-21T15:03:39.000Z | 2020-10-21T15:03:48.000Z | nlp2go/test/test_model.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 1 | 2020-09-15T15:22:49.000Z | 2020-09-15T15:22:49.000Z | import unittest
from transformers import pipelines
import nlp2go
class TestModel(unittest.TestCase):
def test_load_huggingface_model(self):
nlp, predict_parameter, model_task = nlp2go.Model.load_huggingface_model(self, 'voidful/albert_chinese_tiny',
... | 47.45122 | 117 | 0.578001 |
e11ac473445629f3cd557e6c29bf107c3c89109a | 684 | py | Python | src/appconfig/models.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/appconfig/models.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/appconfig/models.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models.base import Model
import uuid
# Create your models here.
# class Version(models.Model):
# id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
# version = models.CharField(max_length=100,unique=True)
# update_re... | 34.2 | 94 | 0.649123 |
aaeaa14d3190129c8cd0bd433405b948522ad714 | 5,272 | py | Python | src/unittest/python/client/notest_client_desktop_application.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | aa638ef1399807403312a0597596412d69e6f20f | [
"MIT"
] | null | null | null | src/unittest/python/client/notest_client_desktop_application.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | aa638ef1399807403312a0597596412d69e6f20f | [
"MIT"
] | null | null | null | src/unittest/python/client/notest_client_desktop_application.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | aa638ef1399807403312a0597596412d69e6f20f | [
"MIT"
] | null | null | null | import sys
sys.path.append(".")
import pytestqt
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from src.main.python.client.gui import App
def test_type_textboxes(qtbot):
window = App()
window.show()
qtbot.addWidget(window)
qtbot.waitForWindowShown(window)
windo... | 41.84127 | 331 | 0.726669 |
c9145934afdbe0b0b1715577b98eb1195ef7bb75 | 1,080 | py | Python | PMIa/2015/Velyan_A_S/task_7_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Velyan_A_S/task_7_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Velyan_A_S/task_7_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 6.
# Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
# Velyan A. S.
# 27.05.2016
import random
print("Программа случайным образом загадывает название одного из семи городов России, имеющи... | 25.116279 | 153 | 0.665741 |
42ed29a7b21d816ad101e298ffd65770b392d086 | 917 | py | Python | django-rest-framework/api_example/language/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django-rest-framework/api_example/language/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django-rest-framework/api_example/language/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
# you can add permission in this views.py
# or in settings.py
from rest_framework import permissions
from .models import Paradigm, Language, Programmer
from .serializers import ParadigmSerializer, LanguageSerializer, ProgrammerSerializer
# Cre... | 36.68 | 85 | 0.797165 |
c2d9e62263bab2e73cb176578a4710a553132a2f | 1,314 | py | Python | research/cv/tsn/src/video_funcs.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/tsn/src/video_funcs.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/tsn/src/video_funcs.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... | 38.647059 | 113 | 0.692542 |
06d20eba4acfe6fa42b12c5a7e00c196f2085fb0 | 25,059 | py | Python | tools/extract_oneflow_export.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | tools/extract_oneflow_export.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | tools/extract_oneflow_export.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | # python3 -m pip install isort autoflake astpretty black
# requires python3.9 to run
import os
import argparse
import ast
import subprocess
import multiprocessing
from pathlib import Path
import astpretty
import sys
parser = argparse.ArgumentParser()
parser.add_argument(
"--out_dir", type=str, default="python",
)
... | 37.014771 | 236 | 0.556128 |
c6cedc0076eee39b1c6b281ba71e5c46dafb4c3b | 541 | py | Python | python/get_session_key.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | null | null | null | python/get_session_key.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | 3 | 2021-01-28T13:46:07.000Z | 2021-01-28T14:26:27.000Z | python/get_session_key.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | 1 | 2020-08-13T11:51:09.000Z | 2020-08-13T11:51:09.000Z | import requests
URL = "https://websites.fraunhofer.de/iwu-surveys/index.php/admin/remotecontrol"
def call_method(method: str, params: list, id_: int = 1) -> dict:
response = requests.post(URL, json={'method': method, 'params': params, 'id': id_})
return response.json()
def get_session_key(username: str, pa... | 30.055556 | 87 | 0.695009 |
05de7b4ce9e35eb86867b4da69078f3445d7f9db | 1,127 | py | Python | 010-C106-Correlation/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 010-C106-Correlation/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 010-C106-Correlation/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # 010-C106-Correlation
# This is a python script made by @somePythonProgrammer
# for a WhiteHat Junior project.
import pandas as pd
import plotly_express as px
import csv
import numpy as np
import os
def corrcoef(_,__):
return np.corrcoef(_,__)[0,1]
def get_attrs(path):
with open(path, 'r') as f:
rea... | 25.044444 | 121 | 0.635315 |
bb5fecd7e56b6f4a6d45f4d5537b0ddb542124b5 | 2,639 | py | Python | src/utils_TID.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | src/utils_TID.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | src/utils_TID.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | from csv import reader
from collections import defaultdict, Counter
from itertools import chain, combinations, product
def getAboveMinSup(itemSet, itemSetList, minSup, globalItemSetWithSup, k):
freqItemSet = set()
itemSetList2 = set()
localItemSetWithSup = Counter()
[(globalItemSetWithSup.upd... | 34.723684 | 175 | 0.604396 |
59055f6c2b805d9827a0125f3ed04d501d57cb07 | 127 | py | Python | src/server/app/repository/LanguageRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/LanguageRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/LanguageRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from ..helper.helpers import getLanguagesFromJson
languages = getLanguagesFromJson()
def getLanguages():
return languages | 21.166667 | 49 | 0.80315 |
ab7d2b5422e218503147109ba387d13fb13a5a4f | 11,754 | py | Python | main.py | jibonaronno/RP2040AudioRecord | c31824129d8b603ae2662bbba5bcc63d1213556b | [
"CC0-1.0"
] | null | null | null | main.py | jibonaronno/RP2040AudioRecord | c31824129d8b603ae2662bbba5bcc63d1213556b | [
"CC0-1.0"
] | null | null | null | main.py | jibonaronno/RP2040AudioRecord | c31824129d8b603ae2662bbba5bcc63d1213556b | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
import sys
import enum
from os.path import join, dirname, abspath
import queue
import serial
from serial import Serial
import serial.tools.list_ports as port_list
from qtpy import uic
from qtpy.QtCore import Slot, QTimer, QThread, Signal, QObject, Qt
from qtpy.QtWidgets import QApplication, QMainWind... | 37.552716 | 129 | 0.590863 |
55aa223e2fded2ed7e1389e4935bce50a408ee42 | 2,165 | py | Python | Integrations/python/setup.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | Integrations/python/setup.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | Integrations/python/setup.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
"""
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
import os
from setuptools.extern import packaging
here = os.path.abspa... | 35.491803 | 96 | 0.68776 |
55208d64046b6ca4172b26b3305b20a210f3eae3 | 26,883 | py | Python | Mscan/malware_scan.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Mscan/malware_scan.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Mscan/malware_scan.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python3
#-*- coding:utf-8 -*-
import sys
import time
import json
import shlex
import subprocess
try:
from xsearch import * # virustotal search
except ImportError:
print("[!] Error Import Xsearch !")
try:
from md5sum import *
except ImportError:
print("[!] Error Import MD5sum !")
try:
... | 53.551793 | 199 | 0.459324 |
238b1cd9ab3d60b0c9a5e85390bec3746cd292b6 | 2,948 | py | Python | src/onegov/election_day/views/manage/subscribers.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/subscribers.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/subscribers.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from onegov.core.security import Private
from onegov.election_day import _
from onegov.election_day import ElectionDayApp
from onegov.election_day.collections import EmailSubscriberCollection
from onegov.election_day.collections import SmsSubscriberCollection
from onegov.election_day.colle... | 26.558559 | 69 | 0.657056 |
a81b7c3f3caf313f2fc26a6a8847b66d91409d13 | 1,139 | py | Python | Python/plotly/plotly_ownData.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/plotly/plotly_ownData.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/plotly/plotly_ownData.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
import pandas as pd
data = pd.DataFrame({'data_1': [1, 2, 4, 5, 7, 2],
'data_2': [4, 3, 1, 13, 7, 6],
'time': [1, 2, 3, 4, 5, 6]
})
#data = [1, 2, 3]
# fig = px.bar(x=l... | 19.982456 | 64 | 0.448639 |
b5a653dfadfdce9c4e7d345e605abefba7b64da1 | 5,836 | py | Python | Project5/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project5/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project5/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def dft_matrix(n: int) -> np.ndarray:
"""
Construct DFT matrix of size n.
Arguments:
n: size of DFT matrix
Return:
F: DFT matrix of size n
Forbidden:
- numpy.fft.*
"""
# initialize matrix with proper size
F = np.zeros((n, n), dtype='complex128')
#... | 26.053571 | 114 | 0.604352 |
572de7f16b6c6211f3846162511055bab804961f | 5,896 | py | Python | libs/crypto_funcs.py | tschitschable/surelock | a93c7e9eae73d9534edc23d86ccca888f8435c46 | [
"MIT"
] | null | null | null | libs/crypto_funcs.py | tschitschable/surelock | a93c7e9eae73d9534edc23d86ccca888f8435c46 | [
"MIT"
] | 2 | 2019-10-15T19:07:33.000Z | 2019-10-30T14:05:10.000Z | libs/crypto_funcs.py | tschitschable/surelock | a93c7e9eae73d9534edc23d86ccca888f8435c46 | [
"MIT"
] | 1 | 2019-10-14T16:28:07.000Z | 2019-10-14T16:28:07.000Z | #!/usr/bin/env python
import re
import base64
import hashlib, binascii, os
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
import random
pad = lambda s: s + (AES.block_size - len(s) % AES.block_size) * chr(AES.block_size - len(s) % AES.block_size)
unpad = lambda s: s[:-or... | 35.305389 | 145 | 0.594132 |
f55043c0bcd7f3c502ebbdbc4837f00e5cf885f8 | 840 | py | Python | nz_crawl_demo/day8/wh1904/wh1904/spiders/bsbdj.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day8/wh1904/wh1904/spiders/bsbdj.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day7/scrapy_demo/wh1904/wh1904/spiders/bsbdj.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # -*- coding: utf-8 -*-
import scrapy
#项目名.items
from wh1904.items import Wh1904Item
class BsbdjSpider(scrapy.Spider):
name = 'bsbdj'
allowed_domains = ['budejie.com']
start_urls = ['http://www.budejie.com/text/1']
base_domain = 'https://www.budejie.com/text/'
def parse(self, response):
out... | 32.307692 | 68 | 0.566667 |
19583e7a3739f71a94753878ce892c444fc17880 | 657 | py | Python | src/preprocessing/OverlayFilter.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | 7 | 2015-11-27T09:53:32.000Z | 2021-01-13T17:35:54.000Z | src/preprocessing/OverlayFilter.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | src/preprocessing/OverlayFilter.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | import numpy as np
import cv
class OverlayFilter(object):
def __init__(self):
self.font = cv.InitFont(cv.CV_FONT_HERSHEY_PLAIN, 1.0, 1.0)
def filter(self, rgb, depth, balls, args = {}):
color = rgb[240, 320]
for x in range(0,3):
for y in range(0,3):
... | 31.285714 | 115 | 0.51446 |
7e1326dc167f84d4e52a92de781944b9543da78c | 2,454 | py | Python | oneflow/python/framework/blob_trait.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/framework/blob_trait.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/framework/blob_trait.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 25.298969 | 72 | 0.682152 |
4758978101f1695119c3ec095f113d1670d6dfa1 | 407 | py | Python | theblog/migrations/0005_alter_post_category.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | theblog/migrations/0005_alter_post_category.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | theblog/migrations/0005_alter_post_category.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2021-12-29 16:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('theblog', '0004_category_post_category'),
]
operations = [
migrations.AlterField(
model_name='post',
name='category',
... | 21.421053 | 69 | 0.609337 |
47c8e7577c47cc4402e6063cf2bbf8662c7ec559 | 6,547 | py | Python | addition_module/DMUE/pretrain/loss_def.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/pretrain/loss_def.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | addition_module/DMUE/pretrain/loss_def.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | import sys
import math
import torch
import torch.nn.functional as F
from torch.nn import Module, Parameter
import torch.nn as nn
from backbones.resnet import ResNet, BasicBlock, Bottleneck
from backbones.resnet_ibn_a import resnet50_ibn_a
# from backbones.attention_irse_def import AttentionNet
# from backbones.resnet_... | 43.072368 | 114 | 0.628532 |
9a2480f7dc1949efa1eee94a1692356c830b1c5c | 2,379 | py | Python | src/test/tests/rendering/line2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/rendering/line2d.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/rendering/line2d.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: line2d.py
#
# Tests: mesh - 2D curvilinear, single domain
# plots - Pseudocolor
# annotations - Line2D
#
# Defect ID: #1724 (arrowheads for 2D Line annotatio... | 23.554455 | 78 | 0.656999 |
7bfb7b9ee9687dbed561143b33408bf5dcabdc1a | 4,003 | py | Python | app/auth/routes.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | app/auth/routes.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | app/auth/routes.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | from flask import render_template, flash, request, session, make_response, g,copy_current_request_context,redirect
from app.db.dbMySQL import MySQLUser,MySQLToken
from app.models import User,Token
from app.utils.generate_token import generateToken
import threading
from . import auth_bp
import datetime
from threadin... | 33.923729 | 117 | 0.568823 |
ef9ef65e85127cd93afe251b684f8252d5be3c4a | 1,321 | py | Python | SoSe-21/Code-Vorlesungen/VL-5/Einstieg-Funktion-3.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/VL-5/Einstieg-Funktion-3.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/VL-5/Einstieg-Funktion-3.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Einstieg in Funktionen
# 1. definieren der Funktion mit dem Namen trenner()
def trenner(anzahl_striche):
for i in range(anzahl_striche):
print("*", end="")
print()
def abschluss():
print("Ich bin fertig und das Programm wird beendet.")
def maximum_3_zahlen(zahl1, zahl2, zahl3):
if zahl1 >= ... | 38.852941 | 136 | 0.727479 |
eff0035401098e806573ef1201a49c4ce19a0d61 | 5,436 | py | Python | geol/feature_extraction/various.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | geol/feature_extraction/various.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | geol/feature_extraction/various.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
File description
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com>
from geol.feature_extraction.base import FeatureGenerator
from geol.utils import utils
import pandas as pd
import gensim
from geol.geol_logger.geol_logger import logger
import pkg_resources
import numpy as np
class BOC(FeatureGenerator... | 30.886364 | 106 | 0.609088 |
089d40ccf234ee73fb675356f08bd37a0b05f475 | 350 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch09_search_and_sort/ex05_selection_sort_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch09_search_and_sort/ex05_selection_sort_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch09_search_and_sort/ex05_selection_sort_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch09_search_and_sort.solutions.ex05_selection_sort import selection_sort_max_inplace
def test_selection_sort_max_inplace():
values = [7, 2, 5, 1, 6, 8, 9, 4, 3]
selection_sort_max_inplace(values)
assert values ==... | 25 | 89 | 0.725714 |
dec3035fc1258100b03664f3e8bb363785ae9b6a | 2,259 | py | Python | TreeOutputLib/OneTimestepOneFilePerGroup/OneTimestepOneFilePerGroup.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeOutputLib/OneTimestepOneFilePerGroup/OneTimestepOneFilePerGroup.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeOutputLib/OneTimestepOneFilePerGroup/OneTimestepOneFilePerGroup.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.OneTimestepOneFile.OneTimestepOneFile import \
OneTimestepOneFile
import os
## Output class. This class creates one file per timestep per group at a
# defined location. A line containing ti... | 46.102041 | 77 | 0.568836 |
7250111ba0547fd0dd6ca198d5805404281b0812 | 933 | py | Python | Packs/CommonScripts/Scripts/URLEncode/URLEncode_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/URLEncode/URLEncode_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/URLEncode/URLEncode_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from URLEncode import *
def test_URLEncode():
"""Unit test
Given
- url to encode.
When
- call URLEncode transformer.
Then
- validate The encoded url.
"""
res = main({'value': 'https://www.google.com/'})
assert res == 'https%3A//www.google.com/'
def test_URLEncode_encoded_inpu... | 22.756098 | 67 | 0.621651 |
a080910106a0a2ade63ced6494fb26cb3b7b1df2 | 326 | py | Python | Problems/Two Pointers/easy/ReversePrefixWord/test_reverse_prefix_word.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Two Pointers/easy/ReversePrefixWord/test_reverse_prefix_word.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Two Pointers/easy/ReversePrefixWord/test_reverse_prefix_word.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from reverse_prefix_word import reversePrefix
class Test(TestCase):
def test_reverse_prefix(self):
self.assertEqual(reversePrefix("abcdefd", "d"), "dcbaefd")
self.assertEqual(reversePrefix("xyxzxe", "z"), "zxyxxe")
self.assertEqual(reversePrefix("abcd", "z"), "... | 40.75 | 66 | 0.711656 |
26663ba3326f0b5a37331e1d506d843c1daf0fb4 | 497 | py | Python | python/pytest/test_pytest_parametrize.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pytest/test_pytest_parametrize.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pytest/test_pytest_parametrize.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pytest
def is_palinedrome(word: str):
word = word.replace(" ", "")
return word.lower() == word[::-1].lower()
@pytest.mark.parametrize("palindrome", [
"",
"a",
"Bob",
"Never odd or even",
"Do geese see God",
])
def test_is_palindrome(palindrome):
assert is_palinedrome(palindrom... | 19.115385 | 54 | 0.65996 |
269c1b1656a6fadc937fdfcfe5a2a18fda0d55c1 | 3,012 | py | Python | Packs/MicrosoftDefenderAdvancedThreatProtection/Scripts/TransformIndicatorToMSDefenderIOC/TransformIndicatorToMSDefenderIOC_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/MicrosoftDefenderAdvancedThreatProtection/Scripts/TransformIndicatorToMSDefenderIOC/TransformIndicatorToMSDefenderIOC_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/MicrosoftDefenderAdvancedThreatProtection/Scripts/TransformIndicatorToMSDefenderIOC/TransformIndicatorToMSDefenderIOC_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
from TransformIndicatorToMSDefenderIOC import *
MSDE_IOC_BY_VALUE = [
{'expirationTime': '2022-02-10T17:02:59.193836+02:00', 'creationTimeDateTimeUtc': '2022-01-22T12:55:20.20775+02:00',
'indicatorType': 'IpAddress', 'lastUpdateTime': '2022-02-03T17:02:59.232834+02:00', 'Severity': 'High',
... | 53.785714 | 120 | 0.697875 |
f89d1970ecc0b2bd66481d1e8deb0c2e102b1418 | 7,214 | py | Python | research/cv/IRN/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/IRN/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/IRN/train.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... | 40.301676 | 100 | 0.627668 |
f8b933ca3eaaa1f438cd3f0e2dc03087e542e847 | 5,505 | py | Python | device/alarmhandler/src/app.py | Phape/smart-security | d6a931fa01bc60d9c0c39029a41d609fbab19bf5 | [
"CC-BY-4.0"
] | null | null | null | device/alarmhandler/src/app.py | Phape/smart-security | d6a931fa01bc60d9c0c39029a41d609fbab19bf5 | [
"CC-BY-4.0"
] | 9 | 2021-06-25T13:19:17.000Z | 2021-07-04T14:06:38.000Z | device/alarmhandler/src/app.py | Phape/smart-security | d6a931fa01bc60d9c0c39029a41d609fbab19bf5 | [
"CC-BY-4.0"
] | null | null | null | import os, sys, logging, configparser, time
import redis
REDIS_ALERT_SYSTEM_ACTIVE = "system:active"
REDIS_ALERT_ENABLED = "alert:enabled"
REDIS_KEY_MEASUREMENT_VALUES = "measurement:values"
class App:
def __init__(self, configfile):
"""
Konstruktor. Liest die Konfigurationsdatei ein und stellt ... | 35.980392 | 130 | 0.62089 |
3e242e6a56687ef2835b7116f22544a36ab4a3ad | 206 | py | Python | website/apps/uploader/urls.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/uploader/urls.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/uploader/urls.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | # encoding: utf-8
from django.conf.urls import url
from uploader.views import FileListView
from uploader.views import FileCreateView
urlpatterns = [
url(r'^$', FileListView.as_view(), name='list'),
]
| 20.6 | 52 | 0.742718 |
843b1b617626ca6eb811582ac537fd053d39969a | 1,530 | py | Python | tools/scripts/javalabSpritesheetGenerators/singlesheetgenerator.py | code-dot-org/code-dot-org | 3fd13c77f37823f3f71ae2675e6e4e1fd77905d1 | [
"Apache-2.0"
] | 772 | 2015-01-01T14:52:37.000Z | 2022-03-29T17:07:10.000Z | tools/scripts/javalabSpritesheetGenerators/singlesheetgenerator.py | SNOmad1/code-dot-org | 3fd13c77f37823f3f71ae2675e6e4e1fd77905d1 | [
"Apache-2.0"
] | 13,529 | 2015-01-05T19:59:18.000Z | 2022-03-31T23:07:43.000Z | tools/scripts/javalabSpritesheetGenerators/singlesheetgenerator.py | SNOmad1/code-dot-org | 3fd13c77f37823f3f71ae2675e6e4e1fd77905d1 | [
"Apache-2.0"
] | 494 | 2015-01-09T00:32:46.000Z | 2022-03-29T17:12:02.000Z | from PIL import Image
import os, math, time
# This generates a single spritesheet from the assets in a frames folder
max_frames_row = 10.0
frames = []
tile_width = 0
tile_height = 0
spritesheet_width = 0
spritesheet_height = 0
# Pull all of the images from the frames directory
files = os.listdir("frames/")
files.sort... | 30 | 84 | 0.711111 |
4b3934187bd14c94f6379df4b5c9629f04f4f023 | 2,975 | py | Python | scheduleSynchronizer/consistency.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/consistency.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/consistency.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from requests.api import get, request
from scheduleSynchronizer.debug import *
from scheduleSynchronizer.web_scraper1111.search import look
import re
# from scheduleSynchronizer.web_scraper.search import *
def add_key(key, value, dict):
if key in dict:
return 'exi... | 30.670103 | 81 | 0.612437 |
4ba7d37176c32996ce3147291f524dfa3f8b5b63 | 647 | py | Python | mysite/core/views.py | rakesh1993it/dajngo-crispy-forms | fe3522978ca9993a4ab3f6a4468fd648af6c9872 | [
"MIT"
] | 32 | 2018-11-28T19:22:59.000Z | 2022-02-13T16:36:48.000Z | gpt-neo-test/Webserver-GPT/mysite/core/views.py | Zeno-Paukner/cellarius | 904b88c6dc33cf4ec2f6d70d3e1acf175b11967a | [
"Unlicense"
] | 3 | 2020-02-12T00:48:58.000Z | 2021-06-10T21:37:57.000Z | mysite/core/views.py | rakesh1993it/django-crispy-forms | fe3522978ca9993a4ab3f6a4468fd648af6c9872 | [
"MIT"
] | 21 | 2018-11-28T20:09:34.000Z | 2022-01-29T06:27:21.000Z | from django.views.generic import FormView, TemplateView
from django.urls import reverse_lazy
from .forms import AddressForm, CrispyAddressForm, CustomFieldForm
class AddressFormView(FormView):
form_class = AddressForm
success_url = reverse_lazy('success')
class CrispyAddressFormView(FormView):
form_cla... | 24.884615 | 66 | 0.777434 |
8a0e74efe8ada3fa631675d00e2f3465d16a06ea | 931 | py | Python | vkapp/bot/logic/user_filters.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | 1 | 2017-11-23T13:33:13.000Z | 2017-11-23T13:33:13.000Z | vkapp/bot/logic/user_filters.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | vkapp/bot/logic/user_filters.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | from .core.Filter import Filter
from .utils import stickers
from .user_states import StatisticsState, ProposeNewsState, AdminChatState
class StatsFilter(Filter):
def on_process(self, current_state, trigger):
sticker_result = stickers.is_sticker(trigger.get_update())
if sticker_result[0]:
... | 30.032258 | 74 | 0.672395 |
8a30d03cc3ee91aa013f67d6ad3e7d8b8feedc8c | 1,388 | py | Python | cmd/suggestion/optuna/v1beta1/main.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 17 | 2018-04-04T08:44:06.000Z | 2018-04-19T18:02:05.000Z | cmd/suggestion/optuna/v1beta1/main.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 58 | 2018-04-03T19:05:50.000Z | 2018-04-19T16:14:04.000Z | cmd/suggestion/optuna/v1beta1/main.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 10 | 2018-04-04T02:06:20.000Z | 2018-04-19T08:53:04.000Z | # Copyright 2022 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.27907 | 74 | 0.754323 |
8a56db0d419ad6f8518cab9f62932dbb6466b7f4 | 1,912 | py | Python | doc/examples/packages/package_cythran/setup.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/packages/package_cythran/setup.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/packages/package_cythran/setup.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """
No pyproject.toml file because in some cases, isolated build cannot be used.
"""
import sys
import os
from pathlib import Path
from runpy import run_path
from setuptools.dist import Distribution
from setuptools import setup, find_packages
if sys.version_info[:2] < (3, 6):
raise RuntimeError("Python version ... | 26.555556 | 82 | 0.735356 |
8a84653cca2c8412f97d4bce172813794f50625d | 695 | py | Python | Test.py | hch-NLP/LTP | 4eaba8d33c20127a5cf75e17c6bbcc62574dcfb1 | [
"Apache-2.0"
] | 1 | 2020-11-23T05:04:18.000Z | 2020-11-23T05:04:18.000Z | Test.py | hch-NLP/LTP | 4eaba8d33c20127a5cf75e17c6bbcc62574dcfb1 | [
"Apache-2.0"
] | null | null | null | Test.py | hch-NLP/LTP | 4eaba8d33c20127a5cf75e17c6bbcc62574dcfb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from pyltp import Segmentor, Postagger, Parser, NamedEntityRecognizer, SementicRoleLabeller, SentenceSplitter
LTP_DATA_DIR = 'F:\\LTP\\ltp_data_v3.4.0' # ltp模型目录的路径
cws_model_path = os.path.join(LTP_DATA_DIR, 'cws.model') # 分词模型路径,模型名称为`cws.model`
sents = SentenceSplitter.split(... | 46.333333 | 110 | 0.716547 |
6a67cd4448f78c74ffb0feb576a6629169e9b395 | 207 | py | Python | modules/test_nn.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | modules/test_nn.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | modules/test_nn.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | """
TEST Module for testing Purposes
CALL BY: <TEST.py>
RETURN: -
INFO: -
"""
import os
import numpy as np
my_dict = {}
for i in range(10):
my_dict.update({i:(i+1)})
print (my_dict)
| 9.857143 | 32 | 0.584541 |
6b3238aa07a2cfa302d3c2950ed7cbc7d6f2c6a6 | 16,530 | py | Python | 3.py | grunwaldmarvin/sp_aufgabe_3 | 48d104f849bb45c7899dd089f33e6328a67ffd54 | [
"MIT"
] | null | null | null | 3.py | grunwaldmarvin/sp_aufgabe_3 | 48d104f849bb45c7899dd089f33e6328a67ffd54 | [
"MIT"
] | null | null | null | 3.py | grunwaldmarvin/sp_aufgabe_3 | 48d104f849bb45c7899dd089f33e6328a67ffd54 | [
"MIT"
] | null | null | null | import pygame
import os
import random
##########################################################
class Settings(object):
file_path = os.path.dirname(os.path.abspath(__file__))
width = 700
height = 600
fps = 60
title = "Unstable Factory - Marvin G."
images_path = os.path.join(... | 42.823834 | 157 | 0.566727 |
865e78bd8f3426f84873b296d13534236d990f2e | 904 | py | Python | ebenezer/atencion/models/pattern.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | ebenezer/atencion/models/pattern.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:15:00.000Z | 2021-06-10T20:52:17.000Z | ebenezer/atencion/models/pattern.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | from uuid import uuid4
from django.db import models
from mptt.models import MPTTModel, TreeForeignKey
class Pattern(MPTTModel):
id = models.UUIDField(
primary_key=True,
default=uuid4, editable=False)
parent = TreeForeignKey(
'self', on_delete=models.CASCADE,
null=True, blank=... | 22.6 | 49 | 0.623894 |
86e0a7063ac79873b3db9c97afe844fc7c454302 | 2,463 | py | Python | machine.py | iepsenn/stack_machine | 194d355db95fc3f7e3d0a8d7c972b7113167d3ad | [
"Apache-2.0"
] | null | null | null | machine.py | iepsenn/stack_machine | 194d355db95fc3f7e3d0a8d7c972b7113167d3ad | [
"Apache-2.0"
] | null | null | null | machine.py | iepsenn/stack_machine | 194d355db95fc3f7e3d0a8d7c972b7113167d3ad | [
"Apache-2.0"
] | null | null | null | class Machine:
def __init__(self, file_input):
self.input_file = file_input
def run(self):
with open(self.input_file) as f:
code = f.read().splitlines()
self.process(code)
def process(self, code):
self.stack = []
for c in code:
command = ... | 27.988636 | 61 | 0.367438 |
d4fdfeec1a76b5c5ec24683e45ef4a567b234790 | 7,393 | py | Python | scripts/doc/normalize-param-cache.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 1 | 2021-06-25T13:43:06.000Z | 2021-06-25T13:43:06.000Z | scripts/doc/normalize-param-cache.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 13 | 2015-01-09T13:08:57.000Z | 2018-01-25T12:56:17.000Z | scripts/doc/normalize-param-cache.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 2 | 2019-08-13T13:37:03.000Z | 2021-02-01T10:19:03.000Z | #!/usr/bin/env python3
# This script takes the output of get-project-params.sh on stdin
# and transforms it into a tabular representation for further
# processing.
from print23 import print_
import sys
import re
import os.path
def debug(msg):
sys.stderr.write(msg + "\n")
def write_out(*args):
print_("@@@"... | 34.226852 | 90 | 0.506966 |
07cf05f086a3aabe6a4b100c2853eb3d2bd43d12 | 172 | py | Python | archives/zn.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | archives/zn.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | archives/zn.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python3
def gcd(a, b):
return a if b == 0 else gcd(b, a % b)
n = int(input())
g = []
for i in range(n):
if gcd(n, i) == 1:
g.append(i)
print(g) | 15.636364 | 41 | 0.5 |
07e66d084defa49b926c963ad740493a971b6398 | 1,633 | py | Python | redpwn/2021/crypto/Keeper_of_the_Flag/kotf.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | redpwn/2021/crypto/Keeper_of_the_Flag/kotf.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | redpwn/2021/crypto/Keeper_of_the_Flag/kotf.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
from Crypto.Util.number import *
from Crypto.PublicKey import DSA
from random import *
from hashlib import sha1
rot = randint(2, 2 ** 160 - 1)
chop = getPrime(159)
def H(s):
x = bytes_to_long(sha1(s).digest())
return pow(x, rot, chop)
L, N = 1024, 160
dsakey = DSA.generate(1024)
p ... | 19.914634 | 59 | 0.526026 |
ed55ce4388d299f5544123658725d799423ee911 | 7,856 | py | Python | research/nlp/tprr/retriever_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/tprr/retriever_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/tprr/retriever_eval.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... | 39.676768 | 106 | 0.632637 |
9c0d072f7b7d8e1c8d9e75a81282fb7c15e051ff | 864 | py | Python | ___Python/Torsten/Python-Kurs/p09_isbn/m01_isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Torsten/Python-Kurs/p09_isbn/m01_isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Torsten/Python-Kurs/p09_isbn/m01_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):
if len(isbn) < 10:
return False
check_digit = isbn[-1] # letzte Stelle der Eingabe
if check_digit == "X":
check_digit = 10
elif ... | 26.181818 | 87 | 0.563657 |
9c4819c1245468cdd3a0c5ccdb8c6ed0e84bdf57 | 192 | py | Python | exercises/en/exc_03_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_03_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_03_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Load the en_core_web_sm model
nlp = ____
# Print the names of the pipeline components
print(____.____)
# Print the full pipeline of (name, component) tuples
print(____.____)
| 17.454545 | 53 | 0.765625 |
92ec94c42c59491d67397774033d71afddc97864 | 646 | py | Python | scripts/pegasus/build_test_sample_spm_no_bos.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 12 | 2021-06-05T03:51:23.000Z | 2022-03-05T05:09:41.000Z | scripts/pegasus/build_test_sample_spm_no_bos.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 5 | 2021-12-01T04:34:07.000Z | 2022-01-28T08:28:18.000Z | scripts/pegasus/build_test_sample_spm_no_bos.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 3 | 2021-04-26T08:01:16.000Z | 2022-03-23T04:47:56.000Z | #!/usr/bin/env python
# this script builds a small sample spm file tests/fixtures/test_sentencepiece_no_bos.model, with features needed by pegasus
# 1. pip install sentencepiece
#
# 2. wget https://raw.githubusercontent.com/google/sentencepiece/master/data/botchan.txt
# 3. build
import sentencepiece as spm
# pega... | 30.761905 | 148 | 0.756966 |
e01a51912bcce580fc5782f25b8c97554908b450 | 3,323 | py | Python | official/cv/dpn/src/crossentropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/dpn/src/crossentropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/dpn/src/crossentropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.978947 | 119 | 0.629552 |
e04a1e761ef5aa1ca04ea0a30470e54e38663c27 | 150 | py | Python | abfahrt/testutils/test_simulator/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/testutils/test_simulator/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/testutils/test_simulator/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | """
This is the module test_simulator for automatic testing/validating inputfiles
"""
from abfahrt.testutils.test_simulator import test_simulator
| 30 | 81 | 0.813333 |
bcffc3b1a4a53019414a15d16de6eaca00bfb179 | 1,645 | py | Python | nyu_dataloader.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | nyu_dataloader.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | nyu_dataloader.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | import numpy as np
from torchvision.datasets import ImageFolder
from torch.utils.data import Dataset, DataLoader
from PIL import Image
from torchvision import transforms, utils
class NYU_v2_datset(Dataset):
"""NYUDataset."""
def __init__(self, root_dir, scale=4, train=True, transform=None):
"""
... | 31.634615 | 113 | 0.599392 |
4c78bd8b6d85a68241413abc647294e5139c07a9 | 3,068 | py | Python | tests/onegov/gazette/test_views_groups.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_views_groups.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_views_groups.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from tests.onegov.gazette.common import login_admin
from tests.onegov.gazette.common import login_editor_1
from tests.onegov.gazette.common import login_publisher
from webtest import TestApp as Client
def test_view_groups(gazette_app):
client = Client(gazette_app)
login_admin(client)
# no groups yet
... | 34.47191 | 78 | 0.676662 |
d5cba2c47e7e059e8400ff2798c36ee9bcc2fca6 | 5,001 | py | Python | bridges/crnn_bridge.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | null | null | null | bridges/crnn_bridge.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | 16 | 2020-01-28T23:04:13.000Z | 2022-03-12T00:02:40.000Z | bridges/crnn_bridge.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | null | null | null | """
This file contains source code from another GitHub project. The comments made there apply. The source code
was licensed under the MIT License. The license text and a detailed reference can be found in the license
subfolder at models/crnn/license. Many thanks to the author of the code.
For reasons of clarity u... | 40.991803 | 117 | 0.594681 |
d5f2733d89aa960634c63815ec301aa105910d91 | 347 | py | Python | models/hr_document_type.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | models/hr_document_type.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | models/hr_document_type.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class FullHrDocumentType(models.Model):
_name = 'hr.document.type'
# Fields
name = fields.Char(string='Name', required=True)
warning_limit_date_hr = fields.Integer(
string='Warning lim... | 23.133333 | 52 | 0.688761 |
fc0f12f087b117d09d9c2e38677d1a3391501eb0 | 13,720 | py | Python | src/comex_stat/assets/migrations/0001_initial.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | src/comex_stat/assets/migrations/0001_initial.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | src/comex_stat/assets/migrations/0001_initial.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-09 18:50
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 58.632479 | 301 | 0.600437 |
5daa7d7f7548522d39545da86d16a940e1b0c35c | 12,455 | py | Python | Zhihu/NN/_extra/two/Networks.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | Zhihu/NN/_extra/two/Networks.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | Zhihu/NN/_extra/two/Networks.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import matplotlib.pyplot as plt
from Zhihu.NN._extra.Layers import *
from Zhihu.NN._extra.Optimizers import *
from Util.Timing import Timing
from Util.ProgressBar import ProgressBar
class NNVerbose:
NONE = 0
EPOCH = 1
METRICS = 2
METRICS_DETAIL = 3
DETAIL = 4
DEBUG = 5
# ... | 39.539683 | 117 | 0.561301 |
5dfee36ca87e8067fa3af19374393f6cfa448150 | 541 | py | Python | exercises/es/test_01_08_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/test_01_08_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/test_01_08_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
"token_text = token.text" in __solution__
), "¿Estás obteniendo el texto del token correctamente?"
assert (
"token_pos = token.pos_" in __solution__
), "¿Estás obteniendo la etiqueta gramatical del token correctamente? Recuerda usar el atributo con el guion bajo."
... | 45.083333 | 129 | 0.693161 |
b905205f409b2084c06303231eb3cf9cccf46ae0 | 756 | py | Python | elements/pick.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/pick.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/pick.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import random
import sys
import os.path
QUESTIONS_DIR = './questions'
LANGUAGE = 'go'
def read_questions_file(name):
questions_file = os.path.join(QUESTIONS_DIR, name)
with open(questions_file) as f:
return filter(None, [q.split()[0] for q in f])
# arguments
sources = sys.ar... | 22.909091 | 57 | 0.666667 |
ab618bc16ab084b525b8ed53aeb068d1db9aa8b7 | 20,882 | py | Python | build/images/finalize_manifests.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | build/images/finalize_manifests.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | build/images/finalize_manifests.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2.7
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This tool takes in multiple manifest files:
* system image and archive manifest files from each package
* Zircon's bootfs.manife... | 41.187377 | 104 | 0.628149 |
dbc02d9315803212cedfed4f81368de13fed81c6 | 2,111 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/ingate/test_ig_unit_information.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/ingate/test_ig_unit_information.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/ingate/test_ig_unit_information.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ingate Systems AB
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible_collections.community.general.tests.unit.compat... | 37.035088 | 100 | 0.657982 |
53055e1c829236c1531ae7ca95a217eb5d32fa50 | 3,930 | py | Python | LaneDialog.py | siej88/FuzzyACO | 989a58049c8417cd023cfc312fb99d2649333ca7 | [
"MIT"
] | null | null | null | LaneDialog.py | siej88/FuzzyACO | 989a58049c8417cd023cfc312fb99d2649333ca7 | [
"MIT"
] | null | null | null | LaneDialog.py | siej88/FuzzyACO | 989a58049c8417cd023cfc312fb99d2649333ca7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
UNIVERSIDAD DE CONCEPCION
Departamento de Ingenieria Informatica y
Ciencias de la Computacion
Memoria de Titulo Ingenieria Civil Informatica
DETECCION DE BORDES EN IMAGENES DGGE USANDO UN
SISTEMA HIBRIDO ACO CON LOGICA DIFUSA
Autor: Sebastian Ignacio Espinoza Jimenez
Patrocinant... | 36.388889 | 103 | 0.621628 |
533b4564240ff998f34664617b76cb0d6ba7d819 | 8,086 | py | Python | Tests/scripts/validate_index.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/scripts/validate_index.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/scripts/validate_index.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """Run validation on the index.json file.
Check index.json file inside the index.zip archive in the cloud.
Validate no missing ids are found and that all packs have a non negative price.
Validate commit hash is in master's history.
"""
import argparse
import sys
import os
from typing import Tuple
from Tests.Marketpla... | 44.185792 | 120 | 0.670418 |
f46f4a9297bbd285df7f7e35ed70012ddca83ef3 | 115 | py | Python | HackerRank/HackerRank-Python/Strings/String Split and Join.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | HackerRank-Python/Strings/String Split and Join.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | HackerRank-Python/Strings/String Split and Join.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | def split_and_join(line):
split_line = line.split()
join_line = "-".join(split_line)
return join_line
| 19.166667 | 36 | 0.678261 |
be6c7531a8f449ccaaca4ce42c44349e9f4bb933 | 1,258 | py | Python | tests/solvers/base/history_test.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | tests/solvers/base/history_test.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | tests/solvers/base/history_test.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | from copy import deepcopy
import chex
import haiku as hk
import jax
import jax.numpy as jnp
from shinrl import History
def test_history(tmpdir):
history = History()
history.config.add_interval = 10
for i in range(30):
history.add_scalar("test1", i)
history.add_scalar("test2", 10 * i)
... | 28.590909 | 77 | 0.645469 |
fe8a0baa5c3610b79e85776b6aa5918a6acc10e3 | 3,090 | py | Python | crawler.py | xeust/patram | 802f655fec1c405cb0102baeb1878605c6ddae6d | [
"MIT"
] | null | null | null | crawler.py | xeust/patram | 802f655fec1c405cb0102baeb1878605c6ddae6d | [
"MIT"
] | null | null | null | crawler.py | xeust/patram | 802f655fec1c405cb0102baeb1878605c6ddae6d | [
"MIT"
] | null | null | null | import os
import json
import markdown
from collections import defaultdict
PAGES_PATH = "./pages"
def deserialize(key, type="FILE"):
if not key:
return key
if type == "FILE":
words = key.split(".md")[0].split("-")
else:
words = key.split("-")
for i, word in enumerate(words):
... | 26.410256 | 72 | 0.515858 |
fe1e286b239cfa1763089b546335115060ea2817 | 769 | py | Python | Packs/FireEyeHX/Integrations/FireEyeHX/FireEyeHX_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FireEyeHX/Integrations/FireEyeHX/FireEyeHX_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FireEyeHX/Integrations/FireEyeHX/FireEyeHX_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
def test_parse_alert_to_incident(mocker):
"""
Given:
- Alert with event_values as list
When:
- Parsing the alert
Then:
- Ensure parsing does not fail
- Verify parsed alert returned as expected
"""
mocker.patch.object(
demi... | 24.806452 | 118 | 0.538362 |
a3f89c74ceb592a8fb8898dc008fea9459aed002 | 3,255 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/edgeswitch/test_edgeswitch_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/edgeswitch/test_edgeswitch_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/edgeswitch/test_edgeswitch_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2018 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | 45.208333 | 144 | 0.715207 |
43cc17f9d304ed6b994ddd53886009723db60855 | 540 | py | Python | source/pkgsrc/misc/calibre/patches/patch-src_calibre_linux.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/misc/calibre/patches/patch-src_calibre_linux.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/misc/calibre/patches/patch-src_calibre_linux.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-src_calibre_linux.py,v 1.7 2015/11/23 11:03:40 wiz Exp $
Disable installing files into $HOME that are not packaged anyway.
--- src/calibre/linux.py.orig 2015-11-15 04:15:13.000000000 +0000
+++ src/calibre/linux.py
@@ -691,8 +691,6 @@ class PostInstall:
self.appdata_resources = []
if i... | 33.75 | 71 | 0.662963 |
78ecaca8baeb5a30fc32486ba99fdefb24be78f1 | 715 | py | Python | 01/insertion_sort.py | backtoskool/eau | f1772e83c9a9cc9c55da417231eef26974c23efd | [
"MIT"
] | null | null | null | 01/insertion_sort.py | backtoskool/eau | f1772e83c9a9cc9c55da417231eef26974c23efd | [
"MIT"
] | null | null | null | 01/insertion_sort.py | backtoskool/eau | f1772e83c9a9cc9c55da417231eef26974c23efd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
def insertion_sort(lst):
""" Sort list using the InsertionSort algorithm.
>>> insertion_sort([24, 6, 12, 32, 18])
[6, 12, 18, 24, 32]
>>> insertion_sort([])
[]
>>> insertion_sort("hallo")
Traceback (most recent call last):
...
TypeError: lst must be a list... | 19.861111 | 52 | 0.503497 |
601c4218a627deec98fe7455cf519d19b81aece1 | 2,066 | py | Python | ais3-pre-exam-2022-writeup/Crypto/pekobot/chall/server.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/pekobot/chall/server.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/pekobot/chall/server.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | from elliptic_curve import Curve, Point
from Crypto.Util.number import bytes_to_long
import os
from random import choice
from secrets import randbelow
flag = os.environb[b"FLAG"]
assert flag.startswith(b"AIS3{")
assert flag.endswith(b"}")
flag += os.urandom(64 - len(flag))
# NIST P-256
a = -3
b = 41058363725152142129... | 27.184211 | 86 | 0.607454 |
6077f30b73d6eeee4fda3ad02d0232b28e1bdabd | 2,445 | py | Python | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
from CommonServerPython import *
@pytest.mark.parametrize(
argnames='skip_verify, skip_validation, uri',
argvalues=[
('true', 'true', '/contentpacks/installed/upload?skipVerify=true&skipValidation=true'),
('false', 'true', '/contentpacks/installed/upload?skipValidation=true'),
... | 42.155172 | 108 | 0.701022 |
60c9c16201e6c3561930d3eaf9634769a6ad9b63 | 121 | py | Python | Trees/Tree.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Trees/Tree.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Trees/Tree.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | from Trees.TreeNode import TreeNode
class Tree(object):
def __init__(self, root=None):
self.root = root
| 12.1 | 35 | 0.669421 |
7181275396a8858b23d7f041efef70d64b3cd785 | 3,465 | py | Python | src/onegov/election_day/models/data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Election
from onegov.ballot import Vote
from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UUID
from onegov.election_day import _
from sqlalchemy import Column
from sqlalchemy import desc
from sqlalchemy import Enum
from sqlalch... | 26.052632 | 74 | 0.626263 |
1c739cb844192655a3fa0b3ffa9657a60a209631 | 412 | py | Python | Shellcoding/raw2hex.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Shellcoding/raw2hex.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Shellcoding/raw2hex.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | import binascii
import sys
import re
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Missing file path")
sys.exit(0)
try:
data = binascii.b2a_hex(open(sys.argv[1], "rb").read()).decode()
except:
print("Error reading %s" % sys.argv[1])
sys.exit(0)
if "-list" in sys.argv:
print("0x" + ",0... | 19.619048 | 66 | 0.59466 |
c7dc960c29ef6a0f1dec0be4c66b514f0c88bd48 | 4,342 | py | Python | 02_transcription/GCSTranscribe.py | Verena-Lemberger/masterarbeit | 2819f222b75b31bd2a44b45ee3417998c385eeab | [
"MIT"
] | null | null | null | 02_transcription/GCSTranscribe.py | Verena-Lemberger/masterarbeit | 2819f222b75b31bd2a44b45ee3417998c385eeab | [
"MIT"
] | 14 | 2021-06-21T19:41:33.000Z | 2021-06-21T19:41:35.000Z | 02_transcription/GCSTranscribe.py | Verena-Lemberger/masterarbeit | 2819f222b75b31bd2a44b45ee3417998c385eeab | [
"MIT"
] | null | null | null | # Google Cloud Speech-To-Text Interview Transcriber
# Please follow the instructions in the README.md first!
#!/usr/bin/env python3
# Set up deps for GC Speech
import sys, os, io, time, configparser
from pathlib import Path, PurePath
from google.oauth2 import service_account
from google.cloud import speech_v1p1beta1 ... | 33.921875 | 168 | 0.72386 |
909d1e13fdf19ac850ef3f39424ef93230188a82 | 5,037 | py | Python | Src/Scripts/baseline.py | hazemalsaied/IdenSys | 9b6220ff7e65f7059240b742c81952132a765007 | [
"MIT"
] | 2 | 2017-09-28T13:54:57.000Z | 2018-06-28T05:03:06.000Z | Src/Scripts/baseline.py | hazemalsaied/IdenSys | 9b6220ff7e65f7059240b742c81952132a765007 | [
"MIT"
] | null | null | null | Src/Scripts/baseline.py | hazemalsaied/IdenSys | 9b6220ff7e65f7059240b742c81952132a765007 | [
"MIT"
] | null | null | null | import os
from corpus import Corpus, VMWE
from evaluation import Evaluation
from param import FeatParams, Paths, XPParams
import reports
class BaseLine:
@staticmethod
def identify():
"""
skjdksdjls
:return: skjdksdjls
"""
if not XPParams.baseline:
raise Exc... | 46.211009 | 127 | 0.471908 |
292154c7eee547025a8056401f8751cca2514f05 | 287 | py | Python | Justice/Python Project.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Justice/Python Project.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Justice/Python Project.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | def image_resize(location,new_size):
"""Function to receive image directory, list with image length
and width in pixels and return resized image"""
from PIL import Image
im1 = Image. open(location)
im2 = im1.copy()
im2.show()
return im2.resize(new_size)
| 28.7 | 66 | 0.682927 |
316d58ef837b2608a21dbb6a6e8d489f4c327b3a | 526 | py | Python | ACM Training/2018-04-15/test.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | ACM Training/2018-04-15/test.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | ACM Training/2018-04-15/test.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | def he(x):
for i in range(2, x):
if (x % i == 0):
return True
return False
def get(x):
cnt = 0
for i in range(2, x + 1):
if (x % i == 0):
if (he(x)):
cnt = cnt + 1
print(x, ' ', cnt)
cnt = 0
for i in range(2, x + 1):
while (x %... | 20.230769 | 32 | 0.391635 |
31849e9a0e632f8e9f1c23db7695a48e4eeb37d7 | 1,215 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/interval_count_intersections.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/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/interval_count_intersections.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/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/interval_count_intersections.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/python2.7
"""
Read two lists of intervals (with chromosomes) and count the number of entries
in the second set that intersect any entry in the first set.
TODO: This could use bitsets rather than the intervals package, would it be
faster?
usage: %prog bed1 bed2 > out
"""
from __future__ import divis... | 23.823529 | 89 | 0.654321 |
b42c8d51d3bebaf3631119ccb2cd3c0e569bd44c | 450 | py | Python | dptest.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | dptest.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | dptest.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | precalc = [None] * 25
limit = 11
total = 0
def S(N):
global total
if N == -1:
return 0
if precalc[N] != None:
return precalc[N]
res = S(N-1) + 2**(N+1)-1+ S(N-1)
if (total + S(N-1)) < limit:
total += S(N-1)
center = 2**(N+1)-1
if (total + center) < limit:
tot... | 20.454545 | 37 | 0.48 |
b435c567cd7d9b10a803bd7af0cac2b167032ca0 | 93 | py | Python | sklearndemo/learn/day01_machine_learning.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | sklearndemo/learn/day01_machine_learning.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | sklearndemo/learn/day01_machine_learning.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | from sklearn.datasets import load_iris
def datasets_demo():
load_iris()
return None | 15.5 | 38 | 0.741935 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.