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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bc9645f4fba958ecaf76b9218eab27b9f06f45ab | 726 | py | Python | exercises/es/test_02_05_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_02_05_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_02_05_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"from spacy.tokens import Doc" in __solution__
), "¿Estás importando la clase Doc correctamente?"
assert len(words) == 6, "Parece que tienes el número incorrecto de palabras."
assert len(spaces) == 6, "Parece que tienes el número incorrecto de espacios."
assert words == ... | 60.5 | 93 | 0.651515 |
e67034e08f4bd2fd41741493b607eeccc205135e | 7,925 | py | Python | magic_formula.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | magic_formula.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | magic_formula.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | # ============================================================================
# Greenblatt's Magic Formula Implementation
# Author - Mayank Rasu
# Please report bugs/issues in the Q&A section
# =============================================================================
import requests
from bs4 import Bea... | 48.323171 | 176 | 0.623975 |
e698cd596ab30dc2f2fa1d3a3118e4b1556dd6ad | 1,148 | py | Python | src/network/bo/messages/blocks.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 2 | 2021-11-08T12:00:02.000Z | 2021-11-12T18:37:52.000Z | src/network/bo/messages/blocks.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | null | null | null | src/network/bo/messages/blocks.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 1 | 2022-03-28T13:49:37.000Z | 2022-03-28T13:49:37.000Z | from .message import Message
import sys
sys.path.append("..")
from src.blockchain.block import Block
class Blocks(Message):
def __init__(self, blocks, info=None) -> None:
super().__init__()
self._name = "blocks"
self._blocks = blocks
self._info = info
def get_blocks(self):
... | 24.425532 | 64 | 0.580139 |
fc42990fbd7cabc22e7bf965734ab1bbe91f5a47 | 5,609 | py | Python | Hackathons_19_20/Incendo/incedo_nlp.py | aviggithub/Hackathons_20 | a1bbc63cff3bd71982017749a0cc162d684e452b | [
"Apache-2.0"
] | null | null | null | Hackathons_19_20/Incendo/incedo_nlp.py | aviggithub/Hackathons_20 | a1bbc63cff3bd71982017749a0cc162d684e452b | [
"Apache-2.0"
] | null | null | null | Hackathons_19_20/Incendo/incedo_nlp.py | aviggithub/Hackathons_20 | a1bbc63cff3bd71982017749a0cc162d684e452b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 24 16:08:46 2019
@author: avi
"""
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from textblob import TextBlob
from textblob import Word
i... | 33.993939 | 191 | 0.736495 |
5d1f04a8e9ec6eec9ceb5a92b02b3133a9504df8 | 222 | py | Python | 1304-find-n-unique-integers-sum-up-to-zero/1304-find-n-unique-integers-sum-up-to-zero.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1304-find-n-unique-integers-sum-up-to-zero/1304-find-n-unique-integers-sum-up-to-zero.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1304-find-n-unique-integers-sum-up-to-zero/1304-find-n-unique-integers-sum-up-to-zero.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def sumZero(self, n: int) -> List[int]:
output=[i for i in range(1,int(n/2)+1)]
output+=[-i for i in range(1,int(n/2)+1)]
if n%2!=0:
output+=[0]
return output | 31.714286 | 49 | 0.504505 |
ab45f688016e9ebc1eef6bd133730be8519fe980 | 337 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/15. factorial of a number.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/15. factorial of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/15. factorial of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that randomly chooses any number from 1 to 10 (inclusive)
and then calculates the factorial of the number.
Example :
num = 5
factorial = 5*4*3*2*1 = 120
"""
import random
def factorial():
k = random.randint(1,10)
num = 1
for i in range(1, k+1):
num *= i
return (... | 16.047619 | 82 | 0.614243 |
f407dfe71af5c22c4d03fe3ea3713ec3c816eb88 | 4,478 | py | Python | Packs/HealthCheck/Scripts/HealthCheckMemory/HealthCheckMemory.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HealthCheck/Scripts/HealthCheckMemory/HealthCheckMemory.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HealthCheck/Scripts/HealthCheckMemory/HealthCheckMemory.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
RESOLUTION = ["Performance Tuning of Cortex XSOAR Server: https://docs.paloaltonetworks.com/cortex/cortex-xsoar/6-0/"
"cortex-xsoar-admin/cortex-xsoar-overview/performance-tuning-of-cortex-xsoar-server"]
def ana... | 30.053691 | 121 | 0.49531 |
f43d88b1ab83616b1cabf0da758297d45c64fcc1 | 8,392 | py | Python | riqc/libs/kmer.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | riqc/libs/kmer.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | riqc/libs/kmer.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | import sys
import os
import time
import pickle
import gzip
import numpy as np
import numpy.random as npr
npr.seed(23)
REV_DIC = {'A': 'T',
'C': 'G',
'G': 'C',
'T': 'A',
'N': 'N'}
def __read_genome(fname):
seq = []
curr_chrm = ''
if fname.endswith('.gz'):
... | 36.329004 | 132 | 0.505124 |
f442bead9a01e766c3cc2cab4fcf486bb075f090 | 2,196 | py | Python | data/parquet-testing/data-types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | data/parquet-testing/data-types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | data/parquet-testing/data-types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import tempfile
import os
from pyspark.sql import SparkSession
from pyspark.sql.types import *
import glob
from decimal import Decimal
import datetime
parquet_compression = 'zstd'
outdir = tempfile.mkdtemp()
parquet_folder = os.path.join(outdir, "out.parquet")
nthreads = 8
memory_gb = 10
spark = SparkSession.builde... | 40.666667 | 310 | 0.698543 |
be2ffdc0525860b3e9f2a8a9e98d8c58d04f30ae | 8,637 | py | Python | teams/team_snapback/Website/updown.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 19 | 2017-10-08T03:18:38.000Z | 2020-07-07T02:34:18.000Z | teams/team_snapback/Website/updown.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 2 | 2017-10-08T03:15:10.000Z | 2017-10-10T16:10:32.000Z | teams/team_snapback/Website/updown.py | AbinMM/PYNQ_Hackathon_2017 | 711c75e8590b02f313295cef712188691690c948 | [
"BSD-3-Clause"
] | 28 | 2017-10-07T23:24:36.000Z | 2022-03-29T08:03:40.000Z | """Upload the contents of your Downloads folder to Dropbox.
This is an example app for API v2.
"""
from __future__ import print_function
import argparse
import contextlib
import datetime
import os
import six
import sys
import time
import unicodedata
if sys.version.startswith('2'):
input = raw_input # noqa: E50... | 34.003937 | 114 | 0.565821 |
22a6045a1a9d6f43d77d44a4d17514871e3c3a96 | 5,912 | py | Python | course/migrations/0001_initial.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | course/migrations/0001_initial.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | course/migrations/0001_initial.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | 2 | 2020-04-20T07:26:51.000Z | 2020-04-30T11:51:54.000Z | # Generated by Django 3.0.4 on 2020-04-24 17:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('plan', '__first__'),
('user', '__first__'),
]
operations = [
migrations.CreateM... | 48.459016 | 196 | 0.586942 |
22e8da6204862d2839ce1e6a3e2355ad70790650 | 617 | pyde | Python | sketches/colldectcircle/colldectcircle.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/colldectcircle/colldectcircle.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/colldectcircle/colldectcircle.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from enemies import Enemy
from player import Player
def setup():
global enemy, player
size(420, 420)
this.surface.setTitle("Circle Collision Detection")
enemy = Enemy(width/2, height/2)
player = Player(20, 20)
def draw():
global enemy, player
background("#95e0f5")
if circle_collision(e... | 22.035714 | 55 | 0.623987 |
a3f03c6389ecc50427ac34337a73ba7bb6713186 | 257 | py | Python | CGR/T4/colors.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | CGR/T4/colors.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | CGR/T4/colors.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | dark_gray = 0.1, 0.1, 0.1
light_gray = 0.5, 0.5, 0.5
white = 0.8, 0.8, 0.8
black = 0.1, 0.1, 0.1
silver = 0.7, 0.7, 0.7
red = 0.8, 0.0, 0.0
green = 0.0, 0.8, 0.0
blue = 0.0, 0.0, 0.8
# Cor de ambiente
blue_sky = 0.08, 0.4, 0.9, 1.0
grass = 0.1, 0.6, 0.08
| 18.357143 | 30 | 0.533074 |
4a4b366f61e5bc6b2d9c984d5b5abfd8fe4df333 | 541 | py | Python | src/training/pytorch/constraint_detector_model.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2020-04-17T12:27:06.000Z | 2020-04-17T12:27:06.000Z | src/training/pytorch/constraint_detector_model.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2022-02-27T13:13:17.000Z | 2022-02-27T13:13:17.000Z | src/training/pytorch/constraint_detector_model.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | null | null | null | import torch
from torch import nn
class ConstraintDetector(nn.Module):
def __init__(self):
super(ConstraintDetector, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(1, 16, (4, 4)),
nn.ReLU(),
nn.MaxPool2d((2, 2)),
nn.Conv2d(16, 32, (4, 4)),
... | 23.521739 | 50 | 0.508318 |
78f0c48d11cef7c7f64beee9d00da37def333945 | 6,786 | py | Python | autodiff_test.py | Jiaxin-Lu/AutoDiff | 55459e45399e6251d46878f829734af7004b5c8d | [
"MIT"
] | null | null | null | autodiff_test.py | Jiaxin-Lu/AutoDiff | 55459e45399e6251d46878f829734af7004b5c8d | [
"MIT"
] | null | null | null | autodiff_test.py | Jiaxin-Lu/AutoDiff | 55459e45399e6251d46878f829734af7004b5c8d | [
"MIT"
] | null | null | null | import autodiff as ad
import numpy as np
def test_identity():
x2 = ad.Variable(name = "x2")
y = x2
grad_x2, = ad.gradients(y, [x2])
executor = ad.Executor([y, grad_x2])
x2_val = 2 * np.ones(3)
y_val, grad_x2_val= executor.run(feed_dict = {x2 : x2_val})
assert isinstance(y, ad.Node)
a... | 35.528796 | 141 | 0.657678 |
1c4992765c22841944c3a0022d4163faee833f72 | 750 | py | Python | scheduleSynchronizer/urls.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/urls.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/urls.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
# /
path('', views.home, name='home'),
path('guide', views.guide, name='guide'),
# TEMPORARY
path('signin', views.sign_in, name='signin'),
path('signout', views.sign_out, name='signout'),
path('calendar', views.calendar, name... | 32.608696 | 75 | 0.674667 |
1c98aaf716a0a3945012c4aefb3bbf60499d803b | 495 | py | Python | exercises/fr/solution_03_09_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/solution_03_09_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/solution_03_09_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.fr import French
from spacy.tokens import Token
nlp = French()
# Déclare l'extension d'attribut de Token "is_country"
# avec la valeur par défaut False
Token.set_extension("is_country", default=False)
# Traite le texte et définis l'attribut is_country à True pour le token "Suisse"
doc = nlp("J'habite... | 30.9375 | 80 | 0.759596 |
98df3088a7670b54c446348e4988af929f8deaf1 | 4,718 | py | Python | test/test_npu/test_network_ops/test_median.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_median.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_median.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licen... | 43.284404 | 125 | 0.641162 |
98efd8989e376c93408c3f14dbe7e25876370455 | 9,855 | py | Python | packages/watchmen-inquiry-surface/src/watchmen_inquiry_surface/data/data_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-surface/src/watchmen_inquiry_surface/data/data_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-surface/src/watchmen_inquiry_surface/data/data_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Dict, Optional
from fastapi import APIRouter, Body, Depends
from watchmen_auth import PrincipalService
from watchmen_inquiry_kernel.meta import ReportService, SubjectService
from watchmen_inquiry_kernel.storage import ReportDataService, SubjectDataService
from watchmen_inquiry_surface.settings impo... | 40.892116 | 120 | 0.803247 |
c74c99a74b590f2c198d8be374bb087909e7cda6 | 2,276 | py | Python | edit_and_save_video_file.py | Vuong02011996/opencv_tools | 82e4ff6dc42d3dc404dbdb7b4bec0d267af56daa | [
"MIT"
] | null | null | null | edit_and_save_video_file.py | Vuong02011996/opencv_tools | 82e4ff6dc42d3dc404dbdb7b4bec0d267af56daa | [
"MIT"
] | null | null | null | edit_and_save_video_file.py | Vuong02011996/opencv_tools | 82e4ff6dc42d3dc404dbdb7b4bec0d267af56daa | [
"MIT"
] | null | null | null | import cv2
import numpy as np
# Create a VideoCapture object
cap = cv2.VideoCapture('/home/vuong/Videos/PreSchool/Lyu You Lin.mp4')
POSITION_LINE = 0.75
# Check if camera opened successfully
if cap.isOpened() is False:
print("Unable to read camera feed")
# Default resolutions of the frame are obtained.The default... | 33.970149 | 129 | 0.647627 |
c7a2c4cf8a904eaca4f33ab793bc267764887d7b | 407 | py | Python | src/common/loss_functions/loss_func_utils.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/common/loss_functions/loss_func_utils.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/common/loss_functions/loss_func_utils.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | import numpy as np
import chainer
import chainer.functions as F
def loglikelihood(location_mean, sampled_location, var):
# negative_loglikelihood =\
# F.gaussian_nll(sampled_location, mean=location_mean, ln_var=sigma)
negative_loglikelihood = -0.5*(sampled_location - location_mean)/var
negative_l... | 31.307692 | 76 | 0.77887 |
1bffd5cb30f255ecc76a8ddf8b144e7a96b2bd47 | 2,725 | py | Python | modules/dgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | modules/dgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | modules/dgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from modules.base import MultiHeadAttentionLayer
class DGNResidualBlock(nn.Module):
def __init__(self, in_dim, hidden_dim, out_dim, num_head, with_non_linearity=False):
super(DGNResidualBlock, self).__init__()
self.att_1 = MultiHea... | 40.073529 | 117 | 0.670826 |
40122bca1da2b02ce8fff2a7140dd3af1d013cfb | 919 | py | Python | pythonProj/FZPython/pyquant/libs/socketioclient.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/libs/socketioclient.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/libs/socketioclient.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | # coding: utf8
import json
from pyquant.config import socketio as config
from socketIO_client import SocketIO, LoggingNamespace
def on_connect():
print('on connect')
def on_disconnect():
print('disconnect')
def on_reconnect():
print('reconnect')
def on_aaa_response(*args):
print('on_aaa_response',... | 21.372093 | 83 | 0.711643 |
908a8910227616f9aa2411a278d12880b8c6c6b5 | 273 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 44/44_a2.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | 50-Python-Exercises/Exercises/Exercise 44/44_a2.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | 50-Python-Exercises/Exercises/Exercise 44/44_a2.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | import string, itertools
with open("letters_a2.txt", "w") as file:
for letter1, letter2, letter3 in itertools.zip_longest(string.ascii_lowercase[0::3], string.ascii_lowercase[1::3], string.ascii_lowercase[2::3]):
file.write(letter1 + letter2 + letter3 + "\n")
| 45.5 | 149 | 0.714286 |
29356383ba6c5c3f43d79defb606479c782939a4 | 817 | py | Python | lego/calculus/nodes/atan.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/atan.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/atan.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | """Arctan node"""
import math
from . import add, divide, multiply, node, number, power
class Atan(node.Node):
"""Arctan node"""
def __init__(self, arg):
self.arg = arg
def copy(self):
return Atan(self.arg.copy())
def evaluate(self, value):
return math.atan(self.arg.evaluat... | 21.5 | 58 | 0.517748 |
319c5be22642b7ebefb4cc52a8987555321c0612 | 165 | py | Python | 1_Datentypen/06_dictionary/_06_to_json_and_back.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | 1_Datentypen/06_dictionary/_06_to_json_and_back.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | 1_Datentypen/06_dictionary/_06_to_json_and_back.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | import json
# Json format as string
movie_json = """
{
"Title":"Johnny 5",
"Year":"1986",
"Runtime":"94 min",
"Country":"USA"
}
"""
# json 2 dict
# dict 2 json
| 9.166667 | 23 | 0.593939 |
b4190876a9181dc7ed5da458d3d9d29530f70631 | 633 | py | Python | chapter_eleven/give_the_interface_a_native_feel_with_objects/calculate_coordinates.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_eleven/give_the_interface_a_native_feel_with_objects/calculate_coordinates.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_eleven/give_the_interface_a_native_feel_with_objects/calculate_coordinates.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | from rust_package import calculate_coordinates
class FlyWeight(type):
_instances = {}
def __call__(cls, *args, **kwargs):
key = str(args[0]) + str(args[1])
if key not in cls._instances:
cls._instances[key] = super(
FlyWeight, cls).__call__(*args, **kwargs)
... | 22.607143 | 57 | 0.622433 |
b45d7f212e0a4bea9fbcd85d85da1fb742232478 | 2,552 | py | Python | nodes/ue05_action_server/turtlebot3_client_path.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue05_action_server/turtlebot3_client_path.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue05_action_server/turtlebot3_client_path.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
# ################################################################################
# edited WHS, OJ , 12.11.2021 #
# usage
# $1 roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
# $2 rosrun rtc turtlebot3_server_path.py
# $3 rosrun rtc turtlebot3_client_path.py
import rospy
impo... | 33.142857 | 82 | 0.503135 |
b4833ab1237f8cd62427c9380064fa4817fb87cc | 12,915 | py | Python | src/Sephrasto/Plugins/LangerBogenBeschreibung/CharakterBeschreibungExt.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Plugins/LangerBogenBeschreibung/CharakterBeschreibungExt.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Plugins/LangerBogenBeschreibung/CharakterBeschreibungExt.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterBeschreibungExt.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 im... | 59.243119 | 115 | 0.726287 |
c332b811904cbb2b51567b3a3c6f9579fc7b3567 | 1,432 | py | Python | Project Euler/Problem_8/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 26 | 2019-07-17T11:05:43.000Z | 2022-02-06T08:31:40.000Z | Project Euler/Problem_8/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 7 | 2019-07-16T19:52:25.000Z | 2022-01-08T08:03:44.000Z | Project Euler/Problem_8/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 19 | 2020-01-14T02:44:28.000Z | 2021-12-27T17:31:59.000Z | def multiply(num):
num = str(num)
prod = 1
for i in num:
prod = prod * int(i)
return prod
def main():
length = 13
prod = 0
max_num = 0
for i in range(len(number)-12):
num = number[int(i):int(i)+13]
num_prod = multiply(num)
if num_prod > prod:
... | 65.090909 | 1,015 | 0.851955 |
d2c26395e80ff40742ecce85a8fc490295cfcad6 | 16,315 | py | Python | zmk/trainModel/mergeTrainingNN.py | MFALHI/MLW | 192cc991df61bd8991a51702a53df6a09448d4f7 | [
"Apache-2.0"
] | 1 | 2020-04-14T15:23:35.000Z | 2020-04-14T15:23:35.000Z | zmk/trainModel/mergeTrainingNN.py | vadgama/MLW | 5ca2926aadc33d9a8a55cbf07faa472fa03e9f73 | [
"Apache-2.0"
] | null | null | null | zmk/trainModel/mergeTrainingNN.py | vadgama/MLW | 5ca2926aadc33d9a8a55cbf07faa472fa03e9f73 | [
"Apache-2.0"
] | 1 | 2020-02-29T12:18:09.000Z | 2020-02-29T12:18:09.000Z | import pandas as pd
import numpy as np
from sklearn import model_selection,preprocessing
from keras.preprocessing.image import ImageDataGenerator
from datetime import datetime
import matplotlib.pyplot as plt
from datetime import datetime
from keras import optimizers
import sys, os,ast,json,copy,traceback,pathlib
from ... | 40.889724 | 161 | 0.747226 |
7d5c8b4f57f10a67eeefbd3fa1b598c82df3433b | 2,523 | py | Python | ais3-pre-exam-2022-writeup/Crypto/SC/chall/cipher.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/SC/chall/cipher.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/SC/chall/cipher.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | import string
import random
def shuffle(x):
x = list(x)
random.shuffle(x)
return x
def encrypt(T, file):
with open(file) as f:
pt = f.read()
with open(f"{file}.enc", "w") as f:
f.write(pt.translate(T))
charset = string.ascii_lowercase + string.ascii_uppercase + string.digits
sh... | 46.722222 | 503 | 0.788744 |
d21bb2efc8aadd0c6ccbb2d7dadb732d0e90347e | 10,628 | py | Python | python/en/archive/books/jump2python/j2p-05_5-built_in_functions.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/jump2python/j2p-05_5-built_in_functions.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/jump2python/j2p-05_5-built_in_functions.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
j2p-05_5-built_in_functions.py
p.234, 05-5. 내장 함수
# The following list is the full list of built-in functions in Python Docs.
This script covers a part of the full list.
Built-in Functions
https://docs.python.org/3/library/functions.html
__import__()
abs()
all()
any()
a... | 16.030166 | 89 | 0.53886 |
fb73cc89e5957309cf11d6ca430bd38f1d449e71 | 92 | py | Python | 2014/11/pew-sensitive-info/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/11/pew-sensitive-info/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/11/pew-sensitive-info/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 = '1Yr0-VdiwjF4tpYl0ahFvGd8zz2alhHN1uZnFbOLssmc'
| 23 | 68 | 0.836957 |
f77b8979d1c4b5066903973c5405ecc4130f4695 | 3,072 | py | Python | Python X/Swapping Variables using a temp.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | Python X/Swapping Variables using a temp.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | Python X/Swapping Variables using a temp.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"v1 = \"first string\"\n",
"v2 = \"second string\""
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"v2 = v1\n",
"v1 =... | 15.207921 | 34 | 0.437826 |
540c2d7d7cc7970039f6366c582245e8b2511849 | 509 | py | Python | tarefas-poo/lista-04/matriz_de_inteiros/view/util.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-04/matriz_de_inteiros/view/util.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-04/matriz_de_inteiros/view/util.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # -------------------------------
# UFSC - CTC - INE - INE5663
# Exercício da Matriz de Inteiros
# -------------------------------
# Define funções usadas em vários painéis
#
def mostra_matriz(matriz, espacamento):
'''Mostra os números de uma matriz com um
espaçamento entre os números.
'''
mascara = '{... | 28.277778 | 49 | 0.544204 |
58428f6f8b537231ba3f016d05669e9c345d22f2 | 1,685 | py | Python | Curso-Em-Video-Python/1Materias/16-tuplas/#16-tuplas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/1Materias/16-tuplas/#16-tuplas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/1Materias/16-tuplas/#16-tuplas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | '''Tuplas são imutaveis, nn da pra mudar'''
'''Da pra usar -1, -2, -3'''
'''lanche([1:3]) suco e pizza'''
'''lanche([2:]) vai da pizza ate o final'''
'''lanche([:2]) vai mostrar hamburge e suco ignora o ultimo'''
lanche = ('Hamburgue', 'Suco', 'Pizza', 'Pudim', 'Abobora')
print(lanche)
'''for c in lanche:
print(F'... | 28.559322 | 98 | 0.628487 |
5494ae92dae46e68e145f6c98a8844f827c5c933 | 771 | py | Python | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/collisions.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/collisions.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/collisions.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | def how_many_before_collision(buckets, loops=1):
'''
Roll random hash indexes into `buckets` and print
how many rolls before a hash collision.
Run `loops` number of times.
'''
for i in range(loops):
tries = 0
tried = set()
while True:
random_key = str(random.... | 30.84 | 100 | 0.608301 |
3f9000e8afb566a305cd39875d3beaaca73f8005 | 357 | py | Python | scripts/HelloPython/bsp02_WHILE.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/HelloPython/bsp02_WHILE.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/HelloPython/bsp02_WHILE.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
# bsp01_WHILE.py
# -----------------------------------
# 30.09.2021 by OJ
# -----------------------------------
# ---- Variablen ----
i = 0
while(i <= 9):
print("Zahl {0:02d}".format(i),
"Zahl {0:03d}".format(i**2),
"Zahl {0:04d}".format(i**3))
i += 1 # i++ gibt es n... | 17 | 38 | 0.40056 |
b77a3d695eb8b75eb3d9879b2af464e8341271d4 | 179 | py | Python | pinck_info.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | pinck_info.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | pinck_info.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | import cPickle as pickle
runtime = '''asd
as
da
s
'''
with open('aaa.txt', 'w') as f:
r = pickle.dump(runtime, f)
with open('aaa.txt', 'r') as d:
t = pickle.load(d)
print(t)
| 12.785714 | 31 | 0.608939 |
4d3f34889d97f736906e039b22b495a87db09916 | 1,548 | py | Python | aoc2020/day_12/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_12/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_12/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
from .vector import NORTH, EAST, SOUTH, WEST, Vector
ROTATE_LEFT = Vector(-1, 1)
ROTATE_RIGHT = Vector(1, -1)
class Solution(SolutionABC):
expected = 286
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._waypoint = (10 * EAST) + (1 * NORTH)
... | 35.181818 | 89 | 0.593023 |
4d6522d67a068c11b0ef1906c2c9074a4b052998 | 727 | py | Python | oldp/apps/cases/apps.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/apps.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/apps.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.template.defaulttags import register
class CasesConfig(AppConfig):
name = 'oldp.apps.cases'
@register.filter
def is_read_more(line_counter, forloop): # section_counter=0, content_counter=0
LINE_COUNT = 30
CONTENT_COUNT = 3
# print(previous_line_length)
... | 30.291667 | 132 | 0.72077 |
4dc48ac631562191b8abdcdf5455acd252c610b0 | 2,481 | py | Python | backend/app.py | whatwouldmarvindo/sweetgeeks | 9d7d1103b7aa08aaeecfe32745016b789d922076 | [
"MIT"
] | null | null | null | backend/app.py | whatwouldmarvindo/sweetgeeks | 9d7d1103b7aa08aaeecfe32745016b789d922076 | [
"MIT"
] | 2 | 2021-09-29T08:15:26.000Z | 2021-11-03T09:37:37.000Z | backend/app.py | whatwouldmarvindo/sweetgeeks | 9d7d1103b7aa08aaeecfe32745016b789d922076 | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify
import response_builder
import json
from flask_mysqldb import MySQL
import os
app = Flask(__name__)
@app.route('/api', methods=['GET'])
def main():
city_name = request.args.get("cityName")
statistics = response_builder.build_statistic(city_name)
return jsonify(sta... | 35.442857 | 192 | 0.639661 |
12ca87eddac1b8e194d37a5eca240123790da425 | 4,909 | py | Python | python/odml/examples/example_rdf_query.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/examples/example_rdf_query.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/examples/example_rdf_query.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | from odml.tools.rdf_converter import ODML_NS
from rdflib import Graph, Namespace, RDF, RDFS
from rdflib.plugins.sparql import prepareQuery
NAMESPACE_MAP = {"odml": Namespace(ODML_NS), "rdf": RDF, "rdfs": RDFS}
res_cite = './resources/template_examples/rdf/i140703-001_datacite_conv.rdf'
res_uri = './resources/templat... | 37.473282 | 97 | 0.515787 |
12f9925e9a92b2ecf0e4983b5e2cdda07c1bdf41 | 1,370 | py | Python | koissu-master/cameratest.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | koissu-master/cameratest.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | 3 | 2021-03-10T13:18:31.000Z | 2021-05-11T09:20:11.000Z | koissu-master/cameratest.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | import redis
import time
from flask import Flask, render_template, Response, request
from flask_socketio import SocketIO, emit, send
app = Flask(__name__)
socketio = SocketIO(app)
CONTROL_DURATION = 5
queue = []
control_start_time = 0
redis_queue = redis.StrictRedis(host='localhost', port=6379, db=0)
@app.route('/... | 22.096774 | 66 | 0.60146 |
67c11c01d09243e9be28db09faa4d64e226ec331 | 590 | py | Python | bolt/discord/models/template.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/discord/models/template.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/discord/models/template.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | from bolt.discord.models.base import Model, Field, Snowflake, Timestamp
from bolt.discord.models.user import User
from bolt.discord.models.guild import Guild
class Template(Model):
__repr_keys__ = ['code', 'name']
code = Field(str, required=True)
name = Field(str)
description = Field(str)
usage_c... | 29.5 | 71 | 0.716949 |
22235af21caaf37e7c828278982488423f5c15f2 | 259 | py | Python | python/generator_tricks_for_systemprogrammer/generate.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/generate.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/generate.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import math
def generate(func):
def gen_func(s):
for item in s:
yield func(item)
return gen_func
if __name__ == "__main__":
gen_sqrt = generate(math.sqrt)
for x in gen_sqrt(range(100)):
print(x)
| 16.1875 | 35 | 0.555985 |
e196ca6e7a08e6ac1bdec844dd57937a3b37d453 | 7,886 | py | Python | retweetbot.py | jorgesumle/ticketfrei | 9e221ed29047ece677d00a668becc8b970d634a2 | [
"0BSD"
] | null | null | null | retweetbot.py | jorgesumle/ticketfrei | 9e221ed29047ece677d00a668becc8b970d634a2 | [
"0BSD"
] | null | null | null | retweetbot.py | jorgesumle/ticketfrei | 9e221ed29047ece677d00a668becc8b970d634a2 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
import tweepy
import re
import requests
import pytoml as toml
import trigger
from time import sleep
import report
import logging
import sendmail
logger = logging.getLogger(__name__)
class RetweetBot(object):
"""
This bot retweets all tweets which
1) mention him,
2) contain at ... | 33.134454 | 108 | 0.554527 |
8300a255990728396c8cce5edebda4ce55d3f55f | 5,116 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/hashserv/tests.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/hashserv/tests.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/hashserv/tests.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #! /usr/bin/env python3
#
# Copyright (C) 2018 Garmin Ltd.
#
# SPDX-License-Identifier: GPL-2.0-only
#
import unittest
import threading
import sqlite3
import hashlib
import urllib.request
import json
from . import create_server
class TestHashEquivalenceServer(unittest.TestCase):
def setUp(self):
# Start a... | 38.757576 | 88 | 0.640344 |
3d6173061b7e517768e5d7eb29e9390e0d87b704 | 950 | py | Python | pelicanconf.py | nerdydrew/Drews-Sheet-Music | d34c82fde1099c3bbdaf55a3ed68c6c4b4b1001c | [
"MIT"
] | 2 | 2019-09-14T08:46:30.000Z | 2022-01-13T18:47:28.000Z | pelicanconf.py | nerdydrew/Drews-Sheet-Music | d34c82fde1099c3bbdaf55a3ed68c6c4b4b1001c | [
"MIT"
] | null | null | null | pelicanconf.py | nerdydrew/Drews-Sheet-Music | d34c82fde1099c3bbdaf55a3ed68c6c4b4b1001c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
SITENAME = u"Drew\u2019s Sheet Music"
SITEURL = '/sheetmusic'
PATH = 'content'
STATIC_PATHS = ['files']
TIMEZONE = 'America/New_York'
DEFAULT_LANG = u'en'
DEFAULT_DATE = 'fs'
THEME = 'theme'
THEME_STATIC_DIR = 'static'
DEFAULT_DA... | 22.093023 | 65 | 0.727368 |
a149b2d7f79b689f037016daf0017649aa4ea588 | 953 | py | Python | src/gantt/ganttchart.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/gantt/ganttchart.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/gantt/ganttchart.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # gantt charts
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28', Completion_pct=50),
dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Completion_pct=25),
dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Com... | 47.65 | 141 | 0.677859 |
62bdf50cca24ef23b079b62a4fc67b5ef45053ab | 1,460 | py | Python | oldp/apps/homepage/views.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/homepage/views.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/homepage/views.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from oldp.apps.cases.models import Case
from oldp.apps.laws.models import LawBook
def index_view(request):
k = 10
books = LawBook.objects.filter(latest=True).order_by('-revision_date')[:k]
cases = Case.get_queryse... | 27.54717 | 78 | 0.640411 |
1a2b5512ebf7e35d6115c99d5bae8daf6f2ffd65 | 242 | py | Python | doc/examples/inlined/try_analysis.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/inlined/try_analysis.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/inlined/try_analysis.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic import boost
@boost
def f():
pass
@boost(inline=1)
def f():
pass
def f1():
pass
def f2():
pass
f1_ = boost(f1)
f1_ = boost(inline=1)(f1)
# decor = boost(inline=1)
# f1_ = decor(f1)
# f2_ = decor(f2)
| 8.344828 | 27 | 0.57438 |
a7f6ffdca4e836eff1524a0fb1152d7a154c4fc8 | 2,110 | py | Python | lib/inference.py | liushrui/dsb | eacbe770acf32023029eb89dcc7829af89b09132 | [
"MIT"
] | null | null | null | lib/inference.py | liushrui/dsb | eacbe770acf32023029eb89dcc7829af89b09132 | [
"MIT"
] | null | null | null | lib/inference.py | liushrui/dsb | eacbe770acf32023029eb89dcc7829af89b09132 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import pandas as pd
from glob import glob
from datetime import datetime
from skimage.io import imread
from skimage.transform import resize
from skimage.morphology import closing, opening, disk
warnings.filterwarnings('ignore', category=UserWarning, module='skimage')
from rl... | 37.678571 | 128 | 0.634123 |
b12a218eaaab88666d09b2331cb508058b9d57f3 | 5,564 | py | Python | src/onegov/form/models/definition.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/models/definition.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/models/definition.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import ContentMixin, TimestampMixin
from onegov.core.orm.mixins import meta_property, content_property
from onegov.core.utils import normalize_for_url
from onegov.form.models.submission import FormSubmission
from onegov.form.models.registration_window import ... | 33.926829 | 78 | 0.639288 |
02ed233fb4750eb0cfaae54b7fdcb8fcbdd40ff6 | 429 | py | Python | Problems/Dynamic Programming/Medium/DecodeWays/decode_ways.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Medium/DecodeWays/decode_ways.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/DecodeWays/decode_ways.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | def numDecodings(s: str) -> int:
if not s or s[0] == '0':
return 0
n = len(s)
dp = [0 for _ in range(n + 1)]
# base case initialization
dp[0:2] = [1, 1]
for i in range(2, n + 1):
# One step jump
if 0 < int(s[i - 1: i]): # (2)
dp[i] = dp[i - 1]
# Tw... | 22.578947 | 47 | 0.403263 |
f326a707e5de0cc1f371a4bfdb7a9906b615ed2f | 1,666 | py | Python | 数据结构/NowCode/22_NumberOfBetween1AndN_Solution.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/22_NumberOfBetween1AndN_Solution.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/22_NumberOfBetween1AndN_Solution.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | # 求出1~13的整数中1出现的次数,并算出100~1300的整数中1出现的次数?为此他特别数了一下1~13中包含1的数字有1、10、11、12、13因此共出现6次,但是对于后面问题他就没辙了。ACMer希望你们帮帮他,并把问题更加普遍化,可以很快的求出任意非负整数区间中1出现的次数(从1 到 n 中1出现的次数)
class Solution:
def NumberOf1Between1AndN_Solution(self, n):
# 循环的出口是 highValue = 0
# 我们从最低位开始一个位一个位的来寻找 1 的可能出现的 情况次数。
# 一开始 精准度为1... | 34.708333 | 158 | 0.528211 |
b89884afa71dc7e3e7514df1374bc215918e0cc9 | 583 | py | Python | nz_django/day1/url_name_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day1/url_name_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day1/url_name_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.http import HttpResponse
from django.shortcuts import redirect,reverse
# Create your views here.
def index(request):
#http://127.0.0.1:8000/?username=kangbazi
# username = request.GET['username']
username = request.GET.get('username')
if username:
return HttpResponse('前台首页')
else... | 29.15 | 45 | 0.641509 |
a247b825c76a046d123196302bbf8e51afc9b46c | 2,128 | py | Python | HXP/2020/web/hackme/admin.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | HXP/2020/web/hackme/admin.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | HXP/2020/web/hackme/admin.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import visi... | 33.777778 | 96 | 0.739192 |
a2584b923337be0f9455e70ab0cf9d731abb6f17 | 321 | py | Python | lib/python/qmk/tests/attrdict.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | lib/python/qmk/tests/attrdict.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/tests/attrdict.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | class AttrDict(dict):
"""A dictionary that can be accessed by attributes.
This should only be used to mock objects for unit testing. Please do not use this outside of qmk.tests.
"""
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self... | 35.666667 | 107 | 0.669782 |
a76ac014b5abb458319a49eac3b904be1ee97904 | 541 | py | Python | ___Python/Angela/PyKurs/p06_ persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p06_ persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p06_ persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import json
from p01_kennenlernen.m01_kennenlernen import teilnehmerliste
# "Pickling" / Serialization / Marshalling / Flattening
with open("teilnehmer.json", "w") as datei: # write
json.dump(teilnehmerliste, datei, default=str) # das ganze Modul wird ausgefuehrt; Datumsangaben nun als strin... | 38.642857 | 128 | 0.7061 |
a7789d0e7c25b319171ef6367664a5730ec535dd | 5,339 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_vxlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_vxlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_vxlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... | 52.343137 | 107 | 0.679715 |
49009ccc1aa62ee0a53806105c4860ab7692693d | 1,214 | py | Python | python/postgresql/add_part.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/postgresql/add_part.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/postgresql/add_part.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import psycopg2
from config import config
def add_part(part_name, vendor_list):
# statement for inserting a new row into the parts table
insert_part = 'INSERT INTO parts(part_name) VALUES(%s) RETURNING part_id;'
# statement for inserting a new row into the vendor_parts table
assign_v... | 29.609756 | 82 | 0.620264 |
0b59a01ef78341d4a921eb3bdb2b1c72be9b6ed9 | 1,111 | py | Python | oldp/apps/laws/processing/extract_law_book_codes.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/laws/processing/extract_law_book_codes.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/laws/processing/extract_law_book_codes.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import json
import os
from oldp.apps.backend.processing.law.law2es import LawProcessor
from oldp.apps.backend.processing import ContentProcessor
@DeprecationWarning
class LawBookCodeExtractor(ContentProcessor):
"""
Helper class: Extract law book codes from XML files. Output is used for ref-extraction in cas... | 27.097561 | 110 | 0.645365 |
683557f32a7c71279d1312a0e83840de13063a95 | 823 | py | Python | src/onegov/winterthur/views/roadwork.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/roadwork.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/roadwork.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public
from onegov.winterthur import WinterthurApp, _
from onegov.winterthur.layout import RoadworkLayout, RoadworkCollectionLayout
from onegov.winterthur.roadwork import Roadwork, RoadworkCollection
@WinterthurApp.html(
model=RoadworkCollection,
permission=Public,
templat... | 24.205882 | 77 | 0.702309 |
0bf4c38aaa5ddc9da485b276354ca1f08dd4b50e | 797 | py | Python | crypto/RSA101/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | crypto/RSA101/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | crypto/RSA101/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | from pwn import *
from sympy import invert
from Crypto.Util.number import long_to_bytes
conn = remote("pre-exam-chals.ais3.org", "10201")
f = lambda x: int(str(x, "utf-8"))
conn.recvuntil(" : (")
e, n = map(f, conn.recvuntil(")\n").strip(b")\n").split(b","))
conn.recvuntil(" : ")
c = f(conn.recvuntil("\n").strip(b"\... | 22.771429 | 62 | 0.641154 |
c5c76d13254181bcb8133ff4bc2fd6e74031b679 | 1,690 | py | Python | spider/master_dataset.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/master_dataset.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/master_dataset.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | import re
import json
from datetime import datetime,timedelta
from Config import get_noau_config
_,db,r = get_noau_config()
def get_location(Location):
Location = re.sub('[^a-zA-Z ,]','',Location)
Locations = Location.split(',')
Locations = [i.strip() for i in Locations]
Locations.append(Location)
... | 35.208333 | 121 | 0.585207 |
a86328112e655070c79e8286fbd6e5efc9b97768 | 792 | py | Python | musterloesungen/4.3/kugel_volumen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/4.3/kugel_volumen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/4.3/kugel_volumen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Aufgabe: 4.3
#
import math
def kugel_volumen(r):
V = 4/3 * math.pi * r**3
... | 39.6 | 131 | 0.611111 |
a8a680b00e436c270d2ac9cf13c3c29c5f632aa7 | 1,372 | py | Python | python_experiments/data_analysis/vldbj_data_parsing/generate_index_update_time_over_sling.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/vldbj_data_parsing/generate_index_update_time_over_sling.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/vldbj_data_parsing/generate_index_update_time_over_sling.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from data_analysis.vldbj_data_parsing.generate_index_markdown import get_index_dict, sling_tag, data_set_lst, format_str
from data_analysis.vldbj_data_parsing.generate_speedup_over_sling_markdown import lst_divide
our_avg_index_update_lst = [0.00130415, 0.00241406, 0.00237629, 0.00163426, 0.0139743, 0.0493718,
... | 42.875 | 120 | 0.642857 |
a8c5c710700eb1910787d6a27ab38f513bd0511d | 6,051 | py | Python | lat/ccf.py | Omaam/lat | bb72c43fc870a36e26a32b05000d091871e07ad5 | [
"MIT"
] | null | null | null | lat/ccf.py | Omaam/lat | bb72c43fc870a36e26a32b05000d091871e07ad5 | [
"MIT"
] | null | null | null | lat/ccf.py | Omaam/lat | bb72c43fc870a36e26a32b05000d091871e07ad5 | [
"MIT"
] | null | null | null | """There are some kind of CCF.
TODO:
* Make function that is able to calcurate CCF, even if
light curves are unevened.(2021-12-20 17:16:50)
"""
import warnings
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
from lat.basic import lcsplit
import lat.lchandler as lchandler
__al... | 24.697959 | 73 | 0.588333 |
4f2d9b8a28375922faf5182735923783be12dabb | 3,271 | py | Python | bot/services.py | lbellomo/RiCuT | 28c2cb95756607d164d757c508db9f9190754a09 | [
"MIT"
] | null | null | null | bot/services.py | lbellomo/RiCuT | 28c2cb95756607d164d757c508db9f9190754a09 | [
"MIT"
] | null | null | null | bot/services.py | lbellomo/RiCuT | 28c2cb95756607d164d757c508db9f9190754a09 | [
"MIT"
] | null | null | null | import requests
import json
from math import sin, cos, sqrt, atan2, radians
from key import keys
from urllib.request import urlopen
"""
from make_map import make_map
from ellipse import ellipse
"""
def get_wind_data(lat=35, lon=139):
app_id = keys['owm']
url = "http://api.openweathermap.org/data/2.5/weather?l... | 33.721649 | 137 | 0.640783 |
4f5e7713b9270380624ee4b234287f0f132ac433 | 6,356 | py | Python | DCM/hemodynamicExample-4R-linear-exe.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | 1 | 2018-04-20T07:44:11.000Z | 2018-04-20T07:44:11.000Z | DCM/hemodynamicExample-4R-linear-exe.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | null | null | null | DCM/hemodynamicExample-4R-linear-exe.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | null | null | null |
"""
@author:
Timo
Lukas
Beschreibung:
Simulation eines Netzwerkes bestehend aus 4 Regionen.
Grafik folgt.
Pythonversion:
3.5.1
"""
import numpy as np
import matplotlib.pyplot as plt
from programs import RK4 as RK4
#from programs import Euler as RK1
from programs import hemodynamicModel as HM
#fr... | 34.543478 | 114 | 0.571586 |
8c297c7a747558feea614601bfe4a02ffa03e7fd | 46 | py | Python | 3_zufall/2_zufallsAlter.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 3_zufall/2_zufallsAlter.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 3_zufall/2_zufallsAlter.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Als ich … Jahre alt war
Keine Lösung
"""
| 7.666667 | 23 | 0.608696 |
8c2cace44fdd87326f1784506a47d5c595ed1767 | 2,228 | py | Python | prototype/examples/accessing_api/api-step1.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/accessing_api/api-step1.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/accessing_api/api-step1.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | 1 | 2021-09-26T12:09:52.000Z | 2021-09-26T12:09:52.000Z | from flask import Flask, make_response
import requests
import os
import logging
app = Flask(__name__)
class KubernetesAPI:
def __init__(self, kubernetes_service_host, kubernetes_service_port,
service_account_token=None, cacert=None, insecure_ssl=False):
if service_account_token is None:
... | 31.828571 | 95 | 0.681329 |
50831aeab59611874a53d6adabf66fb1880bb1f4 | 892 | py | Python | script_10_check_irradiance.py | melioristic/FANPY | 2d68d222de4f1e6d6d802268253ce446cd924914 | [
"MIT"
] | 1 | 2021-04-23T19:47:51.000Z | 2021-04-23T19:47:51.000Z | script_10_check_irradiance.py | melioristic/FANPY | 2d68d222de4f1e6d6d802268253ce446cd924914 | [
"MIT"
] | null | null | null | script_10_check_irradiance.py | melioristic/FANPY | 2d68d222de4f1e6d6d802268253ce446cd924914 | [
"MIT"
] | null | null | null | from fanpy import read_climate
import matplotlib.pylab as plt
import numpy as np
home_dir = '/p/project/hai_hhhack/anand1/'
project_data_path = home_dir + 'Project_Data/forest-carbon-flux/'
plot_path = project_data_path+f'graphics/check_irr.png'
fig, axes = plt.subplots(5,4, figsize = (20,16))
for i in range(5):
... | 29.733333 | 82 | 0.643498 |
e89477290d98929d902cc27d407862d39c2315b9 | 392 | py | Python | euler10.py | akashsharma99/2ndSemPractise | ba854e8ef5089ad627cee6f7c8828b711437affa | [
"MIT"
] | null | null | null | euler10.py | akashsharma99/2ndSemPractise | ba854e8ef5089ad627cee6f7c8828b711437affa | [
"MIT"
] | null | null | null | euler10.py | akashsharma99/2ndSemPractise | ba854e8ef5089ad627cee6f7c8828b711437affa | [
"MIT"
] | null | null | null | def SumOfPrimes(n):
prime=[]
for i in range(n+1):
prime.append(1)
s=0
p=2
while(p*p<=n):
if (prime[p] == 1):
i=p*p
while(i<=n):
prime[i]=0
i+=p
p+=1
for i in range(2,n):
if(prime[i]==1):
... | 18.666667 | 30 | 0.380102 |
fa56315738abbeca2af3044df448ec03677b9723 | 336 | py | Python | python/book/OpenSchool.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/book/OpenSchool.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/book/OpenSchool.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | import urllib.request as re
import numpy as np
if __name__ == "__main__":
a = np.array(
[
[1, 2],
[3, 4],
[4, 6],
]
)
print(a.shape)
b = np.sum(
a,
axis=0
)
print(b)
c = np.sum(
a,
axis=1
)
print(... | 12.444444 | 27 | 0.366071 |
d783d907e6c946eedbd447eb82f3c8b1f574d144 | 1,074 | py | Python | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/LambdaACID.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/LambdaACID.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/LambdaACID.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | """
ACID and Database Scalability Trade-offs
Atomicity
Consistency
Isolation
Durability
NewSQL
SELECT * FROM customers;
SELECT City FROM Customers;
SELECT DISTINCT Country FROM Customers;
SELECT * FROM Customers
WHERE City = 'Berlin';
SELECT * FROM Customers
WHERE NOT City = 'Berlin';
SELECT * FROM Customers
W... | 13.097561 | 40 | 0.741155 |
ad1ba817ec1f39f3848d3defd1ab84026099d552 | 520 | py | Python | build/pandoc-capitalizeheadings.py | phiresky/masters-thesis | 3c0b9b3e46a7f1a90a4d212f23f9742038bab044 | [
"CC-BY-4.0"
] | 2 | 2021-09-06T11:19:28.000Z | 2021-09-06T12:38:21.000Z | build/pandoc-capitalizeheadings.py | phiresky/masters-thesis | 3c0b9b3e46a7f1a90a4d212f23f9742038bab044 | [
"CC-BY-4.0"
] | null | null | null | build/pandoc-capitalizeheadings.py | phiresky/masters-thesis | 3c0b9b3e46a7f1a90a4d212f23f9742038bab044 | [
"CC-BY-4.0"
] | 2 | 2021-10-18T18:52:14.000Z | 2021-10-30T13:20:52.000Z | #! /usr/bin/env python
"""
Pandoc filter to convert all headings to title case. Basically uppercase all words except stopwords (a, an, and, ...)
"""
from pandocfilters import toJSONFilter, Header, Str, stringify
from titlecase import titlecase
def title_case(key, value, fmt, meta):
if key == "Header":
# ... | 27.368421 | 117 | 0.692308 |
0f300a3bf68681c6b31fb1d72fe6a9019110f5eb | 802 | py | Python | nz_django/day2/db_demo2_curd/book/migrations/0001_initial.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/db_demo2_curd/book/migrations/0001_initial.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day2/db_demo2_curd/book/migrations/0001_initial.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # Generated by Django 2.0 on 2020-02-19 09:44
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(auto_... | 27.655172 | 114 | 0.533666 |
0f7834dc5c33b338dee81f8de3883e80705842a5 | 1,083 | py | Python | DCM/programs/RK4.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | 1 | 2018-04-20T07:44:11.000Z | 2018-04-20T07:44:11.000Z | DCM/programs/RK4.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | null | null | null | DCM/programs/RK4.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Tobias
Timo
Beschreibung:
Runge-Kutta-Verfahren vierter Ordnung zur Lösung von gewöhnlichen DGL 1. Ordnung.
Ausgabe der Zeitentwicklung in Matrixform.
Wichtig:
Die Dimension des Eingabeparameters x_0 muss mit dem verwendetem Modell überinstimmen.
Pythonversion:... | 30.083333 | 105 | 0.567867 |
7d4388c2c8acf42be6cd8bb3c072b680a0e97b62 | 588 | py | Python | exercises/de/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Doc.has_extension("has_number"), "Hast du die Doc-Erweiterung korrekt registriert?"
ext = Doc.get_extension("has_number")
assert ext[2] is not None, "Hast du die Getter-Funktion korrekt angegeben?"
assert (
"getter=get_has_number" in __solution__
), "Hast du die Funktion g... | 49 | 97 | 0.722789 |
cbb6f965e368fc2db951b9945d253b3638fbce48 | 354 | py | Python | lang-python/basics/02-simple-data-types/simple-data-types.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/basics/02-simple-data-types/simple-data-types.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/basics/02-simple-data-types/simple-data-types.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Einfache Datentypen in Python
# Zeichenkette oder String (string)
str = "This is a string!"
# Ganzzahl oder Integer (int)
num = 7
# Fließkommazahl oder Float (float, real)
pi = 3.1415
# Ausgabe der als 'einfache Datentypen deklarierten' Variablen
print("Datentyp... | 22.125 | 63 | 0.683616 |
382a13d7bffd92d04ccb1e216fd2f7eaef9a61f7 | 826 | py | Python | emsite/emapp/urls.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | emsite/emapp/urls.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | emsite/emapp/urls.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'emapp'
urlpatterns = [
path('', views.Home.as_view(), name='home'),
path('trans-list', views.TransactionList.as_view(), name='trans_list'),
path('<int:pk>/update', views.TransactionUpdate.as_view(), name='trans_update'),
path('create', view... | 41.3 | 84 | 0.690073 |
0e12523ce9fae326c6d33e77ad44e05c8c03a13c | 1,188 | py | Python | TimeLoopLib/TreeDynamicTimeLoop.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TimeLoopLib/TreeDynamicTimeLoop.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TimeLoopLib/TreeDynamicTimeLoop.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"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 TimeLoopLib import TreeDynamicTimeStepping
class TreeDynamicTimeLoop:
def __init__(self, args):
case = args.find("type").text
if case == "Simple":
self.iniSimpleTimeStepping(a... | 32.108108 | 76 | 0.633838 |
aa79d954e715690a637c04844368b91c3d4c42a5 | 396 | py | Python | backend/apitest.py | ahangchen/Rasp-Person-Sensor | 77d0e41b1a80cf9012f66c7bd44f062edbc6825d | [
"MIT"
] | 2 | 2018-02-26T10:00:29.000Z | 2018-03-16T11:39:34.000Z | backend/apitest.py | ahangchen/Rasp-Person-Sensor | 77d0e41b1a80cf9012f66c7bd44f062edbc6825d | [
"MIT"
] | null | null | null | backend/apitest.py | ahangchen/Rasp-Person-Sensor | 77d0e41b1a80cf9012f66c7bd44f062edbc6825d | [
"MIT"
] | null | null | null | import requests
from sensor import upload_wifi_info
def img_upload():
url = 'http://localhost:8081/file/img'
files = {'file': open('../data/rasp-wifi.png', 'rb')}
response = requests.post(url, files=files)
print(response.content.decode('utf-8'))
def wifi_upload():
upload_wifi_info('a... | 23.294118 | 58 | 0.638889 |
2d5e2b29fcd7edb28ef2a4b2bfe778a3b203abc2 | 521 | py | Python | listings/chapter03/temperatures.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter03/temperatures.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter03/temperatures.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | # Je nach Modus passende Konvertierungs-Lambda-Funktion zurückgeben
def converter(mode):
if mode.upper() == 'C':
return lambda temp: temp / 5 * 9 + 32
else:
return lambda temp: (temp - 32) / 9 * 5
# Modus abfragen und entsprechende Funktion abholen
mode = input("(C)elsius in Fahrenheit oder (F)... | 27.421053 | 70 | 0.652591 |
2d766c4a9162b3466ed15adc2d8260daa5020cf1 | 1,869 | py | Python | v308_2/python/spulen.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v308_2/python/spulen.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v308_2/python/spulen.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
mu = 4*np.pi*1e-7
I1 = 1 # strom kurze spule in ampere
n1 = 100 # kurze spule
l1 = 0.055 # länge in meter
I2 = 1 # strom durch lange spule in A
n2 = 300 # lange spule
l2 = 0.16 # länge in meter
R2 = 0.047 # radius in meter
# lange Spule
xl, Bl = np.genfromtx... | 29.203125 | 98 | 0.600321 |
faf0e949dc10fdbc1d67c9fcbeade2c40e98f218 | 7,217 | py | Python | python/oneflow/compatible/single_client/test/ops/test_elu.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_elu.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_elu.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... | 34.5311 | 87 | 0.610226 |
57f7bb1be543f36593dbcead8d1ccc817b076fc4 | 14,753 | py | Python | data-pipeline/src/data_pipeline/datasets/gnomad_v2/gnomad_v2_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_v2/gnomad_v2_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_v2/gnomad_v2_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, x_position
from data_pipeline.data_types.variant import variant_id
POPULATIONS = ["afr", "amr", "asj", "eas", "fin", "nfe", "oth", "sas"]
SUBPOPULATIONS = {
"eas": ["jpn", "kor", "oea"],
"nfe": ["bgr", "est", "nwe", "onf", "seu"... | 38.319481 | 153 | 0.531688 |
a4afaa9212745db0122dec1259f96ec863bf99ac | 2,241 | py | Python | S4CTF/2021/crypto/phillip/phillip.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | S4CTF/2021/crypto/phillip/phillip.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | S4CTF/2021/crypto/phillip/phillip.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
from Crypto.Util.number import *
from gmpy2 import next_prime, gcd, lcm
from random import randint
import sys, os, signal
import inspect
from flag import flag
def make_params(nbit):
p, q = [getPrime(nbit) for _ in range(2)]
n, f, g = p * q, lcm(p-1, q-1), p + q
e = pow(g, f, n**2)
u = divmo... | 25.465909 | 133 | 0.593485 |
52602da6ed2d402fba3fe6133ac5937fa89d9b45 | 3,297 | py | Python | deploy/deployctl/subcommands/data_pipeline.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | deploy/deployctl/subcommands/data_pipeline.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | deploy/deployctl/subcommands/data_pipeline.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | import argparse
import os
import subprocess
import sys
import tempfile
import typing
import zipfile
from deployctl.config import config
DATA_PIPELINE_DIRECTORY = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../../../data-pipeline/src/data_pipeline")
)
def run_pipeline(
pipeline: str, cluster: ... | 35.836957 | 118 | 0.620564 |
8769ac34d6e6d66dcbd6c05c7d37f880a7a6fa4a | 18,341 | py | Python | MachineTranslation/src_bak/seq2seq/v1(Session execution)/lib/build_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | MachineTranslation/src_bak/seq2seq/v1(Session execution)/lib/build_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | MachineTranslation/src_bak/seq2seq/v1(Session execution)/lib/build_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from deprecated import deprecated
import os
import numpy as np
from tqdm import tqdm
from PIL import Image
import pickle
import pandas as pd
import re
import string
from collections import Counter
import jieba
from tensorflow.keras.preprocessing import sequence
# from lib.... | 29.822764 | 222 | 0.593206 |
df51b13b4b00b871f45f5a970678c384594012e6 | 120 | py | Python | python/python_backup/PRAC_PYTHON/u.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/u.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/u.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | n=input("enter number")
for i in range(1,n+1,1):
for j in range(1,i,1):
print "*",
print
| 17.142857 | 29 | 0.466667 |
d5a0af718a246e4a4853e6ade325b6dbd7f37f82 | 5,963 | py | Python | data.py | ben-eysenbach/DDO | 3751e0a830814650dd8d965b9d9945d2d82def0e | [
"MIT"
] | 1 | 2021-11-17T04:45:21.000Z | 2021-11-17T04:45:21.000Z | data.py | ben-eysenbach/DDO | 3751e0a830814650dd8d965b9d9945d2d82def0e | [
"MIT"
] | null | null | null | data.py | ben-eysenbach/DDO | 3751e0a830814650dd8d965b9d9945d2d82def0e | [
"MIT"
] | 1 | 2021-02-28T16:37:34.000Z | 2021-02-28T16:37:34.000Z | import tensorflow as tf
import numpy as np
import gym
import os
import glob
from tqdm import tqdm
import functools
AGC_ACTIONS = ['NOOP', 'FIRE', 'UP', 'RIGHT', 'LEFT', 'DOWN', 'UPRIGHT', 'UPLEFT', 'DOWNRIGHT', 'DOWNLEFT', 'UPFIRE', 'RIGHTFIRE', 'LEFTFIRE', 'DOWNFIRE', 'UPRIGHTFIRE', 'UPLEFTFIRE', 'DOWNRIGHTFIRE', '... | 37.037267 | 216 | 0.665437 |
6350033780f4cdd90f0fb97dc9c4481b42d5c03e | 1,774 | py | Python | lab2/city.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | 1 | 2018-04-18T19:55:42.000Z | 2018-04-18T19:55:42.000Z | lab2/city.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | null | null | null | lab2/city.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | null | null | null | from math import pi, sqrt, cos, sin, acos
from numpy import around
class Euc_2D:
def __init__(self, x = None, y = None):
self.x = x;
self.y = y
def __sub__(self, other):
return Euc_2D(self.x - other.x, self.y - other.y)
def norm(self):
return sqrt(self.x ** 2 + self.y ** ... | 29.566667 | 79 | 0.582864 |
98819b4a27016e58147f7c156d6b817fdc5ecd51 | 3,439 | py | Python | src/models/selfsupervised/train_mnist.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/models/selfsupervised/train_mnist.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/models/selfsupervised/train_mnist.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null | import json
import os
from pathlib import Path
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torchvision
from torchvision.datasets import MNIST
import torchvision.transforms as transforms
from inferno.trainers.basic import Trainer
from inferno.trainers.callbacks.loggin... | 35.453608 | 95 | 0.696714 |
98b084ef0591773db522c1aab432d8a0a8b31b16 | 1,940 | py | Python | casts/migrations/0003_auto_20190407_1707.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | casts/migrations/0003_auto_20190407_1707.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | casts/migrations/0003_auto_20190407_1707.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-04-07 17:07
import casts.models
from django.db import migrations, models
import sorl.thumbnail.fields
class Migration(migrations.Migration):
dependencies = [("casts", "0002_auto_20190402_0149")]
operations = [
migrations.AlterField(
model_name="cast",... | 31.803279 | 85 | 0.579381 |
d64d3f683f66d86e9d06456806f3e542f8c4b995 | 5,603 | py | Python | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestSupplierScorecard(unittest.TestCase):
def test_create_scorecard(self):
delete_test_scorecards()
my_doc = make_supplier_sc... | 29.335079 | 125 | 0.676245 |
c3b5166f6d1fe22dc5d76a8ec9281c958e851323 | 311 | py | Python | src/onegov/election_day/forms/upload/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null |
ALLOWED_MIME_TYPES = {
'application/excel',
'application/vnd.ms-excel',
'text/plain',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-office',
'application/octet-stream',
'application/zip',
'text/csv'
}
MAX_FILE_SIZE = 10 * 1024 * 1024
| 22.214286 | 72 | 0.681672 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.