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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42b2b32fa34c2f420b385d7c22f5e5e634dc214d | 686 | py | Python | gemtown/advertisings/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/advertisings/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/advertisings/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from . import models
from gemtown.users import models as user_models
import time
class TimestampField(serializers.Field):
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
class UserSerializer(serializers.ModelSerializer):
class Meta... | 23.655172 | 57 | 0.610787 |
956b7f5536bbb5187a721523eaf0c609a2298a34 | 487 | py | Python | multimeter/widerstand.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/widerstand.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/widerstand.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | import read_arduino
import globvar
def widerstand():
read_arduino.read()
Measure0=float(globvar.measure0)
if Measure0==0:
widerstand="messfehler"
else:
widerstandREF=1100
widerstandSPAN=Measure0*4.86/1023 #umwandeln von 8 bit in spannungswert
#anwenden von u/(r1+r2)= u2/r2 umgewandelt z... | 24.35 | 76 | 0.741273 |
dd866c35384c027f98869fd796c714b080066f3a | 644 | py | Python | 582/tuwulisu_582_tree.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 582/tuwulisu_582_tree.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 582/tuwulisu_582_tree.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | class Solution:
def killProcess(self, pid: List[int], ppid: List[int], kill: int) -> List[int]:
sub_process_dict = dict()
for pid_, ppid_ in zip(pid,ppid):
if ppid_ not in sub_process_dict:
sub_process_dict[ppid_]=[pid_]
else:
sub_process_dict[... | 33.894737 | 83 | 0.532609 |
b0742231161b12884083b39c29067ec0b8fc2a04 | 2,784 | py | Python | unsupervised_learning/dbscan.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | 3 | 2022-02-09T21:35:14.000Z | 2022-02-10T15:31:43.000Z | unsupervised_learning/dbscan.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | null | null | null | unsupervised_learning/dbscan.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | null | null | null | from pathlib import Path
import sys
path = str(Path(Path(__file__).parent.absolute()).parent.absolute())
sys.path.insert(0, path)
from sklearn.cluster import DBSCAN
from sklearn.decomposition import PCA
from sklearn.metrics import accuracy_score, adjusted_rand_score
from sklearn.preprocessing import StandardScaler
from... | 35.692308 | 95 | 0.680675 |
c663489b1cb77bb60e295e88f3438e3a67e633cc | 5,861 | py | Python | Proxverter-main/proxverter/__init__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Proxverter-main/proxverter/__init__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Proxverter-main/proxverter/__init__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import sys
import socket
import proxy
import tempfile
import shutil
import ipaddress
import os
import socket
import pathlib
import logging
import multiprocessing
## Package Imports
from . import installer
from . import certgen
from . import sysprox as sprox
class Proxverter:
'''
The main Proxverter class that... | 33.683908 | 128 | 0.584883 |
05d43f397712b90d8c63828989aca40341c21304 | 552 | py | Python | INBa/2015/Ruditch_A_C/task_3_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ruditch_A_C/task_3_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ruditch_A_C/task_3_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 3. Вариант 22
#Напишите программу, которая выводит имя "Филип Ауреол Теофраст Бомбаст фон Гогенгейм", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
#Rudich A.C.
#08.03.2016
print("Сегодня речь пойдёт про Филипа Аурео... | 61.333333 | 228 | 0.791667 |
af0e3399b0b5b80f3df407e6587590b39dc21848 | 511 | py | Python | 2021/RoundB/Increasing_Substring.py | Akash671/KickStart | 7cf7e572408203c881d56989fb37e6270bd696f0 | [
"CC0-1.0"
] | 1 | 2021-03-12T08:39:01.000Z | 2021-03-12T08:39:01.000Z | 2021/RoundB/Increasing_Substring.py | Akash671/KickStart | 7cf7e572408203c881d56989fb37e6270bd696f0 | [
"CC0-1.0"
] | null | null | null | 2021/RoundB/Increasing_Substring.py | Akash671/KickStart | 7cf7e572408203c881d56989fb37e6270bd696f0 | [
"CC0-1.0"
] | 1 | 2021-03-20T18:55:52.000Z | 2021-03-20T18:55:52.000Z | """
author : Akash kumar
kickstart username : Akash@1996
"""
T=int(input())
for t in range(1,T+1):
n=int(input())
s=str(input())
a=[]
S=""
S+=s[0]
a.append(S)
for i in range(n-1):
j=i+1
#c=0
if s[i]<s[j]:
S+=s[j]
a.append(S)... | 17.62069 | 38 | 0.385519 |
afa78d8234e498af29c95336189809112a45154c | 556 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/20. swap bits in an integer.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/20. swap bits in an integer.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/20. swap bits in an integer.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function that accepts an integer and converts the integer into its binary form.
The function should then swap the two bits at positions 3 and 7 (from left) in the binary number and return the result (integer).
Example :
input = 40 (binary representation - '00101000' )
Expected output = 10 (binary repre... | 22.24 | 130 | 0.561151 |
599f136b2b0ef141ed03212b1e48199ccbb770ca | 569 | py | Python | Chapter4_Intermediate/Exercise5.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 2 | 2021-02-13T19:18:00.000Z | 2021-11-10T09:54:49.000Z | Chapter4_Intermediate/Exercise5.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | Chapter4_Intermediate/Exercise5.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | """Exercise 1:
1.)
Write a class Student that has the following member variables:
- Name (String)
- Lastname (String)
- Age (Integer)
- Id (Integer)
2.)
Write a method that print the information about the student.
E.g. for Student('Jan', 'Schaffranek', 27, 1080133228459) it will print:
'Jan Schaffranek is 27 years old ... | 18.354839 | 72 | 0.673111 |
59b13022e728cc95081d19da99c020269b4dd535 | 1,109 | py | Python | tests/onegov/fsi/test_views_templates.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/test_views_templates.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/test_views_templates.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.fsi.models.course_notification_template import InfoTemplate
from tests.onegov.org.common import get_mail
def test_send_template(client_with_db):
client = client_with_db
session = client.app.session()
info_template = session.query(InfoTemplate).first()
view = f'/fsi/template/{info_template... | 32.617647 | 73 | 0.71596 |
abb6ca25b3c67c4c2ea1f6d9d481dac2aa61cbe0 | 6,016 | py | Python | BSI_Risk_Info/BSI_Risk_Information.py | Eutectico/Various-IT-security-learning-Labs | 0817cdb1d4004eaf070a88e54b998a1c49af500a | [
"MIT"
] | null | null | null | BSI_Risk_Info/BSI_Risk_Information.py | Eutectico/Various-IT-security-learning-Labs | 0817cdb1d4004eaf070a88e54b998a1c49af500a | [
"MIT"
] | null | null | null | BSI_Risk_Info/BSI_Risk_Information.py | Eutectico/Various-IT-security-learning-Labs | 0817cdb1d4004eaf070a88e54b998a1c49af500a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
#IMPORT LIBRARIES
from ast import If
import sys
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import requests
from datetime import datetime
#IMPORT CSV LIBRARY
import csv
import os
os.system('cls' if os.name == 'nt' else 'clear')
#Banner
print("oooooooooo. .oooo... | 45.575758 | 175 | 0.622174 |
e62e6a99e94ffb9e22df1fd0712c643ecbfb7f3d | 5,865 | py | Python | tests/addons/did_challenge/test_tag.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | tests/addons/did_challenge/test_tag.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | tests/addons/did_challenge/test_tag.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from typing import List
import datetime
import pytest
from owlmixin.util import load_yaml
from jumeaux.addons.did_challenge.tag import Executor
from jumeaux.models import (
DidChallengeAddOnPayload,
DidChallengeAddOnReference,
Response,
CaseInsensitiveDict,... | 33.135593 | 102 | 0.483887 |
5550911b82c175a0f4b65bbfc2678d344be41075 | 12,640 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/extractTest.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/extractTest.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/extractTest.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) 2009-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... | 44.982206 | 116 | 0.55087 |
e98f50aefb544fba2eadfd9931df8224b3652ed3 | 2,180 | py | Python | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/parts/_utils.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/parts/_utils.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/parts/_utils.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | from scipy.stats import lognorm, norm
import numpy as np
def init_param_dist(param_init, rand_seed):
'''Initialize distribution from tuple, scipy or array-like object.
Args:
param_init (tuple, scipy.stats dist., or array-like)
Examples:
>>> np.random.seed(0)
>>> dist = SEIRBayes.ini... | 35.16129 | 77 | 0.615596 |
e993cda8541c8870cc893988d4987baa7314e937 | 3,894 | py | Python | rasa/shared/utils/common.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 1 | 2020-09-12T17:27:21.000Z | 2020-09-12T17:27:21.000Z | rasa/shared/utils/common.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 52 | 2020-10-03T11:58:14.000Z | 2022-02-01T13:17:52.000Z | rasa/shared/utils/common.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | import importlib
import logging
from typing import Text, Dict, Optional, Any, List, Callable, Collection
logger = logging.getLogger(__name__)
def class_from_module_path(
module_path: Text, lookup_path: Optional[Text] = None
) -> Any:
"""Given the module name and path of a class, tries to retrieve the class.
... | 32.45 | 83 | 0.665383 |
759bf4f1fdf5328c810468d8641757fe77a2c1e3 | 11,075 | py | Python | python_playground/data/LinkCutTree.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_playground/data/LinkCutTree.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_playground/data/LinkCutTree.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | '''
The Link-Cut Tree data structure
'''
from numba import jit
from scipy.sparse.csr import csr_matrix
from data import *
# define the Splay tree
class Node:
def __init__(self, p=None, pp=None, l=None, r=None, \
size=1, identifier=None, label=None):
self.p = p # parent
self.pp =... | 23.024948 | 61 | 0.481625 |
9514d82fbd5eb499070dde8b2a7eb51869c15fb8 | 8,224 | py | Python | lib/python3.5/site-packages/GPSReader/NMEAutils.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/GPSReader/NMEAutils.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/GPSReader/NMEAutils.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | # -*- coding: cp1252 -*-
# $Id: NMEAutils.py 34 2010-05-06 19:57:29Z cfluegel $
import math
############################################################################
# Helper functions
############################################################################
def CreateNMEAChkSum(sentence=None):
"""... | 33.16129 | 123 | 0.590953 |
1f280ed7584015ebe9033566183d603fb53f6bea | 995 | py | Python | Backend/migrations/alembic/versions/b84312f6532e_create_cases_current_view.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/b84312f6532e_create_cases_current_view.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/b84312f6532e_create_cases_current_view.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create cases_current view
Revision ID: b84312f6532e
Revises: 00a7bf4dae6c
Create Date: 2020-11-26 14:43:32.346113
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = 'b84312f6532e'
down_revision = '00a7bf4dae6c'
branch_labels = None
depends_on = None
def upgrade():
op.get_bind().e... | 23.139535 | 117 | 0.659296 |
2f64a715a8aff981af70a55fb2fc1e91d7ae728d | 819 | py | Python | tag_3/p_12_caesar_verschluesselung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_3/p_12_caesar_verschluesselung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_3/p_12_caesar_verschluesselung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
12 Cäsar-Verschlüsselung (Tag 3)
Programmiere eine Funktion, die einen String und eine Zahl k als Parameter entgegennimmt
und die Cäsar-Verschlüsselung zurückliefert. Bei dem sehr einfachen Verschlüsselungsverfahren
wird jeder Buchstabe zyklisch mit dem Buchstaben ersetzt, der im Alphabet k Buchstaben
weiter hinte... | 31.5 | 93 | 0.738706 |
c07a4fde12473e768ab1e71e8bcfb2b93573bfe6 | 347 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Common/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Common/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Common/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | from Config import Config, parse_config_bool # NOQA
from DB import DB, parse_read_pref_tags # NOQA
from LocalCommand import LocalCommand # NOQA
from Lock import Lock # NOQA
from MongoUri import MongoUri # NOQA
from Timer import Timer # NOQA
from Util import config_to_string, is_datetime, parse_method, validate_ho... | 43.375 | 99 | 0.804035 |
a5f96453b36f53e02767c6893af22911ac26670c | 2,278 | py | Python | login/views.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | login/views.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | login/views.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | # """
# """
# import json
# import facebook
# from voluptuous import All, Length, Schema
# from django.contrib.auth.models import User
# from django.http import JsonResponse
# from django.views.decorators.csrf import csrf_exempt
# from rest_framework.authtoken.models import Token
# from users.models import Profile
... | 30.783784 | 82 | 0.63784 |
572b77a3cc83d7c5361fbf42281f0df19526c22c | 4,978 | py | Python | scripts/sanity_checker.py | jdehotin/IFC4.3.x-development | 5652a25dac27242af8c60f1a33206d1697948ffa | [
"FSFAP"
] | 1 | 2021-08-31T16:12:09.000Z | 2021-08-31T16:12:09.000Z | scripts/sanity_checker.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | null | null | null | scripts/sanity_checker.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | null | null | null | import os
import sys
import time
import itertools
import lark
from github import Github
g = Github(os.environ["USER_AUTH"])
r = g.get_repo("buildingSMART/IFC4.3.x-output")
def alnum(s):
return "".join(c for c in s if c.isalnum())
class issue:
def __init__(self, *args):
self.len = self.format.coun... | 32.116129 | 127 | 0.635396 |
93fd0788a12c5362da2c5cc42be0dddebe8f695a | 403 | py | Python | Classes/Button.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Button.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Button.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | import os
import pygame
class Button(object):
mypath = os.path.dirname(os.path.realpath(__file__))
def __init__(self, picture, coords):
self.image = pygame.image.load(os.path.join(self.mypath, picture))
self.imagerect = self.image.get_rect()
self.imagerect.topright = coords
def sh... | 26.866667 | 74 | 0.682382 |
27ec7893e854046db3011191ffae55326496cc24 | 616 | py | Python | fuzzsvc/controller/Log.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | 53 | 2016-08-26T02:51:45.000Z | 2021-05-24T21:05:44.000Z | controller/Log.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | null | null | null | controller/Log.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | 31 | 2016-08-26T04:08:31.000Z | 2021-05-24T21:05:54.000Z | from flask_restful import Resource, reqparse
from app import app
from app import logFile
db = app.config['db']
class LogCtrl(Resource):
def post(self):
parser = reqparse.RequestParser()
parser.add_argument('message', required=True, location='json')
args = parser.parse_args()
with ... | 25.666667 | 70 | 0.581169 |
fd6bef6aa52d40ea733e7cac617b6a8ff9d746fd | 238 | py | Python | packages/watchmen-model/src/watchmen_model/system/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/system/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/system/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .data_source import DataSource, DataSourceParam, DataSourceType
from .external_writer import ExternalWriter, ExternalWriterType
from .key_store import KeyStore
from .tenant import Tenant
from .token import PersonalAccessToken, Token
| 39.666667 | 68 | 0.861345 |
fd9c89de69b9ada0502447d843e2c1ff14569e1b | 108 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-007/pg-7.8-funciton-dufault-farameter-a-face-error.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-007/pg-7.8-funciton-dufault-farameter-a-face-error.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-007/pg-7.8-funciton-dufault-farameter-a-face-error.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def myfnc(x, y=10, z):
print("x =", x, ",", "y =", y, ",", 'z =', z)
x = 5
y = 6
z = 7
myfnc(x, y, z)
| 12 | 49 | 0.351852 |
e30935eb66eeb6a16ece611c44f6be94143aa4bf | 620 | py | Python | src/mvg/favorites.py | dfrommi/alfred-mvv | 5310f80ca3e17686fb534db0e53a613043a1b352 | [
"MIT"
] | 2 | 2019-07-07T19:24:15.000Z | 2019-10-16T09:07:25.000Z | src/mvg/favorites.py | dfrommi/alfred-mvv | 5310f80ca3e17686fb534db0e53a613043a1b352 | [
"MIT"
] | 1 | 2020-06-05T16:49:17.000Z | 2020-06-05T16:49:17.000Z | src/mvg/favorites.py | dfrommi/alfred-mvv | 5310f80ca3e17686fb534db0e53a613043a1b352 | [
"MIT"
] | 2 | 2017-04-03T11:47:59.000Z | 2019-10-16T09:09:26.000Z | class Favorites:
def __init__(self, wf):
self.wf = wf
def get(self):
return self.wf.settings['stations']
def set(self, stations):
self.wf.settings['stations'] = stations
def add(self, station):
self.remove(station)
stations = self.get()
stations.append... | 24.8 | 71 | 0.579032 |
e36caed77f13083167546d9ab903784c12f22ee7 | 5,162 | py | Python | bot/actions/action_search_stats_region.py | cosibot/cosibot-germany-german | ed8917e0da7ebb1ce2140674cc63bc7f82628408 | [
"MIT"
] | null | null | null | bot/actions/action_search_stats_region.py | cosibot/cosibot-germany-german | ed8917e0da7ebb1ce2140674cc63bc7f82628408 | [
"MIT"
] | null | null | null | bot/actions/action_search_stats_region.py | cosibot/cosibot-germany-german | ed8917e0da7ebb1ce2140674cc63bc7f82628408 | [
"MIT"
] | null | null | null | # This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
from typing import Any, Text, Dict, List
import requests
from rasa_sdk import Action, Tracker
from rasa_sdk.executor ... | 45.681416 | 282 | 0.548625 |
47b32a19ed24ad617ef226a604ff467451f9c536 | 15,620 | py | Python | tests/onegov/election_day/views/test_views.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/views/test_views.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/views/test_views.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from freezegun import freeze_time
from onegov import election_day
from onegov.ballot import Ballot
from onegov.ballot import Vote
from onegov.election_day import ElectionDayApp
from tests.onegov.election_day.common import create_election_compound
from tests.onegov.election_day.common import lo... | 33.304904 | 78 | 0.618758 |
47e5b23d073e83e0f2a7c06568a82ecba42c8813 | 335 | py | Python | tests/env_test.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | tests/env_test.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | tests/env_test.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | import os
key = [
'SSRMGMT_SECRET_KEY',
'SSRMGMT_API_USERNAME',
'SSRMGMT_API_PASSWORD',
'SSRMGMT_EMAIL_USER',
'SSRMGMT_EMAIL_PASSWORD',
'SSRMGMT_MYSQL_USER',
'SSRMGMT_MYSQL_PASSWORD', ]
def test_env_set():
for k in key:
print(k, os.environ[k])
if __name__ == '__main__':
... | 16.75 | 31 | 0.653731 |
efb588e7272414a58e2b8f6d5efbf164d31b6e81 | 323 | py | Python | Organisation/Recherche/pico2wave/gtts_Test/gtts_Test.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | Organisation/Recherche/pico2wave/gtts_Test/gtts_Test.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | Organisation/Recherche/pico2wave/gtts_Test/gtts_Test.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | from gtts import gTTS
import os
# deutsch
fd = open('test.txt')
xd = fd.read()
language = 'de'
audio = gTTS(text=xd, lang=language, slow=False)
audio.save("test.wav")
# englisch
fe = open('test_en.txt')
xe = fe.read()
language = 'en'
audio = gTTS(text=xe, lang=language, slow=False)
audio.save("test_en.wav"... | 21.533333 | 49 | 0.659443 |
ef5bfe53cd1d3e16167ac89a460d57c6a14aaf08 | 479 | py | Python | frappe-bench/apps/erpnext/erpnext/hr/doctype/vehicle/vehicle.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/vehicle/vehicle.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/vehicle/vehicle.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import getdate
from frappe.model.document import Document
class Vehicle(Document):... | 34.214286 | 81 | 0.776618 |
de3c42e55833a4248aac8ff60b6271adc47c591b | 112 | py | Python | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/common/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/common/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/common/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .exception import InquiryKernelException
from .settings import ask_trino_enabled, ask_use_storage_directly
| 37.333333 | 65 | 0.892857 |
debaf4fb69bcda043025df4a1eb5599a428b4b93 | 4,120 | py | Python | jumeaux/addons/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from importlib.util import find_spec
from owlmixin import TList
from jumeaux.addons.models import Addon, Addons
from jumeaux.domain.config.vo import Config
from jumeaux.models import (
Request,
Log2ReqsAddOnPayload,
Reqs2Req... | 36.140351 | 96 | 0.674029 |
9d2cac9d129b0573dec8e7427607399d65f30387 | 4,541 | py | Python | socket_bot/client.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | null | null | null | socket_bot/client.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | 1 | 2020-07-31T16:37:23.000Z | 2020-07-31T16:37:23.000Z | socket_bot/client.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | null | null | null | import socket
import threading
import json
from cmd import Cmd
from socket_bot.connection import SocketConnection
from socket_bot.payload import make_payload
class Client(Cmd):
"""
Client
"""
prompt = ''
intro = "[Welcome] Simple SimpleDAW client (Cli version)\n" + \
"[Welcome] Type `help`... | 31.534722 | 118 | 0.534023 |
9d525a21d54eb2413da229a20166e593ec75711f | 548 | py | Python | PYTHON/Strings/string_validators.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/string_validators.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/string_validators.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
if __name__ == '__main__':
s = input()
flags = ['False'] * 5
for i in range(len(s)):
if 'False' not in flags:
print('\n'.join(flags))
break
if s[i].isalnum():
flags[0] = 'True'
if s[i].isalpha():
fla... | 21.92 | 35 | 0.430657 |
dff9abecf08c026e99b636a4ac7d1b025bee299e | 843 | py | Python | setup.py | sharadmv/tssb | 9385ea9ab199070034a36f92b6520152f801823a | [
"MIT"
] | null | null | null | setup.py | sharadmv/tssb | 9385ea9ab199070034a36f92b6520152f801823a | [
"MIT"
] | null | null | null | setup.py | sharadmv/tssb | 9385ea9ab199070034a36f92b6520152f801823a | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
# parse_requirements() returns generator of pip.req.InstallRequirement objects
#install_reqs = parse_requirements("requirements.txt", session=uuid.uuid1())
# reqs is a list of requirement
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
#reqs = [str(ir.req) for ir in install_re... | 27.193548 | 79 | 0.66548 |
cd594d7e04bf7326c4fa5969b610aa9dcb3c53b4 | 2,760 | py | Python | tests/integration_tests/conftest.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | tests/integration_tests/conftest.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | tests/integration_tests/conftest.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | import os
import time
from typing import Any, Dict, NamedTuple
import confluent_kafka.admin
import pytest
from confluent_kafka import Consumer, Producer
from pytest import fixture
from volley.config import load_yaml
from volley.logging import logger
queues: Dict[str, Any] = load_yaml("./example/volley_config.yml")["... | 27.878788 | 110 | 0.677536 |
cd808349be3caa851067e0f1a28e7fb8c5bc7cba | 3,834 | py | Python | Channelpedia/analyse.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 26 | 2015-08-17T19:30:52.000Z | 2021-03-12T20:39:19.000Z | Channelpedia/analyse.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 9 | 2015-01-15T20:16:08.000Z | 2017-05-18T20:53:52.000Z | Channelpedia/analyse.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 18 | 2015-08-17T19:30:56.000Z | 2022-03-04T06:01:30.000Z | from pyneuroml.analysis.NML2ChannelAnalysis import generate_lems_channel_analyser
known_parameters = {}
# low v, step, hi v, delay, duration, base v, tot dur, erev
known_parameters["Channelpedia_HCN1_9"] = (-120, 10, -40, 25,... | 35.831776 | 141 | 0.529473 |
f22d582b0414340417a14d6acc0c8e778abdb33c | 9,382 | py | Python | local-nn-prototype/nn_augment.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | local-nn-prototype/nn_augment.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | local-nn-prototype/nn_augment.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | #!/usr/bin/env python3
"""
Mit den Funktionen in dieser Datei können Eingabedaten mit Hilfe von neuronalen Netzen klassifiziert/erzeugt/verändert werden.
"""
import sys
from collections import namedtuple
import numpy as np
import keras
from keras import backend as K
import skimage
num_classes = 43
def normalizeTenso... | 36.505837 | 126 | 0.654125 |
f2483a949bf605d37d2e8f7481c0a53c84bb6952 | 10,191 | py | Python | TFLCycles/data_exploration.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | TFLCycles/data_exploration.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | TFLCycles/data_exploration.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | # %% [markdown]
# # Transport for London Cycle Data Exploration
#
# ## Dataset
# The data was provided from TFL and was retrieved from Kaggle:
# https://www.kaggle.com/hmavrodiev/london-bike-sharing-dataset
# The dataset counts the number of journeys made per hour in each day of 2015-2017.
# There are 17414 rows.
... | 32.768489 | 139 | 0.662545 |
f26f6ae7cd104289eddbf6a52e33683ea4c3177a | 549 | py | Python | leetcode/020-Valid-Parentheses/ValParent_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/020-Valid-Parentheses/ValParent_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/020-Valid-Parentheses/ValParent_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | public
class Solution {
public boolean isValid(String s) {
HashMap < Character, Character > pairs = new HashMap < Character, Character > ();
pairs.put('(', ')');
pairs.put('[', ']');
pairs.put('{', '}');
Stack < Character > stack = new Stack < Character > ();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt... | 13.725 | 81 | 0.588342 |
8a04991f74830a3f3c97e9b4aaad8e1083118338 | 8,353 | py | Python | scripts/calendar_view_gui/utils/lut.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/calendar_view_gui/utils/lut.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/calendar_view_gui/utils/lut.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Csaba Wirnhardt
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
from osgeo import gdal
import sys
def getCumulativeCutCountFo... | 39.966507 | 171 | 0.661559 |
0a725b6f2a3c7056a2677d5705c8fcd5c1c5248a | 782 | py | Python | Packs/CommonScripts/Scripts/DockerHardeningCheck/DockerHardeningCheck_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/DockerHardeningCheck/DockerHardeningCheck_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/DockerHardeningCheck/DockerHardeningCheck_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from DockerHardeningCheck import check_memory, mem_size_to_bytes, check_pids, check_fd_limits, check_non_root, check_cpus
from pytest import skip
import os
def test_check_memory():
assert 'memory cgroup configuration' in check_memory("10m", "cgroup")
def test_mem_size():
assert mem_size_to_bytes("1g") == (1... | 24.4375 | 121 | 0.70844 |
86c2ad96d91d8c6ff592ae8a5487629eb524486f | 22,467 | py | Python | enrich/merge.py | sonar-idh/Transformer | bbfde9d19ad4a4917257483ba66eb30a8294244d | [
"MIT"
] | null | null | null | enrich/merge.py | sonar-idh/Transformer | bbfde9d19ad4a4917257483ba66eb30a8294244d | [
"MIT"
] | null | null | null | enrich/merge.py | sonar-idh/Transformer | bbfde9d19ad4a4917257483ba66eb30a8294244d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: melina
"""
from os import listdir
from os.path import isfile, join
import fire
def merge_ocr_files(outfile, ocr_data_path):
"""
WORKS ONLY FOR THE FIRST FILE OF THE OCR BATCH3. GND ENTITIES HAVE BEEN ADDED
MANUALLY.
Merges all ocr files into one graphml file.
... | 61.722527 | 931 | 0.649174 |
d4d2a0c1b570500f333fa82267ba16d23e13eb98 | 2,239 | py | Python | fhirclient/r4models/eventdefinition_tests.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/eventdefinition_tests.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/eventdefinition_tests.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import eventdefinition
from .fhirdate import FHIRDate
class EventDefinitionTests(unittest.TestCase):
def instant... | 45.693878 | 180 | 0.679321 |
07b05d2433e86387435219457f0a1a328b170c1e | 367 | py | Python | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/Environment_Variables.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/Environment_Variables.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/Environment_Variables.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #Program to acess environment variables
import os
print('*-------------------------------------*')
print(os.environ)
print('*-------------------------------------*')
#Acess a particular environment variable
print(os.environ['SSH_AUTH_SOCK'])
print('*-------------------------------------*')
print(os.environ['PATH'])
pri... | 30.583333 | 48 | 0.425068 |
13e72df3f363a612c1e5f16ec8b33c4627a2fae0 | 1,556 | py | Python | python/coursera_python/MICHIGAN/wikicrawler/fin3.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/wikicrawler/fin3.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/wikicrawler/fin3.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # To run this, you can install BeautifulSoup
# https://pypi.python.org/pypi/beautifulsoup4
# Or download the file
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file
import sqlite3
conn = sqlite3.connect('wiki1.sqlite')
cur = conn.cursor()
cur.executescript('''
CREATE TABLE IF NOT ... | 21.915493 | 61 | 0.643959 |
6a2803c6f18d86ebb06141bfe3a228384ac51434 | 5,359 | py | Python | Documentation/generate_tag_documentation.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | Documentation/generate_tag_documentation.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | Documentation/generate_tag_documentation.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
## This script converts the tag documentation from the .md format to doxygen-
# readable format. Additionally it is providing the correct linking of tags.
# CAUTION: Only run script from this folder.
import os
... | 38.833333 | 77 | 0.506251 |
e01368d890f598b8fba2d6de6b2138be4b86a835 | 267 | py | Python | src/server/jobs/schema.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/jobs/schema.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/jobs/schema.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from server.pipeline import monitors_pipeline
from .base import CollectorJob
class SchemaCollectorJob(CollectorJob):
def pipelines(self):
return [monitors_pipeline]
def configuration(self):
return { 'monitors': [ { 'type': 'schema' } ] }
| 20.538462 | 55 | 0.692884 |
161fdba91508463ae4fe47c61aa11337553fecba | 8,390 | py | Python | research/cv/fairmot/src/losses.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/fairmot/src/losses.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/fairmot/src/losses.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.205607 | 118 | 0.622765 |
4c55b895d188cab3e7c21017998bb431dc6924e0 | 3,191 | py | Python | setup.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | setup.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | setup.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 26.155738 | 90 | 0.622689 |
911a5d042e82ef04f3251798d371e8b8fecf1c37 | 42 | py | Python | graph_network/dataset/__init__.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | graph_network/dataset/__init__.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | graph_network/dataset/__init__.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | __all__ = ["dataset", "citation_dataset"]
| 21 | 41 | 0.714286 |
e6a08027ebb5b0d71521ccf3ad7a3b1d46f0b426 | 6,121 | py | Python | tests/onegov/wtfs/test_views_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from freezegun import freeze_time
from onegov.core.request import CoreRequest
from unittest.mock import patch
from webtest.forms import Upload
def test_views_report(client):
# Add a municipality with dates
client.login_admin()
add = client.get('/municipalities').click(href='/add')
add.form['name'] = ... | 34.977143 | 78 | 0.622611 |
fc4c195c495e4796e124e49854eab8fe98ac4075 | 376 | py | Python | algorithms/ar-cochprb/python3/coin_change_problem.py | NuclearCactus/FOSSALGO | eb66f3bdcd6c42c66e8fc7110a32ac021596ca66 | [
"MIT"
] | 59 | 2018-09-11T17:40:25.000Z | 2022-03-03T14:40:39.000Z | algorithms/ar-cochprb/python3/coin_change_problem.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 468 | 2018-08-28T17:04:29.000Z | 2021-12-03T15:16:34.000Z | algorithms/ar-cochprb/python3/coin_change_problem.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 253 | 2018-08-28T17:08:51.000Z | 2021-11-01T12:30:39.000Z | #python3 program for coin change problem using dynamic programming approach
def coin_change(S, m, n):
solution = [0 for k in range(n+1)]
solution[0] = 1
for i in range(0,m):
for j in range(S[i],n+1):
solution[j] = solution[j] + solution[j-S[i]]
return solution[n]
#driver code
S ... | 23.5 | 75 | 0.601064 |
f8d983a20328a7807dd083bdd451f35c5b6fb985 | 7,813 | py | Python | funktionen.py | MaliziaGrimm/Lohnvorerfassung-50a-fuer-DATEV | 41b99deacc5bfee6562907de109a8ad5af917d01 | [
"MIT"
] | null | null | null | funktionen.py | MaliziaGrimm/Lohnvorerfassung-50a-fuer-DATEV | 41b99deacc5bfee6562907de109a8ad5af917d01 | [
"MIT"
] | null | null | null | funktionen.py | MaliziaGrimm/Lohnvorerfassung-50a-fuer-DATEV | 41b99deacc5bfee6562907de109a8ad5af917d01 | [
"MIT"
] | null | null | null | import numpy as np
from flask import request
def basis_daten_oeffnen():
basis_daten = open("daten/basisdaten.txt","r")
for x in basis_daten:
var_beraternummer,var_mandantennummer,var_3,var_4,var_5,var_6,var_99=x.split("|")
break
basis_daten.close()
return var_beraternummer,va... | 38.678218 | 116 | 0.663126 |
53a655e7a8a9aad6fd97fb848eaf552ecd30986e | 1,359 | py | Python | verto/utils/HeadingNode.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/utils/HeadingNode.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/utils/HeadingNode.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from collections import namedtuple
class HeadingNode(namedtuple('HeadingNode', 'title, title_slug, level, children')):
''' Represents a heading in the heading tree.
Keyword arguments:
title: the title of the current node.
title_slug: the slug of the current node.
level: the level of t... | 35.763158 | 119 | 0.680648 |
0744713f53df17347398f6978c9ae6e39cd696a2 | 757 | py | Python | Hackerrank_problems/kangaroo/solution3.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 205 | 2021-09-30T15:41:05.000Z | 2022-03-27T18:34:56.000Z | Hackerrank_problems/kangaroo/solution3.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 566 | 2021-09-30T15:27:27.000Z | 2021-10-16T21:21:02.000Z | Hackerrank_problems/kangaroo/solution3.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 399 | 2021-09-29T05:40:46.000Z | 2022-03-27T18:34:58.000Z | '''
LOGIC:
First, we compare the first kangaroo's location with the second one.
if same then they will meet at the starting point.
Second, if first kangaroo's location and rate bothe are heigher or visa-verse
then there is no chance of them meeting at same place.
Else if their location are ... | 27.035714 | 82 | 0.590489 |
9165cdb4540aa1353aa2893451d6901f72ac79ae | 4,530 | py | Python | lib/python3.5/site-packages/GPSReader/GPSReader.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/GPSReader/GPSReader.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | lib/python3.5/site-packages/GPSReader/GPSReader.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | # -*- coding: cp1252 -*-
# $Id: GPSReader.py 33 2010-05-06 17:21:14Z cfluegel $
# TODO
# - Einige Variablen zu "private" Variablen umwandeln
# - Dokumentation vervollstaendigen
#### Importbereich
import serial, time, sys
import threading
import NMEAtelegrams
from GPSError import *
#### GPS Main clas... | 32.826087 | 98 | 0.645475 |
91a273a8d3e156abc0d5d33c2cbb73f27893245c | 244 | py | Python | tests/verena/test_verena.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 445 | 2021-07-26T22:00:26.000Z | 2022-03-31T08:31:08.000Z | tests/verena/test_verena.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 30 | 2021-07-27T15:42:23.000Z | 2022-03-26T16:14:11.000Z | tests/verena/test_verena.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 28 | 2021-07-27T10:48:43.000Z | 2022-03-26T14:31:30.000Z | from deutschland.verena.verena import Verena
def test_verena():
v = Verena()
res = v.get()
assert (
len(res) > 0
), "Scraping and extracting all pages of the VERENA portal eturned 0 results. It very likely shouldn't."
| 24.4 | 108 | 0.659836 |
7256fd0be08923b8dc526c13095715643cfb5789 | 548 | py | Python | src/visitpy/visit_flow/flow/src/core/__init__.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/src/core/__init__.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/src/core/__init__.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: __init__.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 10/14/2010
description:... | 23.826087 | 73 | 0.726277 |
be5cf3aed77ea05657251ba5ab096f954d3c4d45 | 330 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_purchase_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_purchase_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_purchase_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('accounts', 'doctype', 'purchase_invoice_item')
frappe.db.sql("update `tabPurchase Invoice Item` set stock_qty = qty, stock_u... | 36.666667 | 88 | 0.775758 |
fe54264e459c6eeb85c15bc6691b383206345ba1 | 2,207 | py | Python | cleansys/setting_templates/prod_settings.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | cleansys/setting_templates/prod_settings.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | cleansys/setting_templates/prod_settings.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | """
Production settings.
Make sure you have changed the SECRET_KEY!
Please follow the guidelines for production: https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
"""
from .common_settings import LOGGING, BASE_DIR
import os
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY =... | 40.127273 | 116 | 0.780698 |
4a6c5c2ff536ced9cbbce6352927e1065c5f5171 | 30 | py | Python | Licence 2/I33/Exam 2/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/Exam 2/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/Exam 2/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def matmat(A, B, P):
pass
| 10 | 20 | 0.533333 |
4ab2d7e3eebde05d0d1dfe454c9c7314142dc928 | 4,537 | py | Python | python/oneflow/compatible/single_client/test/ops/test_unsorted_batch_segment_sum.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_unsorted_batch_segment_sum.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_unsorted_batch_segment_sum.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... | 36.296 | 88 | 0.703989 |
608d1b980901b7986a2240298b27bcb620d2d094 | 5,198 | py | Python | lib/python/kle2xy.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | lib/python/kle2xy.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/kle2xy.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | """ Original code from https://github.com/skullydazed/kle2xy
"""
import hjson
from decimal import Decimal
class KLE2xy(list):
"""Abstract interface for interacting with a KLE layout.
"""
def __init__(self, layout=None, name='', invert_y=True):
super(KLE2xy, self).__init__()
self.name = n... | 40.929134 | 216 | 0.497499 |
715f73441c4eeb8fbeca08c2fac0901483d96e47 | 802 | pyde | Python | sketches/fourier1/fourier1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/fourier1/fourier1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/fourier1/fourier1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | r1 = 100
r2 = 5
t = 0
circleList = []
def setup():
size(800, 400)
this.surface.setTitle("Fourier 1 (Fourier Sinus)")
def draw():
global t, circleList
background(200)
translate(width / 4, height / 2)
# Großer Kreis
noFill()
stroke(0)
ellipse(0, 0, 2 * r1, 2 * r1)
# Kleiner Kre... | 19.095238 | 54 | 0.528678 |
719d487fb493c4ccdfbbae3a8c4e1f82f7baf157 | 167 | py | Python | basics/read_and_Write.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/read_and_Write.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/read_and_Write.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | with open('test.log', mode='a') as a_file:
a_file.write('test succeeded')
with open('test.log') as a_file:
print(a_file.read()) | 33.4 | 62 | 0.538922 |
71b2eaaa4416d856b679d0f317087c5a6e1fb1e7 | 4,858 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cloudengine/test_ce_lldp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cloudengine/test_ce_lldp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cloudengine/test_ce_lldp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2019 Red Hat Inc.
#
# 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 License, or
# (at your option) any later version.
#
# Ansible is dis... | 42.614035 | 135 | 0.648209 |
1cd97984aeb6ad99b640c81058df5f81a453d60e | 91 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.5-not-changeable-immutable.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.5-not-changeable-immutable.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.5-not-changeable-immutable.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | c = ["A", "b", "c"]
print(c)
c[0] = "a"
print(c)
country = "Bangladesh"
country[0] = "b"
| 10.111111 | 22 | 0.494505 |
c70a1a3f35f9f2d31f10adf4e04090e1d5bec407 | 861 | py | Python | tools/pythonpkg/tests/fast/api/test_insert_into.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/api/test_insert_into.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/api/test_insert_into.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
from pandas import DataFrame
import pytest
class TestInsertInto(object):
def test_insert_into_schema(self, duckdb_cursor):
# open connection
con = duckdb.connect()
con.execute('CREATE SCHEMA s')
con.execute('CREATE TABLE s.t (id INTEGER PRIMARY KEY)')
# make r... | 31.888889 | 68 | 0.615563 |
c71669841a48f8cecc1d282432411ca5898f40ab | 2,721 | py | Python | module1-web-application-development-with-flask/app.py | bs3537/DS-Unit-3-Sprint-3-Productization-and-Cloud | 49579885504059c685b39f19cf59cb19c05ca705 | [
"MIT"
] | 1 | 2020-05-07T20:46:42.000Z | 2020-05-07T20:46:42.000Z | module1-web-application-development-with-flask/app.py | bs3537/DS-Unit-3-Sprint-3-Productization-and-Cloud | 49579885504059c685b39f19cf59cb19c05ca705 | [
"MIT"
] | null | null | null | module1-web-application-development-with-flask/app.py | bs3537/DS-Unit-3-Sprint-3-Productization-and-Cloud | 49579885504059c685b39f19cf59cb19c05ca705 | [
"MIT"
] | null | null | null | #In class lecture code for 2/11/20
#pipenv install
#pipenv shell
#pipenv install Flask and other software imported below in pipenv first
from flask import Flask, jsonify, request, render_template
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import sqlite3
app = Flask(__name__)
#... | 29.258065 | 126 | 0.676957 |
c72a9e6a2499c67243f2191db1af3b06ed8c1877 | 434 | py | Python | INBa/2015/Sarocvashin_M/task_3_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Sarocvashin_M/task_3_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Sarocvashin_M/task_3_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 23
#Напишите программу, которая выводит имя "София Шиколоне", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Сароквашин Максим
# 25.02.2016
print ("Под каким псевдонимом наиболее известена София Шиколон... | 39.454545 | 199 | 0.767281 |
40641b662d3e81ea2f6d39c05965c8db434f77d3 | 1,847 | py | Python | backend/migrations/versions/3ec65867f875_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/3ec65867f875_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/3ec65867f875_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | """empty message
Revision ID: 3ec65867f875
Revises: 0524918b6a8c
Create Date: 2019-04-03 15:34:31.299056
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3ec65867f875'
down_revision = '0524918b6a8c'
branch_labels = None
depends_on = None
def upgrade():
# ... | 32.982143 | 82 | 0.676773 |
905d649dd33298f4c2f9a5686059d66b9125f725 | 791 | py | Python | keras_fcn/metrics.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 235 | 2017-03-01T14:34:29.000Z | 2021-06-03T16:16:16.000Z | keras_fcn/metrics.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 39 | 2017-03-25T01:20:25.000Z | 2020-10-30T11:51:47.000Z | keras_fcn/metrics.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 105 | 2017-04-13T21:31:46.000Z | 2021-11-01T17:25:48.000Z | import keras.backend as K
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
def Mean_IoU(classes):
def mean_iou(y_true, y_pred):
mean_iou, op = tf.metrics.mean_iou(y_true, y_pred, classes)
return mean_iou
_initialize_variables()
return mean_iou
def _initialize_var... | 31.64 | 76 | 0.709229 |
90cdc9444c2f91520f3942be1cc7901e79d2c445 | 176 | py | Python | new-docs/examples/rbac/python/03-external.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-07-08T17:36:08.000Z | 2021-07-08T17:36:08.000Z | new-docs/examples/rbac/python/03-external.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | new-docs/examples/rbac/python/03-external.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | @dataclass
class User:
name: str = ""
def role(self):
yield from db.query(
"SELECT role FROM user_roles WHERE username = ?", [self.name]
)
| 19.555556 | 73 | 0.551136 |
465d3ac98a002c03d71b683cef99c00bc4c19080 | 415 | py | Python | elements/python/6/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/6/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/6/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def max_difference(a):
n = len(a)
if n == 0:
return None
max_after = a[n-1]
max_delta = 0
i = n-2
while i >= 0:
max_after = max(a[i], max_after)
max_delta = max(max_after - a[i], max_delta)
i -= 1
return max_delta
def test():
a = [0,1,2,3,2,3,4,5,6,-3,4... | 17.291667 | 52 | 0.515663 |
467a680a6c759d332a7cba093b8c2aef0b79ea67 | 2,122 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netvisor/test_pn_port_cos_bw.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netvisor/test_pn_port_cos_bw.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netvisor/test_pn_port_cos_bw.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import patch
from ansible_coll... | 44.208333 | 140 | 0.696984 |
d3b4dc83be3b1b167f311eb3578f26c3dbabcc8d | 92 | py | Python | 2014/04/table-pgcounty-visits/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/04/table-pgcounty-visits/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/04/table-pgcounty-visits/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '0Ala-N4Y4VPXIdDl1Y0J0NHhlWEpRcVZVMVZBSHZVQXc'
| 23 | 68 | 0.836957 |
31cfd4d91664671a04acd67c2a8f99018ecb8bb4 | 171 | py | Python | pk/data/cluster/dcluster/__init__.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/cluster/dcluster/__init__.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/cluster/dcluster/__init__.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | #!/usr/bin/env python
'''dcluster
'''
from .run import run
from .mds import mds
from .readfile import readfile
from .rhodelta import rhodelta
from .DCplot import DCplot
| 15.545455 | 30 | 0.754386 |
9eecad7b9c7eb52a7e9a9febc44c945292139e0c | 4,075 | py | Python | ggit_platform/migrations/0001_initial.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | 1 | 2019-02-27T21:20:54.000Z | 2019-02-27T21:20:54.000Z | ggit_platform/migrations/0001_initial.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | ggit_platform/migrations/0001_initial.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-26 11:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import markdownx.models
class Migration(migrations.Migration):
initial = True
dependencies ... | 44.293478 | 141 | 0.574479 |
c37aacb31c4ac0c7f6a416c934e92082537aedb5 | 1,576 | py | Python | corus/sources/rudrec.py | natasha/corus | 1bf01284628585b56723b4d024367f88886fb3e5 | [
"MIT"
] | 205 | 2019-05-01T07:38:01.000Z | 2022-03-30T04:02:54.000Z | corus/sources/rudrec.py | trnkv/corus | 1bf01284628585b56723b4d024367f88886fb3e5 | [
"MIT"
] | 78 | 2019-04-29T06:53:53.000Z | 2021-09-20T14:51:25.000Z | corus/sources/rudrec.py | trnkv/corus | 1bf01284628585b56723b4d024367f88886fb3e5 | [
"MIT"
] | 18 | 2019-06-19T09:56:10.000Z | 2022-01-30T14:55:14.000Z |
from corus.record import Record
from corus.io import (
parse_jsonl,
load_lines
)
class RuDReCRecord(Record):
__attributes__ = ['file_name', 'text', 'sentence_id', 'entities']
def __init__(self, file_name, text, sentence_id, entities):
self.file_name = file_name
self.text = text
... | 25.015873 | 98 | 0.600888 |
48cb4e5fe8975b32217e514c12e1f7ccb568e3ab | 4,518 | py | Python | CC7261-SistemasDistribuidos/Lazy_Barber/barbeiro_dorminhoco.py | phdomingues/FEI-CS | e1dc19c190d61f5f13492ba5179f5d41295f1b50 | [
"MIT"
] | null | null | null | CC7261-SistemasDistribuidos/Lazy_Barber/barbeiro_dorminhoco.py | phdomingues/FEI-CS | e1dc19c190d61f5f13492ba5179f5d41295f1b50 | [
"MIT"
] | null | null | null | CC7261-SistemasDistribuidos/Lazy_Barber/barbeiro_dorminhoco.py | phdomingues/FEI-CS | e1dc19c190d61f5f13492ba5179f5d41295f1b50 | [
"MIT"
] | null | null | null | import queue
import threading
import random
import time
from tqdm import tqdm
def abrirBarbearia(time_scale):
expediente = 8 # Barbeiro trabalha 8 horas no dia
fila = queue.Queue(5) # Fila de clientes, maximo de 5
barbeiro = Barbeiro(fila, time_scale) # Objeto que atende os clientes (tira d... | 36.731707 | 127 | 0.600044 |
814def3046e8366cf2efbc1f61e2725ae83d311d | 143 | py | Python | Topics/Recursion/Practices/02-Reverse-String.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Topics/Recursion/Practices/02-Reverse-String.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Topics/Recursion/Practices/02-Reverse-String.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def reverse(st: str, n: int) -> str:
if n == 0: return ""
return st[n-1] + reverse(st, n-1)
st = input()
print(reverse(st, len(st)))
| 17.875 | 37 | 0.552448 |
c4a8ee374fb40079e6d02a3a8809365eed9edf29 | 2,875 | py | Python | examples/relationship/onetoonefield/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/relationship/onetoonefield/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/relationship/onetoonefield/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.test import TestCase, TransactionTestCase
from .models import Place, Restaurant, Waiter
# Create your tests here.
class SimpleTest(TransactionTestCase):
reset_sequences = True
def test_a_n_plus_1(self):
# 准备数据
p1 = Place.objects.create(name='Demon Dogs', address='944 W. Fullerton... | 44.230769 | 114 | 0.625739 |
82fa368effb76ab00fa71676c7d689d22999a64d | 30,445 | py | Python | sim/lib/measures.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | null | null | null | sim/lib/measures.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | null | null | null | sim/lib/measures.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | 1 | 2021-07-28T13:52:58.000Z | 2021-07-28T13:52:58.000Z | import abc
from collections import namedtuple, defaultdict
import numpy as np
import math
from interlap import InterLap
# from utils import enforce_init_run # use this for unit testing
from lib.utils import enforce_init_run
# Tuple representing an interval, FIXME: duplicates mobilitysim Interval
Interval = namedtup... | 39.082157 | 144 | 0.638397 |
d23a0f3e64078d7df8c546b381388edb1a91c63a | 10,624 | py | Python | research/cv/PSPNet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/PSPNet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/PSPNet/train.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... | 41.338521 | 110 | 0.665945 |
d254624cb29493f10f634415690ae07aa265c5b7 | 1,916 | py | Python | backend/app/api/endpoints/annotations.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | null | null | null | backend/app/api/endpoints/annotations.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 2 | 2022-03-15T11:28:48.000Z | 2022-03-15T11:28:58.000Z | backend/app/api/endpoints/annotations.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | null | null | null | from typing import Any, List
from fastapi import APIRouter, Depends, UploadFile, File, Form
from shapely.geometry import Polygon
from app.api.deps import get_current_active_superuser
from app.core.annotation_extractor import extract_annotations_from_image
from app.core.annotation_validator import AnnotationValidator
... | 30.903226 | 72 | 0.703549 |
d263bdf38af99ff6eea28bf7b9e7dcbda02617ac | 396 | py | Python | Misc/SumOfAllDigits/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Misc/SumOfAllDigits/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Misc/SumOfAllDigits/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | a, b = map(int, input().split())
# Find sum of digits of a number
def sumDigits(n):
tot = 0
while(n > 0):
tot += n % 10
n //= 10
return tot
# Recursively find sum of digits till the number is single digit
def sumOfDigits(n):
k = sumDigits(n)
if k > 9:
return sumOfDigits(k)
... | 18 | 64 | 0.575758 |
968a6dca4eb615a680d42636568b1d2e17454783 | 1,023 | py | Python | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/cross-validation.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/cross-validation.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/cross-validation.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 09:24:09 2016
@author: abhishek
"""
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
import xgboost as xgb
np.random.seed(44)
train = pd.read_csv('./data/train_processed_handle_na.csv')
test = pd.read_csv('./data/test_pro... | 28.416667 | 103 | 0.701857 |
73a81c3e93b77e0257ef674616343450483b9e8c | 86 | py | Python | Version.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | Version.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | Version.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | _sephrasto_version_major = 1
_sephrasto_version_minor = 5
_sephrasto_version_build = 1 | 28.666667 | 28 | 0.872093 |
fbc427e5a7e08632bb04c809b5218828ae0f40b9 | 4,908 | py | Python | Aufgaben/abgabe2/ownTests.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/ownTests.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/ownTests.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | __authors__ = "Rosario Allegro (1813064), Sedat Cakici (1713179), Joshua Joost (1626034)"
# maintainer = who fixes buggs?
__maintainer = __authors__
__date__ = "2020-05-04"
__version__ = "0.0"
__status__ = "Development"
# kernel imports
import numpy as np
import math
# own data imports
import constants
def isUniCirc... | 30.296296 | 135 | 0.554197 |
f75a7219e9db706feac857d6e1c4d917ab32974f | 687 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_sem_repeticoes.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_sem_repeticoes.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_sem_repeticoes.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por verificar se lista não possui números repetidos.
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import sem_repeticoes
class PainelSemRepetic... | 32.714286 | 76 | 0.636099 |
541c8ede4bd9a4396584e6a1c0ad5d875bd1b768 | 1,030 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch02_math/ex02_number_as_text_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch02_math/ex02_number_as_text_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch02_math/ex02_number_as_text_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import unittest
import pytest
from parameterized import parameterized
from ch02_math.solutions.ex02_number_as_text import number_as_text
class Ex02_NumberAsText_Test(unittest.TestCase):
@parameterized.expand([
(7, "S... | 27.105263 | 66 | 0.615534 |
581a224122f6c2f4d6d296831e12095d95e773ab | 3,748 | py | Python | python_gui_tkinter/KALU/GARBAGE/TEST/CommandsGUI.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE/TEST/CommandsGUI.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE/TEST/CommandsGUI.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z |
import tkinter as tk
from tkinter import *
from tkinter import font
from tkinter.filedialog import askopenfilename
from tkinter import ttk
import textwrap
from AppOperations import AppOperations as ao # the class build for this purpose
#from CommandsGUI import CommandsGUI
from Generic import Generic
from GUIfun... | 34.385321 | 136 | 0.707577 |
589b8e2564037d8f2b115f00638d6c8ad4731926 | 10,464 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_query.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_query.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_query.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Felix Archambault
# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)... | 28.747253 | 97 | 0.6638 |
49c1960a6a1d7567838541d70df4dd4b3a021c1f | 1,101 | py | Python | prak_2/patrick_test.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | prak_2/patrick_test.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | prak_2/patrick_test.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | import unittest
import miller_rabin
class TestCryptoMethods(unittest.TestCase):
def test_miller_rabin(self):
self.assertTrue(miller_rabin.miller_rabin(32416190071, 300))
self.assertTrue(miller_rabin.miller_rabin(7, 3))
self.assertFalse(miller_rabin.miller_rabin(-1, 1))
self.assertF... | 35.516129 | 85 | 0.726612 |
b73bb50f297caeca70c209b5dea82fdac35512d2 | 11,000 | py | Python | python/get_limesurvey_results.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | null | null | null | python/get_limesurvey_results.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | 3 | 2021-01-28T13:46:07.000Z | 2021-01-28T14:26:27.000Z | python/get_limesurvey_results.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | 1 | 2020-08-13T11:51:09.000Z | 2020-08-13T11:51:09.000Z | import base64
import json
import os
import re
import time
from typing import List, Dict, Optional
import configargparse
import requests
from loguru import logger
URL = ""
SESSION_KEY = ""
USERNAME = ""
PASSWORD = ""
def levenshtein_distance(s1: str, s2: str) -> int:
if s1 == s2:
return 0
# https://e... | 41.509434 | 188 | 0.640455 |
b79417aaedb63683e589ee4244962b777dea189a | 526 | py | Python | loanrepaygraph.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | loanrepaygraph.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | loanrepaygraph.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib
#matplotlib.use('AGG')
import numpy as np
import math
N = 50
K = 3
M = 3
#X = 3
#fig, ax = plt.subplots()
for X in range(1,7):
G = 0
xaxis = [0]
yaxis = [0]
for i in range(10):
xaxis.append(i + 1)
G += max(math.floor((N-G)/X), M)
... | 16.967742 | 40 | 0.551331 |
4dc1d1ebd7547a98e9519548fec6d280b141b2ba | 887 | py | Python | site/public/courses/BEW-1.1/Examples/DiceGame/05-Unit-Tests/app_test.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/BEW-1.1/Examples/DiceGame/05-Unit-Tests/app_test.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/BEW-1.1/Examples/DiceGame/05-Unit-Tests/app_test.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | # First we need to import our app.
# This test file should be in the same folder as your app.py file
from app import app
import unittest
class AppTests(unittest.TestCase):
# This runs implicitly before any tests are run
# We use this to set up our app before we test on it
def setUp(self):
... | 30.586207 | 66 | 0.647125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.