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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b8f7183366aa8310155fc7e75aaa6a38b22364d1 | 1,617 | py | Python | Hackerrank_problems/Keyword_Transposition_Cipher/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Keyword_Transposition_Cipher/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Keyword_Transposition_Cipher/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | n = int(input()) #number of test cases
alp = [] #list of alphabets A-Z
a = [] #list of keywords
p = [] #list of words of ciphertext
for i in range(0, 26):
alp.append(chr(65+i))
while True:
try:
a.append(input())
b = list(input().split(" "))
p.append(b)
except (EOFError):
... | 28.368421 | 104 | 0.536797 |
6287e8840d6884fd70999ac8b14b2ef9596d2343 | 257 | py | Python | backend/Parsers/Scraper.py | SeanGau/vaccinate | f3d7388c666ee466da570e8c17bbe1f2caee912f | [
"MIT"
] | 39 | 2021-05-01T03:36:44.000Z | 2021-11-16T13:29:21.000Z | backend/Parsers/Scraper.py | SeanGau/vaccinate | f3d7388c666ee466da570e8c17bbe1f2caee912f | [
"MIT"
] | 50 | 2021-04-28T10:57:07.000Z | 2021-08-19T05:13:07.000Z | backend/Parsers/Scraper.py | SeanGau/vaccinate | f3d7388c666ee466da570e8c17bbe1f2caee912f | [
"MIT"
] | 19 | 2021-05-02T04:25:02.000Z | 2021-07-11T04:34:16.000Z | import abc
from hospital_types import ScrapedData
class Scraper(metaclass=abc.ABCMeta):
@property
@abc.abstractmethod
def hospital_id(self) -> str:
pass
@abc.abstractmethod
async def scrape(self) -> ScrapedData:
pass
| 17.133333 | 42 | 0.680934 |
65ea077ef591df269b740d1487ccb068564c595b | 25,869 | py | Python | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/train/train_all.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 123 | 2017-10-05T00:29:34.000Z | 2022-03-28T14:16:06.000Z | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/train/train_all.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 13 | 2017-10-23T09:33:33.000Z | 2022-01-05T09:42:29.000Z | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/train/train_all.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 37 | 2017-10-06T09:47:05.000Z | 2020-06-27T21:06:01.000Z | from __future__ import print_function
import argparse
import os
import random
import sys
sys.path.append(os.getcwd())
import pdb
import time
import numpy as np
import json
import progressbar
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.backends.cudnn as cudn... | 41.791599 | 128 | 0.619622 |
a79fc3cbf6e32b6409fec7ea67fe21a86ac2ae7b | 307 | py | Python | system calls/print_to_stderr.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | system calls/print_to_stderr.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | system calls/print_to_stderr.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | import datetime
stop_time = datetime.datetime.now() + datetime.timedelta(seconds=1)
import sys
while True:
if datetime.datetime.now() > stop_time:
print('one second has passed {}'.format(stop_time), file=sys.stderr)
stop_time = datetime.datetime.now() + datetime.timedelta(seconds=1) | 34.111111 | 76 | 0.713355 |
ac639f0004490a30aabb7f9955faa589140f6ba8 | 675 | py | Python | examples/knowledgebasebot/actions/actions.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 9,701 | 2019-04-16T15:46:27.000Z | 2022-03-31T11:52:18.000Z | examples/knowledgebasebot/actions.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 6,420 | 2019-04-16T15:58:22.000Z | 2022-03-31T17:54:35.000Z | examples/knowledgebasebot/actions.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3,063 | 2019-04-16T15:23:52.000Z | 2022-03-31T00:01:12.000Z | from rasa_sdk.knowledge_base.storage import InMemoryKnowledgeBase
from rasa_sdk.knowledge_base.actions import ActionQueryKnowledgeBase
class ActionMyKB(ActionQueryKnowledgeBase):
def __init__(self):
# load knowledge base with data from the given file
knowledge_base = InMemoryKnowledgeBase("knowled... | 39.705882 | 79 | 0.725926 |
cbfb40eadccb1ecd5b6e24bb4300751c36f2e924 | 1,860 | py | Python | tarefas-poo/lista-03/navio/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício do Navio
# --------------------------
# Classe que representa a interface com o usuário
#
from view.menu import Menu
from view.paineis.painel_cria_navio import PainelCriaNavio
from view.paineis.painel_mostra_navio import PainelMostraNavio
from view.... | 32.068966 | 75 | 0.525806 |
02463440c18eaa0ddad087e589e8a7c7e59af89b | 2,755 | py | Python | packages/watchmen-model/src/watchmen_model/admin/pipeline_action_write.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_action_write.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_action_write.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional, Union
from pydantic import BaseModel
from watchmen_model.common import construct_parameter, construct_parameter_joint, FactorId, Parameter
from watchmen_utilities import ArrayHelper
from .pipeline_action import AggregateArithmeticHolder, FindBy, PipelineAction, ToFactor, ToTopic, Wr... | 30.274725 | 119 | 0.772414 |
026c47d026c8017610946c27f2b4236b0ced8050 | 8,596 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/simpla/_utils.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/simpla/_utils.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/simpla/_utils.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) 2017-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 39.072727 | 119 | 0.668683 |
ce4bab056ebb983c756d9427c2fd324d3870d940 | 4,888 | py | Python | Packs/ApiModules/Scripts/SiemApiModule/SiemApiModule.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/ApiModules/Scripts/SiemApiModule/SiemApiModule.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/ApiModules/Scripts/SiemApiModule/SiemApiModule.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | # pylint: disable=no-name-in-module
# pylint: disable=no-self-argument
from abc import ABC
from typing import Any, Callable, Optional
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from enum import Enum
from pydantic import BaseConfig, BaseModel, AnyUrl, validator,... | 28.923077 | 89 | 0.622954 |
0cc512c34c51eebc539d1ee56a3a416c536f9abc | 746 | py | Python | backend/api/serializers.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/api/serializers.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/api/serializers.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | from rest_framework import serializers
class UserProductInlineSerializer(serializers.Serializer):
url = serializers.HyperlinkedIdentityField(
view_name="product-detail", lookup_field="pk", read_only=True
)
title = serializers.CharField(read_only=True)
class UserPublicSerializer(serializers.Seria... | 35.52381 | 75 | 0.761394 |
f00453766a711ff6e10ce0d1196bca76053daf35 | 7,034 | py | Python | 7-assets/past-student-repos/Graphs-Notes-master/lecture2/lecture2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Graphs-Notes-master/lecture2/lecture2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Graphs-Notes-master/lecture2/lecture2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | class Queue():
def __init__(self):
self.queue = []
def enqueue(self, value):
self.queue.append(value)
def dequeue(self):
if self.size() > 0:
return self.queue.pop(0)
else:
return None
def size(self):
return len(self.queue)
class Stack():
... | 31.828054 | 116 | 0.552886 |
f06bb95c2cbc87d0ed596224396ab74981d7927c | 2,761 | py | Python | encounter_roller.py | jyurkiw/EncounterRoller | 42d036874f6b65bb276003fc9c166917464e4a3b | [
"MIT"
] | null | null | null | encounter_roller.py | jyurkiw/EncounterRoller | 42d036874f6b65bb276003fc9c166917464e4a3b | [
"MIT"
] | null | null | null | encounter_roller.py | jyurkiw/EncounterRoller | 42d036874f6b65bb276003fc9c166917464e4a3b | [
"MIT"
] | null | null | null | from EncounterRoller.lib.settings_manager import SettingsManager
from EncounterRoller.lib.table_manager import TableManager
from EncounterRoller.lib.encounter_builder import EncounterBuilder
import argparse
settings = SettingsManager()
# Main parser
main_parser = argparse.ArgumentParser()
subparsers = main_parser.add... | 40.014493 | 116 | 0.768924 |
b2b2c006a58abd66224aadb8a656f724291bfc64 | 771 | py | Python | other/files.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | other/files.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | other/files.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | import os
# abspath nutzen, da es für das Betriebssystem die entsprechenden Seperatoren verwendet
print("----------Pfad betriebssystemunabhängig angeben----------")
project_path = os.path.abspath(r'C:\Users\felix\Desktop\Python3')
file_path = os.path.join(project_path, r"other\data.txt")
print(file_path)
print("----... | 27.535714 | 87 | 0.686122 |
6537e77a26b793bc2a18fb46ff1427c14fcf83be | 669 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_alias.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_alias.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_alias.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformAlias(unittest.TestCase):
def setUp(self):
self.data = {
"test": "test"
}
def test_alias(self):
values = [
{
"type": "alia... | 23.068966 | 86 | 0.503737 |
d7bf72c2ea869cb9b17f9fcc71ecbf5ccc427ce0 | 2,638 | py | Python | other/re-risky/split-version/task3/spoilers_and_source/src/gen_gold.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | other/re-risky/split-version/task3/spoilers_and_source/src/gen_gold.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | other/re-risky/split-version/task3/spoilers_and_source/src/gen_gold.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 23.553571 | 74 | 0.598939 |
c5b48a33cdf0a6d79e282a2367541456f434b9a9 | 617 | py | Python | quark_core_api/exceptions/common_exceptions.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | quark_core_api/exceptions/common_exceptions.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | quark_core_api/exceptions/common_exceptions.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | from future.builtins import super
class ArgumentOutOfRangeException(Exception):
def __init__(self, arg):
super().__init__(
"The value of argument '{}' is outside the allowable range of values."
.format(arg))
class ArgumentException(Exception):
def __init__(self, arg):
... | 30.85 | 82 | 0.612642 |
c5e5a7cafa49fe9b280271883827bcf6dfae45cc | 262 | py | Python | src/python/py-accepted/133A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/133A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/133A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 133A
# Created on : 2019-01-15 20:14:13
def Main():
l = input()
s = "HQ9"
for ch in s:
if (l.find(ch) != -1):
print("YES")
return
print("NO")
if __name__ == '__main__':
Main()
| 13.789474 | 36 | 0.450382 |
a838a9e075fcf2c9334074b10e4ecc37d96a8673 | 686 | py | Python | zencad/examples/2.Operations/3.Sweep/revol2.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/2.Operations/3.Sweep/revol2.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/2.Operations/3.Sweep/revol2.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: revol2
"""
from zencad import *
proto0 = square(10, center=True)
m00 = revol2(profile=proto0, r=20)
m01 = revol2(profile=proto0, r=20, yaw=(0,deg(180)), roll=(0,deg(60)))
m02 = revol2(profile=proto0, r=20, roll=(0,deg(720)))
proto1 = square(10)
m10 = revol2(profile=prot... | 21.4375 | 77 | 0.672012 |
a896e4ce4cfe3416c523b1aabeeb4bb0dd1db801 | 17,561 | py | Python | model/topoml_util/test_files/gmm_output.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | model/topoml_util/test_files/gmm_output.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | model/topoml_util/test_files/gmm_output.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | import numpy as np
input = np.array([
[-2.38483333, -0.77433333, 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., ],
[2.97916667, -0.10433333, 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., ],
[2.76516667, 0.54266667, 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., ],
[-2.598833... | 73.785714 | 91 | 0.474631 |
4f2a08e83020ebcd30763a599b8635136607ab07 | 600 | py | Python | migrations/versions/924071080036_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/924071080036_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/924071080036_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: 924071080036
Revises: 6893de0cb15b
Create Date: 2021-08-20 08:15:53.480243
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "924071080036"
down_revision = "6893de0cb15b"
branch_lab... | 18.75 | 83 | 0.706667 |
4f3ef3252519fcc39ea64e3c0d9de9e5b6dd2518 | 1,115 | py | Python | PMIa/2015/MOLOKANOV_I_A/task_4_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/MOLOKANOV_I_A/task_4_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/MOLOKANOV_I_A/task_4_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 4. Вариант.21
# Напишите программу, которая выводит имя, под которым скрывается Филип Ауреол Теофраст Бомбаст фон Гогенгейм. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти)... | 85.769231 | 464 | 0.803587 |
4f87cb560fcdd0e878b7173c60605e4471116583 | 2,331 | py | Python | 2019/finals/misc-stuffed-finals/app/main.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/finals/misc-stuffed-finals/app/main.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/finals/misc-stuffed-finals/app/main.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python2
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.791045 | 78 | 0.718147 |
8cdc83964b68d780a7ac5579087abffaff748d7a | 7,245 | py | Python | etl/data_extraction/scrapers/weltwaerts.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 7 | 2020-04-23T20:16:11.000Z | 2022-01-04T14:57:16.000Z | etl/data_extraction/scrapers/weltwaerts.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 361 | 2020-04-23T17:20:14.000Z | 2022-03-02T11:29:45.000Z | etl/data_extraction/scrapers/weltwaerts.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 1 | 2021-11-29T06:02:52.000Z | 2021-11-29T06:02:52.000Z | import re
from data_extraction.scraper import Scraper
class WeltwaertsScraper(Scraper):
"""Scrapes the website weltwaerts.de."""
base_url = 'https://www.weltwaerts.de'
debug = True
def parse(self, response, url):
"""Handles the soupified response of a detail page in the predefined way and r... | 40.47486 | 120 | 0.539406 |
e84d51bf81e1d264cac2a1f3093f2af15cd378b2 | 5,643 | py | Python | repo/script.module.urlresolver/lib/urlresolver/plugins/streamango.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/plugins/streamango.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/plugins/streamango.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
urlresolver Kodi Addon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed... | 38.128378 | 131 | 0.584618 |
2cfbe28bd8a8734a1d1592c3f62f00bc8a1eacb5 | 8,178 | py | Python | TreeModelLib/GrowthAndDeathDynamics/NetworkBettina/NetworkBettina.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeModelLib/GrowthAndDeathDynamics/NetworkBettina/NetworkBettina.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeModelLib/GrowthAndDeathDynamics/NetworkBettina/NetworkBettina.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2021-Today
@author: marie-christin.wimmler@tu-dresden.de
"""
from TreeModelLib.GrowthAndDeathDynamics.SimpleBettina import SimpleBettina
from ProjectLib.Logger import method_logger
import numpy as np
# MRO: NetworkBettina, SimpleBettina, TreeModel, object
cla... | 40.89 | 81 | 0.621301 |
fa12548f8fc933e8960c0c4dab88eb3648e61a24 | 483 | py | Python | python/odml/test_scripts/datacite_ns_collapse_test.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/test_scripts/datacite_ns_collapse_test.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/test_scripts/datacite_ns_collapse_test.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | import os
import odmltools.importers.import_datacite as dimp
home = os.path.join(os.getenv("HOME"), "Chaos")
resources = os.path.join(home, "work/odmltools/test/resources/")
extra_fn = "invalidNS.xml"
extra_file = os.path.join(resources, extra_fn)
out_dir = os.path.join(home, "DL/tmp")
# test fail
dimp.handle_docum... | 26.833333 | 64 | 0.761905 |
fa31c8ff1b3e54e0784a1f0ed3bf5764109d7b45 | 540 | py | Python | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/uart/main.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/uart/main.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/uart/main.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z |
# coding=utf-8
# This is a sample Python script.
import utime
from driver import UART
print("-------------------uart test--------------------")
print("-----How to test: connect PIN10 and PIN12-------")
uart = UART();
uart.open("serial2")
utime.sleep_ms(1000)
uart.setBaudRate(9600)
writeBuf = bytearray([0x41, 0x42, 0... | 23.478261 | 57 | 0.633333 |
d75dda798d6466d475ff3da995cce860637e0c18 | 328 | py | Python | top/clearlight/base/liaoxuefeng/third_party_module/chardet/chardet_learn.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/third_party_module/chardet/chardet_learn.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/third_party_module/chardet/chardet_learn.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import chardet
# 检测编码
# 检测bytes 编码
print(chardet.detect(b'Hello, world!'))
data = ('你好我是'.encode('UTF8'))
print(chardet.detect(data))
data = '最新の主要ニュース'.encode('euc-jp')
print(chardet.detect(data))
data = b'\xc0\xeb\xc0\xeb\xd4\xad\xc9\xcf\xb2\xdd\xa3\xac\xd2\xbb\xcb\xea\xd2\xbb\xbf\xdd\xc8\xd9'
print(chardet.detec... | 23.428571 | 98 | 0.713415 |
ad4d45bc68c840905d07b620d9132d743cd8e339 | 273 | py | Python | jumeaux/addons/judgement/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/judgement/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/judgement/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from jumeaux.models import JudgementAddOnPayload, JudgementAddOnReference
class JudgementExecutor:
def exec(self, payload: JudgementAddOnPayload, reference: JudgementAddOnReference) -> JudgementAddOnPayload:
raise NotImplementedError()
| 34.125 | 112 | 0.787546 |
a8e95d172391c724d83f15cb8fb13d9a5c8de47a | 396 | pyde | Python | sketches/forrest/forrestgenerate/forrestgenerate.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/forrest/forrestgenerate/forrestgenerate.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/forrest/forrestgenerate/forrestgenerate.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | import random as r
def setup():
size(800, 640)
output =open("forrest.tsv", "w")
output.write("type\tx\ty\n")
ellipseMode(CORNER)
for y in range(0, height, 16):
for x in range(0, width, 16):
forrestType = str(r.randint(1, 4))
output.write(forrestType + "\t" + str(x) +... | 28.285714 | 76 | 0.532828 |
0f7a1a4e90343b0ba4e31c38b7392651ef2818c8 | 2,164 | py | Python | research/recommend/Fat-DeepFFM/GetDatasetBinary.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/recommend/Fat-DeepFFM/GetDatasetBinary.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/recommend/Fat-DeepFFM/GetDatasetBinary.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.964912 | 115 | 0.703327 |
69d57456ea4068febcadf5124db9bf2e563f0a9b | 3,832 | py | Python | deprecated/fleet_x/examples/heter_parameter_server/network_conf.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/fleet_x/examples/heter_parameter_server/network_conf.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/fleet_x/examples/heter_parameter_server/network_conf.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | #!/usr/bin/python
# Copyright (c) 2020 PaddlePaddle 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... | 37.568627 | 80 | 0.537839 |
2d9181126057c0741b428ffffb33bd7f9621cbd6 | 4,423 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex10_flood_fill.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex10_flood_fill.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex10_flood_fill.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from enum import Enum
from ch06_arrays.intro.intro import print_array, get_dimension
def flood_fill(values2dim, x, y):
max_y, max_x = get_dimension(values2dim)
# rekursiver Abbruch
if x < 0 or y < 0 or x >= max_x or... | 24.848315 | 72 | 0.390911 |
3579705c0806796c6c94d29ad0da6f72df85282f | 961 | py | Python | database.py | FireEater64/DashBroker | 386fa94c6706950e695ce258d07df29207043b8a | [
"MIT"
] | null | null | null | database.py | FireEater64/DashBroker | 386fa94c6706950e695ce258d07df29207043b8a | [
"MIT"
] | null | null | null | database.py | FireEater64/DashBroker | 386fa94c6706950e695ce258d07df29207043b8a | [
"MIT"
] | null | null | null | from peewee import *
import datetime
import ConfigParser
config = ConfigParser.RawConfigParser()
config.read("dashbroker.ini")
databaseHost = config.get("Database", "Address")
databaseUsername = config.get("Database", "Username")
databasePassword = config.get("Database", "Password")
databaseName = config.get("Databas... | 26.694444 | 99 | 0.757544 |
576bae3003411b56bf004281917773fb08b8e7cf | 243 | py | Python | pamutation.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | pamutation.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | pamutation.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
def compute(sum,path):
if sum ==target:
print path
return
if sum >target:
return
for i in list:
path_temp=path[:]
path_temp.append(i)
compute(sum+i,path_temp)
list = [2,3,5]
target = 20
compute(0,[])
| 11.045455 | 28 | 0.633745 |
57759e2a23bcf7d2c5652261facc926bdb182971 | 143 | py | Python | python_project/python/fun_elif.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | python_project/python/fun_elif.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | python_project/python/fun_elif.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | def fun_elif(n):
if n<0:
print 'negative'
elif n==0:
print 'zero'
elif n>0:
print 'positive'
fun_elif(10)
| 14.3 | 24 | 0.51049 |
57812ee5f2130ffd65b4d534be8d673fa8b2677e | 8,490 | py | Python | feedcrawler/search/search.py | rix1337/RSScrawler | 5a1c067148310c03321329d3fa409a4e4144fce7 | [
"MIT"
] | 63 | 2016-03-21T21:35:07.000Z | 2021-03-20T22:50:34.000Z | feedcrawler/search/search.py | rix1337/RSScrawler | 5a1c067148310c03321329d3fa409a4e4144fce7 | [
"MIT"
] | 200 | 2016-03-15T21:45:26.000Z | 2021-04-03T10:47:45.000Z | feedcrawler/search/search.py | rix1337/RSScrawler | 5a1c067148310c03321329d3fa409a4e4144fce7 | [
"MIT"
] | 25 | 2016-03-15T20:44:33.000Z | 2020-10-25T09:43:48.000Z | # -*- coding: utf-8 -*-
# FeedCrawler
# Projekt von https://github.com/rix1337
import re
from bs4 import BeautifulSoup
from rapidfuzz import fuzz
from feedcrawler.common import check_is_site
from feedcrawler.common import encode_base64
from feedcrawler.common import sanitize
from feedcrawler.config import CrawlerConf... | 34.795082 | 116 | 0.522968 |
579983b0158d8640c88b88f8b8d211f62aff1b5e | 9,581 | py | Python | Project4/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project4/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project4/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def lagrange_interpolation(x: np.ndarray, y: np.ndarray) -> (np.poly1d, list):
"""
Generate Lagrange interpolation polynomial.
Arguments:
x: x-values of interpolation points
y: y-values of interpolation points
Return:
polynomial: polynomial as np.poly1d object
base... | 26.688022 | 111 | 0.409456 |
1024e7900459edd0c6ec91f4580ba45101567226 | 1,854 | py | Python | Pytorch/eval.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 794 | 2018-09-06T07:38:41.000Z | 2022-03-16T06:30:37.000Z | Pytorch/eval.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 111 | 2018-12-04T11:18:27.000Z | 2022-03-31T07:39:11.000Z | Pytorch/eval.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 221 | 2018-11-22T08:11:03.000Z | 2022-03-16T07:11:43.000Z | from torch.autograd import Variable
from .utils import AverageMeter
def eval_classification_net(net,testloader,use_cuda=True):
# evaluation a classification net
# the testloader should return (input, labels(not one-hot version))
# return an Tensor with shape [1] for accuracy(%)
net.train(False)
top... | 34.333333 | 73 | 0.644552 |
1076344db037145ceff7c92a70a88e8342b20476 | 980 | py | Python | tests/onegov/swissvotes/test_views_locale.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/swissvotes/test_views_locale.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/swissvotes/test_views_locale.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from webtest import TestApp as Client
def test_view_change_site_locale(swissvotes_app):
client = Client(swissvotes_app)
login = client.get('/auth/login')
login.form['username'] = 'admin@example.org'
login.form['password'] = 'hunter2'
login.form.submit()
page = client.get('/').maybe_follow()
... | 28.823529 | 49 | 0.664286 |
5e11c6daa7c43874d8a310f3195b5b243621073f | 12,660 | py | Python | mgr.py | dongdawang/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | null | null | null | mgr.py | dongdawang/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | 1 | 2021-06-01T22:59:31.000Z | 2021-06-01T22:59:31.000Z | mgr.py | dongjinhai/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | 1 | 2019-09-24T09:37:52.000Z | 2019-09-24T09:37:52.000Z | import json
import config
import psutil
import requests
import logging
from datetime import date, timedelta
from subprocess import Popen, PIPE, call
from mytoken import token
from datetime import datetime
class JsonLoader(object):
def __init__(self):
self.json = None
def load(self, path):
l =... | 33.228346 | 110 | 0.488942 |
d80202ed76844aa19af4626f77910fb8bbdfa6ca | 2,810 | py | Python | DesignPatterns/StructuralPattern/Composite/composite_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | DesignPatterns/StructuralPattern/Composite/composite_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | DesignPatterns/StructuralPattern/Composite/composite_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | ####################################
# Author: "BALAVIGNESH" #
# Maintainer: "BALAVIGNESH" #
# License: "CC0 1.0 Universal" #
# Date: "25/04/2021" #
####################################
from abc import ABC, abstractmethod
'''
Problem:
- Imagine you're running a delivery... | 30.879121 | 214 | 0.680783 |
520729ad8579813c01a99280f73058c8f29c5ede | 3,923 | py | Python | src/onegov/wtfs/forms/municipality.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/municipality.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/municipality.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.core.orm.func import unaccent
from onegov.form import Form
from onegov.wtfs import _
from onegov.wtfs.fields import MunicipalityDataUploadField
from onegov.wtfs.models import Municipality
from onegov.wtfs.models import PaymentType
from onegov.wtfs.models import PickupDate
from sqla... | 27.243056 | 78 | 0.639052 |
524dc8798a15d879c56e8811c80e7971c609c6e0 | 17,961 | py | Python | modules/controls.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | modules/controls.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | modules/controls.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | """Handles values of controls used in the header of the MMM input file
A control is any value in the MMM input file that is not dependent on rmin,
the minor radius of the plasma. Controls are generally used for switches or
scalar coefficients by MMM. Some controls may also be scanned over, such as
kyrhoe in any of t... | 42.460993 | 133 | 0.628696 |
8707fc6e7fafab940b9005dc88c53d3d21e5fb51 | 13,578 | py | Python | examples/text_to_sql/RAT-SQL/text2sql/dataproc/dusql_dataset_v2.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_sql/RAT-SQL/text2sql/dataproc/dusql_dataset_v2.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_sql/RAT-SQL/text2sql/dataproc/dusql_dataset_v2.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 app... | 36.111702 | 90 | 0.579172 |
875cc27e129ccee8244c868320c862fc17f0098a | 15,949 | py | Python | webservice/preprocessing.py | xdf8/FHNW-Immorechner | 0a44398b8087a86774d05fc781a6745f49b58109 | [
"MIT"
] | null | null | null | webservice/preprocessing.py | xdf8/FHNW-Immorechner | 0a44398b8087a86774d05fc781a6745f49b58109 | [
"MIT"
] | null | null | null | webservice/preprocessing.py | xdf8/FHNW-Immorechner | 0a44398b8087a86774d05fc781a6745f49b58109 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from pandas.api.types import is_object_dtype
from collections import defaultdict
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from... | 38.247002 | 145 | 0.596213 |
df3cbb1e85e2b0e9e60e3434b86857e7b3c6c5c0 | 202 | py | Python | Regex/Introduction/matching_specific_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Regex/Introduction/matching_specific_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Regex/Introduction/matching_specific_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import re
Regex_Pattern = r'hackerrank'
Test_String = input()
match = re.findall(Regex_Pattern, Test_String)
print("Number of matches :", len(match))
print(match)
| 14.428571 | 46 | 0.737624 |
10e6a5e21cb415ecf8d5fab52d38ce8e9a8e10be | 1,037 | py | Python | test.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | 7 | 2015-11-27T09:53:32.000Z | 2021-01-13T17:35:54.000Z | test.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | test.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | class Filter(object):
# def __init__(self, *args, **kwargs):
# self.attributes = [attr for attr in dir(self) if not callable(getattr(self,attr)) and not attr.startswith('__')]
def process(self, args):
for attr, attr_type in self.required.iteritems():
if attr not in args:
... | 28.027027 | 123 | 0.598843 |
1d1594cca8fd2e549939e4e34868d7aa4ab5e8c4 | 5,329 | py | Python | cloudmesh/volume/VolumeABC.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 1 | 2020-03-12T09:49:53.000Z | 2020-03-12T09:49:53.000Z | cloudmesh/volume/VolumeABC.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 1 | 2020-03-25T00:47:12.000Z | 2020-03-30T23:32:00.000Z | cloudmesh/volume/VolumeABC.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 5 | 2020-02-20T01:04:24.000Z | 2020-05-05T14:36:30.000Z | from abc import ABCMeta, abstractmethod
from cloudmesh.configuration.Config import Config
class VolumeABC(metaclass=ABCMeta):
def __init__(self, cloud, path):
# noinspection SpellCheckingInspection
"""
Initialize self.cm, self.default, self.credentials, self.group,
... | 32.29697 | 101 | 0.608745 |
1daa73c2435ce95d672ea59442cbd239e508ad54 | 1,234 | py | Python | computer-networking-a-top-down-approach/cp2/proxy_server.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | computer-networking-a-top-down-approach/cp2/proxy_server.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | computer-networking-a-top-down-approach/cp2/proxy_server.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | from socket import *
import sys
if len(sys.argv) <= 1:
print('Usage : "python ProxyServer.py server_ip"\n[server_ip : It is the IP Address Of Proxy Server')
sys.exit(2)
# Create a server socket, bind it to a port and start listening
tcpSerSock = socket(AF_INET, SOCK_STREAM)
# Fill in start.
tcpSerSock.bind(('', 8888... | 25.708333 | 102 | 0.689627 |
d587bc474cbb28ab0db8a768a10eff433b00fc27 | 1,288 | py | Python | machine_learning/pytorch/simple_nn_model.py | shaft49/tools-ref | b819338151d3a57f82fd03d4655da85d08ebfeea | [
"MIT"
] | null | null | null | machine_learning/pytorch/simple_nn_model.py | shaft49/tools-ref | b819338151d3a57f82fd03d4655da85d08ebfeea | [
"MIT"
] | 4 | 2020-09-26T06:23:09.000Z | 2020-11-04T15:24:20.000Z | machine_learning/pytorch/simple_nn_model.py | shaft49/tools-ref | b819338151d3a57f82fd03d4655da85d08ebfeea | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
# step 0: prepare data
X_numpy, y_numpy = datasets.make_regression(n_samples = 100, n_features=1, noise=20, random_state=1)
X = torch.from_numpy(X_numpy.astype(np.float32))
y = torch.from_numpy(y_numpy.as... | 25.76 | 100 | 0.714286 |
89e26bd15df04dddd76838796f9649e6820c21eb | 392 | py | Python | rangoli.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | rangoli.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | rangoli.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | def print_rangoli(n):
alnum = "abcdefghijklmnopqrstuvwxyz"
data = [alnum[i] for i in range(n)]
elements = list(range(n))
elements = elements[:-1] + elements[::-1]
for i in elements:
temp = data[-(i + 1):]
row = temp[::-1] + temp[1:]
print("-".join(row).center(n * 4 - 3, "-"))... | 26.133333 | 51 | 0.543367 |
61be9ab07fac9d7edeb108f4636ac13a406dd91d | 867 | py | Python | python/en/_matplotlib/gallery/text_labels_and_annotations/composing_custom_legends-3.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/text_labels_and_annotations/composing_custom_legends-3.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/text_labels_and_annotations/composing_custom_legends-3.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
text_labels_and_annotations/composing_custom_legends-3.py
Matplotlib > Gallery > Text, labels and annotations> Composing Custom Legends
https://matplotlib.org/3.1.1/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-cus... | 36.125 | 147 | 0.672434 |
9caefc77128e4be7da0053a430136271ddb30d96 | 10,846 | py | Python | hashing/scripts/breakdown.py | ShuhaoZhangTony/WalnutDB | 9ccc10b23351aa2e6793e0f5c7bd3dd511d7b050 | [
"MIT"
] | null | null | null | hashing/scripts/breakdown.py | ShuhaoZhangTony/WalnutDB | 9ccc10b23351aa2e6793e0f5c7bd3dd511d7b050 | [
"MIT"
] | null | null | null | hashing/scripts/breakdown.py | ShuhaoZhangTony/WalnutDB | 9ccc10b23351aa2e6793e0f5c7bd3dd511d7b050 | [
"MIT"
] | null | null | null | import getopt
import os
import sys
from math import ceil
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pylab
from matplotlib.font_manager import FontProperties
from matplotlib.ticker import LinearLocator, ScalarFormatter
from numpy import double
OPT_FONT_NAME = 'Helvetica'
TICK_FONT_SIZE... | 31.620991 | 116 | 0.58132 |
9ce77814f7c4a349e5ba491336815d23ab28e22d | 2,430 | py | Python | research/recommend/Fat-DeepFFM/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/recommend/Fat-DeepFFM/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/recommend/Fat-DeepFFM/src/dataset.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... | 52.826087 | 104 | 0.606996 |
0d1775122ef407009d38cfb2614223bdfc81cd49 | 4,127 | py | Python | haas_lib_bundles/python/docs/examples/human_detector/haas200/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/human_detector/haas200/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/human_detector/haas200/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件
import netmgr as nm # Wi-Fi 功能所在库
import ujson # json字串解析库
import utime # 延时API所在组件
from driver import GPIO # GPIO类,用于控制微处理器的输入输出功能
import ir # ir人体红外传感器类
... | 26.120253 | 65 | 0.591955 |
0d305ac3a2dedf082d707de2c149258a9691ebbd | 20 | py | Python | PythonText1.py | wangchongjun/lzl | 65ac1997e802c3f78ea01924a7d0c5c502101979 | [
"Apache-2.0"
] | null | null | null | PythonText1.py | wangchongjun/lzl | 65ac1997e802c3f78ea01924a7d0c5c502101979 | [
"Apache-2.0"
] | null | null | null | PythonText1.py | wangchongjun/lzl | 65ac1997e802c3f78ea01924a7d0c5c502101979 | [
"Apache-2.0"
] | null | null | null | print("11111111111") | 20 | 20 | 0.8 |
2ef1d7068afa7cc27a6d308cda78ee53ac0529fa | 599 | py | Python | Lec4.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | Lec4.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | Lec4.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | '''
Lecture 4: Dictionary and Tuple
'''
my_tuple = "a", "b", "c", "d", "e"
print(my_tuple)
my_2nd_tuple = ("a", "b", "c", "d", "e")
print(my_2nd_tuple)
is_a_tuple = ("a",)
print(is_a_tuple)
print(my_tuple[1:3])
print(my_tuple[2:])
my_car = {"color":"red",
"maker":"Toyota",
"year":2015}
print(my_car)... | 21.392857 | 40 | 0.642738 |
2c2b3ea73e727904a3eeb5de4d1473d791b2f7af | 5,394 | py | Python | AnswerMachine/react.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | AnswerMachine/react.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | AnswerMachine/react.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | # pylint: disable=C0114
import regex as re
import Persistence.log as log
from .candidate import Candidate
from .result import Result
log_ = log.getLogger(__name__)
follog_ = log.getLogger(__name__ + '.following', '{name} {message}')
def process_tweet(tweet, api, magic_tags, modus=None, default_magic_tag='DS100'):
... | 38.805755 | 124 | 0.570078 |
d36d16226b116b1f5b7109a1913f45219530e5ce | 7,966 | py | Python | parse_ortho_gene_tree.py | YueYvetteHao/Sandbox | db2b8b0e751bfb7d86e7f2506fb81a75f8c3a3e5 | [
"MIT"
] | null | null | null | parse_ortho_gene_tree.py | YueYvetteHao/Sandbox | db2b8b0e751bfb7d86e7f2506fb81a75f8c3a3e5 | [
"MIT"
] | null | null | null | parse_ortho_gene_tree.py | YueYvetteHao/Sandbox | db2b8b0e751bfb7d86e7f2506fb81a75f8c3a3e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Parse paramecium gene trees for PoFF ortho families.
# Yue Hao
# 09/2020
# python parse_ortho_gene_tree.py species-names.tab test_90.nt_ali.fasta.tre merged_WGD1_genelist.txt
import sys
import copy
import collections
import Bio.Phylo as Phylo
def main():
global species
# species-names.tab
... | 26.03268 | 229 | 0.650138 |
6ce6f7a8e42a0aad6266e8cdc1c1b160e15ec236 | 403 | py | Python | gdp1/assignment_5/collatz.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_5/collatz.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_5/collatz.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | def collatz(n, acc=None):
if n <= 0:
raise ValueError("Collatz must be called with n > 0.")
if acc:
acc.append(n)
else:
acc = [n]
if acc[-3:] == [4, 2, 1]:
return acc
if n % 2 == 0:
new_n = n // 2
else:
new_n = 3 * n + 1
return collatz(new_... | 15.5 | 62 | 0.471464 |
98072027d612a930e81c9daf0ac8efb491df5893 | 2,232 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex11_permutations.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex11_permutations.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex11_permutations.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import itertools
import time
def calc_permutations(input):
# rekursiver Abbruch
if is_blank(input) or len(input) == 1:
return {input}
combinations = set()
# Extrahiere i-tes Zeichen als neues erstes Zei... | 24.26087 | 77 | 0.68414 |
2014ac932a3c4d77f769743775a2eb77ad2677a7 | 1,879 | py | Python | plugins/tff_backend/handlers/testing.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/handlers/testing.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/handlers/testing.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... | 40.847826 | 114 | 0.691325 |
b3975e0268635c71a3fc0b3bf5983328f53d356b | 7,088 | py | Python | publ/image/image.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | publ/image/image.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | publ/image/image.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | """ Base class for managed images """
import html
import typing
from abc import ABC, abstractmethod
import flask
from .. import utils
ImgSize = typing.Tuple[int, int]
RenditionAttrs = typing.Dict[str, typing.Any]
class Image(ABC):
""" Base class for image handlers """
def __init__(self, search_path):
... | 31.927928 | 94 | 0.544865 |
208d9c35dca1a26d2138056738204bc1b9c38f7c | 1,220 | py | Python | 03 Python/Entwicklung eines IoT-Devices/aufgabe/src/main.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Entwicklung eines IoT-Devices/aufgabe/src/main.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Entwicklung eines IoT-Devices/aufgabe/src/main.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | 1 | 2020-10-10T20:24:05.000Z | 2020-10-10T20:24:05.000Z | #! /usr/bin/env python3
# Beispiel einer typischen IoT-Device-Anwendung mit Python.
# Wie so oft lesen wir hier Temperatur und Luftfeuchtigkeit
# mit einem DHT11-Sensor aus. Die Anwendung zeigt aber, wie
# eine echte IoT-Anwendung strukturiert sein kann und bietet
# deshalb folgende Extras:
#
# * Die Anwendung ist mo... | 43.571429 | 84 | 0.818852 |
b3338f119553b7df3b68282677a7af4562743c8d | 714 | py | Python | pyconuk/migrations/0003_redirection.py | PyconUK/2017.pyconuk.org | 337a00c034a15e5b41a8ea8683dd44310e14fb9c | [
"MIT"
] | 3 | 2017-10-24T13:33:29.000Z | 2017-10-30T10:47:28.000Z | pyconuk/migrations/0003_redirection.py | PyconUK/2017.pyconuk.org | 337a00c034a15e5b41a8ea8683dd44310e14fb9c | [
"MIT"
] | 78 | 2017-02-14T16:49:58.000Z | 2018-04-19T06:28:42.000Z | pyconuk/migrations/0003_redirection.py | PyconUK/2017.pyconuk.org | 337a00c034a15e5b41a8ea8683dd44310e14fb9c | [
"MIT"
] | 36 | 2017-06-19T07:48:38.000Z | 2018-01-19T11:08:10.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-07 11:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pyconuk', '0002_delete_newsitem'),
]
operations = [
migrations.CreateModel(
... | 26.444444 | 114 | 0.560224 |
ff84ea64542feb632e3de1004db538cdc2484fd9 | 387 | py | Python | tox_example/tests/test_app.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | tox_example/tests/test_app.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | tox_example/tests/test_app.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import pytest
import time
from src.app import math_fabs, math_ceil,increate
def test_math_fabs():
assert math_fabs(-1.2) == 1.2
assert math_fabs(0) == 0
assert math_fabs(2.4) == 2.4
def test_math_ceil():
assert math_ceil(-1.2) == -1
assert math_ceil(0) == 0
assert math... | 16.826087 | 49 | 0.635659 |
a602ecd0c7dd110b96324560dace9b3691f0b8f5 | 327 | py | Python | Project Euler Qusetions 11 - 20/Project Euler Question 16.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 11 - 20/Project Euler Question 16.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 11 - 20/Project Euler Question 16.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 16
#2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
#What is the sum of the digits of the number 2^1000?
x = 2**1000
x = list(str(x))
for term in x:
intterm = int(term)
x[x.index(term)] = intterm
sum_x = sum(x)
print(sum_x, "is the sum of the digits of the number 2... | 21.8 | 66 | 0.639144 |
cade3aa560e33c4ba9d4c8031b64c089b820472f | 2,848 | py | Python | components/amp-utility/python/Recorder.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/amp-utility/python/Recorder.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/amp-utility/python/Recorder.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # * coding: UTF8 *
"""
Recorder模块具体接口和参数。
==========================================================================================
"""
def set_sink(format, rate, channels, bits, frames, bitrate, sink):
"""
请求录音资源并设置录音参数。
:param format(int): 录音数据编码格式, 可以选择的类型为:
.. c:enum:: media_format_t
... | 16.274286 | 90 | 0.580056 |
6100cb1e342837c87378662b4e0d0824908e638a | 876 | py | Python | src/bo4e/enum/oekozertifikat.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/oekozertifikat.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/oekozertifikat.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Oekozertifikat(StrEnum):
"""
Zertifikate für Ökostrom von verschiedenen Herausgebern.
"""
CMS_EE01 = "CMS_EE01" #: CMS_EE01
CMS_EE02 = "CMS_EE02" #: CMS_EE02
EECS = "EECS" #: EECS
FRAUNHOFER = "FRAUN... | 32.444444 | 60 | 0.652968 |
b67d3a2f233e24ee2520ecd983798d5160bc24ea | 235 | py | Python | simple.py | AnickaBurova/find-filter-run | 01581f1d4d3f6270f1df10906c8e988f7db83e9a | [
"BSD-3-Clause"
] | 1 | 2018-02-20T10:18:30.000Z | 2018-02-20T10:18:30.000Z | simple.py | AnickaBurova/find-filter-run | 01581f1d4d3f6270f1df10906c8e988f7db83e9a | [
"BSD-3-Clause"
] | null | null | null | simple.py | AnickaBurova/find-filter-run | 01581f1d4d3f6270f1df10906c8e988f7db83e9a | [
"BSD-3-Clause"
] | null | null | null | #!/bin/env python2
import sys
data = list(map(ord, sys.stdin.read()))
if len(data) == 12:
print ("data = {} {}".format(len(data),data))
elif len(data) == 7:
print("this is my special case")
else:
print("I dont want it")
| 18.076923 | 49 | 0.6 |
fcabb9939463fd1b91b5f10051f3d0f529449b20 | 1,631 | py | Python | Packs/DeveloperTools/Scripts/VerifyIntegrationHealth/VerifyIntegrationHealth.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeveloperTools/Scripts/VerifyIntegrationHealth/VerifyIntegrationHealth.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeveloperTools/Scripts/VerifyIntegrationHealth/VerifyIntegrationHealth.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Dict, Any, Tuple
import traceback
def health_check(health_dict, integration_name: str) -> Tuple[bool, bool]:
for _, integration in health_dict.items():
if integration.get('brand') == int... | 28.614035 | 82 | 0.640098 |
1e914114920b5662be437e64a0b6a7b36719e86d | 1,141 | py | Python | Problems/Dynamic Programming/Medium/RoseInShop/rose_in_shop.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/RoseInShop/rose_in_shop.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/RoseInShop/rose_in_shop.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def rose_smell_increase(roses: List[int]) -> int:
n, max_sub = len(roses), 0
forward, backward = [1 for _ in range(n)], [1 for _ in range(n)]
for i in range(1, n):
if roses[i] > roses[i - 1]:
forward[i] = forward[i - 1] + 1
else:
max_sub = ma... | 29.25641 | 68 | 0.54163 |
a20eb8bd935c932f254aa4adacd17347f16b88d0 | 4,531 | py | Python | test/test_npu/test_network_ops/test_hardtanh.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_hardtanh.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_hardtanh.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 37.446281 | 96 | 0.634959 |
78747dfe2a90e264d1ef5d7a93500900a31ce462 | 288 | py | Python | Algorithms/Implementation/cut_the_sticks.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/cut_the_sticks.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/cut_the_sticks.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
n = int(input())
arr = list(map(int, input().split()))
while len(arr) > 0:
print(len(arr))
m = min(arr)
for i in range(len(arr)):
arr[i] = arr[i] - m
while (1):
if 0 in arr:
arr.remove(0)
else:
break
| 19.2 | 37 | 0.475694 |
ec988ec1147116a388d5f44cfb56ef493033c1b0 | 193 | py | Python | Fastir_Collector/dump/windows2008ServerDump.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/dump/windows2008ServerDump.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/dump/windows2008ServerDump.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | from __future__ import unicode_literals
from dump import _Dump
class Windows2008ServerDump(_Dump):
def __init__(self, params):
super(Windows2008ServerDump, self).__init__(params)
| 24.125 | 59 | 0.782383 |
01b9d940e7c0bc99b7f86fc0b87bad7d4fc68690 | 839 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 80/80.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 80/80.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 80/80.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Create a script that lets the user create a password until they have satisfied three conditions:
#Password contains at least one number, one uppercase letter and it is at least 5 chars long
#Give the exact reason why the user has not created a correct password
while True:
notes = []
psw = input("Enter password... | 36.478261 | 97 | 0.662694 |
da530610ce1b8b2da0198c1de77532a1bc0daaa7 | 225 | py | Python | tintz/newsletter/models.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | null | null | null | tintz/newsletter/models.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | 2 | 2021-03-19T21:51:51.000Z | 2021-06-10T18:22:50.000Z | tintz/newsletter/models.py | danielfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext as _
# Create your models here.
class Subscriber(models.Model):
email = models.EmailField(max_length=255, unique=True, verbose_name=_('Email'))
| 28.125 | 83 | 0.777778 |
976102508cc5982cfddde0257c1bedd2cc8b64fd | 2,767 | py | Python | checks/__init__.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | checks/__init__.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | checks/__init__.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
The checks module contains the functionality to get information and test certain
functionality of a site or individual pages.
"""
import logging
from checks import certificate
from checks import charset
from checks import dns_resolution
from checks import domain_variations
from checks import duplicate_content
fro... | 33.743902 | 108 | 0.664619 |
978dcc4e6d549987d5fbb796254568631e6ba74b | 1,023 | py | Python | spo/utils/cleanup.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | null | null | null | spo/utils/cleanup.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/utils/cleanup.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
def cleanup_anfragen():
anfragen = frappe.db.sql("""SELECT `name` FROM `tabAnfrage` WHERE `docstatus` = 0 AND `name` NOT IN (SELE... | 44.478261 | 206 | 0.685239 |
c179945218d51b638e5b45183ce16ada2b7cc18a | 2,627 | py | Python | udm-bildungslogin/usr/lib/python2.7/dist-packages/univention/udm/modules/bildungslogin_assignment.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | udm-bildungslogin/usr/lib/python2.7/dist-packages/univention/udm/modules/bildungslogin_assignment.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | udm-bildungslogin/usr/lib/python2.7/dist-packages/univention/udm/modules/bildungslogin_assignment.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2021 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions ... | 34.116883 | 105 | 0.756376 |
e750fed6239d8c71d8a5c866571d4bc65a555f98 | 984 | py | Python | S5/CS331-SS/PGM_009 - Pass 1 of a 2-pass-assembler.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S5/CS331-SS/PGM_009 - Pass 1 of a 2-pass-assembler.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S5/CS331-SS/PGM_009 - Pass 1 of a 2-pass-assembler.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | import csv
print('INPUT\n')
print('INPUT.asm\n=========\n')
with open('input.csv', newline='') as IPF:
reader = csv.reader(IPF)
for row in reader:
[print(i, end= '\n' if row.index(i)==2 else '\t') for i in row]
print('\n\nOPTAB.db\n========\n')
with open('optab.csv', newline='') as OPTF:
reader = csv.r... | 32.8 | 73 | 0.573171 |
e7dfed2e54c515ffaa4beb24464326bc8939041d | 550 | py | Python | Tutorial-YT-main/enc1.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Tutorial-YT-main/enc1.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Tutorial-YT-main/enc1.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #modul
import marshal, zlib, base64, os, sys
try:
r = sys.argv[1]
except:
exit("usage : python2 enc1.py file.py")
if not os.path.isfile(r): #yang r sama in kaya di atas
exit("File tidak di temukan")
a = open(r).read()
b = marshal.dumps(a) #yang a sama kaya di atas b
c = zlib.compress(b) #yang b sama kaya di... | 23.913043 | 97 | 0.674545 |
820e57476e3fe8e2c56211ead3bca7e87b284b58 | 9,390 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/topic_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/topic_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/topic_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Callable, List, Optional, Tuple
from fastapi import APIRouter, Body, Depends
from pydantic import BaseModel
from watchmen_auth import PrincipalService
from watchmen_data_kernel.cache import CacheService
from watchmen_data_kernel.common import ask_all_date_formats
from ... | 34.777778 | 113 | 0.795847 |
a407d232d1a15da2d03315d4df2274f17f435522 | 2,765 | py | Python | research/cv/STGAN/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/STGAN/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/STGAN/preprocess.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... | 38.943662 | 81 | 0.613382 |
cfb13a7376270a16196f0c94f2e84e5178852b6b | 2,545 | py | Python | dist/search.py | docfetcher/DocFetcher | 42f2accd840edc5059060447ed3536aa4d54b5d3 | [
"Apache-2.0"
] | 24 | 2018-07-22T13:02:53.000Z | 2022-02-02T16:45:29.000Z | dist/search.py | docfetcher/DocFetcher | 42f2accd840edc5059060447ed3536aa4d54b5d3 | [
"Apache-2.0"
] | null | null | null | dist/search.py | docfetcher/DocFetcher | 42f2accd840edc5059060447ed3536aa4d54b5d3 | [
"Apache-2.0"
] | 5 | 2018-12-29T10:38:03.000Z | 2021-02-06T15:29:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script sends the given command-line arguments as a query to the running
DocFetcher instance. The results returned by the latter are printed as filename-
filepath pairs on the standard output.
For more advanced processing of the results, call the search function b... | 33.933333 | 80 | 0.764637 |
7a7550ab8a776e919fbadfbecade7b051aa8d178 | 4,757 | py | Python | tests/addons/res2dict/test_json.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | tests/addons/res2dict/test_json.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | tests/addons/res2dict/test_json.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import datetime
import json
import pytest
from owlmixin.util import load_yaml
from jumeaux.addons.res2dict.json import Executor
from jumeaux.models import Response, Res2DictAddOnPayload
NORMAL_BODY = json.dumps({
"total": 10,
"items": [
{"id": 1, "name": "... | 33.5 | 84 | 0.34917 |
8fbfa9a6d38aa513849ff014ec0747d1666f73db | 8,251 | py | Python | Python X/What+are+functions_.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | Python X/What+are+functions_.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | Python X/What+are+functions_.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"this is outside the function\n"
]
}
],
"source": [
"# a collection of instructions\n",
"# a collection of code\n",... | 18.174009 | 297 | 0.459459 |
56e0122dbb68f97b7e4e8179a7c029819bff98b9 | 103 | py | Python | Python/Sets/introduction_to_sets.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/introduction_to_sets.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/introduction_to_sets.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | from statistics import mean
print(input() == 0 or mean(set([int(a) for a in input().strip().split()]))) | 51.5 | 75 | 0.669903 |
a42d2b0656c40ee557df651f92a2e6a783407c67 | 2,649 | py | Python | Randomizer/randomizer.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Randomizer/randomizer.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Randomizer/randomizer.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Khyber Sen
SoftDev1 pd7
HW2 -- NO-body expects the Spanish Inquisition!
2017-09-13
"""
from __future__ import print_function
__author__ = 'Khyber Sen'
__date__ = '2017-09-13'
import random
# type: dict[int, list[str]]
CLASSES = {
7: ['Helen', 'Shakil', 'Eric', 'Jennifer Y', 'Jennifer Z', ... | 32.304878 | 100 | 0.574179 |
a48c59f6325002003f6a7e803d934dba55c58977 | 11,570 | py | Python | Contrib-Inspur/openbmc/poky/scripts/lib/resulttool/report.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/resulttool/report.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/resulttool/report.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # test result tool - report text based test results
#
# Copyright (c) 2019, Intel Corporation.
# Copyright (c) 2019, Linux Foundation
#
# SPDX-License-Identifier: GPL-2.0-only
#
import os
import glob
import json
import resulttool.resultutils as resultutils
from oeqa.utils.git import GitRepo
import oeqa.utils.gitarchiv... | 49.87069 | 140 | 0.571219 |
74eb14547de7fe0d58a2a8867236669da15b4491 | 2,383 | py | Python | bridges/models/east/losses.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | null | null | null | bridges/models/east/losses.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | 16 | 2020-01-28T23:04:13.000Z | 2022-03-12T00:02:40.000Z | bridges/models/east/losses.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | null | null | null | """
This file contains source code from another GitHub project. The comments made there apply. The source code
was licensed under the GNU General Public License v3.0. The license text and a detailed reference can be
found in the license subfolder. Many thanks to the author of the code.
For reasons of clarity unneeded ... | 48.632653 | 109 | 0.693244 |
746818ba44cbc67a3442d7702fa724ff1c39cc95 | 399 | py | Python | _includes/snippets/python/monkey-patching/attributes_basics.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | 1 | 2020-02-02T16:09:43.000Z | 2020-02-02T16:09:43.000Z | _includes/snippets/python/monkey-patching/attributes_basics.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | 1 | 2021-09-02T11:07:53.000Z | 2021-09-02T11:07:53.000Z | _includes/snippets/python/monkey-patching/attributes_basics.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | null | null | null | #! /usr/bin/env python3
class TestClass:
# class atttributes are declared in the class body
# they absolutey must be assigned a value
class_foo = 0
class_bar = object
def __init__(self):
# instance attributes are assigned to the object in the initializer
# these also need to be a... | 24.9375 | 75 | 0.671679 |
77c7392ef8450c606b94ee067796f2c2c21bbbf0 | 6,006 | py | Python | python/csv_row_reorder.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 89 | 2015-02-13T13:46:06.000Z | 2022-03-13T16:42:44.000Z | python/csv_row_reorder.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 91 | 2015-03-12T13:31:36.000Z | 2022-01-14T07:37:37.000Z | python/csv_row_reorder.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 138 | 2015-03-04T15:23:43.000Z | 2022-03-09T15:11:52.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import argparse
import codecs
import sys
import openapc_toolkit as oat
ARG_HELP_STRINGS = {
"csv_file": "The csv file where rows should be reordered",
"column": "The numerical index of the column to be used as sorting key",
"encoding": "The encoding of the C... | 49.229508 | 114 | 0.599068 |
bb3b4a47934a095b01fe7afa79db43145b498cf6 | 1,910 | py | Python | python/csvcomparator.py | Oidlichtnwoada/MiMi | 06bdee6903673ec4d4fdb3a27ee8f65af2cb2f32 | [
"MIT"
] | 1 | 2019-12-27T10:42:40.000Z | 2019-12-27T10:42:40.000Z | python/csvcomparator.py | Oidlichtnwoada/MiMi | 06bdee6903673ec4d4fdb3a27ee8f65af2cb2f32 | [
"MIT"
] | null | null | null | python/csvcomparator.py | Oidlichtnwoada/MiMi | 06bdee6903673ec4d4fdb3a27ee8f65af2cb2f32 | [
"MIT"
] | null | null | null | class CSVComparator:
def __init__(self):
pass
def compareCSVs(self):
test_successful = True
error_count = 0
with open('input.csv', 'r') as f1, open('output_expected.csv', 'r') as f2, open('output_simulated.csv', 'r') as f3:
file1 = f1.readlines()
file2 = ... | 50.263158 | 251 | 0.494241 |
24a5337fca547f63be37cc810db4250b57b7da38 | 1,648 | py | Python | github.py | kfdm/bitbar-roulette | e84be4425bd8dd826885274e87bd33242b395a0c | [
"MIT"
] | null | null | null | github.py | kfdm/bitbar-roulette | e84be4425bd8dd826885274e87bd33242b395a0c | [
"MIT"
] | null | null | null | github.py | kfdm/bitbar-roulette | e84be4425bd8dd826885274e87bd33242b395a0c | [
"MIT"
] | null | null | null | #!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
import configparser
import logging
import os
import sys
from urllib.parse import urlparse, urlencode
import requests
if 'BitBar' not in os.environ:
logging.basicConfig(level=logging.DEBUG)
else:
sys.stdout = open(sys.stdout.fileno(), mode='w', en... | 29.963636 | 79 | 0.621359 |
799084280acc8295693f2854d5a81c464c596b3d | 373 | py | Python | INBa/2015/Shemenev_A_V/task_1_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_1_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_1_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 1. Вариант 30.
# Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Симона Руссель. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
# Shemenev A.V
# 29.02.16
print("Симоне Рассел является вымышленный персонаж на америк... | 37.3 | 207 | 0.806971 |
c62185385c3f54e38b99260227c20f35d7c318b2 | 3,219 | py | Python | rdlcompiler/systemrdl/preprocessor.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | 4 | 2016-05-10T20:40:34.000Z | 2020-04-09T13:23:33.000Z | rdlcompiler/systemrdl/preprocessor.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | rdlcompiler/systemrdl/preprocessor.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | __author__ = 'megabytephreak'
import os
import tempfile
import re
from rdlcompiler.config import Config
import subprocess
from enum import Enum
class preprocess_mode(Enum):
AUTO = -1
NONE = 0
VERILOG_ONLY = 1
PERL_ONLY = 2
BOTH = 3
def perl_available():
try:
with open(os.devnull) as ... | 34.244681 | 144 | 0.62566 |
ba5445c68be95b901833db534c2c3146577e0bb6 | 473 | py | Python | mobile/tools/shell/generate-include/parse.py | jameswu2014/Paddle-Lite | 827e349ac8eb769a873fe9b3aa961af8b8b20a96 | [
"Apache-2.0"
] | 3 | 2018-08-01T09:45:48.000Z | 2021-01-06T14:55:10.000Z | mobile/tools/shell/generate-include/parse.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | null | null | null | mobile/tools/shell/generate-include/parse.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | 5 | 2020-10-13T09:30:16.000Z | 2021-06-08T02:46:17.000Z | import sys
output = ""
for line in sys.stdin:
line.strip()
tag = "\\"
if tag in line:
index = line.index("\\")
line = line[:index]
output += line
for line in output.split(" "):
line = line.strip()
if "/Applications" in line:
continue
if len(line) <= 0:
contin... | 21.5 | 44 | 0.511628 |
2419ea967264671e5760e271cb1412d48aa1392b | 9,703 | py | Python | src/dao/db.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | src/dao/db.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | src/dao/db.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | """db.py - access station related informations"""
# -- coding: utf-8 --
import logging
import sqlite3
import os
from .. import utils
from ..compat import printf
from ..config import Configuration
from ..exceptions_ import StationNotFoundException
__all__ = ["DBManager", "StationDAO"]
DB_PATH = "resources/db/db.sqli... | 36.477444 | 159 | 0.626198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.