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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
738da3aafd326eac7396f2d8597a9ed6a5308ef2 | 6,677 | py | Python | tests/rbac/common/assertions/key.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/rbac/common/assertions/key.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/rbac/common/assertions/key.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # 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 ... | 42.801282 | 86 | 0.702711 |
8384c7dc83ddb4e7c8ed76df8619f0b612ea928a | 370 | py | Python | exercises/pt/solution_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Berlin is a nice city")
# Iterar nos tokens
for token in doc:
# Verifica se o token atual é um substantivo próprio.
if token.pos_ == "PROPN":
# Verifica se o próximo token é um verbo
if doc[token.i + 1].pos_ == "VERB":
prin... | 28.461538 | 65 | 0.640541 |
83c6133d5ab28e0457c672ccdadcee4994046af1 | 682 | py | Python | linear_data_structure/best_time_to_buy_and_sell_stock.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | linear_data_structure/best_time_to_buy_and_sell_stock.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | linear_data_structure/best_time_to_buy_and_sell_stock.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | import sys
from typing import List
def maxProfit_brute_force(prices: List[int]) -> int:
max_price = 0
for i, price in enumerate(prices):
for j in range(i, len(prices)):
max_price = max(prices[j] - price, max_price)
return max_price
def maxProfit_Kadanes(prices: List[int]) -> int:
... | 22 | 57 | 0.651026 |
79134acaa833a965bf2edf94b06847d2f288049a | 2,923 | py | Python | test/test_npu/test_network_ops/test_tril.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_tril.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_tril.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 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/lice... | 37.474359 | 108 | 0.660965 |
5837df7ae8b3b0619f927476c91a7d0f28561ac5 | 3,397 | py | Python | snake/hadOG.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | snake/hadOG.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | snake/hadOG.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | from tkinter import Tk, Canvas
from random import randint
class Bunka:
def __init__(self, x,y):
self.vzhled = platno.create_rectangle(x*VEL,y*VEL+50, (x+1)*VEL, (y+1)*VEL + 50, fill="white",width=0)
self.cislo = 0
#self.text = platno.create_text(x*VEL+VEL/2, y*VEL+VEL/2 + 50, text = "0", an... | 30.061947 | 115 | 0.499558 |
54bf5f5c9e4281becf7b4687643faf8d21849474 | 1,198 | py | Python | python/coursera_python/WESLEYAN/week3/COURSERA/week_3/count_words.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/WESLEYAN/week3/COURSERA/week_3/count_words.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/WESLEYAN/week3/COURSERA/week_3/count_words.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 29 19:46:42 2017
@author: root
"""
# -count_words.py *- coding: utf-8 -*-
import sys
filename = sys.argv[1]
# print("\n",filename,"\n") # You can check that the filename is correct
text_file = open(filename) # open the file for reading
... | 33.277778 | 75 | 0.661102 |
3fb97c881c85959537b8a2aaf4c90f6a3db9f93e | 36 | py | Python | lib/python3.5/tempfile.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/tempfile.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/tempfile.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/tempfile.py | 36 | 36 | 0.805556 |
3fc2ecdc29177b616df5342cd72fee12b0128df5 | 157 | py | Python | python/deep_learning/FUNCTIONAL/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/deep_learning/FUNCTIONAL/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/deep_learning/FUNCTIONAL/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def running_sum(numbers, start=0):
if len(numbers) == 0:
print()
return
total = numbers[0] + start
print(total,end="")
running_sum(numbers[1:],total)
| 19.625 | 34 | 0.675159 |
b77e564f01912cedaa7b35edeafdfb0ff59fb34c | 28,052 | py | Python | python/oneflow/utils/vision/transforms/functional.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/utils/vision/transforms/functional.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/utils/vision/transforms/functional.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
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.165986 | 117 | 0.645409 |
b7a915028c6ddb65e436ca5cdd25b368728be6d1 | 405 | py | Python | ebenezer/atencion/migrations/0010_level_orden.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | ebenezer/atencion/migrations/0010_level_orden.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:15:00.000Z | 2021-06-10T20:52:17.000Z | ebenezer/atencion/migrations/0010_level_orden.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.2 on 2018-10-05 17:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('atencion', '0009_level'),
]
operations = [
migrations.AddField(
model_name='level',
name='orden',
field=... | 20.25 | 49 | 0.580247 |
4d2a3b1d6f0ad35aaed7ffb5e1ea9fabff02990f | 4,115 | py | Python | canopy.py | lizhanlian/CanopyByPython | 89f94f7b2713c536afbcbded43534b28977cfb24 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | Canopy/canopy.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | Canopy/canopy.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | # -*- coding: utf-8 -*-
# @Author: Alan Lau
# @Date: 2017-09-05 22:56:16
# @Last Modified by: Alan Lau
# @Last Modified time: 2017-09-05 22:56:16
import math
import random
import numpy as np
from datetime import datetime
from pprint import pprint as p
import matplotlib.pyplot as plt
# 随机生成500个二维[0,1)平面点
dataset = n... | 31.174242 | 79 | 0.513487 |
4d58cac56450dac5968ed2736596681fdac1a542 | 2,389 | py | Python | src/doc/tutorials/tutorial_examples/scripting/listing_8_extracting_aggregate_values.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/doc/tutorials/tutorial_examples/scripting/listing_8_extracting_aggregate_values.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/doc/tutorials/tutorial_examples/scripting/listing_8_extracting_aggregate_values.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | ###########################################
# file: VisIt Scripting Tutorial Listing 8
###########################################
#
# 1) Run visit from the CLI as described below.
#
####################
# Example that demonstrates looping over a dataset
# to extract an aggregate value at each timestep.
#
# visit -... | 27.77907 | 102 | 0.583089 |
4db6fb4ee5c0300f7aef13f6f4f783c3cb480226 | 254 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/092_classes-POO/treinando/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/092_classes-POO/treinando/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/092_classes-POO/treinando/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from treinando import IndoShow
p1 = IndoShow()
# Ingresso acabou
p1.fila()
p1.fila()
p1.acabou()
p1.comprando_ingresso()
print('#' * 30)
# Tem o ingresso
p1.fila()
p1.fila()
p1.comprando_ingresso()
p1.transporte('719')
p1.durante_show('foda'.upper())
| 14.111111 | 31 | 0.708661 |
422213a77508b25409e7cf9fd8e17698faf731df | 377 | py | Python | DeepRTS/python/test/test_deeprts.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 144 | 2018-07-13T07:47:50.000Z | 2022-03-31T06:29:50.000Z | DeepRTS/python/test/test_deeprts.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 18 | 2019-03-29T10:37:01.000Z | 2022-03-02T12:47:34.000Z | DeepRTS/python/test/test_deeprts.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 23 | 2018-11-02T18:12:51.000Z | 2022-02-15T20:32:18.000Z | import unittest
from DeepRTS import python
from DeepRTS import Engine
class TestDeepRTSGame(unittest.TestCase):
def setUp(self) -> None:
self.game = python.Game(
python.Config.Map.FIFTEEN,
n_players=1,
engine_config=None,
gui_config=None,
)
def... | 22.176471 | 42 | 0.623342 |
35f64e5ea885dff7a24fde0bb4e276d16b71487a | 373 | py | Python | leetcode/141-Linked-List-Cycle/LinkedListCycle_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/141-Linked-List-Cycle/LinkedListCycle_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/141-Linked-List-Cycle/LinkedListCycle_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param head, a ListNode
# @return a boolean
def hasCycle(self, head):
if head == None or head.next == None:
return False
slow = fast = head
while fast and fast.next:
slow = slow.next
fast = fast.next.next
if slow == fa... | 26.642857 | 45 | 0.509383 |
6792ab9177e5f849432e7e1487362888318a09f4 | 92 | py | Python | 2014/11/student-debt/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/11/student-debt/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/11/student-debt/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 = '14muD-D_AKwFCTeXRSoWx8pmbFXwQRdQjUFC6S0Uu_FA'
| 23 | 68 | 0.836957 |
67a17be4cb65404aae1822aa913066e8852c12de | 14,425 | py | Python | Solver.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | Solver.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | Solver.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | import numpy as np
import hashlib
import copy
import datetime
import threading
# Notation: [ROW][COL]
# Note: Add Forbidden Cells to improve the efficiency
# Check duplicate state in the search tree, keep DEPTH info
# Add Progress Monitoring
# ?Store Search Nodes for next batch
# ?Add Heuristic... | 25.530973 | 104 | 0.538094 |
fbf2982b96cd59bdb1694db2faea05735a1f8913 | 227 | py | Python | Contests/CCC/CCC '18 J1 - Telemarketer or not.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '18 J1 - Telemarketer or not.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '18 J1 - Telemarketer or not.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | num = [0 for n in range(4)]
for i in range(4):
num[i] = int(input(""))
failed = False
if (num[0] == 8 or num[0] == 9) and (num[3] == 8 or num[3] == 9) and (num[1] == num[2]):
print("ignore")
else:
print("answer") | 20.636364 | 88 | 0.515419 |
2225ca05574efa4c5b8f771ee48a67c6618094e5 | 846 | py | Python | python/pyqt/LearnPyQt/q_list_box.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/q_list_box.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/q_list_box.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QListWidget
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowTitle("Jayone's Awesome App")
widget = QListWidge... | 24.882353 | 69 | 0.670213 |
97eae9962de314f43d1518f7a3879454790ab9ac | 1,221 | py | Python | tests/test_rec.py | supcik/pymdown-include | fe426425e646d9111d230885b96d605fa78a62c0 | [
"Apache-2.0"
] | null | null | null | tests/test_rec.py | supcik/pymdown-include | fe426425e646d9111d230885b96d605fa78a62c0 | [
"Apache-2.0"
] | null | null | null | tests/test_rec.py | supcik/pymdown-include | fe426425e646d9111d230885b96d605fa78a62c0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Jacques Supcik
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 25.4375 | 76 | 0.661753 |
3f26aa0f6c35a62ad963ac41005256780bd39a53 | 612 | py | Python | TEDx/Titles_starting_0_to_9/parse.py | gt-big-data/TEDVis | 328a4c62e3a05c943b2a303817601aebf198c1aa | [
"MIT"
] | null | null | null | TEDx/Titles_starting_0_to_9/parse.py | gt-big-data/TEDVis | 328a4c62e3a05c943b2a303817601aebf198c1aa | [
"MIT"
] | null | null | null | TEDx/Titles_starting_0_to_9/parse.py | gt-big-data/TEDVis | 328a4c62e3a05c943b2a303817601aebf198c1aa | [
"MIT"
] | 2 | 2018-02-06T00:00:44.000Z | 2019-06-04T12:43:41.000Z |
from os import listdir
import os
from os.path import isfile, join
from operator import itemgetter, attrgetter
def getWords()
onlyfiles = [f for f in listdir(".") if isfile(join(".", f))]
#print(onlyfiles)
#wordDict = {}
for file in onlyfiles:
with open(file) as f:
lines = f.readlines()
for line in line... | 19.125 | 63 | 0.661765 |
e1468d99ac818a6e67f218ca7a52aea9dae60a7e | 3,040 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_test_test__parameters.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_test_test__parameters.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_test_test__parameters.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_ctypes_test_test__parameters.py,v 1.1.2.2 2021/10/13 21:04:01 tm Exp $
Fix CVE-2021-3177: Replace snprintf with Python unicode formatting in ctypes param reprs
Via Fedora:
https://src.fedoraproject.org/rpms/python2.7/blob/rawhide/f/00357-CVE-2021-3177.patch
--- Lib/ctypes/test/test_parameters.py.or... | 51.525424 | 120 | 0.587171 |
e1c1bbfefae2fb9a99ece53845e322214f25de58 | 963 | py | Python | src/onegov/wtfs/forms/daily_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/daily_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/daily_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.form import Form
from onegov.wtfs import _
from onegov.wtfs.models import DailyListBoxes
from onegov.wtfs.models import DailyListBoxesAndForms
from wtforms import RadioField
from wtforms.fields.html5 import DateField
from wtforms.validators import InputRequired
class DailyListSel... | 28.323529 | 79 | 0.659398 |
3d5174f2a4cfda47eefc6a675bad3294c304b4a9 | 4,130 | py | Python | Session01_MLOPs_Introduction_and_Version_Control/train.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session01_MLOPs_Introduction_and_Version_Control/train.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session01_MLOPs_Introduction_and_Version_Control/train.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | '''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
In our example we will be using data that can be downloaded at:
https://www.kaggle.com/tongpython/cat-and-dog
In our setup, it expects:
- a data/ folder
- train/ and validation/ subfolder... | 32.015504 | 79 | 0.676513 |
62ec2f94cbcbdd78f620bbef2daa3608432ad829 | 29,618 | py | Python | Contrib-Inspur/openbmc/poky/scripts/lib/devtool/upgrade.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/scripts/lib/devtool/upgrade.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/scripts/lib/devtool/upgrade.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Development tool - upgrade command plugin
#
# Copyright (C) 2014-2017 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
"""Devtool upgrade plugin"""
import os
import sys
import re
import shutil
import tempfile
import logging
import argparse
import scriptutils
import errno
import bb
devtool_path = os.pat... | 46.278125 | 328 | 0.616112 |
9a7b4d402db24796ec56540c1cb6044fc9897249 | 568 | py | Python | leetcode/047-Permutations-II/Perm2_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/047-Permutations-II/Perm2_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/047-Permutations-II/Perm2_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[]} nums
# @return {integer[][]}
def permuteUnique(self, nums):
if len(nums) == 0:
return nums
if len(nums) == 1:
return [nums]
res = []
bag = set()
for i in range(len(nums)):
if nums[i] not in bag:... | 25.818182 | 49 | 0.431338 |
9adb33ebc25743fa7aa526d82eedcac7bf67689a | 3,450 | py | Python | RDS/circle3_central_services/research_manager/src/tests/test_port.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/tests/test_port.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/tests/test_port.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import unittest
from lib.Port import Port
class Test_Port(unittest.TestCase):
def test_port_init(self):
portSmall = Port("port-owncloud")
portOwncloud = Port("port-owncloud", fileStorage=True)
portInvenio = Port("port-invenio", fileStorage=True, metadata=True)
expected = {
... | 31.081081 | 79 | 0.522899 |
7738a2201c4cade1bc245480457c84ed590c0f74 | 4,353 | py | Python | scripts/minimax_plain_depth_analysis.py | lschmidt2507/Facharbeit2022 | a40cb76302d2e569f7714e3bf9472206a3eaa253 | [
"CC0-1.0"
] | null | null | null | scripts/minimax_plain_depth_analysis.py | lschmidt2507/Facharbeit2022 | a40cb76302d2e569f7714e3bf9472206a3eaa253 | [
"CC0-1.0"
] | null | null | null | scripts/minimax_plain_depth_analysis.py | lschmidt2507/Facharbeit2022 | a40cb76302d2e569f7714e3bf9472206a3eaa253 | [
"CC0-1.0"
] | null | null | null | #minimax_plain_depth_analysis.py
import threading
import time
import math
from game_handler import printGame,generateTilesInfo,countPoints,readBoard,makeMove,undoMove,possibleMoves
startdepth=1
maxTime=30
global delayRunning
# funtion for stopping computation after a certain delay(is called using threadin... | 35.390244 | 195 | 0.599586 |
f3228f2877394dfb94b3a165dcf99c3a6e3773b4 | 1,231 | py | Python | INBa/2015/Shirlin_V_V/task_7_32.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shirlin_V_V/task_7_32.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shirlin_V_V/task_7_32.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задание 3. Вариант 32
#Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
#Ширлин Вячеслав Викторович
#29.04.2016
import random
print ("Компьютер загадывает рандомно название одного из шести раздновидностей тигров ( Ам... | 37.30303 | 198 | 0.713241 |
b260d1bfbe283492c5b38264a3c0ee3b3f52d332 | 444 | py | Python | config.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | config.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | config.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
BOOTSTRAP_SERVE_LOCAL = True
DATA_FILENAME = "data.json"
... | 31.714286 | 76 | 0.698198 |
b26c92e6cded8be8848e5349576722b9c32a73fb | 30,130 | py | Python | fence/resources/google/validity.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | fence/resources/google/validity.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | fence/resources/google/validity.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | """
Objects with validity checking for Google service account registration.
"""
from collections import Mapping
from fence.errors import NotFound
from fence.resources.google.utils import (
get_registered_service_accounts_with_access,
get_project_access_from_service_accounts,
get_users_from_google_members,
... | 37.382134 | 95 | 0.580916 |
b2869f264e5ec055d354b7221146603060adb850 | 1,059 | py | Python | tests/unittests.py | MarkusWET/secure_password_website | 257d0e7d463dea4777d5d92f7f56499f2a4b5044 | [
"MIT"
] | null | null | null | tests/unittests.py | MarkusWET/secure_password_website | 257d0e7d463dea4777d5d92f7f56499f2a4b5044 | [
"MIT"
] | null | null | null | tests/unittests.py | MarkusWET/secure_password_website | 257d0e7d463dea4777d5d92f7f56499f2a4b5044 | [
"MIT"
] | null | null | null | import unittest
from app import app
class LoginTests(unittest.TestCase):
# initialization logic for the test suite declared in the test module
# code that is executed before all tests in one test run
@classmethod
def setUpClass(cls):
pass
# clean up logic for the test suite declared in th... | 23.021739 | 73 | 0.647781 |
ac302097036ee59eacad5e760cb4e23573204574 | 2,559 | py | Python | Plugins/CharakterAssistent/ChoicePopup.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | Plugins/CharakterAssistent/ChoicePopup.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | Plugins/CharakterAssistent/ChoicePopup.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ChoicePopup.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, ... | 42.65 | 115 | 0.726846 |
5a3e17f7daaec820e968699d573c3d946fc4ce53 | 305 | py | Python | python/advanced_sw/KALO/VERSION 0.01/SAFE1AUG/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/KALO/VERSION 0.01/SAFE1AUG/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/KALO/VERSION 0.01/SAFE1AUG/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from AppOperations import AppOperations as ao
from AppOperations import Rec
from MISman import MIS_calculations
#ao.update_Sl(3,'2018-07-30T20:15:54')
#ao.reset_slno()
#k = Rec.timestmp()
#print("Type of k : ",type(k))
#print(Rec.timestmp())
val = "T-93"
MIS_calculations.separate_data("recpt_fees",7800) | 27.727273 | 49 | 0.757377 |
5a6931d58b8671b50665f886f638591bf11ede91 | 1,141 | py | Python | apps/profile/forms.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/profile/forms.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/profile/forms.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django import forms
from . import models
from apps.user.models import User
class ProfileForm(forms.ModelForm):
class Meta:
model = models.Profile
fields = ['company', 'info', 'expert', 'visibility_mail',
'visibility_company', 'visibility_info',
'visibility_f... | 26.534884 | 66 | 0.64943 |
5a7e89ea99485fdfe11232f18d5f2e849a57de5d | 511 | py | Python | exercises/zh/test_02_10_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/test_02_10_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/test_02_10_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
"span1.similarity(span2)" in __solution__ or "span2.similarity(span1)" in __solution__
), "你有计算两个span之间的相似度吗?"
assert span1.text == "不错的餐厅", "你有正确生成span1吗?"
assert span2.text == "很好的酒吧", "你有正确生成span2吗?"
assert (
0 <= float(similarity) <= 1
), "相似度分数是一个浮点数。你确定... | 31.9375 | 94 | 0.634051 |
ce82cdf35ef59afa5f450a19c5787aa7f88c7de1 | 474 | py | Python | src/onegov/user/forms/group.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/group.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/group.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.user import _
from wtforms import StringField
from wtforms.validators import InputRequired
class UserGroupForm(Form):
""" A generic user group form for onegov.user """
name = StringField(
label=_("Name"),
validators=[
InputRequired()
... | 20.608696 | 53 | 0.64557 |
f01349868e6457e0582c7d0d91e3e5669f7e8783 | 1,737 | py | Python | official/cv/ADNet/src/utils/get_train_videos.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/get_train_videos.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/get_train_videos.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.1875 | 106 | 0.690271 |
f03131d13835998178c7387f1b8862b539905b72 | 1,006 | py | Python | comp/microsoft/000_missinteger.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/microsoft/000_missinteger.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/microsoft/000_missinteger.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | '''
https://app.codility.com/demo/results/demoHZEZJ5-D8X/
This is a demo task.
Write a function:
def solution(A)
that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
Give... | 21.869565 | 118 | 0.626243 |
e8de0a5350f0eb2bba79c4cfc6c1b4b6f0111a26 | 3,454 | py | Python | official/gnn/bgcf/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/gnn/bgcf/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/gnn/bgcf/postprocess.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... | 45.447368 | 104 | 0.563984 |
9bf4c32944555678c0be8c28962fc849b5a956b9 | 484 | py | Python | src/onegov/feriennet/views/userprofile.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/userprofile.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/userprofile.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Personal
from onegov.feriennet import FeriennetApp
from onegov.feriennet.forms import UserProfileForm
from onegov.org.models import Organisation
from onegov.org.views.userprofile import handle_user_profile
@FeriennetApp.form(
model=Organisation, name='userprofile', template='userp... | 37.230769 | 70 | 0.82438 |
c5afc372c05e400d4752b1d45d198e8ddd4705c6 | 2,349 | py | Python | crypto/PsychECC/src/server.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/PsychECC/src/server.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/PsychECC/src/server.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | from collections import namedtuple
import random
from secret import flag
from Crypto.Util.number import inverse
def moddiv(x,y,p):
return (x * inverse(y,p)) %p
Point = namedtuple("Point","x y")
class EllipticCurve:
INF = Point(0,0)
def __init__(self, a, b, p):
self.a = a
self.b = b
s... | 33.557143 | 119 | 0.60281 |
7684a56cfccea3087f6327413a98d6b00995719f | 469 | py | Python | tests/test_all.py | simonhodder/spark | 1062e3092996f82f7bc2c852d6444c2be2a1e296 | [
"MIT"
] | null | null | null | tests/test_all.py | simonhodder/spark | 1062e3092996f82f7bc2c852d6444c2be2a1e296 | [
"MIT"
] | null | null | null | tests/test_all.py | simonhodder/spark | 1062e3092996f82f7bc2c852d6444c2be2a1e296 | [
"MIT"
] | null | null | null |
import pytest
from spark import Session
from spark.model import User
from spark.model import Address
def test_all():
session = Session()
a = Address(
house_num=10,
street='Baker Street',
city='London')
u = User(
first_name='Sherlock',
family_name='Holmes',
... | 15.129032 | 31 | 0.594883 |
4f2a92425277c903d75696c5a298df085cce0c21 | 1,602 | py | Python | Organisation/Recherche/Wordcloud/history/tests_wordcloud_pil.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | Organisation/Recherche/Wordcloud/history/tests_wordcloud_pil.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | Organisation/Recherche/Wordcloud/history/tests_wordcloud_pil.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import numpy as np
import PIL
from PIL import Image
# Quelle: https://stackoverflow.com/questions/30227466/combine-several-images-horizontally-with-python
# Kombinieren von 4 Zahlen
year = str(19)
list_im = ['mask_0.jpg', 'mask_1.jpg', 'mask_2.jpg', 'mask_3.jpg', 'mask_4.jpg', 'mask_5.jpg', 'mask_6.jpg',
... | 30.807692 | 110 | 0.58427 |
96f3561c120d67b53ea714ac978d7f6ac7ee4115 | 2,537 | py | Python | andinopy/base_devices/terminal.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/base_devices/terminal.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/base_devices/terminal.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | # _ _ _
# / \ _ __ __| (_)_ __ ___ _ __ _ _
# / _ \ | '_ \ / _` | | '_ \ / _ \| '_ \| | | |
# / ___ \| | | | (_| | | | | | (_) | |_) | |_| |
# /_/ \_\_| |_|\__,_|_|_| |_|\___/| .__/ \__, |
# |_| |___/
# by Jakob Groß
import sys
from an... | 39.030769 | 108 | 0.638944 |
96fb170a7a6d9f10eaa8fe7068f29425d7106d74 | 931 | py | Python | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Exercises/Solutions/P08_OnTimeForTheExam.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Exercises/Solutions/P08_OnTimeForTheExam.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Exercises/Solutions/P08_OnTimeForTheExam.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | hour_exam = int(input())
min_exam = int(input())
hour_arrival = int(input())
min_arrival = int(input())
status = 0
exam_time = (hour_exam * 60) + min_exam
arrival_time = (hour_arrival * 60) + min_arrival
difference = arrival_time - exam_time
if difference > 0:
status = "Late"
elif difference < -30:
status =... | 21.651163 | 69 | 0.640172 |
8c08eb958f63b96fead9449d21847b5bbe851075 | 3,879 | py | Python | DIT/jazmin_settings.py | antonnifo/DIT | 7c496f37bab70229cd84c4b33332708ea8cf278b | [
"MIT"
] | null | null | null | DIT/jazmin_settings.py | antonnifo/DIT | 7c496f37bab70229cd84c4b33332708ea8cf278b | [
"MIT"
] | null | null | null | DIT/jazmin_settings.py | antonnifo/DIT | 7c496f37bab70229cd84c4b33332708ea8cf278b | [
"MIT"
] | null | null | null | JAZZMIN_SETTINGS = {
# title of the window
'site_title': 'DIT Admin',
# Title on the brand, and the login screen (19 chars max)
'site_header': 'DIT',
# square logo to use for your site, must be present in static files, used for favicon and brand on top left
'site_logo': 'data_log_sheet/img/log... | 31.795082 | 114 | 0.599123 |
d78484879a758531427928b0c252ba3e8a3160ed | 3,102 | py | Python | python/en/archive/topics/command_line_arguments/TODOs/02-cmd_line_args_parsing2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/command_line_arguments/TODOs/02-cmd_line_args_parsing2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/command_line_arguments/TODOs/02-cmd_line_args_parsing2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, getopt
# 2019-03-01 (Fri)
# TODO: Make this script work!
def usage():
print("usage: python3 02-cmd_line_args_parsing2.py arg1 arg2 arg3")
def print_opts():
print("file_name =", file_name )
print("argc =", argc )
print("argv =", argv )
p... | 28.722222 | 88 | 0.626692 |
d1618676c96751aae62213eeddfc4719ddc88479 | 660 | py | Python | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File : main.py
@Description: helloworld案例 - 周期性打印"helloworld"到console中
@Author : ethan.lcz
@version : 1.0
'''
# import utime # 延时函数在utime库中
# if __name__ == '__main__':
# while True: # 无限循环
# print("hellworld") #... | 22 | 58 | 0.619697 |
7e6298887a3a629ee0e03a11f571bf4451a16fc2 | 4,621 | py | Python | tests/ingestion/transformers/monosi/test_metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | tests/ingestion/transformers/monosi/test_metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | tests/ingestion/transformers/monosi/test_metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from datetime import datetime
from uuid import uuid4
import pytest
import ingestion.transformers.monosi.metrics as metrics
@pytest.fixture
def metric():
return {
"id": str(uuid4().hex),
"table_name": "table",
"schema": "schema",
"database": "database",
"column_name": "col_... | 29.621795 | 98 | 0.675179 |
0eb131abaf4798bda047b122c8add371333f91a3 | 347 | py | Python | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/module2/titanic_exploration.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/module2/titanic_exploration.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_Past-Projects/LambdaSQL-master/LambdaSQL-master/module2/titanic_exploration.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """
Titanic Data
"""
import psycopg2
from module2.creds import cred
cloud = psycopg2.connect(
dbname=cred.dbname,
user=cred.user,
password=cred.password,
host=cred.host,
)
curs = cloud.cursor()
curs.execute("""
SELECT name, age
FROM Titanic
WHERE Age < 18 and sex = 'female';
""")
print("Kids:", *... | 13.88 | 42 | 0.657061 |
7ebce8954edc68f34f0304cb662e16a466838526 | 400 | py | Python | src/main/bootup.py | MBogert/ReminderCory | a687c70a12f49a807d9fb023d45f799292a37f26 | [
"MIT"
] | null | null | null | src/main/bootup.py | MBogert/ReminderCory | a687c70a12f49a807d9fb023d45f799292a37f26 | [
"MIT"
] | null | null | null | src/main/bootup.py | MBogert/ReminderCory | a687c70a12f49a807d9fb023d45f799292a37f26 | [
"MIT"
] | null | null | null | def main():
# Pseudo-Implementation
# TODO Implement logic in comment lines
# Initialize Logger
# Initialize db from data-file
# Initialize cory
# Health checks (if any)
# Welcome message
# Begin runtime (initialize at idle)
if __name__ == "__main__":
main()
# TODO implementations
def initialize_cory:
de... | 17.391304 | 40 | 0.7375 |
adf523b4f68706e9e2562370ca9d27049107c8ca | 278 | py | Python | backend/apps/iamstudent/migrations/0011_merge_20200404_2309.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/migrations/0011_merge_20200404_2309.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/migrations/0011_merge_20200404_2309.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-02 23:09
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('iamstudent', '0010_custom_migration'),
('iamstudent', '0009_merge_20200402_2309'),
]
operations = [
]
| 18.533333 | 51 | 0.654676 |
adfe5d6ffd067abf150a81bc59a5b806061cdc34 | 3,365 | py | Python | v302/python/mittelwert-kondensator.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v302/python/mittelwert-kondensator.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v302/python/mittelwert-kondensator.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
from scipy.stats import sem
print('====================')
print('Kondensator ANFANG')
print('====================')
print('Wert 1 ANFANG')
cao2 = 994 * 10**(-9)
pot1 = 6.03
c2 = ufloat(cao2, cao2 * 0.002)
pot2 = 10 - pot1
pot3 = pot... | 23.368056 | 89 | 0.608024 |
70d5472dbe1d12ec14a16666a43deb4ff0e8ae72 | 1,218 | py | Python | python/data_sutram/scraper/test_im.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/test_im.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/test_im.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # Mechanize headless
import mechanize
from cookielib import CookieJar
import urllib
# Browser
br = mechanize.Browser()
# Cookie Jar
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)
# Browser options
br.set_handle_equiv(True)
br.set_handle_gzip(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_hand... | 32.918919 | 137 | 0.731527 |
1ddf2922520f6aa4bfc3738376a3a0ecbbf5263e | 855 | py | Python | tests/integration/test_resource_groups.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | tests/integration/test_resource_groups.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | tests/integration/test_resource_groups.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import pytest
import skil
import uuid
from skil.resources.groups import *
_sk = None
def _get_sk():
global _sk
if _sk is None:
_sk = skil.Skil()
return _sk
def test_group_add_and_deletion():
sk = _get_sk()
res = skil.resources.storage.S3(sk, "s3" + str(uuid.uuid1())[:6], "test_bucket",... | 20.357143 | 84 | 0.62924 |
38476eb7a96a95db3013a4cf28ef9c8b1792c0c4 | 1,766 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/tests/creational/test_pool.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/tests/creational/test_pool.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/tests/creational/test_pool.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | import queue
import unittest
from patterns.creational.pool import ObjectPool
class TestPool(unittest.TestCase):
def setUp(self):
self.sample_queue = queue.Queue()
self.sample_queue.put("first")
self.sample_queue.put("second")
def test_items_recoil(self):
with ObjectPool(self.... | 33.961538 | 60 | 0.657984 |
38d12590f59234246f75d9aae0a5c6aa79e453a3 | 3,036 | py | Python | year_2/prog_base_sem1_cw/app/api_1_0/users.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_2/prog_base_sem1_cw/app/api_1_0/users.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_2/prog_base_sem1_cw/app/api_1_0/users.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from flask import jsonify, request, current_app, url_for
from . import api
from ..models import User, Post
from .errors import bad_request
@api.route('/users/')
def get_users():
offset = request.args.get('offset') or 5
try:
offset = int(offset)
except:
return bad_request('Bad offset argume... | 30.979592 | 94 | 0.594203 |
aa749c417c666122123352558e10206592246cdc | 2,889 | py | Python | scripts/figA5.py | gavstrik/BC | 2085872f1ff4241dcf4a5ef64eaa0601fb8ac454 | [
"MIT"
] | null | null | null | scripts/figA5.py | gavstrik/BC | 2085872f1ff4241dcf4a5ef64eaa0601fb8ac454 | [
"MIT"
] | null | null | null | scripts/figA5.py | gavstrik/BC | 2085872f1ff4241dcf4a5ef64eaa0601fb8ac454 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
from scipy.stats import mode, ks_2samp, mannwhitneyu, shapiro, pearsonr
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "sans-serif"
PLOTS_DIR = '../plots'
"""
histograms of guess distributions partitioned into groups and rounds.
"""
datafile_AMT = pd.rea... | 36.56962 | 81 | 0.619592 |
2d55c635179769de07550c25a60f02140a27ba4a | 750 | py | Python | elements/python/7/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/7/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/7/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def say(digits):
cur = digits[0]
run = 1
result = ''
for digit in digits[1:]:
if digit == cur:
run += 1
continue
result += str(run) + cur
cur = digit
run = 1
result += str(run) + cur
return result
def look_and_say(n):
digits = '1'
... | 16.666667 | 45 | 0.449333 |
933ad89a120b4cce5b993027be90d01878672a18 | 1,804 | py | Python | tests/data/test_load.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | tests/data/test_load.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | tests/data/test_load.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | import retro
import pytest
import gc
import gzip
import os
import zlib
from retro.testing import game, handle
from concurrent.futures import ProcessPoolExecutor, TimeoutError
from concurrent.futures.process import BrokenProcessPool
pool = ProcessPoolExecutor(1)
@pytest.fixture(scope="module")
def processpool():
... | 23.736842 | 102 | 0.632483 |
fac84c6b38588a5252beeb3fd5a41ce1849f6c94 | 2,851 | py | Python | weibo/login/weiboLogin.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/login/weiboLogin.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/login/weiboLogin.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #encoding:utf8
'''
Created on 2016年4月11日
@author: wb-zhaohaibo
'''
import urllib2
import cookielib
import WeiboEncode
import WeiboSearch
class WeiboLogin(object):
def __init__(self, user, pwd, enableProxy = False):
"初始化WeiboLogin,enableProxy表示是否使用代理服务器,默认关闭"
print "初始化登录程序..."
... | 38.527027 | 183 | 0.617327 |
e21134e8d2914688a76a8130c25ea39f097db91e | 3,018 | py | Python | 7_DeepLearning-GANs/04_Generative_Adversarial_Attacks/targeted_attack.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/04_Generative_Adversarial_Attacks/targeted_attack.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/04_Generative_Adversarial_Attacks/targeted_attack.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | '''
Generative Adversarial Attacks - den Output des Netes beeinflussen
(z.B. andere Klasse ausgeben als eigentlich ist) durch Noise über ganzes Bild was für das menschliche Auge nicht sichtbar ist,
oder anbringen von Patches (kleine Bilder die dann im Vordergrund liegen) welche dann eine
z.B. andere Klassifizierun... | 37.725 | 127 | 0.678595 |
10645f967cb90505e0a8d95a0c49e24a7b4bbd9b | 8,786 | py | Python | research/cv/DDRNet/src/data/augment/transforms.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DDRNet/src/data/augment/transforms.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DDRNet/src/data/augment/transforms.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... | 32.420664 | 98 | 0.6112 |
10a82b2d11be8d842a3706c5be82cc90600973cf | 1,673 | py | Python | TranspaGOOGLE-master/TanspaGOOGLE.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | TranspaGOOGLE-master/TanspaGOOGLE.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | TranspaGOOGLE-master/TanspaGOOGLE.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/env python3
#github.com/AngelSecurityTeam/TranspaGOOGLE
import optparse
import sys
import requests
import json
tmpDomainList=[]
def lookup(domainName):
nextLink=''
url='https://transparencyreport.google.com/transparencyreport/api/v3/httpsreport/ct/certsearch?include_expired=true&include_subdomains=true&... | 24.602941 | 160 | 0.723849 |
52ec494954ac43a325093f841ee5efbe521270b6 | 3,942 | py | Python | back-end/src/analysis/NeuralNet/655/nn_mapper.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/NeuralNet/655/nn_mapper.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/NeuralNet/655/nn_mapper.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Adapted from an example by Michael G. Noll at:
#
# http://www.michael-noll.com/wiki/Writing_An_Hadoop_MapReduce_Program_In_Python
#
'''
import sys, urllib, re
import numpy as np
# Read pairs as lines of input from STDIN
#for line in sys.stdin:
# We assume that we are fed a series of URLs, ... | 23.188235 | 135 | 0.676053 |
0dea3ae22e010767a2506547182f23b3b038a948 | 481 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro_numpy_size.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro_numpy_size.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro_numpy_size.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import numpy as np
import sys
numbers = [i for i in range(100_000)]
print("Size of each element: ", sys.getsizeof(numbers[0]))
print(numbers[99_999])
print("Size of the list: ", sys.getsizeof(numbers))
numbers_array = np.arange... | 22.904762 | 64 | 0.746362 |
33f43d8dd75183d8b94d8185574855e2f615c4a2 | 6,834 | py | Python | isj_proj05.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | isj_proj05.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | isj_proj05.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# DEKLARACE ZÁSTUPNÝCH PROMNĚNÝCH
NULA=0
JEDNA=1
DVA=2
# Konec deklarace
''' Třída Polynomial pro zpracování ruzných polynomů, dle zadání '''
class Polynomial:
''' Definife funkce __INIT__, uprava dat pro další operace/funkce '''
def __init__(self, *args, **arg): # Definitce funkce ... | 54.238095 | 182 | 0.621598 |
d5433558712390b999d7237fe0aa37ae4a88e6d8 | 6,540 | py | Python | 03_SDN/ext/helper.py | kit-tm/Labs | 8e5af3a76be6e17bdb62fd3175ecc545ed6e9147 | [
"BSD-2-Clause"
] | null | null | null | 03_SDN/ext/helper.py | kit-tm/Labs | 8e5af3a76be6e17bdb62fd3175ecc545ed6e9147 | [
"BSD-2-Clause"
] | null | null | null | 03_SDN/ext/helper.py | kit-tm/Labs | 8e5af3a76be6e17bdb62fd3175ecc545ed6e9147 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 Robert Bauer (robert.bauer@kit.edu)
#
# A small helper class providing some basic wrapper functions
# for simple openflow control handling with the POX-Controller.
# See aufgabe0.py for an simple example of how to use this file.
#
# Copyright (c) 2... | 35.351351 | 93 | 0.648471 |
6357b525697ac67d1628ddd407b9b8340c1c2bf2 | 828 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_attribute/test_item_attribute.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_attribute/test_item_attribute.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_attribute/test_item_attribute.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Item Attribute')
from erpnext.stock.doctype.item_attribute.item_attribute import ItemAttributeIncrementError
class TestItemAttribute(unittest.... | 26.709677 | 91 | 0.76087 |
89ba83ff6545e409db5512ffcbd3f31f69799f4c | 257 | py | Python | connect/config.py | slaurianodev/msgraph | 617e5e7d890a06757ef38871d9ddecfac2852c84 | [
"MIT"
] | null | null | null | connect/config.py | slaurianodev/msgraph | 617e5e7d890a06757ef38871d9ddecfac2852c84 | [
"MIT"
] | null | null | null | connect/config.py | slaurianodev/msgraph | 617e5e7d890a06757ef38871d9ddecfac2852c84 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
# See LICENSE in the project root for license information.
# Client ID and secret.
client_id = '07c53e00-1adb-4fa7-8933-fd98f6a4da84'
client_secret = '7CmTo1brGWMmh5RoFiTdO0n'
| 36.714286 | 79 | 0.789883 |
7f4272e05d8a6bd2802445187d9f4e91866441dc | 2,514 | py | Python | Packs/Troubleshoot/Scripts/TroubleshootAggregateResults/TroubleshootAggregateResults.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Troubleshoot/Scripts/TroubleshootAggregateResults/TroubleshootAggregateResults.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Troubleshoot/Scripts/TroubleshootAggregateResults/TroubleshootAggregateResults.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """
Aggregating results into a single file
"""
from CommonServerPython import *
def find_entry_id_by_name(doc_file_name: str) -> str:
context = demisto.context()
file_context = context.get('File', {})
if not file_context:
return ''
if isinstance(file_context, dict) and file_context['Name'] == ... | 35.914286 | 126 | 0.655529 |
7f72fa866d1035a1b976f384445893b67cde1218 | 1,054 | py | Python | python/en/_packages/pillow/pillow_tutorial-using_the_image_class.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/pillow/pillow_tutorial-using_the_image_class.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/pillow/pillow_tutorial-using_the_image_class.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pillow_tutorial-using_the_image_class.py
Pillow Docs > Handbook > Tutorial > Using the Image class
Pillow 6.0.0
https://pypi.org/project/Pillow/
Handbook
https://pillow.readthedocs.io/en/latest/handbook/index.html
Tutorial > Using the Image class
https... | 26.35 | 73 | 0.72296 |
7fbd095150136f2c8dd530546a565ce5be2d468f | 523 | py | Python | src/onegov/agency/theme/agency_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/theme/agency_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/theme/agency_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import module_path
from onegov.org.theme import OrgTheme
class AgencyTheme(OrgTheme):
name = 'onegov.agency.foundation'
@property
def post_imports(self):
return super().post_imports + [
'agency',
'chosen',
'people',
'ticket',
... | 23.772727 | 74 | 0.600382 |
89bf502bc07697f3ffa1d4e6953b3be3bebcb770 | 214 | py | Python | python_gui_tkinter/KALU/GARBAGE1/TEST/sound.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE1/TEST/sound.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE1/TEST/sound.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from tkinter import *
import mp3play
root = Tk() # create tkinter window
f = mp3play.load('alrt1.mp3'); play = lambda: f.play()
button = Button(root, text = 'Play', command = play)
button.pack()
root.mainloop()
| 19.454545 | 54 | 0.686916 |
61731e1c32580afccfd200f305d268739dad7651 | 607 | py | Python | EM/src/EM.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2018-04-25T18:00:28.000Z | 2018-08-08T09:39:18.000Z | EM/src/EM.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | null | null | null | EM/src/EM.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2019-03-03T02:55:48.000Z | 2021-01-21T04:50:46.000Z | # Conventional Machine Learning Algorithms
# Class of "EM".
# Author: Qixun Qu
# Create on: 2018/06/20
# Modify on: 2018/06/20
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $$$$ .$$$$$. $$$$'
# ... | 16.405405 | 42 | 0.418451 |
14ac0a301e00fbcea3a0ac0c3b3b977fca8f3b47 | 259 | py | Python | Classes/Brick.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Brick.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Brick.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | import pygame
class Brick(object):
x, y = '', ''
desc = "brick"
def __init__(self, pos):
self.x = pos[0]
self.y = pos[1]
self.rect = pygame.Rect(self.x, self.y, 50, 50)
def get_brick(self):
return self
| 12.95 | 55 | 0.513514 |
1aedd8abf3998a6d6a7972cb7badb05cba3fbf51 | 580 | py | Python | IVTp/2014/Grigoriev_A_O/task_3_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Grigoriev_A_O/task_3_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Grigoriev_A_O/task_3_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 3. Вариант 2.
#Напишите программу, которая выводит имя "Мария Луиза Чеччарелли", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
#Григорьев А.О.
#23.05.2016
print ("Герой нашей сегоднящней программы - Мария Луи... | 44.615385 | 208 | 0.737931 |
2142fc70b2a30c705dbae777b03c62a0de3c2d0c | 6,660 | py | Python | frappe-bench/apps/erpnext/erpnext/config/hr.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/hr.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/hr.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Employee and Attendance"),
"items": [
{
"type": "doctype",
"name": "Employee",
"description": _("Employee records."),
},
{
"type": "doctype",
"name": "Employee Attendance To... | 20.492308 | 80 | 0.49955 |
0d2a350eb440e78278cb7c7fe2f288599b2eadcf | 488 | py | Python | Input_Gui.py | Snrsunny143/Taking-Input-In-Python-GUI | b98be4e784a0a307c84f57492d5ccb26b8bbc24d | [
"MIT"
] | 1 | 2020-08-29T03:54:24.000Z | 2020-08-29T03:54:24.000Z | Input_Gui.py | Snrsunny143/Taking-Input-In-Python-GUI | b98be4e784a0a307c84f57492d5ccb26b8bbc24d | [
"MIT"
] | null | null | null | Input_Gui.py | Snrsunny143/Taking-Input-In-Python-GUI | b98be4e784a0a307c84f57492d5ccb26b8bbc24d | [
"MIT"
] | null | null | null | from tkinter import*
import sys
root = Tk()
root.title("Snr Tech And Tutorials")
input =Entry(root)
input.pack()
def printout():
print("User Input :- "+input.get())
def quit():
print("User Input :- Bye. ")
print(" Meet You Later. ")
sys.exit()
button = Button(root, text =" PrintOut ", command=print... | 19.52 | 87 | 0.633197 |
d3a98a72dff4f9eb164b86ee39ad16b58c883edb | 1,722 | py | Python | python_experiments/run_vldbj_experiments/run_reads_dynamic_update.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/run_vldbj_experiments/run_reads_dynamic_update.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/run_vldbj_experiments/run_reads_dynamic_update.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from exec_utilities import time_out_util
from exec_utilities.exec_utils import *
def run_exp():
our_exec_path = '/homes/ywangby/workspace/yche/new-git-repos-yche/SimRank/SPS-Variants/READS/build'
data_set_lst = [
# 'ca-GrQc', 'ca-HepTh', 'p2p-Gnutella06', 'wiki-Vote',
# 'email-Enron', 'email-E... | 36.638298 | 104 | 0.583043 |
4ce484ecc38278ecea33be0cfb19f3c9f0983e12 | 18,650 | py | Python | src/scripts/alchi-web.py | milahu/alchi | 6484d4a877d47204e28cf1a32a5d9da8705aff25 | [
"CC0-1.0"
] | 3 | 2020-08-12T16:57:23.000Z | 2021-03-15T18:39:48.000Z | src/scripts/alchi-web.py | milahu/alchi | 6484d4a877d47204e28cf1a32a5d9da8705aff25 | [
"CC0-1.0"
] | 4 | 2020-09-22T19:25:43.000Z | 2022-02-14T20:51:16.000Z | src/scripts/alchi-web.py | milahu/alchi | 6484d4a877d47204e28cf1a32a5d9da8705aff25 | [
"CC0-1.0"
] | 1 | 2021-04-06T11:18:17.000Z | 2021-04-06T11:18:17.000Z | #!/usr/bin/python3
"""
the web of sixteen types
the nunu matrix
two power four
latin square of order four
"""
# definitions
names = [
None, 'F1', 'M2', 'M3', 'F4', # left = matriarchy
None, 'M1', 'F2', 'F3', 'M4', # right = patriarchy
]
names_long = [
None, # 0
'female fire', # 1
'male earth', ... | 21.560694 | 105 | 0.418713 |
46d3db3255de71e377112203d843af0995fb6cf3 | 558 | py | Python | Utils/py/exportEdgels/exportEdgels.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/exportEdgels/exportEdgels.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/exportEdgels/exportEdgels.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from naoth.LogReader import LogReader
from naoth.LogReader import Parser
def get_camera_matrix(frame):
cm_bottom = frame["CameraMatrix"]
cm_top = frame["CameraMatrixTop"]
return [frame.number, cm_bottom, cm_top]
def get_edgels(frame):
edgel_percepts = frame["ScanLineEdgelPercep... | 24.26087 | 61 | 0.71147 |
03abdc9a12f16464373de3fba3cbb3a4ed2bbe85 | 247 | py | Python | todo/admin.py | arkarhtethan/simple-django-todo-list | 1d91ec11deb4bdcf9902206ddf754205e3d96447 | [
"MIT"
] | null | null | null | todo/admin.py | arkarhtethan/simple-django-todo-list | 1d91ec11deb4bdcf9902206ddf754205e3d96447 | [
"MIT"
] | 9 | 2019-12-04T22:33:07.000Z | 2022-02-10T08:25:39.000Z | todo/admin.py | arkarhtethan/simple-django-todo-list | 1d91ec11deb4bdcf9902206ddf754205e3d96447 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Todo
class TodoAdmin(admin.ModelAdmin):
list_display = ("title","due_date","done")
list_filter = ("done","due_date",)
list_editable = ("due_date",)
admin.site.register(Todo, TodoAdmin)
| 17.642857 | 43 | 0.728745 |
03b9e54d2eb80c6a91a71d3b802ccc16b256d132 | 1,048 | py | Python | cs/lambda_cs/03_data_structures/queue_and_stack/dll_queue.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/03_data_structures/queue_and_stack/dll_queue.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/03_data_structures/queue_and_stack/dll_queue.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Data Structures :: Queue
"""
import sys
sys.path.append("../doubly_linked_list")
from doubly_linked_list import DoublyLinkedList
class Queue:
def __init__(self):
"""Implementation of a Queue (FIFO). A doubly-linked list is
used as the underlying data structure because the methods for
... | 26.2 | 69 | 0.614504 |
ff04392cc00e634cc57517c482b44f56af2fad62 | 4,292 | py | Python | weeman-master/core/httpd.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | weeman-master/core/httpd.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | weeman-master/core/httpd.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | ##
## httpd.py - the main httpd server
##
## Written by @Hypsurus
##
import SimpleHTTPServer
import SocketServer
import urllib2
import cgi
import os
from socket import error as socerr
from core.config import __version__
from core.config import __codename__
from core.misc import printt
from bs4 import BeautifulSoup as ... | 37.982301 | 107 | 0.567568 |
2075cfb93479cc556ec79896863590c0fffb612c | 2,080 | py | Python | whereis-master/whereis-backend/database/database.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | whereis-master/whereis-backend/database/database.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | 3 | 2021-03-10T13:18:31.000Z | 2021-05-11T09:20:11.000Z | whereis-master/whereis-backend/database/database.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
from bson.objectid import ObjectId
client = MongoClient('localhost', 27017)
db = client['whereis_database']
def is_empty():
return db.locations.count_documents({}) <= 0 or db.items.count_documents({}) <= 0
def fill_test_db():
location_ids = db.locations.insert_many([{
... | 24.470588 | 85 | 0.482212 |
20f4fa304b382cb667e05f6fcec36fafee489bc5 | 8,378 | py | Python | official/cv/ADNet/src/trainers/RL_tools.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/trainers/RL_tools.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/trainers/RL_tools.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... | 37.738739 | 117 | 0.619241 |
45b1f8256ecf807b0c9b4c5a0d47c3013c46a614 | 2,389 | py | Python | src/onegov/swissvotes/fields/policy_area.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/fields/policy_area.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/fields/policy_area.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from copy import deepcopy
from json import dumps
from onegov.swissvotes import _
from onegov.swissvotes.models import PolicyArea
from wtforms import SelectMultipleField
from wtforms.widgets import Select
class PolicyAreaWidget(Select):
""" The widget for the React Dropdown Tree. """
def __call__(self, field,... | 28.783133 | 77 | 0.604018 |
b36234dcca716d2c05b5494e3faae0b458d9a979 | 3,265 | py | Python | src/CalculateDistances.py | animucki/2mmn40 | c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc | [
"Unlicense"
] | null | null | null | src/CalculateDistances.py | animucki/2mmn40 | c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc | [
"Unlicense"
] | null | null | null | src/CalculateDistances.py | animucki/2mmn40 | c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
def ReadTrajectory(trajFile):
"""This will read the WHOLE trajectory into memory. This will not be possible
later very large trajectores. I'll let you worry about how to deal with that yourself..."""
trajectory=[]
with open(trajFile... | 34.368421 | 91 | 0.579479 |
b3783ccaa2bfb2dfb0e0d47859ce56110f870aa4 | 10,014 | py | Python | yhh_recommend_text.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | yhh_recommend_text.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | yhh_recommend_text.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | """
爬取淘宝有好货推荐商品及所属类型
"""
import time
import datetime
import json
import requests
import random
import CralwerSet.connect_mysql as connect_mysql
import re
from urllib import parse
import easygui as g
import hashlib
from requests.packages import urllib3
import traceback
import pickle
import pymysql
urllib3.disable_warni... | 43.350649 | 625 | 0.546036 |
2b9fbdaff827a00d9a129888170532f40b7bc014 | 660 | py | Python | tests/test_logik.py | fossabot/superstructure | f4ab5cac269fb3dedfbd3a54c441af23edf3840b | [
"MIT"
] | null | null | null | tests/test_logik.py | fossabot/superstructure | f4ab5cac269fb3dedfbd3a54c441af23edf3840b | [
"MIT"
] | null | null | null | tests/test_logik.py | fossabot/superstructure | f4ab5cac269fb3dedfbd3a54c441af23edf3840b | [
"MIT"
] | null | null | null | import unittest
from superstructure.logik import Begriff
from superstructure.grundbegriffe import Einzelheit
from superstructure.geist import Bewusstsein
class TestLogik(unittest.TestCase):
def test_basic_logik(self):
b = Bewusstsein(name="TestBewusstsein")
i = Begriff(name="I")
j = Begr... | 27.5 | 81 | 0.683333 |
2bcbdbfe08769f4e09303ed4939454168cf6737e | 2,159 | py | Python | similaritycalculation/generalSimilarity.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | null | null | null | similaritycalculation/generalSimilarity.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 38 | 2018-10-24T08:51:58.000Z | 2021-12-13T19:54:39.000Z | similaritycalculation/generalSimilarity.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 12 | 2018-10-24T08:20:13.000Z | 2019-08-12T08:10:14.000Z | import math
import logging
LOGGER = logging.getLogger(__name__)
def sameDatatype(fileEnding1, fileEnding2):
"""checks if two datatypes are the same or from same family
:param fileEnding1 String for instance ".tiff"
:param fileEnding2 String for instance ".geotiff"
:returns: 1 if they are the same, oth... | 34.269841 | 85 | 0.612784 |
47079df10a341d54724572c4f55fd5e3ba482151 | 2,413 | py | Python | research/cv/dcgan/src/generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/dcgan/src/generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/dcgan/src/generator.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.557377 | 89 | 0.656444 |
472b1fb39849210594f1d8132cbf1b5fce24375b | 359 | py | Python | exercises/pt/test_02_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/test_02_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_02_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"doc1.similarity(doc2)" or "doc2.similarity(doc1)" in __solution__
), "Você está comparando a similaridade entre os dois documentos?"
assert (
0 <= float(similarity) <= 1
), "O valor da similaridade deve ser um número de ponto flutuante. Você fez este cálculo correta... | 39.888889 | 107 | 0.668524 |
1b61643193609c85bbaf600eb6fb729daf6a4097 | 1,928 | py | Python | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/arrays_notes.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/arrays_notes.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/05_hash_tables_and_blockchain/Hash-Tables/notes/arrays_notes.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Hash tables :: Day 1 Notes: Arrays
An array:
* Stores a sequence of elements
* Each element must be the same data type
* Occupies a contiguous block of memory
* Can access data in constant time with this equation:
`memory_address = starting_address + index * data_size`
"""
class DynamicArray:
def __init__(... | 27.942029 | 68 | 0.605809 |
940fa25f5d2e638547e03c9cd9e16acdbea8cf89 | 9,547 | py | Python | .github/tools/metrics/benchmark_capture.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | .github/tools/metrics/benchmark_capture.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | .github/tools/metrics/benchmark_capture.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | #!/usr/bin/env python3
import time
import click
import os
import csv
import requests
import json
import logging
from pprint import pprint
from datetime import timedelta
from jinja2 import Environment, FileSystemLoader
from google.api_core.exceptions import NotFound, InternalServerError
from google.cloud import mon... | 30.89644 | 158 | 0.655808 |
ca2df16482429ebd5ccb3367c7ec22c43f589b3f | 2,311 | py | Python | deeplearning EX/Ex1.py | deliciousYSH/Misc.Code | 5e957ca16b2a7b2a1dff5f0a1dec563dd4757d18 | [
"MIT"
] | null | null | null | deeplearning EX/Ex1.py | deliciousYSH/Misc.Code | 5e957ca16b2a7b2a1dff5f0a1dec563dd4757d18 | [
"MIT"
] | null | null | null | deeplearning EX/Ex1.py | deliciousYSH/Misc.Code | 5e957ca16b2a7b2a1dff5f0a1dec563dd4757d18 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import matplotlib.pyplot as plt
from torch.autograd import Variable
x_train = np.array([1.3, 2.4, 3.1, 4.32, 5.13, 6.15, 7.25, 8.92, 8.92, 3.12, 4.32, 8.52], dtype=np.float32)
x_train = x_train.reshape(-1, 1)
y_train = np.array([2.3, 1.13, 5.4, 6.1, 6.2, 6.85, 7.03, 8.18, 7.25, 6.82, 1.... | 30.407895 | 134 | 0.672003 |
b6f0a22ecc404ebcdc051115a6062d013933a00a | 518 | py | Python | Algorithms/Strings/Weighted_Uniform_Strings.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Strings/Weighted_Uniform_Strings.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Strings/Weighted_Uniform_Strings.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/weighted-uniform-string/problem?h_r=internal-search
import string
from collections import Counter
l = string.ascii_lowercase
s = 'abccddde'
d = {}
for i,j in enumerate(l,1):
d[j] = i
e = Counter(s)
w_c = []
w = []
for i,j in e.items():
for k in range(1,j+1):
w_c... | 16.709677 | 91 | 0.596525 |
eda54ba1313b5f9760eb835e348d48e8549774b2 | 2,675 | py | Python | src/onegov/town/views/settings.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town/views/settings.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town/views/settings.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ The settings view, defining things like the logo or color of the org. """
from onegov.core.security import Secret
from onegov.form import Form, merge_forms, move_fields
from onegov.org import _
from onegov.org.forms import HomepageSettingsForm
from onegov.org.models import Organisation
from onegov.org.views.settin... | 32.621951 | 79 | 0.650841 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.