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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bee5691436b848cf489552df54dc2cff4c780103 | 146 | py | Python | packages/watchmen-rest-doll/src/app.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/app.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/app.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from uvicorn import run
if __name__ == "__main__":
run("watchmen_rest_doll.main:app", host="127.0.0.1", port=8000, log_level="info", workers=1)
| 29.2 | 93 | 0.719178 |
36955ace042dc72453546eab899707a57b6fe8cd | 452 | py | Python | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalSSLScript/RiskIQPassiveTotalSSLScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalSSLScript/RiskIQPassiveTotalSSLScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalSSLScript/RiskIQPassiveTotalSSLScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
indicator_value = demisto.args().get('indicator_value')
sha1Regex = re.compile(r'\b[a-fA-F\d]{40}\b')
indicator_type = 'serialNumber'
if re.match(emailRegex, indicator_value):
indicator_type = 'subjectEmailAddress'
if sha1Regex.match(indicator_value):
indicator_type = 'sha1'
... | 30.133333 | 106 | 0.75885 |
36c6a8a8892ceac97169eaeb37ce233f80926e8f | 7,438 | py | Python | src/Room.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | null | null | null | src/Room.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | 9 | 2019-07-15T08:49:00.000Z | 2019-08-28T15:05:08.000Z | src/Room.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | null | null | null | import Enemies
import actions
import items
import merchant
class Room:
def __init__(self, name):
self.name = name
"""The base class for a tile within the world space"""
def intro_text(self):
"""Information to be displayed when the player moves into this tile."""
raise NotImplemente... | 28.067925 | 127 | 0.58349 |
181b8e50e21ad87757843d64407a1bb59847d198 | 2,851 | py | Python | research/cv/SRGAN/src/model/discriminator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/SRGAN/src/model/discriminator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/SRGAN/src/model/discriminator.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.013333 | 119 | 0.601894 |
1882157c4e38628dfe8428f099cfb35ba7219e9d | 2,366 | py | Python | Packs/BPA/Integrations/BPA/BPA_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/BPA/Integrations/BPA/BPA_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/BPA/Integrations/BPA/BPA_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from test_data.response_constants import GET_RESULTS_RESPONSE, GET_DOCUMENTATION_RESPONSE
from test_data.result_constants import GET_RESULTS_NO_FILTER, GET_RESULTS_ID_FILTER, GET_RESULTS_NAME_FILTER, \
GET_DOCUMENTATION_NO_FILTER, GET_DOCUMENTATION_ID_FILTER
from BPA import Client, get_results_comma... | 44.641509 | 111 | 0.717667 |
a17939978d580edc7cafde05c11a0256753e90ec | 2,168 | py | Python | app/others/views.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/others/views.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/others/views.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import app, db
from flask import g, abort
from app.submission.models import Submission
from app.common.models import JudgementStatus
from app.common.user import User
from utils import success, get_day_zero_time
from datetime import datetime, timedelta
from sqlalchemy import and_
@app.route('... | 28.906667 | 96 | 0.589945 |
a183417e80ae3e1f0a6e323930cace9d428ed5ea | 92 | py | Python | 2014/11/ebola-ppe-scenarios/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/11/ebola-ppe-scenarios/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/11/ebola-ppe-scenarios/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 = '1APeMsNoGiUcf9o7i8y2_5hI687DDexq4ymuQQK_mO3k'
| 23 | 68 | 0.847826 |
1a1fb8700d0cb85e63118d000a15da6474dd08be | 221 | py | Python | core/checks.py | Pug234/BytesBump | d5ff3130bffae92e1c5c671db4ed8904c403e9dc | [
"MIT"
] | 11 | 2020-11-14T17:28:50.000Z | 2021-05-19T18:21:07.000Z | core/checks.py | AnimeDyno/BytesBump | a0cf0bfc4c13592c7b10ad46faa46a2a98dc1443 | [
"MIT"
] | 3 | 2021-01-22T15:48:41.000Z | 2021-06-22T17:16:50.000Z | core/checks.py | zImPinguin/Bump-Bot | 3f449a4e5581a35a5cff998e94a13ae33dbe2b04 | [
"MIT"
] | 13 | 2020-11-18T05:20:31.000Z | 2021-06-19T16:31:30.000Z | from .files import Data
from discord.ext import commands
config = Data("config").yaml_read()
def manager():
def predicate(ctx):
return ctx.author.id in config["managers"]
return commands.check(predicate) | 24.555556 | 50 | 0.714932 |
c512d5c0f3b13ecfbc8037aed09fb354ef80ed37 | 1,285 | py | Python | menucard/filter.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | menucard/filter.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | menucard/filter.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | import django_filters
from menucard.models import *
from django_filters import DateFilter
class BesucherFilter(django_filters.FilterSet):
"""
Eine Klasse zur Repräsentation eines Besucherfilters
...
Attributes
----------
start_datum : datefilter
... | 26.22449 | 94 | 0.523735 |
9a78097b4e7250be41a474d81d80acea06ac5dd5 | 1,488 | py | Python | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/model.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-14T09:03:15.000Z | 2022-03-14T09:03:15.000Z | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/model.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/model.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # 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 required by appli... | 41.333333 | 139 | 0.747984 |
9a938febbcfd289e0dd9a3707c54980563cefb0a | 2,036 | py | Python | fcos_core/layers/sigmoid_focal_loss_vari.py | HaoGood/MMMC | 24dd4ce830efc7a8dc580735903c2a776b6a1a7b | [
"Apache-2.0"
] | 3 | 2022-01-12T11:22:38.000Z | 2022-01-27T02:28:30.000Z | fcos_core/layers/sigmoid_focal_loss_vari.py | HaoGood/MMMC | 24dd4ce830efc7a8dc580735903c2a776b6a1a7b | [
"Apache-2.0"
] | null | null | null | fcos_core/layers/sigmoid_focal_loss_vari.py | HaoGood/MMMC | 24dd4ce830efc7a8dc580735903c2a776b6a1a7b | [
"Apache-2.0"
] | 1 | 2022-01-23T02:45:03.000Z | 2022-01-23T02:45:03.000Z | import torch.nn as nn
import torch.nn.functional as F
def sigmoid_focal_loss_vari(pred,
target,
weight=None,
alpha=0.75,
gamma=2.0,
iou_weighted=False):
"""`Varifocal Loss <https://arxiv.org/abs/2008.13367>`_
Args:
... | 44.26087 | 79 | 0.594794 |
7730bfb19cbf68c514a685fe28a067e59d5e7927 | 1,385 | py | Python | src/onegov/fsi/forms/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/forms/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/forms/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired
from onegov.form import Form
from onegov.form.fields import MultiCheckboxField
from onegov.fsi import _
from cached_property import cached_property
class NotificationForm(Form):
subject = StringField(
label=_('Em... | 24.732143 | 73 | 0.656318 |
620be3d9bedfc939a80fb8e1d5b2855216c69e57 | 432 | py | Python | 3-longest-substring-without-repeating-characters/3-longest-substring-without-repeating-characters.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 3-longest-substring-without-repeating-characters/3-longest-substring-without-repeating-characters.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 3-longest-substring-without-repeating-characters/3-longest-substring-without-repeating-characters.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
if not s:
return 0
dp=[s[0]]
last = 0 # updated
for i, each in enumerate(s[1:], 1):
if each not in dp[-1]:
dp.append(dp[-1]+each)
else:
last_idx = s[... | 30.857143 | 54 | 0.451389 |
b85782a16eee2f511c8985e62ef70d14d0f2535f | 9,085 | py | Python | Prototype/main prototype/Printing.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/Printing.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/Printing.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | from PyQt5 import QtWidgets, QtCore, QtPrintSupport, QtGui
from PyQt5.QtGui import QPainter
from PyQt5.QtWidgets import QApplication
import sys
from Tab import Tab
import pathlib
class Print(QtWidgets.QWidget):
"""
Printing class
"""
def __init__(self,tab):
"""
Print class init:
... | 52.212644 | 207 | 0.604183 |
b880af2a9667635fd4ac29ea5e9e31f24102a20f | 5,267 | py | Python | tests/utilities/creation_utils.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/utilities/creation_utils.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/utilities/creation_utils.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 ... | 36.576389 | 88 | 0.624454 |
b8849bb9b446d830e39e17f68f290fd9f66a9a1c | 33,686 | py | Python | src/tools/dev/scripts/email2discussions.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/dev/scripts/email2discussions.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/dev/scripts/email2discussions.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) 2021, Lawrence Livermore National Security, LLC
#
# Python3 script using GraphQL interface to GitHub discussions to read
# .txt file mbox files of VisIt User's email archive and import each
# email thread as a GitHub discussion.
#
# 1. Reads a directory of .txt files in mbox format for messages (readAll... | 35.83617 | 175 | 0.580449 |
0c52d11df78a2af8e499fbc99b984aba62604dcf | 567 | py | Python | tests/product_key.py | fausecteam/faustctf-2019-responsivesecurity | 65b4e02bdc9de278166c38697ab992638977d511 | [
"0BSD"
] | null | null | null | tests/product_key.py | fausecteam/faustctf-2019-responsivesecurity | 65b4e02bdc9de278166c38697ab992638977d511 | [
"0BSD"
] | null | null | null | tests/product_key.py | fausecteam/faustctf-2019-responsivesecurity | 65b4e02bdc9de278166c38697ab992638977d511 | [
"0BSD"
] | null | null | null | import urllib.request
import nacl.encoding
import nacl.signing
def get_url(url):
return urllib.request.urlopen(url).read()
def get_product_key_from_api(endpoint, keyfile):
with open(keyfile, "rb") as kf:
sk = nacl.signing.SigningKey(kf.read().strip(), nacl.encoding.HexEncoder)
h = get_url(endpoint... | 28.35 | 81 | 0.700176 |
3be875e1bd8521acd18fd2940fa1ae5e9f2ce331 | 2,826 | py | Python | disenn/models/conceptizers.py | AmanDaVinci/DiSENN | ca84a8d646ad8e5e3675ffd19165c20933b81ef7 | [
"MIT"
] | 1 | 2020-08-28T05:06:36.000Z | 2020-08-28T05:06:36.000Z | disenn/models/conceptizers.py | AmanDaVinci/DiSENN | ca84a8d646ad8e5e3675ffd19165c20933b81ef7 | [
"MIT"
] | null | null | null | disenn/models/conceptizers.py | AmanDaVinci/DiSENN | ca84a8d646ad8e5e3675ffd19165c20933b81ef7 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from .encoders import ConvEncoder
from .decoders import ConvDecoder
class VaeConceptizer(nn.Module):
"""Variational Auto Encoder to generate basis concepts
Concepts should be independently sensitive to single generative factors,
which will lead to better interpretabilit... | 35.325 | 90 | 0.63305 |
020bd457c39e6e3e00f2ff94ecbbf198ad20d010 | 3,927 | py | Python | pages/extensions/amp_example_preview/util/example_exporter.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 300 | 2015-12-09T20:35:37.000Z | 2019-07-16T06:41:29.000Z | pages/extensions/amp_example_preview/util/example_exporter.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 2,099 | 2019-07-16T13:24:27.000Z | 2022-03-26T12:31:51.000Z | pages/extensions/amp_example_preview/util/example_exporter.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 543 | 2019-07-18T09:06:14.000Z | 2022-03-31T02:43:10.000Z | import os
import urllib.parse
import errno
from grow.documents import document
from .constants import FORMAT_TYPE_IDS, DEFAULT_FORMAT
from .example_document import ExampleDocument
from .templates import load_template
TEMPLATE_PATH = 'layouts/example-pages/'
TEMPLATE_FILES = {
'websites': TEMPLATE_PATH + 'amp-websi... | 33.564103 | 114 | 0.677871 |
02460bac16b39ed62ba694c5834c806eae90554a | 889 | py | Python | src/Settings.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | src/Settings.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | src/Settings.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
ip = "192.168.0.40"
port = "9559"
state_dim = 2 # env.observation_space.shape[0]
action_dim = 1 # env.action_space.shape[0]
action_bound = 0.4 # env.action_space.high
TRAINING_STEPS = 2000
OBERE_GRENZE = 0.4
UNTERE_GRENZE = -0.25
TIME_TO_MOVE = 0.3
TRAINING_FILE = "training_set.json"
VIDEODEV... | 25.4 | 47 | 0.687289 |
ce9fab89c4aff3a3745ca2fa810b11c14c0052c6 | 1,714 | py | Python | src/bo4e/com/regionskriterium.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/regionskriterium.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/regionskriterium.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Regionskriterium class and corresponding marshmallow schema for de-/serialization
"""
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
from bo4e.enum.gueltigkeitstyp import Gueltigkeitstyp
from bo4e.enum.regi... | 34.28 | 187 | 0.756126 |
0b81189ea547a66e71645b91ce19c5db81ed33ed | 465 | py | Python | rainbow_test.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | 1 | 2019-04-27T07:28:52.000Z | 2019-04-27T07:28:52.000Z | rainbow_test.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | rainbow_test.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | from rainbow import *
import time
from field import Field
from painter import RGB_Field_Painter
if __name__ == "__main__":
rgb_field_painter = RGB_Field_Painter()
field_leds = Field(10, 20)
for m in range(5, 50):
for a in range(1, 50):
for i in range(200):
field_leds.se... | 25.833333 | 95 | 0.604301 |
0b9475bc1ad79452580f4736e1e7b4890f26ca24 | 954 | py | Python | IdeaProjects/stock/stock_dev1/stock.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | IdeaProjects/stock/stock_dev1/stock.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | IdeaProjects/stock/stock_dev1/stock.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/python3
# coding=utf-8
”’
Created on Nov 9, 2011
@author: 笑遍世界
”’
import urllib.request
def get_price(code):
url = ‘http://hq.sinajs.cn/?list=%s’ % code
req = urllib.request.Request(url)
#如果不需要设置代理,下面的set_proxy就不用调用了。由于公司网络要代理才能连接外网,所以这里有set_proxy…
req.set_proxy(‘proxy.XXX.com:91... | 30.774194 | 86 | 0.62369 |
f0366f968b655a6c9eb0c49aea2a5db5059b055e | 252 | py | Python | namedtuple.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | namedtuple.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | namedtuple.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | from collections import namedtuple
N = int(input())
columns = ','.join(input().split())
Student = namedtuple('Student',columns)
sum = 0
for i in range(N):
row = input().split()
student = Student(*row)
sum += int(student.MARKS)
print(sum) | 19.384615 | 39 | 0.650794 |
a8c3fc40eeff63fd9dbec4eb5f9014e3fe916422 | 227 | py | Python | Erste Schritte/hallo.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Erste Schritte/hallo.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Erste Schritte/hallo.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | # Mein erstes Programm
print("Hallo Welt") # Eine Ausgabe
""" Kommentar in
mehreren Zeilen """
# Verkettung von Ausgaben
print("Hallo", "Welt")
# Lange Ausgaben
print("Hallo",
"Welt")
print("Hallo ",
"Welt")
| 16.214286 | 35 | 0.634361 |
8c1d7ed5ac13afd9eb909b3c4e7df5b0617f1c7c | 2,651 | py | Python | frappe-bench/apps/erpnext/erpnext/agriculture/doctype/soil_texture/soil_texture.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/agriculture/doctype/soil_texture/soil_texture.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/agriculture/doctype/soil_texture/soil_texture.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, cint
from frappe import _
c... | 37.871429 | 124 | 0.666164 |
0fc60188656c2a99d40d16162ade892fa72112b4 | 1,436 | py | Python | crawlab/spiders/spiders/utils.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | 1 | 2019-08-20T14:26:39.000Z | 2019-08-20T14:26:39.000Z | crawlab/spiders/spiders/utils.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | null | null | null | crawlab/spiders/spiders/utils.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | null | null | null | import itertools
import re
def generate_urls(base_url: str) -> str:
url = base_url
# number range list
list_arr = []
for i, res in enumerate(re.findall(r'{(\d+),(\d+)}', base_url)):
try:
_min = int(res[0])
_max = int(res[1])
except ValueError as err:
... | 25.642857 | 81 | 0.509053 |
e84a8cc069dcaa546e72a2163326eb8b6078a2d9 | 333 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/5. determine the factors of a number.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/5. determine the factors of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/5. determine the factors of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function to determine the factors of a number. Return the output in the form of a list.
Example:
input = 26
output = [1,2,13,26]
"""
def factors(num):
output_list = []
for i in range(1, num + 1):
if num % i == 0:
output_list.append(i)
else:
break
return ... | 20.8125 | 95 | 0.576577 |
2cd85394cb22b675f9833a7ff870d30761710992 | 1,573 | py | Python | src/standard_module/multiprocessing_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/standard_module/multiprocessing_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/standard_module/multiprocessing_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
multiprocessing.dummy
multiprocessing.dummy.Pool
"""
"""
from threading import Event,Thread
def f(e):
print('f 0')
e.wait()
print('f 1')
e = Event()
t = Thread(target=f,args=(e,))
t.start()
e.set()
e.clear()
"""
"""
import threading
l = threading.loca... | 13.798246 | 49 | 0.607756 |
fa0c3f3bb1c0a23dd1ea3609e50ff78468f69aa1 | 157,982 | py | Python | wifite-master/wifite.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 337 | 2020-08-15T12:22:14.000Z | 2022-03-29T06:05:15.000Z | wifite-master/wifite.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 3 | 2020-11-12T14:30:48.000Z | 2021-05-18T16:56:22.000Z | wifite-master/wifite.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 83 | 2020-08-15T00:22:58.000Z | 2022-03-31T08:40:23.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
wifite
author: derv82 at gmail
author: bwall @botnet_hunter (ballastsec@gmail.com)
author: drone @dronesec (ballastsec@gmail.com)
Thanks to everyone that contributed to this project.
If you helped in the past and want your name here, shoot me an ... | 45.202289 | 161 | 0.496126 |
ad0251f46039f11d614764c36d965c9098e3b69b | 1,089 | py | Python | venv/lib/python3.7/site-packages/twilio/rest/numbers/v2/__init__.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | venv/lib/python3.7/site-packages/twilio/rest/numbers/v2/__init__.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | bot/lib/python3.7/site-packages/twilio/rest/numbers/v2/__init__.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.version import Version
from twilio.rest.numbers.v2.regulatory_compliance import RegulatoryComplianceList
class V2(Version):
def __init__(self, domain):
"""
Ini... | 25.325581 | 85 | 0.620753 |
7e2de664b3cc7ea6bfd11d0d82ff478c792d0011 | 788 | py | Python | deprecated/fleet_x/docs/source/paddle_fleet/to_rst.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/fleet_x/docs/source/paddle_fleet/to_rst.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/fleet_x/docs/source/paddle_fleet/to_rst.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | import os
not_rst_file = [
'fleet_and_edl_for_distillation_cn.md',
'fleet_and_edl_for_distillation.md',
'fleet_collective_training_practices_cn.md',
'fleet_collective_training_practices.md',
'fleet_collective_training_speedup_with_amp_cn.md',
'fleet_collective_training_speedup_with_amp.md',
... | 29.185185 | 111 | 0.708122 |
7e39f81c635f000f608a085847a70b899937bdb0 | 3,150 | py | Python | service/wkb/intelligent_device_web/keras_tf_imagenet.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/intelligent_device_web/keras_tf_imagenet.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/intelligent_device_web/keras_tf_imagenet.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
#import os
#import tensorflow as tf
#os.environ["CUDA_VISIBLE_DEVICES"] = "6"
#gpu_options = tf.GPUOptio... | 39.375 | 124 | 0.620952 |
7e670783f1fdf6e52468daa1b6e3c11911532e23 | 1,839 | py | Python | examples/myqueryset/bulk_create_/views.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/myqueryset/bulk_create_/views.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/myqueryset/bulk_create_/views.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.shortcuts import render
from django.http import HttpResponse
from .models import product
# Create your views here.
def index_view(request):
# 批量插入1000条数据, 每一批插入10条数据.
items = []
for i in range(10000):
pp = product(name="aaa-%s" % i,
price=10.00,
... | 47.153846 | 90 | 0.492659 |
7e878afd24f9539c79beca63a33f5c906cabf350 | 227 | py | Python | Problems/Dynamic Programming/Easy/MaxSubArray/max_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Easy/MaxSubArray/max_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Easy/MaxSubArray/max_subarray.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def maxSubArray(nums: List[int]) -> int:
res = nums[0]
for i in range(1, len(nums)):
if nums[i - 1] > 0:
nums[i] += nums[i - 1]
res = max(res, nums[i])
return res | 25.222222 | 40 | 0.519824 |
7d0c9184dbc701e5b8b15443431ce9aba1b80448 | 1,259 | py | Python | INBa/2015/Ermashov_A_V/task_8_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_8_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_8_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так,
#чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае,
#если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки,
#отгадавшие слово без подсказки, пол... | 33.131579 | 101 | 0.714853 |
7d2d9d0c8d2232d48c9809322cce3ebfebde4b3b | 1,495 | py | Python | src/Sephrasto/EventBus.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | src/Sephrasto/EventBus.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | src/Sephrasto/EventBus.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | import bisect
class PriotizedCallback():
def __init__(self):
self.priority = 0
self.callback = None
def __lt__(self, other):
return self.priority < other.priority
class EventBus:
actionCallbacks = {}
filterCallbacks = {}
@staticmethod
def addFilter(filterName, callbac... | 31.145833 | 63 | 0.655518 |
7d44d073676ba5620988f3889339f17073b261af | 108 | py | Python | wagtailadditionalicons/__init__.py | rivz-a/wagtailcustumsicons | 8f62e03df4f37a6c8fce7b85ffc62d9e495cad39 | [
"BSD-3-Clause"
] | null | null | null | wagtailadditionalicons/__init__.py | rivz-a/wagtailcustumsicons | 8f62e03df4f37a6c8fce7b85ffc62d9e495cad39 | [
"BSD-3-Clause"
] | null | null | null | wagtailadditionalicons/__init__.py | rivz-a/wagtailcustumsicons | 8f62e03df4f37a6c8fce7b85ffc62d9e495cad39 | [
"BSD-3-Clause"
] | null | null | null | __version__ = '2.0.0-alpha'
default_app_config = 'wagtailadditionalicons.apps.WagtailadditionalIconsConfig'
| 36 | 79 | 0.842593 |
cbbba19be1437a8c92ffa22c96eef75641741fbe | 905 | py | Python | SleekSecurity/layers/plugins/fingerprint/cms/plone.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/cms/plone.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/cms/plone.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt'
from re import search,I
def plone(headers,content):
_ = False
if 'x-caching-rule-id' in headers.keys():... | 43.095238 | 104 | 0.643094 |
cbbccdbcb0b363fb63f5163b387e25322258fbd8 | 1,106 | py | Python | main.py | Limatationz/pandemiesimulator | 91d21fda2f9c77d616a9e9401271fc044b421007 | [
"MIT"
] | null | null | null | main.py | Limatationz/pandemiesimulator | 91d21fda2f9c77d616a9e9401271fc044b421007 | [
"MIT"
] | null | null | null | main.py | Limatationz/pandemiesimulator | 91d21fda2f9c77d616a9e9401271fc044b421007 | [
"MIT"
] | null | null | null | """
Contains the main function
"""
import sys
from PyQt5 import QtCore
from PyQt5.QtCore import QFile, QTextStream
from PyQt5.QtWidgets import QApplication
from presenter.presenter import Presenter
from resources.style import breeze_resources
if __name__ == '__main__':
""" Creates the app and shows the GUI ... | 26.97561 | 78 | 0.703436 |
1dbbb152bb37c399b8bc53631b04ed56e985942d | 5,378 | py | Python | src/onegov/swissvotes/fields/metadata.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/fields/metadata.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/fields/metadata.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from decimal import Decimal
from onegov.form.fields import UploadField
from onegov.form.validators import FileSizeLimit
from onegov.form.validators import WhitelistedMimeType
from onegov.swissvotes import _
from onegov.swissvotes.models import ColumnMapperMetadata
from openpyxl import load_workbook
class SwissvoteMet... | 36.835616 | 75 | 0.482335 |
38173df2468a10b7dd8c1c50c7b970d297cab637 | 407 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C09SystemDesignScalability/questions/9.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C09SystemDesignScalability/questions/9.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C09SystemDesignScalability/questions/9.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Sales Rank
# A large eCommerce company wishes to list the best-selling products, overall and by category.
# For example, one product might be the #1056th best-selling product overall but the 13th
# best-selling product under "Sports Equipment" and the #24th best-selling product under
# "Safety".
# Descr... | 37 | 94 | 0.734644 |
389288093c28774b5ca38730c2a38ca0f3ae464d | 12,848 | py | Python | official/cv/ADNet/src/trainers/adnet_test.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/adnet_test.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/adnet_test.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... | 44.151203 | 119 | 0.645081 |
2a7bf1c7675e9ee82693cfb3a1ba465563a455af | 4,411 | py | Python | src/test/tests/rendering/axislabels.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/rendering/axislabels.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/rendering/axislabels.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# MODES: serial, parallel, scalable
# CLASSES: nightly
#
# Test Case: axislabels.py
#
# Tests: Tests the axis labels
#
# Programmer: Eric Brugger
# Date: Fri Dec 17 16:19:49 PST 2021
#
# Modifications
#
# ----------------... | 31.283688 | 78 | 0.678078 |
63249e7d69541ae677a15d79e5a9617a37441399 | 623 | py | Python | scripts/generate-bag-of-words-tweets.py | pratikkumar-jain/Twitter-Mining | 228a852f38b8ff8b8c9b86f270d4b530840696f7 | [
"MIT"
] | 1 | 2020-10-04T13:46:21.000Z | 2020-10-04T13:46:21.000Z | scripts/generate-bag-of-words-tweets.py | pratikkumar-jain/Twitter-Mining | 228a852f38b8ff8b8c9b86f270d4b530840696f7 | [
"MIT"
] | null | null | null | scripts/generate-bag-of-words-tweets.py | pratikkumar-jain/Twitter-Mining | 228a852f38b8ff8b8c9b86f270d4b530840696f7 | [
"MIT"
] | null | null | null | from cassandra.cluster import Cluster
from sklearn.feature_extraction.text import CountVectorizer
def createBagofWords():
output_text = []
cluster = Cluster()
#connect to 'tweet_mining' keyspace
session = cluster.connect('tweet_mining')
rows = session.execute("SELECT tweet_id,tweet_text FROM tweets... | 28.318182 | 100 | 0.714286 |
2d5656511e016aa10e631f16385aed9327496469 | 1,305 | py | Python | elements/python/9/11/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/9/11/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/9/11/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import random
class Queue(object):
def __init__(self, capacity=4):
self.items = [None]*capacity
self.tail = 0
self.head = 0
def enqueue(self, x):
if self.size() == self.cap():
self._grow()
idx = self.head % self.cap()
self.items[idx] = x
sel... | 21.048387 | 59 | 0.514176 |
2d5af69369a6f82d329a8d29680766c59121a0d1 | 403 | py | Python | tests/test_api.py | KingKevin23/agspiel-python-api | 33e74ff6bee2f9ce353da757bdb99e929acc1a13 | [
"MIT"
] | 1 | 2021-03-09T21:37:41.000Z | 2021-03-09T21:37:41.000Z | tests/test_api.py | KingKevin23/agspiel-python-api | 33e74ff6bee2f9ce353da757bdb99e929acc1a13 | [
"MIT"
] | 4 | 2020-11-13T19:34:58.000Z | 2021-07-24T16:25:27.000Z | tests/test_api.py | KingKevin23/agspiel-python-api | 33e74ff6bee2f9ce353da757bdb99e929acc1a13 | [
"MIT"
] | 1 | 2020-08-24T14:38:18.000Z | 2020-08-24T14:38:18.000Z | # Copyright (c) 2020 | KingKevin23 (@kingkevin023)
from agspiel.api.api import Api
from datetime import datetime
from unittest import TestCase
class TestApi(TestCase):
def setUp(self):
self.api = Api("")
def test_api_version(self):
self.assertIsInstance(self.api.api_version, int)
def te... | 26.866667 | 61 | 0.719603 |
932e9c222a604b61d94d991e1268dc75fb4ae800 | 8,050 | py | Python | borza_model.py | rok-lindic/Borza | 430f8b177a40bf6494d934e36dd5e85c4367e394 | [
"MIT"
] | null | null | null | borza_model.py | rok-lindic/Borza | 430f8b177a40bf6494d934e36dd5e85c4367e394 | [
"MIT"
] | null | null | null | borza_model.py | rok-lindic/Borza | 430f8b177a40bf6494d934e36dd5e85c4367e394 | [
"MIT"
] | null | null | null | ###MODEL
import urllib.request, json
from datetime import datetime, timedelta
import sys
import time
url = 'https://rest.ljse.si/web/Bvt9fe2peQ7pwpyYqODM/price-list/XLJU/'#+str(danasnji_dan)+'/json'
def danasnji_dan():#Ne vem tocno, kdaj posodobijo podatke, po izkušnjah pa so ob 17h bili posodobljeni, zato ... | 40.656566 | 148 | 0.548696 |
9371d931755a5229837779a0bd0bb12a4115c21c | 554 | py | Python | PINp/2015/TITOV_I_V/task_6_20.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/TITOV_I_V/task_6_20.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/TITOV_I_V/task_6_20.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 20.
# Создайте игру, в которой компьютер загадывает имя одного из семи друзей Белоснежки,
#, а игрок должен их угадать
# Titov I. V.
# 02.06.2016
import random
avtori = ("Вася ", "Петя ", "Вова ","Коля ","Русик ","Ваня ","Миша")
zagadka = random.choice(avtori)
predpologenie = input("Программа заг... | 29.157895 | 100 | 0.709386 |
937c4b84f497e68ba09a880e30b4c592261316b8 | 861 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_06_Funktionen/05_recursive_function_with_turtle_trees.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_06_Funktionen/05_recursive_function_with_turtle_trees.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_06_Funktionen/05_recursive_function_with_turtle_trees.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 05_recursive_function_with_turtle_trees.py
# Project: Kapitel_06_Funktionen
# Created Date: Sunday 24.02.2019, 12:57
# Author: Apop85
# -----
# Last Modified: Sunday 24.02.2019, 13:08
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MIT... | 21 | 80 | 0.636469 |
57e40101f8a99a3deb1e9f56f419b267153a9378 | 1,745 | py | Python | spider/ce_worker_pos.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/ce_worker_pos.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/ce_worker_pos.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | import time
import json
from bson import json_util
import multiprocessing
from multiprocessing import Pool
from Config import get_config
got,db,r = get_config()
def advance_search_dataset(q,f,num,event_id):
_,db,_ = get_config()
collection = db.pos
tweetCriteria = got.manager.TweetCriteria().setQuery... | 34.9 | 146 | 0.627507 |
aa1c01e41119d4b66c3b070f3ebb5e388bfc64de | 3,505 | py | Python | python/oneflow/test/modules/test_scatter_ops.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/test/modules/test_scatter_ops.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_scatter_ops.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.894737 | 86 | 0.652211 |
52d22bc8167388eb175a9961b9a3b353d41c7f5d | 884 | py | Python | controller.py | joy-mdy-geo/ufc-old | c3b4ab63c21984f57f802ae8d6680ddcf32af220 | [
"MIT"
] | null | null | null | controller.py | joy-mdy-geo/ufc-old | c3b4ab63c21984f57f802ae8d6680ddcf32af220 | [
"MIT"
] | 3 | 2018-08-25T06:01:34.000Z | 2018-08-25T06:01:51.000Z | controller.py | joy-mdy-geo/ufc-old | c3b4ab63c21984f57f802ae8d6680ddcf32af220 | [
"MIT"
] | null | null | null | from converter import uni2win, uni2zg, win2uni, zg2uni
def convert(from_encoding='from_zawgyi', to_encoding='to_unicode', input=''):
result = ''
if from_encoding[5:] == to_encoding[3:]:
return input
if from_encoding == 'from_unicode':
if to_encoding == 'to_zawgyi':
result = uni... | 36.833333 | 77 | 0.622172 |
f4f581c2ec71e115eb3e5ca6841b9abb99dda391 | 1,544 | py | Python | tensorflow/basic-rl/tutorial14/code/train_ppo2.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial14/code/train_ppo2.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial14/code/train_ppo2.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | from baselines.common import set_global_seeds
from baselines.common.vec_env.vec_normalize import VecNormalize
from baselines.ppo2 import ppo2
from baselines.ppo2.policies import MlpPolicy
import gym
import tensorflow as tf
from baselines.common.vec_env.dummy_vec_env import DummyVecEnv
import argparse
from baselines imp... | 35.906977 | 112 | 0.744171 |
5e90dee4296a14d5f8acff134c4c32b16f941df1 | 2,957 | py | Python | python_experiments/data_analysis/reads_varying_parameters_statistics/varying_delta_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/reads_varying_parameters_statistics/varying_delta_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/reads_varying_parameters_statistics/varying_delta_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os, json, decimal
from data_analysis.reads_varying_parameters_statistics.varying_c_statistics_reads import has_infeasible_on_line_rand_walk_num
reads_tag = 'reads-s'
reads_d_tag = 'reads-d'
reads_rq_tag = 'reads-rq'
suffix_str = '-rand-bench.txt'
delta_lst = list(reversed([10 ** (-(i + 1)) for i in range(9)]))... | 37.43038 | 125 | 0.681434 |
5e92b20bac3b412794eadff978553621e248956e | 463 | py | Python | Curso-Em-Video-Python/2Exercicios/040_Media_escolar.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/040_Media_escolar.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/040_Media_escolar.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | print('Escola Javali Cansado')
print('-' * 20)
nome = str(input('Qual seu nome: '))
nota1 = float(input('Nota 1: '))
nota2 = float(input('Nota 2: '))
media = (nota1 + nota2)/2
if media < 5:
print(' {} Sua media foi: {:.1f} \n REPROVADO!!'.format(nome, media))
elif media >= 5 and media < 7:
print(' {} Sua media ... | 28.9375 | 82 | 0.602592 |
0d593d108f5daec2cb8ff80d890368908299af9f | 269 | py | Python | GUI/gui_sample_002.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | GUI/gui_sample_002.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | GUI/gui_sample_002.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | from tkinter import *
class Application:
def __init__(self, master=None):
self.widget1 = Frame(master)
self.widget1.pack()
self.msg = Label(self.widget1, text="Primeiro widget")
self.msg.pack ()
root = Tk()
Application(root)
root.mainloop()
| 24.454545 | 60 | 0.669145 |
21e918c5c5974591a46094a667d7bc297988cb07 | 1,502 | py | Python | Problems/Dynamic Programming/Medium/CountSquareSubmatricesAllOnes/count_square_submatrices_all_one.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/CountSquareSubmatricesAllOnes/count_square_submatrices_all_one.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/CountSquareSubmatricesAllOnes/count_square_submatrices_all_one.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from functools import lru_cache
from typing import List
# Top-down (Memoization)
# TC: O(M * N); SC: O(M * N)
def countSquares(self, matrix: List[List[int]]) -> int:
m, n = len(matrix), len(matrix[0])
self.ans = 0
@lru_cache(None)
def dp(i: int, j: int) -> int:
if i < 0 or i == m or j < 0 or ... | 27.814815 | 80 | 0.490013 |
1d3ee185d84d2645041d579cda733889a1514157 | 12,503 | py | Python | src/visuanalytics/server/db/queries.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/server/db/queries.py | SWTP-SS20-Kammer-2/Data-Analytics | 23f71b49efed53bba2887d68e389c732566e1932 | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/server/db/queries.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import json
import os
import humps
from visuanalytics.server.db import db
from visuanalytics.util.resources import IMAGES_LOCATION as IL, AUDIO_LOCATION as AL
STEPS_LOCATION = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../resources/steps"))
IMAGE_LOCATION = os.path.abspath(os.path.join(os.path.dirna... | 39.071875 | 154 | 0.633448 |
1d664f177a4e644be39a516548365563010b89c5 | 4,448 | py | Python | basic/37-charm.fi/tests/test_passive_strategy.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 987 | 2021-12-19T09:57:18.000Z | 2022-03-31T15:39:45.000Z | basic/37-charm.fi/tests/test_passive_strategy.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 73 | 2021-07-04T03:53:57.000Z | 2021-12-18T06:17:13.000Z | basic/37-charm.fi/tests/test_passive_strategy.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 263 | 2021-06-28T15:26:56.000Z | 2021-12-19T08:14:37.000Z | from brownie import chain, reverts
import pytest
from pytest import approx
from conftest import computePositionKey
@pytest.mark.parametrize("buy", [False, True])
@pytest.mark.parametrize("big", [False, True])
def test_strategy_rebalance(
vault,
strategy,
pool,
tokens,
router,
getPositions,
... | 28.151899 | 88 | 0.651978 |
984833f035ab6e8e07c76e6905f26902d7b5e5ba | 2,024 | py | Python | backend/helper.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/helper.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/helper.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null |
# ------------ Helper functions ------------
MEDIA_TYPES = [
{
'endswith': '.gif',
'mime': 'image/gif',
'text': 'Bild'
},{
'endswith': '.png',
'mime': 'image/png',
'text': 'Bild'
},{
'endswith': '.jpg',
'mime': 'image/jpeg',
'text': '... | 25.620253 | 72 | 0.539032 |
f6e82ca6755b0587390341ed83e16a396e842221 | 16,582 | py | Python | pdfannots/types.py | EnginKarahan/pdfannots | 745e1636df077e895ad1c116306df0e764c05e0f | [
"MIT"
] | null | null | null | pdfannots/types.py | EnginKarahan/pdfannots | 745e1636df077e895ad1c116306df0e764c05e0f | [
"MIT"
] | null | null | null | pdfannots/types.py | EnginKarahan/pdfannots | 745e1636df077e895ad1c116306df0e764c05e0f | [
"MIT"
] | null | null | null | from __future__ import annotations
import bisect
import datetime
import enum
import logging
import typing
from pdfminer.layout import LTComponent, LTText
from pdfminer.pdftypes import PDFObjRef
from .utils import merge_lines
logger = logging.getLogger('pdfannots')
Point = typing.Tuple[float, float]
"""An (x, y) po... | 35.891775 | 99 | 0.597395 |
89f8f9098b5391e879ca63da86ce3f6202997f1b | 6,231 | py | Python | retro/cores/gba/src/platform/python/mgba/memory.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/cores/gba/src/platform/python/mgba/memory.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/cores/gba/src/platform/python/mgba/memory.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | # Copyright (c) 2013-2016 Jeffrey Pfau
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from ._pylib import ffi, lib
class MemoryView(object):
def __init__(self, c... | 39.188679 | 158 | 0.619323 |
d630045c83e39ef6740e9fe5e708156fffd81cf5 | 2,152 | py | Python | zencad/geom/near.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/geom/near.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/geom/near.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | from OCC.Core.TopAbs import TopAbs_VERTEX, TopAbs_FACE, TopAbs_WIRE, TopAbs_EDGE, TopAbs_SOLID, TopAbs_SHELL, TopAbs_COMPOUND, TopAbs_COMPSOLID
from OCC.Core.TopExp import TopExp_Explorer
from OCC.Core.BRepExtrema import BRepExtrema_DistShapeShape
from zencad.geom.reflect_helpers import shape_types
from zencad.util im... | 25.317647 | 143 | 0.744424 |
c38f00bb84ddb625844cb51cad9e89e8190a2022 | 259 | py | Python | Curso-Em-Video-Python/2Exercicios/ex107/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex107/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex107/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import moedas
p = float(input('Digite o preço: R$ '))
print(f'A metade de {p} é {moedas.metade(p)}')
print(f'O dobro de {p} é {moedas.dobro(p)}')
print(f'Aumentando 10%, temos {moedas.aumentar(p, 10)}')
print(f'Reduzindo 13%, temos {moedas.reduzir(p, 13)}')
| 32.375 | 56 | 0.664093 |
c3b03c6f9b9ede90c13ed290a0c3058eb8e5a5c6 | 17,499 | py | Python | applications/doc_vqa/Extraction/run_docvqa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/doc_vqa/Extraction/run_docvqa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/doc_vqa/Extraction/run_docvqa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import copy
import json
import random
import logging
import warnings
import argparse
import numpy as np
from collections import OrderedDict, Counter
import paddle
from paddle.static import InputSpec
from paddle.jit import to_static
from paddlenlp.transformers import LayoutXLMModel, LayoutXLMTokeni... | 38.800443 | 119 | 0.577462 |
c3dfc31be31de6946b972fbabc3d3ff764ab5a33 | 114 | py | Python | src/sft/__init__.py | huykingsofm/FileTransmitter | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | 1 | 2020-08-28T19:06:13.000Z | 2020-08-28T19:06:13.000Z | src/sft/__init__.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | src/sft/__init__.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | from sft.listener import SFTListener
from sft.client import SFTClientResponser
from sft.version import __version__ | 38 | 41 | 0.877193 |
616fd607670c1a55163fe00306dc0d930744f38f | 2,182 | py | Python | exercises/de/test_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
len(pattern1) == 2
), "Die Anzahl der Tokens im pattern1 passt nicht zu der tatsächlichen Anzahl an Tokens im String."
assert (
len(pattern2) == 4
), "Die Anzahl der Tokens im pattern2 passt nicht zu der tatsächlichen Anzahl an Tokens im String."
# Pattern 1 vali... | 47.434783 | 103 | 0.648946 |
f62022d030ce905bac3193b95acaa72bcc00eff4 | 96 | py | Python | year_2/prog_base_sem1_cw/app/administer/__init__.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_2/prog_base_sem1_cw/app/administer/__init__.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/administer/__init__.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from flask import Blueprint
administer = Blueprint('administer', __name__)
from . import views | 19.2 | 46 | 0.791667 |
9cbd2e9574870bd9c0e32bf62894ce62241e1533 | 2,415 | py | Python | x2paddle/project_convertor/pytorch/api_mapper/learning_rate_scheduler.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/project_convertor/pytorch/api_mapper/learning_rate_scheduler.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/project_convertor/pytorch/api_mapper/learning_rate_scheduler.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | # 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 appl... | 43.125 | 88 | 0.624017 |
0d19dd1a521cd35cdb12b0228d5036f8fd190137 | 1,315 | py | Python | apps/grolsch/migrations/0001_initial.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/grolsch/migrations/0001_initial.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/grolsch/migrations/0001_initial.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-09 12:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | 35.540541 | 114 | 0.606084 |
371504859b79a6051e65b368a6e558c9167d9d89 | 671 | py | Python | Newsagent/app.py | flikkes/intelligente_agenten | 340ca9b9d98b4525b330292f16444e106dec9d66 | [
"MIT"
] | null | null | null | Newsagent/app.py | flikkes/intelligente_agenten | 340ca9b9d98b4525b330292f16444e106dec9d66 | [
"MIT"
] | null | null | null | Newsagent/app.py | flikkes/intelligente_agenten | 340ca9b9d98b4525b330292f16444e106dec9d66 | [
"MIT"
] | null | null | null | import tkinter
from Agent import crawlCategories, crawlTeasers
from tkinter import *
from tkinter import messagebox
top = tkinter.Tk()
top.geometry("600x1200")
categories = crawlCategories()
for category in categories:
catBtn = Button(top, text=category['name'], command=lambda name = category['url']:crawlCallb... | 23.137931 | 106 | 0.710879 |
2ea059b7dd046729b6b4c6a64b66e51ad23e7ac7 | 4,496 | py | Python | bin/ddns.py | Adamvg/SmartHouse | 740b010260f6f6b38a19e2a75d431446abd54253 | [
"MIT"
] | 136 | 2019-06-27T08:11:47.000Z | 2022-03-11T12:26:53.000Z | bin/ddns.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 5 | 2020-05-30T00:19:22.000Z | 2022-03-25T18:49:47.000Z | bin/ddns.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 63 | 2019-07-15T21:11:58.000Z | 2022-03-13T09:43:24.000Z | #!/usr/bin/env python
# CloudFlare service mode. This enables/disables CF's traffic acceleration.
# Enabled (orange cloud) is 1. Disabled (grey cloud) is 0.
# cf_service_mode: 1
#
# CloudFlare DDNS script.
#
# usage:
# ddns.py domain subdomain cf_service_mode
# ddns.py test.local sub.test.local 1
# See README for d... | 24.434783 | 84 | 0.650133 |
25c3396717e442e834feada12b459aa0e0e65e37 | 2,841 | py | Python | Contrib-Inspur/openbmc/poky/scripts/lib/resulttool/log.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/log.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/log.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # resulttool - Show logs
#
# Copyright (c) 2019 Garmin International
#
# SPDX-License-Identifier: GPL-2.0-only
#
import os
import resulttool.resultutils as resultutils
def show_ptest(result, ptest, logger):
if 'ptestresult.sections' in result:
if ptest in result['ptestresult.sections'] and 'log' in result[... | 39.458333 | 111 | 0.577262 |
6cfe8e1a86ed89eeefe72cde09bae0326124736d | 1,354 | py | Python | books/SystemProgramming/ch3_introduction/xlsx_vmstat.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/SystemProgramming/ch3_introduction/xlsx_vmstat.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/SystemProgramming/ch3_introduction/xlsx_vmstat.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | #!/bin/env python
import openpyxl
from openpyxl.styles import Alignment, Font
from subprocess import Popen, PIPE
def create_header(sheet, start_col: str, end_col: str, word: str) -> None:
sheet.merge_cells(f"{start_col}:{end_col}")
sheet[start_col] = word
sheet[start_col].font = Font(bold=True)
sheet[... | 28.208333 | 77 | 0.610783 |
3917a384e90c328609678fdd981b00ddc2a4a4ba | 1,059 | py | Python | Server/plantNamesWriter.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/plantNamesWriter.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/plantNamesWriter.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | import json
def run(i=int, name=str):
with open('/home/pi/Bewaesserung/plantNames.json') as infile:
dataOld = json.load(infile)
plants = []
for j in range(1,8):
if (j != i):
plant = "plant{}".format(j)
plants.append(dataOld[0][plant])
else:
plant... | 25.214286 | 71 | 0.518414 |
1a9e3aba7de12da5f723918c0f25cb108c6a5a93 | 7,509 | py | Python | sig-contributor-experience/surveys/k8s_survey_analysis/prepare_2018.py | shubham14bajpai/community | f4c7914af3132a765472090b3a03b024e7aa951e | [
"Apache-2.0"
] | 9,963 | 2016-05-03T08:34:46.000Z | 2022-03-31T16:28:24.000Z | sig-contributor-experience/surveys/k8s_survey_analysis/prepare_2018.py | shubham14bajpai/community | f4c7914af3132a765472090b3a03b024e7aa951e | [
"Apache-2.0"
] | 6,434 | 2016-05-11T16:11:43.000Z | 2022-03-31T23:40:33.000Z | sig-contributor-experience/surveys/k8s_survey_analysis/prepare_2018.py | shubham14bajpai/community | f4c7914af3132a765472090b3a03b024e7aa951e | [
"Apache-2.0"
] | 5,067 | 2016-05-04T21:46:00.000Z | 2022-03-31T15:00:56.000Z | import pandas as pd
import numpy as np
convert_2018_to_2019 = {
'Blocker:_Code/Doc_review':'Blocker:_Code/Documentation_review',
'Blocker:_GH_tools&processes_(not_our_customized_tooling)': 'Blocker:_GitHub_tools_and_processes_(not_our_customized_tooling)',
'Blocker:_Finding_a/the_right_SIG': 'Blocker:_Fin... | 63.10084 | 294 | 0.774537 |
203955de492e1fccab6275f08372b7d074708658 | 693 | py | Python | src/unittest/python/erweitert/test_subtraktion.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/erweitert/test_subtraktion.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/erweitert/test_subtraktion.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | """
Created on 27.12.2013
@author: Walter Rafeiner-Magor
"""
import unittest
from bruch.Bruch import *
class TestSubtraktion(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(self):
del self.b, s... | 19.25 | 59 | 0.555556 |
80853c66f9a0574c2261f49f048727bc20555cba | 890 | py | Python | source/pkgsrc/devel/tevent/patches/patch-buildtools_wafsamba_samba__conftests.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/tevent/patches/patch-buildtools_wafsamba_samba__conftests.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/tevent/patches/patch-buildtools_wafsamba_samba__conftests.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-buildtools_wafsamba_samba__conftests.py,v 1.2 2019/03/02 14:06:03 adam Exp $
Ensure defines are strings to avoid assertion failure, some
returned values are unicode.
--- buildtools/wafsamba/samba_conftests.py.orig 2019-02-26 06:44:21.000000000 +0000
+++ buildtools/wafsamba/samba_conftests.py
@@ -97,9 +... | 44.5 | 91 | 0.557303 |
8085e68d41dc33032965fe324895cadd2afc6e59 | 3,513 | py | Python | object_detection/car_detection/traffic.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | object_detection/car_detection/traffic.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | object_detection/car_detection/traffic.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import os
import logging
import logging.handlers
import random
import numpy as np
import skvideo.io
import cv2
import matplotlib.pyplot as plt
import utils
# without this some strange errors happen
cv2.ocl.setUseOpenCL(False)
random.seed(123)
from pipeline import (
PipelineRunner,
ContourDetection,
Visua... | 27.232558 | 79 | 0.578708 |
80a35570a717ef2bd20141160de01213f532f585 | 476 | py | Python | GoogleCTF/2021/web/gpushop/paymeflare/jwk.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | GoogleCTF/2021/web/gpushop/paymeflare/jwk.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | GoogleCTF/2021/web/gpushop/paymeflare/jwk.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import requests
import json
import base64
from Crypto.PublicKey import RSA
res = requests.get('https://www.googleapis.com/oauth2/v3/certs')
keys = json.loads(res.content).get('keys')
for k in keys:
n = k['n']
e = k['e']
n = base64.urlsafe_b64decode(n + '==')
e = base64.urlsafe_b64decode(e + '=='... | 23.8 | 77 | 0.615546 |
80f225f17f30757eb1b27ad167e732ce57b2f321 | 2,099 | py | Python | isj_proj02.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | isj_proj02.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | isj_proj02.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import collections
# for task 1, 2, 3
eskymo = ['do', 'pre', 'du', 'du', 'do', 'za', 'du', 'du']
def first_task():
# number of all distinct strings in the eskymo list
vocabulary_size_eskymo = len(set(eskymo)); # vase reseni
# test
return vocabulary_size_eskymo == 4
def secon... | 26.910256 | 149 | 0.65555 |
03bcd163980cdebdbe24645b43967f602bf872f6 | 7,179 | py | Python | BIQAA.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-03-28T11:50:45.000Z | 2020-12-08T13:36:26.000Z | BIQAA.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-04-20T11:12:59.000Z | 2020-05-11T05:37:36.000Z | BIQAA.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | null | null | null |
# Source: https://notebooks.azure.com/salva/projects/Digital-Image-Processing/html/001%20Anisotropic%20Quality%20Index%20(AQI).ipynb
# Author: Salvador Gabarda
from IProcess import IProcess, EDataType
import numpy as np
#import matplotlib.pyplot as plt
#import matplotlib.image as mpimg
from scipy.fftpack import fft,... | 36.075377 | 132 | 0.731439 |
20a0a9b41f2a10e14befde0960078c8246c03670 | 417 | py | Python | Project Euler Qusetions 61 - 70/Project Euler Question 65.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 61 - 70/Project Euler Question 65.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 61 - 70/Project Euler Question 65.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 65
#Convergents of e
converge_list = [2, 3]
count = 2
multiple = 0
for x in range(3, 101):
count += 1
if count != 3:
x = sum(converge_list[-2:])
converge_list.append(x)
else:
count = 0
multiple += 2
x = (converge_list[-2] + (converge_list[-1] ... | 23.166667 | 64 | 0.585132 |
455c8cfcbdd8ec975352133a4ce4d029b061b8eb | 768 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/89. subtract five days from a given date.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/89. subtract five days from a given date.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/89. subtract five days from a given date.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that chooses random values for the year, month and day within the specified valid ranges
and then subtract five days from this date.
Example:
chosen_date = datetime.date(3683, 12, 16)
Expected output = datetime.date(3683, 12, 11)
"""
import datetime
import random
def subtract_days():
... | 25.6 | 113 | 0.722656 |
45cedf287f5483bbbe4b152dbc4bcea5c788e3b4 | 839 | py | Python | components/amp-utility/python/ujson.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/ujson.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/ujson.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # * coding: UTF8 *
"""
该模块实现相应 `CPython` 模块的子集,如下所示。
该模块允许Python对象和JSON数据格式之间的转换。
函数
------------------------------
"""
def dumps(obj):
"""
将字典类型的数据obj转换为str
json转str::
import ujson
data = {
'id': 'EventTest' ,
'params': {
'test_event' : 100
}
}... | 12.907692 | 69 | 0.475566 |
aff49b5bd7a8c163b7008d6866a8dccba1186eeb | 282 | py | Python | basics/error_handling.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/error_handling.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/error_handling.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | n = int(input())
for i in range(0,n):
try:
userinput = input().split()
a = int(userinput[0])
b = int(userinput[1])
print(a//b)
except ZeroDivisionError as e:
print("Error Code: "+str(e))
except ValueError as e:
print("Error Code: "+str(e))
| 23.5 | 34 | 0.567376 |
b3078e7874da0f63905a2cae34f6b37457f0635e | 753 | py | Python | server/apps/user_operation/adminx.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/user_operation/adminx.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/user_operation/adminx.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-22 09:17
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : adminx.py
# @Software: PyCharm
import xadmin
from .models import UserFavorMovie, UserFavorActor, UserFavorGenre
class UserFavorMovieAdmin(object):
list_display ... | 24.290323 | 66 | 0.713147 |
642653f0ffc0e276d06facb5da822a3fc32395af | 3,088 | py | Python | Packs/Confluera/Integrations/Confluera/Confluera_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Confluera/Integrations/Confluera/Confluera_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Confluera/Integrations/Confluera/Confluera_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | ''' IMPORTS '''
from CommonServerPython import *
from CommonServerUserPython import *
import json
import io
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def util_mock_login(requests_mock):
mock_response = util_load_json('test_data/login.... | 28.072727 | 72 | 0.68329 |
ff9d5c5858181de9087e825025dd51a3774fccab | 418 | py | Python | python/TensorFlow/main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/TensorFlow/main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/TensorFlow/main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/8/18 2:11
# @Author:TimVan
# @File:main.py
# @Software:PyCharm
import os
import tensorflow as tf
# from tensorflow.python.client import device_lib
# os.environ["TF_CPP_MIN_LOG_LEVEL"] = "99"
if __name__ == "__main__":
print(tf.__version__)
# sess = tf.Session(config=tf.C... | 20.9 | 74 | 0.691388 |
924e121017036ade26bffb73688445815d28313e | 6,303 | py | Python | packages/watchmen-meta/src/watchmen_meta/admin/pipeline_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/admin/pipeline_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/admin/pipeline_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Optional
from watchmen_meta.common import TupleNotFoundException, TupleService, TupleShaper
from watchmen_model.admin import Pipeline, PipelineStage
from watchmen_model.common import ParameterJoint, PipelineId, TenantId, TopicId
from watchmen_storage import Column... | 35.610169 | 110 | 0.768206 |
a62dddd75d8374dfcd020802171f0d9f4fe7d555 | 537 | py | Python | scripts/layerjson_writer.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | scripts/layerjson_writer.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | scripts/layerjson_writer.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
import cStringIO
from forge.configs import tmsConfig
from forge.lib.helpers import gzipFileObject
from forge.lib.boto_conn import getBucket, writeToS3
bucket = getBucket()
layerJSONPath = 'forge/data/json-conf/layer.json'
bucketBasePath = tmsConfig.get('General', 'bucketpath')
with open(layer... | 29.833333 | 55 | 0.73743 |
a63d166d1214317e533ad939e67f8291bbb9d79c | 78 | py | Python | workSpace/wifi/status.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | 5 | 2018-07-24T17:41:15.000Z | 2021-02-07T13:59:42.000Z | workSpace/wifi/status.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | null | null | null | workSpace/wifi/status.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | 5 | 2018-07-24T17:41:03.000Z | 2021-10-01T07:06:16.000Z | import network
sta_if = network.WLAN(network.STA_IF)
print(sta_if.ifconfig())
| 19.5 | 37 | 0.794872 |
5bdced99b48b60d2bad6a5509bf635b135bc3e43 | 9,326 | py | Python | 20-hs-redez-sem/groups/03-doubleRatchet/src/helper_functions/helpers.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/03-doubleRatchet/src/helper_functions/helpers.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/03-doubleRatchet/src/helper_functions/helpers.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey, X25519PublicKey
from cryptography.hazmat.backends import default_backend
import cbor2
from logStore.funcs.EventCreatio... | 38.53719 | 103 | 0.656766 |
cac3226a66978adf8c7e944889716e6924fbdfaf | 1,581 | py | Python | skimind/kernel/pdfManag/config.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/pdfManag/config.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/pdfManag/config.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #---------------------------------------------------------------------------
# ce module contient les configurations
#---------------------------------------------------------------------------
# global config
from . import skiconfig
# system tools
import os
#-------------------------------------------------------... | 35.931818 | 76 | 0.304238 |
cadc9c5b3d61ada1cbf31dbb0b4f207a5623b7c2 | 681 | py | Python | euler21.py | akashsharma99/2ndSemPractise | ba854e8ef5089ad627cee6f7c8828b711437affa | [
"MIT"
] | null | null | null | euler21.py | akashsharma99/2ndSemPractise | ba854e8ef5089ad627cee6f7c8828b711437affa | [
"MIT"
] | null | null | null | euler21.py | akashsharma99/2ndSemPractise | ba854e8ef5089ad627cee6f7c8828b711437affa | [
"MIT"
] | null | null | null | def get_sum(x):
s=0
for i in range(0,(x//2)+1):
if(i==0):s=s+0
elif(x%i==0):
s=s+i
return s
t = int(input())
for a0 in range(t):
n = int(input())
arr=[False]*(n+1)
arr[0]=True
s=0
for index in range(n+1):
if(arr[index]==False):
s1=get_sum(i... | 22.7 | 38 | 0.39207 |
1b1b12e4f64dd4e761c77f5055dd9af3379ede0f | 781 | py | Python | programm/speech_output.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/speech_output.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/speech_output.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | """
module for the speech output
@autor: wimmer, simon-justus
"""
from gtts import gTTS
import os
from threading import Thread
import subprocess
import pyttsx
class Speaker:
def __init__(self):
pass
def say_in_thread(self, msg):
say_thread = Thread(target=self.say, args=(msg,))
sa... | 24.40625 | 104 | 0.629962 |
1bb0c3f7ee5ac40f1566f8d7c51e772a5ad23e4c | 947 | py | Python | exercises/es/test_03_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_03_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_03_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Span.has_extension(
"wikipedia_url"
), "¿Registraste la extensión en el span?"
ext = Span.get_extension("wikipedia_url")
assert ext[2] is not None, "¿Añadiste el getter correctamente?"
assert (
"getter=get_wikipedia_url" in __solution__
), "¿Asignaste get_wikip... | 39.458333 | 89 | 0.665259 |
ca371a0fd350cab3be7f6564d4344ce269cadd40 | 209 | py | Python | python/python_backup/PRAC_PYTHON/ab25.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab25.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab25.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # input a name and print abbriviation
s=input("enter string:")
w=""
for i in range(0,len(s),1):
if s[i]==' ':
print w[0],".",
w=""
else:
w=w+s[i]
print w
| 19 | 38 | 0.435407 |
04a046ec38fe225f419a317bef28f76d3c5c6915 | 7,632 | py | Python | Classes/Play_Game.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Play_Game.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Play_Game.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | from Classes.Player import Player
from Classes.Board import Board
from Classes.Client import Client
from PyQt5.QtCore import pyqtSlot
from PyQt5 import QtCore
from threading import Thread
import ast
import pygame
class PlayGame(QtCore.QObject):
game_over_for_player = QtCore.pyqtSignal(bool, str)
player_win = ... | 34.849315 | 106 | 0.588574 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.