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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
45f7b2626f801fc7659c24335009ed7bd2fe0dbd | 405 | py | Python | UTCTF/2021/crypto/Sleeves/challenge.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | UTCTF/2021/crypto/Sleeves/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | UTCTF/2021/crypto/Sleeves/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from challenge.eccrng import RNG
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
rng = RNG()
# I'll just test it out a few times first
print("r1 = %d" % rng.next())
print("r2 = %d" % rng.next())
r = str(rng.next())
aes_key = SHA256.new(r.encode('ascii')).digest()
cipher = AES.new(aes_key, AES.MODE_ECB)
p... | 27 | 84 | 0.604938 |
cad09c740e82117511ba119c7e91cda421933385 | 1,852 | py | Python | Backend/views/divi.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/views/divi.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/views/divi.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | from flask import Blueprint, jsonify
from cache import cache
from db import db
from models.divi import HospitalDevelopment, HospitalsDevelopmentPerLandkreis, HospitalsDevelopmentPerBundesland, \
HospitalsDevelopmentPerRegierungsbezirk
from views.helpers import __as_feature_collection
routes = Blueprint('divi', __... | 30.866667 | 115 | 0.74838 |
1b190c5d74f25ab98ebe214dafd88fe5843c01f0 | 3,874 | py | Python | backend/apps/accounts/tables.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/accounts/tables.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/accounts/tables.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
import django_tables2 as tables
from .models import Newsletter, NewsletterState
NewsletterStateIcons = {
NewsletterState.READY_TO_SEND: '<svg class="bi bi-file-check" width="1em" height="1em" viewBox="0 0 16 16" fill=... | 67.964912 | 737 | 0.646877 |
84f9412da14ca6f877ab18641a98b36e42ed8567 | 1,155 | py | Python | crypto/ECC/test.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 987 | 2021-12-19T09:57:18.000Z | 2022-03-31T15:39:45.000Z | crypto/ECC/test.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 73 | 2021-07-04T03:53:57.000Z | 2021-12-18T06:17:13.000Z | crypto/ECC/test.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 263 | 2021-06-28T15:26:56.000Z | 2021-12-19T08:14:37.000Z | import unittest
from binascii import hexlify, unhexlify
from fastecdsa import keys, curve
from fastecdsa.encoding.sec1 import InvalidSEC1PublicKey, SEC1Encoder
from ecc_secp256k1 import ECC256k1
PRIV_KEY = 0x92c0302c1fff4679f4c98684ff368fdbe04da815e6de24d246793f5812577016
pub_key = keys.get_public_key(PRIV_KEY, curve... | 33 | 98 | 0.804329 |
ca6aba048d60d586fc091c34d788c0b33c8be16b | 408 | py | Python | libapp/migrations/0005_alter_bookslips_restore.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | 2 | 2021-05-31T13:11:50.000Z | 2021-06-05T04:37:51.000Z | libapp/migrations/0005_alter_bookslips_restore.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | libapp/migrations/0005_alter_bookslips_restore.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-05-30 21:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('libapp', '0004_bookcart'),
]
operations = [
migrations.AlterField(
model_name='bookslips',
name='restore',
... | 21.473684 | 81 | 0.602941 |
047b077c0c9e17dc7222f815655bea77514a2e38 | 1,087 | py | Python | v406/python/rechnungEinzel.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v406/python/rechnungEinzel.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v406/python/rechnungEinzel.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
from uncertainties import ufloat
from scipy import optimize
import matplotlib.pyplot as plt
print("---------------einzelspalt---------------")
dx1, i1 = np.genfromtxt("python/einzelspalt.txt", unpack=True)
dsg = 0.325 # abstand schirm gitter in meter
g = 0.075e-3 # in meter
λ = 635e-9 # in meter
... | 30.194444 | 82 | 0.654094 |
6d667f2d739ad53e6caa103cd794e7df685a70b3 | 924 | py | Python | SBTK_League_Helper/src/interfacing/ogs/players.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/players.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/players.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from .abstract import OGSElement, OGSBetaElement
from ..players import Player
class OGSMacroPlayer(Player):
# ABSTRACT OVERRIDES
@classmethod
def request_from_server (Class, credentials, request_type = 'id', **kwargs):
if request_type == 'id':
id = kwargs['id']
return ... | 24.972973 | 87 | 0.590909 |
bfa9b281df3e8fa4119d49a97d365258bd4a51b4 | 507 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_autoname_field.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/patches/v7_0/update_autoname_field.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_autoname_field.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
doctypes = frappe.db.sql(""" select name, autoname from `tabDocType`
where autoname like 'field:%' and allow_rename ... | 36.214286 | 80 | 0.719921 |
bfbb0a83a74765920e52c216c55c22e81d3f584a | 124 | py | Python | Data Structures/DataStructures-Problems/Graphs/Monk at the Graph Factory/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 26 | 2019-07-17T11:05:43.000Z | 2022-02-06T08:31:40.000Z | Data Structures/DataStructures-Problems/Graphs/Monk at the Graph Factory/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 7 | 2019-07-16T19:52:25.000Z | 2022-01-08T08:03:44.000Z | Data Structures/DataStructures-Problems/Graphs/Monk at the Graph Factory/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 19 | 2020-01-14T02:44:28.000Z | 2021-12-27T17:31:59.000Z | n = int(input())
total = sum(list(map(int, input().split(' '))))
if total == 2*(n-1):
print('Yes')
else:
print('No') | 20.666667 | 47 | 0.532258 |
449ca47af3065fceab1627aafb590e6d735257b9 | 4,373 | py | Python | torch/fx/experimental/fx2trt/input_tensor_spec.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | torch/fx/experimental/fx2trt/input_tensor_spec.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | torch/fx/experimental/fx2trt/input_tensor_spec.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | from typing import List, NamedTuple, Iterable, Tuple, Sequence
import torch
from .types import Shape, ShapeRange
from .utils import get_dynamic_dims
class InputTensorSpec(NamedTuple):
"""
This class contains the information of a input tensor.
shape: shape of the tensor.
dtype: dtyep of the tensor.... | 36.747899 | 131 | 0.645781 |
44bfb32a474afe6b83cbaed9544fb364481eeb05 | 4,472 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/saga/generateDefaultsActivityGen.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/saga/generateDefaultsActivityGen.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/saga/generateDefaultsActivityGen.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python3
""" Generate the default values for the SUMOActivityGen.
Author: Lara CODECA
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
"""
import argparse
import ... | 37.579832 | 93 | 0.628354 |
44c9494332d23217dbed87e9234721d775aee539 | 6,106 | py | Python | bolt/core/plugin.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/core/plugin.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/core/plugin.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | """
Description:
Superclass for which all plugins are derived
Provides some simple abstractions to make writing plugins easy
Contributors:
- Patrick Hennessy
"""
from bolt.utils.decorators import add_method_tag
from bolt.core.command import Command, RegexCommand, ParseCommand
from bolt.... | 25.982979 | 83 | 0.500655 |
7816243756a31343857b1e0b81dc86a2ddb3cb85 | 5,435 | py | Python | docs/Timetable/tt1.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | docs/Timetable/tt1.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | docs/Timetable/tt1.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
TT/tt1.py
Last updated: 2021-06-19
Timetable ... data handling / actions ...
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance ... | 38.006993 | 75 | 0.710212 |
01b43a7981685fb351bd9d8f18099bcb52b02e85 | 6,040 | py | Python | raw_code/pulson440/align.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/align.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/align.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | '''
COMMENT PROGRAM DESCRIPTION HERE
'''
#SOMEONE WRITE DOCUMENTATION FOR ARGUMENTS
#imports desired libs
import pandas as pd
import numpy as np
import pickle
import matplotlib.pyplot as plt
#opens and loads pickle file
with open('Mandrill_1way_Misaligned3_data.pkl', 'rb') as f:
data = pickle.lo... | 47.1875 | 144 | 0.737748 |
172e41452846aa61d10c652b5ffc3ece0f10c01e | 269 | py | Python | backend/app/models/new_task.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/models/new_task.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/models/new_task.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from sqlalchemy import ForeignKey, Integer, Column
from app.db.base_class import Base
class NewTask(Base):
user_id = Column(Integer, ForeignKey("user.id"), primary_key=True)
base_task_id = Column(Integer, ForeignKey("basetask.id"), primary_key=True)
| 29.888889 | 80 | 0.739777 |
1741095ea962e14bd846906b90aa4b68eea7a65b | 894 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_change_amount_account.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/patches/v7_0/update_change_amount_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_change_amount_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
def execute():
frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
for company in frappe.db.sql("""select company from `tabSales Invoice`
where change_amount ... | 44.7 | 99 | 0.763982 |
bdd4eb7981874ccafbf05698e8adca06be6c869c | 1,376 | py | Python | src/labtest/views.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/labtest/views.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/labtest/views.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from django.http import JsonResponse
from django.utils import timezone
from datetime import timedelta
from labtest.serializers import LocationSerializer
from labtest.models import LabTest, Location
from django.core import serializers
from rest_framework import viewsets
def locations(request):
# print("get_locatio... | 32 | 107 | 0.538517 |
e5f5acfb95a437cf7524db442c66a7c597a82237 | 2,987 | py | Python | easyp2p/platforms/robocash.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/platforms/robocash.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/platforms/robocash.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""
Download and parse Robocash statement.
"""
import json
from easyp2p.p2p_parser import P2PParser
from easyp2p.p2p_session import P2PSession
from easyp2p.platforms.base_platform import BasePlatform
class Robocash(BasePlatform):
"""
C... | 33.188889 | 79 | 0.62839 |
97525f00b8dbdf779f1ec67cc680f1311f5d7603 | 6,208 | py | Python | skil/cli.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | skil/cli.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | skil/cli.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | #!/usr/bin python
# -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2015-2018 Skymind, Inc.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.a... | 33.556757 | 99 | 0.58038 |
c1127996d9455774f30e1120615d5679191fd96a | 975 | py | Python | ebenezer/atencion/models/dominio.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | ebenezer/atencion/models/dominio.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:15:00.000Z | 2021-06-10T20:52:17.000Z | ebenezer/atencion/models/dominio.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | from uuid import uuid4
from django.db import models
class Dominio(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid4, editable=False)
nombre = models.CharField(
unique=True, max_length=200,
blank=False, null=False)
descripcion = models.TextField(
... | 25 | 41 | 0.550769 |
c120309411c1c4158d9e71a54956de3e4f58a93a | 4,828 | py | Python | scripts/send_results_to_lecturers.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | scripts/send_results_to_lecturers.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | scripts/send_results_to_lecturers.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | import logging
import os
from string import Template
from configparser import ConfigParser
from imwievaluation.semester_old import Semester
from imwievaluation.mail import MailServer
from imwievaluation.limesurvey import LimeSurveySession
logger = logging.getLogger(__name__)
configParser = ConfigParser()
configParse... | 35.762963 | 131 | 0.727423 |
c15be3b4a6be10edb7de9eea4742f41295d227c0 | 387 | py | Python | src/visitpy/visit_flow/visit_flow_vpe/src/__init__.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/visit_flow_vpe/src/__init__.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/visit_flow_vpe/src/__init__.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: __init__.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 3/28/2012
description:
... | 25.8 | 73 | 0.749354 |
e71868e9470240e9625df54cdafd35edf2b44b81 | 49 | py | Python | python/python_backup/PRAC_PYTHON/poiy.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/poiy.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/poiy.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | s=5
for i n range(1,7,1):
print s
s=(s*10)+5 | 12.25 | 22 | 0.530612 |
e75c853a7b0317e610cac816a54066270fc3fcd7 | 523 | py | Python | pylvm2/pylvm/i18n.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | pylvm2/pylvm/i18n.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | pylvm2/pylvm/i18n.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | import locale
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error:
locale.setlocale(locale.LC_ALL, 'C')
#print locale.LC_ALL
import os
import gettext
if os.path.isdir('po'):
# if there is a local directory called 'po' use it so we can test
# without installing
#t = gettext.translation('s... | 24.904762 | 75 | 0.680688 |
d45398d6655f5d41c7f5257e9cb186cbdbf33814 | 205 | py | Python | exercises/es/solution_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/solution_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/solution_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importa spaCy
import spacy
# Crea el objeto nlp para procesar español
nlp = spacy.blank("es")
# Procesa un texto
doc = nlp("¿Cómo estás?")
# Imprime en pantalla el texto del documento
print(doc.text)
| 17.083333 | 44 | 0.726829 |
2e17b12051faafa90187c55147f2e606644c0e60 | 1,848 | py | Python | run/core/controllers/signup.py | matthewmuccio/FlaskBase | b2d7288a33b20badee1f4667526cfc528599a9ef | [
"MIT"
] | null | null | null | run/core/controllers/signup.py | matthewmuccio/FlaskBase | b2d7288a33b20badee1f4667526cfc528599a9ef | [
"MIT"
] | null | null | null | run/core/controllers/signup.py | matthewmuccio/FlaskBase | b2d7288a33b20badee1f4667526cfc528599a9ef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from flask import abort, Blueprint, redirect, render_template, request, session, url_for
from core.models import model
controller = Blueprint("signup", __name__, url_prefix="/")
@controller.route("/", methods=["GET", "POST"])
def show_signup():
# In session (user signed in)
i... | 35.538462 | 125 | 0.704545 |
cf548910ca97ad2b94e07dbf3b0dd8317eed5739 | 459 | py | Python | jocker/utils.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | 3 | 2017-10-18T08:11:58.000Z | 2019-07-31T23:53:37.000Z | jocker/utils.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | null | null | null | jocker/utils.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | null | null | null | import os
from subprocess import PIPE, STDOUT, run
def run_command(command, args=None, env=None, check=False):
"""
Exec command with Popen
"""
if args:
command = '{command} {args}'.format(command=command, args=args)
os.environ.update(env or {})
if check:
return run(
... | 22.95 | 71 | 0.616558 |
d8c12a8e62e710a84f57a7e839ed03f1cc3d5d5b | 808 | py | Python | deutschland/strahlenschutz/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/strahlenschutz/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/strahlenschutz/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
ODL-Info API
Daten zur radioaktiven Belastung in Deutschland # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
__version__ = "1.0.0"
# import ApiClient
from deutschland.strahlenschutz.api_client import ApiClient
# import C... | 28.857143 | 67 | 0.82797 |
2b0752c2c4ffd3c3734e23a272cc1d30157b30c3 | 92 | py | Python | 2014/06/exonerations/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/06/exonerations/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/06/exonerations/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '18UcK-oyW0m6eo56aiJ1-ZUIukT9dbFvreSg3PySGgB8'
| 23 | 68 | 0.826087 |
cfd11ab365f482ff9aca5cc7ec28cac382d7a3b2 | 3,648 | py | Python | marsyas-vamp/marsyas/scripts/chord-detection/scripts/extractChroma.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/chord-detection/scripts/extractChroma.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/chord-detection/scripts/extractChroma.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
import argparse, re
from marsyas import *
from math import sqrt
from os import path
################################################################################
# Parse Command-line Arguments
#
parser = argparse.ArgumentParser(description='Process .wav files to estimate tuning frequency re... | 42.418605 | 157 | 0.601151 |
7a9adbf07d05ad4ec45aee02ca6119c1da280a43 | 317 | py | Python | pyhton/lambdas/main.py | NovaOrdis/playground | 6fe076b5d246ac5b492ab8d5de04eef43d797b62 | [
"Apache-2.0"
] | 5 | 2016-11-16T02:18:45.000Z | 2018-03-14T19:57:11.000Z | pyhton/lambdas/main.py | NovaOrdis/playground | 6fe076b5d246ac5b492ab8d5de04eef43d797b62 | [
"Apache-2.0"
] | null | null | null | pyhton/lambdas/main.py | NovaOrdis/playground | 6fe076b5d246ac5b492ab8d5de04eef43d797b62 | [
"Apache-2.0"
] | 10 | 2016-06-06T18:28:13.000Z | 2018-07-01T18:20:06.000Z | def regular_function(s):
return s.capitalize()
def user_of_function(words, f):
for w in words:
print(f(w))
data = ['a', 'b', 'c']
# equivalent behavior:
user_of_function(data, regular_function)
user_of_function(data, lambda w: w.capitalize())
user_of_function(data, lambda w: regular_function(w))
| 21.133333 | 53 | 0.70347 |
64ed911204684e78fb710dea60ca3ff0b48c76e1 | 1,363 | py | Python | scripts/check_version.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | scripts/check_version.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | scripts/check_version.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | import re
from typing import Union
from main_dec import main
from pfun import Effect, Try, curry, error, files, success
class MalformedTomlError(Exception):
pass
class NoVersionMatchError(Exception):
pass
def get_version(toml: str) -> Try[MalformedTomlError, str]:
match = re.search(r'version = \"([0... | 24.339286 | 74 | 0.674982 |
8f114b134b0e88a69ff60412dce26bacb8a23c86 | 5,028 | py | Python | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_mitochondrial_variants.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_mitochondrial_variants.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_mitochondrial_variants.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | import hail as hl
from data_pipeline.data_types.locus import normalized_contig
from data_pipeline.data_types.variant import variant_id
FILTER_NAMES = hl.dict(
{"artifact_prone_site": "Artifact-prone site", "indel_stack": "Indel stack", "npg": "No passing genotype"}
)
def nullify_nan(value):
return hl.cond(... | 39.904762 | 120 | 0.612371 |
8f119e3c0c21027840600c46fd0d8ae165bf9d6a | 608 | py | Python | src/models/Xu2017/xunet.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/models/Xu2017/xunet.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/models/Xu2017/xunet.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null | import torch
if torch.cuda.is_available():
import torch.cuda as t
else:
import torch as t
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
class XuNet(nn.Module):
def __... | 18.424242 | 51 | 0.695724 |
56cc99bfea41129c2839a66a85a427d3669c3802 | 481 | py | Python | fastapi/tutorial-1-1-hello-world/main.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | fastapi/tutorial-1-1-hello-world/main.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | fastapi/tutorial-1-1-hello-world/main.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | # https://fastapi.tiangolo.com/tutorial/first-steps/
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def hello():
return {"message": "Hello World."}
# start server (development)
# uvicorn main:app --port=3000 --reload
# main the file main.py (the Python "module").
# app the object created ... | 25.315789 | 79 | 0.675676 |
853811a717be555652eccf742e29eb19b5f2b018 | 1,401 | py | Python | LDA/ldabuilder.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | 1 | 2018-05-14T10:02:54.000Z | 2018-05-14T10:02:54.000Z | LDA/ldabuilder.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | null | null | null | LDA/ldabuilder.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from nltk.tokenize import RegexpTokenizer
from stop_words import get_stop_words
from nltk.stem.porter import PorterStemmer
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')
from gensim import corpora, models
tokenizer = RegexpTokenizer(r'\w+')
# ... | 35.923077 | 99 | 0.726624 |
85714ad514fb15529cab15c260668eb3922be556 | 2,847 | py | Python | Cmap-main/maple.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Cmap-main/maple.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Cmap-main/maple.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from barnum import gen_data
from time import sleep
import names
import random
import stri... | 45.190476 | 174 | 0.724622 |
77615e0a660848692c085977472edda68d94cd25 | 536 | py | Python | reports/sep/code/crop_test.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2020-04-17T12:27:06.000Z | 2020-04-17T12:27:06.000Z | reports/sep/code/crop_test.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2022-02-27T13:13:17.000Z | 2022-02-27T13:13:17.000Z | reports/sep/code/crop_test.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | null | null | null | from os.path import join
import tensorflow as tf
import cv2
path = join('data', 'sep_interim_04', '0_0_3.png')
blob = tf.io.read_file(path)
blob = tf.image.decode_jpeg(blob, channels=1)
blob = tf.image.convert_image_dtype(blob, tf.float32)
blob = tf.image.resize_with_pad(blob, 360, 360)
blob = tf.expand_dims(blob, ax... | 25.52381 | 53 | 0.735075 |
3b87279fa78fd9e09eac5841d9cada00bbd6448d | 1,922 | py | Python | src/onegov/file/models/fileset.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/models/fileset.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/models/fileset.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.crypto import random_token
from onegov.core.orm import Base
from onegov.core.orm.mixins import ContentMixin, TimestampMixin
from sqlalchemy import Column, ForeignKey, Table, Text
from sqlalchemy.orm import relationship
# many to many relationship between File and FileSets
file_to_set_associations = T... | 34.945455 | 78 | 0.711238 |
8e7b14a0620914b53c9d3b30e7ebd411ed07aafa | 83 | py | Python | examples/nowcoder/SQL3/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/nowcoder/SQL3/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/nowcoder/SQL3/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.apps import AppConfig
class Sql3Config(AppConfig):
name = 'SQL3'
| 13.833333 | 33 | 0.73494 |
8eb4ada13ce8580321caaab13075bf1114ac9a45 | 395 | py | Python | babelbox/utils.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | 2 | 2021-03-18T04:34:23.000Z | 2021-03-23T17:35:07.000Z | babelbox/utils.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | null | null | null | babelbox/utils.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
def relative_path_to(file: Path, dir: Path, path_delimiter=".") -> str:
parts = list(file.relative_to(dir).parts)
parts[-1] = parts[-1][: -len(file.suffix)]
return path_delimiter.join(parts)
def files_in_dir(dir: Path):
for dirname, _, filenames in os.walk(dir):
... | 26.333333 | 71 | 0.670886 |
797609c90e1dc8aa3d3a7cd4ff3f35b4e2ffbcd4 | 1,581 | py | Python | research/hpc/molecular_dynamics/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/molecular_dynamics/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/molecular_dynamics/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.265306 | 78 | 0.691335 |
ebe839ac7b14209b37e5fa7abcf2176b770b50c6 | 2,203 | py | Python | src/visitpy/visit_utils/src/builtin/apropos.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_utils/src/builtin/apropos.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_utils/src/builtin/apropos.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import re, sys
from pydoc import help as python_help
try:
import visit
except:
pass
#
# Define an override for standard python `help` method
# It calls normal python help but also returns an apropos
# result if it would be useful.
#
def visit_help(thing):
try:
python_help(thing)
except:
... | 31.028169 | 109 | 0.622333 |
cce8509a1ca69201e828588f1dc8919175395929 | 243 | py | Python | tests/test_root.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/test_root.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/test_root.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from tests.seeder import Seeder
from tests.utils import UtilActions
def test_root(client, seeder: Seeder, utils: UtilActions):
utils.get_endpoint_ok("frontend.index")
utils.get_endpoint_ok("serve_file_in_dir", path="city-solid.png")
| 30.375 | 69 | 0.781893 |
ba9897370577eb32479b7559368f4fd4a996d960 | 1,438 | py | Python | python/oneflow/test/graph/test_graph_arange.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/test/graph/test_graph_arange.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/test/graph/test_graph_arange.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 31.26087 | 88 | 0.706537 |
306b4710bde07a2642756327caf330886d8b424a | 5,379 | py | Python | back-end/src/analysis/NeuralNet/655/nn_reducer.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/NeuralNet/655/nn_reducer.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/NeuralNet/655/nn_reducer.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Adapted from an example by Michael G. Noll at:
#
# http://www.michael-noll.com/wiki/Writing_An_Hadoop_MapReduce_Program_In_Python
#
from __future__ import with_statement
from operator import itemgetter
import sys
import re
writerow=list()
for line in sys.stdin:
line = line.strip()
da... | 27.584615 | 162 | 0.622421 |
88e0582bf09611aec10caae08437d5f4ea21161b | 1,325 | py | Python | src/video_transcoding/migrations/0003_auto_20200525_1130.py | serzh-unknown/django-video-transcoding | a9048a83ff71e214a215f271d8809f98c1db44b0 | [
"MIT"
] | 21 | 2020-02-07T17:40:16.000Z | 2021-09-02T18:56:21.000Z | src/video_transcoding/migrations/0003_auto_20200525_1130.py | serzh-unknown/django-video-transcoding | a9048a83ff71e214a215f271d8809f98c1db44b0 | [
"MIT"
] | 184 | 2020-02-09T10:46:17.000Z | 2022-03-28T00:53:04.000Z | src/video_transcoding/migrations/0003_auto_20200525_1130.py | serzh-unknown/django-video-transcoding | a9048a83ff71e214a215f271d8809f98c1db44b0 | [
"MIT"
] | 6 | 2020-02-07T13:58:33.000Z | 2021-07-27T16:24:56.000Z | # Generated by Django 3.0.6 on 2020-05-25 11:30
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video_transcoding', '0002_auto_20200226_0919'),
]
operations = [
migrations.AlterField(
model_name... | 33.125 | 161 | 0.582642 |
cc78803e87ad9be6703e70d946181b5051e9b329 | 391 | py | Python | ISTp/2014/GOMAN_D_V/task_5_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/GOMAN_D_V/task_5_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/GOMAN_D_V/task_5_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5. Вариант 45
# Напишите программу, которая бы при запуске случайным образом отображала имя
# одного из четырех черепашек-ниндзя.
# Goman D.V.
# 29.03.2016
import random
n = random.randint(1,4)
if n == 1:
name = 'Леонардо.'
elif n == 2:
name = 'Рафаэля.'
elif n == 3:
name = 'Донателло.'
else:
... | 20.578947 | 77 | 0.664962 |
4e11c362cb249fda71a71d5c7dcc2d30201b3846 | 660 | py | Python | praefix-test.py | effjot/stiefogen | da149f22912fa3b31fc2660ff01e4e0ca08d5efe | [
"MIT"
] | 14 | 2015-04-30T08:50:53.000Z | 2021-08-23T13:58:12.000Z | praefix-test.py | effjot/stiefogen | da149f22912fa3b31fc2660ff01e4e0ca08d5efe | [
"MIT"
] | 4 | 2020-08-28T20:45:47.000Z | 2021-04-06T21:56:25.000Z | praefix-test.py | effjot/stiefogen | da149f22912fa3b31fc2660ff01e4e0ca08d5efe | [
"MIT"
] | 5 | 2015-05-01T06:40:40.000Z | 2019-12-12T22:17:29.000Z | import os
import stiefo
filenamebase = "praefix-test"
wlist = stiefo.wordlist()
#wlist.load("Wortlisten/wortliste-aufbauschrift-1.txt")
if os.path.isfile(filenamebase + '.wrd'):
wlist.load(filenamebase + '.wrd')
with open(filenamebase + '.txt', "r", encoding="utf-8") as f:
text = f.read()
s... | 24.444444 | 62 | 0.684848 |
4e2fb05d9c8f9f05ba20e1db4ca0ebe620ecbb1e | 779 | py | Python | 0020validParentheses.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0020validParentheses.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0020validParentheses.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Solution:
def isValid(self, s: str) -> bool:
leftPa = '([{'
rightPa = ')]}'
pre = list()
for c in s:
if c in leftPa:
pre.append(c)
if c in rightPa:
if 0 == len(pre):
... | 22.911765 | 55 | 0.356868 |
d17bc96a5b7806c623f8ee967e6fd1e41be4b1ea | 7,424 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_04_Standarddatentypen/01_datentypen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_04_Standarddatentypen/01_datentypen.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_04_Standarddatentypen/01_datentypen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 01_datentypen.py
# Project: Kapitel_04_Standarddatentypen
# Created Date: Friday 22.02.2019, 20:25
# Author: Apop85
# -----
# Last Modified: Saturday 23.02.2019, 14:51
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MIT license.
# Chec... | 100.324324 | 406 | 0.773438 |
ee76eea4763470e2097b9c96353d7c83cd338090 | 1,497 | py | Python | algorithms/graph_theory/bfs.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/graph_theory/bfs.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/graph_theory/bfs.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | import heapq
def first_imp():
import heapq
for i in range(int(input())):
V, E = map(int, input().split())
edge = [[] for _ in range(V)]
for _ in range(E):
fr, to = map(lambda x: int(x) - 1, input().split())
edge[fr].append(to)
edge[to].append(fr)
... | 33.266667 | 70 | 0.501002 |
c9e71474cb5d1a8f49afac6402d97d21995ed40b | 5,262 | py | Python | CGR/T2/snowman.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | CGR/T2/snowman.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | CGR/T2/snowman.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from colors import *
from shapes import SolidCylinder
angle_h = 300.0
angle_v = 0
spin = True
turn_h = 1
turn_v = 0
render_quality = 100 # max = 100
def keyboard(key, x, y):
global spin, turn_h, turn_v, angle_h, angle_v, render_quality
... | 23.078947 | 65 | 0.645952 |
090b6c710b8e079f0c89155e046df07319ddd1ff | 13,231 | py | Python | app/main.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/main.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/main.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | import json
import traceback
from json import JSONDecodeError
from spotifyAPI import SpotifyAPI
from soundcloudAPI import SoundcloudAPI
from downloader import Downloader
import os
import threading
import PySimpleGUI as sg
import logging
from sys import exit
LOG_FORMAT = "%(levelname)s %(asctime)s - %(message)s"
loggi... | 36.150273 | 134 | 0.51795 |
6df6c3b8e5c87f3b7ead7e2dbf5df0d431c549b1 | 795 | py | Python | UIUCTF/2021/crypto/dhke_intro/dhkectf_intro.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | UIUCTF/2021/crypto/dhke_intro/dhkectf_intro.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | UIUCTF/2021/crypto/dhke_intro/dhkectf_intro.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import random
from Crypto.Cipher import AES
# generate key
gpList = [ [13, 19], [7, 17], [3, 31], [13, 19], [17, 23], [2, 29] ]
g, p = random.choice(gpList)
a = random.randint(1, p)
b = random.randint(1, p)
k = pow(g, a * b, p)
k = str(k)
# print("Diffie-Hellman key exchange outputs")
# print("Public key: ", g, p)
# ... | 22.083333 | 68 | 0.612579 |
61e720627ae6817b4f475da8e038dd9541b99961 | 1,962 | py | Python | quant/markets/_kraken.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/markets/_kraken.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/markets/_kraken.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 quant.api.kraken import PublicClient
import market_util
from .market import Market
class Kraken(Market):
"""XBT就是BTC"""
def __init__(self, pair_code):
base_currency, market_currency = self.get_available_pairs(pair_code)
super(Kraken, self)._... | 32.7 | 86 | 0.585627 |
111e49614c7e0da6a590c5fa35b64da0697d5bc9 | 11,601 | py | Python | research/cv/rcnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/rcnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/rcnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.593857 | 102 | 0.588484 |
28f3f35c7782fb0e8d4c7ddb859e05e5786e4a18 | 4,955 | py | Python | test/test_npu/test_network_ops/test_slow_conv_transpose2d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_slow_conv_transpose2d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_slow_conv_transpose2d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 44.241071 | 97 | 0.647225 |
3a6e811f8df557e65a288720fda10fe8bde4215b | 1,238 | py | Python | Prototype/main prototype/Exporter.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/Exporter.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/Exporter.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | class Exporter:
def __init__(self, tab):
self.tab = tab
def export(self, filename):
data = ""
data += "name: " + self.tab.name + "\n"
data += "rright: " + str(self.tab.rright) + "\n"
data += "rleft: " + str(self.tab.rleft) + "\n"
data += "rsum: " + str(self.tab.r... | 35.371429 | 56 | 0.444265 |
c94e239cf991671f443fa875794c93806a0bc92e | 1,334 | py | Python | Project Euler Qusetions 61 - 70/Project Euler Question 67.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 61 - 70/Project Euler Question 67.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 61 - 70/Project Euler Question 67.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 67
#Maximum path sum II
with open("C:\\Users\\Clayton\\Documents\\Python Other Files\\p067_triangle.txt") as tri_file:
content = tri_file.read()
grid = content
grid = [(row.split(" ")) for row in grid.split("\n")]
grid.pop(-1)
for row in grid:
for term in row:
intterm = int(te... | 22.610169 | 94 | 0.558471 |
a3358c43b8ee8face137e018ea19fb254f67da2c | 1,756 | py | Python | research/nlp/atae_lstm/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/atae_lstm/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/atae_lstm/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.361702 | 85 | 0.658314 |
6e28c3c87516a746601cc20a0062ba8666559a44 | 1,422 | py | Python | Code/chap8.py | CPEGM/Swinnen-2012 | ce6a2621cc66ec7818abe4e4cb2b6cff1d6e151b | [
"CC0-1.0"
] | null | null | null | Code/chap8.py | CPEGM/Swinnen-2012 | ce6a2621cc66ec7818abe4e4cb2b6cff1d6e151b | [
"CC0-1.0"
] | null | null | null | Code/chap8.py | CPEGM/Swinnen-2012 | ce6a2621cc66ec7818abe4e4cb2b6cff1d6e151b | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 1 20:16:49 2018
@author: CPEGM
"""
# Petites corrections par rapport au programme donné dans le livre
import tkinter as tk
from random import randrange
def drawline():
" Tracé d'une ligne dans le canvas 1"
global x1, y1, x2, y2, coul
can1.create_line(x1, y1,... | 26.333333 | 78 | 0.66526 |
281e168852773364704d259c14a799183abbbbf5 | 7,699 | py | Python | src/onegov/fsi/models/course_attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/models/course_attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/models/course_attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.types import UUID, JSON
from sqlalchemy import Boolean
from onegov.search import ORMSearchable
from sedate import utcnow
from sqlalchemy import Column, Text, ForeignKey, ARRAY, desc
from sqlalchemy.orm import relationship, object_session, backref
from uuid import uu... | 33.767544 | 79 | 0.657228 |
25370ec03cd633fa71dabe70dbcbfe5b570a038b | 4,058 | py | Python | site/public/courses/CS-1.2/Code/hashtable.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/Code/hashtable.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/Code/hashtable.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | #!python
from linkedlist import LinkedList
class HashTable(object):
def __init__(self, init_size=8):
"""Initialize this hash table with the given initial size."""
# Create a new list (used as fixed-size array) of empty linked lists
self.buckets = []
for i in range(init... | 41.835052 | 78 | 0.60621 |
6c30c47212863fd1e12586cc41f5aeb94e97e0ea | 686 | py | Python | app/__init__.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | app/__init__.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | app/__init__.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_moment import Moment
import os
app = Flask(__name__)
app.config.from_object(Config)
bootstrap = Bootstrap(app)
db = SQLAlchemy(app)
login = L... | 24.5 | 65 | 0.782799 |
6c5a6f0bc14d59392adbc170f72fff3aac0c75f4 | 237 | py | Python | packages/watchmen-model/src/watchmen_model/pipeline_kernel/pipeline_monitor_pipelines.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/pipeline_kernel/pipeline_monitor_pipelines.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/pipeline_kernel/pipeline_monitor_pipelines.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List
from watchmen_model.admin import Pipeline, Topic
# noinspection PyUnusedLocal
def ask_pipeline_monitor_pipelines(topics: List[Topic]) -> List[Pipeline]:
# TODO define all pipeline monitor pipelines
return []
| 23.7 | 74 | 0.801688 |
6679bffae5c3faad1792f3223cc843602000a081 | 548 | py | Python | data/episode08/hmm_tiger.py | AkademieOlympia/nlp-mit-python | 39b36c65bf7e0fc9e3bc0388e0250732b909c689 | [
"CC-BY-4.0"
] | 2 | 2020-03-03T09:40:24.000Z | 2020-04-09T07:23:59.000Z | data/episode08/hmm_tiger.py | AkademieOlympia/nlp-mit-python | 39b36c65bf7e0fc9e3bc0388e0250732b909c689 | [
"CC-BY-4.0"
] | null | null | null | data/episode08/hmm_tiger.py | AkademieOlympia/nlp-mit-python | 39b36c65bf7e0fc9e3bc0388e0250732b909c689 | [
"CC-BY-4.0"
] | 1 | 2022-01-31T13:07:09.000Z | 2022-01-31T13:07:09.000Z | import nltk
import nltk.tag.hmm as hmm
gold_corpus = nltk.corpus.ConllCorpusReader('.', 'tiger.conll09',
['ignore', 'words', 'ignore', 'ignore', 'pos'],
encoding='utf-8')
# Lege einen neues HMM Trainings-Objekt mit Standard-Parametern an
trainer... | 42.153846 | 84 | 0.627737 |
66ac3feced0e80aa686104cd655da290d01783a4 | 2,715 | py | Python | DTCWaveletPic.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-03-28T11:50:45.000Z | 2020-12-08T13:36:26.000Z | DTCWaveletPic.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-04-20T11:12:59.000Z | 2020-05-11T05:37:36.000Z | DTCWaveletPic.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | null | null | null | from IProcess import IProcess, EDataType
from PIL import Image
import dtcwt
import numpy as np
import math
from dtcwt.utils import asfarray
import warnings
class DTCWaveletPic(IProcess):
def __init__(self, level=1):
IProcess.__init__(self)
self.waveletLevel = level
self.waveletLevelMax = level
pass
def g... | 29.51087 | 104 | 0.686556 |
b00b99551718c4183a636bcc22cf0f9f04f2fbc2 | 558 | py | Python | project/forms/common.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/forms/common.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/forms/common.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from flask_babelex import lazy_gettext
from markupsafe import Markup
def get_accept_tos_markup():
tos_open = '<a href="/impressum">'
tos_close = "</a>"
privacy_open = '<a href="/datenschutz">'
privacy_close = "</a>"
return Markup(
lazy_gettext(
"I read and accept %(tos_open)s... | 26.571429 | 120 | 0.629032 |
af3bcad2b609ef21aa692bcdd54351c4d9c5d7f9 | 1,909 | py | Python | django_project/apps/qfauth/management/commands/init_group.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | django_project/apps/qfauth/management/commands/init_group.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | django_project/apps/qfauth/management/commands/init_group.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group,Permission,ContentType
from apps.news.models import News,NewsCategory,Banner,Comment
from apps.course.models import Course,CourseCategory,Teacher
from apps.course.models import CourseOrder
class Command(BaseCommand):
... | 39.770833 | 98 | 0.698795 |
af67d5fb34bae94c167035864f6cb4be15e9ba73 | 387 | py | Python | divvydash/dashboard/migrations/0003_auto_20200409_2202.py | Sawyer-Middeleer/divvy-dash | 5ef1738d47516949f7288b56b5c92a5c7d1d9d42 | [
"MIT"
] | null | null | null | divvydash/dashboard/migrations/0003_auto_20200409_2202.py | Sawyer-Middeleer/divvy-dash | 5ef1738d47516949f7288b56b5c92a5c7d1d9d42 | [
"MIT"
] | 5 | 2020-06-06T01:45:31.000Z | 2021-06-10T19:59:14.000Z | divvydash/dashboard/migrations/0003_auto_20200409_2202.py | Sawyer-Middeleer/divvy-dash | 5ef1738d47516949f7288b56b5c92a5c7d1d9d42 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2020-04-10 03:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0002_auto_20200409_2152'),
]
operations = [
migrations.AlterField(
model_name='station',
name='last_rep... | 20.368421 | 49 | 0.602067 |
a52587035967a053ae483f5a091389af45c7f0bf | 2,274 | py | Python | test.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | test.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | test.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | from mumath import MuMath
from mumath.markdown import MuMark, InlineMuMark
import argparse
from pathlib import Path
parser = argparse.ArgumentParser()
parser.add_argument("--markdown", help="Run markdown tests", action="store_true")
args = parser.parse_args()
tests = Path(__file__).parent / "cases.tex"
tests = test... | 23.204082 | 81 | 0.562885 |
3cde7affb05a526eed129ead4a34273c920aee64 | 4,509 | py | Python | src/tools/data/DataManualExamples/Simulations/extract.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/data/DataManualExamples/Simulations/extract.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/data/DataManualExamples/Simulations/extract.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | extract_options_exportFormat = "FieldViewXDB_1.0"
extract_options_writeUsingGroups = 0;
extract_options_writeGroupSize = 1;
def extract_set_options(fmt, writeUsingGroups, groupSize):
extract_options_exportFormat = fmt
extract_options_writeUsingGroups = writeUsingGroups
extract_options_writeGroupSize = grou... | 31.978723 | 94 | 0.613218 |
abeb62e79c57744357c520d657a939473bb4662c | 1,179 | py | Python | py/inter_review.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | py/inter_review.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | py/inter_review.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
import ask_util
import json
import os, sys
import re
import requests
import time
class ParkReview:
def get(self,prdNo):
url = 'http://mbook.interpark.com/api/my/review/shortReviewList?sc.prdNo=%s&sc.page=1&sc.row=20' % prdNo
res = requests.get(url)
#print(res.text)
jsonD... | 25.085106 | 109 | 0.621713 |
057982a263b662d6600eacc195638e9f1bd3cc40 | 409 | py | Python | Projekteuler/Loesungen/projecteuler_aufgabe003_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | Projekteuler/Loesungen/projecteuler_aufgabe003_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | Projekteuler/Loesungen/projecteuler_aufgabe003_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | """
Aufgabe 3 aus http://projecteuler.net
(Deutsche Übersetzung auf http://projekteuler.de)
Größter Primfaktor
Die Primfaktoren von 13195 sind 5, 7, 13 und 29.
Was ist der größte Primfaktor der Zahl 600851475143?
"""
zahl = 600851475143
faktor = 2
while faktor <= zahl:
if zahl%faktor == 0:
zahl //= fa... | 17.041667 | 52 | 0.679707 |
e9c6d772a1245a6c699925a0e33c65d621118ae8 | 994 | py | Python | INBa/2015/Kishukov_N/task_7_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Kishukov_N/task_7_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Kishukov_N/task_7_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 10
# 1-50. Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
# Кишуков Назир
# 16.04.2016
import random
print("Компьютер загадал название одного из девяти вокзалов Москвы, а Вы должны его угадать.... | 23.116279 | 181 | 0.701207 |
f9397f62ea553fe4bd44a0925e7e91d9cdcca4c4 | 189 | py | Python | fabfile.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | fabfile.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | fabfile.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import local
def install():
local('pip install flask') # flask web开发库
local('pip install arrow') # arrow python时间库
| 21 | 49 | 0.656085 |
dde5e6348ac389e017265de6d6d68020f3d33a0c | 2,386 | py | Python | fg/tournaments/models.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | fg/tournaments/models.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | fg/tournaments/models.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | from django.db import models
from bs4 import BeautifulSoup
import requests
class Player(models.Model):
name = models.CharField(max_length=200, unique=True)
class Meta:
ordering = ['name']
def __str__(self):
return self.name
class Person(models.Model):
name = models.CharField(max_le... | 34.085714 | 195 | 0.703269 |
9b2fc315c99c045f32de14f4448479b2b9cc4e48 | 2,177 | py | Python | code/gestures/screen.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/gestures/screen.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/gestures/screen.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | import os
import tkinter as tk
import time
from threading import Thread
from config import config
class Screen:
def __init__(self, initial_picture="init.gif"):
"""
init the class and shows the window default image configurable
"""
self.imgPath = os.path.join(config.PICTUREPATH, in... | 30.236111 | 72 | 0.610932 |
fd61747b6c94e4169807d92b158bd90951bdf23f | 599 | py | Python | DataStructures/LinkedList/Compare.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/LinkedList/Compare.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/LinkedList/Compare.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def CompareLists(headA, headB):
mark = 1
while headA or headB:
A_data = headA.data if headA else None
B_data = headB.data if headB else None
if A_data != B_data:
mark = 0
break
headA = headA.next
headB = headB.next
return mark
... | 23.038462 | 49 | 0.579299 |
1f1684a4909637fae25bae5f6e502329bbd6c64e | 49,023 | py | Python | deutschland/autobahn/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/autobahn/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/autobahn/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Autobahn App API
Was passiert auf Deutschlands Bundesstraßen? API für aktuelle Verwaltungsdaten zu Baustellen, Staus und Ladestationen. Außerdem Zugang zu Verkehrsüberwachungskameras und vielen weiteren Datensätzen. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://op... | 40.954887 | 217 | 0.537217 |
85ec828707c7b469338114db84cdd71701eb6868 | 9,092 | py | Python | year_3/comppi_1/core/forms.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_1/core/forms.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_1/core/forms.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from django import forms
from puborgs.modelschoices import locations, orgadditional, reports
class LogInForm(forms.Form):
username = forms.CharField(
label="Кодове ім'я",
max_length=255,
help_text="Username співробітника"
)
password = forms.CharField(
label="Пароль",
... | 28.148607 | 114 | 0.630994 |
238ad93bf4afa925c1e63493ae9bb7d39160236d | 1,150 | py | Python | Misc/HiveMaker/solution_1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Misc/HiveMaker/solution_1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Misc/HiveMaker/solution_1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # The idea is that except if we have less than 11 sticks where the solution is trivial
# in every other case we create as much pairs of hexagons as possible. The addition of
# two pairs provides the best solution and also return to us 3 sticks. We repeat until
# no new pairs can be created. Then with less than 11 stick... | 28.04878 | 86 | 0.604348 |
7b0507bc07077dcf6602865c007b3ecedd81369b | 1,264 | py | Python | frontend/infra/provision/s3.py | jim-hill-r/BlueSteel | fa3ac479096679146b99bf5b12792fad25d9d0f1 | [
"MIT"
] | 2 | 2020-04-03T12:19:00.000Z | 2020-04-03T13:32:11.000Z | frontend/infra/provision/s3.py | jim-hill-r/BlueSteel | fa3ac479096679146b99bf5b12792fad25d9d0f1 | [
"MIT"
] | 25 | 2020-04-23T23:17:20.000Z | 2020-05-29T21:00:44.000Z | frontend/infra/provision/s3.py | jim-hill-r/BlueSteel | fa3ac479096679146b99bf5b12792fad25d9d0f1 | [
"MIT"
] | null | null | null | import json
try:
import boto3
except ImportError:
print(f'Error: boto3 is required. Please install.')
print(f'Try: pip install boto3')
def provision(bucket, region):
s3 = boto3.client('s3', region_name=region)
print ('Creating app s3 bucket...')
try:
location = {'LocationConstraint': reg... | 28.088889 | 83 | 0.625 |
7bc30f3a9260b5be8fae12878130d9dbf942a378 | 3,369 | py | Python | src/onegov/fsi/collections/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/collections/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/collections/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from sqlalchemy import or_
from onegov.core.collection import Pagination, GenericCollection
from onegov.fsi.models.course_attendee import CourseAttendee
from onegov.user import User
class CourseAttendeeCollection(GenericCollection, Pagination):
def __init__(self, session,
page=0,
... | 30.627273 | 73 | 0.59721 |
cde78f91d32c9e6abfeca17ce0dda429ece95468 | 559 | py | Python | robolib/util/intermediate.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/util/intermediate.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/util/intermediate.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import numpy as np
import os
INTERMEDIATE_FILE_EXTENSION = ".interm"
def save_intermediate(intermediate, path):
if not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.dirname(path))
file = open(path, 'wb')
np.save(file, intermediate)
def load_intermediate(path):
file = open(path, ... | 25.409091 | 72 | 0.699463 |
f5786263037d3c947a3bb6282101827ffa847340 | 92 | py | Python | 2014/06/table-chocolate-fertility/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/06/table-chocolate-fertility/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/06/table-chocolate-fertility/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1bXN0tL0yIpXf_jNvxUVcx6wYtMk_lB3HaPZ-tGlB1nQ'
| 23 | 68 | 0.836957 |
fdbd7678558fc90de76dc899c39f6f171b1877c6 | 321 | py | Python | adzuki/utils.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | adzuki/utils.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | 5 | 2019-03-19T22:21:28.000Z | 2020-09-16T03:08:56.000Z | adzuki/utils.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | from google.cloud.datastore.entity import Entity
def entity2dict(subject):
if isinstance(subject, Entity):
dictioniarized = dict(subject)
return { k: entity2dict(v) for k, v in dictioniarized.items() }
elif isinstance(subject, list):
return [ entity2dict(v) for v in subject ]
else:
return subject... | 29.181818 | 67 | 0.719626 |
e30e3b90c602d6ca28a43b4117755812715a0628 | 32,359 | py | Python | tests/onegov/election_day/formats/election/test_wabstic_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_wabstic_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_wabstic_majorz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from io import BytesIO
from onegov.ballot import Election
from onegov.election_day.formats import import_election_wabstic_majorz
from onegov.election_day.models import Canton
from tests.onegov.election_day.common import print_errors
def test_import_wabstic_majorz_1(session, import_test_data... | 32.985729 | 78 | 0.310331 |
8b5370751c5813ac37392f9d3faf650cd38eefaf | 286 | py | Python | aemter/tests/test_apps.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/aemter/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/aemter/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.apps import apps
from django.test import TestCase
from aemter.apps import AemterConfig
class ReportsConfigTest(TestCase):
def test_apps(self):
self.assertEqual(AemterConfig.name, 'aemter')
self.assertEqual(apps.get_app_config('aemter').name, 'aemter')
| 28.6 | 70 | 0.755245 |
8b774a779e92e311db2d0f8837757ccc1fdd6555 | 2,539 | py | Python | yolov5-coreml-tflite-converter/tflite/tf_utils/parameters.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_utils/parameters.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_utils/parameters.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | from constants import DEFAULT_INPUT_RESOLUTION, DEFAULT_SOURCE_DATASET, DEFAULT_NB_CALIBRATION, \
DEFAULT_MAX_NUMBER_DETECTION, FLOAT32, FLOAT16, INT8, \
FULLINT8, BAHNHOF, WAGEN, TRAKTION, TFLITE, SAVED_MODEL, PADDED, SIMPLE, COMBINED
class ModelParameters:
'''
Parameters used for the model
'''
... | 38.469697 | 146 | 0.634502 |
9a0145efb73472b14da217264f5d488721b58219 | 299 | py | Python | src/onegov/swissvotes/fields/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/fields/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/fields/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.swissvotes.fields.dataset import SwissvoteDatasetField
from onegov.swissvotes.fields.metadata import SwissvoteMetadataField
from onegov.swissvotes.fields.policy_area import PolicyAreaField
__all__ = (
'PolicyAreaField',
'SwissvoteDatasetField',
'SwissvoteMetadataField',
)
| 27.181818 | 68 | 0.819398 |
d06c3c6f4038dd4f61feae75a7ffcc248d923914 | 1,964 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/docs/tutorial/manhattan/runner.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | Co-Simulation/Sumo/sumo-1.7.0/docs/tutorial/manhattan/runner.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | Co-Simulation/Sumo/sumo-1.7.0/docs/tutorial/manhattan/runner.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 38.509804 | 92 | 0.703157 |
eff2c8c11caf72a7d88d87c1351758dc8b449676 | 3,296 | py | Python | basic/19-brownie/Brownie/tests/exchange/test_token_to_eth.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 634 | 2021-06-28T15:48:19.000Z | 2021-12-19T08:33:57.000Z | basic/19-brownie/Brownie/tests/exchange/test_token_to_eth.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 73 | 2021-07-04T03:53:57.000Z | 2021-12-18T06:17:13.000Z | basic/19-brownie/Brownie/tests/exchange/test_token_to_eth.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 263 | 2021-06-28T15:26:56.000Z | 2021-12-19T08:14:37.000Z | from brownie import accounts
import brownie
def test_token_to_eth_swap(w3, HAY_token, hay_token_exchange):
HAY_token.approve(hay_token_exchange, 10 * 10 ** 18, {"from": accounts[0]})
# step 1: initialize exchange
hay_token_exchange.initializeExchange(10 * 10 ** 18, {"from": accounts[0], "amount": 5 * 10 ... | 47.768116 | 103 | 0.692658 |
721224fa68239d413b4a8bce0d26ebee44e4bebd | 7,736 | py | Python | bigbench/benchmark_tasks/chess_state_tracking/scripts/generate_tasks.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 460 | 2021-01-26T21:23:37.000Z | 2022-03-31T15:55:10.000Z | bigbench/benchmark_tasks/chess_state_tracking/scripts/generate_tasks.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 475 | 2021-01-27T01:29:01.000Z | 2022-03-30T20:23:56.000Z | bigbench/benchmark_tasks/chess_state_tracking/scripts/generate_tasks.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 305 | 2021-01-26T23:28:11.000Z | 2022-03-31T14:51:26.000Z | import argparse
import random
import os
import chess
import json
from os import path
from collections import OrderedDict
from typing import List
PREFIX_SIZE_TO_RANGE = {'short': (1, 50), 'medium': (51, 100), 'long': (101, 200)}
def get_info_from_game_prefix(uci_prefix):
piece_type_list = []
board = chess.B... | 37.921569 | 110 | 0.6356 |
7231f7eca900a591d73bb4ba0b4e81c1cd0e5f2e | 3,305 | py | Python | gtsrb_image_database_loader.py | 1kastner/einfuehrung-in-datenauswertung | 654a1be1fed0fcc063ad4938382930494ef04b25 | [
"MIT"
] | null | null | null | gtsrb_image_database_loader.py | 1kastner/einfuehrung-in-datenauswertung | 654a1be1fed0fcc063ad4938382930494ef04b25 | [
"MIT"
] | null | null | null | gtsrb_image_database_loader.py | 1kastner/einfuehrung-in-datenauswertung | 654a1be1fed0fcc063ad4938382930494ef04b25 | [
"MIT"
] | null | null | null | """
Loads the GTSRB database from the hard drive.
This is not relevant for any grading.
"""
import os
import pandas as pd
def load_traffic_sign_database(path_to_directory):
"""
:param path_to_directory: Points to the root directory of the traffic sign folder structure (including the Readme.md)
:return... | 33.72449 | 121 | 0.583056 |
dfa1788c6887b614e38aef093e1eb0b27bc7c67b | 3,548 | py | Python | Packs/QRadar/Scripts/QRadarGetOffenseCorrelations/QRadarGetOffenseCorrelations.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/QRadar/Scripts/QRadarGetOffenseCorrelations/QRadarGetOffenseCorrelations.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/QRadar/Scripts/QRadarGetOffenseCorrelations/QRadarGetOffenseCorrelations.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
def get_query(cre_name_null):
if cre_name_null == "False":
query = "SELECT *,\"CRE Name\",\"CRE Description\",CATEGORYNAME(highlevelcategory) " \
"FROM events WHERE \"CRE NAME\" <> NULL AND INOFFENSE({0}) START '{1}'"
else:... | 38.989011 | 113 | 0.5854 |
5f23b4fd39f18bb6bbcb802e0bf63e7790e79e13 | 426 | py | Python | prices/serializers.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T13:06:11.000Z | 2021-06-23T13:06:11.000Z | prices/serializers.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T21:21:52.000Z | 2021-06-23T21:21:52.000Z | prices/serializers.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T19:14:19.000Z | 2021-06-28T19:14:19.000Z | from rest_framework.serializers import ModelSerializer
from prices.models import IdDB
class PricesSerializer(ModelSerializer):
class Meta:
model = IdDB
fields = [
'kinopoisk_id',
'title',
'title_en',
'year',
'price'
]
loo... | 21.3 | 54 | 0.528169 |
cd45bac90e71cf629caf011a70c189dc9cbf7756 | 1,269 | py | Python | sqlalchemy/orm/orm_example.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | sqlalchemy/orm/orm_example.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | sqlalchemy/orm/orm_example.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import sqlalchemy
import sqlalchemy.ext.declarative
import sqlalchemy.orm
# Global Setup
user = "postgres"
password = "python"
host = "localhost"
port = 5432
db = "postgres"
url = 'postgresql://{}:{}@{}:{}/{}'
db_string = url.format(user, password, host, port, db)
db = sqlalchemy.create_engine... | 23.072727 | 73 | 0.687155 |
cd980637ea6278ae90fbf28d6dc1f55fd6c1f34d | 516 | py | Python | pacman-arch/test/pacman/tests/sync1003.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/sync1003.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/sync1003.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Induced removal would break dependency"
sp1 = pmpkg("pkg1", "1.0-2")
sp1.replaces = [ "pkg2" ]
self.addpkg2db("sync", sp1)
lp2 = pmpkg("pkg2", "1.0-1")
self.addpkg2db("local", lp2)
lp3 = pmpkg("pkg3", "1.0-1")
lp3.depends = [ "pkg2=1.0" ]
self.addpkg2db("local", lp3)
self.args = "-Su"
self.addr... | 23.454545 | 59 | 0.684109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.