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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28decb65daf6793aff46f1ffd82b6197bd13db92 | 389 | py | Python | code/ListComprehension.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/ListComprehension.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/ListComprehension.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | # Liste 0 bis 9
my_list = []
for i in range(10):
my_list.append(i)
# List Comprehension
# val - iterable
my_list2 = [i for i in range(10)]
# Quadrat
my_list3 = [i**2 for i in range(10)]
# Multi-dim List
# Matrix (3 rows, 2 columns)
M = [[1, 2],
[3, 4],
[5, 6]]
NUM_ROWS = 2
NUM_COLS = 3
M2 = [... | 17.681818 | 64 | 0.588689 |
e935b9509f265f882ec5c635d694025576d7288b | 488 | py | Python | leetcode/279-Perfect-Squres/PerfectSqures_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-12-29T03:26:39.000Z | 2016-12-29T03:26:39.000Z | leetcode/279-Perfect-Squres/PerfectSqures_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/279-Perfect-Squres/PerfectSqures_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def numSquares(self, n):
"""
:type n: int
:rtype: int
"""
from math import sqrt
t = int(sqrt(n))
if t * t == n:
return 1
while n % 4 == 0:
n /= 4
if n % 8 == 7:
return 4
t ... | 18.769231 | 36 | 0.348361 |
dd1f711837b70028dc7c51abbddd110e574ff7f3 | 18,709 | py | Python | Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from google.cloud import storage
from typing import Any, Dict
import requests
import traceback
import urllib3
''' GLOBALS/PARAMS '''
RFC3339_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
DEMISTO_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
... | 31.981197 | 120 | 0.66941 |
b0c197db471292e987abe2e152c16f8d458f0f6e | 1,648 | py | Python | Testing/test_utilities/check_param_value.py | cianciosa/V3FIT | 18b1f4c0d596b47fbbd97508905c60e842801950 | [
"MIT"
] | null | null | null | Testing/test_utilities/check_param_value.py | cianciosa/V3FIT | 18b1f4c0d596b47fbbd97508905c60e842801950 | [
"MIT"
] | null | null | null | Testing/test_utilities/check_param_value.py | cianciosa/V3FIT | 18b1f4c0d596b47fbbd97508905c60e842801950 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from optparse import OptionParser
import sys
parser = OptionParser()
parser.add_option("-f", "--file", dest="filename", help="File name to test.", metavar="FILE")
parser.add_option("-p", "--p_type", dest="p_type", help="p_type to search for", metavar="P_TYPE")
parser.add_option("-v", "--value", dest... | 42.25641 | 176 | 0.669296 |
b0c1dab01ffff9d0eb13fbdb640708e7cabf6efb | 537 | py | Python | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-if_elif_else_statements.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-if_elif_else_statements.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-if_elif_else_statements.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # Ch02-FlowControl-if_elif_else_statements.py
# This is an example for if, elif, and else statements.
#
# https://automatetheboringstuff.com/chapter2/
# Flow Control Statements: Lesson 5 - if, elif, and else
name = 'Dracula'
age = 4000
if name == 'Alice':
print('Hi, Alice.')
elif age < 12:
print('You are not ... | 26.85 | 66 | 0.679702 |
b0dfdb4ecc61121f4a1ea1918daf189abb555546 | 55 | py | Python | crawlab/constants/lang.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | 1 | 2019-08-20T14:26:39.000Z | 2019-08-20T14:26:39.000Z | crawlab/constants/lang.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | 9 | 2019-05-24T03:53:09.000Z | 2022-02-26T10:53:48.000Z | crawlab/constants/lang.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | 1 | 2019-11-08T08:12:40.000Z | 2019-11-08T08:12:40.000Z | class LangType:
PYTHON = 1
NODE = 2
GO = 3
| 11 | 15 | 0.509091 |
9fff0b24e74a1eb1bda30ffd9f94c274adc55b5f | 3,367 | py | Python | src/my_classifier.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | 11 | 2018-01-16T06:39:00.000Z | 2021-11-28T11:46:41.000Z | src/my_classifier.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | null | null | null | src/my_classifier.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | 2 | 2019-08-16T14:53:37.000Z | 2019-08-17T02:01:22.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author:lch02
@Time: 2017/12/26 18:23
@Description:
"""
import config
import os
import nltk
import cPickle as pickle
# import pickle
from nltk.classify import SklearnClassifier
from sklearn.svm import LinearSVC
__author__ = 'lch02'
def create_classifier(featx):
... | 30.609091 | 91 | 0.662014 |
05e807df7b15ca3a93995a96e817612ba874ad3b | 4,156 | py | Python | scripts/spreadsheet_to_resource_mds/spreadsheet_to_resource_mds.py | moscowtimeNgD/opsecswag.github.io | 8654d3d436095ddb399d80be53c893eb586544c9 | [
"MIT"
] | 5 | 2021-09-11T09:38:13.000Z | 2021-12-24T05:05:41.000Z | scripts/spreadsheet_to_resource_mds/spreadsheet_to_resource_mds.py | moscowtimeNgD/opsecswag.github.io | 8654d3d436095ddb399d80be53c893eb586544c9 | [
"MIT"
] | 8 | 2021-09-11T20:50:46.000Z | 2021-10-09T20:59:56.000Z | scripts/spreadsheet_to_resource_mds/spreadsheet_to_resource_mds.py | moscowtimeNgD/opsecswag.github.io | 8654d3d436095ddb399d80be53c893eb586544c9 | [
"MIT"
] | 6 | 2021-09-11T21:41:30.000Z | 2021-12-14T18:23:12.000Z | #! /usr/bin/python3
import gspread
import json
import os
import re
from oauth2client.service_account import ServiceAccountCredentials
from util import author_to_file_path, get_excerpt_from_page, get_valid_author_slug, title_to_file_path
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapi... | 34.347107 | 103 | 0.584697 |
af51619810ea45f4ae708e52d8b504082a577dba | 3,245 | py | Python | train.py | OPI-py/universal_chat_bot | 100ef62aa408497d95bcc5e9edac27bd24f501a1 | [
"MIT"
] | null | null | null | train.py | OPI-py/universal_chat_bot | 100ef62aa408497d95bcc5e9edac27bd24f501a1 | [
"MIT"
] | null | null | null | train.py | OPI-py/universal_chat_bot | 100ef62aa408497d95bcc5e9edac27bd24f501a1 | [
"MIT"
] | null | null | null | import random
import json
import pickle
import numpy as np
import nltk
from nltk.stem import WordNetLemmatizer
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation, Dropout
from tensorflow.keras.optimizers import SGD
# nltk.download('punkt') # require to download once
l... | 36.875 | 95 | 0.730046 |
bb8543ee3409cdd22a3a2ba6d0e1e464826a19bd | 207 | py | Python | examples/basic/setup.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | examples/basic/setup.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | examples/basic/setup.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | from setuptools import setup
install_requires = [
'warp',
'ipykernel',
'matplotlib',
'pydot']
setup(
name='example',
packages=['example'],
install_requires=install_requires)
| 15.923077 | 38 | 0.637681 |
b1bed2aa480661820182805384aadf283379afd9 | 3,300 | py | Python | src/main.py | marina8888/flame-dilution-method | 823c004f7f7ea85ca3e010610b61972a112cf988 | [
"MIT"
] | 2 | 2020-03-23T15:05:19.000Z | 2020-03-24T02:43:07.000Z | src/main.py | marina8888/flame-dilution-method | 823c004f7f7ea85ca3e010610b61972a112cf988 | [
"MIT"
] | 1 | 2020-05-07T13:06:09.000Z | 2020-05-07T13:06:09.000Z | src/main.py | marina8888/flame-dilution-method | 823c004f7f7ea85ca3e010610b61972a112cf988 | [
"MIT"
] | 2 | 2020-05-07T13:05:09.000Z | 2020-05-15T16:42:02.000Z | # before running this code pip install pandas, matplotlib and numpy libraries to your environment:
from excel_file.classes import Workbook, BigWorkbook
from excel_file import create_workbook
from graph_creator import create_graphs
# run file with -W in script parameters. Warnings related to dataslice copies can be igno... | 50.769231 | 160 | 0.669697 |
a70e0c18fd3ad69dac357593aa51d6b65f2db527 | 1,395 | py | Python | projects/g4h1-wsn/src/wsn/utils.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h1-wsn/src/wsn/utils.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h1-wsn/src/wsn/utils.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | import logging
import numpy
from .core import Wsn
# 日志配置
logger: logging.Logger = logging.getLogger('wsn.utils')
def generate_rand_nodes(
wsn: Wsn,
wsn_width_x: float, wsn_width_y: float, node_num: int,
node_r_mu: float, node_r_sigma: float, node_power: float, node_pc_per_sen... | 27.352941 | 83 | 0.648746 |
59d7f51a1728178eee089ca016a9ede9efced918 | 12,476 | py | Python | bach_code/data.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 5 | 2015-12-08T21:47:41.000Z | 2020-10-28T12:39:08.000Z | bach_code/data.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | null | null | null | bach_code/data.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 1 | 2020-10-28T12:39:09.000Z | 2020-10-28T12:39:09.000Z | from helpers import * # includes music21
import gct
import math
import time
import sys
from ordered_set import OrderedSet
from glob import glob
from random import shuffle
import numpy as npy
import h5py
import os
#####
#
# data.py
#
# Goal: create a data representation of the entire Bach chorale set - that is, the 371... | 36.479532 | 118 | 0.676499 |
ab8ce52173003ba60cc9a735634c8800133e7c88 | 4,699 | py | Python | official/cv/psenet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/psenet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/psenet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020-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 agre... | 34.050725 | 92 | 0.678017 |
e94b9e20d7714881f84097d98e313955cfc85103 | 166 | py | Python | IntPrepKit/01-WarmUp/03-Jumping-on-the-Clouds.py | sadikkuzu/HackerRank | 2b1ed2cf41f6a5404c5b9293186f301b646b5d33 | [
"Apache-2.0"
] | 5 | 2019-03-09T22:44:01.000Z | 2021-09-14T00:11:38.000Z | IntPrepKit/01-WarmUp/03-Jumping-on-the-Clouds.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 4 | 2018-08-16T09:39:47.000Z | 2018-09-14T17:37:07.000Z | IntPrepKit/01-WarmUp/03-Jumping-on-the-Clouds.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 1 | 2020-06-01T23:38:35.000Z | 2020-06-01T23:38:35.000Z | # https://www.hackerrank.com/challenges/counting-valleys/problem?h_l=interview&playlist_slugs%5B%5D%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D%5B%5D=warmup
| 83 | 165 | 0.831325 |
e98aab3fd7b26338799fd8c53901e82af37b662e | 467 | py | Python | leetcode/680-Valid-Palindrome-II/recursive.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-12-29T03:26:39.000Z | 2016-12-29T03:26:39.000Z | leetcode/680-Valid-Palindrome-II/recursive.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/680-Valid-Palindrome-II/recursive.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | def is_palindrome(st):
l, r = 0, len(st) - 1
while l < r:
if st[l] != st[r]:
return False
l += 1
r -= 1
return True
class Solution:
def validPalindrome(self, s: str) -> bool:
if len(s) < 2:
return True
res = False
if s[0] == s[-... | 19.458333 | 66 | 0.471092 |
dddcd05799df5a93143e05100dbb524aff0b99b1 | 9,263 | py | Python | files/meas/Experiment_01/02_Phasenmessung.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_01/02_Phasenmessung.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_01/02_Phasenmessung.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 12 13:16:39 2019
@author: Selim Cimen
"""
# Bitte beachten Sie die Messspitzen des Red Pitaya auf das Verhältnis 1:1 einzustellen
import time
import numpy as np
from redpitaya import redpitaya_scpi as scpi
import matplotlib.pyplot as plt
import ... | 46.782828 | 120 | 0.501673 |
5507db22d95100692b05fe88f717ae8868b3bdf1 | 209 | py | Python | HackerRank/30-Days-of-Code/Day 19: Interfaces/interfaces.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | 30-Days-of-Code/Day 19: Interfaces/interfaces.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | 30-Days-of-Code/Day 19: Interfaces/interfaces.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | class Calculator(AdvancedArithmetic):
def divisorSum(self, n):
result_sum = 0
for i in range(1, n + 1):
if n % i == 0:
result_sum += i
return result_sum
| 26.125 | 37 | 0.516746 |
fd335e69f6732aef4a820eda22a84829f3a7b01d | 7,136 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-5_modeling_with_rnn-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-5_modeling_with_rnn-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-5_modeling_with_rnn-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pnlp-4_english-5_modeling_with_rnn-refactored.py
pnlp-4_text_classification-english_sentiment_analysis-...
This is a refactorized version.
There're some minor changes in the variable names and so on.
Source: Python Natural Language Processing
Advanced machine learnin... | 32.884793 | 147 | 0.658212 |
1fbc1f3e410203a7d6659e40c335ceba60c82f31 | 1,430 | py | Python | workshop_petstagram/workshop_petstagram/main/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | workshop_petstagram/workshop_petstagram/main/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | workshop_petstagram/workshop_petstagram/main/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.urls import path
from workshop_petstagram.main.views.generic import show_home, show_dashboard, show_error_page
from workshop_petstagram.main.views.pet_photos import show_pet_photo_details, add_pet_photo, edit_pet_photo, \
like_pet_photo, delete_pet_photo
from workshop_petstagram.main.views.pets import ... | 49.310345 | 110 | 0.724476 |
1f8e22d496306cb2c7048bd37fd32ddc63a3ce5c | 799 | py | Python | 21-fs-ias-lec/03-BACnetCore/src/replication/channel.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/channel.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/channel.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from abc import ABC, abstractmethod
from queue import Queue
class Channel(ABC):
"""
The Channel class is abstract and specifies what must be implemented in an actual channel variant.
Different channel implementations can be developed, according to the needs and circumstances of
the project, that has t... | 24.96875 | 102 | 0.693367 |
2f5b4fcf6b7cd95621fda18cd755b0fa926c6ce4 | 7,718 | py | Python | sqlivuln/sqlivuln.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | sqlivuln/sqlivuln.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | sqlivuln/sqlivuln.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python2
#-*- coding:utf-8 -*-
import json
import time
import os
import subprocess
import platform
import sys
banner_ascii = '''
\033[1;91m
██████ █████ ██▓ ██▓ ██▒ █▓ █ ██ ██▓ ███▄ █
▒██ ▒ ▒██▓ ██▒▓██▒ ▓██▒ ▓██░ █▒ ██ ▓██▒▓██▒ ██ ▀█ █
░ ▓██▄ ▒██▒ ██░▒██░ ... | 36.92823 | 162 | 0.449469 |
85e34036fea3e82fffadd2a3312a57685b380c24 | 3,970 | py | Python | frappe-bench/apps/erpnext/erpnext/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '10.1.20'
def get_default_company(user=None):
'''Get default company for user'''
from frappe.defaults import get_user_default_as_li... | 32.016129 | 102 | 0.769521 |
c85a2fbafd4ab629d6b771363e04d9cd44f30639 | 433 | py | Python | software/test/Schleifen_auslesen_test.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/test/Schleifen_auslesen_test.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/test/Schleifen_auslesen_test.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | n = [2, 2, 3, 4, 5, 6]
k = [10, 11, 12, 13, 14, 15]
l=(0:5)
print(l)
for i in range(len(n)):
l[i].append(n[i])
l[i].append(k[i])
print(l)
res = 0
for i in n:
print(i)
res = res + i
print(res)
schnitt = res/len(n)
print(schnitt)
d=2
ds=str(d)
print(d)
print(ds)
print(type(d))
print(type(ds))
strong='d... | 14.931034 | 44 | 0.584296 |
c07713aa452a7d428f7e506e85414e1365d09e2f | 407 | py | Python | exercises/en/exc_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Import the English language class and create the nlp object
from ____ import ____
nlp = ____
# Process the text
doc = ____("I like tree kangaroos and narwhals.")
# A slice of the Doc for "tree kangaroos"
tree_kangaroos = ____
print(tree_kangaroos.text)
# A slice of the Doc for "tree kangaroos and narwhals" (witho... | 25.4375 | 72 | 0.771499 |
9e4eb860d87741cbc86a4d2d6c811a45ca97854d | 778 | py | Python | tests/web.adblockplus.org/tests/test_Languages.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/tests/test_Languages.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/tests/test_Languages.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pages.landingPage import LandingPage
from chunks.topMenu import TopMenu
from data.dataLanguages import TEST_DATA
import utils.global_functions as gf
@pytest.fixture
def driver():
options = Options()
gf.... | 23.575758 | 63 | 0.781491 |
9e819347a809be47020d6d33498dd36aa548c058 | 146 | py | Python | Problems/Two Pointers/easy/RemovePalindromicSubsequence/remove_palindromic_subsequence.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Two Pointers/easy/RemovePalindromicSubsequence/remove_palindromic_subsequence.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Two Pointers/easy/RemovePalindromicSubsequence/remove_palindromic_subsequence.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | def removePalindromeSub(s: str) -> int:
if not s: return 0 # empty string
if s == s[::-1]: return 1 # palindrome
return 2 # general | 36.5 | 43 | 0.609589 |
7b72b197b4685d6228287e0d027d5197d84017c8 | 467 | py | Python | CS305/assignment2/prime.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS305/assignment2/prime.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS305/assignment2/prime.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from math import ceil, sqrt
def check_prime(n: int) -> bool:
if n < 2:
return False
for i in range(2, ceil(sqrt(n) + 0.5)):
if n % i == 0:
return False
return True
def find_prime(start: int, end: int) -> list:
res = []
for i in range(start, end + 1):
if check_pr... | 22.238095 | 45 | 0.550321 |
b5274ec1f62f99642ffe368886e7a6ee43ae21fc | 3,764 | py | Python | tests/test_verbrauch.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_verbrauch.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_verbrauch.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import datetime
from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.verbrauch import Verbrauch, VerbrauchSchema
from bo4e.enum.mengeneinheit import Mengeneinheit
from bo4e.enum.wertermittlungsverfahren import Wertermittlungsverfahren
from tests.serialization_helper import assert_serializati... | 39.208333 | 109 | 0.582891 |
b597d641824e15167e6ff627647753e25fc8367c | 9,998 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/73a1/asm/asm.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/73a1/asm/asm.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/07_computer_architecture/asm/asm.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Assembler for LS-8 v4.0
#
# Example code:
#
# INC R0 ; A comment
# Label1:
# DEC R2
# LDI R3,Label1
#
# DS A String that is declared
# DB 0x0a ; a hex byte
# DB 12 ; a decimal byte
# DB 0b0001 ; a binary byte
import sys
import re
# Opcodes
OPCODES = {
"ADD": {"type": 2, "c... | 24.625616 | 79 | 0.504701 |
8d7dcb9e1d70d13868dd3d0aed7091c9411cc958 | 843 | py | Python | lib/metrics.py | liushrui/dsb | eacbe770acf32023029eb89dcc7829af89b09132 | [
"MIT"
] | null | null | null | lib/metrics.py | liushrui/dsb | eacbe770acf32023029eb89dcc7829af89b09132 | [
"MIT"
] | null | null | null | lib/metrics.py | liushrui/dsb | eacbe770acf32023029eb89dcc7829af89b09132 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from keras import backend as K
# Define IoU metric
def mean_iou(y_true, y_pred):
prec = []
for t in np.arange(0.5, 1.0, 0.05):
y_pred_ = tf.to_int32(y_pred > t)
score, up_opt = tf.metrics.mean_iou(y_true, y_pred_, 2)
K.get_session().r... | 33.72 | 87 | 0.645314 |
f54db0907a600877f860eff882f0810d0ba3c35b | 2,231 | py | Python | ggit_platform/urls.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | 1 | 2019-02-27T21:20:54.000Z | 2019-02-27T21:20:54.000Z | ggit_platform/urls.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | ggit_platform/urls.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^admin/stories/$', views.story_list, name='story_list'),
url(r'^admin/stories/new/$', views.story_new, name='story_new'),
url(r'^admin/stories/(?P<id>\d+)/edit/$', views.story_edit, name='story_edit'),
url(r'^admin/stories/(?P<... | 53.119048 | 102 | 0.654863 |
194a8a5ff90ba2ffc575c935dec7a468fdc9b1a5 | 1,456 | py | Python | Arrays and Strings/UniqueCharactersInString.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/UniqueCharactersInString.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/UniqueCharactersInString.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | '''
Implement an algorithm to determine if a string has all unique characters.
What if you can not use additional data structures?
'''
def isUniqueCharsString(s):
'''
in: string
out: bool
'''
# Approach 1: Brute Force
# -----------------------
# length = len(s)
# for i ... | 23.483871 | 76 | 0.460852 |
e3605ac9fd1724153069b648a00a77d7fc63b093 | 11,670 | py | Python | plotting/scripts/plot_output_compares.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/scripts/plot_output_compares.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/scripts/plot_output_compares.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""Saved output comparison plots for the ETGM paper"""
# Standard Packages
import sys; sys.path.insert(0, '../'); sys.path.insert(0, '../../')
import logging
# 3rd Party Packages
import matplotlib.pyplot as plt
# Local Packages
import modules.utils as utils
from plotting.modules.plotstyles import... | 46.309524 | 168 | 0.636247 |
8bdbb9b411d88d4db0f9d70442c2214a266a69ab | 452 | py | Python | moviemon/urls.py | 42bbichero/MovieMon | 4fee28e0449429ffcd3e0a284365a7f3e7c64e3d | [
"MIT"
] | null | null | null | moviemon/urls.py | 42bbichero/MovieMon | 4fee28e0449429ffcd3e0a284365a7f3e7c64e3d | [
"MIT"
] | null | null | null | moviemon/urls.py | 42bbichero/MovieMon | 4fee28e0449429ffcd3e0a284365a7f3e7c64e3d | [
"MIT"
] | 1 | 2019-01-12T10:42:25.000Z | 2019-01-12T10:42:25.000Z |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.init),
url(r'^worldmap$', views.worldmap),
url(r'^moviedex$', views.moviedex),
url(r'^moviedex/(?P<id>[\w-]+)$', views.moviedex_id),
url(r'^battle/(?P<id>[\w-]+)$', views.battle),
url(r'^options$', views.options),
url(... | 30.133333 | 67 | 0.610619 |
8bea236c9fad71d3d4fc097b2525a54548aee957 | 307 | py | Python | 1221-split-a-string-in-balanced-strings/1221-split-a-string-in-balanced-strings.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1221-split-a-string-in-balanced-strings/1221-split-a-string-in-balanced-strings.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1221-split-a-string-in-balanced-strings/1221-split-a-string-in-balanced-strings.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def balancedStringSplit(self, s: str) -> int:
# R: +1, L: -1
output = 0
cur = 0
for step in s:
if step=="R":
cur+=1
else:
cur-=1
if cur==0:
output+=1
return output | 23.615385 | 49 | 0.374593 |
47f06f8fea4e0e53159a0232d1275115efd82576 | 4,047 | py | Python | year_3/databases_sem1/lab1/maxdb/storages.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem1/lab1/maxdb/storages.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem1/lab1/maxdb/storages.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from .dbelement import DBElement, DBFKElement
import json
import pickle
from .utils import touch
class Storage(metaclass=ABCMeta):
"""
Abstract base class for _all Storages.
A Storage (de)serializes the current state of the database and saves it.
A Storage... | 26.45098 | 92 | 0.597233 |
ef189be9a08bc622d995d3d9916edd66a9f04831 | 1,098 | py | Python | app.py | AakashMallik/cnn-firefly | 6c8ed58a035e62682263753436b124cb979ed240 | [
"MIT"
] | null | null | null | app.py | AakashMallik/cnn-firefly | 6c8ed58a035e62682263753436b124cb979ed240 | [
"MIT"
] | 7 | 2020-11-27T12:24:31.000Z | 2020-11-29T09:41:09.000Z | app.py | AakashMallik/cnn-firefly | 6c8ed58a035e62682263753436b124cb979ed240 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from pathlib import Path
from inquirer import Checkbox, List, prompt
from inquirer.themes import GreenPassion
from src.utils.path import CONFIG_ROOT
from src.main import Pipeline
config_list = [config_files for config_files in CONFIG_ROOT.iterdir()
if config_files.is_file()]
if... | 27.45 | 71 | 0.568306 |
32827f651f3fc85ce16868839bd860c0ffd35a81 | 1,654 | py | Python | bin/dl.py | username4gh/dotfiles | 6ab3e6a7eecb82f01fadfa40a961164df34af091 | [
"Unlicense"
] | 5 | 2017-04-18T20:21:06.000Z | 2020-12-28T05:44:39.000Z | bin/dl.py | username4gh/dotfiles | 6ab3e6a7eecb82f01fadfa40a961164df34af091 | [
"Unlicense"
] | 35 | 2016-09-21T18:04:51.000Z | 2020-03-11T02:39:20.000Z | bin/dl.py | username4gh/dotfiles | 6ab3e6a7eecb82f01fadfa40a961164df34af091 | [
"Unlicense"
] | 2 | 2018-12-17T03:16:35.000Z | 2020-10-18T10:09:01.000Z | #! /usr/bin/env python
# coding=UTF-8
import re
import sys
import urllib2
class Downloader:
def __init__(self):
""" do nothing
"""
@staticmethod
def _file_size(file_name):
file_size = os.path.getsize(file_name)
if file_size < 1024:
return str(file_size) + 'byte... | 25.060606 | 61 | 0.515115 |
de9c26f6d0542c53a1c5fc8a0b1946b9b96b34e7 | 1,210 | py | Python | Backend/wait_db_rdy.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/wait_db_rdy.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/wait_db_rdy.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | import os
from datetime import datetime, timedelta
from time import sleep
from urllib.parse import quote
import psycopg2
# noinspection PyUnresolvedReferences
import loadenv
DB_HOST = os.environ.get('DB_HOST').replace('\n', '')
DB_PORT = os.environ.get('DB_PORT').replace('\n', '')
DB_USER = os.environ.get('DB_USER').... | 26.304348 | 158 | 0.647107 |
c21a7ac608c30518377aeab9d7fc5af80715cc16 | 4,775 | py | Python | python/fleetx/utils/barrier_server_impl.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | python/fleetx/utils/barrier_server_impl.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | python/fleetx/utils/barrier_server_impl.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from concurrent import futures
import grpc
from . import barrier_server_pb2 as barrier_server_pb2
from . import barrier_server_pb2_grpc as barrier_server_pb2_grpc
from .barrier_client_impl import BarrierClient
import time
import sys, os
import logging
clas... | 34.107143 | 80 | 0.61089 |
a03296f32125f87d2a65ed43c8496629d7339cd0 | 3,421 | py | Python | src/test/tests/operators/box.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/box.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/operators/box.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: box.py
#
# Tests: mesh - 3D point, single domain,
# 3D rectilinear, multiple domain.
# 3D unstructured, single domain.
# plots ... | 22.070968 | 78 | 0.664133 |
90045fd23f33b142d5b11d010127af899d179a6a | 400 | py | Python | src/training/pytorch/symbol_detector_convert.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2020-04-17T12:27:06.000Z | 2020-04-17T12:27:06.000Z | src/training/pytorch/symbol_detector_convert.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2022-02-27T13:13:17.000Z | 2022-02-27T13:13:17.000Z | src/training/pytorch/symbol_detector_convert.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | null | null | null | import torch
from symbol_detector_model import SymbolDetector
from torch.utils.mobile_optimizer import optimize_for_mobile
model = SymbolDetector()
model.load_state_dict(torch.load("./models/symbol_detector.pth"))
model_tmp = torch.quantization.convert(model)
scripted_model = torch.jit.script(model_tmp)
opt_model = o... | 33.333333 | 65 | 0.8375 |
f2454efc809ac2f476ccb657b60bcc19bd42d4ec | 615 | py | Python | lib/images.py | codekulturbonn/webgen | 38cb7f5f382a05b65ef0886fc05814ed2e0e55ff | [
"MIT"
] | null | null | null | lib/images.py | codekulturbonn/webgen | 38cb7f5f382a05b65ef0886fc05814ed2e0e55ff | [
"MIT"
] | null | null | null | lib/images.py | codekulturbonn/webgen | 38cb7f5f382a05b65ef0886fc05814ed2e0e55ff | [
"MIT"
] | null | null | null |
import glob
import os.path
import random
'''
Collect images from a folder
'''
def filter(data, **kwargs):
#print(kwargs['config']['captions'])
data['source_images'] = []
n = 1
for i in glob.glob(data['images']):
#print("IMAGE", n)
filename = os.path.basename(i)
base, ext = os.... | 21.206897 | 56 | 0.526829 |
8a19677810485d2faac4b65c8456c94ea5c171b0 | 944 | py | Python | tools/add_book_info.py | terben/Linux_Deutsch_Jupyter | 1980dacc970fc2905380624c941b5ed31aaa9bad | [
"CC-BY-4.0"
] | 1 | 2022-01-24T17:17:57.000Z | 2022-01-24T17:17:57.000Z | tools/add_book_info.py | terben/Linux_Deutsch_Jupyter | 1980dacc970fc2905380624c941b5ed31aaa9bad | [
"CC-BY-4.0"
] | null | null | null | tools/add_book_info.py | terben/Linux_Deutsch_Jupyter | 1980dacc970fc2905380624c941b5ed31aaa9bad | [
"CC-BY-4.0"
] | 1 | 2019-11-28T11:58:57.000Z | 2019-11-28T11:58:57.000Z | import os
import nbformat
from nbformat.v4.nbbase import new_markdown_cell
import notebook_utils as nu
# script to add an advertisement for the Linux book to the lecture
# notebook
# implicit assumptions:
# - the source notebooks are in the parent directory of pwd
# - result notebooks go to pwd
def add_book_info():... | 28.606061 | 73 | 0.686441 |
0a44c434d06d58ed8616c5ba0490c1d73981736b | 5,566 | py | Python | examples/language_model/luke/args.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/luke/args.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/luke/args.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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 applicab... | 37.355705 | 122 | 0.545634 |
6a876dc94bfc2b4b52ef86b235774c8bffa3c0d5 | 5,262 | py | Python | modules.py | friskit-china/IoH | 2728e9cfcc5316948b5dacbceb132c1dfcf285b6 | [
"MIT"
] | null | null | null | modules.py | friskit-china/IoH | 2728e9cfcc5316948b5dacbceb132c1dfcf285b6 | [
"MIT"
] | null | null | null | modules.py | friskit-china/IoH | 2728e9cfcc5316948b5dacbceb132c1dfcf285b6 | [
"MIT"
] | null | null | null | import adafruit_bme280
import adafruit_ssd1306
import paho.mqtt.client as mqtt
import json
import os
from PIL import ImageFont, Image, ImageDraw
import time
from easydict import EasyDict as edict
class BME280:
def __init__(self, _g, i2c_bus, address, sea_level_pressure=1013.25):
_g.logger.info... | 38.691176 | 118 | 0.619156 |
6aae87d2d9c245c18e84ba2ef25ddf29d298bb7d | 3,297 | py | Python | test/test_npu/test_network_ops/test_upsample_nearest3d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_upsample_nearest3d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_upsample_nearest3d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 39.722892 | 90 | 0.640279 |
0aec05f0807185024717f056a79e19cb2c18ce26 | 10,571 | py | Python | our_callbacks.py | BIGBALLON/Model_Experiment | d96712a01997a2f51cad29d611e60d2567ce1021 | [
"MIT"
] | 2 | 2018-11-25T14:05:33.000Z | 2019-07-12T03:45:24.000Z | our_callbacks.py | BIGBALLON/Model_Experiment | d96712a01997a2f51cad29d611e60d2567ce1021 | [
"MIT"
] | null | null | null | our_callbacks.py | BIGBALLON/Model_Experiment | d96712a01997a2f51cad29d611e60d2567ce1021 | [
"MIT"
] | null | null | null | import argparse
import numpy as np
import tensorflow as tf
import math
from keras import backend as K
from keras.callbacks import LearningRateScheduler, TensorBoard, ModelCheckpoint
from keras.callbacks import Callback
learning_rate_scheduler_list = [
'step_decay', 'step_decay_two', 'step_decay_three',
'exponential', ... | 47.617117 | 162 | 0.563617 |
7cb5fb9a07e3a20f61b02c0a2e233bdf62d1218e | 1,267 | py | Python | glal3/Linuxlabor/radio.py | mnemocron/FHNW | e43c298cb9c8f617fa19b77dd6630a342c78bda7 | [
"Unlicense"
] | 1 | 2020-10-07T07:28:33.000Z | 2020-10-07T07:28:33.000Z | glal3/Linuxlabor/radio.py | mnemocron/FHNW | e43c298cb9c8f617fa19b77dd6630a342c78bda7 | [
"Unlicense"
] | null | null | null | glal3/Linuxlabor/radio.py | mnemocron/FHNW | e43c298cb9c8f617fa19b77dd6630a342c78bda7 | [
"Unlicense"
] | 1 | 2021-01-17T16:38:58.000Z | 2021-01-17T16:38:58.000Z | #!/usr/bin/python
#_*_ coding: utf-8 _*_
'''
@file
@author
@date
'''
import sys
import os
import urllib.request
from bs4 import BeautifulSoup
url = 'http://www.listenlive.eu/switzerland.html'
conn = urllib.request.urlopen(url)
html = conn.read()
bs = BeautifulSoup(html, 'lxml')
elements ... | 21.116667 | 81 | 0.625099 |
860c7a165654df77beacd4bf959ebec7ba47be3d | 585 | py | Python | exercises/en/test_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert "len(doc)" in __solution__, "Are you getting the doc's length?"
assert "return doc" in __solution__, "Are you returning the doc?"
assert "nlp.add_pipe" in __solution__, "Are you adding the component?"
assert (
"first=True" in __solution__
), "Are you adding the component f... | 36.5625 | 88 | 0.641026 |
86cff63508b691faf1a2f76c71a1407853c90836 | 445 | py | Python | PYTHON/Closures_and_Decorators/name_directory.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Closures_and_Decorators/name_directory.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Closures_and_Decorators/name_directory.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def person_lister(f):
def inner(people):
people.sort(key=lambda x: int(x[2]))
for p in people:
yield f(p)
return inner
@person_lister
def name_format(person):
return ("Mr. " if person[3] == "M" else "Ms. ") + person[0] + " " + person[1]
if _... | 22.25 | 81 | 0.586517 |
86d9e493a85713839b5e0678759983c9486b4e65 | 350 | py | Python | SBTK_League_Helper/src/security/__init__.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/security/__init__.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/security/__init__.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from .key_handling import store_keys, retrieve_keys
valid_charset = '-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
def check_valid_password(pwd):
try:
assert len(pwd) >= 10
for char in pwd:
assert char in valid_charset
except AssertionError:
return False... | 26.923077 | 82 | 0.7 |
86f52f9d5134c66543bd5dcf354abe5e63b1cd21 | 658 | py | Python | utils/date_util.py | NewLanded/swbt | 8b8e8609cea060d6f124dc3c4bd99cb6243501dc | [
"Apache-2.0"
] | null | null | null | utils/date_util.py | NewLanded/swbt | 8b8e8609cea060d6f124dc3c4bd99cb6243501dc | [
"Apache-2.0"
] | null | null | null | utils/date_util.py | NewLanded/swbt | 8b8e8609cea060d6f124dc3c4bd99cb6243501dc | [
"Apache-2.0"
] | 1 | 2019-11-28T16:29:49.000Z | 2019-11-28T16:29:49.000Z | import datetime
def convert_datetime_to_str(date):
return date.strftime('%Y%m%d')
def convert_str_to_datetime(date):
if "-" in date:
return datetime.datetime.strptime(date, "%Y-%m-%d")
else:
return datetime.datetime.strptime(date, "%Y%m%d")
def convert_pd_timestamp_to_datetime(timestam... | 22.689655 | 61 | 0.683891 |
8117546b68824aa3316f5a1227149eb0cc3afc8e | 1,571 | py | Python | pilha.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | pilha.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | pilha.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | import unittest
class PilhaVaziaErro(Exception):
pass
class Pilha():
def __init__(self):
self.pilha = []
def topo(self):
try:
return self.pilha[-1]
except:
raise PilhaVaziaErro()
def vazia(self):
if len(self.pilha) == 0:
return True
... | 25.754098 | 72 | 0.603437 |
d4d14e1e1819572fd3ff7b34d03a9dbd3b48f986 | 8,358 | py | Python | src/jxf2ntf.py | r-gr/jxf-to-ntf | fc9563b72be9eddc89af5c31d829b2bf9a56f773 | [
"MIT"
] | null | null | null | src/jxf2ntf.py | r-gr/jxf-to-ntf | fc9563b72be9eddc89af5c31d829b2bf9a56f773 | [
"MIT"
] | null | null | null | src/jxf2ntf.py | r-gr/jxf-to-ntf | fc9563b72be9eddc89af5c31d829b2bf9a56f773 | [
"MIT"
] | null | null | null | import struct
from typing import List, Tuple, BinaryIO
def main(infiles: List[str], outfile: str, n: int) -> None:
size_x, size_y = None, None
with open(outfile, 'wb') as ntf:
for i in range(n):
print(f'processing file {i+1}/{n}')
with open(infiles[i], 'rb') as jxf:
... | 39.611374 | 97 | 0.505384 |
07b49828e3dadcc3f6bd2bafcca06358bd22b0b8 | 1,282 | py | Python | src/server/handlers/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/handlers/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/handlers/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from .datasources import (
DataSourceListResource,
DataSourceTestResource,
DataSourceResource,
)
from .integrations import (
IntegrationListResource,
IntegrationResource,
)
from .issues import (
IssueListResource,
)
from .metrics import (
MetricListResource,
)
from .monitors import (
Mon... | 32.871795 | 100 | 0.737129 |
ed5214f7116412470663119564137f73598dcb2d | 440 | py | Python | source-code/ESP8266/main.py | ZakkyMas/Audio_Mixer_Wireless | 7f7a002fdf8eebe6891c06b803f1a3bd0c2da7ca | [
"MIT"
] | 3 | 2020-12-30T18:37:13.000Z | 2021-10-02T07:43:10.000Z | source-code/ESP8266/main.py | ZakkyMas/Audio_Mixer_Wireless | 7f7a002fdf8eebe6891c06b803f1a3bd0c2da7ca | [
"MIT"
] | null | null | null | source-code/ESP8266/main.py | ZakkyMas/Audio_Mixer_Wireless | 7f7a002fdf8eebe6891c06b803f1a3bd0c2da7ca | [
"MIT"
] | 1 | 2021-10-02T07:47:53.000Z | 2021-10-02T07:47:53.000Z | import gc
gc.enable()
import utime as time
from machine import Pin
res = 0
for a in range(10):
if not Pin(0, Pin.IN).value():
res = 1
break
time.sleep_ms(100)
if not res:
try:
from m_System import System
main = System()
main.Looping()
ma... | 18.333333 | 36 | 0.518182 |
1325c6c3579c99853f5ffcfcafc0ba7a1c5eece3 | 294 | py | Python | pacman-arch/test/pacman/tests/sync-sysupgrade-print-replaced-packages.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/sync-sysupgrade-print-replaced-packages.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/sync-sysupgrade-print-replaced-packages.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Print replacements when using -Sup"
lp = pmpkg("a", "1-1")
self.addpkg2db("local", lp)
sp = pmpkg("b", "2-2")
sp.replaces = ["a"]
self.addpkg2db("sync", sp)
self.args = "-Sup"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PACMAN_OUTPUT=%s-%s" % (sp.name, sp.version))
| 19.6 | 59 | 0.653061 |
13a2f8f0db75dbb3d2cedc40bfb080dc27a73bde | 2,699 | py | Python | src/transformers/modeling_marian.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 1 | 2022-03-25T00:00:49.000Z | 2022-03-25T00:00:49.000Z | src/transformers/modeling_marian.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | null | null | null | src/transformers/modeling_marian.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 2 | 2021-03-27T16:46:26.000Z | 2021-12-24T00:33:28.000Z | # coding=utf-8
# Copyright 2020 Marian Team Authors and The HuggingFace Inc. team.
#
# 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
#
# Unles... | 42.171875 | 115 | 0.708411 |
e06ac5c064756686e3bf1380b1a7866f11c792cb | 3,794 | py | Python | src/onegov/gazette/views/notice_attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/notice_attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/notice_attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from onegov.core.crypto import random_token
from onegov.core.security import Private
from onegov.file.utils import as_fileintent
from onegov.gazette import _
from onegov.gazette import GazetteApp
from onegov.gazette.forms import EmptyForm
from onegov.gazette.layout import Layout
from onego... | 28.742424 | 77 | 0.642857 |
5d255a7bbd2723389073778773376ae8429dc5e6 | 572 | py | Python | GUI/Banco.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | GUI/Banco.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | GUI/Banco.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | #importando módulo do SQlite
import sqlite3
class Banco():
def __init__(self):
self.conexao = sqlite3.connect('banco.db')
self.createTable()
def createTable(self):
c = self.conexao.cursor()
c.execute("""create table if not exists usuarios (
idusuario inte... | 27.238095 | 66 | 0.513986 |
54cf8f5e0d10a45727470e14a039043f187f41eb | 5,887 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/notification/bearychat.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/notification/bearychat.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/notification/bearychat.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jiangge Zhang <tonyseek@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | 32.346154 | 104 | 0.652115 |
4aea5d86f819caa141501b2f54d1eb03fcee4600 | 2,460 | py | Python | dcapy/auth/auth.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | dcapy/auth/auth.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | dcapy/auth/auth.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | from pydantic import BaseModel, Field, HttpUrl
import requests
import json
import pandas as pd
from typing import List, Union
api_url = 'https://dcapyapi.herokuapp.com/'
#api_url = 'http://127.0.0.1:8000/'
class Credential(BaseModel):
url: HttpUrl = Field(api_url, const=True)
token: str = Field(None)
... | 27.333333 | 83 | 0.51748 |
4aec725f2a24e3f0f69a499a4a012cd38c830d86 | 1,558 | py | Python | Shelly-master/shell.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 77 | 2019-12-19T18:24:35.000Z | 2022-01-21T18:22:59.000Z | shell.py | marciopocebon/Shelly | 35dcbb8c8692eea53a6c3abb3c42c1707faaf0ba | [
"MIT"
] | null | null | null | shell.py | marciopocebon/Shelly | 35dcbb8c8692eea53a6c3abb3c42c1707faaf0ba | [
"MIT"
] | 24 | 2019-12-23T17:54:50.000Z | 2022-02-09T16:13:22.000Z | from argparse import ArgumentParser
from configparser import ConfigParser
from requests import get
from time import sleep
from sys import stdout
print ("""
______ ____
/ __/ / ___ / / __ __
_\ \/ _ / -_/ / / // /
/___/_//_\__/_/_/\_, /
/___/ v.1
--------------------------
Python shell... | 26.862069 | 86 | 0.608472 |
ab2657c9f944484fcf564940843178a38c00ee27 | 581 | py | Python | src/server/bo/NamedBusinessObject.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/bo/NamedBusinessObject.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/bo/NamedBusinessObject.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | from server.bo.BusinessObject import BusinessObject
class NamedBusinessObject(BusinessObject):
"""The implementation of a NamedBusinessObject class.
Collective base class for the implementation of all relevant classes
within this project.
A central attribute for all named business objects is the nam... | 25.26087 | 73 | 0.659208 |
91815fdea7d482b17f8bc77a5cda09eb9c9e8b46 | 1,255 | py | Python | django/ToDoApp/manageToDo/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django/ToDoApp/manageToDo/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django/ToDoApp/manageToDo/views.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, reverse
from django.contrib import messages
from .models import ToDoList
from .forms import ToDoListForm
# Create your views here.
def home(request):
if request.method == 'POST':
form = ToDoListForm(request.POST or None)
if form.is_valid():
... | 26.145833 | 85 | 0.663745 |
9185255f0e098a1459c0c5a901d9445a6e38847d | 4,373 | py | Python | packages/watchmen-meta/src/watchmen_meta/dqc/monitor_rule_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/dqc/monitor_rule_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/dqc/monitor_rule_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional
from watchmen_meta.common import TupleService, TupleShaper
from watchmen_model.common import FactorId, TenantId, TopicId
from watchmen_model.dqc import MonitorRule, MonitorRuleCode, MonitorRuleGrade, MonitorRuleId
from watchmen_storage import ColumnNameLiteral, EntityCriteriaExpressio... | 38.699115 | 111 | 0.782987 |
72c547e94e4afa0e4ee1f280bb1dc37ac75b311c | 893 | py | Python | 494/Tuwulisu_494_dp_dfs.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 494/Tuwulisu_494_dp_dfs.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 494/Tuwulisu_494_dp_dfs.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | class Solution:
def findTargetSumWays(self, nums: List[int], target: int) -> int:
dict_=dict()
def dfs(layer_id: int, nums: List[int], current_num: int, target: int)->int:
if layer_id >= len(nums):
if current_num==target:
return 1
... | 42.52381 | 85 | 0.566629 |
72f8cac180c684df37bd0b922592fa7fbc67b6d3 | 2,641 | py | Python | tests/etl/test_data_preprocessing_pipeline.py | emptymalei/haferml | ba193ce1c022c89fb4e88924b7bb7a05b676929a | [
"MIT"
] | 11 | 2021-04-17T18:51:45.000Z | 2021-06-25T19:42:25.000Z | tests/etl/test_data_preprocessing_pipeline.py | emptymalei/haferml | ba193ce1c022c89fb4e88924b7bb7a05b676929a | [
"MIT"
] | 3 | 2021-04-29T19:24:15.000Z | 2021-05-21T04:30:54.000Z | tests/etl/test_data_preprocessing_pipeline.py | emptymalei/haferml | ba193ce1c022c89fb4e88924b7bb7a05b676929a | [
"MIT"
] | 2 | 2021-06-10T00:55:43.000Z | 2021-12-30T07:37:07.000Z | import pandas as pd
from haferml.preprocess.ingredients import attributes
from haferml.preprocess.pipeline import BasePreProcessor
from loguru import logger
class DemoPreProcessor(BasePreProcessor):
def __init__(self, config, columns, cutoff_timestamp=None):
super(DemoPreProcessor, self).__init__(config=c... | 28.095745 | 85 | 0.593715 |
2287b00d954e2783d42ac24936ee3e1320549ebb | 520 | py | Python | exercises/de/exc_03_09_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/exc_03_09_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/exc_03_09_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.tokens import Token
nlp = spacy.blank("de")
# Definiere die Getter-Funktion, die den umgekehrten Text eines Tokens zurückgibt
def get_reversed(token):
return token.text[::-1]
# Registriere die Token-Erweiterung "reversed" mit Getter-Funktion get_reversed
____.____(____, ____=____)
# Ver... | 28.888889 | 83 | 0.769231 |
4a2e7aa7990aaf7bf316f921b3d83e2cb1324c66 | 553 | py | Python | wagtail_localize/migrations/0005_remove_translationsource_object.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | wagtail_localize/migrations/0005_remove_translationsource_object.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | wagtail_localize/migrations/0005_remove_translationsource_object.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | # Generated by Django 3.0.8 on 2020-08-05 11:35
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0057_page_locale_fields_notnull"),
("wagtail_localize", "0004_one_source_per_objectlocale"),
]
operations = [
migrations.Alte... | 24.043478 | 65 | 0.609403 |
4a731baed5bba317c3e32379a183bf7b952a9a76 | 1,926 | py | Python | assignments/9/runge_function.py | patcher1/numerik | ad24c8522d61970a3a881e034a7940d43ba486be | [
"BSD-3-Clause"
] | null | null | null | assignments/9/runge_function.py | patcher1/numerik | ad24c8522d61970a3a881e034a7940d43ba486be | [
"BSD-3-Clause"
] | null | null | null | assignments/9/runge_function.py | patcher1/numerik | ad24c8522d61970a3a881e034a7940d43ba486be | [
"BSD-3-Clause"
] | 1 | 2019-10-01T14:36:03.000Z | 2019-10-01T14:36:03.000Z | import numpy as np
import numpy.linalg as linalg
import scipy.linalg
import matplotlib.pyplot as plt
def approximate_polynomial(polynom_degree,function, inputs, method ):
A = np.zeros((inputs.size,polynom_degree))
for i in range(0, polynom_degree):
A[:,i] = np.power(inputs, i)
b = np.array([func... | 27.913043 | 88 | 0.639148 |
4abf22961fa4b5730012db38d8ae8fb51d70f536 | 4,656 | py | Python | docker/api/api/endpoints/edit_measures.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | docker/api/api/endpoints/edit_measures.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | docker/api/api/endpoints/edit_measures.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Corona-Info-App
#
# © 2020 Tobias Höpp
# Include dependencies
from flask import request, jsonify
# Include modules
from main import api, jwt
from flask_jwt_extended import jwt_required
from utils.measure_utils import deleteMeasure, modifyMeasure, createMeasure, getMeasures, getMeasure
from... | 38.479339 | 103 | 0.652706 |
436105acd6e79073590bcd23923f7c178c97af3d | 1,248 | py | Python | ais3-pre-exam-2022-writeup/Misc/JeetQode/chall/problem.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Misc/JeetQode/chall/problem.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Misc/JeetQode/chall/problem.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod, abstractproperty
from typing import Any, Tuple
from helper import run_jq
import json
class Problem(ABC):
@abstractproperty
def name(self) -> str:
pass
@abstractproperty
def desciption(self) -> str:
pass
@abstractproperty
def rounds(self) -... | 26.553191 | 80 | 0.573718 |
43ad5f04c49289067a264c28992dcca3787058b8 | 626 | py | Python | lib/settings.py | HSRNetwork/weather_beacon | 1e87b92052273b94663f779d63514bdf465fae2a | [
"MIT"
] | null | null | null | lib/settings.py | HSRNetwork/weather_beacon | 1e87b92052273b94663f779d63514bdf465fae2a | [
"MIT"
] | null | null | null | lib/settings.py | HSRNetwork/weather_beacon | 1e87b92052273b94663f779d63514bdf465fae2a | [
"MIT"
] | null | null | null | import ujson
class Settings(object):
def __init__(self, settings_file):
self.settings_file = settings_file
def get(self, key):
with open(self.settings_file, 'r') as fp:
data = ujson.load(fp)
try:
return data[key]
except KeyError:
... | 25.04 | 49 | 0.533546 |
78ee785fc43b73213249306b036c1ab17f016143 | 5,754 | py | Python | ci/check/run_clang_format.py | caishenghang/oneflow | db239cc9f98e551823bf6ce2d4395bd5c339b1c5 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | ci/check/run_clang_format.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | ci/check/run_clang_format.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | #!/usr/bin/env python2
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | 35.085366 | 88 | 0.608446 |
60a9278dc02ca725687358a1426bec7560814446 | 1,460 | py | Python | data/labeled_sentiment_data/create_mixed_corpus_1.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 1 | 2020-06-04T13:20:45.000Z | 2020-06-04T13:20:45.000Z | data/labeled_sentiment_data/create_mixed_corpus_1.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 6 | 2020-06-03T18:45:11.000Z | 2022-02-10T01:51:03.000Z | data/labeled_sentiment_data/create_mixed_corpus_1.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | null | null | null | from utilities.utilities import save_data
from utilities.utilities import get_random_elements_from_list
from random import shuffle
import pickle
path = "data/labeled_sentiment_data/pickle_files/"
corpus_name1 = "sb10k_and_one_million_posts_corpus"
corpus_name2 = "scare"
new_corpus_name = "mixed_corpus_1"
dataset1 = p... | 35.609756 | 87 | 0.726027 |
60ffb4cc0afc192be29559bb41ac04f7d30d70f8 | 3,971 | py | Python | taren/websitecache.py | ThirtySomething/TaRen | ef09e8616c45bcb97afcea3ad4844ae6fade7525 | [
"MIT"
] | null | null | null | taren/websitecache.py | ThirtySomething/TaRen | ef09e8616c45bcb97afcea3ad4844ae6fade7525 | [
"MIT"
] | null | null | null | taren/websitecache.py | ThirtySomething/TaRen | ef09e8616c45bcb97afcea3ad4844ae6fade7525 | [
"MIT"
] | null | null | null | '''
******************************************************************************
Copyright 2020 ThirtySomething
******************************************************************************
This file is part of TaRen.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and ... | 42.244681 | 152 | 0.629313 |
1cdd3c8e6ecd3cfa8a50a5e1d0c7d84791824720 | 591 | py | Python | exercises/de/test_02_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_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
person_hash == nlp.vocab.strings["PER"]
), "Hast du den korrekten String nachgeschlagen, um den Hash zu erhalten?"
assert (
'nlp.vocab.strings["PER"]' in __solution__
), "Hast du den korrekten String nachgeschlagen, um den Hash zu erhalten?"
assert (
pers... | 36.9375 | 78 | 0.656514 |
1cef472d38d0bafef8ae65aed84a7b40c8153a32 | 4,164 | py | Python | Bowman/module_test.py | JonathanOnorato/ChemLP | a7b0d2f9a3899531aacda9bc85d89d721f6450c4 | [
"MIT"
] | 4 | 2020-04-13T20:49:01.000Z | 2021-02-09T01:05:01.000Z | Bowman/module_test.py | JonathanOnorato/ChemLP | a7b0d2f9a3899531aacda9bc85d89d721f6450c4 | [
"MIT"
] | 3 | 2020-04-28T23:16:27.000Z | 2020-04-28T23:26:53.000Z | Bowman/module_test.py | JonathanOnorato/ChemLP | a7b0d2f9a3899531aacda9bc85d89d721f6450c4 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'This program so far imports a variant of the functions we all made as BowFunks. It then takes a given start url, in this case a Chapter from\\nthe Schaller textbook, ... | 33.580645 | 319 | 0.618876 |
c71b2e14b3d209c7bafa3ee196f4d8a60467a74f | 14,651 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/splitRouteFiles.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/splitRouteFiles.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/splitRouteFiles.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# 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 available at
# https://www.ec... | 43.218289 | 116 | 0.588834 |
90b01550fdd4899ef684ce28e26eaa390259cd39 | 1,291 | py | Python | presentations/ICPC-Referat/Material/tarjans-short.py | keithmannock/LaTeX-examples | 6829f6cf9710b314a4bf0b64abdae5bcf6997fd0 | [
"MIT"
] | 2 | 2017-11-02T10:09:12.000Z | 2017-11-24T22:16:18.000Z | presentations/ICPC-Referat/Material/tarjans-short.py | everbot/LaTeX-examples | 9558d8b3c19776cb068b9753dcd3f88645dd7134 | [
"MIT"
] | null | null | null | presentations/ICPC-Referat/Material/tarjans-short.py | everbot/LaTeX-examples | 9558d8b3c19776cb068b9753dcd3f88645dd7134 | [
"MIT"
] | null | null | null | def strongly_connected_components(graph):
index_counter = 0
stack = []
lowlinks = {}
index = {}
result = []
def strongconnect(node, index_counter):
index[node] = index_counter
lowlinks[node] = index_counter
index_counter += 1
stack.append(node)
try:
successors = graph[node]
except:
successor... | 25.313725 | 63 | 0.697909 |
90e09ace21c898a07e58b522917620b85673ef5b | 1,310 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Stacks and Queues/Min Max Riddle/min_max_riddle.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Stacks and Queues/Min Max Riddle/min_max_riddle.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Stacks and Queues/Min Max Riddle/min_max_riddle.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
from collections import defaultdict
# Complete the riddle function below.
def create_dict(arr):
len_dict = defaultdict(int)
stack = []
i = 0
while i < len(arr):
if not stack or arr[stack[-1]] <= arr[i]:
stack.... | 20.793651 | 87 | 0.571756 |
2944a377834214f5d802d152b626d2245ff56445 | 671 | py | Python | 0067add-binary.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0067add-binary.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0067add-binary.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Solution:
def addBinary(self, a: str, b: str) -> str:
m = len(a) - 1
n = len(b) - 1
res = ''
c = 0
while m >= 0 or n >= 0:
c1 = (ord(a[m]) - ord('0')) if m >= 0 else 0
c2 = (ord(b[n]) - ord('0')) if... | 24.851852 | 56 | 0.402385 |
31162177aad2de364ea2039776a12af0095cd9de | 1,863 | py | Python | measurement.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | measurement.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | measurement.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | # coding: utf-8
from calendar import timegm
from datetime import datetime
from json import dumps
#TODO im pretty shure in future we will nee some thing different maybe with
# abstract classes or extending classes
class Measurement:
''' measurement object to hold one or more units a value and a timestamp '''
... | 35.150943 | 86 | 0.613527 |
311f3f745fcf7fd757f40f3529864fc89f05c014 | 7,557 | py | Python | baustellen.py | digitale-plattform-stadtverkehr-berlin/service-baustellen | 6dc5d7460117d8ca60ed41f43f2085185a6f2e2a | [
"MIT"
] | null | null | null | baustellen.py | digitale-plattform-stadtverkehr-berlin/service-baustellen | 6dc5d7460117d8ca60ed41f43f2085185a6f2e2a | [
"MIT"
] | null | null | null | baustellen.py | digitale-plattform-stadtverkehr-berlin/service-baustellen | 6dc5d7460117d8ca60ed41f43f2085185a6f2e2a | [
"MIT"
] | null | null | null | import json
import os
import pytz
import datetime
from zeep import Client
from zeep.plugins import HistoryPlugin
from pyproj import Proj, transform
from apscheduler.schedulers.blocking import BlockingScheduler
from azure.storage.blob import BlobClient
client = None
history = HistoryPlugin()
OCITC_USER = os.environ.g... | 39.15544 | 121 | 0.567156 |
3169209e77371444b4c9cc12123a6caa536b3d19 | 3,969 | py | Python | src/onegov/user/auth/clients/msal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/auth/clients/msal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/auth/clients/msal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from typing import Dict
import msal
from attr import attrs, attrib
from cached_property import cached_property
from onegov.user import log
@attrs(auto_attribs=True)
class AzureADAttributes(object):
""" Holds the expected AzureAD id_token_claims used to ensure the user """
# the unique id in Azure per Appli... | 31.5 | 78 | 0.638196 |
9ee372732534f7e0913f18858617a9484e4a99e6 | 2,727 | py | Python | app/calculator_tools.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/calculator_tools.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/calculator_tools.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | #imports
import pandas as pd, numpy as np
from api_tools import get_product_info
from eua_tools import fetch_eua_price
#some values
km_equiv = 7 # 7km Fahrt für 1 kg CO2
baum_equiv = 10 # 1 baum bindet 10kg Co2 pro Jahr
eua_eur = fetch_eua_price() #25.5 # eur/t
def get_web_data_for_cart(res):
''' update the merg... | 39.521739 | 183 | 0.660066 |
7349c34a81341bc9f1af24e5237b5e81e2aabbca | 580 | py | Python | deep-learning-from-scratch/ch04/mean_squared_error.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | deep-learning-from-scratch/ch04/mean_squared_error.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | deep-learning-from-scratch/ch04/mean_squared_error.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import numpy as np
def mean_squared_error(y, t):
return 0.5 * np.sum((y-t)**2)
if __name__ == "__main__":
# 정답은 '2'
t = [0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
# 예1 : '2'일 확률이 가장 높다고 추정함 (0.6)
y = [0.1, 0.05, 0.6, 0.0, 0.05, 0.1, 0.0, 0.1, 0.0, 0.0]
result1 = mean_squared_error(np.array(y), np.array(t... | 30.526316 | 81 | 0.537931 |
b4163d4135ac08594560b52eb317e9edee968b7f | 526 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/71_count/count.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/71_count/count.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/71_count/count.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
count - itertools
"""
from itertools import count
# O contador count não tem fim
# O contador pra para num laço for usando um if com break
contador = count(start=9, step=-1)
# start onde começa a contar
# step para pular ex: 2, 4, 6, 8 e da pra usar pra contar ao contrario usando -1
for c in contador:
print(r... | 22.869565 | 80 | 0.657795 |
6f257eedaf1161b2f3057d51b79b9bf0cb5de7e4 | 775 | py | Python | PMIa/2014/danilov_d_a/task_6_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_6_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_6_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 6. Вариант 6.
#Создайте игру, в которой компьютер загадывает название одного из семи городов России, имеющих действующий метрополитен, а игрок должен его угадать.
#Данилов Д.А.
#21.05.2016
import random
print("Программа случайным образом загадывает загадывает название одного из семи городов России, имею... | 45.588235 | 183 | 0.748387 |
6f3d539122a08904f624970bbf3da5fba14c723a | 6,074 | py | Python | xml2ttl.py | iqb-mdc/core | a85ee9937eaadec75d9fed87d8818db924da44ec | [
"MIT"
] | null | null | null | xml2ttl.py | iqb-mdc/core | a85ee9937eaadec75d9fed87d8818db924da44ec | [
"MIT"
] | 1 | 2021-04-17T15:09:35.000Z | 2021-04-17T15:09:35.000Z | xml2ttl.py | iqb-berlin/mdc-core | a85ee9937eaadec75d9fed87d8818db924da44ec | [
"MIT"
] | null | null | null | from collections import namedtuple
from lxml import etree
from rdflib import Graph, Literal, Namespace, URIRef
from rdflib.namespace import DCTERMS, RDF, SKOS
from pathlib import Path
import os, sys
ConceptScheme = namedtuple("ConceptScheme", ["conceptScheme", "concepts", "metadata"])
SchemeData = namedtuple("SchemeD... | 39.441558 | 208 | 0.627264 |
48afa5fbaab7d16ae2ab5032402ba786adfce886 | 369 | py | Python | Chapter2_Python/CodingExercise.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/CodingExercise.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/CodingExercise.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def e_function(my_list):
my_result = []
for val in my_list:
my_result.append(np.exp(val))
return my_result
my_list = [1, 2, 3, 4, 5]
e_list = e_function(my_list)
# x y
plt.plot(my_list, e_list, color="blue")
... | 16.772727 | 40 | 0.590786 |
5b048c76e7beec25d676707001ee54d040f8e119 | 1,355 | py | Python | src/python3_learn_video/iterator.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/iterator.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/iterator.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | """
迭代器:
iter() __iter__()
next() __next__()
"""
print('-----------------------------------------------')
for i in "FishC":
print(i)
print('-----------------------------------------------')
links = {'鱼C工作室': 'http://www.fishc.com', \
'鱼C论坛': 'http://bbs.fishc.com', \
'鱼C博客': ... | 21.171875 | 56 | 0.391882 |
828acccd0a25ab5d9b902bf8a85fffb2918c745e | 4,289 | py | Python | TreeModelLib/BelowgroundCompetition/OGSLargeScale3D/python_source.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeModelLib/BelowgroundCompetition/OGSLargeScale3D/python_source.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeModelLib/BelowgroundCompetition/OGSLargeScale3D/python_source.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | ## This is an example for an OGS python boundary condition
# The setup can be ran with:
# test/LargeTests/Test_Setups_large/ogs_example_setup/OGS3D_SAZOI_BETTINA.xml
# In this example, 2 trees are placed in the center of a 20 x 10 m domain.
# Boundary conditions are defined on the left and right sight as 'Dirichlet'
# ... | 34.039683 | 114 | 0.695733 |
82aaf2e96192340bafccdf9a3eda606de3967886 | 1,288 | py | Python | PINp/2014/Koleganov_N_S/task_8_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Koleganov_N_S/task_8_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Koleganov_N_S/task_8_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 8. Вариант 10.
#Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки, отгадавшие слово б... | 33.894737 | 355 | 0.731366 |
7d7f2c65e70ffc29dd7fea82588cc0e2f3e5793b | 1,970 | py | Python | spider/got/manager/UserManager.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/got/manager/UserManager.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/got/manager/UserManager.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | import urllib,urllib2,json,re,datetime,sys,cookielib
from .. import models
from pyquery import PyQuery
import random
random.seed(1)
class UserManager:
'''
from:xxx + to:xxx = @xxx
'''
def __init__(self):
pass
@staticmethod
def get_base_info(tweet_id):
url = 'https://twitter.com/xxx/status/%s'%(tweet_id)
... | 28.142857 | 214 | 0.702538 |
c48db92cc15102455561c9dfeb4afa6d010eed3e | 530 | py | Python | CareerTinderServer/CareerTinder/migrations/0008_auto_20160918_0746.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | 1 | 2016-09-18T16:40:27.000Z | 2016-09-18T16:40:27.000Z | CareerTinderServer/CareerTinder/migrations/0008_auto_20160918_0746.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | null | null | null | CareerTinderServer/CareerTinder/migrations/0008_auto_20160918_0746.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-18 11:46
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('CareerTinder', '0007_auto_20160918_0434'),
]
operations = [
... | 24.090909 | 97 | 0.641509 |
486279f9c4e23d4d5455be8ac6d15b9efce0042e | 959 | py | Python | 21-fs-ias-lec/03-BACnetCore/samples/overview.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/samples/overview.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/samples/overview.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from ..src.core.node import Node
from ..src.replication.udp_channel import UDPChannel
from ..src.core.com_link import OperationModes
from ..src.core.interface.event import Content
"""
This sample introduces some basic functionality of channel, node and feeds.
"""
# Channel creation
channel = UDPChannel("127.0.0.1", d... | 23.975 | 77 | 0.788321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.