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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4eac969c5b81e09556d98cf9218552a2885dedc6 | 82 | py | Python | Python/Strings/find_a_string.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/find_a_string.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/find_a_string.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | s, sub = input(), input()
print(sum(s[i:].startswith(sub) for i in range(len(s)))) | 41 | 56 | 0.634146 |
eed0bc50facbfc5bcbbc28f07756280ccd72cad5 | 2,709 | py | Python | m5-101/content/code/csv-demo.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:15:38.000Z | 2021-11-10T12:29:19.000Z | m5-101/content/code/csv-demo.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | null | null | null | m5-101/content/code/csv-demo.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:18:10.000Z | 2021-04-08T13:44:48.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import csv
# In[2]:
from faker import Faker
import random
import numpy as np
import datetime
import time
# In[3]:
csv_file = csv.reader(open('../txt_files/eshop-data.csv'))
lines = [line for line in csv_file]
# In[4]:
fake = Faker(locale="zh_CN")
# In[5]:
... | 17.14557 | 136 | 0.611665 |
6ddbd25b06a9e7bc91cbed550676539617fdc1b9 | 861 | py | Python | ICHSA/2021/crypto/Crime_Cloud/source.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | ICHSA/2021/crypto/Crime_Cloud/source.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | ICHSA/2021/crypto/Crime_Cloud/source.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import base64
import os
import zlib
def rand(n):
return os.urandom(n)
def xor(a,b):
return bytes(x^y for x,y in zip(a,b))
def enc_otp(pt):
return xor(pt, rand(len(pt)))
def process(req):
pt = zlib.compress(b"ICHSA_CTF{fake_flag_to_annoy_you_pay_us_ten_thousand_BTC}" + rand(32) + req)... | 22.657895 | 102 | 0.569106 |
c9586956b3722073c1e23a01b7477ff45bb94d46 | 1,084 | py | Python | Termin 5/Aufgabe 3.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Termin 5/Aufgabe 3.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Termin 5/Aufgabe 3.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | 3 | 2019-11-17T01:33:07.000Z | 2020-03-26T10:13:39.000Z | """
Aufgabe 5.3
"""
import numpy as np
from skimage.io import imread, imshow
import matplotlib.pyplot as plt
from skimage.feature import match_template
#5.1
catG = imread("./catG.png")
catEye = imread("./catEye.png")
#5.2
match_cat = match_template(catG, catEye)
fig, ax = plt.subplots(1,4)
ax[0].imshow(catG, cmap =... | 22.583333 | 102 | 0.738007 |
a3555cdf74bc7bb8138c8025b96bad0a7f175039 | 5,099 | py | Python | query.py | Scauting-Burgum/ScautDB | d848671aff29a14b458966820dbb8275cd2c3154 | [
"MIT"
] | null | null | null | query.py | Scauting-Burgum/ScautDB | d848671aff29a14b458966820dbb8275cd2c3154 | [
"MIT"
] | null | null | null | query.py | Scauting-Burgum/ScautDB | d848671aff29a14b458966820dbb8275cd2c3154 | [
"MIT"
] | null | null | null | class Query:
def __init__(self, table, columns = list(), filters = list()):
self.table = table
self.columns = columns
self.filters = filters
@property
def column_string(self):
column_string = 'rowid'
for column in self.columns:
column_string += '... | 32.896774 | 117 | 0.437341 |
6e0b1ace83fe2ed128507c44c400d2bd694687c3 | 2,288 | py | Python | visualize.py | wladimir-computin/SML-Logger | 8fe106907871fd535870589ea54f498affb7239f | [
"MIT"
] | null | null | null | visualize.py | wladimir-computin/SML-Logger | 8fe106907871fd535870589ea54f498affb7239f | [
"MIT"
] | null | null | null | visualize.py | wladimir-computin/SML-Logger | 8fe106907871fd535870589ea54f498affb7239f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
from datetime import datetime
import os
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from scipy.signal import savgol_filter
import dataset
def plot(db, stufftoplot, plotname, from_date = datetime(2000, 1, 1), to_date = datetime.now()):
statement = f"SELECT ti... | 34.149254 | 96 | 0.694493 |
958af822e6a0c77f71b66126a8f43a743e29049c | 346 | py | Python | plotter.py | Psekilo/Inefficent-Curved-Beam-Stress-Plot | 03add93454f9f73d03758dc1e7ac02e9e8c4427e | [
"MIT"
] | null | null | null | plotter.py | Psekilo/Inefficent-Curved-Beam-Stress-Plot | 03add93454f9f73d03758dc1e7ac02e9e8c4427e | [
"MIT"
] | null | null | null | plotter.py | Psekilo/Inefficent-Curved-Beam-Stress-Plot | 03add93454f9f73d03758dc1e7ac02e9e8c4427e | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import csv
x=[]
y=[]
with open('values.csv', 'r') as csvfile:
plots= csv.reader(csvfile, delimiter=',')
for row in plots:
x.append(float(row[0]))
y.append(float(row[1]))
plt.plot(x,y, marker='o')
plt.title('curvedbeams.cpp')
plt.xlabel('Radius')
plt.ylabel('... | 16.47619 | 45 | 0.635838 |
95ef7f2996aef352d0556f0760de49f236f816c1 | 98 | py | Python | apps/principal/apps.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | apps/principal/apps.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | apps/principal/apps.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class PrincipalConfig(AppConfig):
name = 'apps.principal'
| 16.333333 | 33 | 0.765306 |
06c48d957caf1743782c5deaf94076c4a4fc10ae | 631 | py | Python | ___Python/Carsten/p09_isbn/isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Carsten/p09_isbn/isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Carsten/p09_isbn/isbn.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # Aufgabe:
# http://exercism.io/exercises/python/isbn-verifier/readme
# Prüfe, ob isbn eine gültige ISBN-Nummer ist
def verify(isbn):
x = [None]
for i in isbn:
try:
i = int(i)
x.append(i)
except ValueError:
if isbn[-1] == "X" and i == "X":
... | 26.291667 | 147 | 0.442155 |
c665c9cf5f7c1055dc3855c17c7b8158a3c5d123 | 1,565 | py | Python | server/maps_api.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | server/maps_api.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | server/maps_api.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | from geopy import distance
from googlemaps import Client as GoogleMaps
google_api_key = "AIzaSyA5Ryv0KYWdNKYAXsxGSwlC6oaD5q9iCI4"
def get_coordinates(address: str, api_key: str) -> tuple:
"""
Takes in a string address and Google API key.
Returns a tuple with latitude and longitude.
"""
gmaps = G... | 34.777778 | 90 | 0.686262 |
af5dd8ba08bae2d49507dbbd69145c1ea30328df | 1,136 | py | Python | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/timing_tests.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/timing_tests.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/timing_tests.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null |
# O(n^2)
def add_to_front(n):
x = []
for i in range(0, n):
x.insert(0, n - i)
return x
# O(n)
def add_to_back(n):
x = []
for i in range(0, n):
x.append(i + 1)
return x
# O(n)
def pre_allocate(n):
x = [None] * n
for i in range(0, n):
x[i] = i + 1
return x
... | 18.322581 | 51 | 0.62588 |
a56f4146699753687005489a3998e99359e3c054 | 670 | py | Python | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_local_ancestry.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_local_ancestry.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_local_ancestry.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 12 | 2018-02-22T09:45:43.000Z | 2020-02-27T21:37:52.000Z | import hail as hl
from data_pipeline.data_types.variant import variant_id
def prepare_local_ancestry(path):
ds = hl.import_vcf(path, reference_genome="GRCh38", min_partitions=2000).rows()
ds = ds.select(
variant_id=variant_id(ds.locus, ds.alleles),
populations=hl.struct(
genome=[... | 27.916667 | 100 | 0.537313 |
3ce1b8e233dfe85d75c774a936e46f6985227a88 | 1,409 | py | Python | imagestore.py | Torreshan/Nao | 8ad8eb9b92ce303ad79892efa2a812a1d971e058 | [
"MIT"
] | null | null | null | imagestore.py | Torreshan/Nao | 8ad8eb9b92ce303ad79892efa2a812a1d971e058 | [
"MIT"
] | null | null | null | imagestore.py | Torreshan/Nao | 8ad8eb9b92ce303ad79892efa2a812a1d971e058 | [
"MIT"
] | null | null | null | import rospy
# ROS Image message
from sensor_msgs.msg import Image
# ROS Image message -> OpenCV2 image converter
from cv_bridge import CvBridge, CvBridgeError
# OpenCV2 for saving an image
from geometry_msgs.msg import Twist
import cv2
# Instantiate CvBridge
bridge = CvBridge()
d = 0
def image_callback(msg):
pri... | 27.096154 | 65 | 0.672108 |
55771489dc24bf3a02065dde6e5d73dceba68540 | 585 | py | Python | Problems/SlidingWindow/CountNumberNiceSubarrrays/count_number_nice_subarrays.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/SlidingWindow/CountNumberNiceSubarrrays/count_number_nice_subarrays.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/SlidingWindow/CountNumberNiceSubarrrays/count_number_nice_subarrays.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def numberOfSubarrays(self, nums: List[int], k: int) -> int:
low_bound, index_of_left_most_odd_in_win, ans = -1, 0, 0
for num in nums:
k -= num % 2
if nums[index_of_left_most_odd_in_win] % 2 == 0:
index_of_left_most_odd_in_win += 1
if k < 0:
... | 34.411765 | 60 | 0.611966 |
7579e64d19c90a204cdcfdd92b04e7031707eba0 | 1,207 | py | Python | queryRaspi.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | 1 | 2020-07-16T02:52:47.000Z | 2020-07-16T02:52:47.000Z | queryRaspi.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | queryRaspi.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | import os
import json
from getIP.getip import *
# Return CPU temperature as a float
def getCPUtemperature():
f = os.popen("cat /sys/class/thermal/thermal_zone0/temp")
temp = int(f.readline().strip())/1000
return round(temp, 1)
# Return RAM information (unit=MB) in a list
# Index 0: total RAM
# Index 1: us... | 27.431818 | 63 | 0.643745 |
75b5184be5dfaee48d7d47257a0d12c4e2d2ab6c | 28,657 | py | Python | models/trainers/DefaultTrainer.py | scott-mao/CroP | f1e0a25224e341683cf47e7ce451ce0fe996e950 | [
"MIT"
] | null | null | null | models/trainers/DefaultTrainer.py | scott-mao/CroP | f1e0a25224e341683cf47e7ce451ce0fe996e950 | [
"MIT"
] | null | null | null | models/trainers/DefaultTrainer.py | scott-mao/CroP | f1e0a25224e341683cf47e7ce451ce0fe996e950 | [
"MIT"
] | 1 | 2021-11-08T16:34:45.000Z | 2021-11-08T16:34:45.000Z | import argparse
import sys
import time
from scipy import stats
import torch
from torch.optim.optimizer import Optimizer
from torch.utils.data.dataloader import DataLoader
from torch.utils.tensorboard import SummaryWriter
from torch.optim.lr_scheduler import StepLR, OneCycleLR
from models import GeneralModel
from model... | 43.952454 | 169 | 0.572216 |
75b6515a992792469554a2091ebad451091edc17 | 3,787 | py | Python | UnityPython.FrontEnd/unitypython/IntEncode.py | franklin1dev/Traffy.UnityPython-main | b616e4c0043af05f5c34ebd245c09b21bfa79a10 | [
"MIT"
] | 29 | 2022-02-21T01:48:23.000Z | 2022-03-31T11:01:14.000Z | UnityPython.FrontEnd/unitypython/IntEncode.py | franklin1dev/Traffy.UnityPython-main | b616e4c0043af05f5c34ebd245c09b21bfa79a10 | [
"MIT"
] | 25 | 2022-02-20T23:32:06.000Z | 2022-03-31T05:04:01.000Z | UnityPython.FrontEnd/unitypython/IntEncode.py | thautwarm/Traffy.UnityPython | 2133db6df44d70e766b51a32bbe949d3deb84dc1 | [
"MIT"
] | null | null | null | from __future__ import annotations
from enum import IntEnum
import typing
_T = typing.TypeVar('_T')
class STATE(IntEnum):
EXTEND1 = 0
EXTEND2 = 1
ENDING = 2
class Decoder:
def __init__(self) -> None:
self.first = 0
self.second = 0
BIT_END = 0b_0100_0000
def decode(encoded: list[int]... | 27.845588 | 87 | 0.560602 |
75c08efa187a521886878fa7a47f13ffc364a455 | 938 | py | Python | flask_sri.py | raicheff/flask-sri | 83e062b80e4a3c309906bf1dc8bdbb42e529576b | [
"MIT"
] | null | null | null | flask_sri.py | raicheff/flask-sri | 83e062b80e4a3c309906bf1dc8bdbb42e529576b | [
"MIT"
] | null | null | null | flask_sri.py | raicheff/flask-sri | 83e062b80e4a3c309906bf1dc8bdbb42e529576b | [
"MIT"
] | null | null | null | #
# Flask-SRI
#
# Copyright (C) 2017 Boris Raicheff
# All rights reserved
#
import json
import warnings
class SRI(object):
"""
Flask-SRI
Documentation:
https://flask-sri.readthedocs.io
For use with the Gulp-SRI plug-in:
https://github.com/mathisonian/gulp-sri
:param app: Flask app to ... | 20.391304 | 83 | 0.618337 |
75c51dc32974638f89894dff8f848fae6386b586 | 909 | py | Python | InputRecord/input.py | Golfyrs/ML.Experiments | 362d94357c2ca84a6a4cb127aec6d00c8b1756d4 | [
"Apache-2.0"
] | null | null | null | InputRecord/input.py | Golfyrs/ML.Experiments | 362d94357c2ca84a6a4cb127aec6d00c8b1756d4 | [
"Apache-2.0"
] | null | null | null | InputRecord/input.py | Golfyrs/ML.Experiments | 362d94357c2ca84a6a4cb127aec6d00c8b1756d4 | [
"Apache-2.0"
] | null | null | null | from pynput.mouse import Listener
import logging
import time
import sqlite3
import datetime
import threading
def on_move(x, y):
moves.append((datetime.datetime.now(), x, y))
def on_click(x, y, button, pressed):
clicks.append((datetime.datetime.now(),x, y, str(button), pressed))
def refresh():
print("r... | 22.170732 | 74 | 0.663366 |
75d4fb75baa1ad09d16b94983b3abd4bf0e58db2 | 5,358 | py | Python | workshop/post_build.py | sparkgene/aws-iot-edukit-tutorials | c4508192a3807336017c8fe1ed49ea4465cfa45f | [
"MIT-0"
] | 41 | 2020-05-06T12:11:04.000Z | 2022-03-20T21:48:04.000Z | workshop/post_build.py | sparkgene/aws-iot-edukit-tutorials | c4508192a3807336017c8fe1ed49ea4465cfa45f | [
"MIT-0"
] | 13 | 2019-09-21T16:25:14.000Z | 2021-09-27T17:12:09.000Z | workshop/post_build.py | sparkgene/aws-iot-edukit-tutorials | c4508192a3807336017c8fe1ed49ea4465cfa45f | [
"MIT-0"
] | 26 | 2020-05-09T19:31:07.000Z | 2021-12-07T05:38:49.000Z | import boto3
from boto3.dynamodb.conditions import Key, Attr
import json
import os
import sys
import toml
import logging
import datetime
import base64
import requests
from requests_aws4auth import AWS4Auth
from botocore.utils import ContainerMetadataFetcher
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#... | 35.019608 | 117 | 0.60657 |
f9342df653968ac6ac54cca2aa688d0742d925c3 | 2,063 | py | Python | 008-C104-MeanMedianMode/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 008-C104-MeanMedianMode/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 008-C104-MeanMedianMode/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # 004-C104-MeanMedianMode
# This is a python script made by @somePythonProgrammer
# for a WhiteHat Junior project.
import csv
from collections import Counter
def mean(numbers: list) -> float:
return sum(numbers) / len(numbers)
def median(numbers: list) -> float:
numbers.sort()
if len(numbers) % 2 == 0:
... | 24.855422 | 91 | 0.520116 |
f935eebc87f56a17424a10f3309fb5685bc3a778 | 2,397 | py | Python | Lab1/dataset.py | rajatgupta310198/DL-Lab | cf17b92f9f6643877619d158552b70488879767c | [
"MIT"
] | null | null | null | Lab1/dataset.py | rajatgupta310198/DL-Lab | cf17b92f9f6643877619d158552b70488879767c | [
"MIT"
] | null | null | null | Lab1/dataset.py | rajatgupta310198/DL-Lab | cf17b92f9f6643877619d158552b70488879767c | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import os, re
# Cat 0
# Dog 1
class CatDog(object):
def __init__(self, dir_name='/dataset'):
self.data_dir = dir_name
self.train_images, self.train_labels, self.test_images, self.test_labels = self.read_train_images()
print(self.train_images.shape, ... | 34.242857 | 170 | 0.607843 |
ddca030c54ec2ee12f705bc64f7280e29ce41177 | 894 | py | Python | Sketche/hellokitty.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | Sketche/hellokitty.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | Sketche/hellokitty.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | import p5
import os
# Hier wird der Pfad zum Verzeichnis des ».py«-Files gesetzt
# Erspart einem das Herumgehample in TextMate mit dem os.getcwd()
# und os.path.join()
file_path = os.path.dirname(os.path.abspath(__file__))
os.chdir(file_path)
tilesize = 90
step = 15
def setup():
global kitty, xpos, ypos
p5.s... | 24.162162 | 89 | 0.631991 |
fb1b6b799e752bac8a94bca6202e0c47f4dde1dc | 1,435 | py | Python | Algorithms/Bit_Manipulation/xor_sequence.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Bit_Manipulation/xor_sequence.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Bit_Manipulation/xor_sequence.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def xor_seq(num, div):
if num == 0:
n = 4 * div
elif num == 1:
n = 1
elif num == 2:
n = 4 * div + 3
else:
n = 0
return n
for _ in range(int(input())):
result = 0
L, R = map(int, input().strip().split())
ld, lm = divmod(... | 17.5 | 57 | 0.418815 |
34c93f0441f10e2684536e04c8f4be2b12ef5edf | 56,842 | py | Python | view/view.py | Limatationz/pandemiesimulator | 91d21fda2f9c77d616a9e9401271fc044b421007 | [
"MIT"
] | null | null | null | view/view.py | Limatationz/pandemiesimulator | 91d21fda2f9c77d616a9e9401271fc044b421007 | [
"MIT"
] | null | null | null | view/view.py | Limatationz/pandemiesimulator | 91d21fda2f9c77d616a9e9401271fc044b421007 | [
"MIT"
] | null | null | null | """
Element of the view.
Contains the View class.
"""
import pyqtgraph as pg
import pyqtgraph.exporters
from PyQt5 import QtGui
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import Qt, QPropertyAnimation, QRect, QPoint, QRegularExpression
from PyQt5.QtGui import QBrush, QPixmap, QRegularExpressionValid... | 38.879617 | 119 | 0.602723 |
9b7cee10ea224304a6030aa2288f8fd4ca3e6a47 | 804 | py | Python | 2021-05-09/城市地图带后端/城市地图后端/user/migrations/0002_auto_20170401_1805.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 395 | 2017-02-24T02:59:29.000Z | 2022-03-31T15:48:19.000Z | 2021-05-09/城市地图带后端/城市地图后端/user/migrations/0002_auto_20170401_1805.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 7 | 2020-03-17T08:33:00.000Z | 2021-09-02T23:10:46.000Z | 2021-05-09/城市地图带后端/城市地图后端/user/migrations/0002_auto_20170401_1805.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 235 | 2017-03-14T03:31:38.000Z | 2022-03-29T16:14:51.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-01 18:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0001_initial'),
]
operations = [
migrations.AddField(
m... | 25.935484 | 91 | 0.580846 |
32e411d17bb219b414c969221333e88806cfaf0f | 319 | py | Python | python/coursera_python/MICHIGAN/Programming For Everybody using python/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/Programming For Everybody using python/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/Programming For Everybody using python/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | score = input("Enter Score: ")
score = float(score)
if score < 0.0 or score > 1.0:
print('Error!')
else :
if(score >= 0.9):
print("A")
elif(score >=0.8):
print("B")
elif(score >=0.7):
print("C")
elif(score >=0.6):
print("D")
elif(score <=0.6):
print("F")
| 19.9375 | 30 | 0.470219 |
fd190aa44201bd88bebcdcd2869be1eacb27d41c | 1,005 | py | Python | panzee/maputils.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | panzee/maputils.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | panzee/maputils.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null | import cocos
def loadMap(path=None):
if path != None:
map = cocos.tiles.load(path)
return map
else:
return None
def getCellProperty(cell, var):
# (cocos.tiles.Cell, String)
if not issubclass(type(cell), cocos.tiles.Cell):
raise TypeError
try:
return cell[var]
... | 24.512195 | 54 | 0.538308 |
2f2c92fed85b1698fd513f01c04577086334781b | 1,532 | py | Python | reptile/downMovie.py | WuNull/findmovie | 29d3ef6fe2282f48be57780f5e8366de1d3479a6 | [
"Apache-2.0"
] | 1 | 2019-11-26T07:03:06.000Z | 2019-11-26T07:03:06.000Z | reptile/downMovie.py | WuNull/findmovie | 29d3ef6fe2282f48be57780f5e8366de1d3479a6 | [
"Apache-2.0"
] | null | null | null | reptile/downMovie.py | WuNull/findmovie | 29d3ef6fe2282f48be57780f5e8366de1d3479a6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import urllib.request
import urllib.error
import re
opener = urllib.request.build_opener()#构建一个handler对象
def search():
title = input("请输入电影名称:")
title = title.encode('gb2312')
req = urllib.request.Request('http://s.ygdy8.com/plus/so.php')
#so.php请求参数将中文进行了Url.encode(),所以需要将中文enco... | 46.424242 | 213 | 0.662533 |
2f584f0771873b17ffdeeae0783e9aa40e3f3194 | 4,038 | py | Python | tools/indexer/indexer.py | Programmierer281986/Schneider-IT | 2713d11f02df9c6e59117eb7136459989d60690f | [
"Apache-2.0"
] | null | null | null | tools/indexer/indexer.py | Programmierer281986/Schneider-IT | 2713d11f02df9c6e59117eb7136459989d60690f | [
"Apache-2.0"
] | null | null | null | tools/indexer/indexer.py | Programmierer281986/Schneider-IT | 2713d11f02df9c6e59117eb7136459989d60690f | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
import json
import os
import re
import sys
ESCAPECHARS = [
[ "<", "<" ],
[ ">", ">" ]
]
class Topic:
def __init__(self, title, location):
self.title = title
self.location = location
self.subtopics = list()
def __str__(self):
r... | 28.638298 | 104 | 0.52526 |
23f44e3986f81f3ff04554de8900d3f103847843 | 19,257 | py | Python | Liquid-experiments/util/jobModel.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-experiments/util/jobModel.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-experiments/util/jobModel.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | import json
import random
def convert_job_status(status_code):
status_map = [
'Created', # 0
'Starting', # 1
'Running', # 2
'Stopped', # 3
'Finished', # 4
'Failed', # 5
]
if 0 <= status_code < len(status_map):
return status_map[status_code]
return 'Unknown'
def get_job(job_... | 28.65625 | 87 | 0.538454 |
9b208f079621bb6be6fcc1aa87b5e2350351b191 | 149 | py | Python | src/onegov/ballot/constants.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/constants.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/constants.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | # Used locales in election_day, can not import variables from election day app
election_day_i18n_used_locales = {'de_CH', 'fr_CH', 'it_CH', 'rm_CH'}
| 49.666667 | 78 | 0.765101 |
c8c2499339e3fc31414118ea78144a4980d354d3 | 4,343 | py | Python | src/onegov/form/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains upgrade tasks that are executed when the application is being
upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`.
"""
from depot.io.utils import FileIntent
from io import BytesIO
from onegov.core.crypto import random_token
from onegov.core.orm.types import JSON, UUID
from onegov.core.up... | 29.951724 | 74 | 0.686162 |
8da954fec702d67aac62b35beb895537213b2e1c | 387 | py | Python | comp/google/2015/003-Symmetry-X/SymmetryX.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/google/2015/003-Symmetry-X/SymmetryX.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/google/2015/003-Symmetry-X/SymmetryX.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | def sym_x_exist(points):
l, r = min(points), max(points)
mid_x = (l[0] + r[0]) / 2.0
pts = set(points)
for p in points:
if (2 * mid_x - p[0], p[1]) not in pts:
return False
return True
tests = []
tests.append([(1, 2), (-1, 2), (3, 4), (-3, 4)])
tests.append([(1, 2), (-1, 2), (3... | 21.5 | 48 | 0.498708 |
93e5bd73ed94fbc3e207a77835dec8aedcd674c4 | 5,053 | py | Python | ST.py | ponyatov/ST | 4aab2004608fe5f85366870c8387451f05451adc | [
"MIT"
] | null | null | null | ST.py | ponyatov/ST | 4aab2004608fe5f85366870c8387451f05451adc | [
"MIT"
] | null | null | null | ST.py | ponyatov/ST | 4aab2004608fe5f85366870c8387451f05451adc | [
"MIT"
] | null | null | null | ## @file
## @brief Smalltalk-like guest OS
## @defgroup ST
## @brief Smalltalk-like guest OS
## @{
import config
import os, sys
## core object
class Object:
def __init__(self, V):
## scalar: object name, string/number value,..
self.value = V
## associative array: map = env/namespace
... | 25.39196 | 89 | 0.59054 |
93ea0522093983dd25f14eaf2a71623a91db64c9 | 49 | py | Python | parse_ecli/__init__.py | kiersch/parse_ecli | ae2bfe0003e625a33845abc262480f81166aea92 | [
"MIT"
] | 2 | 2020-05-05T13:08:15.000Z | 2020-05-05T14:12:16.000Z | parse_ecli/__init__.py | kiersch/parse_ecli | ae2bfe0003e625a33845abc262480f81166aea92 | [
"MIT"
] | 1 | 2020-05-13T10:09:48.000Z | 2020-05-13T10:09:48.000Z | parse_ecli/__init__.py | kiersch/parse_ecli | ae2bfe0003e625a33845abc262480f81166aea92 | [
"MIT"
] | null | null | null | from .parse_ecli import *
from .pattern import *
| 16.333333 | 25 | 0.755102 |
9e07569b3f70937ddef7182666c7c5ea4fc86dbf | 457 | py | Python | TrunOff-master/rest.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | TrunOff-master/rest.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | TrunOff-master/rest.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os, sys, time
os.system('clear')
try:
print("\n[1] Restart Hp")
print("[2] Shutdown Hp")
ask=input("[!] Masukan Pilihan Anda: ")
if ask == '1':
os.system('clear')
print("[!] Wait 5 second")
time.sleep(5)
os.system('/system/bin/reboot')
elif ask == '2':
os.system('clear')
print("[!] Wait 5 seco... | 19.869565 | 43 | 0.606127 |
5fdc910c8a7b5b7f83990ce133e66540ec7e6aa9 | 12,177 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/traci/_vehicletype.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/traci/_vehicletype.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/traci/_vehicletype.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # -*- coding: utf-8 -*-
# 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.... | 34.891117 | 118 | 0.652377 |
8bfc80916ce4dfbe3fc0a2486dcf53a1e08d0cdd | 275 | py | Python | Assignments/Assignment 4/Assignment4.py | ryan-gonfiantini/CMPT-120L-902-21S | e5807251e26ce422ce0c70f99ac62661b5881c18 | [
"MIT"
] | null | null | null | Assignments/Assignment 4/Assignment4.py | ryan-gonfiantini/CMPT-120L-902-21S | e5807251e26ce422ce0c70f99ac62661b5881c18 | [
"MIT"
] | null | null | null | Assignments/Assignment 4/Assignment4.py | ryan-gonfiantini/CMPT-120L-902-21S | e5807251e26ce422ce0c70f99ac62661b5881c18 | [
"MIT"
] | null | null | null | #question 1
def sum_a_range(number):
total = 0
for num in range(number + 1):
total += num
return total
if __name__ == "__main__":
print(sum_a_range(8))
#question 2
def main():
x = int(input("Enter an integer: 5 + "))
print(str(x))
main()
| 15.277778 | 44 | 0.589091 |
8bc32d8566564d134ff7aeee042b195996805874 | 42 | py | Python | KEYS.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | null | null | null | KEYS.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | null | null | null | KEYS.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | null | null | null | TOKEN="Insert your TOKEN here"
PREFIX="!"
| 14 | 30 | 0.714286 |
47a614eda7f30c6463c30fd966c94978d5b4c25f | 169 | py | Python | exercises/ja/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # ドイツの言語クラスをインポート
from spacy.lang.de import German
# nlpオブジェクトを作成
nlp = German()
# テキストを処理(ドイツ語で「よろしく!」の意味)
doc = nlp("Liebe Grüße!")
# docのテキストをプリント
print(doc.text)
| 14.083333 | 32 | 0.727811 |
32807ec62891767b20fdae622936e30a15920f40 | 2,262 | py | Python | Packs/GoogleChronicleBackstory/Scripts/ChronicleAssetEventsForHostnameWidgetScript/ChronicleAssetEventsForHostnameWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleAssetEventsForHostnameWidgetScript/ChronicleAssetEventsForHostnameWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleAssetEventsForHostnameWidgetScript/ChronicleAssetEventsForHostnameWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from unittest.mock import patch
import ChronicleAssetEventsForHostnameWidgetScript
def test_main_success(mocker):
"""
When main function is called, set_arguments_for_widget_view should be called.
"""
mocker.patch.object(ChronicleAssetEventsForHostnameWidgetScript, 'set_arguments_for_widget_view'... | 32.314286 | 118 | 0.736958 |
08b45e621aaaa703317309d11bb0cc1b1d7cf840 | 974 | py | Python | src/test/tests/session/sessionexpression.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/session/sessionexpression.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/session/sessionexpression.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: sessionexpression.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - Pseudocolor
#
# Notes: This test case creates a plot of a user-defined expression
# ... | 36.074074 | 88 | 0.517454 |
f5b1943a6cdc245b88917d0bff4bba29558a98a8 | 481 | py | Python | pacman-arch/test/pacman/tests/sync011.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/sync011.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/sync011.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install a package from a sync db with cascaded dependencies + provides"
sp1 = pmpkg("dummy", "1.0-2")
sp1.depends = ["dep1", "dep2=1.0-2"]
sp2 = pmpkg("dep1")
sp2.files = ["bin/dep1"]
sp2.provides = ["dep2"]
sp3 = pmpkg("dep2", "1.0-2")
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p);
self.a... | 22.904762 | 91 | 0.66736 |
f5e93a1c31c77b98b93917a7d4008ab737666890 | 694 | py | Python | logs.py | jayelm/rl-starter-files | 045302672e6ae5f4704afce56b788a67393dcc52 | [
"MIT"
] | null | null | null | logs.py | jayelm/rl-starter-files | 045302672e6ae5f4704afce56b788a67393dcc52 | [
"MIT"
] | null | null | null | logs.py | jayelm/rl-starter-files | 045302672e6ae5f4704afce56b788a67393dcc52 | [
"MIT"
] | null | null | null | """
Logger class
"""
import logging
import tqdm
logging.basicConfig(
format="%(asctime)s %(name)-8s %(levelname)-8s %(message)s",
level=logging.DEBUG,
datefmt="%Y-%m-%d %H:%M:%S",
)
class TqdmLoggingHandler(logging.Handler):
def __init__(self, level=logging.NOTSET):
super().__init__(level)
... | 19.828571 | 64 | 0.602305 |
19c2b29f9e10afd20ca84d7f30239c637f49fe46 | 2,340 | py | Python | restful01/app.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | restful01/app.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | restful01/app.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from flask import Flask,jsonify,abort,request
from flask_script import Manager
app = Flask(__name__)
manager = Manager(app)
from flask_httpauth import HTTPBasicAuth
auth = HTTPBasicAuth() #创建一个认证对象
#进行认证
@auth.verify_password
def verify_password(username,password):
if username=='nikun' and password == 'kangbazi':... | 22.718447 | 88 | 0.616239 |
19d4b980a12cce8fbe7a5f00a0695f76ec888ad1 | 653 | py | Python | src/onegov/feriennet/views/auth.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/auth.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/auth.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public
from onegov.feriennet import FeriennetApp, _
from onegov.org.views.auth import handle_registration
from onegov.user import Auth
from onegov.user.forms import RegistrationForm
@FeriennetApp.form(
model=Auth, name='register', template='form.pt',
permission=Public, form=Re... | 34.368421 | 76 | 0.7366 |
c24b0095d48dd819984cda19052dc890a2ec56e3 | 132,716 | py | Python | old/baxter_utils_3.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | old/baxter_utils_3.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | old/baxter_utils_3.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | """baxterロボットの色々関数とクラス
・順運動学写像,ヤコビ行列など
・無印よりちょっと速い
"""
import numpy as np
from math import cos, sin, tan, pi, sqrt
class BaxterKinematics3:
"""ローカル座標系の原点,ヤコビ行列等を計算
・ちょっとはやい
"""
L = 278e-3
h = 64e-3
H = 1104e-3
L0 = 270.35e-3
L1 = 69e-3
L2 = 364.35e-3
L3 = 69e-3
L4 = 3... | 275.344398 | 6,124 | 0.585318 |
cd27e7785b5190680fd8a44a331cd157a78b46d5 | 1,408 | py | Python | tarefas-poo/lista-03/navio/model/container.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/model/container.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/model/container.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício do Navio
# --------------------------
# Classe que representa um container.
#
class Container:
'''Um container é caracterizado pelo seu código de identificação,
se é refrigerado ou não e pelo peso das mercadorias que ele armazena.
'''
... | 32 | 96 | 0.608665 |
f82d021bcd4854aae331db1d0e168681884709c6 | 1,216 | py | Python | us2/python/herz.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | us2/python/herz.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | us2/python/herz.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import sem
from uncertainties import ufloat
import uncertainties.unumpy as unp
# edv ist das kleinere
amp, t = np.genfromtxt('python/daten/herzwelle.txt', unpack=True)
amp *=10**(-3)
tiefe = 44.46*10**(-3)
durch = 49.4*10**(-3)
radius = durch/2
area ... | 23.384615 | 65 | 0.63898 |
f8a04d4fd0eca8cd06c63738df7d553714fe0953 | 6,268 | py | Python | service/wkb/ChatSoldHelp/more_friends.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/ChatSoldHelp/more_friends.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/ChatSoldHelp/more_friends.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re,csv,sys,time,itchat,os
from itchat.content import *
#通过如下命令登陆,即使程序关闭,一定时间内重新开启也可以不用重新扫码。
#在手机端点击下线才下线
itchat.auto_login(hotReload=False)
#获取好友基础信息
friends=itchat.get_friends(update=True)
print(len(friends))
##信息分析
#wkb=friends[1]
#print("18253995666" in wkb.RemarkName)#True
#
##手机... | 30.72549 | 141 | 0.59381 |
e44ad41fad8e996efe4a3719fe2f27552e5a2100 | 5,077 | py | Python | 2021-05-09/城市地图带后端/城市地图后端/awesome_coffice/settings.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 395 | 2017-02-24T02:59:29.000Z | 2022-03-31T15:48:19.000Z | 2021-05-09/城市地图带后端/城市地图后端/awesome_coffice/settings.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 7 | 2020-03-17T08:33:00.000Z | 2021-09-02T23:10:46.000Z | 2021-05-09/城市地图带后端/城市地图后端/awesome_coffice/settings.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 235 | 2017-03-14T03:31:38.000Z | 2022-03-29T16:14:51.000Z | """
Django settings for awesome_coffice project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
i... | 27.743169 | 91 | 0.700611 |
f261ddac49ce06fdcdcc3b186734d5db59ba3e48 | 730 | py | Python | 21-fs-ias-lec/03-BACnetCore/src/replication/message_container.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/03-BACnetCore/src/replication/message_container.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/03-BACnetCore/src/replication/message_container.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import cbor2
class MessageContainer:
"""
The message container deals with the serialization and deserialization of data within the
CBOR format.
"""
def __init__(self, protocol_instruction, data):
self.protocol_instruction = protocol_instruction
self.data = data
@classmethod
... | 30.416667 | 113 | 0.705479 |
298dbc6f75fc84be998eb774db3c351d57459f5b | 70 | py | Python | Pilektion.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | Pilektion.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | Pilektion.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | import wx
import wx.grid
table = [[1, 2, 3],[4, 5, 6]]
print(table)
| 10 | 29 | 0.585714 |
29ca71bd88e963783ce054f395dee730b5d513ae | 6,114 | py | Python | frappe-bench/apps/erpnext/erpnext/crm/doctype/lead/lead.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/crm/doctype/lead/lead.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/crm/doctype/lead/lead.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import (cstr, validate_email_add, cint, comma_and, has_gravatar, now, getdate, nowdate)
from frappe... | 30.267327 | 105 | 0.718024 |
d9e0fe4e953a6b2f4619ab8897357f750315c331 | 10,124 | py | Python | lale/lib/sklearn/voting_classifier.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 265 | 2019-08-06T14:45:43.000Z | 2022-03-30T23:57:48.000Z | lale/lib/sklearn/voting_classifier.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 467 | 2019-08-08T02:01:21.000Z | 2022-03-25T16:12:00.000Z | lale/lib/sklearn/voting_classifier.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 81 | 2019-08-07T19:59:31.000Z | 2022-03-31T09:11:58.000Z | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.202703 | 146 | 0.490419 |
8a9aa62087a6163140e71d0a01c6ce3ec95e9860 | 311 | py | Python | Algorithms/Implementation/Strange.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Strange.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Strange.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
t = int(raw_input())
#非常机智的解法
rem = 3
while t > rem:
t -= rem
rem *= 2
#t一定比rem小
print rem - t + 1
'''
n = 0
while 1:
Sum_cur = 3 * (2**n - 1)
a_fur = 3 * 2**n
if Sum_cur + a_fur >= t:
diff = t - Sum_cur
print a_fur - diff + 1
break
n += 1
'''
| 12.44 | 30 | 0.466238 |
6ac6f01782711eb15395361004a78ee2cd3ba5b2 | 491 | py | Python | INBa/2014/Andreev_F_I/task_2_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/Andreev_F_I/task_2_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/Andreev_F_I/task_2_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2, Вариант 2
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Эсхин. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Андреев Ф.И.
# 23.05.2016
print (''' Речи благородного человека, даже если они составле... | 49.1 | 199 | 0.763747 |
0a86fea8d7c7bfa1b0d00c6391f6961ebdbc04be | 8,017 | py | Python | scrapers/parse_scrape_output.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/parse_scrape_output.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/parse_scrape_output.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 1 | 2020-08-25T06:45:56.000Z | 2020-08-25T06:45:56.000Z | #!/usr/bin/env python3
import datetime
import sys
import traceback
import scrape_matrix as sm
from scrape_dates import parse_date
abbr = None
url_sources = []
scrape_time = None
date = None
cases = None
tested = None
deaths = None
recovered = None
hospitalized = None
new_hosp = None
icu = None
vent = None
isolated = ... | 32.99177 | 128 | 0.552077 |
0aeb4ac26e4691dc94f0fe341c2d20476570e02b | 337 | py | Python | SleekSecurity/layers/plugins/fingerprint/language/ruby.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/language/ruby.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/language/ruby.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt
from re import findall,I
def ruby(content):
_ = findall(r'\<a href\=\S*(\.rb|\.rhtml)',content,I)
if _ != ... | 25.923077 | 54 | 0.632047 |
7c3d666595ee8e0209a590b5597a7372059193b3 | 1,815 | py | Python | gateway-os/software/brain-module/src/utils.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | 1 | 2018-04-29T22:33:42.000Z | 2018-04-29T22:33:42.000Z | gateway-os/software/brain-module/src/utils.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | gateway-os/software/brain-module/src/utils.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | ## IMPORTS ##
import argparse # Argparse: the recommended command-line parsing module
# argumentParserFactory
# ------------
# Handles ArgumentParser creator
#
# returns {ArgumentParser}: The parser created
def argumentParserFactory():
# Creates an argument parser
parser = argparse.ArgumentParser(description="captur... | 56.71875 | 158 | 0.734986 |
7cc219796cf7209ce32abe021fb86999eab2630b | 599 | py | Python | BITs/2014/Kozlov_A_D/task_3_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Kozlov_A_D/task_3_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Kozlov_A_D/task_3_11.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 3. Вариант 11.
#Напишите программу, которая выводит имя "Анна Андреевна Горенко", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
#Козлов А.Д.
#01.03.2016
print("Герой программы на этот раз - Анна Андреевна Горенко\nПо... | 39.933333 | 207 | 0.751252 |
6b448417734f940922223581538b8ef6ed43df97 | 5,874 | py | Python | 2-resources/__DATA-Structures/Code-Challenges/cc77lruCache/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc77lruCache/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc77lruCache/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # https://piazza.com/class/j63w1pdyopf7kj?cid=93
# https://youtu.be/tg4JEUsYKSM
# Original solution that leverages our homebrew doubly-linked list:
"""Our LRUCache class keeps references to the max limit of nodes it
can hold, the current number of nodes it is holding, a doubly-linked
list that holds the nodes in the c... | 31.751351 | 196 | 0.660878 |
8636d9976270b47ab6418431156c9c36c0eeb441 | 539 | py | Python | api/views.py | nathanwelsh8/guts_2021_hackathon | d875000051a423db4a4bb1a8df35d6d9a9e9db63 | [
"MIT"
] | 1 | 2021-02-05T15:58:02.000Z | 2021-02-05T15:58:02.000Z | api/views.py | nathanwelsh8/guts_2021_hackathon | d875000051a423db4a4bb1a8df35d6d9a9e9db63 | [
"MIT"
] | null | null | null | api/views.py | nathanwelsh8/guts_2021_hackathon | d875000051a423db4a4bb1a8df35d6d9a9e9db63 | [
"MIT"
] | 2 | 2021-02-05T20:27:48.000Z | 2021-03-31T19:58:07.000Z | from django.utils import timezone
from rest_framework import generics, response
from rest_framework.permissions import IsAuthenticated
from . import serializers
class Profile(generics.RetrieveAPIView):
permission_classes = (IsAuthenticated,)
serializer_class = serializers.User
def get_object(self):
... | 25.666667 | 69 | 0.753247 |
d48eb6b831ba3ec5d1a79c2df124e61d75157378 | 571 | py | Python | src/onegov/winterthur/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public
from onegov.winterthur import WinterthurApp, _
from onegov.org.layout import DefaultLayout
from onegov.winterthur.roadwork import RoadworkConnectionError
@WinterthurApp.html(
model=RoadworkConnectionError,
permission=Public,
template='roadwork_connection_error.pt')
... | 27.190476 | 62 | 0.749562 |
d4d88e630779a77383c73075bbe2d2fcdd55cda3 | 653 | py | Python | cbm/ipycbm/ipy_qa/qa_main.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/ipycbm/ipy_qa/qa_main.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/ipycbm/ipy_qa/qa_main.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
from ipywidgets import Tab
from cbm.ipycbm.utils import s... | 25.115385 | 66 | 0.679939 |
92e6a25ef9f123d40985847cf77e561a60e0594f | 1,079 | py | Python | site/public/courses/CS-1.1/Projects/herdimmunity_starter_term2_2019/Person.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.1/Projects/herdimmunity_starter_term2_2019/Person.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.1/Projects/herdimmunity_starter_term2_2019/Person.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | import random
from Virus import Virus
class Person:
''' The simulation will contain people who will make up a population.'''
def __init__(self, is_vaccinated, infection=None):
''' We start out with is_alive = True
All other values will be set by the simulation through the parameters wh... | 41.5 | 142 | 0.668211 |
13ca2094b66b07e82051bed46fc525c0231a8d30 | 140 | py | Python | data_tests/saved__backend__py3.9/python/type_hint_notemplate.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/python/type_hint_notemplate.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__/python/type_hint_notemplate.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | def compute(a, b, c, d, e):
print(e)
tmp = a + b
if 1 and 2:
tmp *= 2
return tmp
__transonic__ = ("0.3.0.post0",)
| 14 | 32 | 0.478571 |
13f399ff7746a01e2cf416b3d2ac9faf1df5e4d4 | 459 | py | Python | Packs/VerifyIPv4Indicator/Scripts/VerifyIPv4Indicator/VerifyIPv4Indicator_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/VerifyIPv4Indicator/Scripts/VerifyIPv4Indicator/VerifyIPv4Indicator_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/VerifyIPv4Indicator/Scripts/VerifyIPv4Indicator/VerifyIPv4Indicator_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from VerifyIPv4Indicator import main
def test_main(mocker):
"""
Given:
- MAC Address as input
When:
- Running the script
Then:
- Ensure the MAC address is caught as invalid IPv4 and returns empty string
"""
mocker.patch.object(demisto, 'arg... | 25.5 | 83 | 0.657952 |
b95b0bf577111272c462390c96f91b73af211260 | 619 | py | Python | Lehrjahr_2/Modul_122/python/strings.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 5 | 2015-05-19T14:26:53.000Z | 2016-06-24T17:03:03.000Z | Lehrjahr_2/Modul_122/python/strings.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | null | null | null | Lehrjahr_2/Modul_122/python/strings.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 6 | 2015-05-26T06:25:05.000Z | 2020-04-30T07:25:30.000Z | #!/usr/bin/python3.4
#
#SCRIPT: strings.py
#AUTHOR: Severin Kaderli
#PURPOSE: Some fun with strings
#USAGE: ./strings.py
#String ausgeben
ausgabe = "Python lernen!"
print(ausgabe)
print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
#Strings sind in Python indexiert
print(ausgabe[0])
print(ausgabe[5] + " " + ausgabe[3])
#Letztes ... | 21.344828 | 50 | 0.747981 |
b9b058304f16971954814ee86fc78d266eba43be | 2,511 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/facts/facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/facts/facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/facts/facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The facts class for exos
this file validates each subset of facts and selectively
calls the appropriate facts gathering function
"""
from __future__ import absolute_impor... | 40.5 | 142 | 0.784548 |
0eba942a21a677213e5490bb85e771e139e3adeb | 779 | py | Python | largest-rectangle.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | largest-rectangle.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | largest-rectangle.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null |
import sys
def largestRectangle(height):
# # Complete this function
largest_area = 0
stack = []
top = 0
stack_next = 0
i = 0
while(i <= len(h)):
if(not stack or ( i < len(h) and h[i] > h[stack[-1]])):
stack.append(i)
i += 1
else:
top = st... | 23.606061 | 63 | 0.45828 |
914e200c0bad6de9f6bd9f30bd8b14286a7b40c8 | 2,065 | py | Python | Praxisseminar/plc1.py | EnjoyFitness92/Praxisseminar-SS2020 | b5baba5d1512a5fad3391efc42f3ab232d79c4e2 | [
"MIT"
] | null | null | null | Praxisseminar/plc1.py | EnjoyFitness92/Praxisseminar-SS2020 | b5baba5d1512a5fad3391efc42f3ab232d79c4e2 | [
"MIT"
] | 2 | 2020-06-24T13:01:22.000Z | 2020-06-24T13:10:07.000Z | Praxisseminar/plc1.py | EnjoyFitness92/Praxisseminar-SS2020 | b5baba5d1512a5fad3391efc42f3ab232d79c4e2 | [
"MIT"
] | null | null | null | """
Praxisseminar plc1.py
"""
from minicps.devices import PLC
from utils import PLC1_DATA, STATE
from utils import PLC1_PROTOCOL, PLC1_ADDR
from utils import Praxisseminar_test_logger
from utils import MOTOR_VEL
import time
# constant tag addresses
SENSOR = ('SENSOR', 1)
MOTOR = ('MOTOR', 1)
# Die Klasse des Flie... | 28.287671 | 119 | 0.597094 |
fc5c7b819b4df6b5e1eedf266562aa7cced8bbcb | 635 | py | Python | Python/Sorting/bubble_sort.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | 1 | 2019-02-26T16:19:32.000Z | 2019-02-26T16:19:32.000Z | Python/Sorting/bubble_sort.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | null | null | null | Python/Sorting/bubble_sort.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | 1 | 2019-01-15T02:50:17.000Z | 2019-01-15T02:50:17.000Z | """
Bubble Sort
-----------
A naive sorting that compares and swaps adjacent elements.
Time Complexity: O(n**2)
Space Complexity: O(1) Auxiliary
Stable: Yes
Psuedo code: http://en.wikipedia.org/wiki/Bubble_sort
"""
def sort(seq):
"""
Takes a list of integers and sorts them in ... | 20.483871 | 75 | 0.565354 |
db82f9e9fa057d14f4b7c54917e649dc4d6da700 | 1,482 | py | Python | app.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 1 | 2019-07-30T14:39:43.000Z | 2019-07-30T14:39:43.000Z | app.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 11 | 2019-07-31T13:40:30.000Z | 2019-08-07T21:54:52.000Z | app.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | null | null | null | import os
import click
from logging import getLogger
from web import create_app, db
from web.models import Product, StockMovement
logger = getLogger(__name__)
logger.info('creating app')
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
basedir = os.path.abspath(os.path.dirname(__file__))
def get_all_products... | 24.295082 | 75 | 0.610661 |
dbd34d54d1865853ef913965793f38f241f8b6a0 | 208 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
for doc in frappe.get_all("Sales Order", filters={"docstatus": 1,
"order_type": "Maintenance"}):
doc = frappe.get_doc("Sales Order", doc.name)
doc.set_status(update=True)
| 26 | 66 | 0.706731 |
91bc0c7b4a79f92c35f7d6b2c7364688acff7c36 | 920 | py | Python | python_gui_tkinter/Tkinter/TkinterCourse/54_events.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/Tkinter/TkinterCourse/54_events.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/Tkinter/TkinterCourse/54_events.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
A Tkinter application runs most of its time inside an event loop, which is entered via the mainloop method. It waiting for events to happen. Events can be key presses or mouse operations by the user.
Tkinter provides a mechanism to let the programmer deal with events. For each widget, it's possible to bind Python ... | 32.857143 | 199 | 0.716304 |
37fc0c69a139d05b7031ce7a35bf4c9f2538cf0f | 6,098 | py | Python | python/oneflow/compatible/single_client/test/ops/test_fused_self_attention_query_mul_key_and_value.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_fused_self_attention_query_mul_key_and_value.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_fused_self_attention_query_mul_key_and_value.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... | 33.322404 | 87 | 0.613152 |
53678da7d79118eef4d23adae0d439b0980093d7 | 517 | py | Python | python_experiments/paper_figures/tkde/tkde_common.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/paper_figures/tkde/tkde_common.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/paper_figures/tkde/tkde_common.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import json
import os
def get_name_dict():
with open('data_names.json') as ifs:
return eval(''.join(ifs.readlines()))
# data set abbreviation dictionary
data_names = get_name_dict()
# figure parameters
FIG_SIZE_MULTIPLE = (32, 4)
LABEL_SIZE = 22
TICK_SIZE = 22
LEGEND_SIZE = 22
os.system('mkdir -p {}'.... | 20.68 | 64 | 0.72147 |
f42c8fb0abef98812834ab0db334278514008bd0 | 13,034 | py | Python | Packs/GenericSQL/Integrations/GenericSQL/GenericSQL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GenericSQL/Integrations/GenericSQL/GenericSQL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GenericSQL/Integrations/GenericSQL/GenericSQL.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 *
from CommonServerUserPython import *
from typing import Any, Tuple, Dict, List, Callable, Optional
import sqlalchemy
import pymysql
import traceback
import hashlib
import logging
from sqlalchemy.sql import text
from sqlalchemy.engine.url import URL
from ur... | 43.446667 | 124 | 0.650222 |
be799af319b778d858398d97f915b0f987cf3f8c | 382 | py | Python | gshiw/quotes_web/quotes/migrations/0002_auto_20171211_2237.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/quotes/migrations/0002_auto_20171211_2237.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/quotes/migrations/0002_auto_20171211_2237.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-11 14:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('quotes', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_... | 19.1 | 48 | 0.602094 |
22c1c9ec65fba231ad63caa8b47fe6eb11856e33 | 1,093 | py | Python | app/__init__.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | app/__init__.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | app/__init__.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | import os
from flask import Flask, redirect,g
from app.db.dbMySQL import MySQLUser,MySQLToken
from app.utils.temp_toke import perpetualTimer
def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True,static_url_path='/static')
app.config.from_mapp... | 26.02381 | 82 | 0.661482 |
fe0afa7ffcfacf351c193e681a08eb6d7b3e6846 | 2,130 | py | Python | scrapers/scrape_fl.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_fl.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_fl.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
import scrape_common as sc
import sys
import re
# get latest from list with all press releases
d = sc.download('https://www.regierung.li/coronavirus', silent=True)
pdf_url = sc.find(r'<a.*?href="([^"]+\.pdf)[^"]*"[^>]*?>[^<]+?Situationsbericht[^<]+?<\/a>', d)
if pdf_url:
# download latest... | 38.035714 | 143 | 0.658216 |
432f930bb467d500107b461b2dbde9c8482666dd | 3,234 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex04_find_way_out.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex04_find_way_out.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex04_find_way_out.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def get_at(values, x, y):
return values[y][x]
def print_array(values):
for y in range(0, len(values)):
for x in range(0, len(values[y])):
value = get_at(values, x, y)
print(value, end='')
... | 30.8 | 64 | 0.38961 |
4386b5b798c0cbefa688fae520cd3cc958d0561d | 213 | py | Python | src/python/py-accepted/112A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/112A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/112A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 112A
# Created on : 2019-01-14 21:45:38
def Main():
a, b = input().lower(), input().lower()
print(-1 if a < b else 1 if b < a else 0)
if __name__ == '__main__':
Main()
| 16.384615 | 45 | 0.539906 |
43946e8f3e8db97aefb1ac95fc53ad9b7415971a | 846 | py | Python | archives/codelibraries/cp-geo-master/compile-figs.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | archives/codelibraries/cp-geo-master/compile-figs.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | archives/codelibraries/cp-geo-master/compile-figs.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | from glob import glob
import os
HEADER = r"""\documentclass[a4paper,11pt]{standalone}
\usepackage[utf8]{inputenc}
\input{preamble}
\input{tikz/general-setup}
\begin{document}
"""
FOOTER = r"""\end{document}
"""
FIGS_PATH = "*/figs/*.tex"
OUT_DIR = "figs-out"
COMPILE = "pdflatex -output-directory={} ".format(OUT_DIR)
... | 29.172414 | 103 | 0.648936 |
60517ee296453a813018ccc928d0c8441f33d030 | 4,256 | py | Python | books/PythonCleanCode/ch7_generator/test_generators_coroutines.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/test_generators_coroutines.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/test_generators_coroutines.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Tests for generators_coroutines_*.py"""
from unittest import TestCase, main, mock
from generators_coroutines_1 import (CustomException, DBHandler, stream_data,
stream_db_records)
from generators_coroutines_2 import auto_stream_db_records
from generators_coroutines_2 import... | 32.48855 | 78 | 0.645677 |
e084300e2eaff859cc8a1b96173c5f9d2beb41eb | 319 | py | Python | Hackerrank_problems/loops/Solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/loops/Solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/loops/Solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z |
if __name__ == '__main__':
n = int(input())
for integer in range(n): #run the loop for n times.
square = integer * integer # multiply integer * integer which will give you square of number and store it into square variable.
print(square) # print the result.
| 35.444444 | 139 | 0.592476 |
1ccecf97ae1d2093168b6b0077a6e8b2f08ac97a | 8,071 | py | Python | Utils/compiledb-generator/compiledb-gen-parser.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/compiledb-generator/compiledb-gen-parser.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/compiledb-generator/compiledb-gen-parser.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z | #!/usr/bin/env python2
#
# compiledb-generator: Tool for generating LLVM Compilation Database
# files for make-based build systems.
#
# Copyright (c) 2017 Nick Diego Yamane <nick.diego@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General P... | 34.639485 | 146 | 0.600173 |
e8135f0e78c92d5e54773c08aceee5b7c17592bd | 9,012 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/cadytsIterate.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/assign/cadytsIterate.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/assign/cadytsIterate.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-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 avail... | 52.395349 | 118 | 0.610519 |
4055f0f2b41c0a23147c9ce873b93a7de9835db5 | 2,847 | py | Python | imwievaluation/tests/test_lecture.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/tests/test_lecture.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/tests/test_lecture.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | from sqlalchemy.orm.session import Session
from tests.database_test import DatabaseTest
from lecturer import Lecturer
from lecture import Lecture
from student import Student
from semester import Semester
from spreadsheet import SpreadsheetHandler
from unittest.mock import MagicMock
class TestLecture(DatabaseTest):
... | 38.472973 | 91 | 0.690551 |
d3bea013d45ab3cd987dd977b0bfd1660dd3c192 | 30,675 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/simpla/_platoonmanager.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/simpla/_platoonmanager.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/simpla/_platoonmanager.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2017-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 49.396135 | 120 | 0.581222 |
3120f3cfd41215ce842d6988028b8e2a316319e1 | 3,172 | py | Python | chapter5/mnistsoftmax.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | 1 | 2020-02-16T13:31:42.000Z | 2020-02-16T13:31:42.000Z | chapter5/mnistsoftmax.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | chapter5/mnistsoftmax.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2019/2/16 17:20
# @Author : LunaFire
# @Email : gilgemesh2012@gmail.com
# @File : mnistsoftmax.py
import os
import numpy as np
import matplotlib.pyplot as plt
from keras.datasets import mnist
from keras.utils import np_utils
from keras.models import Sequential, load_model
f... | 27.111111 | 90 | 0.645019 |
3143cff5cde299b69b60531786ce6b14e0732242 | 105 | py | Python | data_tests/saved__backend__py3.9/python/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/python/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__/python/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
def func(a, b):
return (a * np.log(b)).max()
__transonic__ = ("0.3.0.post0",)
| 11.666667 | 32 | 0.580952 |
319ddea331a58a34b523aac295cdc1039bb7db31 | 4,794 | py | Python | algos/walker.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | 1 | 2021-07-22T10:28:40.000Z | 2021-07-22T10:28:40.000Z | algos/walker.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | null | null | null | algos/walker.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
from helper_functions import graph_helper_functions as gh
SUBTREE_SPACING = 1
NODE_SPACING = 1
def run(path, figsize=(20, 20), key=None):
G, root = gh.load_file(path, key=key)
print("Calculate Postions in Tree...")
pos = tr... | 28.035088 | 101 | 0.540676 |
b47d1e562105897882ec44a2b3364b8e8e0c5f9c | 2,913 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/hpilo/hponcfg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/hpilo/hponcfg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/hpilo/hponcfg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 24.897436 | 92 | 0.621009 |
c3140910f899e4e313c65fda176216d932583108 | 500 | py | Python | tensorflow/TensorFlow-Tutorials-1/00_multiply.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 23 | 2017-07-07T07:00:52.000Z | 2022-03-09T06:49:17.000Z | TensorFlow-Tutorials/00_multiply.py | zhwhong/awesome-deep-learning | ba4302a8d65ac8b63627bcfa8e3b23871fa2c390 | [
"CC0-1.0"
] | null | null | null | TensorFlow-Tutorials/00_multiply.py | zhwhong/awesome-deep-learning | ba4302a8d65ac8b63627bcfa8e3b23871fa2c390 | [
"CC0-1.0"
] | 26 | 2017-06-13T01:44:24.000Z | 2021-06-17T18:11:26.000Z | #!/usr/bin/env python
import tensorflow as tf
a = tf.placeholder("float") # Create a symbolic variable 'a'
b = tf.placeholder("float") # Create a symbolic variable 'b'
y = tf.multiply(a, b) # multiply the symbolic variables
with tf.Session() as sess: # create a session to evaluate the symbolic expressions
print... | 38.461538 | 117 | 0.688 |
489a3640dddef1addb028b562391dd6c8efe625c | 8,694 | py | Python | backend/alembic/versions/9586bf705fdf_first_commit.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/alembic/versions/9586bf705fdf_first_commit.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/alembic/versions/9586bf705fdf_first_commit.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | """First commit
Revision ID: 9586bf705fdf
Revises: 7047f90165ed
Create Date: 2021-09-15 14:57:38.094475
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.engine.reflection import Inspector
# revision identifiers, used by Alembic.
revision = "9586bf705fdf"
down_revision = "7047f90165ed"
branch_labels... | 39.339367 | 86 | 0.557396 |
5b145c5b21c8689bb1749216f92633a8c4040654 | 2,213 | py | Python | research/cv/dem/src/accuracy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/dem/src/accuracy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/dem/src/accuracy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.981481 | 108 | 0.699955 |
d2d07f242156ee70bbf314febbc73ef570f3c30d | 4,280 | py | Python | Server/ValveHandler.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/ValveHandler.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/ValveHandler.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | import JsonWriter
import time
from datetime import datetime
import json
import jsonDataReader
def calcuteValveStatus():
while(True):
t = getTime(JsonWriter.getTimestamp())
print(t)
#Standardfall
if (t.hour < 8 or t.hour > 18):
#hier dann noch die Helligkeit abfragen
... | 39.62963 | 140 | 0.563785 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.