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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64f56c2fadd5b5a0bb222f08cee45b10093ec480 | 1,127 | py | Python | webinterface/management/commands/send_database_backup.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/management/commands/send_database_backup.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/management/commands/send_database_backup.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, CommandError
from django.core.mail import EmailMessage
from cleansys.settings import ADMINS, DATABASES
class Command(BaseCommand):
help = 'Sends the database db.sqlite3 by email to the ADMINs mentioned in settings.'
def handle(self, *args, **options):
... | 40.25 | 105 | 0.609583 |
8f3001169daebda36a814fcb8db0bed8ecabae82 | 470 | py | Python | python/en/_packages/csv/1.Reading_CSV_files_in_Python.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/csv/1.Reading_CSV_files_in_Python.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/csv/1.Reading_CSV_files_in_Python.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # 1.Reading_CSV_files_in_Python.py
#
# https://pythonprogramming.net/reading-csv-files-python-3/
# Reading CSV files in Python
# reading_cvs_files_in_python-example.csv
# 1/2/2014,5,8,red
# 1/3/2014,5,2,green
# 1/4/2014,9,1,blue
import csv
with open('1.Reading_CSV_files_in_Python-example.csv') as csvfile... | 24.736842 | 67 | 0.710638 |
f124e5ebcb7908fd17b098d8430dd45f5e67b01c | 3,507 | py | Python | transonic/analyses/justintime.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/analyses/justintime.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/analyses/justintime.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """Analyses for ``@jit``
========================
"""
from transonic.analyses import extast
from transonic.analyses import compute_ancestors_chains, get_decorated_dicts
from transonic.analyses.capturex import CaptureX
from transonic.log import logger
from transonic.analyses.util import get_exterior_code
def analys... | 27.833333 | 82 | 0.637582 |
f1424de9f1870574d9eb9f8397e475c89b4960ca | 3,548 | py | Python | python/en/_pandas/Pandas for Everyone/p4e-8_4_more_string_methods.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_pandas/Pandas for Everyone/p4e-8_4_more_string_methods.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_pandas/Pandas for Everyone/p4e-8_4_more_string_methods.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
p4e-8_4_more_string_methods.py
pandas_for_everyone
8. Strings and Text Data
8.1. Introduction
8.2. Strings
8.2.1. Subsetting and Slicing Strings
8.2.1.1. Single Letter
8.2.1.2. Slicing Multiple Letters
8.2.1.3. Negative Numbers
... | 29.081967 | 82 | 0.583709 |
74ad6c1b82fb8889abcc8d5ff9cc97ecbb698c6d | 7,203 | py | Python | Utils/py/MotionAnalysis/temperature_contribution.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/MotionAnalysis/temperature_contribution.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/MotionAnalysis/temperature_contribution.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import BehaviorParseTest
from matplotlib import pyplot
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
JointID = {
"HeadPitch": 0,
"HeadYaw": 1,
"RShoulderRoll": 2,
"LShoulderRoll": 3,
"RShoulderPitch": 4,
"LShoulderPitch": 5,
"RElbowRoll": 6,
"LElbowRoll": 7,
"RElbowYaw": 8,
"LElbowYaw... | 30.138075 | 110 | 0.612245 |
77d5e01eef1051ab6db7eb94ce4459a3c713ec3f | 815 | py | Python | infrastructure/kctf/samples/xss-bot/healthcheck/files/healthz.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | null | null | null | infrastructure/kctf/samples/xss-bot/healthcheck/files/healthz.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | null | null | null | infrastructure/kctf/samples/xss-bot/healthcheck/files/healthz.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import BaseHTTPServer
class HealthzHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
if self.path != '/healthz':
self.send_response(404)
self.send_header("Content-length", "0")
self.end_headers()
... | 29.107143 | 61 | 0.58773 |
7afa8967f2d6ae6201642103b8a5f817b37a0ee9 | 10,865 | py | Python | spider_django/django_app/views.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | spider_django/django_app/views.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | spider_django/django_app/views.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.views.decorators.http import require_http_methods
from django.core import serializers
from django.http import JsonResponse
from django.http.request import QueryDict
import json
from .models import TSpiderTask, TSpiderConf, TSpiderResult
# Create your views here.
@requi... | 32.050147 | 120 | 0.614082 |
3b4b13717e7d385986509bd88f3bd57d045eb7fe | 1,995 | py | Python | hrputils.py | banachtech/hrp | b3ce4f3f35973e808eaea8a1f8b42c98ac691364 | [
"MIT"
] | null | null | null | hrputils.py | banachtech/hrp | b3ce4f3f35973e808eaea8a1f8b42c98ac691364 | [
"MIT"
] | null | null | null | hrputils.py | banachtech/hrp | b3ce4f3f35973e808eaea8a1f8b42c98ac691364 | [
"MIT"
] | null | null | null | import pandas as pd, numpy as np
import scipy.cluster.hierarchy as sch
def getIVP(cov,**kargs):
# Compute the inverse-variance portfolio
ivp=1./np.diag(cov)
ivp/=ivp.sum()
return ivp
def getClusterVar(cov,cItems):
# Compute variance per cluster
cov_=cov[np.ix_(cItems,cItems)] # matr... | 36.272727 | 119 | 0.609524 |
3b81f76a8702529f5ddfb48e0d87cf1deb7eed32 | 1,456 | py | Python | server/parse_mvd.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | 1 | 2021-08-31T16:12:09.000Z | 2021-08-31T16:12:09.000Z | server/parse_mvd.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | null | null | null | server/parse_mvd.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | null | null | null | import io
import sys
import json
import operator
import functools
import pyparsing
from collections import defaultdict
from ifcopenshell import mvd
from ifcopenshell.mvd.mvdxml_expression import node as expression_node
flatten=lambda l: sum(map(flatten,l),[]) if isinstance(l,(list, pyparsing.ParseResults)) else [l]... | 29.12 | 136 | 0.65728 |
7965d3a2dd323c52bc4d44e79ef09859d596b35b | 728 | py | Python | books/PythonCleanCode/ch5_decorator/decorator_SoC_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch5_decorator/decorator_SoC_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch5_decorator/decorator_SoC_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 5: Decorators
> Separation of Concerns (SoC).
Break a coupled decorator into smaller ones.
"""
import functools
import time
from log import logger
def traced_function(function):
@functools.wraps(function)
def wrapped(*args, **kwargs):
logger.info("... | 23.483871 | 87 | 0.630495 |
79747c262583e7d683b78f2f88a224ecdcde1b74 | 260 | py | Python | src/nfz_module/processor/SensorDataProcessor.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/processor/SensorDataProcessor.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/processor/SensorDataProcessor.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod, abstractproperty
__author__ = 'Hans-Werner Roitzsch'
class SensorDataProcessor(metaclass=ABCMeta):
"""
Abstract Base Class: SensorDataProcessor
"""
@abstractmethod
def process_data(self, sensor_data):
return
| 18.571429 | 57 | 0.784615 |
799ed7928bb69f22f77e171424b155fd83c4dc76 | 905 | py | Python | tests/WordProviderTest.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | tests/WordProviderTest.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | tests/WordProviderTest.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import unittest
from measure.WordProvider import WordProvider
class WordProviderTest(unittest.TestCase):
def test(self):
wp = WordProvider()
wp.load("Hello World.")
self.assertEqual("Hello", wp.join(1))
self.assertEqual("Hello World.", wp.join(2))
self.assertEqual("Hello W... | 28.28125 | 61 | 0.542541 |
79d1e0ac300a7180c95571d3079f53dd62bc9cc7 | 335 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_23/update_stopped_status_to_closed.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/v6_23/update_stopped_status_to_closed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_23/update_stopped_status_to_closed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for dt in ("Sales Order", "Purchase Order"):
frappe.db.sql("update `tab{0}` set status='Closed' where status='Stoppe... | 37.222222 | 88 | 0.746269 |
a51bfc06387bf34158abecc17503392594acac6d | 2,485 | py | Python | python_experiments/data_analysis/indx_update/index_update_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/indx_update/index_update_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/indx_update/index_update_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import decimal
data_set_lst = [
"ca-GrQc",
"ca-HepTh",
"p2p-Gnutella06",
"wiki-Vote",
"email-Enron",
"email-EuAll",
"web-NotreDame",
"web-Stanford",
"web-BerkStan",
"web-Google",
"cit-Patents",
"soc-LiveJournal1",
"wiki-Link"
]
def format_str(float_num):
my_str... | 37.651515 | 128 | 0.62495 |
d6d5cbc2cf033404a5e66dde1c64185931c3189b | 5,307 | py | Python | python/oneflow/compatible/single_client/test/serving/test_resnet_save_and_load.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/serving/test_resnet_save_and_load.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/serving/test_resnet_save_and_load.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... | 37.907143 | 115 | 0.680045 |
031acaace03790152667174358084993d1101430 | 441 | py | Python | source/pkgsrc/math/py-scikit-learn/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/math/py-scikit-learn/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/math/py-scikit-learn/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2019/06/17 15:01:45 adam Exp $
Enable 'test' command.
--- setup.py.orig 2019-06-17 08:28:08.000000000 +0000
+++ setup.py
@@ -65,6 +65,7 @@ SETUPTOOLS_COMMANDS = {
'bdist_wininst', 'install_egg_info', 'build_sphinx',
'egg_info', 'easy_install', 'upload', 'bdist_wheel',
'--s... | 29.4 | 60 | 0.673469 |
0351a3223e1a0e8919cf5c9dd647d3ffad39f456 | 102 | py | Python | book/_build/jupyter_execute/docs/1005_Alkane_und_Alkanole_in_Natur_und_Technik.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | book/_build/jupyter_execute/docs/1005_Alkane_und_Alkanole_in_Natur_und_Technik.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | book/_build/jupyter_execute/docs/1005_Alkane_und_Alkanole_in_Natur_und_Technik.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # 1005_Alkane und Alkanole in Natur und Technik
#
# **12h**
| 14.571429 | 49 | 0.656863 |
cef1ec527e868ac623a17faeae67c10ffa495da0 | 975 | py | Python | site/public/courses/CS-1.2/Code/hashtable_class_example.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/Code/hashtable_class_example.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/Code/hashtable_class_example.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | from linkedlist import LinkedList
keyvalues = [("rose", 10), ("mums", 12), ("daisy", 5)]
#hash table
#array of linked lists
my_hashtable = [LinkedList(), LinkedList(), LinkedList()]
#hash function
def my_hash(key):
return len(key)
#figure out bucket ids
#rose #3
b... | 27.857143 | 58 | 0.647179 |
0672bd946ae6b08b84684f1fc54e3a52beae7f49 | 4,600 | py | Python | src/torch/utils/dumper.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | src/torch/utils/dumper.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | src/torch/utils/dumper.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# 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/licen... | 36.8 | 114 | 0.630652 |
ebf1eb30a8eb299e34133231c5e11ba59a808253 | 1,236 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/fpga.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/fpga.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/fpga.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# -*- codi... | 34.333333 | 111 | 0.63754 |
230f3d2a0728a3993d3ca5f923e2b451f6879dd3 | 1,597 | py | Python | CH341SER_LINUX/readpm.py | schaibo/wiringPi | dd22fed180dd96c937070c9da6cc57e0efbf531c | [
"Apache-2.0"
] | null | null | null | CH341SER_LINUX/readpm.py | schaibo/wiringPi | dd22fed180dd96c937070c9da6cc57e0efbf531c | [
"Apache-2.0"
] | null | null | null | CH341SER_LINUX/readpm.py | schaibo/wiringPi | dd22fed180dd96c937070c9da6cc57e0efbf531c | [
"Apache-2.0"
] | null | null | null | import time
import serial
import sys
import pymysql
import datetime
ser=serial.Serial('/dev/ttyUSB0',57600,parity=serial.PARITY_NONE)
def getdata():
try :
if ser.isOpen == False:
ser.open()
#ser.write(b"serial turn on")
print("serial turn on")
while True:
size = ser.inWaiting... | 24.953125 | 152 | 0.553538 |
ee5a598693a202875367f86ec76bc832007b9567 | 3,512 | py | Python | laposte.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | laposte.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | laposte.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*-coding:Latin-1 -*
import smtplib
import json
import subprocess
import re
import os
import os.path
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
import sys
import time
from time import gmtime, strftime
DEVICE_ARG = "VIDE"
Alarme_type_AR... | 21.679012 | 161 | 0.662585 |
ee5de4e0d93498cf96a7b37c34ddf9d125a82fc1 | 55,262 | py | Python | Multi-BF.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Multi-BF.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Multi-BF.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python2
#-*-coding:utf-8-*-
import requests,bs4,sys,os,subprocess,datetime
import requests,sys,random,time,re,base64,json
from multiprocessing.pool import ThreadPool
reload(sys)
sys.setdefaultencoding("utf-8")
""
# Recode Boleh Tapi Jangan Ubah
# Bot Komen Nya Faham Gk?
""
try:
import reque... | 36.645889 | 454 | 0.514802 |
ee67d9ab43b8999ea1408075d85f58a80561191c | 1,768 | py | Python | ex6.py | verdantred/hatere | d0ab01e90d92f69504c8dce01910787a5b9aa13a | [
"BSD-2-Clause"
] | null | null | null | ex6.py | verdantred/hatere | d0ab01e90d92f69504c8dce01910787a5b9aa13a | [
"BSD-2-Clause"
] | null | null | null | ex6.py | verdantred/hatere | d0ab01e90d92f69504c8dce01910787a5b9aa13a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 17 11:15:21 2017
@author: wwnii
SGN-41007 Pattern Recognition and Machine Learning
Exercise Set 6
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import image
from sklearn.datasets import load_files
from skimage.feature import local_binary_pa... | 28.516129 | 107 | 0.63009 |
eee89fce96bdc2d0dec9342dfca3321471ca2723 | 481 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_2/recalculate_bom_cost.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_2/recalculate_bom_cost.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/recalculate_bom_cost.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # 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
def execute():
for d in frappe.db.sql("select name from `tabBOM` where docstatus < 2"):
try:
document = frappe.get_doc('BOM', d[0])... | 28.294118 | 73 | 0.733888 |
6d6916ac2e986c2133e2e9af56b3db06bfa3f45d | 787 | py | Python | main.py | SouthWind017/StockTrend | e9e8441de9e41e8ef67798b63a805ff7d2e0c662 | [
"Apache-2.0"
] | 1 | 2021-03-27T07:39:19.000Z | 2021-03-27T07:39:19.000Z | main.py | SouthWind017/StockTrend | e9e8441de9e41e8ef67798b63a805ff7d2e0c662 | [
"Apache-2.0"
] | null | null | null | main.py | SouthWind017/StockTrend | e9e8441de9e41e8ef67798b63a805ff7d2e0c662 | [
"Apache-2.0"
] | 1 | 2021-10-30T06:30:08.000Z | 2021-10-30T06:30:08.000Z | import tushare as ts
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.api import *
pro = ts.pro_api('填自己的token')#https://tushare.pro/ 注册账号填自己的token
data = pro.daily(ts_code='600848.SH', start_date='20180101', end_date='20210327')#ts_code是股票代码 start_date是开始时间 end_date结束时间
#如果要预测btc之类的虚拟... | 30.269231 | 125 | 0.693774 |
6d7e72bf8e702724bf8a5cb4f053f83c6788f757 | 4,990 | py | Python | Packs/PaloAltoNetworks_IoT/Scripts/iot_get_raci/iot_get_raci.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_get_raci/iot_get_raci.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_get_raci/iot_get_raci.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import re
import demistomock as demisto
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import]
def get_iot_config(iot_config_list_name="IOT_CONFIG"):
iot_config = demisto.executeCommand("getList", {"listN... | 33.266667 | 98 | 0.508216 |
6dd448102bc812dac5c794c285532638a36c4df8 | 4,324 | py | Python | src/graph_creator/create_graphs.py | marina8888/flame-dilution-method | 823c004f7f7ea85ca3e010610b61972a112cf988 | [
"MIT"
] | 2 | 2020-03-23T15:05:19.000Z | 2020-03-24T02:43:07.000Z | src/graph_creator/create_graphs.py | marina8888/flame-dilution-method | 823c004f7f7ea85ca3e010610b61972a112cf988 | [
"MIT"
] | 1 | 2020-05-07T13:06:09.000Z | 2020-05-07T13:06:09.000Z | src/graph_creator/create_graphs.py | marina8888/flame-dilution-method | 823c004f7f7ea85ca3e010610b61972a112cf988 | [
"MIT"
] | 2 | 2020-05-07T13:05:09.000Z | 2020-05-15T16:42:02.000Z | from graph_creator import graph_funcs
import matplotlib.pyplot as plt
from excel_file.classes import Workbook, BigWorkbook
def plot_by_legend(gas_list: list, instance_list: [Workbook], final_part_title: str, colour_list: list= None, legend:str=None, legend_list: list = None):
if len(colour_list) != len(legend_list... | 61.771429 | 153 | 0.690564 |
1156739c085060569b8a9c464a6d7c9f2ca5f8c1 | 7,227 | py | Python | T1/07_robotic_drawing_exercise/robotic_drawing/utils.py | tetov/MAS-1920 | e5cfe4afbc7c0e80c6adfd139624d028c0ca4bfb | [
"MIT"
] | 3 | 2019-09-15T17:40:35.000Z | 2020-11-07T01:47:29.000Z | T1/07_robotic_drawing_exercise/robotic_drawing/utils.py | tetov/MAS-1920 | e5cfe4afbc7c0e80c6adfd139624d028c0ca4bfb | [
"MIT"
] | 1 | 2019-09-17T22:59:19.000Z | 2019-09-17T22:59:19.000Z | T1/07_robotic_drawing_exercise/robotic_drawing/utils.py | MAS-dfab/MAS-1920 | 93abb09b072b9a061496bc8a30bdce481a8735c5 | [
"MIT"
] | 8 | 2019-09-16T18:47:20.000Z | 2019-10-15T17:08:08.000Z | """
This module contains utility functions:
1) Transformation functions
2) Useful geometry functions e.g. Intersections
"""
import Rhino.Geometry as rg
import math
# ----- Coordinate System conversions -----
def rhino_to_robotbase(ref_plane, model_base):
"""
Function that transforms a reference plane... | 30.493671 | 181 | 0.56026 |
3a0467b6b8793348b69ff46ef92e345d38d96208 | 1,321 | py | Python | src/test/tests/hybrid/curve_expressions.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/curve_expressions.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/hybrid/curve_expressions.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: curve_expressions.py
#
# Programmer: Kathleen Bonnell
# Date: November 18, 2008
#
# Modifications:
#
# ----------------------------------------------------------------------------
def TurnOffCu... | 26.42 | 78 | 0.557911 |
e9408900d05dde023ecbb6b4109029a9f7572b7c | 746 | py | Python | leetcode/086-Partition-List/PartitionList_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-12-29T03:26:39.000Z | 2016-12-29T03:26:39.000Z | leetcode/086-Partition-List/PartitionList_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/086-Partition-List/PartitionList_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # @author: cchen
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param {ListNode} head
# @param {integer} x
# @return {ListNode}
def partition(self, head, x):
if head == None or head.next =... | 22.606061 | 45 | 0.47319 |
42fcd7208fb722191853fc5edee94c61a588e450 | 20,863 | py | Python | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
from datetime import datetime, timedelta
from CommonServerPython import *
import requests
import traceback
from typing import Dict, Any
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 format with UTC, defa... | 44.014768 | 120 | 0.706897 |
6e272455e63c0900dbb6f17ef6c449479e1817f9 | 257 | py | Python | Recursion/PermutationsInString.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Recursion/PermutationsInString.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Recursion/PermutationsInString.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | """
https://leetcode.com/problems/permutation-in-string/
Given two strings s1 and s2, write a function to return true if s2 contains the
permutation of s1. In other words, one
of the first string's permutations is the substring of the second string.
"""
| 32.125 | 80 | 0.762646 |
6e4480d4efe7549625b45943e5435e26272bf80c | 852 | py | Python | nffb/settings.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/settings.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/settings.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django settings for nffb project.
"""
from django.utils.translation import ugettext_lazy as _
from cms_site.settings import *
# Application definition
INSTALLED_APPS = [
'nffb',
] + INSTALLED_APPS + [
'cmsplugin_container',
'cmsplugin_iframe2',
]
CMS_TEMPLATES = [
('defau... | 18.521739 | 55 | 0.666667 |
2847019ccaf81bb41fed7fe1e141568b4d445d05 | 177 | py | Python | .venv/Lib/site-packages/dexpy/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 21 | 2016-10-19T18:13:03.000Z | 2021-11-02T13:58:31.000Z | .venv/Lib/site-packages/dexpy/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 43 | 2016-10-11T20:56:28.000Z | 2020-08-20T16:39:38.000Z | .venv/Lib/site-packages/dexpy/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | """dexpy
A python package for Design of Experiments (DOE).
"""
__all__ = [ "alias", "ccd", "cox_effects", "design", "effects",
"factorial", "power", "samplers" ]
| 19.666667 | 63 | 0.59322 |
289966e6f26dd4b1f0cc5c0ea80a2d65bc8f6eb5 | 675 | py | Python | Encypt-main/enc.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Encypt-main/enc.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Encypt-main/enc.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python2
#code open source
#buat belajar
#Di buat tanggal : 19 September 2021 22.00
#Github : https://github.com/Aldo098
#Youtube : Mr.1557
#link yt : https://youtube.com/channel/UC7ygjAbDjuiN76PqOlJm40A
#modul
import marshal, zlib, base64, os, sys
try:
r = sys.argv[1]
except:
exit('Usage: py2 enc... | 21.09375 | 97 | 0.691852 |
9564184343bcf238db14421072c8131b31aae0fd | 1,025 | py | Python | genutil/lists_dicts.py | MZH-bust/genutil | f17190ec484d5844f8950908cc07556a5b1429e7 | [
"MIT"
] | null | null | null | genutil/lists_dicts.py | MZH-bust/genutil | f17190ec484d5844f8950908cc07556a5b1429e7 | [
"MIT"
] | null | null | null | genutil/lists_dicts.py | MZH-bust/genutil | f17190ec484d5844f8950908cc07556a5b1429e7 | [
"MIT"
] | null | null | null | """Dieses Modul stellt grundlegende Funktionen zur Arbeit mit Listen und Dictionaries zur Verfügung. """
import re
from genutil import datatypes
def sort_alphanumeric(list_of_strings: list) -> list:
"""Sortiert eine Liste alphanumerisch sinnvoll.
Examples
--------
>>> sort_alphanumeric(["1", "10", "... | 26.973684 | 104 | 0.650732 |
66d589005634abccfae598ebdc8434528b0816fb | 476 | py | Python | showcase10/com/aaron/subprocess_example.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase10/com/aaron/subprocess_example.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase10/com/aaron/subprocess_example.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- codiing:utf-8 -*-
"""
subprocess use example
"""
__author__="aaron.qiu"
import subprocess
if __name__=='__main__':
print('$ nslookup')
p = subprocess.Popen(['nslookup'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = p.communicate(b'set q=mx\npython.org\nexit\n'... | 23.8 | 109 | 0.663866 |
9fcfce9a7825583d1d200f4476ffe09bb87e37ae | 1,437 | py | Python | skimind/kernel/pdfManag/tools.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/pdfManag/tools.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/pdfManag/tools.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | # regular expression module
import re
# config
from . import config
# pdf
import PyPDF2
def is_matchs_datas(tablist):
"""
Verifie si une liste contient les donnees de pari
"""
try:
date = tablist[1]
date_list = re.findall("\d\d[-/]\d\d[-/]\d{2,4}",date)
... | 20.239437 | 95 | 0.585247 |
c681cdf7a274895d51de1d726b3d173d6fea8ef4 | 885 | py | Python | app.py | Saketspradhan/Flask-App-CMP | 071f4827e82c8189cb9fc234b112e80b25668899 | [
"MIT"
] | null | null | null | app.py | Saketspradhan/Flask-App-CMP | 071f4827e82c8189cb9fc234b112e80b25668899 | [
"MIT"
] | null | null | null | app.py | Saketspradhan/Flask-App-CMP | 071f4827e82c8189cb9fc234b112e80b25668899 | [
"MIT"
] | null | null | null | import re
import requests
from bs4 import BeautifulSoup
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/fetchCurrentPrice/<string:stock_name>")
def fetchCurrentPrice(stock_name):
stock_name = str(stock_name)
stock_name.replace(" ", "+")
URL = "https://www.google.com/sear... | 31.607143 | 153 | 0.637288 |
af669b1534c5d17bba757efe51791336ea2fe2b8 | 314 | py | Python | PYTHON/Collections/word_order.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Collections/word_order.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Collections/word_order.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from collections import OrderedDict
if __name__ == '__main__':
N = int(input())
d = OrderedDict()
for _ in range(N):
text = input()
d[text] = d.get(text, 0) + 1
print(len(d))
for val, key in d.items():
print(key, end=' ')
print()
| 19.625 | 36 | 0.55414 |
bbeb617d9f55c75dd0e09dd4e1557b64746e6794 | 9,247 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_powerport.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_powerport.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_powerport.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 36.262745 | 133 | 0.469774 |
b1f8b047fd9befd96c9cdc3371bd8a1df2b7bcd1 | 2,077 | py | Python | ggit_platform/forms.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | 1 | 2019-02-27T21:20:54.000Z | 2019-02-27T21:20:54.000Z | ggit_platform/forms.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | ggit_platform/forms.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | from django import forms
from .models import Event
from .models import Member
from .models import Region
from .models import Story
from .models import Track
class TrackForm(forms.ModelForm):
class Meta:
model = Track
fields = '__all__'
widgets = {
'icon': forms.DateInput(attrs... | 32.968254 | 95 | 0.617236 |
ab822ce18f34a6abbda80fad017960f8906a6972 | 2,850 | py | Python | scripts/get_results.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | scripts/get_results.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | scripts/get_results.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | #!/usr/bin/env python3
# from imwievaluation.surveyxml import SurveyXML
#
# sx = SurveyXML('../imwievaluation/tests/testfiles/survey.xml')
# structure = sx.get_survey_structure()
#
# for group in structure:
# print(group['group_name'])
# for question in group['questions']:
# print('\t %s' % question['qu... | 35.625 | 78 | 0.675088 |
5531e05f4e0fe9bb051407c7865f003615e80192 | 16,489 | py | Python | external/argh/assembling.py | richardseifert/Hydra_pipeline | a31d782219359bae7fa82fa9b081fb72bef69fce | [
"MIT"
] | 1 | 2017-11-04T15:08:42.000Z | 2017-11-04T15:08:42.000Z | pythonlib/argh/assembling.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2018-11-05T17:28:58.000Z | 2018-11-05T18:20:00.000Z | external/argh/assembling.py | richardseifert/Hydra_pipeline | a31d782219359bae7fa82fa9b081fb72bef69fce | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Copyright © 2010—2014 Andrey Mikhaylenko and contributors
#
# This file is part of Argh.
#
# Argh is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README.rst for copying conditions.
#
"""
Asse... | 37.475 | 83 | 0.616229 |
555483267bfc20ef969a707b2a5f85ccf70bf4cc | 238 | py | Python | models/qual_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/qual_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/qual_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | 3 | 2017-09-11T08:02:11.000Z | 2020-04-04T08:13:23.000Z | # -*- coding: utf-8 -*-
from openerp import api, exceptions, fields, models, _
class QualType(models.Model):
_name = 'qual.type'
name = fields.Char(string='Description')
code = fields.Char(string=u'Code diplôme', size=16)
| 21.636364 | 55 | 0.668067 |
f9d317fec8895c8dfb5ae06508e29374538d894f | 1,035 | py | Python | 6_kombinationen/loopIfElse/KreisQuadrat.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 6_kombinationen/loopIfElse/KreisQuadrat.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 6_kombinationen/loopIfElse/KreisQuadrat.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
If-Else: Kreis oder Quadrat?
"""
newPage(300, 300)
diameter = 20
middle = height() / 2
step = int(width() / diameter)
for i in range(step):
if True:
oval(diameter * i, middle, diameter, diameter)
else:
print("False")
"""
Frage:
- Was geschieht nach if ...?
- Was geschieht ... | 25.243902 | 77 | 0.55942 |
1f9925a1b3a34dcb21f775dfc59f232a14f7bb5b | 24,115 | py | Python | tests/onegov/wtfs/test_layouts.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_layouts.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_layouts.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.user import User
from onegov.user import UserCollection
from onegov.wtfs.collections import MunicipalityCollection
from onegov.wtfs.collections import NotificationCollection
from onegov.wtfs.collections import PaymentTypeCollection
from onegov.wtfs.collections import ScanJobCollect... | 34.205674 | 78 | 0.690027 |
2f54fd45ad9353b00b89f75d7a68bbf280903f65 | 630 | py | Python | Packs/GetServerURL/Scripts/GetServerURL/GetServerURL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GetServerURL/Scripts/GetServerURL/GetServerURL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GetServerURL/Scripts/GetServerURL/GetServerURL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from urllib.parse import urlparse, ParseResult
def main():
urls = demisto.demistoUrls()
server_url = urls.get('server', '')
server_url_parts: ParseResult = urlparse(server_url)
host_name = server_url_parts.hostname
port = server_url_p... | 23.333333 | 73 | 0.679365 |
85e09c90b52869d83c49ad14f9ad4f8fe18f2bbb | 5,309 | py | Python | Python/tree/kdtree.py | li195111/Algorithm | 35df3c885b4ebec010c41eec4560bcd46d59588e | [
"MIT"
] | null | null | null | Python/tree/kdtree.py | li195111/Algorithm | 35df3c885b4ebec010c41eec4560bcd46d59588e | [
"MIT"
] | null | null | null | Python/tree/kdtree.py | li195111/Algorithm | 35df3c885b4ebec010c41eec4560bcd46d59588e | [
"MIT"
] | null | null | null | from models import SVG, Point
def distance_squared(point1, point2):
return (point1[0]-point2[0])**2+(point1[1]-point2[1])**2
def closest_point(all_points, new_point):
'''Time: O(n)
'''
best_point = None
best_dist = None
for cur_point in all_points:
cur_dist = distance_squared(new_point... | 38.471014 | 109 | 0.562441 |
c0d6f73e95bdfb842bb9288604404854360beac4 | 698 | py | Python | baccoapp/mysandwich/urls.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | baccoapp/mysandwich/urls.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | baccoapp/mysandwich/urls.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | from django.urls import path
from .views import SandwichListView
from .views import SandwichDetailView
from .views import add_sandwich
from .views import SearchResultsView
from .views import IngredientsListView
# from . import views
urlpatterns = [
# path('', views.index, name='index'),
# path('', create_sand... | 36.736842 | 79 | 0.727794 |
7b311bbe48e4919edbf9147fe519baf1910c983b | 1,533 | py | Python | AnswerMachine/handle_list.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | AnswerMachine/handle_list.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | AnswerMachine/handle_list.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | # pylint: disable=C0114
import Persistence.log as log
from .tweet import Tweet
from .react import process_commands, process_tweet
log_ = log.getLogger(__name__)
def filter_list(tweet_list):
results = {}
for api_tweet in tweet_list:
t = Tweet(api_tweet)
if t.id in results:
continue
... | 36.5 | 89 | 0.657534 |
9e61db262adc5c1ad862c865b4c7aa647860df9a | 37,486 | py | Python | webinterface/models.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/models.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/models.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from django.db import models
from django.core.exceptions import *
from django.db.models.query import QuerySet
from operator import itemgetter
import datetime
from django.contrib.auth.hashers import make_password
from django.utils.text import slugify
import logging
from logging.config import dictConfig
from django.contr... | 41.790412 | 120 | 0.669103 |
9eb8f81ec287da6bf07f04806db8d890928bd09d | 3,854 | py | Python | tests/test_fremdkostenblock.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_fremdkostenblock.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_fremdkostenblock.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.betrag import Betrag
from bo4e.com.fremdkostenblock import Fremdkostenblock, FremdkostenblockSchema
from bo4e.com.fremdkostenposition import Fremdkostenposition
from bo4e.com.preis import Preis
from bo4e.enum.mengeneinheit import Mengenein... | 41.44086 | 102 | 0.469901 |
c8abdfc5499feed2822249d9ea087a26d247796c | 1,278 | py | Python | 2016/day06_signals_and_noise/python/src/test_solutions.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day06_signals_and_noise/python/src/test_solutions.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day06_signals_and_noise/python/src/test_solutions.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | """Tests."""
from part1 import ErrorCorrector as ErrorCorrector1
from part2 import ErrorCorrector as ErrorCorrector2
class TestPart1UnitTests:
"""."""
def test_correct(self):
"""."""
test_input = [
"eedadn",
"drvtee",
"eandsr",
"raavrd",
... | 20.95082 | 51 | 0.407668 |
b5a6b251484eb86bc4ad553f3bce33df19d12d34 | 2,418 | py | Python | src/flocker/__init__.py | Muxelmann/home-projects | 85bd06873174b9c5c6276160988c19b460370db8 | [
"MIT"
] | null | null | null | src/flocker/__init__.py | Muxelmann/home-projects | 85bd06873174b9c5c6276160988c19b460370db8 | [
"MIT"
] | null | null | null | src/flocker/__init__.py | Muxelmann/home-projects | 85bd06873174b9c5c6276160988c19b460370db8 | [
"MIT"
] | null | null | null | import inspect
import os
import sys
import importlib
import jinja2
from flask import Flask, render_template
def create_app():
'''App creation factory'''
app = Flask(__name__, instance_relative_config=True)
app.secret_key = os.urandom(16)
if not os.path.exists(app.instance_path):
os.makedirs(ap... | 40.3 | 115 | 0.676179 |
a9432815cd325635ffc2604657fbf5362f4ae565 | 1,098 | py | Python | python_gui_tkinter/KALU/GARBAGE1/mail/mail_MailTemplate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE1/mail/mail_MailTemplate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE1/mail/mail_MailTemplate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | class MailTemplate():
template = """\
<html>
Sir,<br>
This is to inform you that we are
<i>finally arriving on 11/08/2018,</i>
we will be leaving here
<i>from 11:00 A.M.</i>
<p>
Another thing is,
<b> my friend Soumya Ray who will be accompanying me is not a member of the project, I am doing thi... | 29.675676 | 227 | 0.714026 |
572a172cf53141949af5e4c52544168c4fcf9aac | 4,817 | py | Python | Packs/CrowdStrikeFalconX/Integrations/CrowdStrikeFalconX/CrowdStrikeFalconX_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CrowdStrikeFalconX/Integrations/CrowdStrikeFalconX/CrowdStrikeFalconX_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CrowdStrikeFalconX/Integrations/CrowdStrikeFalconX/CrowdStrikeFalconX_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CrowdStrikeFalconX import Client,\
send_uploaded_file_to_sandbox_analysis_command, send_url_to_sandbox_analysis_command,\
get_full_report_command, get_report_summary_command, get_analysis_status_command,\
check_quota_status_command, find_sandbox_reports_command, find_submission_id_command
from TestsInp... | 36.218045 | 120 | 0.746315 |
e3772903ab5248de0ff26753a0dc02d3771b5890 | 395 | py | Python | tests/onegov/translator_directory/test_import.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/translator_directory/test_import.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/translator_directory/test_import.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null |
from onegov.translator_directory.cli import parse_language_field
def test_parsing_language_field():
text = 'A, B'
assert list(parse_language_field(text)) == ['A', 'B']
text = 'A,B'
assert list(parse_language_field(text)) == ['A', 'B']
text = "Lang (A, B), Lang (2),Lang3"
assert list(parse_l... | 24.6875 | 64 | 0.61519 |
7bd8002e3973853ffae1d13bb6547ab8bebf1c3e | 1,566 | py | Python | example/postgres_test.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | example/postgres_test.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | example/postgres_test.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | import psycopg2
from database import mydb as database
from constant import database_name
from constant import (password_vault_tab, authentication_tab)
from encrypt_tools import forge_secret_key, encrypt_vault, decrypt_vault
import pandas as pd
password_manager_db = database(database_name)
password_manager_db.connect... | 32.625 | 112 | 0.731162 |
ef4ff27c4b2499afc170a5f1de34c5d433c2c07a | 1,830 | py | Python | research/cv/Auto-DeepLab/src/utils/dynamic_lr.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Auto-DeepLab/src/utils/dynamic_lr.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Auto-DeepLab/src/utils/dynamic_lr.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.782609 | 117 | 0.67377 |
32647a48421e3ec4efaf37a50b806eb96187fcce | 1,095 | py | Python | pytestDemo/common/logger.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | pytestDemo/common/logger.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | pytestDemo/common/logger.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | import logging, time, os
BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# 定义日志文件路径
LOG_PATH = os.path.join(BASE_PATH, "log")
if not os.path.exists(LOG_PATH):
os.mkdir(LOG_PATH)
class Logger():
def __init__(self):
self.logname = os.path.join(LOG_PATH, "{}.log".format(time.st... | 31.285714 | 87 | 0.658447 |
08aa72e0cfb5d971e6bfa9565a1e8ba3a5089a8e | 2,525 | py | Python | storage/emulated/0/qpython/projects3/map/main.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/projects3/map/main.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/projects3/map/main.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | #-*-coding:utf8;-*-
"""
This is a sample for qpython webapp
"""
import os.path
from bottle import Bottle, ServerAdapter
from bottle import template,request,response,redirect,HTTPResponse
root = os.path.dirname(os.path.abspath(__file__))#获取当前路径
try:
import androidhelper
Droid = androidhelper.Android()
Droid... | 34.589041 | 246 | 0.67604 |
72448a6109ad616fef140f41fbcb181bb46b493c | 88 | py | Python | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/08.12-Anonymous-Functions-Lambda.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/08.12-Anonymous-Functions-Lambda.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/08.12-Anonymous-Functions-Lambda.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | sqr = lambda x: x * x
x = sqr(5)
print(x)
add = lambda a, b: a + b
print(add(1, 5))
| 8.8 | 24 | 0.522727 |
a085e79206c9cc96aac1b12dab034df7bae5520e | 851 | py | Python | pages/dashboard_pages.py | socialdistancingdashboard/frontend | aa102c20af09f18aea601573940e1fb8b94041a3 | [
"Apache-2.0"
] | 4 | 2020-03-31T09:05:26.000Z | 2020-10-08T10:39:53.000Z | pages/dashboard_pages.py | socialdistancingdashboard/frontend | aa102c20af09f18aea601573940e1fb8b94041a3 | [
"Apache-2.0"
] | null | null | null | pages/dashboard_pages.py | socialdistancingdashboard/frontend | aa102c20af09f18aea601573940e1fb8b94041a3 | [
"Apache-2.0"
] | null | null | null | import streamlit as st
def parse_md_with_local_images(filename):
'''
streamlit cannot handle local image paths in markdown
documents, therefore these have to be located and inserted
via st.image.
Only looks for images at line start.
'''
s = ''
with open(filename,'r') as f:
for ... | 30.392857 | 80 | 0.527615 |
a0b4c86dbae9641c990cb8ed213c707d76c77768 | 3,322 | py | Python | maze/maze.py | SaturnHafen/micro-bit-ideas | 96c34ebf29a1e3077ccd1ffd38f01d9680448ffe | [
"MIT"
] | null | null | null | maze/maze.py | SaturnHafen/micro-bit-ideas | 96c34ebf29a1e3077ccd1ffd38f01d9680448ffe | [
"MIT"
] | null | null | null | maze/maze.py | SaturnHafen/micro-bit-ideas | 96c34ebf29a1e3077ccd1ffd38f01d9680448ffe | [
"MIT"
] | null | null | null | maze = [ # Caution! mirrored + 90° clockwise rotated
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 9, 9, 9, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 9, 9, 9, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 9, 9, 9, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0... | 28.886957 | 111 | 0.431367 |
f895299614201e35144916fba15789f4c1d9f80b | 5,038 | py | Python | src/onegov/fsi/forms/course_event.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/forms/course_event.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/forms/course_event.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import sedate
from onegov.form.fields import TimezoneDateTimeField, ChosenSelectField
from wtforms import StringField, IntegerField, BooleanField
from wtforms.validators import InputRequired
from onegov.fsi import _
from onegov.form import Form
from onegov.fsi.collections.course import CourseCollection
from onegov.f... | 30.533333 | 78 | 0.632989 |
3e845ca921624137078cb325ba844defc94989c1 | 7,882 | py | Python | src/onegov/event/utils/guidle.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/utils/guidle.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/utils/guidle.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from bleach.sanitizer import Cleaner
from cached_property import cached_property
from datetime import timedelta
from dateutil.parser import parse
from onegov.gis import Coordinates
from sedate import replace_timezone
class GuidleBase(object):
""" Base class for parsing guidle exports containing general helpers. "... | 30.669261 | 78 | 0.56813 |
5f675a6814d32b656c390595ee0f5e8889efbebd | 3,569 | py | Python | ryu/app/simulation/Topo.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/simulation/Topo.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/simulation/Topo.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import threading
from networkx import DiGraph
import networkx as nx
from Node import Switch, Host, Controller, SwitchNumber, ControllerPower, SwitchCap
import time
def deal_log_file():
newest_folder = sorted(os.listdir('Result'))[-1]
local = 1
with open('Result\\' + newest_folder ... | 33.990476 | 116 | 0.563743 |
5f8009c0ec0d15f3eb7f24de605dfb23d20c7c37 | 120 | py | Python | urlwatch/data/hooks.py | lichtwellenreiter/dockerfiles | bad31b1dafffdf95cfc7a83c7f012ae80245b501 | [
"MIT"
] | null | null | null | urlwatch/data/hooks.py | lichtwellenreiter/dockerfiles | bad31b1dafffdf95cfc7a83c7f012ae80245b501 | [
"MIT"
] | null | null | null | urlwatch/data/hooks.py | lichtwellenreiter/dockerfiles | bad31b1dafffdf95cfc7a83c7f012ae80245b501 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
from urlwatch import filters
from urlwatch import jobs
from urlwatch import reporters
| 17.142857 | 30 | 0.816667 |
f29233ba57dca8beecc803b4fea4c5e5abc4f213 | 5,127 | py | Python | lbry/lbry/wallet/account.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | null | null | null | lbry/lbry/wallet/account.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/wallet/account.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import json
import logging
from hashlib import sha256
from string import hexdigits
import ecdsa
from torba.client.baseaccount import BaseAccount, HierarchicalDeterministic
log = logging.getLogger(__name__)
def validate_claim_id(claim_id):
if not len(claim_id) == 40:
raise Exception("Incorrect claimid ... | 36.884892 | 93 | 0.676614 |
4b4047763f0c888bf227a6e16090f859f71a14e7 | 2,961 | py | Python | hrsweb/hrsdb.py | sirboldilox/hrsweb | 7d0b9df08fde8edba9cdd4c86d9a4518aa5f9758 | [
"MIT"
] | null | null | null | hrsweb/hrsdb.py | sirboldilox/hrsweb | 7d0b9df08fde8edba9cdd4c86d9a4518aa5f9758 | [
"MIT"
] | null | null | null | hrsweb/hrsdb.py | sirboldilox/hrsweb | 7d0b9df08fde8edba9cdd4c86d9a4518aa5f9758 | [
"MIT"
] | null | null | null | """
Wrapper around the REST api for HRSDB
"""
import logging
import requests
from requests.exceptions import ConnectionError, Timeout, HTTPError
# Log adapter
logs = logging.getLogger(__name__)
class HRSDB(object):
GET = 0
POST = 1
PUT = 2
DEFAULT_TIMEOUT = 2
def __init__(self, base_url):
... | 25.973684 | 81 | 0.587302 |
d9eb97d54c13c2ae2f9b29896bb3086c5944b53b | 1,883 | py | Python | app/Processors/DDGNProcessor.py | Sainpse/FundAPI | 308c646a1b4fa03e4abe53bc340cc959fdc14d9f | [
"MIT"
] | null | null | null | app/Processors/DDGNProcessor.py | Sainpse/FundAPI | 308c646a1b4fa03e4abe53bc340cc959fdc14d9f | [
"MIT"
] | null | null | null | app/Processors/DDGNProcessor.py | Sainpse/FundAPI | 308c646a1b4fa03e4abe53bc340cc959fdc14d9f | [
"MIT"
] | null | null | null | from app.Models.DDQNAgent import DDQNAgent
from tensorflow import keras
import numpy as np
class DDGNProcessor():
def __init__(self) -> None:
gamma = .9, # discount factor
tau = 100 # target network update frequency
architecture = (50,50,50,50) # units per layer
learning_rate =... | 34.236364 | 106 | 0.593202 |
8a598d50cd2ddae9e62b353c3a340138463d8e7a | 25,101 | py | Python | src/krotov/info_hooks.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | src/krotov/info_hooks.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | src/krotov/info_hooks.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | """Routines that can be passed as `info_hook` to :func:`.optimize_pulses`"""
import sys
import time
import grapheme
import numpy as np
__all__ = ['chain', 'print_debug_information', 'print_table']
def _qobj_nbytes(qobj):
"""Return an estimate for the number of bytes of memory required to store a
Qobj."""
... | 39.098131 | 79 | 0.576869 |
8a93da85bbb59759807e26759689dc1969c241d0 | 3,338 | py | Python | gateway-os/software/fang-module/src/main.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | 1 | 2018-04-29T22:33:42.000Z | 2018-04-29T22:33:42.000Z | gateway-os/software/fang-module/src/main.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | gateway-os/software/fang-module/src/main.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | ## IMPORTS ##
import base64 # Base64: Base16, Base32, Base64 data encodings
import cv2 # OpenCV: usage ranges from interactive art, to mines inspection, stitching maps on the web or through advanced robotics
import json # Json: is a lightweight data interchange format inspired by JavaScript object l... | 31.490566 | 138 | 0.694727 |
8aa729c1bef6e37e191bd9e6a772659091a0db33 | 9,387 | py | Python | torch/ao/quantization/utils.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 1 | 2022-01-20T03:49:23.000Z | 2022-01-20T03:49:23.000Z | torch/ao/quantization/utils.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 14 | 2021-10-14T06:58:50.000Z | 2021-12-17T11:51:07.000Z | torch/ao/quantization/utils.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | null | null | null | """
Utils shared by different modes of quantization (eager/graph)
"""
import warnings
import functools
import torch
from torch.ao.quantization.quant_type import QuantType, quant_type_to_str
from typing import Tuple, Any, Union, Callable
# Type for fusion patterns, it can be more complicated than the following actually... | 38.004049 | 112 | 0.676254 |
7cd36a5da4e5dc2e954157a90976ed50788f15e7 | 17 | py | Python | 3_Funktionen/05_methods_with_ref_params.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | 3_Funktionen/05_methods_with_ref_params.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | 3_Funktionen/05_methods_with_ref_params.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null |
## Seiteneffekt
| 5.666667 | 15 | 0.705882 |
7cd89859b25836bab261588d12d6369025d587d6 | 2,893 | py | Python | tests/onegov/fsi/test_views_audit.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/test_views_audit.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/test_views_audit.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import timedelta
from sedate import utcnow
from uuid import uuid4
def test_audit_for_course(client, scenario):
"""
Story:
For a course with refresh interval, an admin checks the list of attendees.
This list contains when the attendee last visited this course during an
event.
The... | 31.445652 | 79 | 0.651227 |
8696ff6c44a75c2294a9c4747f11786c069138a9 | 54,046 | py | Python | Packs/CTIX/Integrations/CTIXv3/CTIXv3.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/CTIX/Integrations/CTIXv3/CTIXv3.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/CTIX/Integrations/CTIXv3/CTIXv3.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | # Uncomment while development
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
"""IMPORTS"""
import base64
import hashlib
import hmac
import json
import time
import urllib.parse
from typing import Any, Dict
import requests
import urllib3
# Disable insecure warnings
urllib3... | 35.533202 | 123 | 0.617048 |
d4a1843460f27be19b3f59b883edbc9795de9fb9 | 3,453 | py | Python | tests/test_building.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | tests/test_building.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | tests/test_building.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | from hisim import component
from hisim.components import occupancy
from hisim.components import weather
from hisim.components import building
from hisim.loadtypes import LoadTypes, Units
from hisim.simulationparameters import SimulationParameters
import os
def test_building():
# Sets inputs
weather_location =... | 40.151163 | 131 | 0.705184 |
077aeb3e16c07ceca460053b7a382dbf51c1b81e | 2,618 | py | Python | src/onegov/election_day/forms/data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day import _
from onegov.election_day.layouts import DefaultLayout
from onegov.election_day.models.data_source import UPLOAD_TYPE_LABELS
from onegov.form import Form
from onegov.form.fields import ChosenSelectField
from wtforms import RadioField
from wtforms import StringField
from wtforms.validato... | 25.666667 | 70 | 0.566463 |
ed0118b02133d8511f373319a4696e168378f377 | 4,787 | py | Python | Packs/knowbe4Phisher/Integrations/knowbe4Phisher/knowbe4Phisher_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/knowbe4Phisher/Integrations/knowbe4Phisher/knowbe4Phisher_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/knowbe4Phisher/Integrations/knowbe4Phisher/knowbe4Phisher_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import knowbe4Phisher as phisher
import pytest
from test_data.mock_tests import *
import json
def util_load_json(path):
with open(path, mode='r', encoding='utf-8') as f:
return json.load(f)
client = phisher.Client(base_url='https://eu.test.com/graphql', verify=False,
headers={'Au... | 38.604839 | 126 | 0.639231 |
9c6f707e381310c280ffb7cea86f9b62024a1758 | 3,482 | py | Python | envs/fixed/slash.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | envs/fixed/slash.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | envs/fixed/slash.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | # Created by ALuier Bondar on 2020/12/13.
import random
from envs.base import BaseEnvironment, StateFormat
from enum import Enum
class SlashFixedEnvironment(BaseEnvironment):
"""Environment implementation with fixed main character
who could also slash his sword to intercept arrows
子龙位置固定、支持挥剑拦截弓箭的环境实现... | 27.856 | 83 | 0.591327 |
1348a06bb9b048684d6a4a92765dbecee5ccadf1 | 400 | py | Python | theblog/migrations/0013_profile_github_url.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | theblog/migrations/0013_profile_github_url.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | theblog/migrations/0013_profile_github_url.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-25 14:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('theblog', '0012_comment'),
]
operations = [
migrations.AddField(
model_name='profile',
name='github_url',
... | 21.052632 | 74 | 0.6 |
b92ebb7e2bb26133dd9ac188d62c6575838db9a6 | 190 | py | Python | WiSe-2122/Wiederholung/Gruppe-B/rueckmeldung.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Wiederholung/Gruppe-B/rueckmeldung.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Wiederholung/Gruppe-B/rueckmeldung.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
# Funktionsdefinition
def rueckmeldung(text):
rueckmeldung = input(text)
return rueckmeldung
entscheidung = rueckmeldung("Wollen Sie weiterspielen (ja/nein): ")
print(entscheidung) | 23.75 | 67 | 0.768421 |
b9c62db2ad3998714d5a1227d758bbae1fc1be5a | 4,018 | py | Python | tools/legacy/pac-man/gui/windows/mainWindow/window.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/legacy/pac-man/gui/windows/mainWindow/window.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/legacy/pac-man/gui/windows/mainWindow/window.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | import tkinter as tk
import tkinter.scrolledtext
import tkinter.ttk as ttk
import json
import core
import gui.shared as shared
import gui.windows.mainWindow.logic as logic
from functools import partial
from types import SimpleNamespace
def createRootControl(controls):
controls.window = tk.Tk()
controls.window.... | 44.153846 | 110 | 0.770035 |
b9e80df6724996b07dff0a031214054d9896cb7d | 1,802 | py | Python | qmk_firmware/lib/python/qmk/tests/test_qmk_keymap.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/lib/python/qmk/tests/test_qmk_keymap.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/tests/test_qmk_keymap.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | import qmk.keymap
def test_template_c_pytest_basic():
templ = qmk.keymap.template_c('handwired/pytest/basic')
assert templ == qmk.keymap.DEFAULT_KEYMAP_C
def test_template_json_pytest_basic():
templ = qmk.keymap.template_json('handwired/pytest/basic')
assert templ == {'keyboard': 'handwired/pytest/b... | 45.05 | 214 | 0.740289 |
6a470586d716f86fbb68a704504254cf19e466c9 | 242 | py | Python | Variablen und Operatoren/Eingabe/spiel.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Variablen und Operatoren/Eingabe/spiel.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Variablen und Operatoren/Eingabe/spiel.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | # Werte und Berechnung
a = 5
b = 3
c = a + b
print("Die Aufgabe:", a, "+", b)
# Eingabe
print("Bitte eine Zahl eingeben:")
z = input()
# Eingabe in Zahl umwandeln
zahl = int(z)
# Ausgabe
print("Ihre Eingabe:", z)
print("Das Ergebnis:", c)
| 14.235294 | 34 | 0.628099 |
e0329e3d11bc1bc44189138944cf702afd696805 | 194 | py | Python | 961-n-repeated-element-in-size-2n-array/961-n-repeated-element-in-size-2n-array.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 961-n-repeated-element-in-size-2n-array/961-n-repeated-element-in-size-2n-array.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 961-n-repeated-element-in-size-2n-array/961-n-repeated-element-in-size-2n-array.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def repeatedNTimes(self, nums: List[int]) -> int:
len_nums = len(nums)//2
for x in set(nums):
if nums.count(x)==len_nums:
return x | 32.333333 | 53 | 0.536082 |
16a9c988d73278d9ddb33342fe2c2b6fc3e8fe01 | 5,142 | py | Python | untis.py | Nico0302/SMG-UntisOfficeConverters | b43fd6b2baa58d42f9343c3a40963b7eec689ed5 | [
"MIT"
] | null | null | null | untis.py | Nico0302/SMG-UntisOfficeConverters | b43fd6b2baa58d42f9343c3a40963b7eec689ed5 | [
"MIT"
] | null | null | null | untis.py | Nico0302/SMG-UntisOfficeConverters | b43fd6b2baa58d42f9343c3a40963b7eec689ed5 | [
"MIT"
] | null | null | null | import csv, re
from utils import to_ascii, to_grade_number
class Reader:
def __init__(self, diffile, delimiter=',', quotechar='"'):
self.difreader = csv.reader(diffile, delimiter=delimiter, quotechar=quotechar)
self.data = []
def row_validator(self, row, *args, **kwargs):
return True
... | 31.546012 | 91 | 0.61902 |
bcf89b2c9ee7430d959d625d17dfb6151abe84a5 | 4,262 | py | Python | app/job/main/member/cmd/databus.py | 78182648/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | 22 | 2019-04-27T06:44:41.000Z | 2022-02-04T16:54:14.000Z | app/job/main/member/cmd/databus.py | YouthAge/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | null | null | null | app/job/main/member/cmd/databus.py | YouthAge/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | 34 | 2019-05-07T08:22:27.000Z | 2022-03-25T08:14:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-12-25 下午2:43
# @Author : Hedan (hedan@bilibili.com)
# @file : databusTest
import json
import redis
# [databus]
# key = "4ba46ba31f9a44ef"
# secret = "99985eb4451cfb1b899ca0fbe3c4bdc8"
# group = "AccountLog-MainAccount-P"
# topic = ... | 28.993197 | 147 | 0.690521 |
d5d835ea31cbd5bebfc804e04c78978afd6adf64 | 1,842 | py | Python | genesis/oracle.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | genesis/oracle.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | genesis/oracle.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
import random
from utils.lib import O
from genesis.gen_utils import Statement, Vocabulary, choice
__author__ = "bigfatnoob"
def sample(collection, size):
size = min(size, len(co... | 27.088235 | 63 | 0.700869 |
5d2d55eb1af1bd43f0fb5fb46b3712b13bc7ba3b | 1,977 | py | Python | voc2011/test_voc_generator.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | null | null | null | voc2011/test_voc_generator.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | null | null | null | voc2011/test_voc_generator.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import json
import pytest
import numpy as np
from voc2011.voc_generator import PascalVocGenerator, ImageSetLoader
#from voc2011.utils import increment_var
import yaml
with open("init_args.yml", 'r') as stream:
try:
init_args = yaml.load(stream)
except yaml.YAMLE... | 30.890625 | 81 | 0.592312 |
53d656da8402646b63ccd23d70865c7fb8f5649d | 1,802 | py | Python | src/visuanalytics/analytics/util/type_utils.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/analytics/util/type_utils.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/analytics/util/type_utils.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import functools
from typing import Type
from visuanalytics.analytics.control.procedures.step_data import StepData
from visuanalytics.analytics.util.step_errors import StepTypeError, raise_step_error, StepError
from visuanalytics.util.dict_utils import merge_dict
def register_type_func(types: dict, error: Type[StepE... | 31.068966 | 95 | 0.703108 |
dbc8fb50c79c892ac92d75d07587d8cf663dd8cc | 300 | py | Python | setup.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | 4 | 2016-05-10T20:40:34.000Z | 2020-04-09T13:23:33.000Z | setup.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | setup.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name='rdlcompiler',
version='0.1',
description='',
author='Paul Roukema',
author_email='roukemap@gmail.com',
url='',
packages=['rdlcompiler', 'rdlcompiler.systemrdl'],
requires=[ 'enum34']
) | 23.076923 | 56 | 0.613333 |
91568fbfb0c1710cdf9c94344f7915b98c9b4a7b | 1,626 | py | Python | research/hpc/pinns/src/NavierStokes/loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pinns/src/NavierStokes/loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pinns/src/NavierStokes/loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.595745 | 83 | 0.615621 |
5300626a90d972700e898f93980be24f5859dbc6 | 18,430 | py | Python | skil/services.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | skil/services.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | skil/services.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import skil
from skil.utils.io import serialize_config, deserialize_config
import skil_client
import time
import uuid
import numpy as np
import requests
import json
import os
from skil_client.rest import ApiException as api_exception
try:
import cv2
except ImportError:
cv2 = None
class Service(object):
... | 35.171756 | 115 | 0.614107 |
f433bea2367c589a751843ebfcb9e10564915aee | 15,376 | py | Python | .arch/arch/dev.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | .arch/arch/dev.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | .arch/arch/dev.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Starting Dev Server with Dir Change Watcher and Org Publisher
**Alternative** to mkdocs serve --livereload
Requires entr, tmux and npm install live-server
You have more finegrained control on used resources plus the org exporter
It will all be started in a tmux window.
"""
from plugins impo... | 34.244989 | 189 | 0.547086 |
f4714aed2103f850eec2881dbc8254f4ceb8b38c | 2,269 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/game/patchTrafficLights.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/game/patchTrafficLights.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/game/patchTrafficLights.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 37.816667 | 111 | 0.668136 |
be9ef8ad61658cdbede5a7e2ba5ddcb202c28c88 | 463 | py | Python | scriptsForPreprocessing/change_json.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | scriptsForPreprocessing/change_json.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | scriptsForPreprocessing/change_json.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import os, json
path_to_annotations = os.path.join(r'resources/fishial/train', 'via_region_data.json')
json_tmp = json.load(open(path_to_annotations))
result_dictionary = {}
for idx, name_record in enumerate(json_tmp):
dict = json_tmp[name_record]
dict.update({"verified": False})
dict.update({"correct": Fal... | 38.583333 | 86 | 0.732181 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.