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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30d932fce4a47d18d87e3013e063fcf965800e1b | 727 | py | Python | Kapitel_1/_7_dunder_str_pc.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | 1 | 2020-12-24T15:42:54.000Z | 2020-12-24T15:42:54.000Z | Kapitel_1/_7_dunder_str_pc.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | Kapitel_1/_7_dunder_str_pc.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | # --- Klassendeklaration mit Konstruktor und 'Dunder'-str-Method --- #
class PC:
def __init__(self, cpu, gpu):
self.cpu = cpu
self.gpu = gpu
# __str__(self) -> Rückgabe muss ein String sein
def __str__(self):
msg = ""
msg += f"\nDiese Instanz ist von der Klasse: {self.__clas... | 34.619048 | 99 | 0.605227 |
eb8e916a421cff2a61abdc2661045436897959a7 | 915 | py | Python | ExercicioAula2.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | ExercicioAula2.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | ExercicioAula2.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | def max_(n,v):
if n == 1:
return v[0]
else:
x = max_(n-1,v)
if x > v[n-1]:
return x
else:
return v[n-1]
def min_(n,v):
if n == 1:
return v[0]
else:
x = min_(n-1,v)
if x < v[n-1]:
... | 19.0625 | 96 | 0.480874 |
eb9a3968a3f612576face23726f7cfaf84779610 | 117 | py | Python | sandbox/character/habit.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | sandbox/character/habit.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | 1 | 2022-03-22T23:50:32.000Z | 2022-03-22T23:50:32.000Z | sandbox/character/habit.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | import string
from sandbox.schedule.schedule import Schedule
class Habit:
name: string
schedule: Schedule
| 13 | 46 | 0.760684 |
d68c7cb857e7dca5fa67a970561efaf285ac87b7 | 818 | py | Python | Packs/CommonScripts/Scripts/GetValuesOfMultipleFIelds/GetValuesOfMultipleFIelds.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/GetValuesOfMultipleFIelds/GetValuesOfMultipleFIelds.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/GetValuesOfMultipleFIelds/GetValuesOfMultipleFIelds.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from typing import List, Dict
def update_list(_list: List, update_with):
if isinstance(update_with, list):
_list.extend(update_with)
else:
_list.append(update_with)
def main():
args: Dict = demisto.args()
root = args.get('key')
if root:
if n... | 22.722222 | 53 | 0.555012 |
d6f1638c91dc4a7461b61e4e17e1a1cab4d5080c | 1,203 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex03_perfectnumber.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex03_perfectnumber.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex03_perfectnumber.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch02_math.intro.intro import find_proper_divisors
def is_perfect_number_simple(number):
# immer durch 1 teilbar
sum_of_multipliers = 1
for i in range(2, int(number / 2) + 1):
if number % i == 0:
... | 22.277778 | 55 | 0.713217 |
ba9a20e7eb1ccf8e14346f838efe691f88263c75 | 1,721 | py | Python | assets/data/fcc-General-reformatting-regex.py | millerj870/millerj870.github.io | 96d0ddc187a22443add0f1a67daf0690b1effae9 | [
"CC0-1.0"
] | null | null | null | assets/data/fcc-General-reformatting-regex.py | millerj870/millerj870.github.io | 96d0ddc187a22443add0f1a67daf0690b1effae9 | [
"CC0-1.0"
] | null | null | null | assets/data/fcc-General-reformatting-regex.py | millerj870/millerj870.github.io | 96d0ddc187a22443add0f1a67daf0690b1effae9 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 25 08:23:00 2021
@author: jason.miller
"""
# testing regex in a file by reformatting title
import re, os, sys
os.chdir('/Users/jason.miller/Library/Mobile Documents/com~apple~CloudDocs/To Do/2021/7/17/')
input = open("tmp.txt","r")
output = open("... | 33.096154 | 166 | 0.606624 |
240a9b3bab1a138fdf3e4cda9bfdb6d3f74911ce | 1,552 | py | Python | Contrib-Inspur/openbmc/meta-security/meta-tpm/lib/oeqa/runtime/cases/tpm2.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/meta-security/meta-tpm/lib/oeqa/runtime/cases/tpm2.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/meta-security/meta-tpm/lib/oeqa/runtime/cases/tpm2.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) 2019 Armin Kuster <akuster808@gmail.com>
#
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.runtime.decorator.package import OEHasPackage
class Tpm2Test(OERuntimeTestCase):
def check_endlines(self, results, expected_endlines):
... | 35.272727 | 94 | 0.631443 |
243ffd722ad48c86b51312470ee8fecec58fb5b3 | 566 | py | Python | fence/blueprints/login/okta.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | fence/blueprints/login/okta.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | fence/blueprints/login/okta.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | import flask
from fence.resources.openid.okta_oauth2 import OKTA_IDP_NAME
from fence.blueprints.login.base import DefaultOAuth2Login, DefaultOAuth2Callback
class OktaLogin(DefaultOAuth2Login):
def __init__(self):
super(OktaLogin, self).__init__(
idp_name=OKTA_IDP_NAME,
client=flas... | 26.952381 | 81 | 0.708481 |
030a6cba27b95f95591fa1cd9c1e10687f25be3b | 916 | py | Python | deutschland/autobahn/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/autobahn/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/autobahn/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
Autobahn App API
Was passiert auf Deutschlands Bundesstraßen? API für aktuelle Verwaltungsdaten zu Baustellen, Staus und Ladestationen. Außerdem Zugang zu Verkehrsüberwachungskameras und vielen weiteren Datensätzen. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generate... | 32.714286 | 217 | 0.825328 |
0360d5039fd6bd190d8e4d7e20d4a02165f87ebe | 729 | py | Python | array.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | array.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | array.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | # Python program to demonstrate
# Adding Elements to a Array
# importing "array" for array creations
import array as arr
# array with int type
a = arr.array('i', [1, 2, 3])
print ("Array before insertion : ", end =" ")
for i in range (0, 3):
print (a[i], end =" ")
print()
# inserting array using
# insert() functi... | 18.225 | 45 | 0.607682 |
063547b04b357ead2d047380ff6eeea7cf51d6bf | 2,392 | py | Python | spotify_gender_ex/lang_file.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 1 | 2022-02-05T16:40:13.000Z | 2022-02-05T16:40:13.000Z | spotify_gender_ex/lang_file.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 31 | 2021-06-17T11:59:33.000Z | 2022-03-19T07:05:18.000Z | spotify_gender_ex/lang_file.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | null | null | null | # coding=utf-8
import re
from typing import Callable, List, Optional
from xml.etree import ElementTree
GENDER_REGEX = re.compile(r'''(\*[iIrRnN])|(\([rRnN]\))|([a-zß-ü][IRN])|(:[iIrRnN](?!nternal))''')
class LangFile:
def __init__(self, path: str):
"""Open language file at the given path and read its con... | 39.213115 | 98 | 0.600753 |
ebf364bb1a906375d7dd321cff106d862e90ff67 | 839 | py | Python | python/data_sutram/pypath/PyPath/scrap_path.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/pypath/PyPath/scrap_path.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/pypath/PyPath/scrap_path.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from tqdm import tqdm
import json
import sqlite3
import re
from pypath import api
a=api()
#data = {}
#data['stoppages'] = []
get_all_stoppages = a.get_all_stoppages()
get_all_routes = a.get_all_routes()
get_last_update_time = a.get_last_update_time()
#get_kolkata_traffic_update = a.get_kolkata_traffic_update()
wit... | 23.305556 | 75 | 0.749702 |
aec759ee8a91b71228d069af9ff1f196a6b7a2eb | 2,060 | py | Python | src/aijack/defense/purifier.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/purifier.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/purifier.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class Purifier_Cifar10(nn.Module):
"""autoencoder for purification on Cifar10
reference https://arxiv.org/abs/2005.03915
"""
def __init__(self):
super(Purifier_Cifar10, self).__init__()
self.L1 = nn.Linear(10, 7)
... | 27.466667 | 80 | 0.611165 |
4e2146737bc26047a71373e1bbce559068d5abd7 | 6,512 | py | Python | yolov5-coreml-tflite-converter/tflite/tf_converter/keras_to_tflite_converter.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_converter/keras_to_tflite_converter.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_converter/keras_to_tflite_converter.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | import time
import logging
import tensorflow as tf
from constants import DEFAULT_IOU_THRESHOLD, DEFAULT_CONF_THRESHOLD, FULLINT8, INT8, FLOAT16, FLOAT32, COMBINED, BLUE, \
END_COLOR, RED, GREEN
from tf_metadata.metadata_writer import MetadataWriter
from tf_utils.io_order import IOOrder
from tf_utils.parameters imp... | 52.516129 | 204 | 0.694103 |
ee90267ff7d1ccd5a058bf60826c5dc7c44e76f4 | 336 | py | Python | leetcode/482-License-Key-Formatting/LicenseKeyFormatting.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-12-29T03:26:39.000Z | 2016-12-29T03:26:39.000Z | leetcode/482-License-Key-Formatting/LicenseKeyFormatting.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/482-License-Key-Formatting/LicenseKeyFormatting.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def licenseKeyFormatting(self, S, K):
"""
:type S: str
:type K: int
:rtype: str
"""
M = ''.join(S.split('-'))
sec = [M[max(i - K, 0):i].upper() for i in range(len(M), -1, -K)][::-1]
sec = sec if sec[0] else sec[1:]
retur... | 28 | 79 | 0.446429 |
a0081b34a45a80245afe3cdee8cf37e96d5d9658 | 20,781 | py | Python | GZP_GTO_QGIS/gto/scripts/SCR_MandatoryEntries.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/gto/scripts/SCR_MandatoryEntries.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/gto/scripts/SCR_MandatoryEntries.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | """
@author: ms.gis, June 2020
Script for QGIS GTO for Modul GZP
"""
import re
from qgis.core import (QgsProject,
QgsVectorLayer,
QgsMapLayer)
from PyQt5.QtWidgets import (QMessageBox,
QProgressDialog,
QApplication... | 46.386161 | 197 | 0.559694 |
0923026453db3752559b3ffb9b23f2960d51c30f | 487 | py | Python | models/sanction_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/sanction_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/sanction_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 sanction_type(models.Model):
_name = 'sanction.type'
_description = u'Sanction '
name = fields.Char(string='Description',size=64)
detail = fields.Text(string='Text sur document')
interview = fields.Boolean(str... | 28.647059 | 74 | 0.704312 |
e103a7d1776b12eb9a2b6c4a994fe75387eab892 | 2,201 | py | Python | python/oneflow/compatible/single_client/framework/watcher.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/framework/watcher.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/framework/watcher.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... | 38.614035 | 86 | 0.795547 |
6dd162e10475e4fb2b0292119a8dc9b5dc4c3eaf | 1,265 | py | Python | pandasguide/com/aaron/test_code.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | pandasguide/com/aaron/test_code.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | pandasguide/com/aaron/test_code.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | import sys
def test(x):
if x > 0:
print("a")
else:
print("b")
def distinct_list():
l = [1, 2, 2, 3, 3, 3]
print({}.fromkeys(l).keys())
lt = list(set(l))
print(lt)
def vars_test():
ff = vars() is locals()
print(ff)
ff = vars(sys) is sys.__dict__
print(vars())... | 16.012658 | 42 | 0.524111 |
6ee062154937fc08243eb507222f397a5bffec9c | 10,346 | py | Python | Python/Sonstige_Uebungen/Deep Learning/recognizeShapesOwnData/optimizeLearning.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/Deep Learning/recognizeShapesOwnData/optimizeLearning.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/Deep Learning/recognizeShapesOwnData/optimizeLearning.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: optimizeLearning.py
# Project: NN
#-----
# Created Date: Sunday 17.01.2021, 11:25
# Author: Apop85
#-----
# Last Modified: Sunday 17.01.2021, 13:24
#-----
# Copyright (c) 2021 Apop85
# This software is published under the MIT license.
# Check http://www.ope... | 43.470588 | 183 | 0.561666 |
6c3a276761a7b2b706b7cd4dec8d5d009613233c | 223 | py | Python | PYTHON/Strings/strings_split_and_join.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/strings_split_and_join.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/strings_split_and_join.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def split_and_join(line):
# write your code here
line_list = line.split()
return '-'.join(line_list)
if __name__ == '__main__':
print(split_and_join('this is a string'))
| 18.583333 | 45 | 0.672646 |
06e50b023c0f91975922e2b5253ecc6f99be2893 | 160 | py | Python | src/main/python/ble_temperature_sensor/sensortype.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/sensortype.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/sensortype.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from enum import Enum
class SensorType(Enum):
UNKNOWN = 1
GOVEE = 1
INKBIRD = 2
BRIFIT = 3
AZARTON = 4
MI = 5
| 12.307692 | 23 | 0.58125 |
06f3499b675f6eddd644914677aed5f5595d1196 | 1,206 | py | Python | books/Data-Structures-And-Algorithms-with-Python/ch03/merge_sort.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/Data-Structures-And-Algorithms-with-Python/ch03/merge_sort.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/Data-Structures-And-Algorithms-with-Python/ch03/merge_sort.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def mergeSort(nums):
# base case if the input array is one or zero just return
if len(nums) > 1:
# splitting input array
print('splitting', nums)
mid = len(nums) // 2
left = nums[:mid]
right = nums[mid:]
# recursive calls to mergeSort for left and right subarrays
... | 28.046512 | 72 | 0.472637 |
b1cdad3b95f326aba0098cacaf837dad5a4bafeb | 1,095 | py | Python | SoSe-21/Uebung-2/A3-FahrenheitCelsius.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-2/A3-FahrenheitCelsius.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-2/A3-FahrenheitCelsius.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Aufgabe 3 - Übung 2
#
# Erstellen Sie ein Python-Programm mit den folgenden Anforderungen:
# - Umrechnung von Fahrenheit nach Celsius
# - Umrechnung von Celsius nach Fahrenheit
# Dies kann sicher helfen: Celsius = 5/9 * (Fahrenheit - 32).
# 1. Nutzereingabe für Celsius erfassen und in float umwandeln
celsiusIn... | 47.608696 | 85 | 0.771689 |
ab940ac989231566c9b9618fc01c90cf45db717a | 2,256 | py | Python | Metadataextraction/test_extractTime.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | null | null | null | Metadataextraction/test_extractTime.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 47 | 2018-11-13T13:55:01.000Z | 2019-09-16T13:38:11.000Z | Metadataextraction/test_extractTime.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 4 | 2018-11-27T12:36:51.000Z | 2020-10-14T18:07:04.000Z | import os # used to get the location of the testdata
import extractTool # used to invoce the getMetadata function
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
######################################
# --detail=bbox --folder=single --time
######################################... | 56.4 | 199 | 0.700798 |
abcaefea78aa689c3d41e1bbd74ae6c36222a992 | 602 | py | Python | geotagger/utils.py | jakubroztocil/geotagger | fa79945e88facafadc29090a991abe95f57e7ad5 | [
"MIT"
] | 26 | 2017-03-14T01:20:12.000Z | 2021-11-30T20:37:10.000Z | geotagger/geotagger/utils.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2017-06-25T22:08:04.000Z | 2018-05-26T20:10:06.000Z | geotagger/utils.py | jakubroztocil/geotagger | fa79945e88facafadc29090a991abe95f57e7ad5 | [
"MIT"
] | 10 | 2017-04-18T13:18:15.000Z | 2020-04-27T11:50:26.000Z | import mimetypes
import os
import arrow
import dateutil.parser
def parse_date(s):
return arrow.get(dateutil.parser.parse(s))
def get_image_file_paths(photo_directory_path):
image_file_paths = set()
for root, subdirs, files in os.walk(photo_directory_path):
for filename in files:
fil... | 27.363636 | 62 | 0.659468 |
abe5f6de19482a21b2e4b7350ab48caaf76a6265 | 1,014 | py | Python | qmk_firmware/lib/python/qmk/cli/pyformat.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/pyformat.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/pyformat.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Format python code according to QMK's style.
"""
from subprocess import CalledProcessError, DEVNULL
from milc import cli
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Flag only, don't automatically format.")
@cli.subcommand("Format python code according to QMK's style.", hidden=False ... | 37.555556 | 116 | 0.667653 |
0506129679d2fbe2c6c50cc791d7a6a0de157be0 | 458 | py | Python | crinacle/download_phone_book.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | 1 | 2020-01-16T14:03:51.000Z | 2020-01-16T14:03:51.000Z | crinacle/download_phone_book.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | null | null | null | crinacle/download_phone_book.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
import requests
import json
sys.path.insert(1, os.path.realpath(os.path.join(sys.path[0], os.pardir)))
DIR_PATH = os.path.abspath(os.path.join(__file__, os.pardir))
def main():
res = requests.get('https://crinacle.com/graphing/data/phone_book.json')
with open(os.... | 22.9 | 76 | 0.674672 |
057251bdcf80c00b11999146293708ef75ce412a | 17,746 | py | Python | ui/Ui_MainWindow.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | ui/Ui_MainWindow.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | ui/Ui_MainWindow.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/Ui_MainWindow.ui',
# licensing of 'ui/Ui_MainWindow.ui' applies.
#
# Created: Wed May 22 10:26:59 2019
# by: pyside2-uic running on PySide2 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore,... | 67.475285 | 171 | 0.747098 |
55473a034e23ff7e605bee1a859bd7a7c6fb8e9c | 9,068 | py | Python | src/lecture2/test_softmax/test_softmax.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture2/test_softmax/test_softmax.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture2/test_softmax/test_softmax.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import os
import copy
import sys
import timeit
import numpy as np
import six.moves.cPickle as pickle
# local dep
sys.path.append("..")
from logistic_regression.softmax_regression import SoftmaxRegression
from logistic_regression import utils
class test_softmax_classifier(SoftmaxRegression):
def __init_... | 39.947137 | 108 | 0.507389 |
75ee012db320dec9b5dc39445e2e15e2f630da76 | 107 | py | Python | python/python/regex/format.py | acgist/demo | 7dfc5d6cb967dafec4d5707e2f395d3e3d354d80 | [
"BSD-3-Clause"
] | 3 | 2019-07-06T02:31:44.000Z | 2020-07-31T08:04:55.000Z | python/python/regex/format.py | acgist/demo | 7dfc5d6cb967dafec4d5707e2f395d3e3d354d80 | [
"BSD-3-Clause"
] | 24 | 2020-07-31T07:21:58.000Z | 2021-12-19T08:43:42.000Z | python/python/regex/format.py | acgist/demo | 7dfc5d6cb967dafec4d5707e2f395d3e3d354d80 | [
"BSD-3-Clause"
] | null | null | null | #coding=utf-8
'''
字符串格式化代码
'''
print "{name}现在{age}岁!".format(name = "碧螺萧萧", age = 24)
print "%010d" %12;
| 13.375 | 55 | 0.588785 |
ddebe1551a7b324ce181b3e22758fdedae2efb60 | 1,916 | py | Python | asteroid/filterbanks/analytic_free_fb.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | asteroid/filterbanks/analytic_free_fb.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | asteroid/filterbanks/analytic_free_fb.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
from .enc_dec import Filterbank
class AnalyticFreeFB(Filterbank):
"""Free analytic (fully learned with analycity constraints) filterbank.
For more details, see [1].
Args:
n_filters (int): Number of filters. Half of `n_filters` will
... | 39.916667 | 100 | 0.628914 |
1f6539e5435cb4e54593c4c0efc490deed4c471a | 2,527 | py | Python | official/cv/ADNet/src/utils/gen_action_labels.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/utils/gen_action_labels.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/utils/gen_action_labels.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... | 36.623188 | 89 | 0.614958 |
cdf2f5a8a2142c653c27fb14557e4e6ecb6856ff | 781 | py | Python | zipLists.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | zipLists.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | zipLists.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
input:
List1, List2
length of list is: list1 = list2
output:
for each element
(list1[i] = List2[i])*
"""
input_left = "C:/Temp/ablkeywords_notcomplete.txt"
input_right = "C:/Temp/ablkeywords_notcomplete_komma.txt"
with open(input_left, 'r', encoding="ANSI") as txt:
program_txt1 = ... | 18.162791 | 57 | 0.673496 |
cdf49f6d828af54ce2dfc0933bbe1960872cb282 | 1,245 | py | Python | development/scripts/get_object_metadata.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | development/scripts/get_object_metadata.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | development/scripts/get_object_metadata.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 12 | 2018-02-22T09:45:43.000Z | 2020-02-27T21:37:52.000Z | #!/usr/bin/env python3
"""
Use this script to get sizes and MD5 hashes for objects listed on the downloads page.
Usage:
./get_object_metadata.py gs://bucket/file_1 gs://bucket/file_2 ...
"""
import argparse
import base64
import json
import subprocess
ONE_GIBIBYTE = 2 ** 30
ONE_MEBIBYTE = 2 ** 20
def fetch_objec... | 21.465517 | 85 | 0.590361 |
a941b7fa8b06c6ce0da0fa1683bd09e32ee6bccc | 384 | py | Python | string_manipulation/group_anagrams.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | string_manipulation/group_anagrams.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | string_manipulation/group_anagrams.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | from typing import List
import collections
def group_anagrams(strs: List[str]) -> List[List[str]]:
anagrams = collections.defaultdict(list)
for word in strs:
anagrams[''.join(sorted(word))].append(word)
return list(anagrams.values())
def test_case():
case1 = ["eat", "tea", "tan", "ate", "na... | 22.588235 | 55 | 0.651042 |
f50d893abb0f061f9af06f95f3aa15968dbb1038 | 2,864 | py | Python | network engineering course practice/medium term practice/front/run.py | MU001999/codeex | 23e300f9121a8d6bf4f4c9ec103510193808e9ba | [
"MIT"
] | 2 | 2019-01-27T14:16:09.000Z | 2019-05-25T10:05:24.000Z | network engineering course practice/medium term practice/front/run.py | MU001999/codeex | 23e300f9121a8d6bf4f4c9ec103510193808e9ba | [
"MIT"
] | null | null | null | network engineering course practice/medium term practice/front/run.py | MU001999/codeex | 23e300f9121a8d6bf4f4c9ec103510193808e9ba | [
"MIT"
] | 1 | 2020-11-05T05:17:28.000Z | 2020-11-05T05:17:28.000Z | from flask import Flask, render_template, redirect
from model import *
from collections import defaultdict
app = Flask(__name__)
@app.route('/')
def index():
return redirect('/requests/1')
@app.route('/requests')
def get_requests():
return redirect('/requests/1')
@app.route('/requests/<int:page>')
def get_r... | 34.926829 | 159 | 0.697277 |
192c316250f726e38eb07929d23a5e1df4326ff7 | 750 | py | Python | Data Structures/Python/Trees/postOrder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Data Structures/Python/Trees/postOrder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Data Structures/Python/Trees/postOrder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | """
Complete the postOrder function in your editor below, which has parameter: a pointer to the root of a binary tree. It must print the values in the tree's postorder traversal as a single line of space-separated values.
Input Format
Our hidden tester code passes the root node of a binary tree to your postOrder fun... | 22.058824 | 218 | 0.689333 |
a9032d63171bf2732910997ea83631b974170877 | 4,032 | py | Python | gui/exportGUI.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | 1 | 2022-01-18T12:53:17.000Z | 2022-01-18T12:53:17.000Z | gui/exportGUI.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | gui/exportGUI.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from PyQt5 import QtCore, QtGui, QtWidgets
from gui import save as sv
from gui import boxes as BOX
from lib import gfHelper as gfh
class SaveDialog(QtWidgets.QDialog, sv.Ui_Dialog):
def __init__(self, data, col_dict=None):
super(SaveDialog, self).__init__()
... | 38.4 | 114 | 0.560764 |
8bf94aaed25350495238ba53b323a07bf8ed5ae2 | 92 | py | Python | 2014/08/net-neutrality-themes/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/08/net-neutrality-themes/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/08/net-neutrality-themes/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1HzvgWfglmLEwUw0CiyZlcubb0mzeRfySE6sdp-FwSP0'
| 23 | 68 | 0.836957 |
e35ca224787713af0e339c89b4544d5732b53f5d | 8,191 | py | Python | history/Others/Python/files/ToyWeatherSpider.py | hengg/i-know-nothing-about-js | 2dc1af3303a8565dd5599f8803d4454121bfdbec | [
"MIT"
] | 2 | 2020-08-07T15:31:19.000Z | 2021-02-05T16:40:36.000Z | history/Others/Python/files/weather.py | hengg/js-walker | 2dc1af3303a8565dd5599f8803d4454121bfdbec | [
"MIT"
] | 8 | 2020-04-07T00:56:00.000Z | 2020-09-15T02:21:42.000Z | history/Others/Python/files/weather.py | hengg/i-know-nothing-about-js | 2dc1af3303a8565dd5599f8803d4454121bfdbec | [
"MIT"
] | null | null | null | #!/usr/local/bin/python2.7
#coding=utf-8
#__author__ = 'wangliang'
from flask import Flask
import re
import urllib2
import json
import time
import cookielib
import traceback
import os
import socket
from flask import Flask
app = Flask(__name__)
timertmp = time
#设置连接超时时间
socket.setdefaulttimeout(5)
#重写重新定向类(禁止重定向)... | 35.613043 | 142 | 0.582591 |
8bd5557c84c7ac8ddb123ae79616b93dc16cdb7f | 1,305 | py | Python | official/cv/ADNet/src/utils/draw_box_from_npy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/utils/draw_box_from_npy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/utils/draw_box_from_npy.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... | 33.461538 | 78 | 0.688889 |
8be1acb47996ce88c5e2e7f173ddfb6831b4d343 | 7,551 | py | Python | MachineTranslation/lib/utils/evaluate_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | MachineTranslation/lib/utils/evaluate_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | MachineTranslation/lib/utils/evaluate_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
from lib.utils.bleu_xrh import *
from nltk.translate.bleu_score import corpus_bleu
class Evaluate:
"""
评价翻译模型
Author: xrh
Date: 2021-9-26
"""
def __init__(self, with_unk=True,
eliminate_space=True,
... | 31.4625 | 284 | 0.549861 |
7be80ae0e21798d9af0067a602b0d4cafb9308b6 | 2,820 | py | Python | project/api/user/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/user/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/user/resources.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask import abort
from flask.helpers import make_response
from flask_apispec import doc, marshal_with, use_kwargs
from flask_security import current_user
from project import db
from project.access import login_api_user_or_401
from project.api import add_api_resource
from project.api.organization_invitation.schem... | 32.045455 | 85 | 0.742199 |
d0e24b67d5bc2a767e873f4830fff6ee174a5dce | 4,294 | py | Python | WebHostLib/upload.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | null | null | null | WebHostLib/upload.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | 5 | 2020-01-18T21:10:46.000Z | 2020-01-25T20:58:19.000Z | WebHostLib/upload.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | 2 | 2020-01-18T17:36:50.000Z | 2020-01-22T16:52:08.000Z | import json
import zlib
import zipfile
import logging
from flask import request, flash, redirect, url_for, session, render_template
from pony.orm import commit, select
from WebHostLib import app, Seed, Room, Patch
accepted_zip_contents = {"patches": ".bmbp",
"spoiler": ".txt",
... | 47.711111 | 148 | 0.493712 |
eb104fb5acbac044be271286fe5cab1e27a3fd8c | 23,717 | py | Python | plugins/tff_backend/bizz/nodes/hoster.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/nodes/hoster.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/nodes/hoster.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... | 49.51357 | 120 | 0.70245 |
3e36a591801f452db71c92a6b081400e5b0d4119 | 12,355 | py | Python | src/api/views.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/api/views.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/api/views.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from datetime import datetime
import json
from django.shortcuts import render
import firebase_admin
from django.http import HttpResponse
from firebase_admin import credentials
from firebase_admin import auth
from matplotlib.pyplot import title
from rest_framework import viewsets, generics
from rest_framework.response... | 34.802817 | 282 | 0.591097 |
903d20d176df1bf72564b250643e0456d5ad8862 | 2,498 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex07_roman_numbers.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex07_roman_numbers.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex07_roman_numbers.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def from_roman_number_v1(roman_number):
value = 0
last_digit_value = 0
for i in range(len(roman_number) - 1, -1, -1):
roman_digit = roman_number[i]
digit_value = value_map[roman_digit]
add_mode... | 24.732673 | 68 | 0.58807 |
903d2f95063a181f04ebfcdcce60223b5d4a626f | 190 | py | Python | pyventskalender/tag20_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag20_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag20_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | # %%
import requests
from cat_fact.client import CatClient
cat_client = CatClient(requests.Session(), "http://cat-fact.herokuapp.com")
fakt = cat_client.get_random_fact("cat")
fakt["text"] | 23.75 | 75 | 0.757895 |
5f463c565439fe44d8526729fc1ca9a39144b696 | 612 | py | Python | Algorithms/Implementation/picking_numbers.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/picking_numbers.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/picking_numbers.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from collections import Counter, OrderedDict
n = int(input().strip())
ar = [int(a_temp) for a_temp in input().strip().split(' ')]
cnt = Counter()
for a in ar:
cnt[a] += 1
od = OrderedDict(sorted(cnt.items()))
print(od)
last_k = None
last_v = 0
max_sum = 0
for k, v in od.items():... | 19.125 | 59 | 0.560458 |
5fce795fdc035310cde692a2b9bb81281351f25c | 249 | py | Python | exercises/fr/exc_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("fr")
doc = nlp("J'ai un chat")
# Recherche le hash pour le mot "chat"
cat_hash = ____.____.____[____]
print(cat_hash)
# Recherche cat_hash pour obtenir la chaine
cat_string = ____.____.____[____]
print(cat_string)
| 19.153846 | 43 | 0.73494 |
840113f26a60f056c0a0d3b827565864a9c7511a | 1,548 | py | Python | tests/web.adblockplus.org/chunks/cookieSettingsForm.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/chunks/cookieSettingsForm.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/chunks/cookieSettingsForm.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | from pages.basePage import BasePage
SAVE_PREFERENCES_BUTTON_XPATH = '//*[@title="Save cookie preferences"]'
NECESSARY_COOKIES_TOGGLE_SELECTOR = "//input[@type='checkbox'][1]"
TRACKING_COOKIES_TOGGLE_SELECTOR = "//input[@type='checkbox'][@class='tracking-cookies']"
AB_TESTING_COOKIES_TOGGLE_SELECTOR = "//input[@type='c... | 45.529412 | 117 | 0.78876 |
843e78dde45b7ab6811efe073beed4739dccb78d | 166 | py | Python | .venv/Lib/site-packages/ipopt-0.1.9/test/rosen.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/ipopt-0.1.9/test/rosen.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/ipopt-0.1.9/test/rosen.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | from scipy.optimize import rosen, rosen_der
from ipopt import minimize_ipopt
x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
res = minimize_ipopt(rosen, x0, jac=rosen_der)
print(res)
| 27.666667 | 46 | 0.73494 |
f250be573e5fd5ca06234a110fcbec59475316ba | 418 | py | Python | exercises/ja/solution_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/solution_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/solution_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.ja import Japanese
nlp = Japanese()
# テキストを処理
doc = nlp(
"1990年には東アジアの60%以上の人々が極度の貧困状態に陥っていました。"
"今では4%以下になっています。"
)
# docに含まれるトークンを処理
for token in doc:
# トークンが数字に似ているかどうかをチェック
if token.like_num:
# docの次のトークンを取得
next_token = doc[token.i + 1]
# 次のトークンの文字列が「%」に一致... | 20.9 | 50 | 0.641148 |
4b295a836a82fdfc787b7d3cd6ab9dd574ac6136 | 2,430 | py | Python | MetaCTF/2020/steg_as_a_service/steg/www/server.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | MetaCTF/2020/steg_as_a_service/steg/www/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | MetaCTF/2020/steg_as_a_service/steg/www/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
from flask import Flask, render_template, request
import subprocess
import uuid
import os
from os import path
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = './uploads/'
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024
@app.route('/')
def upload_file():
return render_template('./upl... | 44.181818 | 156 | 0.595473 |
76e20826773a9ecfe7567419536d7a1d520bb123 | 184 | py | Python | ZbjDjChannels/chatroom/urls.py | zbjlala/ZbjDjChannels | c4da2339574e2e398bd452eef4d026eab309752c | [
"MIT"
] | null | null | null | ZbjDjChannels/chatroom/urls.py | zbjlala/ZbjDjChannels | c4da2339574e2e398bd452eef4d026eab309752c | [
"MIT"
] | null | null | null | ZbjDjChannels/chatroom/urls.py | zbjlala/ZbjDjChannels | c4da2339574e2e398bd452eef4d026eab309752c | [
"MIT"
] | null | null | null | from django.conf.urls import url
from chatroom import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^(?P<room_name>[^/]+)/$', views.room, name='room'),
] | 23 | 61 | 0.625 |
6a5ac95f9713100deebe8cd0ac4269a74040139c | 198 | py | Python | Problems/Dynamic Programming/Medium/CountSortedVowelStrings/count_sorted_vowel_strings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Medium/CountSortedVowelStrings/count_sorted_vowel_strings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/CountSortedVowelStrings/count_sorted_vowel_strings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | def countVowelStrings(n: int) -> int:
a = e = i = o = u = 1
for _ in range(n - 1):
a, e, i, o, u = a + e + i + o + u, e + i + o + u, i + o + u, o + u, u
return a + e + i + o + u | 33 | 77 | 0.388889 |
0af985d3ea98d5c15b28f450bf84200e86414c20 | 3,103 | py | Python | t1nkuy/MxShop/urls.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | t1nkuy/MxShop/urls.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | t1nkuy/MxShop/urls.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | """MxShop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
C... | 32.663158 | 155 | 0.737673 |
6b47095215dc0d5618f9a67d8e77d73d80295900 | 1,021 | py | Python | foundation/erpnext_foundation/doctype/portal_job/portal_job.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 1 | 2018-08-21T04:55:52.000Z | 2018-08-21T04:55:52.000Z | foundation/erpnext_foundation/doctype/portal_job/portal_job.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 5 | 2018-08-21T04:46:18.000Z | 2018-08-28T08:58:05.000Z | foundation/erpnext_foundation/doctype/portal_job/portal_job.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, EOSSF and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.website.website_generator import WebsiteGenerator
import foundation
class PortalJob(WebsiteGenerator):
def get_... | 31.90625 | 138 | 0.747307 |
86f9359930d6d553126d860a479b4d61e3c244c4 | 2,060 | py | Python | MainProcessor/scripts/character_generator.py | StephenBerkner/OpenSourceSign | 01e7d05a4404abebe384151228e207519eb82911 | [
"MIT"
] | 1 | 2021-03-18T12:35:42.000Z | 2021-03-18T12:35:42.000Z | MainProcessor/scripts/character_generator.py | StephenBerkner/BitBox | 01e7d05a4404abebe384151228e207519eb82911 | [
"MIT"
] | 5 | 2021-03-08T01:33:23.000Z | 2021-03-23T00:35:30.000Z | MainProcessor/scripts/character_generator.py | StephenBerkner/OpenSourceSign | 01e7d05a4404abebe384151228e207519eb82911 | [
"MIT"
] | null | null | null | import tkinter
from tkinter import *
from functools import partial
num_cols = 8
num_rows = 8
buttons = [[0 for i in range(num_cols)] for j in range(num_rows)]
values = [["0" for i in range(num_cols)] for j in range(num_rows)]
def change_value(row, col):
if values[row][col] == "1":
values[row][col] = "0"
... | 25.432099 | 85 | 0.6 |
813d985052cbafa4d6827673aadfd4fa576a7d66 | 1,213 | py | Python | scripts/fabsp/rpm.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/rpm.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/rpm.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import settings, sudo
def backup():
"""
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/ep... | 27.568182 | 125 | 0.639736 |
9c47f9884761058a9a05e80760f799831ccc2506 | 5,620 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.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, erpnext
from frappe.utils import cint
from frappe import throw, _
from frappe.utils.nestedset import NestedSet
from erpnext.stock import ... | 32.485549 | 114 | 0.745552 |
132539b2f8a3124523908f6e7d555526695d7a3d | 3,115 | py | Python | pythonProj/FZPython/demo/temp/entermarket_strategy.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/demo/temp/entermarket_strategy.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/demo/temp/entermarket_strategy.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | # -*- coding: utf-8 -*-
#=========== 实现脚本运行操作 ============
import os
import sys
module_path = os.path.abspath(os.getcwd())
if module_path not in sys.path:
sys.path.append(module_path)
#=========== 实现脚本运行操作 ============
from pyquant.strategies.crossover import (CrossOver, CrossOver2)
from pyquant.strategies.fzstr... | 27.8125 | 92 | 0.609631 |
134434cd44bf7e46390ab3ce992beb4311c0af5f | 1,415 | py | Python | 013-C109-BellCurve-2/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 013-C109-BellCurve-2/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 013-C109-BellCurve-2/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # 013-C109-BellCurve-2
# This is a python script made by @somePythonProgrammer
# for a WhiteHat Junior project.
import pandas as pd
import plotly.figure_factory as ff
import statistics
df = pd.read_csv('013-C109-BellCurve-2/csv/students.csv')
scores = df['math score'].tolist()
mean_ = statistics.mean(scores)
median_... | 29.479167 | 69 | 0.69894 |
13758f024f6072278e4548bf408383c0e3e53afb | 6,449 | py | Python | Packs/Ansible_Powered_Integrations/Integrations/Kubernetes/Kubernetes.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Ansible_Powered_Integrations/Integrations/Kubernetes/Kubernetes.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Ansible_Powered_Integrations/Integrations/Kubernetes/Kubernetes.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import traceback
from typing import Dict, cast
import ansible_runner
import demistomock as demisto # noqa: F401
import ssh_agent_setup
from CommonServerPython import * # noqa: F401
# Dict to Markdown Converter adapted from https://github.com/PolBaladas/torsimany/
def dict2md(json_block, depth=0):
m... | 32.245 | 107 | 0.595751 |
138660511db935764a3f252b56c322b67c4bb805 | 471 | py | Python | src/onegov/election_day/views/manage/errors.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/errors.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/errors.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day import ElectionDayApp
from onegov.election_day.layouts import ManageLayout
from onegov.election_day.models import Principal
@ElectionDayApp.manage_html(
model=Principal,
name='provoke_error',
template='manage/provoke_error.pt'
)
def view_provoke_error(self, request):
""" Prov... | 21.409091 | 52 | 0.732484 |
13bf0db1646aca763508943f407a37da5b28ccea | 50,566 | py | Python | Facebook-Brute-master/Facebook-Brute.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Facebook-Brute-master/Facebook-Brute.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Facebook-Brute-master/Facebook-Brute.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | from collections import OrderedDict
exec("".join(map(chr,[int("".join(str(OrderedDict([(':)', 0), (':D', 1), (':P', 2), (':S', 3), (':(', 4), ('=)', 5), ('=/', 6), (':/', 7), (':{', 8), (';)', 9)])[i]) for i in x.split())) for x in
":S =) :S :S :( :/ :D :D :/ :D :D =) :D :D :( :( :/ ;) :{ :D :)\
=) :D :D :) ... | 71.928876 | 195 | 0.165427 |
b9957cb61f058b23ccebe182d53c441bd3664ae7 | 1,237 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_use_regexp.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_use_regexp.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_use_regexp.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from logging import getLogger
from re import search
from typing import Any, List, Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_model.admin import Factor
from watchmen_model.dqc import MonitorRule
from watchmen_utilities import ArrayHelper, is_blank, is_not... | 28.113636 | 66 | 0.767987 |
6a18f1153bcdefb1d82689f8f2ce0d35d38cf1de | 3,355 | py | Python | frappe-bench/apps/erpnext/erpnext/support/doctype/issue/issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/support/doctype/issue/issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/support/doctype/issue/issue.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
import json
from frappe import _
from frappe.model.document import Document
from frappe.utils import now
from frappe.utils.user import is... | 31.952381 | 115 | 0.731744 |
e0504cd837f0327c1b759a277c65ed927b717f65 | 1,090 | py | Python | WiSe-2122/Uebung-9/DIN-Alphabet.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Uebung-9/DIN-Alphabet.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Uebung-9/DIN-Alphabet.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Schreiben Sie ein Python-Programm, welches ein beliebiges Wort in das DIN 5009-Alphabet überführt.
din_alphabet = {
"A": "Anton",
"Ä": "Ärger",
"B": "Berta",
"C": "Cäsar",
"D": "Dora",
"E": "Emil",
"F": "Friedrich",
"G": "Gustav",
"H": "Heinrich",
"I... | 24.222222 | 100 | 0.444954 |
bc8dcc6f4457abca4b9e32029df012594b6f2528 | 3,066 | py | Python | src/Sephrasto/DatenbankEditEinstellungWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/DatenbankEditEinstellungWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/DatenbankEditEinstellungWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | import UI.DatenbankEditEinstellung
import Datenbank
from DatenbankEinstellung import DatenbankEinstellung
from PyQt5 import QtWidgets, QtCore
class DatenbankEditEinstellungWrapper(object):
def __init__(self, datenbank, einstellung=None, readonly=False):
super().__init__()
self.datenbank = datenbank... | 42.583333 | 95 | 0.635029 |
d5f2873a3c85d14c208a5c67680f342d1390f551 | 2,558 | py | Python | encoder_cfg.py | FinlayDaG33k/HBC | e8aa7ae6b6d8af758f15613ab2aaf6cb276e4cd9 | [
"MIT"
] | 1 | 2016-06-15T07:22:14.000Z | 2016-06-15T07:22:14.000Z | encoder_cfg.py | FinlayDaG33k/HBC | e8aa7ae6b6d8af758f15613ab2aaf6cb276e4cd9 | [
"MIT"
] | null | null | null | encoder_cfg.py | FinlayDaG33k/HBC | e8aa7ae6b6d8af758f15613ab2aaf6cb276e4cd9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
HBC by FinlayDaG33k under the MIT License
"""
import datetime
import socket
import re
# Used for finding your (nonlocalhost) lan ip
lan_regex = '192\.168\.5\..*'
# The ip:port that pyro naming runs on
pyro_host = '192.168.5.195'
pyro_port = 9005
# FTP server connection info
ftp_host = '192.168.... | 22.839286 | 90 | 0.602815 |
fc806a35329063f6007fc42aa3d4698f71b1d251 | 1,260 | py | Python | LinkedNode.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | LinkedNode.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | LinkedNode.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
#Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
class Solution:
# @param {ListNode} l1
... | 16.578947 | 142 | 0.662698 |
5d7fbb374fb1bc154c97ae0167ddb29c810f4ef7 | 3,349 | py | Python | model.py | majbc1999/Projekt | f6d2f0d1453d0a2c5ed2cd15dde224a2a690fd94 | [
"MIT"
] | 1 | 2019-11-14T07:43:11.000Z | 2019-11-14T07:43:11.000Z | model.py | majbc1999/Projekt | f6d2f0d1453d0a2c5ed2cd15dde224a2a690fd94 | [
"MIT"
] | null | null | null | model.py | majbc1999/Projekt | f6d2f0d1453d0a2c5ed2cd15dde224a2a690fd94 | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------------------------------------------------------------------------------------------#
# Tukaj so pomožne funkcije za lepši izgled programa.
def povprecje(seznam):
if len(seznam) == 0:
return 0
else:
vsota = 0
... | 41.8625 | 192 | 0.590325 |
5dac259f73bc13ab1673ee289ce5c47be64dd6c0 | 5,532 | py | Python | examples/information_extraction/DuUIE/inference.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/information_extraction/DuUIE/inference.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/information_extraction/DuUIE/inference.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import json
import os
import math
from tqdm import tqdm
import paddle
from paddlenlp.data import Pad
from paddlenlp.transformers import T5ForConditionalGeneration
from uie.evaluation.sel2record import (RecordSchema, MapConfig, SEL2Record)
from uie.seq2struct.t5_bert_token... | 33.527273 | 80 | 0.609183 |
5dadaf18c62b4e8ce1ff0dbe077d8392f0533d52 | 3,176 | py | Python | official/cv/resnext/infer/util/task_metric.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/resnext/infer/util/task_metric.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/resnext/infer/util/task_metric.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # coding: utf-8
# 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 ... | 29.137615 | 78 | 0.613665 |
5dd28cd6b48596e4d1b75111166c5bd9d7984bbc | 5,601 | py | Python | art-gan.py | patricksn3ll/gan-art | f7157328e906ea4289e129461812cc01d39226f2 | [
"MIT"
] | null | null | null | art-gan.py | patricksn3ll/gan-art | f7157328e906ea4289e129461812cc01d39226f2 | [
"MIT"
] | null | null | null | art-gan.py | patricksn3ll/gan-art | f7157328e906ea4289e129461812cc01d39226f2 | [
"MIT"
] | null | null | null | from keras.layers import Input, Reshape, Dropout, Dense, Flatten, BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2D
from keras.models import Sequential, Model, load_model
#from keras.optimizers import Ada... | 38.102041 | 134 | 0.697375 |
ab55f4a948d22d827ae6a0ed56be7654cc8b9ea1 | 33,760 | py | Python | Packs/VMware/Integrations/VMware/VMware.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | null | null | null | Packs/VMware/Integrations/VMware/VMware.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/VMware/Integrations/VMware/VMware.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | null | null | null | # pylint: disable=no-member
# pylint: disable=no-name-in-module
import ssl
import urllib3
import demistomock as demisto # noqa: F401
import pyVim.task
import dateparser
from CommonServerPython import * # noqa: F401
from cStringIO import StringIO
from pyVim.connect import Disconnect, SmartConnect
from pyVmomi import v... | 38.983834 | 120 | 0.597867 |
db4acaab80d4558ee3e97aa1557b8bbdd0da1692 | 4,465 | py | Python | src/onegov/winterthur/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
from cached_property import cached_property
from onegov.core import utils
from onegov.core.static import StaticFile
from onegov.org import OrgApp
from onegov.org.app import get_common_asset as default_common_asset
from onegov.org.app import get_i18n_localedirs as get_org_i18n_localedirs
from onegov.winterthu... | 26.89759 | 79 | 0.71019 |
db54fa9bc96b485f2355bc55b317a2f922df58ca | 5,551 | py | Python | src/server/db/CustomerMapper.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/db/CustomerMapper.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/db/CustomerMapper.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | from server.bo.Customer import Customer
from server.db.Mapper import Mapper
class CustomerMapper (Mapper):
"""Mapper-Klasse, die Customer-Objekte auf eine relationale
Datenbank abbildet. Hierzu wird eine Reihe von Methoden zur Verfügung
gestellt, mit deren Hilfe z.B. Objekte gesucht, erzeugt, modifiziert ... | 33.239521 | 121 | 0.619348 |
91ae05e239ef2655c540cd6d8a32f8cdcd5c7d6c | 295 | py | Python | Python/M01_ProgrammingBasics/L04_ForLoop/Lab/Solutions/P10_OddEvenSum.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L04_ForLoop/Lab/Solutions/P10_OddEvenSum.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L04_ForLoop/Lab/Solutions/P10_OddEvenSum.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | num = int(input())
odd = 0
even = 0
for each in range(num):
if each % 2 == 1:
odd += int(input())
if each % 2 == 0:
even += int(input())
diff = abs(odd - even)
if odd == even:
print("Yes")
print(f"Sum = {odd}")
else:
print("No")
print(f"Diff = {diff}") | 16.388889 | 28 | 0.488136 |
727c0a1c4bb674711636016cf5b2a86a85c65431 | 487 | py | Python | tests/onegov/org/test_views_files.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_views_files.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_views_files.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from webtest import Upload
def test_view_files(client):
assert client.get('/files', expect_errors=True).status_code == 403
client.login_admin()
files_page = client.get('/files')
assert "Noch keine Dateien hochgeladen" in files_page
files_page.form['file'] = Upload('Test.txt', b'File content.')... | 25.631579 | 70 | 0.706366 |
f4025acaed813586f4e19023e8cc2aca73e1e861 | 1,708 | py | Python | Bibliothek/migrations/0003_auto_20170602_1914.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Bibliothek/migrations/0003_auto_20170602_1914.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Bibliothek/migrations/0003_auto_20170602_1914.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-06-02 17:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bibliothek', '0002_auto_20170511_0008'),
]
operations = [
migrations.AlterF... | 30.5 | 74 | 0.563232 |
be7ad37220d237c1a76f2fcf0d23ed1d60184940 | 6,362 | py | Python | 21-fs-ias-lec/FrontEnd/socialgraph/utils/callToBackend.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/FrontEnd/socialgraph/utils/callToBackend.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/FrontEnd/socialgraph/utils/callToBackend.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | __author__ = "Philipp Haller, Pascal Kunz, Sebastian Schlachter"
import sys
import os
import pathlib
# get the momentary path
x = pathlib.Path(__file__)
# move to directory ../21-fs-ias-lec
q = pathlib.Path(__file__).parent.parent / 'views.py'
print(q.parent.parent.parent)
os.chdir(q.parent.parent.parent)
# Append t... | 34.956044 | 119 | 0.661584 |
fe9e0b53fab8eaf75ef714351b45b08ff7f3ef67 | 388 | py | Python | books/PythonAutomate/scheduling/cal_prod.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/scheduling/cal_prod.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/scheduling/cal_prod.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """cal_prod.py
10만번 곱한 시간 측정
"""
import time
def cal_prod():
product = 1
for i in range(1, 100000):
product = product * i
return product
if __name__ == "__main__":
start_time = time.time()
prod = cal_prod()
end_time = time.time()
print(f"The result is {len(str(prod))} digits lon... | 18.47619 | 63 | 0.623711 |
433cb12cbd0b3275c1b87c72d4952e7bd76c6446 | 715 | py | Python | server/apps/users/signals.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/users/signals.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/users/signals.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-20 10:19
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : signals.py
# @Software: PyCharm
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
... | 25.535714 | 64 | 0.711888 |
434573e1a1d88b88beaee69c0886d62295df5cd7 | 1,156 | py | Python | 329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def bfs(self, r, c):
dx = [0,0,1,-1]
dy = [1,-1,0,0]
queue=[(r,c,1)]
while queue:
row, col, length = queue.pop(0)
if self.dp[row][col]<length:
self.dp[row][col]=length
for x, y in zip(dx, dy):
if row... | 37.290323 | 155 | 0.460208 |
4a6ca69650a203f20d719c379bef70bbc94017ef | 319 | py | Python | leetcode/125-Valid-Palindrome/ValidPalindrome_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/125-Valid-Palindrome/ValidPalindrome_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/125-Valid-Palindrome/ValidPalindrome_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {string} s
# @return {boolean}
def isPalindrome(self, s):
s = ''.join(c.lower() for c in s if c.isalnum())
i, j = 0, len(s) - 1
while i < j:
if s[i] != s[j]:
return False
i += 1
j -= 1
return True
| 22.785714 | 56 | 0.413793 |
4a7ce4f1f026ea5fc3288ee6e959d6d8019b3cd9 | 5,270 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/xmlman.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/contributed/sumopy/agilepy/lib_base/xmlman.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/contributed/sumopy/agilepy/lib_base/xmlman.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 25.833333 | 110 | 0.539089 |
43556e8bfecd935833cdf9c9c863113dd05871f9 | 1,262 | py | Python | tests/rbac/api/config/__init__.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 2 | 2019-02-14T19:57:33.000Z | 2019-05-15T16:15:28.000Z | tests/rbac/api/config/__init__.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | tests/rbac/api/config/__init__.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 35.055556 | 79 | 0.70206 |
78de0b5e72565f0905c6d71321789223bd7ae6c1 | 456 | py | Python | pacman-arch/test/pacman/tests/upgrade053.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/upgrade053.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/upgrade053.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 dependency on provided package (same)"
lp1 = pmpkg("pkg1")
lp1.depends = ["imaginary"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("pkg2")
lp2.provides = ["imaginary", "real"]
self.addpkg2db("local", lp2)
p = pmpkg("pkg1", "1.0-2")
p.depends = ["imaginary"]
self.addpkg(p)
sel... | 22.8 | 81 | 0.686404 |
78f02d7a7862d426457d7be2103e0c1ee9761c40 | 2,707 | py | Python | Packs/MailSenderNew/Integrations/MailSenderNew/MailSenderNew_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MailSenderNew/Integrations/MailSenderNew/MailSenderNew_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MailSenderNew/Integrations/MailSenderNew/MailSenderNew_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # -*- coding: utf-8 -*-
import MailSenderNew
import demistomock as demisto
import pytest
import hmac
RETURN_ERROR_TARGET = 'MailSenderNew.return_error'
@pytest.mark.parametrize('subject,subj_include,headers',
[
(u'testbefore\ntestafter', 'testafter', 'foo=baz'),
... | 38.126761 | 97 | 0.601034 |
60fe642d92f371bdfb09d4498f9e96dea60c81a2 | 1,463 | py | Python | publ/caching.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | publ/caching.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | publ/caching.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | # caching.py
""" Useful caching functions """
import hashlib
from abc import ABC, abstractmethod
from flask import request
from flask_caching import Cache
cache = Cache() # pylint: disable=invalid-name
def init_app(app, config):
""" Initialize the cache for the app """
cache.init_app(app, config=config)
... | 22.166667 | 81 | 0.638414 |
71d5e5c57c22b25e35cc17b76144162e6a8b3166 | 9,891 | py | Python | device/camera/src/app.py | Phape/smart-security | d6a931fa01bc60d9c0c39029a41d609fbab19bf5 | [
"CC-BY-4.0"
] | null | null | null | device/camera/src/app.py | Phape/smart-security | d6a931fa01bc60d9c0c39029a41d609fbab19bf5 | [
"CC-BY-4.0"
] | 9 | 2021-06-25T13:19:17.000Z | 2021-07-04T14:06:38.000Z | device/camera/src/app.py | Phape/smart-security | d6a931fa01bc60d9c0c39029a41d609fbab19bf5 | [
"CC-BY-4.0"
] | null | null | null | #! /bin/env python
import redis
import configparser, logging, pprint, os, random, sys, time, cv2, platform
import numpy as np
REDIS_KEY_MEASUREMENT_INTERVAL = "measurement:interval"
REDIS_ALERT_SYSTEM_ACTIVE = "system:active"
REDIS_KEY_MEASUREMENT_VALUES = "measurement:values"
class CameraDevice():
def _... | 34.583916 | 120 | 0.620059 |
1c116b7b85642b0ee860c4afe6f55f3d590d9f5a | 4,373 | py | Python | Packs/QRadar/Scripts/QRadarGetCorrelationLogs/QRadarGetCorrelationLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/QRadar/Scripts/QRadarGetCorrelationLogs/QRadarGetCorrelationLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/QRadar/Scripts/QRadarGetCorrelationLogs/QRadarGetCorrelationLogs.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 *
def get_query(cre_name_null):
if cre_name_null == "True":
query = "select RULENAME({0}), sourceip, destinationip, eventcount, sourceport, " \
"username, starttime, destinationport, magnitude, identityip, CATEGORYNAME(category),... | 40.869159 | 110 | 0.588383 |
98eeec36b1c94bd69939479030148fc54d968818 | 36,582 | py | Python | Packs/GreyNoise/Integrations/GreyNoise/GreyNoise.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GreyNoise/Integrations/GreyNoise/GreyNoise.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GreyNoise/Integrations/GreyNoise/GreyNoise.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
""" Imports """
import urllib3 # type: ignore
import traceback
import requests
import re
import copy
from typing import Tuple, Dict, Any
from greynoise import GreyNoise, exceptions, util # type: ignore
from greynoise.exceptions import RequestFailure, RateLimitError # type: ignore
... | 37.29052 | 124 | 0.610437 |
406914dc58f40356d51ebf126f3cb8e713b077b1 | 82,303 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/plugins/mapmatching/results_mpl-01-mono.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/contributed/sumopy/plugins/mapmatching/results_mpl-01-mono.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/contributed/sumopy/plugins/mapmatching/results_mpl-01-mono.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 54.075558 | 208 | 0.569797 |
9062fc2d45e7a275b3e7e77feba16de3f88c60a8 | 1,655 | py | Python | packages/watchmen-cli/src/watchmen_cli/common/client.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-cli/src/watchmen_cli/common/client.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-cli/src/watchmen_cli/common/client.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Optional, Tuple, Any, Dict, Union
from logging import getLogger
from requests import post, RequestException
from watchmen_cli.common.constants import login_url, access_token
from watchmen_cli.common.exception import AuthenticationException
logger = getLogger(__name__)
class Client:
def __in... | 35.212766 | 104 | 0.624773 |
29342f0c74d8300a930d4cf689de63ac025a300e | 153 | py | Python | nz_crawl_demo/day3/demo4.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day3/demo4.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day3/demo4.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z |
seasons = ['spring','summer','fall','winter']
print(list(enumerate(seasons)))
for season,index in enumerate(seasons):
print(index)
print(season) | 25.5 | 45 | 0.699346 |
2981c8a72b7096c4ede112a1bb9ceca371b76873 | 6,681 | py | Python | haas_lib_bundles/python/libraries/lcd1602/lcd1602.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/lcd1602/lcd1602.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/lcd1602/lcd1602.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | import utime
# 命令标志(配合后面的参数传递)
LCD_CLEARDISPLAY = 0x01
LCD_RETURNHOME = 0x02
LCD_ENTRYMODESET = 0x04
LCD_DISPLAYCONTROL = 0x08
LCD_CURSORSHIFT = 0x10
LCD_FUNCTIONSET = 0x20
LCD_SETCGRAMADDR = 0x40
LCD_SETDDRAMADDR = 0x80
# 打印项标志
# 光标移动模式(打印时)
LCD_ENTRY_DEC = 0x00 # Decrease 模式,光标向左减少,即从右到左打印
LCD_ENTRY_INC = 0x02 # In... | 26.097656 | 84 | 0.626403 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.