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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7b2b35c44756910a057cd93fab531127ddfb5bec | 2,669 | py | Python | DataProcessor.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | DataProcessor.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | DataProcessor.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
from networktables import NetworkTables
style.use('dark_background')
# Connect to the Raspberry Pi
NetworkTables.initialize(server='192.168.0.37')
nt = NetworkTables.getTable('IMU_Data')
# Initia... | 24.712963 | 99 | 0.557887 |
7b3a63f22e86efa4cec99cd4228bac09af3071c7 | 1,151 | py | Python | python_reference/useful_scripts/ping.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | python_reference/useful_scripts/ping.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | python_reference/useful_scripts/ping.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | # Example run:
# ~/Desktop >sudo python3 ping.py
# 0.017251014709472656
# Original source: https://gist.github.com/pyos/10980172
import time
import random
import select
import socket
def chk(data):
x = sum(a + b * 256 for a, b in zip(data[::2], data[1::2] + b'\x00')) & 0xFFFFFFFF
x = (x >> 16) + (x & 0xFF... | 28.775 | 86 | 0.573414 |
cda289ffa7186b6ccc7512aef8020d382acd71b2 | 2,007 | py | Python | src/test/tests/meshtype/globe.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/meshtype/globe.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/meshtype/globe.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: globe.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - pc, contour, mat subset, mesh, vector
# operators - none
# selection - none
#
# D... | 23.611765 | 78 | 0.626308 |
a8205defa684c0252f060006e7d905fb5ea2f475 | 624 | py | Python | Algorithms/Strings/sherlock_and_the_valid_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/sherlock_and_the_valid_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/sherlock_and_the_valid_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import Counter, OrderedDict, defaultdict
from operator import itemgetter
S = Counter(input().strip())
cnt = defaultdict(int)
for k, v in S.items():
cnt[v] += 1
common_val = max(cnt.items(), key=itemgetter(1))[0] # cnt -> key means S -> values
words = OrderedDict(S)
possibl... | 21.517241 | 83 | 0.596154 |
a94db521a3b288b011a7b2cf0fce7af15615f6fc | 3,648 | py | Python | scripts/initialisation/initGroupsAndPermissions.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | scripts/initialisation/initGroupsAndPermissions.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | scripts/initialisation/initGroupsAndPermissions.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Initialise the Groups and Permissions after the models have been initialised in the database.
Permissions are initialised with the models itself.
Do the assignment of groups here, not in the Admin-Surface!
'''
import os
import sys
import django
if __name__ == '__main__':
# Setup the D... | 23.535484 | 94 | 0.725603 |
fd9e02d4c3a61e826fb9589b5172d1397807bfef | 597 | py | Python | Python/Courses/Crash-Course-on-Python.Google/week-2-Basic-Python-Syntax/05-Returning-Values.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-2-Basic-Python-Syntax/05-Returning-Values.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-2-Basic-Python-Syntax/05-Returning-Values.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def area_triangle(base: float, height: float) -> float:
return base * height / 2
area_a = area_triangle(5, 4)
area_b = area_triangle(7, 3)
result = area_a + area_b
print(f"The sum of both areas is: {result}")
def convert_seconds(seconds: int) -> [int, int, int]:
hours = seconds // 3600
minutes = (second... | 25.956522 | 61 | 0.698492 |
4764e4f2253a56e30501483b4992d4e4fb2a7637 | 1,557 | py | Python | robolib/modelmanager/downloader.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/modelmanager/downloader.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/modelmanager/downloader.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import os.path
from urllib.request import urlretrieve
import robolib.datamanager.datadir as datadir
def get_model(model, delete=False):
filename = datadir.get_opencv_dir(model["name"])
if delete and os.path.isfile(filename):
print("Delete-Mode is on. Deleting file")
os.remove(filename)
if ... | 39.923077 | 120 | 0.716121 |
328f2037ab0b1cfb0b0cfe88d2da43e6a5c03fe5 | 20,511 | py | Python | Keith/Open Street Map.py | FabianV1984/TheMostDangerousSwissRoad | e5ffdb6fae39c60d8b5d6247e9d2839f8103df98 | [
"MIT"
] | null | null | null | Keith/Open Street Map.py | FabianV1984/TheMostDangerousSwissRoad | e5ffdb6fae39c60d8b5d6247e9d2839f8103df98 | [
"MIT"
] | null | null | null | Keith/Open Street Map.py | FabianV1984/TheMostDangerousSwissRoad | e5ffdb6fae39c60d8b5d6247e9d2839f8103df98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Open Street Map
#
# **Inhalt:** Daten aus einer Open Source Quelle ziehen
#
# **Nötige Skills**
# - Geopandatenhandling
#
# **Lernziele**
# - Einblick in Funktionsweise von OSM
# - Vor-Aufbereitete OSM-Shapefiles laden
# - Daten herunterladen mit `OSMnx`-Library
# In[1]:
... | 22.007511 | 235 | 0.723368 |
085fc1477e6cf99f1e85c7890502efc4afa69377 | 2,898 | py | Python | plugins/blur_thumbnails/blur_thumbnails.py | fernanluis/fernanluis.github.io | eb063d40f2893fb9dd5b22662f343827aa6b157a | [
"MIT"
] | 1 | 2021-02-15T12:19:44.000Z | 2021-02-15T12:19:44.000Z | plugins/blur_thumbnails/blur_thumbnails.py | fernanluis/fernanluis.github.io | eb063d40f2893fb9dd5b22662f343827aa6b157a | [
"MIT"
] | null | null | null | plugins/blur_thumbnails/blur_thumbnails.py | fernanluis/fernanluis.github.io | eb063d40f2893fb9dd5b22662f343827aa6b157a | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from pelican import signals
from PIL import Image, ImageFilter # importación de la librería pillow, pero como es un fork mantiene el nombre original y se importa image ImageFilter
# Function extracted from https://stackoverflow.com/a/19308592/7690767
def get_filepaths(directory, exte... | 45.28125 | 235 | 0.717046 |
08aa18acbbbe0ffe0965c4d08a495a80ef365597 | 867 | py | Python | common/models/stat/StatDailyFood.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 2 | 2019-06-10T08:57:47.000Z | 2021-06-12T16:22:15.000Z | common/models/stat/StatDailyFood.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | common/models/stat/StatDailyFood.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from sqlalchemy import Column, Date, DateTime, Index, Integer, Numeric
from sqlalchemy.schema import FetchedValue
from application import db
class StatDailyFood(db.Model):
__tablename__ = 'stat_daily_food'
__table_args__ = (
db.Index('date_food_id', 'date', 'food_id'),
)
id = ... | 43.35 | 100 | 0.740484 |
7245a310a58a42df5e2675b806a552f5c8390f42 | 798 | py | Python | migrations/versions/5c8457f2eac1_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/5c8457f2eac1_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/5c8457f2eac1_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: 5c8457f2eac1
Revises: ed6bb2084bbd
Create Date: 2020-07-13 19:01:04.770613
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "5c8457f2eac1"
down_revision = "ed6bb2084bbd"
branch_labels = None
depends_on = None
def upgrade():
# #... | 24.9375 | 87 | 0.679198 |
c24c102d1e20505dc1da9c9a28d00d06e2b5a4aa | 2,244 | py | Python | SOP/04/uebung.py | chfrank-cgn/FOM | 72ada98bb287b00807911a070a390964b681f099 | [
"CC-BY-4.0"
] | null | null | null | SOP/04/uebung.py | chfrank-cgn/FOM | 72ada98bb287b00807911a070a390964b681f099 | [
"CC-BY-4.0"
] | null | null | null | SOP/04/uebung.py | chfrank-cgn/FOM | 72ada98bb287b00807911a070a390964b681f099 | [
"CC-BY-4.0"
] | null | null | null | # Uebung 1
gerade = list(range(2,21,2))
ungerade = list(range(1,20,2))
print(gerade)
print(ungerade)
# Uebung 2
alle = gerade + ungerade
alle.sort()
print(alle)
# Uebung 3
a, b, c = gerade[:3]
print(a,b,c)
# Uebung 4
gerade_mal_zehn = [z*10 for z in gerade]
print(gerade_mal_zehn)
# Uebung 5
gerade[1::2] = gerade_ma... | 19.179487 | 78 | 0.690731 |
dfdac0f05b183a03860661fdf7672f4c67744180 | 175 | py | Python | angstrom/2021/misc/TI-1337_Nspire/constants.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2021/misc/TI-1337_Nspire/constants.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2021/misc/TI-1337_Nspire/constants.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import fractions
import math
pi = math.pi
tau = math.tau
e = math.e
phi = 1.618033988749895
sqrt2 = 1.414213562373095
planck = 6.62607015e-34
half = fractions.Fraction(1, 2)
| 15.909091 | 31 | 0.742857 |
dfdce5171cb8df78158c7870d4d6f1964c759137 | 1,887 | py | Python | RSS/controller/rssfeed.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 2 | 2020-02-26T01:54:26.000Z | 2020-04-27T20:09:14.000Z | RSS/controller/rssfeed.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 17 | 2020-02-29T02:43:44.000Z | 2020-04-27T20:38:44.000Z | RSS/controller/rssfeed.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 8 | 2020-02-26T21:37:36.000Z | 2020-06-23T00:01:27.000Z | import tkinter as tk
import os, sys
sys.path.append("../")
from RSS.view import userinterface as ui
from RSS.model.rssfeed import RssModel
from RSS.model.settings import SettingsModel
class RssController():
""" Class controller.rssfeed.RssController.
This class customizes the Tkinter root window. It creat... | 28.590909 | 81 | 0.653418 |
39d9a0d9cbca9e71a84ddf62d6f97d5a5713dded | 1,699 | py | Python | commom/utils.py | AlcindoSchleder/dashboard | aacb847bee05368bff72853a7d1887de211bccd2 | [
"MIT"
] | null | null | null | commom/utils.py | AlcindoSchleder/dashboard | aacb847bee05368bff72853a7d1887de211bccd2 | [
"MIT"
] | 4 | 2020-09-21T01:32:14.000Z | 2020-09-21T01:32:47.000Z | commom/utils.py | AlcindoSchleder/dashboard | aacb847bee05368bff72853a7d1887de211bccd2 | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
import datetime
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
class Utilities:
@staticmethod
def check_username(first_name: str, last_name: str) -> str:
if first_name is None or first_name == '' or \
... | 32.056604 | 81 | 0.500883 |
081f273114beb25bcf92b04e341bef444d1275b4 | 793 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/115_poposta_de_projeto-calculando-redes-ipv4/classes/calcipv4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/115_poposta_de_projeto-calculando-redes-ipv4/classes/calcipv4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/115_poposta_de_projeto-calculando-redes-ipv4/classes/calcipv4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import re
class CalcIPv4:
def __init__(self, ip, mascara=None, prefixo=None):
self.ip = ip
self.mascara = mascara
self.prefixo = prefixo
@property
def ip(self):
return self._ip
@property
def mascara(self):
return self._mascara
@property
def prefixo... | 19.341463 | 55 | 0.557377 |
0843888102fd4e38c945d778a2a18b49be54f89f | 9,576 | py | Python | src/server/db/StudentMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/db/StudentMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/db/StudentMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | from server.bo.Student import Student
from server.db.Mapper import Mapper
class StudentMapper(Mapper):
"""Mapper class, that maps the student objects on relational
Database. To do this, a number of methods are available, which
help to search, create, modify and delete obejcts.
The mapping is bidirect... | 33.482517 | 219 | 0.602861 |
2993ecce9fcb8afa251e3b5acfa77d07acf10528 | 7,613 | py | Python | research/nlp/ktnet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/ktnet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/ktnet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.00578 | 120 | 0.629056 |
299acacc5964d71f8cd3a83dc9b1d7e7ff5e97f7 | 1,498 | py | Python | code/armor.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | code/armor.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | code/armor.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | """ Encode and decode ASCII armored text.
"""
import base64
import textwrap
ARMOR_TYPES = {
'message': ('-----BEGIN PFSE MESSAGE-----', '-----END PFSE MESSAGE-----'),
'recipe': ('-----BEGIN PFSE RECIPE-----', '-----END PFSE RECIPE-----'),
'dh-publickey': ('-----BEGIN DH PUBLICKEY-----', '-----END DH PUBLI... | 28.264151 | 92 | 0.522029 |
d9fc2c748ffb50b2b6643d977aa253e954286a1b | 87,794 | py | Python | edward2/tensorflow/layers/convolutional.py | krasserm/edward2 | 311d3ad6946b543e70af1495eab9a0a9b4f69854 | [
"Apache-2.0"
] | null | null | null | edward2/tensorflow/layers/convolutional.py | krasserm/edward2 | 311d3ad6946b543e70af1495eab9a0a9b4f69854 | [
"Apache-2.0"
] | null | null | null | edward2/tensorflow/layers/convolutional.py | krasserm/edward2 | 311d3ad6946b543e70af1495eab9a0a9b4f69854 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.106459 | 80 | 0.665421 |
8a6b08c240d4f93ae520883624509ffbe34ac9b1 | 765 | py | Python | haas_lib_bundles/python/libraries/relay/relay.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/relay/relay.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/relay/relay.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | from driver import GPIO
class Relay():
def __init__(self, gpioObj, trigger):
self.gpioObj = None
if not isinstance(gpioObj, GPIO):
raise ValueError("parameter gpioObj is not a GPIO object")
if (trigger != 0) and (trigger != 1):
raise ValueError("parameter trigger sh... | 28.333333 | 70 | 0.60915 |
8a9de4aea800a2e1ebba3a24ae347c0e6572f589 | 3,201 | py | Python | src/visuanalytics/tests/analytics/processing/image/test_visualization.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/processing/image/test_visualization.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/processing/image/test_visualization.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import os
import shutil
import unittest
from visuanalytics.analytics.control.procedures.step_data import StepData
from visuanalytics.analytics.processing.image.visualization import generate_all_images
from visuanalytics.util import resources
def prepare_image_test(values, data, config=None):
if config is None:
... | 31.382353 | 92 | 0.457045 |
0a0d28849b12f0c3590357536f49d797018b4743 | 1,304 | py | Python | datastories_semeval2017_task4/modules/CustomPreProcessor.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 1 | 2020-06-04T13:20:45.000Z | 2020-06-04T13:20:45.000Z | datastories_semeval2017_task4/modules/CustomPreProcessor.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 6 | 2020-06-03T18:45:11.000Z | 2022-02-10T01:51:03.000Z | datastories_semeval2017_task4/modules/CustomPreProcessor.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | null | null | null | import os
import pickle
import numpy
from cachetools import cached
from sklearn.base import BaseEstimator, TransformerMixin
from tqdm import tqdm
class CustomPreProcessor(BaseEstimator, TransformerMixin):
def __init__(self, pp, to_list=False):
self.pp = pp
self.to_list = to_list
@cached(cache=... | 31.804878 | 70 | 0.597393 |
0a81acae74acc043d0cdfc2e6c300678765ad837 | 3,198 | py | Python | src/shl-deep-learning-prototyping-architectures/resnet.py | PhilippMatthes/diplom | b51356ec5773b385a308bc8d0d7867f519c390d6 | [
"MIT"
] | 1 | 2021-04-13T20:16:36.000Z | 2021-04-13T20:16:36.000Z | src/shl-deep-learning-prototyping-architectures/resnet.py | PhilippMatthes/diplom | b51356ec5773b385a308bc8d0d7867f519c390d6 | [
"MIT"
] | null | null | null | src/shl-deep-learning-prototyping-architectures/resnet.py | PhilippMatthes/diplom | b51356ec5773b385a308bc8d0d7867f519c390d6 | [
"MIT"
] | null | null | null | from tensorflow import keras
def make_resnet(input_shape: list, output_classes: int, n_feature_maps=64):
"""
Resnet model from https://github.com/hfawaz/dl-4-tsc
"""
input_layer = keras.layers.Input(input_shape)
# BLOCK 1
conv_x = keras.layers.Conv1D(filters=n_feature_maps, kernel_size=8, p... | 40.481013 | 111 | 0.735772 |
7c3384e15a95ed4cbcb76b38d964f4bdac4c22c6 | 726 | py | Python | exercises/es/solution_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/solution_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/solution_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import json
from spacy.lang.es import Spanish
from spacy.tokens import Doc
with open("exercises/es/bookquotes.json", encoding="utf8") as f:
DATA = json.loads(f.read())
nlp = Spanish()
# Registra la extensión del Doc, "author" (por defecto None)
Doc.set_extension("author", default=None)
# Registra la extensión d... | 31.565217 | 73 | 0.707989 |
7c65c295c95eb1a7d99b2927496b4de3dc3da6bb | 528 | py | Python | scripts/component_graph/server/util/env.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/component_graph/server/util/env.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/component_graph/server/util/env.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python3
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Provides OS environment utility functionality. """
import os
def get_fuchsia_root():
"""Returns the fuchsia the from the envi... | 29.333333 | 72 | 0.700758 |
7c82a6048e837800298705e8d724ab17078cea50 | 1,104 | py | Python | webapp.py | OrangeB0lt/interview_project_intelX | 66833f8d4c1049d33fb7a4bdeba62ec27e5b16f8 | [
"MIT"
] | null | null | null | webapp.py | OrangeB0lt/interview_project_intelX | 66833f8d4c1049d33fb7a4bdeba62ec27e5b16f8 | [
"MIT"
] | null | null | null | webapp.py | OrangeB0lt/interview_project_intelX | 66833f8d4c1049d33fb7a4bdeba62ec27e5b16f8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import projects_class
import storage
import uuid
from flask import Flask, render_template, url_for, jsonify, request, abort
from flask_cors import CORS
'''
Create flask instance and apply CORS
'''
app = Flask(__name__)
CORS(app)
'''
Disable strict slashes for all routes
'''
app.url_map.strict_slash... | 22.08 | 74 | 0.689312 |
d4be3f4c2b6c81f245b128a12e9d5b4e5b0b7503 | 14,728 | py | Python | hisim/components/smart_device.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/components/smart_device.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/components/smart_device.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | # Generic/Built-in
import pandas as pd
import json
import numpy as np
import math as ma
# Owned
from hisim import component as cp
from hisim import loadtypes as lt
from hisim import utils
from hisim.components import occupancy
from hisim.components import price_signal
from hisim.simulationparameters import SimulationP... | 43.964179 | 157 | 0.590915 |
9c244423f07665bb4fa1d7dfd8f9eeadc999c397 | 23,780 | py | Python | Packs/MicrosoftGraphSecurity/Integrations/MicrosoftGraphSecurity/MicrosoftGraphSecurity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftGraphSecurity/Integrations/MicrosoftGraphSecurity/MicrosoftGraphSecurity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftGraphSecurity/Integrations/MicrosoftGraphSecurity/MicrosoftGraphSecurity.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 Dict, List, Any
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
APP_NAME = 'ms-graph-security'
''' HELPER FUNCTIONS '''
def get_timestamp(time_description):
if time_d... | 42.846847 | 129 | 0.61741 |
9c317c20b39f2ce330fe029240d5f099cd1bca37 | 10,005 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/tools/predict.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-12T06:52:43.000Z | 2022-01-12T06:52:43.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/tools/predict.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/tools/predict.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 appli... | 37.612782 | 92 | 0.584308 |
9c5f697d4368f452570e660b9802a6087230a50f | 3,008 | py | Python | official/cv/crnn/src/ic03_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/crnn/src/ic03_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/crnn/src/ic03_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.682927 | 119 | 0.59508 |
92e5c6f93eff3b94316cf0de23a7c5bda025a3bd | 2,245 | py | Python | 7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureIII/lectureIII.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-03-19T19:25:39.000Z | 2021-03-19T19:25:39.000Z | 7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureIII/lectureIII.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureIII/lectureIII.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import sys
PRINT_BEEJ = 1
HALT = 2
PRINT_NUM = 3
SAVE = 4
PRINT_REGISTER = 5
ADD = 6
PUSH = 7
POP = 8
register = [0] * 8
memory = [0] * 128 # 128 bytes of RAM
SP = 7 # Because it will live in register spot 7
def load_memory(filename):
try:
ad... | 20.044643 | 92 | 0.542094 |
13166087ed4b5656d2ea481d013ce7c5fe226ecd | 7,346 | py | Python | configs/common/ObjectList.py | abhijiths94/gem5 | 543fc0fdc9eadeec9b1085cd06af50652069b986 | [
"BSD-3-Clause"
] | null | null | null | configs/common/ObjectList.py | abhijiths94/gem5 | 543fc0fdc9eadeec9b1085cd06af50652069b986 | [
"BSD-3-Clause"
] | null | null | null | configs/common/ObjectList.py | abhijiths94/gem5 | 543fc0fdc9eadeec9b1085cd06af50652069b986 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019 Inria
# Copyright (c) 2012, 2017-2018 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardwar... | 40.362637 | 77 | 0.670977 |
131ad62e193108ca52fcdb8da346ee1fede8052d | 1,741 | py | Python | session11/demolib.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 2 | 2019-10-26T12:47:05.000Z | 2020-07-07T16:36:19.000Z | session11/demolib.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | null | null | null | session11/demolib.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 4 | 2020-02-28T13:43:05.000Z | 2020-12-02T10:39:46.000Z | '''
Created on 14.09.2020
@author: neumann
'''
import random
class ValueList:
"""create a list with size of count and with random
values between minvalue and maxvalue
Args:
count (int): size of list
minvalue (int, optional): min random value. Defaults to 0.
maxvalue (int, optiona... | 22.037975 | 85 | 0.53992 |
0ee846c5be49f450dea2ecb727a43d31b9ba695c | 785 | py | Python | Packs/CommonScripts/Scripts/FormattedDateToEpoch/FormattedDateToEpoch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/FormattedDateToEpoch/FormattedDateToEpoch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/FormattedDateToEpoch/FormattedDateToEpoch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import dateparser
from datetime import datetime, timezone
from typing import Optional
def date_to_epoch(date: str, formatter: Optional[str] = None) -> int:
epoch = datetime(1970, 1, 1, tzinfo=timezone.utc)
date_obj = datetime.strptime(date, formatter) if formatter \
else ... | 32.708333 | 106 | 0.721019 |
16428248e57fc50e6ff24f8162dd13c106e052f9 | 254 | py | Python | wlanstart.py | NeumannSven/esp_websocket | 9fc4c5a42e92958ecd106b8f32d68cac860ba4dd | [
"MIT"
] | null | null | null | wlanstart.py | NeumannSven/esp_websocket | 9fc4c5a42e92958ecd106b8f32d68cac860ba4dd | [
"MIT"
] | null | null | null | wlanstart.py | NeumannSven/esp_websocket | 9fc4c5a42e92958ecd106b8f32d68cac860ba4dd | [
"MIT"
] | null | null | null | import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
wlan.connect('YOUR_SSID','YOUR_WIFI_PASSWORD')
while not wlan.isconnected():
pass
print("Netzwerkkonfiguration: ", wlan.ifconfig())
| 23.090909 | 53 | 0.700787 |
4c1b7b80f79cc5552026fd20d9d253aee98ddc15 | 1,502 | py | Python | exercises/de/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert len(pattern1) == 2, "pattern1 sollte zwei Tokens beschreiben."
assert len(pattern2) == 2, "pattern2 sollte zwei Tokens beschreiben."
assert (
len(pattern1[0]) == 1
), "Der erste Token von pattern1 sollte ein einziges Attribut beschreiben."
assert any(
pattern1[0].g... | 46.9375 | 97 | 0.652463 |
d5c881ae998d3213d00da928250e6c4a86509a88 | 1,382 | py | Python | backend/apps/accounts/utils.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/accounts/utils.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/accounts/utils.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | # adapted from: https://gist.github.com/jcinis/2866253
from random import choice
from string import ascii_lowercase, digits
from .models import User
import logging
logger = logging.getLogger("django")
from django.contrib.auth.forms import PasswordResetForm
from django.conf import settings
def generate_random_username... | 34.55 | 109 | 0.704776 |
d5e0a5873b8b59c09dcd2ffe81dd44d9b00a710b | 3,549 | py | Python | oneflow/python/framework/blob_desc.py | caishenghang/oneflow | db239cc9f98e551823bf6ce2d4395bd5c339b1c5 | [
"Apache-2.0"
] | 1 | 2020-12-24T09:26:36.000Z | 2020-12-24T09:26:36.000Z | oneflow/python/framework/blob_desc.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/framework/blob_desc.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 27.3 | 84 | 0.6816 |
91507bd579f798d27825d304f378f126f68123b1 | 3,940 | gyp | Python | 3rdParty/V8/v5.7.492.77/src/inspector/inspector.gyp | sita1999/arangodb | 6a4f462fa209010cd064f99e63d85ce1d432c500 | [
"Apache-2.0"
] | 27 | 2017-12-14T13:48:25.000Z | 2020-12-31T15:46:55.000Z | 3rdParty/V8/v5.7.492.77/src/inspector/inspector.gyp | lipper/arangodb | 66ea1fd4946668192e3f0d1060f0844f324ad7b8 | [
"Apache-2.0"
] | null | null | null | 3rdParty/V8/v5.7.492.77/src/inspector/inspector.gyp | lipper/arangodb | 66ea1fd4946668192e3f0d1060f0844f324ad7b8 | [
"Apache-2.0"
] | 3 | 2019-01-14T12:12:27.000Z | 2019-06-07T09:47:00.000Z | # Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'protocol_path': '../../third_party/inspector_protocol',
},
'includes': [
'inspector.gypi',
'<(PRODUCT_DIR)/../../../thi... | 28.550725 | 91 | 0.488071 |
e689dbbd7526b4ed9b6d69f1534d61e252d404dc | 110,604 | py | Python | repo/plugin.video.PsycoTV/plugin.video.PsycoTV/default.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/plugin.video.PsycoTV/plugin.video.PsycoTV/default.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/plugin.video.PsycoTV/plugin.video.PsycoTV/default.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | # -*- coding: utf-8 -*-
import urllib
import urllib2
import datetime
import re
import os
import codecs
import base64
import xbmcplugin
import xbmcgui
import xbmcaddon
import xbmcvfs
import traceback
import cookielib
from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup, BeautifulSOAP
try:
import json
except:
... | 39.943662 | 1,225 | 0.525849 |
e6ac795416087ca5f89be878a3df0345a773f2a3 | 5,196 | py | Python | sFTP-master/sftp.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 9 | 2018-09-01T06:34:52.000Z | 2020-11-02T22:53:58.000Z | sFTP-master/sftp.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | sFTP-master/sftp.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 5 | 2018-11-29T20:09:20.000Z | 2020-11-02T22:54:00.000Z | # Date: 07/27/2018
# Author: Pure-L0G1C
# Description: Secure FTP
import os
import socket
import pickle
from time import sleep, time
from base64 import b64encode
from socket import timeout as TimeOutError
from crypto import CryptoRSA, CryptoSalsa20
class sFTP(object):
def __init__(self, ip, port, max_... | 30.385965 | 115 | 0.684373 |
99023389ab7ebe752c9451c6b63c9f0c54e3b88d | 271 | py | Python | DarkCTF/2020/pynotes/share/pppp.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | DarkCTF/2020/pynotes/share/pppp.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | DarkCTF/2020/pynotes/share/pppp.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from _note import *
from sys import modules
del modules['os']
keys = list(__builtins__.__dict__.keys())
for k in keys:
# present for you
if k not in ['int', 'id', 'print', 'range', 'hex', 'bytearray', 'bytes']:
del __builtins__.__dict__[k]
/** code **/
| 22.583333 | 77 | 0.627306 |
db792720aa26c806a483ea4f45b1b1d3f67546dd | 11,519 | py | Python | python/oneflow/utils/data/dataset.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/utils/data/dataset.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/utils/data/dataset.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.485465 | 92 | 0.636253 |
91702aaa25b83f5d0bdb24657278f82c79dd9827 | 791 | py | Python | source/pkgsrc/databases/ldb/patches/patch-buildtools_wafsamba_samba__install.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/databases/ldb/patches/patch-buildtools_wafsamba_samba__install.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/databases/ldb/patches/patch-buildtools_wafsamba_samba__install.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-buildtools_wafsamba_samba__install.py,v 1.1 2019/03/20 19:06:17 adam Exp $
Apply correct install_name on Darwin.
--- buildtools/wafsamba/samba_install.py.orig 2019-01-14 22:24:44.000000000 +0000
+++ buildtools/wafsamba/samba_install.py
@@ -151,6 +151,8 @@ def install_library(self):
bld.sym... | 49.4375 | 108 | 0.7067 |
37f6c734dacdb4dcc3df29def353d7266df0157c | 486 | py | Python | python/coding_dojang/asyncio_async_with.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/asyncio_async_with.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/asyncio_async_with.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import asyncio
class AsyncAdd:
def __init__(self, a, b):
self.a = a
self.b = b
async def __aenter__(self):
await asyncio.sleep(1.0)
return self.a + self.b # __aenter__ 에서 값을 반환하면 as에 지정한 변수에 들어감
async def __aexit__(self, exc_type, exc_value, traceback):
pass
... | 21.130435 | 75 | 0.625514 |
533f2233cd66a9f8a7b098f4d0caff6009e16254 | 204 | py | Python | MiniProjects/Python-Challenges/Area_Of_Triangle.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Python-Challenges/Area_Of_Triangle.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Python-Challenges/Area_Of_Triangle.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | import math
for i in range(1,10):
a = float(input("Enter The Base Length Of The Triangle :"))
b = float(input("Enter The Height Of The Triangle :"))
print("Area Of The Triangle Is :" , (1/2)*a*b)
| 34 | 61 | 0.647059 |
be3515fbc27d7db5e20e55b567be7d71b6d564ba | 6,373 | py | Python | python/do_harvest.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | null | null | null | python/do_harvest.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | null | null | null | python/do_harvest.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import argparse
import datetime
import os
from collections import OrderedDict
from csv import DictReader
import openapc_toolkit as oat
ARG_HELP_STRINGS = {
"integrate": ('Integrate changes in harvested data into existing ' +
'collected files ("all... | 46.518248 | 117 | 0.60568 |
22b81446ee6eda217fa5fc5cae0a1ce0656be4a0 | 1,225 | py | Python | SHELL/2021/crypto/arc-cipher/script.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | SHELL/2021/crypto/arc-cipher/script.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | SHELL/2021/crypto/arc-cipher/script.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | text = "<flag>"
key = "MANGEKYOU"
s = []
k = []
for i in key:
k.append(((ord(i))))
for i in range(0,256):
s.append(i) # i.e. s = [0 1 2 3 4 5 6 7 ..]
if i >= len(key):
k.append(k[i%len(key)])
def key_sche(s,k):
j = 0
for i in range(0,256):
j = (j + s[i] + k[i])%256
temp ... | 21.875 | 52 | 0.498776 |
608cfc37dc9c4ba3dbbe2dc87ceaf59568eba039 | 358 | py | Python | klausur/testing_out/scopes.py | larsaars/pgki_uebungen | 24eee86b4f51f5ba3ca65526afeb6dad0110c739 | [
"Apache-2.0"
] | null | null | null | klausur/testing_out/scopes.py | larsaars/pgki_uebungen | 24eee86b4f51f5ba3ca65526afeb6dad0110c739 | [
"Apache-2.0"
] | null | null | null | klausur/testing_out/scopes.py | larsaars/pgki_uebungen | 24eee86b4f51f5ba3ca65526afeb6dad0110c739 | [
"Apache-2.0"
] | null | null | null | def myfunc():
# print(x)
x = 'local to myfunc'
print(x)
def inner_1():
# print(x)
x = 'local to inner 1'
print(x)
def inner_2():
# print(x)
nonlocal x
x = 'local to inner 2'
print(x)
inner_2()
print(x)
... | 13.259259 | 34 | 0.413408 |
71b07aa92b86cd4576e537475cee12b7f02bdf0a | 4,836 | py | Python | LibMS/libapp/models.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | 2 | 2021-05-31T13:11:50.000Z | 2021-06-05T04:37:51.000Z | LibMS/libapp/models.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | LibMS/libapp/models.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth import settings
from django.utils import timezone
STATUS_CHOICES = (
('0', '未完成'),
('1', '已完成'),
('2', '已通知')
)
# Create your models here.
class User(models.Model):
id = models.IntegerField(primary_key=True, verbose_name='读者ID')
pwd = models.C... | 33.583333 | 103 | 0.665012 |
71cc914e513d1a4bcc91b0a43d5709d38b6d9b32 | 1,959 | py | Python | showcase1/com/aaron/reexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/reexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/reexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- codiing:utf-8 -*-
"""regular expressions example"""
__author__="aaron.qiu"
import re
import binascii
import struct
def matchShowcase():
pattern = re.compile(r'hello',re.I)
word = "hello,world,Hello,Express reguration"
result1 = re.match(pattern,word)
result2 = re.match(pattern, 'helloo CQC!')
... | 21.527473 | 57 | 0.603369 |
e0d9f1f3b49df8d11504389198aa3fb61369a5fe | 221 | py | Python | archives/codelibraries/cp-geo-master/sph.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | archives/codelibraries/cp-geo-master/sph.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | archives/codelibraries/cp-geo-master/sph.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from math import *
(r,lat,lon) = [float(s) for s in sys.argv[1:]]
lon *= pi/180
lat *= pi/180
print("({:.3f},{:.3f},{:.3f})".format(r*cos(lat)*cos(lon), r*cos(lat)*sin(lon), r*sin(lat)))
| 27.625 | 92 | 0.597285 |
460774a7ec85bac20c42a320e0e775b8d667a069 | 271 | py | Python | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
# test_records = frappe.get_test_records('Patient Medical Record')
class TestPatientMedicalRecord(unittest.TestCase):
pass
| 24.636364 | 66 | 0.778598 |
08fdacc2a8fe7c0dcbdf2ca6ce7239b1cee76086 | 408 | py | Python | preprocessing/mongo_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | preprocessing/mongo_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | preprocessing/mongo_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | db.cloneCollection('ip:host','from coll','to coll')
db.copyDatabase('from db','to db','ip:host')
db.copyDatabase(<from_dbname>, <to_dbname>, <from_hostname>, <username>,<password>);
db.copyDatabase(
"tweet",
"tweet",
"example.net",
"admin",
"lixiepeng",
"MONGODB-CR"
)
mongodump -h IP --port 端口 -u 用户... | 27.2 | 84 | 0.64951 |
c7b60ac7a8d94d086cdb8d716c8f95b0d6219a9d | 5,130 | py | Python | server.py | bioPunkKitchen/climate.local | ccd29da3d84542d5f9c73a5d75bc3ceefeef1f08 | [
"MIT"
] | 1 | 2019-05-28T18:33:49.000Z | 2019-05-28T18:33:49.000Z | server.py | bioPunkKitchen/climate.local | ccd29da3d84542d5f9c73a5d75bc3ceefeef1f08 | [
"MIT"
] | 1 | 2019-12-30T14:52:02.000Z | 2020-01-04T11:41:08.000Z | server.py | bioPunkKitchen/climate.local | ccd29da3d84542d5f9c73a5d75bc3ceefeef1f08 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask, render_template, request
import datetime
import time
import os
import json
import handledata as handle
app = Flask(__name__)
hd = handle.handle_data()
def timestamp():
time = datetime.datetime.now().strftime('%Y-%m-%d_%a_%H:%M:%S.%f')
return time
def read_state():... | 29.825581 | 124 | 0.681871 |
408f9c9371c512f10b196a43ee31c5cef345b761 | 19,749 | py | Python | official/nlp/lstm/modelarts/train_start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/lstm/modelarts/train_start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/lstm/modelarts/train_start.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... | 43.5 | 120 | 0.670515 |
40c852715357f93b920864419910559a1145e966 | 86 | py | Python | src/Sephrasto/Version.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/Version.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/Version.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | _sephrasto_version_major = 2
_sephrasto_version_minor = 5
_sephrasto_version_build = 0 | 28.666667 | 28 | 0.872093 |
462a975e38ce5ba50f6aff08787fbb0e7afaf6bc | 2,761 | py | Python | oneflow/python/test/onnx/nodes/test_batch_normalization.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/onnx/nodes/test_batch_normalization.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/onnx/nodes/test_batch_normalization.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 31.735632 | 88 | 0.614995 |
462f1df5fc4c9deb392a555ddb83ca0b2ce022af | 2,535 | py | Python | tests/nlu/tokenizers/test_convert_tokenizer.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 1 | 2020-09-12T17:27:21.000Z | 2020-09-12T17:27:21.000Z | tests/nlu/tokenizers/test_convert_tokenizer.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 46 | 2020-09-26T11:36:38.000Z | 2022-03-01T13:38:02.000Z | tests/nlu/tokenizers/test_convert_tokenizer.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | import pytest
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
from rasa.nlu.constants import TOKENS_NAMES, NUMBER_OF_SUB_TOKENS
from rasa.shared.nlu.constants import TEXT, INTENT
from rasa.nlu.tokenizers.convert_tokenizer import ConveRTToke... | 32.922078 | 81 | 0.666272 |
316df9778b2fac11d5b479c56b6f5d27d2f85fc2 | 2,134 | py | Python | python/oneflow/compatible/single_client/framework/distribute_context.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/framework/distribute_context.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/framework/distribute_context.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.983607 | 85 | 0.743205 |
5edaa88ca1681818682dda8ccf5e130267fe565c | 479 | py | Python | kreisid.py | BackInBash/cov19-ki | 793239f5ed2de985f367c590316fe0b710724d82 | [
"MIT"
] | null | null | null | kreisid.py | BackInBash/cov19-ki | 793239f5ed2de985f367c590316fe0b710724d82 | [
"MIT"
] | null | null | null | kreisid.py | BackInBash/cov19-ki | 793239f5ed2de985f367c590316fe0b710724d82 | [
"MIT"
] | null | null | null | import json
#
# Resolve KreisID zu Name
#
def kreisid(id):
if len(id) < 5:
id = "0"+id
file = open("data/kreisid.json", "r+")
data = json.load(file)
file.close()
for row in data:
if row == id:
return str(data[row][0][0])
return ""
def landid(id):
file = open("... | 18.423077 | 42 | 0.515658 |
48a94b52afb37a96f0aeba1d94b8343fd67522f0 | 2,797 | py | Python | research/cv/DeepID/src/model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/DeepID/src/model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/DeepID/src/model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.957143 | 101 | 0.535216 |
d2cf8d4c4cbffa95a4df00469cd45734611490e6 | 29 | py | Python | event_detector/gttm/cluster_detection/__init__.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/cluster_detection/__init__.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/cluster_detection/__init__.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | from .plotting import Plotter | 29 | 29 | 0.862069 |
d2f84a325fcc133fc9d12bce89ad585a23dc347c | 480 | py | Python | python/en/archive/dropbox/programmers/02-1_list.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/programmers/02-1_list.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/programmers/02-1_list.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # 02-1_list.py
def solution(L, x):
i = 0
for e in L:
if ( e < x ):
i += 1
else:
break
L.insert(i, x)
answer = L
return answer
#if __name__ == "main":
if __name__ == "__main__":
list_1 = [20,37,58,72,91]
print(list_1)
print("")
a = solution( list... | 17.142857 | 28 | 0.502083 |
81a0cb1567d25cf7b2e850f6db7f89560daab0c7 | 630 | py | Python | Problems/Dynamic Programming/Easy/BuySellStock2/test_buy_sell_stock_2.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Easy/BuySellStock2/test_buy_sell_stock_2.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Easy/BuySellStock2/test_buy_sell_stock_2.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from buy_sell_stock_2 import maxProfit1, maxProfit2
class Test(TestCase):
def test_max_profit_1(self):
self.assertTrue(maxProfit1([7, 1, 5, 3, 6, 4]) == 7)
self.assertTrue(maxProfit1([7, 6, 4, 3, 1]) == 0)
self.assertTrue(maxProfit1([1, 2, 3, 4, 5]) == 5)
... | 39.375 | 60 | 0.595238 |
81b6a8cb598dca85d211a723f84f37df5d8c4620 | 1,720 | py | Python | plugins/tff_backend/api/nodes_unauthenticated.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/api/nodes_unauthenticated.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/api/nodes_unauthenticated.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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... | 36.595745 | 74 | 0.755233 |
f20649c6e9baccee0202a4c96faf2d0beb89697c | 14,611 | py | Python | repo/script.module.urlresolver/lib/urlresolver/plugins/alldebrid.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/plugins/alldebrid.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/plugins/alldebrid.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
urlresolver Kodi Addon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed... | 46.091483 | 199 | 0.571693 |
6ff566b5ae8c266b686e274cf57c9a9303cfa9a1 | 2,945 | py | Python | AP_SS16/402/python/old/main.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/402/python/old/main.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/402/python/old/main.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import uncertainties as u
import numpy as np
import uncertainties.unumpy as unp
import uncertainties.umath as umath
import data as d
import calculations as c
import plot as plot
import helpers as h
from table import (
make_table,
make_SI,
write,
)
print("Maximale Messdifferenz:", max(d.eigenfrequenzen_ho... | 31.329787 | 106 | 0.708659 |
d25568dae4f627b8154a0b184df507c414be4b6f | 752 | py | Python | Packs/CommonScripts/Scripts/EmailDomainWhitelist/EmailDomainWhitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/EmailDomainWhitelist/EmailDomainWhitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/EmailDomainWhitelist/EmailDomainWhitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
def csv_string_to_list(v):
if type(v) == str: # requires python3
return v.lower().replace(' ', '').replace('\n', '').split(',')
v = [val.lower() for val in v]
return v
def main():
DOMAIN_LIST = csv_string_to_list(demisto.args()['domain_list'])
EMAIL_ADDRESS... | 24.258065 | 70 | 0.634309 |
793b6793eee2b992beb142325a98718cf96bf5f4 | 3,228 | py | Python | solutions/py_engine_esp32_demo/makeimg.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | solutions/py_engine_esp32_demo/makeimg.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | solutions/py_engine_esp32_demo/makeimg.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | # Combine bootloader, partition table and application into a final binary.
import os, sys
sys.path.append(os.getenv("IDF_PATH") + "/components/partition_table")
import gen_esp32part
OFFSET_BOOTLOADER_DEFAULT = 0x1000
OFFSET_PARTITIONS_DEFAULT = 0x8000
def load_sdkconfig_hex_value(filename, value, default):
va... | 34.340426 | 83 | 0.687423 |
e3e8771ba1b219ed90b5cdcf7888d1623c9ec6ad | 271 | py | Python | exercises/pt/solution_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Importar a classe da língua espanhola (Spanish)
from spacy.lang.es import Spanish
# Crie um objeto nlp
nlp = Spanish()
# Processar o texto em espanhol (equivalente ao português: "Como vai?")
doc = nlp("¿Cómo estás?")
# Imprimir o texto do documento
print(doc.text)
| 22.583333 | 71 | 0.730627 |
585098053ab15aa271cc1f91111b00d9cde25c86 | 222 | py | Python | python/python_backup/PRAC_PYTHON/adrashproj.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/adrashproj.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/adrashproj.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # input strings until done is not entered
s=input("enter string:")
w=""
s=s+" "
count=0
for i in range(1,,1):
s=input("enter string:")
c=c+1
if(s=="done")
break;
print c
| 14.8 | 43 | 0.495495 |
5856cd1e582b3f3eb8f19d5bc7d574b407af6f68 | 15,437 | py | Python | tests/onegov/people/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/people/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/people/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import module_path
from onegov.people.models import Agency
from onegov.people.models import AgencyMembership
from onegov.people.models import Person
from os.path import splitext
from pytest import mark
def test_person(session):
session.add(
Person(
salutation="Mr.",
... | 33.269397 | 79 | 0.64028 |
49bc3a9d27a15899bd0c9191b956aef9ac7039c3 | 4,311 | py | Python | Python/TestStepscope.py | jimwaschura/Automation | f655feeea74ff22ebe44d8b68374ba6983748f60 | [
"BSL-1.0"
] | null | null | null | Python/TestStepscope.py | jimwaschura/Automation | f655feeea74ff22ebe44d8b68374ba6983748f60 | [
"BSL-1.0"
] | null | null | null | Python/TestStepscope.py | jimwaschura/Automation | f655feeea74ff22ebe44d8b68374ba6983748f60 | [
"BSL-1.0"
] | 1 | 2020-08-16T00:11:55.000Z | 2020-08-16T00:11:55.000Z | # TestStepscope.py
# ================================================================================
# BOOST SOFTWARE LICENSE
#
# Copyright 2020 BitWise Laboratories Inc.
# Original Author.......Jim Waschura
# Contact...............info@bitwiselabs.com
#
# Permission is hereby granted, free of charge, to any person or... | 33.161538 | 82 | 0.600789 |
3fe57a15847c3285ae1a3425159b1af56234f71d | 502 | py | Python | INBa/2015/CHINKIROV_V_V/task_2_29.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/CHINKIROV_V_V/task_2_29.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/CHINKIROV_V_V/task_2_29.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #задача 1. Вариант 29
#Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Джебран Халиль Джебран. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
#Чинкиров В.В
#29.02.2016
print("Под псевдонимом Джебран Халиль ,скрывается ливанс... | 50.2 | 214 | 0.812749 |
129fa0dc47bce5c96ecc0b20e6528b0f21ae5c12 | 1,351 | py | Python | scripts/s3_tiles.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | scripts/s3_tiles.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | scripts/s3_tiles.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
import sys
import getopt
from textwrap import dedent
from forge.configs import tmsConfig
from forge.lib.helpers import error
from forge.lib.boto_conn import S3Keys
# One might want to provide an extent also later on
def usage():
print(dedent('''\
Usage: venv/bin/python scripts/s3_... | 25.018519 | 85 | 0.569208 |
12dd6bba3ba2c6898a7b602c38b624db856bf9f4 | 428 | py | Python | exercises/de/test_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
import spacy.tokens
import spacy.lang.de
assert isinstance(
nlp, spacy.lang.de.German
), "Das nlp-Objekt sollte eine Instanz der Klasse German sein."
assert isinstance(
doc, spacy.tokens.Doc
), "Hast du den Text mit dem nlp-Objekt verarbeitet und ein Doc erstellt?"
... | 30.571429 | 78 | 0.672897 |
c423106258f1dba17ce0923c457c1185892ae626 | 327 | py | Python | tests/__init__.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | tests/__init__.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | tests/__init__.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""Package containing all tests for easyp2p."""
import os
INPUT_PREFIX = os.path.join('tests', 'input', 'input_test_')
RESULT_PREFIX = os.path.join('tests', 'expected_results', 'result_test_')
TEST_PREFIX = os.path.join('tests', 'test_results', 't... | 29.727273 | 73 | 0.703364 |
c47a3acc492a8330e559177c33160a848119eb11 | 1,410 | py | Python | project/forms/event_date.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | null | null | null | project/forms/event_date.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | null | null | null | project/forms/event_date.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | null | null | null | from flask import request
from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import HiddenField, SelectField, StringField, SubmitField
from wtforms.validators import Optional
from project.forms.common import distance_choices
from project.forms.widgets import CustomDateField
class Fin... | 34.390244 | 78 | 0.714894 |
675349dcbc175d5f104677028e36db3de1e3d8ea | 864 | py | Python | atmega8.py | Faldrian/AVRKnobel | f9b17b132c576e91d3df1db00d54334f7a434143 | [
"MIT"
] | null | null | null | atmega8.py | Faldrian/AVRKnobel | f9b17b132c576e91d3df1db00d54334f7a434143 | [
"MIT"
] | null | null | null | atmega8.py | Faldrian/AVRKnobel | f9b17b132c576e91d3df1db00d54334f7a434143 | [
"MIT"
] | null | null | null | import time
import signal
import sys
from collections import deque
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(7, GPIO.IN)
GPIO.setup(8, GPIO.IN)
bits = []
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
GPIO.remove_event_detect(8)
print('stopped listening.')
d = deq... | 18.782609 | 63 | 0.675926 |
67d9a28ef05ffeb1a570af5a8278f2afa8f69328 | 1,471 | py | Python | python_gui_tkinter/Tkinter/TkinterCourse/22_canvas_wid_1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/Tkinter/TkinterCourse/22_canvas_wid_1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/Tkinter/TkinterCourse/22_canvas_wid_1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
The Canvas widget supplies graphics facilities for Tkinter. Among these graphical objects are lines, circles, images, and even other widgets. With this widget it's possible to draw graphs and plots, create graphics editors, and implement various kinds of custom widgets.
We demonstrate in our first example, how to ... | 49.033333 | 420 | 0.761387 |
db3abd435246264248ecb90d9e85f966692d7beb | 458 | py | Python | python/gdal_cookbook/cookbook_geometry/create_multi_line_string.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_multi_line_string.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_multi_line_string.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from osgeo import ogr
multiline = ogr.Geometry(ogr.wkbMultiLineString)
line1 = ogr.Geometry(ogr.wkbLineString)
line1.AddPoint(1214242.4174581182, 617041.9717021306)
line1.AddPoint(1234593.142744733, 629529.9167643716)
multiline.AddGeometry(line1)
line1 = ogr.Geometry(ogr.wkbLineString)
line1.AddPoint(1184641.3624957... | 30.533333 | 53 | 0.831878 |
45076ab12970f1977369e623c25dffb8d38817d2 | 1,505 | py | Python | deploy/deployctl/__main__.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | deploy/deployctl/__main__.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | deploy/deployctl/__main__.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | #!/usr/bin/env python3
import argparse
import sys
from deployctl.subcommands import blog_deployment
from deployctl.subcommands import blog_images
from deployctl.subcommands import browser_deployments
from deployctl.subcommands import browser_images
from deployctl.subcommands import config
from deployctl.subcommands i... | 30.1 | 71 | 0.747508 |
4533295d4f241b053945b76e4c10f1f1516c8cfb | 2,817 | py | Python | pythonBot/main.py | tabacha/WoIstDerWagen | feddaedbde494e9e0983f6a2c34b6b5c65a6ed23 | [
"Apache-2.0"
] | 5 | 2016-06-27T07:37:16.000Z | 2018-04-18T12:09:39.000Z | pythonBot/main.py | tabacha/WoIstDerWagen | feddaedbde494e9e0983f6a2c34b6b5c65a6ed23 | [
"Apache-2.0"
] | 21 | 2016-06-26T09:46:25.000Z | 2020-02-23T11:08:35.000Z | pythonBot/main.py | tabacha/WoIstDerWagen | feddaedbde494e9e0983f6a2c34b6b5c65a6ed23 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import tweepy, time, sys, pprint, config
from mysql.connector import (connection)
import msgParse
import re
import os
import logging
from daemonize import Daemonize
def init():
global log
global cnx
global api
if (hasattr(config,'logger')):
import ... | 37.56 | 143 | 0.606319 |
18b884e11ad7fdde649f37e70bb2eb740dc3fd06 | 2,695 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/traci/_chargingstation.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/_chargingstation.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/_chargingstation.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.... | 39.057971 | 114 | 0.699072 |
bee4dcb34998955a8b7f4b0b59815ce375e4ba0d | 705 | py | Python | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/lists.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/lists.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/lists.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # For the exercise, look up the methods and functions that are available for use
# with Python lists.
x = [1, 2, 3]
y = [8, 9, 10]
# For the following, DO NOT USE AN ASSIGNMENT (=).
# Change x so that it is [1, 2, 3, 4]
# [command here]
x.append(4)
print(x)
# Using y, change x so that it is [1, 2, 3, 4, 8, 9, 10]
#... | 20.142857 | 80 | 0.631206 |
bee6b85533af2535647861e87e7df3f6a063369d | 789 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/types.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/types.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/types.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from enum import Enum
from typing import Any, Callable, List, Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_model.admin import Factor
from watchmen_model.dqc import MonitorRule
class RuleResult(str, Enum):
SUCCESS = 'success', # no issue detected
FAILE... | 31.56 | 104 | 0.776933 |
36b42340162903f095e09871dc4ba7fdd10e2058 | 569 | py | Python | 374-guess-number-higher-or-lower/374-guess-number-higher-or-lower.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 374-guess-number-higher-or-lower/374-guess-number-higher-or-lower.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 374-guess-number-higher-or-lower/374-guess-number-higher-or-lower.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # The guess API is already defined for you.
# @param num, your guess
# @return -1 if num is higher than the picked number
# 1 if num is lower than the picked number
# otherwise return 0
# def guess(num: int) -> int:
class Solution:
def guessNumber(self, n: int) -> int:
start = 1
e... | 27.095238 | 52 | 0.481547 |
e9f21d98805166810e07bf7279db0d17cfd24993 | 185 | py | Python | Online-Judges/CodingBat/Python/Logic-02/Logic_2-02-lone_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Logic-02/Logic_2-02-lone_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Logic-02/Logic_2-02-lone_sum.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def lone_sum(a, b, c):
if a == b and a == c:
return 0
elif a == b:
return c
elif b == c:
return a
elif a == c:
return b
return a+b+c
| 16.818182 | 25 | 0.421622 |
c51fce83912e9148dd1fdd1a3ef3745ac048c918 | 3,730 | py | Python | Projekt/Klassifiziere.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Projekt/Klassifiziere.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Projekt/Klassifiziere.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | 3 | 2019-11-17T01:33:07.000Z | 2020-03-26T10:13:39.000Z | import numpy as np
from os import walk
from sklearn.neighbors import KNeighborsClassifier
from sys import maxsize
#"""
#k-Nearest Neighbour Klassifikator
#"""
#def klassifiziereKNN(trDesk, testDesk, trLabels, k):
# knn = KNeighborsClassifier(n_neighbors=k, metric='euclidean')
# knn.fit(trDesk, trLabels)
# ret... | 29.84 | 90 | 0.695979 |
3d6900d1fba2cb365484c4cafb11cb6c544f51bf | 966 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/binman/etype/intel_fsp_s.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/binman/etype/intel_fsp_s.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/binman/etype/intel_fsp_s.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright 2019 Google LLC
# Written by Simon Glass <sjg@chromium.org>
#
# Entry-type module for Intel Firmware Support Package binary blob (S section)
#
from entry import Entry
from blob import Entry_blob
class Entry_intel_fsp_s(Entry_blob):
"""Entry containing Intel Firmware... | 34.5 | 79 | 0.736025 |
3d75152981151f1c8f6c9bca50e1ecd5185ca86a | 236 | py | Python | aws/sqs/connector.py | jwoos/dockerfiles | 9a3e08a004eb9e6a15c2a212edc12a7893b6143e | [
"MIT"
] | 2 | 2017-07-07T21:47:22.000Z | 2017-07-12T05:04:11.000Z | aws/sqs/connector.py | jwoos/dockerfiles | 9a3e08a004eb9e6a15c2a212edc12a7893b6143e | [
"MIT"
] | 5 | 2017-09-08T04:16:48.000Z | 2017-11-01T17:21:41.000Z | aws/sqs/connector.py | jwoos/dockerfiles | 9a3e08a004eb9e6a15c2a212edc12a7893b6143e | [
"MIT"
] | 1 | 2019-01-14T16:03:45.000Z | 2019-01-14T16:03:45.000Z | import json
import boto3
sqs = boto3.resource(
'sqs',
endpoint_url='http://localhost:9324',
region_name='elasticmq',
aws_secret_access_key='x',
aws_access_key_id='x',
use_ssl=False
)
client = sqs.meta.client
| 14.75 | 41 | 0.677966 |
3da07c7cf8747042ec11bdced471717b7b6195bc | 336 | py | Python | yolov5-coreml-tflite-converter/yolov5.setup.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/yolov5.setup.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/yolov5.setup.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="yolov5",
url="https://github.com/ultralytics/yolov5",
maintainer="ultralytics",
maintainer_email="glenn.jocher@ultralytics.com",
packages=["models", "utils"],
install_requires=["opencv-python", "matplotlib", "torchvision", "PyYAML", "requests", "pandas"... | 30.545455 | 111 | 0.6875 |
b1a5559ce36c44c6683e510b8c141b1f7002f3c1 | 3,337 | py | Python | research/cv/CGAN/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/CGAN/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/CGAN/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.760417 | 88 | 0.635301 |
775e0f4782265763c1506595ec14f5fdf11d1bd7 | 1,743 | py | Python | utest/general_transformation_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | utest/general_transformation_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | utest/general_transformation_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import unittest
import zencad
import math
def early(a, b):
if abs(a.x - b.x) > 0.0001:
return False
if abs(a.y - b.y) > 0.0001:
return False
if abs(a.z - b.z) > 0.0001:
return False
return True
def vertex_set_issame(a, b):
for x in a:
for y in b:
if ea... | 22.063291 | 70 | 0.533563 |
91f104d21e8cefc82369c5c7fc2c9517ffebe6a2 | 3,467 | py | Python | python/en/archive/topics/temp/audio/pcm2wav/test_pcm2wav_AudioPreprocessing.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/audio/pcm2wav/test_pcm2wav_AudioPreprocessing.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/audio/pcm2wav/test_pcm2wav_AudioPreprocessing.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
* Package playsound
1. If package playsound is not installed, install it with pip3.
$ sudo pip3 install playsound
[sudo] password for aimldl:
Collecting playsound
Downloading https://files.pythonhosted.org/packages/f5/16/10d897b0a83fb4b05b03a63d7a266... | 41.771084 | 161 | 0.684742 |
65def6c4fb415329320bd259bdd47a9732f38445 | 4,037 | py | Python | web2/bahn/views.py | sarafischer/wp-bahn | a98a297928a9454fa24f033e70ab7ebcdf53a5d5 | [
"MIT"
] | 1 | 2020-01-10T10:34:40.000Z | 2020-01-10T10:34:40.000Z | web2/bahn/views.py | PatriciaKaluza/wp-bahn | a98a297928a9454fa24f033e70ab7ebcdf53a5d5 | [
"MIT"
] | null | null | null | web2/bahn/views.py | PatriciaKaluza/wp-bahn | a98a297928a9454fa24f033e70ab7ebcdf53a5d5 | [
"MIT"
] | null | null | null | import datetime
import time
import schiene
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils import timezone
from . import models
# Create your views here.
s = schiene.Schiene()
def set_today(dt):
today = datetime.date.today()
return dt.... | 33.641667 | 121 | 0.607629 |
b28ada8353a118f886696b2d35f973b291d81820 | 947 | py | Python | packages/watchmen-utilities/src/watchmen_utilities/numeric_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-utilities/src/watchmen_utilities/numeric_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-utilities/src/watchmen_utilities/numeric_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from decimal import Decimal
from typing import Any, Optional, Tuple
def is_numeric_instance(value: Any) -> bool:
return value is not None and (isinstance(value, int) or isinstance(value, float) or isinstance(value, Decimal))
def is_decimal(value: Optional[str]) -> Tuple[bool, Optional[Decimal]]:
"""
none is not ... | 25.594595 | 112 | 0.732841 |
a2ba35459365df475caba90e0e175571718442e1 | 1,712 | py | Python | deutschland/mudab/models/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 445 | 2021-07-26T22:00:26.000Z | 2022-03-31T08:31:08.000Z | deutschland/mudab/models/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 30 | 2021-07-27T15:42:23.000Z | 2022-03-26T16:14:11.000Z | deutschland/mudab/models/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 28 | 2021-07-27T10:48:43.000Z | 2022-03-26T14:31:30.000Z | # flake8: noqa
# import all models into this package
# if you have many models here with many references from one model to another this may
# raise a RecursionError
# to avoid this, import only the models that you directly need like:
# from from deutschland.mudab.model.pet import Pet
# or import this package, but befo... | 53.5 | 86 | 0.866822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.