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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a3c2033a07edfba6d2f09f90913216e57bbef80d | 213 | py | Python | nz_django/day8/djang_drf_demo/front/permissions.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day8/djang_drf_demo/front/permissions.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day8/djang_drf_demo/front/permissions.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from rest_framework.permissions import BasePermission
from .models import User
class UserLoginPermission(BasePermission):
def has_permission(self, request, view):
return isinstance(request.user,User) | 30.428571 | 53 | 0.798122 |
a3de928f3def7e56b8ed0b3d9e618599af08ab8c | 2,291 | py | Python | mod/units/yuyue_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 1 | 2015-06-28T15:26:52.000Z | 2015-06-28T15:26:52.000Z | mod/units/yuyue_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | null | null | null | mod/units/yuyue_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 6 | 2015-03-20T16:36:22.000Z | 2021-08-28T07:58:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-09-23 18:38:13
# @Author : jerry.liang.qq.com
import tornado.web
from ..models.user import User
from tornado.httpclient import HTTPRequest, HTTPClient, HTTPError
from config import SERVICE,TIME_OUT
import urllib
class yuyueHandler(tornado.web... | 31.819444 | 116 | 0.537756 |
a3ea7870a72cde2ee9e09abe01c289f681810443 | 10,129 | py | Python | src/visuanalytics/analytics/apis/api.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 1 | 2020-11-27T17:26:27.000Z | 2020-11-27T17:26:27.000Z | src/visuanalytics/analytics/apis/api.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 85 | 2021-01-02T11:38:59.000Z | 2021-07-26T07:13:47.000Z | src/visuanalytics/analytics/apis/api.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 1 | 2021-04-19T06:50:53.000Z | 2021-04-19T06:50:53.000Z | """
Modul, welches die Funktionen bereitstellt, welche für API-Requests benötigt werden.
"""
import json
import logging
import time
import requests
import xmltodict
from visuanalytics.analytics.control.procedures.step_data import StepData
from visuanalytics.analytics.util.step_errors import APIError, raise_step_error... | 39.877953 | 145 | 0.676276 |
60c76d546dbcb0cf9e94f6cccd4d4f6f27b8dcae | 293 | py | Python | TestTank.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | TestTank.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | TestTank.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | import sys
from time import sleep
sys.path.append("/home/pi/Documents/Robots/slcypi/MA") ### ADD PATH
sys.path.append("/home/pi/Documents/Robots/slcypi/HAT_Python3") ### ADD PATH
#from MA.Tank import Tank
from Tank import Tank
myRobot = Tank()
myRobot.drive(1,50)
sleep(1)
myRobot.stop()
| 18.3125 | 76 | 0.737201 |
e0e0f119e27d770b2db7d6679d14df68d4bc44bf | 2,247 | py | Python | ingress/ambassador/end-to-end/1-parallel/007-rate-limit/rate-limit-test.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | ingress/ambassador/end-to-end/1-parallel/007-rate-limit/rate-limit-test.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | ingress/ambassador/end-to-end/1-parallel/007-rate-limit/rate-limit-test.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/env python
# Copyright 2018 Datawire. 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 b... | 31.647887 | 82 | 0.664887 |
1c21d0c4fc7303847c0d712f51a6784e2ee6b438 | 2,093 | py | Python | experiments/DDPG_offset.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | 4 | 2020-10-11T01:30:13.000Z | 2021-04-27T16:03:41.000Z | experiments/DDPG_offset.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | experiments/DDPG_offset.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | import argparse
import os
import sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import pandas as pd
import ray
from ray.rllib.agents.ddpg.ddpg import DDPGTrainer
from ray.rl... | 41.039216 | 180 | 0.576684 |
c7da586fdbe86fec603ef0b373ac8bd8c4838685 | 1,261 | py | Python | oldp/apps/courts/tests/test_models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/courts/tests/test_models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/courts/tests/test_models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.test import TestCase
from oldp.apps.courts.models import Court, State, City, get_instance_or_create
class CourtsModelsTestCase(TestCase):
fixtures = ['courts.json']
def setUp(self):
pass
def tearDown(self):
pass
def test_get_court(self):
self.assertEqual(Court.o... | 30.756098 | 102 | 0.674861 |
400c7a24449d609b9b10b54a1534fe2c2388024a | 1,128 | py | Python | run_train.py | henrique/jigsaw20 | 5d12de807667810ea9b9bdb9cbccebabea7ed21d | [
"Apache-2.0"
] | 8 | 2020-06-23T13:42:34.000Z | 2022-01-25T11:00:01.000Z | run_train.py | henrique/jigsaw20 | 5d12de807667810ea9b9bdb9cbccebabea7ed21d | [
"Apache-2.0"
] | null | null | null | run_train.py | henrique/jigsaw20 | 5d12de807667810ea9b9bdb9cbccebabea7ed21d | [
"Apache-2.0"
] | 3 | 2020-06-24T03:18:26.000Z | 2020-07-30T01:22:53.000Z | import numpy as np
from train import train
from hyperopt import hp, fmin, tpe, space_eval, Trials
from hyperopt.mongoexp import MongoTrials
trials = Trials()
# trials = MongoTrials('mongo://localhost:1234/jigsaw_db/jobs', exp_key='r002')
# define a search space
space = dict(
optimizer='LAMB', #hp.choice('optimiz... | 31.333333 | 83 | 0.655142 |
40aa12dfee87fcdb3f2e469f2495eb1cbc7f92cd | 796 | py | Python | ___Python/Marco/PythonProj/p04_oop/m03_uhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p04_oop/m03_uhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p04_oop/m03_uhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null |
class Uhr(object):
def __init__(self, stunde, minute, sekunde):
self.stunde = stunde
self.minute = minute
self.sekunde = sekunde
def naechsteSekunde(self):
self.sekunde += 1
if self.sekunde > 59:
self.sekunde = 0
self.minute += 1
... | 25.677419 | 145 | 0.505025 |
4675c77fc7e534404a8a940fc9b09462e1de7e51 | 722 | py | Python | musicbeats/models.py | VICTOR4046/MusiX | 4a13d849e9db9a20b3ef8f286a8d047c0de86170 | [
"MIT"
] | null | null | null | musicbeats/models.py | VICTOR4046/MusiX | 4a13d849e9db9a20b3ef8f286a8d047c0de86170 | [
"MIT"
] | null | null | null | musicbeats/models.py | VICTOR4046/MusiX | 4a13d849e9db9a20b3ef8f286a8d047c0de86170 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Song(models.Model):
song_id = models.AutoField(primary_key=True)
name = models.CharField(max_length=2000)
singer = models.CharField(max_length=2000)
tags = models.CharField(max_length=100)
image... | 38 | 62 | 0.738227 |
46781b3193cda1b57d9cc849e30d0d5c3874bab7 | 1,498 | py | Python | Sketche/bouncing_ball.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | Sketche/bouncing_ball.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | Sketche/bouncing_ball.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | import p5
import random as r
class Ball(object):
def __init__(self):
self.r = r.randint(8, 12)
self.vel = p5.Vector(1, 1)*r.uniform(2.0, 6.0)
self.dir = p5.Vector(-1.5, 1.5)
self.pos = p5.Vector(r.randint(0, width), r.randint(0, height))
self.red = (r.randint(100, 255))
... | 28.264151 | 98 | 0.534713 |
311d787db602723643e2147a507c46f97d7a0c0e | 2,016 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/scenario/scenarios/RealWorld/RiLSA_example1/makeRoutes.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/scenario/scenarios/RealWorld/RiLSA_example1/makeRoutes.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/scenario/scenarios/RealWorld/RiLSA_example1/makeRoutes.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"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) 2012-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... | 30.089552 | 120 | 0.55754 |
7304efad0fe685763036431efe89cd1826986e5f | 2,023 | py | Python | src/util/functions.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/util/functions.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/util/functions.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | import numpy as np
from util.vec import Vec3
class Point: # Holder for objects in space, which require the location attribute
def __init__(self, location):
self.location = location
def get_vec(self):
return Vec3(self.location)
def __add__(self, other):
return self.location + other... | 27.337838 | 102 | 0.634701 |
b426c5f7a3ea1da42cf2c1d2757f9e6f8756e10f | 1,253 | py | Python | experimental/sngp/gaussian_process.py | krasserm/edward2 | 311d3ad6946b543e70af1495eab9a0a9b4f69854 | [
"Apache-2.0"
] | null | null | null | experimental/sngp/gaussian_process.py | krasserm/edward2 | 311d3ad6946b543e70af1495eab9a0a9b4f69854 | [
"Apache-2.0"
] | null | null | null | experimental/sngp/gaussian_process.py | krasserm/edward2 | 311d3ad6946b543e70af1495eab9a0a9b4f69854 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 34.805556 | 76 | 0.758978 |
c3716e27a7514d7236cd4a111f1bc73b25454f5e | 2,513 | py | Python | projects/gloo/api/external/envoy/import.py | vadimi/gloo | 9f312e34274ca4d739570c5b669845b2caed70bf | [
"Apache-2.0"
] | null | null | null | projects/gloo/api/external/envoy/import.py | vadimi/gloo | 9f312e34274ca4d739570c5b669845b2caed70bf | [
"Apache-2.0"
] | null | null | null | projects/gloo/api/external/envoy/import.py | vadimi/gloo | 9f312e34274ca4d739570c5b669845b2caed70bf | [
"Apache-2.0"
] | null | null | null | import re,sys,os
def get_imports(envoy_path, f):
try:
with open(os.path.join(envoy_path,"api/",f)) as data:
alldata = data.read()
allimports = re.findall("import \"(.*)\";", alldata)
imports = set([a for a in allimports])
for i in allimports:
... | 39.888889 | 180 | 0.56546 |
48a560169b120f221b75125f4fe542ae0e78874b | 265 | py | Python | comp/amazon/MaximizeStockets.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/amazon/MaximizeStockets.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/amazon/MaximizeStockets.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | def maxprofit(stockvals):
maxval, profit = 0, 0
for stockval in stockvals[::-1]:
maxval = max(maxval, stockval)
profit += maxval - stockval
return profit
stockvalues = [1, 3, 1, 2, 4]
print
"Profit was: " + str(maxprofit(stockvalues))
| 22.083333 | 44 | 0.626415 |
d2bb8c03ac38c7d8ffa9bd7eb169ddf6f79007e4 | 3,169 | py | Python | crm/decoraters.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | crm/decoraters.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | crm/decoraters.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.http import HttpResponse
from django.shortcuts import redirect
def nicht_authentifizierter_user(view_func):
'''
Decorater der eine View-Funktion verarbeitet
Parameters:
view_func (Function): Eine View-Funktion
... | 34.075269 | 120 | 0.533922 |
81adb4160222cbdaa59d18366a7fb9c7b8defc0a | 13,672 | py | Python | utils/check_dummies.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 12 | 2021-06-05T03:51:23.000Z | 2022-03-05T05:09:41.000Z | utils/check_dummies.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 1 | 2021-10-20T02:25:36.000Z | 2021-10-20T02:25:36.000Z | utils/check_dummies.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 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
#
# Unless required by applicable... | 34.438287 | 123 | 0.652648 |
c4f1233722ab91b1ac7339484f1dbc822be7eb5e | 237 | py | Python | Python/Collections/collections_counter.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Collections/collections_counter.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Collections/collections_counter.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | from collections import Counter
X, shoes = input(), Counter(map(int, input().strip().split()))
e = 0
for i in range(int(input())):
s, p = map(int, input().split())
if(shoes[s] > 0):
e += p
shoes[s] -= 1
print(e) | 21.545455 | 62 | 0.548523 |
1ef9da7279ce9d2360f823551c3268297c31e50a | 795 | py | Python | python/en/_matplotlib/gallery/lines_bars_and_markers/simple_plot.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/lines_bars_and_markers/simple_plot.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/lines_bars_and_markers/simple_plot.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
lines_bars_and_markers/simple_plot.py
Matplotlib > Gallery > Lines, bars and markers > Simple plot
https://matplotlib.org/gallery/lines_bars_and_markers/simple_plot.html#sphx-glr-gallery-lines-bars-and-markers-simple-plot-py
"""
import matplotlib.pyplot as plt
import... | 23.382353 | 125 | 0.69434 |
f73c872994b227cfbf44164f73160c58f1598ca9 | 1,897 | py | Python | mongodb/mongodb-enterprise-kubernetes/samples/kubernetes-clients/python/test_mongodb_kube_client.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | mongodb/mongodb-enterprise-kubernetes/samples/kubernetes-clients/python/test_mongodb_kube_client.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | mongodb/mongodb-enterprise-kubernetes/samples/kubernetes-clients/python/test_mongodb_kube_client.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/env python
from __future__ import print_function
import yaml
from mongodb_kube_client import MongoDBEnterpriseKubeClient
def parse_config_file(path):
'''
Parses the config file in the given path
'''
with open(path, 'r') as parameters:
try:
return yaml.load(parameters)
... | 32.706897 | 106 | 0.702688 |
5853830db8e546b1376076b850e4c47e414404be | 1,411 | py | Python | solutions/exercise-001-test.py | tmstff/corgy-python | 8f044d318087cc956079e615932b1cefd8b766ed | [
"MIT"
] | 1 | 2022-01-31T20:26:18.000Z | 2022-01-31T20:26:18.000Z | solutions/exercise-001-test.py | tmstff/corgy-python | 8f044d318087cc956079e615932b1cefd8b766ed | [
"MIT"
] | null | null | null | solutions/exercise-001-test.py | tmstff/corgy-python | 8f044d318087cc956079e615932b1cefd8b766ed | [
"MIT"
] | null | null | null | #!/usr/bin/python
##Import modules
import pytest
import exercise-001
## TESTS
def test_GesamtgewichtLOOP():
assert Aufgabe1.GesamtgewichtLOOP([]) == 0
assert Aufgabe1.GesamtgewichtLOOP([1]) == 1
assert Aufgabe1.GesamtgewichtLOOP([6,6,6]) == 18
def test_DurchschnittsGewichtLOOP():
ass... | 32.068182 | 67 | 0.720765 |
588aef25e68a63dbaea5c6108bbe35b6b724755e | 2,359 | py | Python | Cortex-M_Implementation_KEM/Cortex-M0/saber-ref-mem/evaluate.py | mariaschopp/SABER | 1d289c29d33d91fab1e2da15378601f540c9da28 | [
"Unlicense"
] | 34 | 2019-02-15T05:11:49.000Z | 2022-03-23T08:00:29.000Z | Cortex-M_Implementation_KEM/Cortex-M0/saber-ref-mem/evaluate.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | 8 | 2020-04-09T12:33:42.000Z | 2022-03-07T20:08:41.000Z | Cortex-M_Implementation_KEM/Cortex-M0/saber-ref-mem/evaluate.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | 10 | 2020-03-09T15:09:50.000Z | 2022-03-23T08:00:18.000Z | #!/usr/bin/python -u
# -*- coding: utf-8 -*-
import subprocess
import serial
import csv
import re
import os
import numpy
import signal
import sys
import time
uart = '/dev/ttyACM0'
def replace_line(file_name, line_num, text):
lines = open(file_name, 'r').readlines()
lines[line_num-1] = text
out = open(fil... | 24.071429 | 104 | 0.645189 |
589a6d0bfd6ab40d686aeef8677a23df405734f2 | 11,808 | py | Python | src/server/app/endpoints/editor/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/editor/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/editor/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | import sys
from ...db.settings import db, oidc, socketio
from flask import Flask, Blueprint, render_template, abort, g, request
from oauth2client.client import OAuth2Credentials
from flask_jwt_extended import (create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_jwt_identity, get_r... | 27.270208 | 176 | 0.67793 |
54364c6a10fe5b33cb607af630c5be9379d580f9 | 16,839 | py | Python | pghoard/rohmu/object_storage/azure.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 731 | 2018-06-01T21:48:43.000Z | 2022-03-29T08:21:42.000Z | pghoard/rohmu/object_storage/azure.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 124 | 2018-06-19T05:59:50.000Z | 2022-03-31T18:17:59.000Z | pghoard/rohmu/object_storage/azure.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 64 | 2018-06-26T14:12:53.000Z | 2022-03-20T07:33:33.000Z | """
rohmu - azure object store interface
Copyright (c) 2016 Ohmu Ltd
See LICENSE for details
"""
import logging
import time
from io import BytesIO
# pylint: disable=import-error, no-name-in-module
import azure.common
from azure.core.exceptions import ResourceExistsError
from azure.storage.blob import BlobServiceClien... | 47.036313 | 124 | 0.641784 |
49d9fd76bdc215272f481e0194ba9e09fdd608e1 | 1,683 | py | Python | plugins/tff_backend/models/global_stats.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/models/global_stats.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/models/global_stats.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 32.365385 | 106 | 0.727867 |
b78cae42a69f917b21374cb532cd759e38f9b36c | 5,994 | py | Python | test/test_npu/test_network_ops/test_ifmr.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_ifmr.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_ifmr.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... | 42.814286 | 78 | 0.547881 |
b7cf13e3ed9fe2080a4bea4268a743f83b70f9ca | 541 | py | Python | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/12_reverse_strings.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/12_reverse_strings.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/12_reverse_strings.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # Inhalte von Strings umdrehen oder alphabetisch sortieren
print('Gib deinen Vollständigen Namen ein')
name=input()
liste=list(name)
print('Rückwärts:')
for i in range(len(liste)):
print(liste[len(liste)-1-i], end='')
else:
print(end='\n')
print('Alphabetisch sortiert:')
liste.sort(key=str.lower)
for buchsta... | 20.807692 | 58 | 0.695009 |
4d7eb65c149266f0ac0bc40cb92d2a8df1263258 | 1,228 | py | Python | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/subject_data_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/subject_data_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/subject_data_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from watchmen_auth import PrincipalService
from watchmen_inquiry_kernel.schema import SubjectSchema
from watchmen_model.common import DataPage, DataResult, Pageable
from watchmen_model.console import Subject
from .subject_storage import SubjectStorage
class SubjectDataService:
def __init__(self, subject: Subject, pr... | 34.111111 | 103 | 0.794788 |
12ec0911c0754b735116ea4a4edba324a1463f7b | 1,106 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/lav_to_maf.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/lav_to_maf.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/lav_to_maf.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/python2.7
"""
Application to convert LAV file to MAF file. Reads a LAV file from standard
input and writes a MAF file to standard out; some statistics are written to
standard error.
usage: lav_to_maf [--silent] [path=replacement] < lav_file > maf_file
"""
import sys
import copy
import bx.align.lav
import... | 20.481481 | 76 | 0.662749 |
12f861d839c4ff23fd51370d5821a6aa8e57eb91 | 2,180 | py | Python | Packs/Campaign/Scripts/CollectCampaignRecipients/CollectCampaignRecipients.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/CollectCampaignRecipients/CollectCampaignRecipients.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/CollectCampaignRecipients/CollectCampaignRecipients.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
ALL_INCIDENTS = 'All'
CAMPAIGN_EMAIL_TO_FIELD = 'campaignemailto'
def get_campaign_incidents():
"""
Get the campaign incidents form the incident's context
:rtype: ``list``
:return: list of campa... | 30.704225 | 117 | 0.674312 |
c4575648de8fd95b4e8fe52280d47b56be29a474 | 112 | py | Python | Licence 2/I33/TP 2/ex_5.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 2/ex_5.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 2/ex_5.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def decompose(n, b):
T = []
while n != 0:
T += [n % b]
n = n // b
return T[::-1]
print(decompose(30, 5)) | 14 | 23 | 0.473214 |
c47c9e1bcec3b99c2f833fcf25b272f468cc5381 | 715 | py | Python | src/common/model_preparator/model_loader.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/common/model_preparator/model_loader.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/common/model_preparator/model_loader.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | import chainer
import importlib
import os, sys
from chainer import serializers
def prepare_model(args):
model = getattr(
importlib.import_module(args.archtecture.module_name),
args.archtecture.class_name)(args.n_class, args.in_ch)
if os.path.exists(args.initial_model):
... | 29.791667 | 86 | 0.674126 |
fbf86b222e1f969ed436681d6ff55a3dd8046a64 | 1,298 | py | Python | src/python3_learn_video/constructor_destructor.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/constructor_destructor.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/constructor_destructor.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | """
构造 和 析构:
魔法方法总是被双下划线包围,例如 __init__(self[, ...])
魔法方法是面向对象的Python的一切,如果你不知道魔法方法,说明你还没能意识到面向对象的Python的强大
魔法方法的“魔力”体现在它们总能够在适当的时候被自动调用
有时候在类定义时有写__init__方法,有时候却没有,这是为什么?????????
"""
class Rectangel:
def __init__(self, x, y): # init 方法不能返回任何值
self.x = x
self.y = y
def getPeri(self... | 18.542857 | 57 | 0.468413 |
4509904249f6e43a709e00030e548d9eab0f4c42 | 2,097 | py | Python | frappe-bench/apps/erpnext/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import getdate, cint
import calendar
def execute(filters=None):
# key yyyy-mm
new_customers_in =... | 31.772727 | 99 | 0.694325 |
450bc7d22239754c4598ca90b9bbc452fca889dd | 1,958 | py | Python | evo_algorithm/ea_template/test_ea_template.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | evo_algorithm/ea_template/test_ea_template.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | evo_algorithm/ea_template/test_ea_template.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | import ea_template
import unittest
class TestEA(unittest.TestCase):
def setUp(self):
ea_template.population.clear()
ea_template.api_calls = 0
ea_template.stop = False
def test_init_population(self):
self.assertEqual(len(ea_template.population), 0)
ea_template.initPopu... | 37.653846 | 102 | 0.669561 |
18f81e8b5f34c0cf98cc634e2255997b08121436 | 3,150 | py | Python | app/main.py | Saransh239/MOVIE-RECOMMENDER | 88e2ef57733d2070e901eb1067348c9eedd089c3 | [
"MIT"
] | null | null | null | app/main.py | Saransh239/MOVIE-RECOMMENDER | 88e2ef57733d2070e901eb1067348c9eedd089c3 | [
"MIT"
] | 3 | 2020-08-29T10:25:38.000Z | 2020-11-11T16:34:41.000Z | app/main.py | Saransh239/MOVIE-RECOMMENDER | 88e2ef57733d2070e901eb1067348c9eedd089c3 | [
"MIT"
] | 1 | 2020-09-20T07:51:04.000Z | 2020-09-20T07:51:04.000Z | from flask import Flask, render_template, request, jsonify
#from chatbot import chatbot
import os
from flask_cors import CORS
import pandas as pd
import scipy.sparse as sp
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
def get_data()... | 32.142857 | 137 | 0.670476 |
e141daaaf65a6af6cd15ad62cb4be2a91bb1496a | 408 | py | Python | 1380-lucky-numbers-in-a-matrix/1380-lucky-numbers-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1380-lucky-numbers-in-a-matrix/1380-lucky-numbers-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1380-lucky-numbers-in-a-matrix/1380-lucky-numbers-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def luckyNumbers (self, matrix: List[List[int]]) -> List[int]:
candidates = [(i, mat.index(min(mat))) for i, mat in enumerate(matrix)]
output=[]
for cand in candidates:
r, c = cand
col = [sub[c] for sub in matrix]
target = matrix[r][c]
... | 37.090909 | 79 | 0.526961 |
e1a041799b2453a3bcae766b5b85d3edf44efcba | 449 | py | Python | exercises/fr/solution_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/solution_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/solution_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("fr_core_news_sm")
text = "Le constructeur Citröen présente la e-Méhari Courrèges au public."
# Traite le texte
doc = nlp(text)
# Itère sur les entités
for ent in doc.ents:
# Affiche le texte de l'entité et son label
print(ent.text, ent.label_)
# Obtiens la portion pour "e-Méh... | 22.45 | 74 | 0.737194 |
830a90abea56327bd4ac62b26a7941248068241f | 14,646 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/system/interfaces_file/test_interfaces_file.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/system/interfaces_file/test_interfaces_file.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/system/interfaces_file/test_interfaces_file.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2017, Roman Belyakovsky <ihryamzik () 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 License, or
# (at your option) any la... | 44.652439 | 157 | 0.489144 |
832087aba6ca4038e9d3d8ebcb7d96c3496c8216 | 560 | py | Python | misc/json2lp.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 29 | 2017-06-21T19:29:07.000Z | 2022-02-17T12:26:24.000Z | misc/json2lp.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 34 | 2017-06-26T14:31:02.000Z | 2022-02-03T16:40:41.000Z | misc/json2lp.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 22 | 2017-06-29T11:08:42.000Z | 2022-02-03T16:16:49.000Z | #!/usr/bin/env python
"""Translates clingo's Json fact format to regular *.lp format.
"""
import sys
import json
import argparse
def main():
parser = argparse.ArgumentParser(usage='Extracts facts from json file read from stdin or give as argument')
parser.add_argument('jfile', nargs='?', help='Json file')
... | 24.347826 | 111 | 0.648214 |
b8060879564d88a813b20312871b28d045b52a4b | 664 | py | Python | tests/web.adblockplus.org/tests/test_MonitorDonationPages.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_MonitorDonationPages.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_MonitorDonationPages.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.genericDonationPage import GenericDonationPage
from data.dataDonationPages import TEST_DATA
import utils.global_functions as gf
@pytest.fixture
def driver():
options = Options()
gf.setup(options)
... | 22.133333 | 59 | 0.792169 |
c52cc994d460de5ab431b7116e5e5efbdbf4e5d4 | 1,369 | py | Python | Chapter8_CodeTesting/Timing/timing.py | kernbeisser/UdemyPythonPro | 000d5e66031bcc22b2d8f115edfbd5ef0e80d5b9 | [
"MIT"
] | null | null | null | Chapter8_CodeTesting/Timing/timing.py | kernbeisser/UdemyPythonPro | 000d5e66031bcc22b2d8f115edfbd5ef0e80d5b9 | [
"MIT"
] | null | null | null | Chapter8_CodeTesting/Timing/timing.py | kernbeisser/UdemyPythonPro | 000d5e66031bcc22b2d8f115edfbd5ef0e80d5b9 | [
"MIT"
] | null | null | null | '''Test code.
'''
import random
import time
from functools import wraps
from timeit import Timer
from vector import Vector2D
def timing(fn):
@wraps(fn)
def timer(*args, **kwargs):
start_time = time.perf_counter()
fn_result = fn(*args, **kwargs)
end_time = time.perf_counter()
t... | 24.446429 | 94 | 0.65084 |
c56dcdd11d96f00dd0a94d8bd31c7a4a023178e0 | 515 | py | Python | CodeChef_problems/ANIRWO/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/ANIRWO/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/ANIRWO/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #Question Link
#https://www.codechef.com/problems/ANIRWO
t=int(input()) #input test cases
for a0 in range(t):
s=input().lower() #input string
ns="" #creating empty string to store result
for i in range(len(s)):
val=ord(s[i]) #fetching the ASCII value of the character at position i
if v... | 28.611111 | 83 | 0.590291 |
9ac7bc5568e96fe6a083d31a77334e4ce4923cad | 270 | py | Python | PYTHON/Built_Ins/zipped.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Built_Ins/zipped.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Built_Ins/zipped.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
val = list(map(int, input().split()))
N, X = val[0], val[1]
score = []
for _ in range(X):
score.append(list(map(float, input().split())))
for z in zip(*score):
print(sum(z) / len(z))
| 24.545455 | 55 | 0.533333 |
b11d0cd0686d2abcc51195191e582ee9f5052724 | 339 | py | Python | module/mode.py | MakiseVon/LabelDcm | f220ec182cae4cd64167399e28ebe7d9442f28b2 | [
"MIT"
] | null | null | null | module/mode.py | MakiseVon/LabelDcm | f220ec182cae4cd64167399e28ebe7d9442f28b2 | [
"MIT"
] | null | null | null | module/mode.py | MakiseVon/LabelDcm | f220ec182cae4cd64167399e28ebe7d9442f28b2 | [
"MIT"
] | 2 | 2021-02-03T04:34:26.000Z | 2021-02-03T06:32:48.000Z | import enum
from enum import Enum
class LabelMode(Enum):
DEFAULT_MODE = enum.auto()
POINT_MODE = enum.auto()
LINE_MODE = enum.auto()
ANGLE_MODE = enum.auto()
CIRCLE_MODE = enum.auto()
MIDPOINT_MODE = enum.auto()
VERTICAL_MODE = enum.auto()
MOVE_POINT_MODE = enum.auto()
ERASE_POINT_... | 22.6 | 34 | 0.669617 |
49437a90cda62c8ce3c77ace16cd2ccb6648499e | 12,572 | py | Python | ProbeShot/mapgenusblastdb.py | cherrytrees-kpu/sturdy-journey | ce87562bde81ec55235d8f65e8ec9d5e13b50bcc | [
"MIT"
] | null | null | null | ProbeShot/mapgenusblastdb.py | cherrytrees-kpu/sturdy-journey | ce87562bde81ec55235d8f65e8ec9d5e13b50bcc | [
"MIT"
] | null | null | null | ProbeShot/mapgenusblastdb.py | cherrytrees-kpu/sturdy-journey | ce87562bde81ec55235d8f65e8ec9d5e13b50bcc | [
"MIT"
] | null | null | null | from Bio import AlignIO
import argparse
import pathlib
import json
def output_data(data, path, name):
"""
Output data into importable structure
"""
output_path = path.joinpath(name + '.txt')
outputfile = open(output_path, 'w')
outputfile.write(json.dumps(data))
outputfile.close()
def map_g... | 46.051282 | 102 | 0.556634 |
6221ff28d80a6750cdad8842ddc739772c5d2bb7 | 2,864 | py | Python | test/test_lossy_counting.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | test/test_lossy_counting.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | test/test_lossy_counting.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | from parameterized import parameterized
from nose.tools import assert_equal, assert_true
import os
import sys
dir_path = os.path.dirname(os.path.abspath(__file__))
module_path = os.path.join(dir_path, "../src/counter")
if module_path not in sys.path:
sys.path.append(module_path)
os.chdir(dir_path)
class TestLos... | 37.194805 | 158 | 0.580307 |
622a26717b096cf6389ff0359d608064760e8c21 | 1,693 | py | Python | webinterface/management/commands/create_assignments.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/management/commands/create_assignments.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/management/commands/create_assignments.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from django.core.management.base import BaseCommand
from webinterface.models import *
from cleansys.settings import WARN_WEEKS_IN_ADVANCE__ASSIGNMENTS_RUNNING_OUT
class Command(BaseCommand):
help = 'Creates Assignments in all enabled Schedules by calling create_assignments_over_timespan() on each ' \
'... | 56.433333 | 119 | 0.682812 |
62306c1fb0c6b8b92c707fa6f6b0450525dea7d3 | 2,212 | py | Python | UAS/UAS 6/main.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | UAS/UAS 6/main.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | UAS/UAS 6/main.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | #Main Program
from Class import Kota
kota = [
Kota('Jombang', 1),
Kota('Surabaya', 2),
Kota('Bandung', 3),
Kota('Jakarta', 4)
]
cadangan = [
Kota('Jombang', 1),
Kota('Surabaya', 2),
Kota('Bandung', 3),
Kota('Jakarta', 4)
]
tersedia1, tersedia2= [
1, 2, 3, 4, 5,
6, 7, 8, 9, 10,
11, 12, 13, ... | 27.308642 | 88 | 0.600362 |
62834aae7c00c848dc65f2d5930a74d09f609d5e | 286 | py | Python | kernel/panel/urls.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/panel/urls.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/panel/urls.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from django.urls import reverse_lazy, reverse
from . import views
app_name = 'panel'
urlpatterns = [
re_path(r'^$', views.PanelView.as_view(), name='index'),
]
# re_path(r'^registration/$', views.UserFormView.as_view(), name='registration') | 23.833333 | 80 | 0.723776 |
0c57ab2e95be37ab42d7aee045fbe37dd8080a02 | 169 | py | Python | chff/tests/test_chff.py | mnes-io/chff | 9f450183ae508a56bf6869f59e7ffce24f56b269 | [
"MIT"
] | null | null | null | chff/tests/test_chff.py | mnes-io/chff | 9f450183ae508a56bf6869f59e7ffce24f56b269 | [
"MIT"
] | null | null | null | chff/tests/test_chff.py | mnes-io/chff | 9f450183ae508a56bf6869f59e7ffce24f56b269 | [
"MIT"
] | null | null | null | from unittest import TestCase
import chff
class Testchff(TestCase):
def test_is_string(self):
s = chff.hello()
self.assertTrue(isinstance(s, str))
| 18.777778 | 43 | 0.686391 |
a7c1fa7a924e2469027ddd214b1c346d314423e7 | 1,432 | py | Python | Miniprojekt och Studio/Mini3/mini3.py | Guziobi/GKT-Projekt | b0d63974fe672380345c83c9882cc782db81b182 | [
"MIT"
] | null | null | null | Miniprojekt och Studio/Mini3/mini3.py | Guziobi/GKT-Projekt | b0d63974fe672380345c83c9882cc782db81b182 | [
"MIT"
] | null | null | null | Miniprojekt och Studio/Mini3/mini3.py | Guziobi/GKT-Projekt | b0d63974fe672380345c83c9882cc782db81b182 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from VLE import *
P = 1520 # mmHg
T = 87 # C
Xf = 0.35
tol = 0.001
Tb_m = 64.7
Tb_e = 77.1
A1 = 7.87863
B1 = 1473.11
C1 = 230.0
A2 = 7.09803
B2 = 1238.71
C2 = 217.0
ABC1 = [A1, B1, C1]
ABC2 = [A2, B2, C2]
Lambda12 = 0.62551
Lambda21 = 0.49384
TBP, x1, y1 = bubb... | 22.730159 | 173 | 0.64176 |
38f38eaf97504b85ebc3b878b0aba67c835bb278 | 16,984 | py | Python | quant/observers/t_bfx_btc.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/t_bfx_btc.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/t_bfx_btc.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import division
import logging
import time
from quant import config
from quant.common import constant
from .basicbot import BasicBot
from quant.brokers import broker_factory
class Arbitrage(BasicBot):
"""
btc和bt1 bt2的合成与分解套利
btc > bt1 + bt2:... | 47.309192 | 119 | 0.575836 |
ac6dc2f2acc7a5425e0a32da3db4fab9ad402991 | 2,185 | py | Python | src/onegov/core/security/rules.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/rules.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/rules.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.cronjobs import Job
from onegov.core.framework import Framework
from onegov.core.security import Public
from webob.exc import HTTPException
@Framework.permission_rule(model=object, permission=object, identity=None)
def has_permission_not_logged_in(app, identity, model, permission):
""" This catch... | 30.774648 | 78 | 0.722197 |
5a7a3ccb9f9aca2ae7b6cd29650544d2244c3f66 | 6,515 | py | Python | oneflow/python/test/ops/test_ssp_variable_proxy.py | ncnnnnn/oneflow | f6e81f65eed1d87c3125e7a78247cfaa72220020 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/ops/test_ssp_variable_proxy.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/test/ops/test_ssp_variable_proxy.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 35.407609 | 90 | 0.580046 |
0ccac0ca49b8dd85b710f85d4f147c2fd427d589 | 1,060 | py | Python | display/_relay_menu_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_relay_menu_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_relay_menu_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._button_lights import ButtonLights
from ._view import View
from ._display import Display
from config import RelayConfig
relay_menu_view_name: str = "relay_menu_view"
class RelayMenuView(View):
def __init__(self, button_ligts: ButtonLights, relay_config: RelayConfig):
super().__init__(button_ligts... | 24.651163 | 78 | 0.642453 |
0cec42a920cece8a4306ad778470e2d7dd23cb6d | 4,740 | py | Python | oldp/apps/cases/processing/processing_steps/assign_court.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/processing/processing_steps/assign_court.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/processing/processing_steps/assign_court.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import json
import logging
import re
from oldp.apps.backend.processing import ProcessingError
from oldp.apps.cases.models import Case
from oldp.apps.cases.processing.processing_steps import CaseProcessingStep
from oldp.apps.courts.apps import CourtTypes, CourtLocationLevel
from oldp.apps.courts.models import Court, Ci... | 33.380282 | 94 | 0.564135 |
f0417fe226cdfe7279872c6f0c0b4ee2ef64ad99 | 919 | py | Python | gdp1/assignment_3/max_fixed.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_3/max_fixed.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_3/max_fixed.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | from gdp1.common.input_helpers import int_input
def my_max(values):
"""Returns the "largest" value in the given list. If the values are not of the same type, the result may be
undefined.
@param list values: A list of values.
@raises ValueError: When an empty array is passed.
@return: The "largest... | 27.848485 | 111 | 0.656148 |
686df7a3c5e66bf7122301bf111e58922030c53a | 11,840 | py | Python | Packs/VMwareWorkspaceONEUEM/Integrations/VMwareWorkspaceONEUEM/VMwareWorkspaceONEUEM_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/VMwareWorkspaceONEUEM/Integrations/VMwareWorkspaceONEUEM/VMwareWorkspaceONEUEM_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/VMwareWorkspaceONEUEM/Integrations/VMwareWorkspaceONEUEM/VMwareWorkspaceONEUEM_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import io
import pytest
from CommonServerPython import *
from VMwareWorkspaceONEUEM import Client, HTTP_ERROR, MESSAGES
from test_data import input_data
SERVER_URL = "https://host.awmdm.com"
BASE_URL = "https://host.awmdm.com/API/mdm/"
client = Client("user", "user123", BASE_URL, {'aw-tenant-code': "abed"... | 39.075908 | 123 | 0.753209 |
cc338ffa8b1f3cd3c5bd326984b60462bf5a77cb | 231 | py | Python | AdvinheAFruta/Jogador.py | jvpersuhn/hb | 5487abf4fc5b742cf21086ca5b823b915132445d | [
"MIT"
] | null | null | null | AdvinheAFruta/Jogador.py | jvpersuhn/hb | 5487abf4fc5b742cf21086ca5b823b915132445d | [
"MIT"
] | null | null | null | AdvinheAFruta/Jogador.py | jvpersuhn/hb | 5487abf4fc5b742cf21086ca5b823b915132445d | [
"MIT"
] | null | null | null |
class Jogador:
def __init__(self):
self.__tentativas = 10
@property
def tentativa(self):
return self.__tentativas
@tentativa.setter
def tentativa(self, qtd):
self.__tentativas -= qtd
| 16.5 | 32 | 0.623377 |
cc34d5c57e1a50e17d6c517b9710dc516f9fd0c3 | 187 | py | Python | exercises/pt/exc_01_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_01_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_01_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importar a biblioteca spaCy
import ____
# Crie um objeto nlp do Inglês
nlp = ____
# Processe o texto
doc = nlp("This is a sentence.")
# Imprima o texto do documento
print(____.text)
| 15.583333 | 32 | 0.727273 |
f0e805421e5ca78cbbecbbe1e498d3154aa58d51 | 274 | py | Python | Curso-Em-Video-Python/2Exercicios/ex107/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex107/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex107/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | def metade(valor):
return valor / 2
def dobro(valor):
return valor * 2
def aumentar(valor, porcento):
aumento = valor + (valor * porcento / 100)
return aumento
def reduzir(valor, porcento):
reduz = valor - (valor * porcento / 100)
return reduz
| 16.117647 | 46 | 0.642336 |
9bd4dad7f00e67e0d511a34353b100b348106a3b | 5,034 | py | Python | Webpage/utils/member.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/utils/member.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/utils/member.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | import hashlib
import os
import datetime
from django.contrib.auth.models import User
from cruises.models import sailor
from member.models import profile
# from arbeitsstunden.models import account
import member.models as memberModel
from keycloak import KeycloakAdmin
import random
from django import template
import ge... | 32.477419 | 166 | 0.644219 |
503f6544033f6c6a6480fe0ebc5c7cda9c2d3378 | 563 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 41/41.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | 50-Python-Exercises/Exercises/Exercise 41/41.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | 50-Python-Exercises/Exercises/Exercise 41/41.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #FromScratch - Create a script that generates a file where all letters of English alphabet are listed one in each line
#TO BE USED AS FIRST LECTURE EXAMPLE
#SOLUTION WOULD BE LIKE: Think of the program as a machine that gets some input and produces some output.
#In this case the input would be alphabet letters and the ... | 51.181818 | 169 | 0.760213 |
504644e54ac174ffd10e238c6b63cafe88eb2c5c | 1,415 | py | Python | iscsi_initiator/scandev.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | iscsi_initiator/scandev.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | iscsi_initiator/scandev.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | import os
# the blockdevice information about a target
# can be found in directory'/sys/class/iscsi_session/'
#
# iscsi_session
# |
# -----------------------------
# | | ..... |
# session1 session2 ..... sessionN
# |----------
# | |
# device targetname #here chec... | 30.106383 | 71 | 0.624735 |
5060f9ce8a1a5b4408944fcf317cf0020e55a302 | 1,518 | py | Python | src/bo4e/com/standorteigenschaftenstrom.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/standorteigenschaftenstrom.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/standorteigenschaftenstrom.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains StandorteigenschaftenStrom class
and corresponding marshmallow schema for de-/serialization
"""
import attr
from marshmallow import fields
from bo4e.com.com import COM, COMSchema
# pylint: disable=too-few-public-methods
@attr.s(auto_attribs=True, kw_only=True)
class StandorteigenschaftenStrom(COM):
... | 33 | 207 | 0.756258 |
7642510b86be4f2a4685a7bea50d4be6e05075f5 | 1,071 | py | Python | Webpage/cruises/forms.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/cruises/forms.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/cruises/forms.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null |
from django import forms
from django.db.models import fields
from django.forms import CheckboxSelectMultiple, DateInput
from django.http import request
from ajax_select.fields import AutoCompleteSelectField, AutoCompleteSelectMultipleField
from .models import *
class DateInput(forms.DateInput):
input_type = 'd... | 32.454545 | 101 | 0.705882 |
76a1a268c5013fb4c9eb016e49e91d1ff6328fa8 | 1,546 | py | Python | Python/zzz_training_challenge/UdemyPythonPro/Chapter13_C_Python_Numba/benchmark.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | 4 | 2020-12-28T23:43:35.000Z | 2022-01-01T18:34:18.000Z | Python/zzz_training_challenge/UdemyPythonPro/Chapter13_C_Python_Numba/benchmark.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/UdemyPythonPro/Chapter13_C_Python_Numba/benchmark.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | 9 | 2020-09-26T19:29:28.000Z | 2022-02-07T06:41:00.000Z | '''Test code.
'''
from typing import Any
import numpy as np
import fastvector
import math_cpython
import math_numba
l = [i for i in range(1_000_000)]
a = np.array([i for i in range(1_000_000)], dtype=np.int64)
v = fastvector.VectorND([i for i in range(1_000_000)])
NUM_ROUNDS = 200
NUM_ITERATIONS = 10
# def test_... | 21.472222 | 60 | 0.628072 |
4f8bbd0c48083d169c4de4f0253266b347226bcd | 626 | pyde | Python | sketches/riley01/riley01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/riley01/riley01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/riley01/riley01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from random import choice
riley_pal = [color(4, 21, 31),
color(1, 155, 183), color(1, 155, 183),
color(226, 107, 67), color(226, 107, 67),
color(60, 76, 97),
color(144, 166, 215), color(144, 166, 215),
color(240, 192, 68), color(240, 192, 68),
... | 26.083333 | 56 | 0.51278 |
8cd6613e58834d3caae92fb3ff805e639b598f73 | 4,982 | py | Python | bigbench/benchmark_tasks/word_problems_on_sets_and_graphs/acquaintances.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 460 | 2021-01-26T21:23:37.000Z | 2022-03-31T15:55:10.000Z | bigbench/benchmark_tasks/word_problems_on_sets_and_graphs/acquaintances.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 475 | 2021-01-27T01:29:01.000Z | 2022-03-30T20:23:56.000Z | bigbench/benchmark_tasks/word_problems_on_sets_and_graphs/acquaintances.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | 305 | 2021-01-26T23:28:11.000Z | 2022-03-31T14:51:26.000Z | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 39.228346 | 185 | 0.559615 |
0fc9ad20eddfebdcabef01dfe53e03e896859bb0 | 1,811 | py | Python | source/pkgsrc/lang/python37/patches/patch-Lib_test_test__time.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python37/patches/patch-Lib_test_test__time.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python37/patches/patch-Lib_test_test__time.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_test_test__time.py,v 1.1 2020/11/17 19:33:26 sjmulder Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
--- Lib/test/test_time.py.orig 2020-08-15 05:20:16.000000000 +0000
+++ Lib/test/test_time.py
@@ -1052,6 +1052,36 @@ class Te... | 40.244444 | 86 | 0.657648 |
e842c065acd7239ef0751431f6ea3f970190df43 | 8,615 | py | Python | 0-notes/job-search/SamplesDSAlgos/search/search_depth_breadth_first.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/search/search_depth_breadth_first.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/search/search_depth_breadth_first.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import sys
sys.path.append('../queue_and_stack')
from dll_queue import Queue
from dll_stack import Stack
# A traversal is completed when every node has been explored.
# A search is completed when the search target is found.
# DEPTH & BREADTH FIRST SEARCHES
# Depth First: Algorithm explores as far as possible along... | 36.046025 | 105 | 0.622519 |
fa6602706e946177031fb542dd29679dfc31812b | 455 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_0/new_address_template.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/v4_0/new_address_template.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_0/new_address_template.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import print_function, unicode_literals
import frappe
def execute():
frappe.reload_doc("utilities", "doctype", "address_template")
if not frappe.db.sql("select name from `tabAddress Template`"):
try:
d = frappe.new_doc("Address Template")
d.update({"country":frappe.db.get_default("country") o... | 30.333333 | 74 | 0.727473 |
0ea09c87973c49ee033f867f7b53071e47ea6a5b | 234 | py | Python | pacman-arch/test/pacman/tests/remove031.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/remove031.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/remove031.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Remove a package in HoldPkg"
p1 = pmpkg("foopkg")
self.addpkg2db("local", p1)
self.option["HoldPkg"] = ["???pkg"]
self.args = "-R %s" % p1.name
self.addrule("PACMAN_RETCODE=1")
self.addrule("PKG_EXIST=foopkg")
| 19.5 | 48 | 0.679487 |
7ebed4984cafba6a6cb7aac2910b0437defb9c83 | 3,213 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/test_utm_utils.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/test_utm_utils.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/test_utm_utils.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 51.822581 | 115 | 0.716464 |
69755340401c97ce6c4f611ac9e35f143df98d64 | 148 | py | Python | ue3/B13.py | DanielHerold/numdiff | b46d2db47ddd3f85e15c4e2a0bbb018110094a79 | [
"MIT"
] | null | null | null | ue3/B13.py | DanielHerold/numdiff | b46d2db47ddd3f85e15c4e2a0bbb018110094a79 | [
"MIT"
] | null | null | null | ue3/B13.py | DanielHerold/numdiff | b46d2db47ddd3f85e15c4e2a0bbb018110094a79 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
values = np.loadtxt('B13.out')
time=values[:,0]
y = values[:,1]
plt.plot(time, y)
plt.show()
| 12.333333 | 31 | 0.682432 |
2a5b6be0ee9777215166ad6e7fc4c87746792eea | 224 | py | Python | Tutorials/10 Days of Statistics/Day 1/standard_deviation.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Tutorials/10 Days of Statistics/Day 1/standard_deviation.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/10 Days of Statistics/Day 1/standard_deviation.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
import math
n = int(input().strip())
arr = [int(arr_i) for arr_i in input().strip().split(' ')]
mean = sum(arr)/n
std = math.sqrt(sum([math.pow((arr_i-mean), 2) for arr_i in arr])/n)
print(std)
| 17.230769 | 68 | 0.638393 |
aab362b66a5a871ff1718b286b591eaccce75fe6 | 2,011 | py | Python | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section5FileHandling/36ReadingExcelSheets.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 1 | 2022-02-02T21:56:08.000Z | 2022-02-02T21:56:08.000Z | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section5FileHandling/36ReadingExcelSheets.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 27 | 2020-06-27T23:25:59.000Z | 2022-02-27T20:40:56.000Z | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section5FileHandling/36ReadingExcelSheets.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | # Started. Come back to finish.
# NOTE: downloaded the original.xlsx file from course site for this file.
import pandas as pd # A popular module for data analysis. NOTE: to install type 'pip install pandas' in Terminal. It was already on my machine so I dind't install it.
# NOTE: for this file we also need the 'xlrd... | 52.921053 | 207 | 0.671805 |
aad06921f98e1d8ceb9950ecd86dcf720538b95c | 355 | py | Python | app/database-maker/src/utils.py | shimech/hit-and-blow | 7fd7d7077ca286b5dfaea333b68514f824a42c8e | [
"MIT"
] | 1 | 2020-06-25T17:07:36.000Z | 2020-06-25T17:07:36.000Z | app/database-maker/src/utils.py | shimech/hit-and-blow | 7fd7d7077ca286b5dfaea333b68514f824a42c8e | [
"MIT"
] | 1 | 2020-04-02T11:19:10.000Z | 2020-04-02T11:19:10.000Z | app/database-maker/src/utils.py | shimech/hit-and-blow | 7fd7d7077ca286b5dfaea333b68514f824a42c8e | [
"MIT"
] | null | null | null | import os
class Utils:
@staticmethod
def make_dir(base_dir, dir_name):
dir_path = os.path.join(base_dir, dir_name)
if os.path.isdir(dir_path):
print("PATH: {} はすでに存在します。".format(dir_path))
else:
os.makedirs(dir_path)
print("PATH: {} を作成しました。".format(... | 25.357143 | 57 | 0.591549 |
2d63e113730ed1e89c7131cdd712c36870e5609a | 13,656 | py | Python | ENV/tensorforce-master/mazerunner/world.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ENV/tensorforce-master/mazerunner/world.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ENV/tensorforce-master/mazerunner/world.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | 1 | 2019-11-29T12:28:33.000Z | 2019-11-29T12:28:33.000Z | import logging
logging.basicConfig()
import math
from random import randint
import pyglet
import cocos
import cocos.euclid as eu
import cocos.mapcolliders as mc
import cocos.tiles as ti
from cocos import draw
import config
from player import Player
from generator import Generator
from score import ScoreLayer
from w... | 33.388753 | 119 | 0.573448 |
359243490134b8997b34aec6ce02838c7dc97b5d | 642 | py | Python | ExchangeKey.py | gamegrd/YY | 39fca68d11956508fdbc094c9c319b7a7082722f | [
"Apache-2.0"
] | 9 | 2016-10-17T04:57:47.000Z | 2021-03-08T15:50:03.000Z | ExchangeKey.py | SkyblueMr/YY | 39fca68d11956508fdbc094c9c319b7a7082722f | [
"Apache-2.0"
] | 1 | 2017-10-13T09:27:34.000Z | 2017-10-13T09:27:34.000Z | ExchangeKey.py | SkyblueMr/YY | 39fca68d11956508fdbc094c9c319b7a7082722f | [
"Apache-2.0"
] | 6 | 2017-06-07T01:27:42.000Z | 2020-02-10T04:08:51.000Z | import ExchangeKey_pb2
import hexdump
import binascii
import rsa
h = ExchangeKey_pb2.ExchangeKey()
(pub_key, pri_key) = rsa.newkeys(512, 3)
h.cmd = 0x1
req = ExchangeKey_pb2.ExchangeKeyReq()
h.req.f1 = chr(0x01) + chr(0x00) + chr(0x01)
rsa_key = rsa.transform.int2bytes(pub_key.n)
reversed(rsa_key)
h.req.rsa_key = ch... | 26.75 | 168 | 0.813084 |
57d4de19d2cb9bde860931ee79505f8b279d07ee | 85 | py | Python | ALBERT/dataset/utils/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | ALBERT/dataset/utils/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | ALBERT/dataset/utils/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 训练时数据加载的配置文件
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/30
""" | 17 | 23 | 0.658824 |
aa2e5e5705031f921afe92c4a6c5164c3b35fa0a | 1,274 | py | Python | token_.py | Peetee06/compilerbau_ws2122_hsbochum | 9b71e33f7385ba946ce7f4d375b7ca68b21dd97f | [
"MIT"
] | null | null | null | token_.py | Peetee06/compilerbau_ws2122_hsbochum | 9b71e33f7385ba946ce7f4d375b7ca68b21dd97f | [
"MIT"
] | null | null | null | token_.py | Peetee06/compilerbau_ws2122_hsbochum | 9b71e33f7385ba946ce7f4d375b7ca68b21dd97f | [
"MIT"
] | 2 | 2022-03-13T18:48:24.000Z | 2022-03-20T16:45:19.000Z | """
Parentclass Token
Compilerbau
Constants for Nodetypes of a Syntaxtree
"""
class Token(object):
TOKEN_TYPES = [
"INT",
"FLOAT",
"STRING",
"IDENTIFIER",
"KEYWORD",
"ADD", # +
"SUB", # -
"MUL", # *
"DIV", # /
"ASSIGN", # =
... | 20.885246 | 71 | 0.459969 |
a4c5b5efc56f2f32028e26c82d08453807f4d0c5 | 849 | py | Python | test.py | raswz/wifionice | 67f1fa7a6b396afe7a447a4d10adbc64dcbcdd4f | [
"CC-BY-4.0"
] | null | null | null | test.py | raswz/wifionice | 67f1fa7a6b396afe7a447a4d10adbc64dcbcdd4f | [
"CC-BY-4.0"
] | null | null | null | test.py | raswz/wifionice | 67f1fa7a6b396afe7a447a4d10adbc64dcbcdd4f | [
"CC-BY-4.0"
] | null | null | null | import pandas as pd
import numpy as np
import datetime
data = pd.read_csv(r'c:\Users\Ronja\Documents\GitHub\wifionice\wifionice.csv', sep=';', low_memory=False) #Importiert die wifionice.csv-Datei
data['created'] = pd.to_datetime(data['created'].str.strip(), format='%Y-%m-%d %H:%M:%S')
#data['link_gw_conn'] = data.re... | 53.0625 | 141 | 0.746761 |
eae5990a7aa9bdfdefc12aba86503966ca97dfbb | 1,171 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch08_binary_trees/ex08_reconstruction_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch08_binary_trees/ex08_reconstruction_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch08_binary_trees/ex08_reconstruction_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch08_binary_trees.solutions.ex05_levelorder import levelorder
from ch08_binary_trees.solutions.ex08_reconstruct import reconstruct, reconstruct_clearer
def test_reconstruct_from_list():
inputs = [1, 2, 3, 4... | 30.815789 | 89 | 0.608027 |
f4a417413e6ca08a927e3f387012adf853eaa410 | 2,626 | py | Python | crawl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | crawl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | crawl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # -*- coding: utf-8 -*-
# @Author: lock
# @Date: 2017-12-15 18:23:22
# @Last Modified by: lock
# @Last Modified time: 2017-12-16 00:47:42
import requests
from lxml import html
import sys
import urlparse
import collections
import time
from PIL import Image
import os
import random
URL = "https://www.xxx.top" ... | 23.657658 | 149 | 0.664128 |
5213abd7f2096686aa36657ec21f60b97e90dafb | 10,323 | py | Python | research/cv/AVA_cifar/src/autoaugment.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/AVA_cifar/src/autoaugment.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/AVA_cifar/src/autoaugment.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.802372 | 130 | 0.578901 |
5219adf5e191745db2d183f0809dd018db86f364 | 285 | py | Python | volley/serializers/__init__.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | volley/serializers/__init__.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | volley/serializers/__init__.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | from volley.serializers.json_serializer import JsonSerialization
from volley.serializers.msgpack_serializer import MsgPackSerialization
from volley.serializers.orjson_serializer import OrJsonSerialization
__all__ = ["JsonSerialization", "MsgPackSerialization", "OrJsonSerialization"]
| 47.5 | 78 | 0.877193 |
876cb7c52eca6b80759b5db84d0d4762192320ff | 17,496 | py | Python | official/cv/vit/src/vit.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/vit/src/vit.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/vit/src/vit.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.508876 | 117 | 0.610082 |
5e5173b54182288441a720ed41a35d05fbae12a7 | 571 | py | Python | pacman-arch/test/pacman/tests/upgrade006.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/upgrade006.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/upgrade006.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Upgrade a package with several files"
lp = pmpkg("dummy")
lp.files = ["usr/share/file_%d" % n for n in range(250, 750)]
self.addpkg2db("local", lp)
p = pmpkg("dummy", "1.1-1")
p.files = ["usr/share/file_%d" % n for n in range(600, 1000)]
self.addpkg(p)
self.args = "-U %s" % p.filename()
self.add... | 30.052632 | 61 | 0.707531 |
0dd9bc266218a1a42e5c429ed4f8990973d4a21d | 2,802 | py | Python | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0001_initial.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0001_initial.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0001_initial.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | # Generated by Django 2.0.5 on 2018-10-04 23:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Action',
fields=[
... | 40.608696 | 118 | 0.571734 |
2198a50c2ff6091ea25384ed31ba22e481a9f21e | 596 | py | Python | src/utils.py | Cxmu03/IServ-Scraper | 8f6ae2a8568851f915565f445d64a2f740b73b75 | [
"MIT"
] | 6 | 2021-08-31T16:47:27.000Z | 2022-01-24T14:46:48.000Z | src/utils.py | Cxmu03/IServ-Scraper | 8f6ae2a8568851f915565f445d64a2f740b73b75 | [
"MIT"
] | 1 | 2022-01-24T14:48:18.000Z | 2022-01-24T14:48:18.000Z | src/utils.py | Cxmu03/IServ-Scraper | 8f6ae2a8568851f915565f445d64a2f740b73b75 | [
"MIT"
] | null | null | null | import csv
import datetime
from typing import BinaryIO
FIELDNAMES = [
"Aufgabe",
"Lehrer",
"Startdatum",
"Enddatum",
"Link",
"Tags",
"Beschreibung",
"Bereitgestellte Dateien",
"Abgabetext",
"Abgabedateien",
"Rückmeldungstext",
"Rückmeldungsdateien",
]
def create_csv(fi... | 19.225806 | 74 | 0.669463 |
df16f6a9d061c95ba6ff4d664a9e518cf7dee513 | 1,732 | py | Python | authApp/models/user.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | null | null | null | authApp/models/user.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | 1 | 2022-01-05T23:52:37.000Z | 2022-01-05T23:52:37.000Z | authApp/models/user.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from django.contrib.auth.hashers import make_password
#DAO: Gestor del modelo
class UserManager(BaseUserManager):
def create_user(self, username, password=None):
if not... | 40.27907 | 91 | 0.691109 |
df336ec6b0b8a903dbeb51c00459bcefd9a8ffdf | 315 | py | Python | MazeSolving/Solver/MazeSolver.py | Thukor/MazeSolver | c953e193ce27a7348e8ec9c5592144426dfce193 | [
"MIT"
] | 5 | 2018-02-06T22:48:34.000Z | 2020-01-07T20:19:05.000Z | MazeSolving/Solver/MazeSolver.py | Thukor/MazeSolver | c953e193ce27a7348e8ec9c5592144426dfce193 | [
"MIT"
] | 11 | 2018-01-31T21:47:49.000Z | 2018-04-21T16:42:52.000Z | MazeSolving/Solver/MazeSolver.py | Thukor/MazeSolver | c953e193ce27a7348e8ec9c5592144426dfce193 | [
"MIT"
] | 2 | 2020-06-18T05:40:03.000Z | 2022-02-02T03:46:30.000Z | from PathFinder import *
from pathfinding_algorithms import *
class MazeSolver:
@staticmethod
def solve_maze(maze):
pf = PathFinder(nx_shortest_path)
start_end = sorted([node for node in maze.nodes() if node.is_possible_start])
heuristic = manhattan_distance
return pf.find_shortest_path(maze,*start_end) | 31.5 | 79 | 0.793651 |
d5a26ce129932912f8f67503cb33dbb6f9752d59 | 156 | py | Python | scripts/hello_world_EricBonham.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_EricBonham.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_EricBonham.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # LANGUAGE: Python
# ENV: Idle
# AUTHOR: Francesco d'Amato
# GITHUB: https://github.com/EricBonham
for i in str("hello world!"):
print(i, end='')
| 17.333333 | 39 | 0.641026 |
7f9b1f2bb7ead3b951334033e11928c93c49c5e3 | 704 | py | Python | src/python/py-stuff/nov-10/main.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-stuff/nov-10/main.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-stuff/nov-10/main.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | # libraries and data
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
# Dataset:
a = pd.DataFrame({ 'group' : np.repeat('A',500), 'value': np.random.normal(10, 5, 500) })
b = pd.DataFrame({ 'group' : np.repeat('B',500), 'value': np.random.normal(13, 1.2, 500) })
c ... | 41.411765 | 93 | 0.630682 |
f6db6b105ec720879bf962a4422d8aebaa9f7cae | 7,876 | py | Python | Fastir_Collector/_analyzemft/mftsession.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/_analyzemft/mftsession.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/_analyzemft/mftsession.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/env python
# Author: David Kovar [dkovar <at> gmail [dot] com]
# Name: analyzeMFT.py
#
# Copyright (c) 2010 David Kovar. All rights reserved.
# This software is distributed under the Common Public License 1.0
#
# Date: May 2013
#
import sys
import csv
import os
from optparse import OptionParser
import mft
f... | 38.79803 | 128 | 0.567801 |
1266e1ca0cfd7e5b6d9116fd2525c9e5234a8e05 | 1,872 | py | Python | p01/src/consumer-02.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/consumer-02.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/consumer-02.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pika
import asyncio
import time
async def firstWorker():
while True:
await asyncio.sleep(1)
print("First Worker Executed")
async def secondWorker():
while True:
await asyncio.sleep(5)
print("Second Worker Executed")
async def consumer01():
con... | 24 | 70 | 0.694979 |
f62c8281f0debbe37293badd756f406660a1a1fc | 4,046 | py | Python | manuf/test/test_manuf.py | extremenetworks/manuf | 905734f6d23bd49833dff40f89f62b366425232b | [
"Apache-2.0"
] | 3 | 2019-08-28T02:21:56.000Z | 2020-06-03T17:39:14.000Z | manuf/test/test_manuf.py | ahangchen/Rasp-Person-Sensor | 77d0e41b1a80cf9012f66c7bd44f062edbc6825d | [
"MIT"
] | 2 | 2020-07-09T20:43:27.000Z | 2020-07-29T05:50:27.000Z | manuf/test/test_manuf.py | ahangchen/Rasp-Person-Sensor | 77d0e41b1a80cf9012f66c7bd44f062edbc6825d | [
"MIT"
] | 3 | 2020-04-27T15:50:18.000Z | 2020-05-06T08:57:41.000Z | import manuf
import os
import unittest
class ManufTestCase(unittest.TestCase):
MANUF_URL = "https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=manuf"
def setUp(self):
self.manuf = manuf.MacParser(manuf_name="manuf")
#
def test_update_update(self):
self.manuf.update... | 40.868687 | 95 | 0.638655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.