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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25b6f05bb17d8abdf2a225cd01aa8937325c7602 | 502 | pyde | Python | sketches/randrect/randrect.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/randrect/randrect.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/randrect/randrect.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from random import randint, choice
a = 220
colors = [color(155, 46, 105, a), color(217, 55, 80, a), color(226, 114, 79, a),
color(243, 220, 123, a), color(78, 147, 151, a)]
def setup():
size(940, 315)
rectMode(CENTER)
strokeWeight(5)
# noStroke()
background(255)
def draw():
for _ in... | 25.1 | 80 | 0.573705 |
d32115e5f8b3ae63fa807e51dac447a4e0d3d470 | 5,052 | py | Python | examples/model_interpretation/evaluation/plausibility/eval_similarity.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/model_interpretation/evaluation/plausibility/eval_similarity.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/model_interpretation/evaluation/plausibility/eval_similarity.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 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... | 33.68 | 91 | 0.651029 |
6cb77aba49b657121974ad0f2c0d01ee9600b161 | 7,881 | py | Python | Tests/scripts/utils/tests/content_packs_util_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/scripts/utils/tests/content_packs_util_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/scripts/utils/tests/content_packs_util_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import os
import pytest
from Tests.scripts.collect_tests_and_content_packs import get_packs_from_landing_page
from Tests.scripts.utils.content_packs_util import (is_pack_xsoar_supported,
is_pack_deprecated,
... | 40.415385 | 111 | 0.644461 |
46dbce5151ec79c613026a4159f83d092887f3d2 | 8,787 | py | Python | Packs/PaloAltoNetworks_IoT/Scripts/iot_get_raci/iot_get_raci_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_get_raci/iot_get_raci_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_get_raci/iot_get_raci_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import iot_get_raci
from iot_get_raci import get_raci
_CONFIG = {
"devices": [
{
"device_id": "Audio Streaming|Profusion Media Player.*",
"owner": "IT_AUDIO_VIDEO"
},
{
"device_id": "Camera|Avigilon Camera.*",
"owner": "WPR_SECURITY"
... | 26.308383 | 107 | 0.524297 |
b38bb27603921b91b15f1a79af5657243caed560 | 11,467 | py | Python | ScanQLi-master/function.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ScanQLi-master/function.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ScanQLi-master/function.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import requests
from bs4 import BeautifulSoup
import config
import time
import sys
try:
import urlparse # Python2
except ImportError:
import urllib.parse as urlparse # Python3
import progressbar
from termcolor import colored
import os
# Suppress insecure warning
import urllib3
urllib3.disable_warnings(urllib3.... | 30.49734 | 158 | 0.580971 |
373a6bc5ea65cda41b3ddd5826a5700f641107fc | 1,168 | py | Python | project/forms/planing.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/forms/planing.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/forms/planing.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import HiddenField, SelectField, SubmitField
from wtforms.validators import Optional
from project.forms.common import distance_choices, weekday_choices
from project.forms.widgets import CustomDateField, MultiCheckboxField
class Plani... | 31.567568 | 78 | 0.704623 |
80947832f049d57f030c5b434c41f341b70e0f09 | 2,224 | py | Python | tests/test_auth_core.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | tests/test_auth_core.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | tests/test_auth_core.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import json
import pytest
from jose import jwt, exceptions
from benwaonline.exceptions import BenwaOnlineError
from benwaonline.auth import core
post_headers = {'Accept': 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json'}
def get_pem(fname)... | 26.47619 | 75 | 0.665468 |
455f6d05f2fa4948b9b73806dac72b2f00cff3fc | 1,296 | py | Python | demo/bidirectional_lstm_train.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | demo/bidirectional_lstm_train.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | demo/bidirectional_lstm_train.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | from keras_malicious_url_detector.library.bidirectional_lstm import BidirectionalLstmEmbedPredictor
from keras_malicious_url_detector.library.utility.url_data_loader import load_url_data
import numpy as np
from keras_malicious_url_detector.library.utility.text_model_extractor import extract_text_model
from keras_malici... | 35.027027 | 120 | 0.732253 |
44502f61a642282385335439632b04b20870cbee | 2,973 | py | Python | Packs/ExpanseV2/Scripts/MatchIPinCIDRIndicators/MatchIPinCIDRIndicators_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/MatchIPinCIDRIndicators/MatchIPinCIDRIndicators_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/MatchIPinCIDRIndicators/MatchIPinCIDRIndicators_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from MatchIPinCIDRIndicators import match_ip_in_cidr_indicators
import demistomock as demisto # noqa # pylint: disable=unused-wildcard-import
from typing import List, Dict, Any
import json
import io
MOCK_IP = '44.224.1.1'
MOCK_QUERY = (
'type:CIDR and tags:(AWS OR GCP OR Azure) and ( value:"44.224.1.1/32" or valu... | 36.703704 | 128 | 0.604776 |
92202717a29b4c7c829b3941816d376646e1610e | 30 | py | Python | plugins/sort_categories/__init__.py | nerdydrew/Drews-Sheet-Music | d34c82fde1099c3bbdaf55a3ed68c6c4b4b1001c | [
"MIT"
] | 2 | 2019-09-14T08:46:30.000Z | 2022-01-13T18:47:28.000Z | plugins/sort_categories/__init__.py | nerdydrew/Drews-Sheet-Music | d34c82fde1099c3bbdaf55a3ed68c6c4b4b1001c | [
"MIT"
] | null | null | null | plugins/sort_categories/__init__.py | nerdydrew/Drews-Sheet-Music | d34c82fde1099c3bbdaf55a3ed68c6c4b4b1001c | [
"MIT"
] | null | null | null | from .sort_categories import * | 30 | 30 | 0.833333 |
2bab9eaf2543b5c63717409140e15190cf1dfdfd | 14,767 | py | Python | src/bias_mitigator/loss_related_operations.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/bias_mitigator/loss_related_operations.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/bias_mitigator/loss_related_operations.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | import numpy as np
import torch
import src.constants as constants
# Gets the loss of the target_tokens using the triggers as the context.
def get_loss(
language_model,
batch_size,
trigger_tokens,
demo_tokens,
target_tensor,
tokenizer,
device=torch.device("cuda"),
salience_token_items... | 41.951705 | 125 | 0.622266 |
921b28354f2c6afb1ed5cc52125f4d1d91263fb7 | 2,894 | py | Python | Packs/Zabbix/Integrations/Zabbix/Zabbix_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Zabbix/Integrations/Zabbix/Zabbix_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Zabbix/Integrations/Zabbix/Zabbix_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import Zabbix
from pyzabbix import ZabbixAPI
class TestZabbix():
def test_get_host(self, mocker):
mocker.patch('demistomock.params', return_value={
'url': 'http://localhost',
'credentials': {
'identifier': 'user',
'password': 'password'
... | 27.046729 | 82 | 0.546303 |
a63bbd1b9f65c5c184ba478c4819c003b4970520 | 364 | py | Python | PINp/2015/DENISENKO_A_N/task_2_27.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/DENISENKO_A_N/task_2_27.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/DENISENKO_A_N/task_2_27.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 27.
# Напишите программу, которая будет выводить на экран наиболее понравившееся
#вам высказывание, автором которого является Овидий. Не забудьте о том, что
#автор должен быть упомянут на отдельной строке.
# Denisenko A. N.
# 02.06.2016
print("Все изменяется, ничто не исчезает")
print("\t\t\tОвид... | 30.333333 | 76 | 0.758242 |
5ba5acc7caa8eddb408b7b4ce137b31f307d7a35 | 598 | py | Python | test/__init__.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | test/__init__.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | test/__init__.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | # from flask import Flask
# from flask_testing import TestCase
#
# from app import create_app, db
#
#
# class BaseTest(TestCase):
# SQLALCHEMY_DATABASE_URI = "sqlite://"
# TESTING = True
#
# def create_app(self):
# return create_app()
#
# def setUp(self):
# db.create_all()
#
# def te... | 19.933333 | 109 | 0.618729 |
75454dd3ff377a3b6c81ba82a8ba9eb47df86168 | 160 | py | Python | Road_safety/hackathon/admin.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 3 | 2019-07-05T16:52:34.000Z | 2021-07-09T09:01:03.000Z | Road_safety/hackathon/admin.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 5 | 2020-08-18T21:45:56.000Z | 2021-04-13T14:36:47.000Z | Road_safety/hackathon/admin.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 2 | 2019-07-02T21:36:40.000Z | 2019-08-23T16:17:11.000Z | from django.contrib import admin
from .models import Police, Driver
# Register your models here.
admin.site.register(Police)
admin.site.register(Driver) | 22.857143 | 35 | 0.775 |
34202df6c345f73ad2caf482df19792de17a907f | 1,034 | py | Python | docs/API/Users_Guide/scripts/BAM_Slice_Multiple.py | ZhenyuZ/gdc-docs | f024d5d4cd86dfa2c9e7d63850eee94d975b7948 | [
"Apache-2.0"
] | 67 | 2016-06-09T14:11:51.000Z | 2022-03-16T07:54:44.000Z | docs/API/Users_Guide/scripts/BAM_Slice_Multiple.py | ZhenyuZ/gdc-docs | f024d5d4cd86dfa2c9e7d63850eee94d975b7948 | [
"Apache-2.0"
] | 19 | 2016-06-21T15:51:11.000Z | 2021-06-07T09:22:20.000Z | docs/API/Users_Guide/scripts/BAM_Slice_Multiple.py | ZhenyuZ/gdc-docs | f024d5d4cd86dfa2c9e7d63850eee94d975b7948 | [
"Apache-2.0"
] | 32 | 2016-07-15T01:24:19.000Z | 2019-03-25T10:42:28.000Z | import requests
import json
'''
This script will not work until $TOKEN_FILE_PATH
is replaced with an actual path.
'''
token_file = "$TOKEN_FILE_PATH"
file_ids = [
"11443f3c-9b8b-4e47-b5b7-529468fec098",
"1f103620-bb34-46f1-b565-94f0027e396d",
"ca549554-a244-4209-9086-92add7bb7109"
]
for file_id in ... | 27.210526 | 77 | 0.575435 |
343add2d172cabf24a579ec40272fa7eff7afd8e | 452 | py | Python | pacman-arch/test/pacman/tests/symlink020.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/symlink020.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/symlink020.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "symlink -> dir replacment"
lp1 = pmpkg("pkg1")
lp1.files = ["usr/lib/foo",
"lib -> usr/lib/"]
self.addpkg2db("local", lp1)
lp1 = pmpkg("pkg2")
lp1.files = ["usr/lib/bar"]
self.addpkg2db("local", lp1)
sp = pmpkg("pkg1", "1.0-2")
sp.files = ["lib/bar"]
self.addpkg2db("sync", sp)
self.... | 21.52381 | 46 | 0.637168 |
cabd870e999082648fb6b14088a6d9f634020fad | 656 | py | Python | lego/calculus/nodes/ln.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/ln.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/ln.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | """natural logarithm node"""
import math
from . import divide, node, number
class Ln(node.Node):
"""natural logarithm node"""
def __init__(self, arg):
self.arg = arg
def copy(self):
return Ln(self.arg.copy())
def evaluate(self, value):
return math.log(self.arg.evaluate(val... | 19.878788 | 55 | 0.597561 |
1b3e69b93142bdf68b618f4ea3b3f939855703de | 474 | py | Python | Python/Exercícios_Python/017_catetos_e_hipotenusa.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/017_catetos_e_hipotenusa.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/017_catetos_e_hipotenusa.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""017 - Catetos e Hipotenusa
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1kBk5KvC85aql3kAKRT-r44C0cCa5KwjO
"""
from math import sqrt
print('Calculando a Hipotenusa')
co = float(input('Insira o valor do cateto oposto: '))
ca... | 29.625 | 77 | 0.704641 |
04848c8718b909c85ee11a30dd8d18487f12d001 | 807 | py | Python | data-pipeline/src/data_pipeline/pipelines/gnomad_v3_short_tandem_repeats.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | data-pipeline/src/data_pipeline/pipelines/gnomad_v3_short_tandem_repeats.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | data-pipeline/src/data_pipeline/pipelines/gnomad_v3_short_tandem_repeats.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 12 | 2018-02-22T09:45:43.000Z | 2020-02-27T21:37:52.000Z | from data_pipeline.pipeline import Pipeline, run_pipeline
from data_pipeline.datasets.gnomad_v3.gnomad_v3_short_tandem_repeats import prepare_gnomad_v3_short_tandem_repeats
pipeline = Pipeline()
pipeline.add_task(
"prepare_short_tandem_repeats",
prepare_gnomad_v3_short_tandem_repeats,
"/gnomad_v3/gnomad... | 29.888889 | 114 | 0.612144 |
6d2dfea341558f8ac93a1816c1bfe95c7672c67c | 595 | py | Python | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetVulnerabilityInfo/ForescoutEyeInspectButtonGetVulnerabilityInfo.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetVulnerabilityInfo/ForescoutEyeInspectButtonGetVulnerabilityInfo.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetVulnerabilityInfo/ForescoutEyeInspectButtonGetVulnerabilityInfo.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from CommonServerPython import *
def get_cve():
cve_id = demisto.args().get('cve_id')
if not cve_id:
return_error('Missing CVE ID.')
return demisto.executeCommand('forescout-ei-vulnerability-info-get', {'cve_id': cve_id})
def main():
try:
return_results... | 25.869565 | 92 | 0.690756 |
949144fac1674c027ace77216a512217cca4301b | 326 | py | Python | exercises/ja/test_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/test_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
import spacy.tokens
import spacy.lang.de
assert isinstance(nlp, spacy.lang.de.German), "nlpオブジェクトはGermanクラスのインスタンスでなければなりません"
assert isinstance(doc, spacy.tokens.Doc), "テキストをnlpオブジェクトで処理してdocを作成しましたか?"
assert "print(doc.text)" in __solution__, "doc.textをプリントしましたか?"
__msg__.good("正解... | 32.6 | 88 | 0.736196 |
949b59cd96d66ad74330eede0d8196d53b09eb3b | 81 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 60/60.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 60/60.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 60/60.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Create a program that prints Hello repeatedly.
while 1 < 2:
print("Hello")
| 16.2 | 47 | 0.691358 |
787cf4bdbd7dda47d950502dbfc8a068f9f42449 | 1,047 | py | Python | ProjectEuler_plus/euler_062.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_062.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_062.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
N, K = list(map(int, input().strip().split()))
d = {}
d_num = defaultdict(int)
cubes = []
for i in range(1, N + 1):
cube = i ** 3
cubes.append(cube)
check_num = ''.join(sorted(list(str(cube))))
d[check_num] = d.get(check_num, 0) + 1
if d... | 22.276596 | 57 | 0.56256 |
019e8fce57aaf2f2406ce949ee56038005fe41e3 | 1,245 | py | Python | 2016/day04_security_through_obscurity/python/src/part1.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day04_security_through_obscurity/python/src/part1.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day04_security_through_obscurity/python/src/part1.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Docstring."""
from collections import Counter
from functools import reduce
from common import (
get_input,
)
class RoomAnalyzer:
"""."""
def __init__(self, input_list=[]):
"""."""
self.input_list = input_list
def process_room_string(self, room_string):
... | 27.666667 | 110 | 0.616064 |
170ecaabb2f3cdca421aede2c77073324ed36a8d | 935 | py | Python | scrapers/scrape_nw.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_nw.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_nw.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import scrape_common as sc
xls_url = 'http://www.nw.ch/coronastatistik'
xls = sc.xlsdownload(xls_url, silent=True)
rows = sc.parse_xls(xls, header_row=3)
is_first = True
for row in rows:
dd = sc.DayData(canton='NW', url=xls_url)
dd.datetime = row['A'].date().isof... | 27.5 | 93 | 0.653476 |
c176c5e1ab6f03c3042b7b5224fa2ce74abfc7a5 | 1,554 | py | Python | transonic/backends/pythran.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/backends/pythran.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/backends/pythran.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """Pythran Backend
==================
Internal API
------------
.. autoclass:: PythranBackend
:members:
:private-members:
"""
from .base import BackendAOT
class PythranBackend(BackendAOT):
"""Main class for the Pythran backend"""
backend_name = "pythran"
suffix_header = ".pythran"
def chec... | 29.320755 | 80 | 0.635135 |
c1f2312221128b2dd1420fa7e7becc0e5ee9fe99 | 10,484 | py | Python | 2018/finals/pwn-gdb-as-a-service/web_challenge/challenge/gdbproc.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/finals/pwn-gdb-as-a-service/web_challenge/challenge/gdbproc.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/finals/pwn-gdb-as-a-service/web_challenge/challenge/gdbproc.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/env python3
#
# 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 ... | 28.881543 | 206 | 0.621995 |
de00155de323560cf4f540eb254059b6f51c1409 | 1,299 | py | Python | p01/cifastapi/producer.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/cifastapi/producer.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/cifastapi/producer.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0111,C0103,R0205
import functools
import logging
import time
import pika
import sys
import config
LOGGER = logging.getLogger(__name__)
class MyProducter(object):
def __init__(self, host=None, exchange="logs" ):
if not host:
h... | 21.65 | 88 | 0.625096 |
e704116d05c76269fd6eada6b7272213c3fef6c5 | 341 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_2/update_project_milestones.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v4_2/update_project_milestones.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/update_project_milestones.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
for project in frappe.db.sql_list("select name from tabProject"):
frappe.reload_doc("projects", "doctype", "project")
p = frappe.get_doc("Project", project)
p.update_milestones_completed()
p.db_set("percent_milestones_completed", p.percent_m... | 34.1 | 74 | 0.785924 |
416362df00ed60bcaf03e708559c2dfc8ab29184 | 16,952 | py | Python | riqc/riqc.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | riqc/riqc.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | riqc/riqc.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | import scipy.stats as spst
import numpy as np
import sys
import os
import glob
import fnmatch
import pickle
from optparse import OptionParser, OptionGroup
import logging
from .libs.annotation import *
from .libs.viz import *
from .libs.bam import *
from .libs.bam_sparse import *
from .libs.kmer import *
from .scaling... | 53.815873 | 254 | 0.605651 |
ec3d803eb2b3752d4c20ed662ab8735f331a5fc0 | 614 | py | Python | Curso-Em-Video-Python/2Exercicios/ex109/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex109/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex109/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | def metade(valor=0, formato=False):
resp = valor / 2
return resp if formato is False else moeda(resp)
def dobro(valor=0, formato=False):
resp = valor * 2
return resp if formato is False else moeda(resp)
def aumentar(valor=0, porcento=0, formato=False):
aumento = valor + (valor * porcento / 100)
... | 27.909091 | 58 | 0.67101 |
6bcfeb0b1922c1ee7e3ad68ea024d6c5c3337fd3 | 400 | py | Python | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/common/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/common/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/common/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .exception import PipelineKernelException
from .settings import ask_async_handle_monitor_log, ask_decrypt_factor_value, ask_parallel_actions_count, \
ask_parallel_actions_dask_temp_dir, ask_parallel_actions_dask_use_process, ask_parallel_actions_in_loop_unit, \
ask_pipeline_update_retry, ask_pipeline_update_retr... | 66.666667 | 112 | 0.9075 |
d4196c1a6bd428bb9bde127ecabecea95c319322 | 1,478 | py | Python | site_init.py | hephaisto/scons-tools | 4fc446f80a751175f803a820b2d5670cfcfa0c1d | [
"MIT"
] | 1 | 2016-09-20T20:20:00.000Z | 2016-09-20T20:20:00.000Z | host/site_scons/site_init.py | hephaisto/serial-can-dump | a3aa3e6e166327ad86b491ca8d89fbcc1090f597 | [
"MIT"
] | 9 | 2016-02-15T22:33:31.000Z | 2017-06-18T20:00:30.000Z | host/site_scons/site_init.py | hephaisto/serial-can-dump | a3aa3e6e166327ad86b491ca8d89fbcc1090f597 | [
"MIT"
] | null | null | null | import re
import subprocess
def git_tag_version(env):
pipe=subprocess.Popen(["git","describe"],stdout=subprocess.PIPE)
stdout,stderr=pipe.communicate()
version_string=stdout.split("\n")[0]
version_regex=re.compile(r"(\d+)\.(\d+).(\d+)(?:-(\d+)(?:-(\w+)))?")
version_match=version_regex.match(version_string)
# ver... | 35.190476 | 102 | 0.717862 |
d4736d23b3a2f73dc7a7b7d8f4a23a6b98363420 | 830 | py | Python | apps/utils/context_processors.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/utils/context_processors.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/utils/context_processors.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | def defer_html(request):
def get_defer_html():
if not hasattr(request, 'defer_html'):
request.defer_html = []
return request.defer_html
def append_defer_html(html):
if not hasattr(request, 'defer_html'):
request.defer_html = []
request.defer_html.append(h... | 29.642857 | 47 | 0.621687 |
5cf5ebc701b74363a630451207a4f8ba51d59449 | 2,606 | py | Python | modeling/head/deeplab_danet.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | modeling/head/deeplab_danet.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | modeling/head/deeplab_danet.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
from modeling.model_utils.aspp import build_aspp
from modeling.model_utils.decoder import build_decoder
<<<<<<< HEAD
from modeling.backbone import build_backbone
from modeling.model_u... | 37.768116 | 111 | 0.660783 |
d8469dfc7812cb03b72e591d71126a8d14aecd7e | 2,546 | py | Python | python/en/archive/practice_python/practice_python-exercise03-List Less Than Ten.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/practice_python/practice_python-exercise03-List Less Than Ten.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/practice_python/practice_python-exercise03-List Less Than Ten.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
2018-10-23 (Tue)
PRACTICE PYTHON, https://www.practicepython.org/
Exercise 3. List Less Than Ten
https://www.practicepython.org/exercise/2014/02/15/03-list-less-than-ten.html
Take a list, say for example this one:
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
and write a progr... | 28.288889 | 94 | 0.63315 |
2b3942e9ec779fed583ac1c41fb9110ff8ff8bd5 | 3,129 | py | Python | tests/test_library.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 12 | 2021-02-26T08:19:00.000Z | 2022-01-26T14:00:16.000Z | tests/test_library.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | null | null | null | tests/test_library.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 3 | 2021-03-19T13:51:56.000Z | 2021-08-25T05:25:52.000Z | import modelindex
import pytest
from modelindex import Metadata
from modelindex.models.Collection import Collection
from modelindex.models.CollectionList import CollectionList
from modelindex.models.Model import Model
from modelindex.models.ModelList import ModelList
from modelindex.models.Result import Result
from mod... | 49.666667 | 181 | 0.740812 |
51f0640656bb1004bd4ea810c24ccd28e9fe0e9b | 1,778 | py | Python | logic/round.py | AndreiD049/ProgressBar | 5fcc5ab39e55e3522c3d3b3c0eec8d1a91ac6174 | [
"MIT"
] | null | null | null | logic/round.py | AndreiD049/ProgressBar | 5fcc5ab39e55e3522c3d3b3c0eec8d1a91ac6174 | [
"MIT"
] | null | null | null | logic/round.py | AndreiD049/ProgressBar | 5fcc5ab39e55e3522c3d3b3c0eec8d1a91ac6174 | [
"MIT"
] | null | null | null | import os
import platform
import shelve
from logic.utils import clear_folder
from collections import OrderedDict
class Round:
def __init__(self, name, teams=[], max_points=100):
self.round_name = name
self.max_points = max_points
self.teams = OrderedDict()
for team in teams:
... | 29.147541 | 95 | 0.556243 |
a40ca7df86b0beb2596f9da8ad1be8200efb59ae | 4,584 | py | Python | src/pfun/state.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | src/pfun/state.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | src/pfun/state.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | from __future__ import annotations
from asyncio import Lock
from typing import Callable, Generic, NoReturn, Optional, TypeVar, cast
from .effect import Success, Try, add_method_repr, from_callable
from .either import Either, Left, Right
from .immutable import Immutable
A = TypeVar('A')
E = TypeVar('E')
class State... | 29.766234 | 78 | 0.536867 |
cfad27e589fee14667f230c1a5f7dd607ad673cf | 1,674 | py | Python | backend/utils/handle_json.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 10 | 2020-03-20T19:14:43.000Z | 2020-10-29T21:31:40.000Z | backend/utils/handle_json.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 41 | 2020-03-20T20:27:55.000Z | 2020-03-24T21:49:37.000Z | backend/utils/handle_json.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 1 | 2020-03-21T09:31:51.000Z | 2020-03-21T09:31:51.000Z | from flask import abort
from utils import validate_json
def get_places_json_data(request):
"""
Returns the json data from a place request.
If either no json is present or the json is malformed a 400 if thrown.
"""
validate_json.has_json_header(request)
data = request.json
if not validate_js... | 27 | 74 | 0.703704 |
cfe78b15815790a48d50a4246a6d5ec5956a7a84 | 1,145 | py | Python | src/test/tests/simulation/aresamr.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/simulation/aresamr.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/simulation/aresamr.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: aresamr.py
#
# Tests: libsim - connecting to simulation and retrieving data from it.
# mesh - 2D aresamr mesh
#
# Programmer: Kathleen Biagas
# Date: June 17, 2014
#
# Modif... | 23.854167 | 78 | 0.573799 |
cff2cb2a269b8f52376cbadb99e8bbba1f718afc | 2,410 | py | Python | profiling/profile_syntaxtree.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | profiling/profile_syntaxtree.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | profiling/profile_syntaxtree.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""test_syntaxtree.py - profiling of syntaxtree-module of DHParser
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2017 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License... | 30.125 | 76 | 0.709544 |
7a76add1f735324183223ec1ac98fc5529a50122 | 342 | py | Python | fbtor/FBoolectorTypes.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/FBoolectorTypes.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/FBoolectorTypes.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | import enum
#Some constants for indexing the FPTypes
EXP = 0
MAN = 1
WIDTH = 2
#enum type for floating point type
class FPType(enum.Enum):
single = [8,23,32]
double = [11,52,64]
extended = [15,64,80]
#enum type for rounding mode
class RMode(enum.Enum):
to_zero = 0
to_neg_inf = -1
to_pos_inf =... | 17.1 | 40 | 0.654971 |
8f95c2fd2c1c74b074d5721c8b1cdf228fc36ab9 | 334 | py | Python | DataStructures/LinkedList/MergeSorted.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/LinkedList/MergeSorted.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/LinkedList/MergeSorted.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
#smart
def MergeLists(headA, headB):
if headA == None:
return headB
if headB == None:
return headA
if headA.data < headB.data:
headA.next = MergeLists(headA.next, headB)
return headA
else:
headB.next = MergeLists(headA, headB.next)
retu... | 19.647059 | 50 | 0.580838 |
890ddc6fc0d0cf20d63cf5c629fbcb9164f5e76c | 454 | py | Python | Curso-Em-Video-Python/2Exercicios/028_Jogo_da_Adivinhacao_v.1.0.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/028_Jogo_da_Adivinhacao_v.1.0.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/028_Jogo_da_Adivinhacao_v.1.0.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from random import randint
soma = 0
resultado = 1
while resultado != 0:
print('---' * 13)
print('Vou escolher um numero entre 0 e 5 aleatoriamente')
sorteio = randint(1, 5)
usuario = int(input('tente a sorte escolha um numero 1 a 5: '))
print('Processando...')
soma += 1
if sorteio == usuario... | 30.266667 | 67 | 0.623348 |
7103e5884bfc7057b81a9c5c812cbff909807ffe | 1,462 | py | Python | python/advanced_sw/wallpaper.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/wallpaper.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/wallpaper.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | ## https://www.pexels.com/photo/68147
##url_s = " https://www.pexels.com/photo/753626"
url_s = "https://www.pexels.com/photo/33109"
## https://www.pexels.com/photo/87452/
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
import requests
# Ignore SSL certificate error... | 23.206349 | 86 | 0.716142 |
f11a41722e4ed4266552c779995a7c8e50649525 | 828 | py | Python | top/clearlight/base/liaoxuefeng/object_oriented_advanced_program/Multiple_inheritance.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/object_oriented_advanced_program/Multiple_inheritance.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/object_oriented_advanced_program/Multiple_inheritance.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # 多重继承
'''
通过多重继承, 一个子类就可以同时获得多个父类的功能
'''
class Animal(object):
pass
# 大类:
class Mammal(Animal):
pass
class Bird(Animal):
pass
# 各种动物:
class Dog(Mammal):
pass
class Bat(Mammal):
pass
class Parrot(Bird):
pass
class Ostrich(Bird):
pass
class Runnable(object):
def run(self)... | 10.753247 | 51 | 0.646135 |
24f8e84868bcc350abc3c6426e2300545137117b | 22,708 | py | Python | mxst/pipeline_03_exercising.py | mnemocron/FHNW | e43c298cb9c8f617fa19b77dd6630a342c78bda7 | [
"Unlicense"
] | 1 | 2020-10-07T07:28:33.000Z | 2020-10-07T07:28:33.000Z | mxst/pipeline_03_exercising.py | mnemocron/FHNW | e43c298cb9c8f617fa19b77dd6630a342c78bda7 | [
"Unlicense"
] | null | null | null | mxst/pipeline_03_exercising.py | mnemocron/FHNW | e43c298cb9c8f617fa19b77dd6630a342c78bda7 | [
"Unlicense"
] | 1 | 2021-01-17T16:38:58.000Z | 2021-01-17T16:38:58.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 08:49:49 2020
@author: simon
"""
#%%
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
# Quantizer
# quant(0.111, [-0.125, 0.125]) ==> 1 out of range[0, 1, 2]
# returns value in range [0 to n+1] where n = len(references)
def quant(... | 30.979536 | 102 | 0.616303 |
8ed45807088b9645006496043c76e5bd7f082e85 | 1,323 | py | Python | Theories/DataStructures/BinaryTree/RecoverBST/recover_bst.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Theories/DataStructures/BinaryTree/RecoverBST/recover_bst.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Theories/DataStructures/BinaryTree/RecoverBST/recover_bst.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import Optional
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
# Inorder Traversal; TC: O(n); SC: O(logn)
def recoverTree(self, root: Optional[TreeNode]) -> None:
"""
Do not return anything, modify r... | 33.923077 | 73 | 0.5548 |
8ef14150acfacbcad43093a9db5e4bba9e5e151e | 1,981 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
install_docs = [
{"doctype":"Role", "role_name":"Stock Manager", "name":"Stock Manager"},
{"doctype":"Role", "role_name":"Item Manager", "name":"Item Manager"},
{"doctype":"Role", "role_name":"Stock User", "name":"Stock User"},
{"doctype":"Role", "role_name":"Q... | 36.685185 | 98 | 0.726906 |
8dd8f597f8055e1c8e802e297374b1f6fe186044 | 1,247 | py | Python | TomTom/scraper.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | TomTom/scraper.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | TomTom/scraper.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | import requests
import boto3
import pandas as pd
from unidecode import unidecode
import time
from tqdm import tqdm
import json
s3_client = boto3.client('s3')
cities = pd.read_csv("staedte_koordinaten_ueber_50k.CSV", sep = ";")
cities
errors = []
result = pd.DataFrame()
for x, row in tqdm(cities[:50].iterrows(), total=... | 32.815789 | 138 | 0.636728 |
8de769a3bdda0a1f44540fd9729efdce96590fd8 | 1,568 | py | Python | fabfile.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 89 | 2015-02-13T13:46:06.000Z | 2022-03-13T16:42:44.000Z | fabfile.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 91 | 2015-03-12T13:31:36.000Z | 2022-01-14T07:37:37.000Z | fabfile.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 138 | 2015-03-04T15:23:43.000Z | 2022-03-09T15:11:52.000Z | #!/usr/bin/env python3
import csv
from fabric.api import *
import sys
import os
# USAGE: $ fab -R pub get_ut:input={input_file},output={output_file},refresh={true,false}
env.roledefs = {
'pub': ['bup@pub']
}
openapc_dir = "/home/openapc/openapc/"
def prepare():
local("git pull origin master")
def get_ut(i... | 34.844444 | 131 | 0.629464 |
a5184faf77fdca4295570c0ce3f14e634b62b0bb | 17,479 | py | Python | Packs/MapPattern/Scripts/MapPattern/MapPattern.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MapPattern/Scripts/MapPattern/MapPattern.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MapPattern/Scripts/MapPattern/MapPattern.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import fnmatch
import json
import re
from typing import Any, Dict, Generator, List, Optional, Tuple, Union
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
DEFAULT_ALGORITHM = 'literal'
DEFAULT_PRIORITY = 'first_match'
def demisto_get(obj: Any, path: Any) -> Any:
"""
... | 38.928731 | 126 | 0.547857 |
ba58b679e3b0d903322ba7b50a71bda7784f9874 | 12,789 | py | Python | Server/180405/cron_kindle-wetter_180405.py | nicoh88/kindle-kt3_weatherdisplay_battery-optimized | 9f6df7f5c9553543c667a9865dd5bfad247ab190 | [
"Unlicense",
"MIT"
] | 61 | 2018-03-27T14:06:56.000Z | 2022-03-18T23:23:57.000Z | Server/180405/cron_kindle-wetter_180405.py | nicoh88/kindle-kt3_weatherdisplay_battery-optimized | 9f6df7f5c9553543c667a9865dd5bfad247ab190 | [
"Unlicense",
"MIT"
] | 4 | 2018-12-14T22:59:12.000Z | 2021-10-04T14:27:30.000Z | Server/180405/cron_kindle-wetter_180405.py | nicoh88/kindle-kt3_weatherdisplay_battery-optimized | 9f6df7f5c9553543c667a9865dd5bfad247ab190 | [
"Unlicense",
"MIT"
] | 15 | 2018-07-04T06:21:17.000Z | 2021-08-31T17:49:59.000Z | #!/usr/bin/python3
#######################################################
### Autor: Nico Hartung <nicohartung1@googlemail.com> #
#######################################################
##############
# Bibliotheken
import os
import datetime
import codecs
import urllib.request
import json
import untangle
import MySQ... | 39.717391 | 195 | 0.529439 |
24062e69ebf752a8ef09f6a9d0a9d9bdc513e504 | 264 | py | Python | Algorithms/Greedy/BeautifulPairs.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Greedy/BeautifulPairs.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Greedy/BeautifulPairs.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
from collections import Counter
N = int(raw_input())
A = Counter(map(int, raw_input().split()))
B = Counter(map(int, raw_input().split()))
count = sum([value for value in (A&B).values()])
if A - B:
count += 1
else:
count -= 1
print count
| 16.5 | 48 | 0.636364 |
79f199a4354e6522f3760f12b9c39e0684a7410b | 1,771 | pyde | Python | sketches/sidescroller2/sidescroller2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/sidescroller2/sidescroller2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/sidescroller2/sidescroller2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # Side Scroller 2
from backgrounds import Hill, Cloud
from sprites import Alien, Obstacle
FPS = 60
clouds = []
bighills = []
smallhills = []
sprites = []
obstacles = []
def setup():
size(800, 450)
this.surface.setTitle("Side Scroller 2: Jump, Ally, jump!")
clouds.append(Cloud(400, -1))
for i in range... | 27.246154 | 67 | 0.604178 |
cefaf3ebfb571b52302092e93709840726cb4993 | 811 | py | Python | ___Python/Michael/p04_oop_MA2/m02_kalender.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p04_oop_MA2/m02_kalender.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p04_oop_MA2/m02_kalender.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | class Kalender(object):
tagepromonat = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
def __init__(self, tag, monat, jahr):
self.tag = tag
self.monat = monat
self.jahr = jahr
def naechsterTag(self):
self.tag += 1
korrektur = 1 if self.schal
... | 24.575758 | 97 | 0.531443 |
888bebd9a83f7191de7b85a10018e41726259741 | 13,181 | py | Python | RDS/circle3_central_services/research_manager/src/lib/ProjectService.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/lib/ProjectService.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/lib/ProjectService.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from lib.Project import Project
import logging
import requests
import os
from lib.EnumStatus import Status
from RDS import Util
logger = logging.getLogger()
def keys(self):
prefix = self.prefixer("")
for k in self._keys():
val = k.replace(prefix, "", 1)
yield val
class ProjectService:
d... | 35.432796 | 146 | 0.554131 |
ee587d8653bb0dec7853d26eb00493e5cdfac206 | 1,836 | py | Python | notebooks/utils/lexical/preprocessing.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | null | null | null | notebooks/utils/lexical/preprocessing.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | 2 | 2020-03-24T17:06:03.000Z | 2020-03-31T02:16:40.000Z | notebooks/utils/lexical/preprocessing.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | null | null | null | import nltk
import unidecode
import string
import spacy
class LexicalProcessing:
def __init__(self):
self.sent_tokenizer = nltk.data.load('tokenizers/punkt/portuguese.pickle')
self.stemmer = nltk.stem.RSLPStemmer()
self.stopwords = nltk.corpus.stopwords.words('portuguese')
self.nl... | 29.142857 | 82 | 0.639978 |
c99d66cff706fb2806c62d8ca46ba9b86b54cd2d | 5,434 | py | Python | Project Euler Qusetions 11 - 20/Project Euler Question 19.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 19.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 11 - 20/Project Euler Question 19.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 19
#You are given the following information, but you may prefer to do some research for yourself.
#1 Jan 1900 was a Monday.
#Thirty days has September,
#April, June and November.
#All the rest have thirty-one,
#Saving February alone,
#Which has twenty-eight, rain or shine.
#And on leap years, ... | 38.814286 | 106 | 0.505889 |
11b877c782e6924196928ab1b16243d62d61c294 | 803 | py | Python | inn_checker/inn_check/views.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | inn_checker/inn_check/views.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | inn_checker/inn_check/views.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | from django.core.paginator import Paginator
from django.shortcuts import render
from inn_checker.settings import PAGE_COUNT
# from .forms import INNForm
from inn_check.models import INNModel
'''
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
... | 25.903226 | 62 | 0.699875 |
11e0746ede4791da969d7ec74e628c8d78503cde | 2,235 | py | Python | forms.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | null | null | null | forms.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | 9 | 2017-06-15T10:24:09.000Z | 2018-08-01T21:07:25.000Z | forms.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | null | null | null | from django import forms
from .models import Transport, TransportUserGetFet, TransportLocation
from django.contrib.auth.models import User
class CreateTransport(forms.ModelForm):
contentClasses = (
("nonfood", "non food"),
("people", "people"),
("food", "food"),
("... | 42.169811 | 130 | 0.628635 |
ee9c1cdf3bebb92a1a9cbc78958c4cb0791ff503 | 14,196 | py | Python | src/onegov/event/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import click
import pycurl
from csv import reader as csvreader
from datetime import date
from datetime import datetime
from datetime import timedelta
from dateutil.parser import parse
from hashlib import sha1
from icalendar import Calendar as vCalendar
from io import BytesIO
from lxml import etree
from onegov.core.cli... | 32.117647 | 78 | 0.537405 |
e129929dba2177628d9c6bf3a07d75ea61b740ea | 356 | py | Python | top/clearlight/io/python_program/file_oper/write_message.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/io/python_program/file_oper/write_message.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/io/python_program/file_oper/write_message.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | def write_msg():
filename = 'programming.txt'
with open(filename, 'w') as file_obj:
file_obj.write("python good")
def append_write_msg():
filename = 'programming.txt'
with open(filename, 'a') as file_obj:
file_obj.write("\nI think it is simple by use")
if __name__ == '__main__':
... | 23.733333 | 55 | 0.646067 |
012aa887667b4e7fb2f410940e8fb3bcccc32797 | 4,591 | py | Python | dags/notecard_populator.py | chrispaynes/DepotAF | 26e5e26f59fe53d071d78645900a42f86f5e0d2a | [
"MIT"
] | null | null | null | dags/notecard_populator.py | chrispaynes/DepotAF | 26e5e26f59fe53d071d78645900a42f86f5e0d2a | [
"MIT"
] | null | null | null | dags/notecard_populator.py | chrispaynes/DepotAF | 26e5e26f59fe53d071d78645900a42f86f5e0d2a | [
"MIT"
] | null | null | null | from airflow import DAG
from airflow.operators import PythonOperator, TriggerDagRunOperator, BaseSensorOperator, PostgresOperator
from datetime import datetime, timedelta
from airflow.models import Variable
import psycopg2 as pg
import os
import re
import csv
import shutil
from datetime import datetime
from airflow.mo... | 30.203947 | 158 | 0.599869 |
0141c80a4fdade489fe5672a6a574cae304c682a | 1,135 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Archive/Zbackup/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Archive/Zbackup/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Archive/Zbackup/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | from Zbackup import Zbackup # NOQA
def config(parser):
parser.add_argument("--archive.zbackup.binary", dest="archive.zbackup.binary", default='/usr/bin/zbackup', type=str,
help="Path to ZBackup binary (default: /usr/bin/zbackup)")
parser.add_argument("--archive.zbackup.cache_mb", dest... | 70.9375 | 136 | 0.66696 |
018aead93a96564f6a43ca30586017b1157a01ab | 256 | py | Python | tag_0/p_1_3_gib_einen_text_viermal_aus.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_0/p_1_3_gib_einen_text_viermal_aus.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_0/p_1_3_gib_einen_text_viermal_aus.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
1 Einstieg (Tag 0)
1.3 Gib einen Text viermal aus.
Hinweis: Mit etwas herumprobieren geht das sehr schnell, ohne den Text 4-mal zu kopieren.
"""
if __name__ == '__main__':
text = input('Bitte Text eingeben: ')
print((text + '\n') * 4, end='')
| 25.6 | 89 | 0.652344 |
09879d104feed330eae16472538aa44a9b5d794e | 145 | py | Python | pages/themes/beginners/exceptions/examples/raise_exception.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/exceptions/examples/raise_exception.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/exceptions/examples/raise_exception.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | try:
user_number = int(input("Enter a number: "))
except ValueError:
print("~"*30)
print("You did not enter a number!")
print("~"*30)
raise
| 18.125 | 45 | 0.655172 |
1102308a9c76a72d8b227b2e9e6c180953590965 | 1,697 | py | Python | Raspberry Pi Pico/Pi_Pico_Internals.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-03-22T18:38:43.000Z | 2021-03-22T18:38:43.000Z | Raspberry Pi Pico/Pi_Pico_Internals.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | null | null | null | Raspberry Pi Pico/Pi_Pico_Internals.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-02-06T10:07:36.000Z | 2021-02-06T10:07:36.000Z | # Pi_Pico_Internals.py
# This sample program shows some information
# and uses some on-board resources to illustrate their query
# (c) 2021-03-09 Claus Kuehnel (info@ckuehnel.ch)
from machine import Timer
from machine import Pin
from machine import ADC
import sys, uos, ubinascii
def tick(timer):
led.toggle()
le... | 38.568182 | 111 | 0.733648 |
3a52320a7375a1f2d61bd2de6ee3b0ded8b696f7 | 864 | py | Python | exercises/de/test_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/test_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/test_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert len(doc1.ents) == 2, "Im ersten Beispiel werden zwei Enitäten erwartet."
assert (
doc1.ents[0].label_ == "WEBSITE" and doc1.ents[0].text == "Reddit"
), "Überprüfe die erste Entität im ersten Beispiel."
assert (
doc1.ents[1].label_ == "WEBSITE" and doc1.ents[1].text == ... | 45.473684 | 83 | 0.643519 |
3a98deb918e15702cf11e2506a92ae1b0a0e092f | 2,010 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_4/stock_entry_additional_costs.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v5_4/stock_entry_additional_costs.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_4/stock_entry_additional_costs.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
frappe.reload_doctype("Stock Entry")
frappe.reload_doctype("Stock Entry Detail")
frappe... | 37.222222 | 105 | 0.763682 |
3ae877a6eb50b82be88e0233dfaa18fc806404c4 | 2,771 | py | Python | RDS/circle1_adapters_and_ports/port_openscienceframework/src/api/project/project.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle1_adapters_and_ports/port_openscienceframework/src/api/project/project.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle1_adapters_and_ports/port_openscienceframework/src/api/project/project.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import json
from RDS import ROParser
import logging
import os
from flask import jsonify, request, g, current_app
from werkzeug.exceptions import abort
from lib.Util import require_api_key, from_jsonld
from RDS import Util
logger = logging.getLogger()
@require_api_key
def index():
req = request.json.get("metadata... | 23.285714 | 88 | 0.617106 |
c9454fadc4150a5313c21f6b328fc06a0abe8704 | 4,156 | py | Python | official/cv/posenet/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/posenet/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/posenet/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... | 38.481481 | 101 | 0.61718 |
6e309609afbc160793be434ad9531e3a1cef80a6 | 5,306 | py | Python | tests/test_parallelization.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | tests/test_parallelization.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | tests/test_parallelization.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | """Tests of krotov.parallelization."""
import io
from functools import partial
import numpy as np
import pytest
import qutip
import scipy
import krotov
import transmon_xgate_system_mod
def _func_global(x, power, *, use_sqrt=False):
"""Test function to map."""
y = x ** power
if use_sqrt:
y = np.s... | 30.848837 | 79 | 0.627026 |
956260e61983164dc693d0e0e8eced6bf0aab269 | 1,029 | py | Python | src/main.py | staugur/ssp | 1f5a0cec7369b078a09e9846d81881cc37dd2c3c | [
"BSD-3-Clause"
] | 1 | 2019-03-25T06:43:54.000Z | 2019-03-25T06:43:54.000Z | src/main.py | saintic/ssp | 1f5a0cec7369b078a09e9846d81881cc37dd2c3c | [
"BSD-3-Clause"
] | null | null | null | src/main.py | saintic/ssp | 1f5a0cec7369b078a09e9846d81881cc37dd2c3c | [
"BSD-3-Clause"
] | 1 | 2019-10-13T12:25:07.000Z | 2019-10-13T12:25:07.000Z | # -*- coding: utf-8 -*-
"""
ssp
~~~~
Simple Status Page
:copyright: (c) 2019 by staugur.
:license: BSD 3-Clause, see LICENSE for more details.
"""
from redis import from_url
from flask import Flask, render_template
from config import HOST, PORT, REDIS, SITE
from version import __version__
from li... | 22.866667 | 113 | 0.694849 |
9591077850d78fae04b0f240f29dd5992d7e5c5f | 1,465 | py | Python | src/onegov/org/models/editor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/editor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/editor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains the model describing the page editor. """
class Editor(object):
""" Defines the model for the page editor. Required because pages need
to be edited outside their url structure, since their urls are absorbed
completely and turned into SQL queries.
"""
def __init__(self, action, page, ... | 31.847826 | 78 | 0.609556 |
95c65efe663941a4322dbdda78b831bf207fb1de | 1,890 | py | Python | RDS/circle1_adapters_and_ports/port_zenodo/src/server.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle1_adapters_and_ports/port_zenodo/src/server.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle1_adapters_and_ports/port_zenodo/src/server.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | #!/usr/bin/env python
from RDS import Util, OAuth2Service, FileTransferMode, FileTransferArchive
from __init__ import app
import os
redirect_uri = os.getenv("RDS_OAUTH_REDIRECT_URI", "")
zenodo_address = os.getenv("ZENODO_ADDRESS", "https://sandbox.zenodo.org")
zenodo_oauth_token_url = "{}/oauth/token".format(zenodo... | 48.461538 | 330 | 0.778307 |
c276dde60c5868598c8f49bb71a615a5e56d1fa8 | 310 | py | Python | python/coursera_python/MICHIGAN/Programming For Everybody using python/5_2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/Programming For Everybody using python/5_2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/Programming For Everybody using python/5_2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | largest = None
smallest = None
d = 0
while True:
num = input("Enter a number: ")
d=d+1
if d == 1:
largest = int(num)
smallest = int(num)
if num == "done" : break
if int(num)>largest:
largest=int(num)
if int(num)<smallest:
smallest=int(num)
print("Maximum", largest)
print("Minimum", smallest)
| 16.315789 | 32 | 0.641935 |
6c790f02cff7eed1ec2e491d25292d0e00414a19 | 73 | py | Python | torba/torba/client/constants.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4,076 | 2018-06-01T05:54:24.000Z | 2022-03-07T21:05:52.000Z | torba/torba/client/constants.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 80 | 2018-06-14T01:02:03.000Z | 2019-06-19T10:45:39.000Z | torba/torba/client/constants.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | 20 | 2018-06-27T21:52:22.000Z | 2022-03-08T11:25:23.000Z | NULL_HASH32 = b'\x00'*32
CENT = 1000000
COIN = 100*CENT
TIMEOUT = 30.0
| 10.428571 | 24 | 0.671233 |
b0575735c31855d1f8dfc5d1ce6d30fb597808a8 | 710 | py | Python | vorl5-ueb4-gui-ueb1.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl5-ueb4-gui-ueb1.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl5-ueb4-gui-ueb1.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | # 5. Vorlesung 17.10.2020, Skript Python 4 (07_Python_04.pdf)
# Übung 4: GUI Übung 1: Stren zeichnen
from tkinter import *
main = Tk()
main.title("Ein Stern")
cnv = Canvas (main, width=200, height=200)
cnv.pack()
points = [
100,20,
110,50,
140,60,
110,70,
100,100,
90,70,
60,60,
90,50... | 15.106383 | 64 | 0.566197 |
af299e3281c41f0619fab5f599b26f68345a3480 | 1,378 | py | Python | Webpage/api/middelware.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/api/middelware.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/api/middelware.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from distutils.log import error
from operator import truediv
from urllib.request import Request
from django.http import Http404, HttpRequest, HttpResponseNotAllowed
from keycloak import KeycloakAdmin,KeycloakOpenID
from utils.keycloak import getKeycloackAdmin, getKeycloakOpenID
import requests
import os
def getUserIn... | 26.5 | 88 | 0.67852 |
af41de6570f6a01222c587a94c168db33e07c030 | 1,756 | py | Python | tikz/3d-manhattan-bar-plot/getCoordinates.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/3d-manhattan-bar-plot/getCoordinates.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/3d-manhattan-bar-plot/getCoordinates.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | def writeCoordinates(file, x, y, z):
file.write("(" + str(x) + "," + str(y) + "," + str(z) + ") ")
def make3dhistogram(x, y, z, zmin, output):
file = open(output, 'wb')
i = 0
for j in range(len(y)):
writeCoordinates(file, x[i], y[j], zmin)
writeCoordinates(file, x[i], y[j], zmin)
fi... | 39.022222 | 79 | 0.546697 |
bb8097940bcb5358fda15749670a15cafd1e9c42 | 1,263 | py | Python | apps/general/views.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/general/views.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/general/views.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | from django.contrib import messages
from django.shortcuts import render, redirect
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import require_POST
from django.contrib.auth import logout as django_logout, authenticate, login as django_login
def index(request):
return re... | 29.372093 | 98 | 0.73555 |
a52f7ed902817ecabb75dab4fc7d6ca3034392c2 | 2,877 | py | Python | pocketthrone/entities/building.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/entities/building.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/entities/building.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | __all__ = ('Buildign')
class Building:
# engine properties
_id = -1
name = ""
name_de = ""
size = "1x1"
# building type
_type = None
# possible building types & names
_types = ["wall", "tower", "blacksmith", "bordel", "stables", "harbor", "tunnels", "siege_workshop", "mansion", "market"]
_names = {
"wall"... | 26.154545 | 136 | 0.690302 |
3c064783c3cc88d8034174aed2bbd5298a7fe6c0 | 183 | py | Python | Openharmony v1.0/third_party/ltp/testcases/network/nfsv4/acl/cleangroups.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/ltp/testcases/network/nfsv4/acl/cleangroups.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/ltp/testcases/network/nfsv4/acl/cleangroups.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from random_gen import *
from optparse import OptionParser
import subprocess
import os
import random
test = RandomGen()
test.getGroupList()
test.cleanGroups()
| 16.636364 | 33 | 0.797814 |
3cd83b5919a092219d47b9f6838f8ffb6add7baf | 2,231 | py | Python | localconf.py | whatifrussian/xkcdbird | e21cd93b6f45ef04a46328cdd0feececfdd58984 | [
"Unlicense"
] | null | null | null | localconf.py | whatifrussian/xkcdbird | e21cd93b6f45ef04a46328cdd0feececfdd58984 | [
"Unlicense"
] | null | null | null | localconf.py | whatifrussian/xkcdbird | e21cd93b6f45ef04a46328cdd0feececfdd58984 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# Currently not used, see below.
#import logging
AUTHOR = u'xkcd'
SITENAME = u'XKCD — по-русски'
TIMEZONE = 'Europe/Moscow'
DEFAULT_LANG = u'ru'
PLUGIN_PATHS = [ "plugins" ]
PLUGINS = ["neighbors", "sitemap", "xkcd_json", "num_... | 21.660194 | 94 | 0.67593 |
ab64b892e7cea4220af1751a377215c7e81ca6b7 | 376 | py | Python | app/errors.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | app/errors.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | app/errors.py | galyeshua/Index | 96e1630efc51d2c03f2d80889dfa1d117155e2ee | [
"MIT"
] | null | null | null | from app import app, db
from flask import render_template
@app.errorhandler(404)
def error_404(error):
return render_template('errors/404.html'), 404
@app.errorhandler(500)
def error_500(error):
db.session.remove()
return render_template('errors/500.html'), 500
@app.errorhandler(413)
def error_413(err... | 19.789474 | 50 | 0.742021 |
ab84ffcd43bceb0c7cf801dc50bd3bd0eb513dca | 1,394 | py | Python | Algorithms/Implementation/Lisa's_Workbook.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Lisa's_Workbook.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Lisa's_Workbook.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/lisa-workbook/problem
# test 0
n = 2
k = 3
arr = [4,2]
# test 1
n = 5
k = 3
arr = [4,2,6,1,10]
#=======================#
c = [] # chapters
p = [] # pages
# while loop implementation
i = 1 # starting index -> page
j = arr[0] # ending index -> page
ind = 0 # arr[ind] -> chapt... | 15.840909 | 61 | 0.426829 |
ddca29f5a420ae2e467bc0ed67bbf61d863781e0 | 766 | py | Python | server/apps/movie/view_base.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/movie/view_base.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/movie/view_base.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-19 21:16
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : view_base.py
# @Software: PyCharm
from django.views.generic import View
from .models import Movie
from django.http import HttpResponse
import json
class MovieList(V... | 26.413793 | 100 | 0.608355 |
fb2f2985aa7dc97f4c64b7825b50e2f1cf1150ed | 6,858 | py | Python | test/test_npu/test_network_ops/test_floor.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_floor.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_floor.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 43.681529 | 90 | 0.595655 |
34e57c8825e7c1112a139f4fb9be86b2f1379e1e | 1,062 | pyde | Python | sketches/cuteplanet05/cuteplanet05.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/cuteplanet05/cuteplanet05.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/cuteplanet05/cuteplanet05.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | #Spaceship
from spaceship import Spaceship, Octopussy
octopussy = Octopussy("octopussy.png", 800, 150)
planet = Spaceship("planet.png", 500, 350)
rocketboy1 = Spaceship("rocketship.png", 300, 300)
rocketboy2 = Spaceship("rocketship.png", -300, 250)
beetle = Spaceship("beetleship.png", 200, 100)
ships = [planet, rocke... | 25.285714 | 60 | 0.621469 |
34f20de13d5d3bce3294c602691241fae5cda356 | 2,448 | py | Python | MT-LSTM/model.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/model.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/model.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ MT-LSTM文本分类模型
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/31
"""
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from MT_LSTM import MT_LSTM
import torch
class Model(nn.Module):
def __init__(self, vocab, hidden_size, device, ave_length=19, embedding... | 36 | 127 | 0.535948 |
32f9cd7cc9bfba406034723222cf8df3a27318c1 | 5,797 | py | Python | base/weapi.py | francisar/wechat | 8932feb4aacc6df27a472e3278780fcdd41bc47c | [
"MIT"
] | null | null | null | base/weapi.py | francisar/wechat | 8932feb4aacc6df27a472e3278780fcdd41bc47c | [
"MIT"
] | null | null | null | base/weapi.py | francisar/wechat | 8932feb4aacc6df27a472e3278780fcdd41bc47c | [
"MIT"
] | null | null | null | #coding=utf-8
from wechat.settings import WX_TOKEN,WX_EncodingAESKey,WX_APPID,WX_APPSECRET
import requests
from django.core.cache import cache
class WechatApi(object):
URL_ROOT_API = 'https://api.weixin.qq.com'
URL_GET_TOKEN = URL_ROOT_API + '/cgi-bin/token' + '?grant_type=client_credential&appid=%s&secret=%s'
... | 47.130081 | 135 | 0.634466 |
2f476ed88754e7e13d808ba1c9f56636c146e40b | 399 | py | Python | scratch/prcess_pool_test.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | scratch/prcess_pool_test.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | scratch/prcess_pool_test.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | # bug in pypy3.6 ? -> OSError
import concurrent.futures
import multiprocessing
def task(i):
import time
time.sleep(i)
return i
with concurrent.futures.ProcessPoolExecutor(multiprocessing.cpu_count()) as pool:
results = []
for i in range(3):
results.append(pool.submit(task, i))
concu... | 18.136364 | 81 | 0.669173 |
c84546ec5a2ddfb904442ad1d5d8d1ae3bc80cfd | 549 | py | Python | UAS/UAS 9/Class.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | UAS/UAS 9/Class.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | UAS/UAS 9/Class.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | #Class Mahasiswa
class Mahasiswa:
def __init__(self, nama, kehadiran, tugas, uts, uas):
self.nama = nama
self.kehadiran = kehadiran
self.tugas = tugas
self.uts = uts
self.uas = uas
def cekKelulusan(self):
if self.kehadiran >= 80 and self.tugas >= 80 and self.uts >= 85 and self.uas >= 75:
pr... | 30.5 | 86 | 0.639344 |
23c4d3754355f8d2f0cfb70ea6cf162235f09a17 | 250 | py | Python | top/clearlight/base/csdn/yield/yield_01.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/csdn/yield/yield_01.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/csdn/yield/yield_01.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | def foo(num):
print("starting...")
while num < 10:
num = num + 1
yield num
# debug看运行顺序 即可
for n in foo(0):
print(n)
def gen(n):
for i in range(n):
yield i ** 2
for i in gen(5):
print(i, " ", end="")
| 12.5 | 25 | 0.48 |
23df3370b61841b17715157c4b6f42896f9a3fd8 | 1,864 | py | Python | python/coursera_python/TORONTO/a2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/TORONTO/a2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/TORONTO/a2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def get_length(dna):
""" (str) -> int
Return the length of the DNA sequence dna.
>>> get_length('ATCGAT')
6
>>> get_length('ATCG')
4
"""
return len(dna)
def is_longer(dna1, dna2):
""" (str, str) -> bool
Return True if and only if DNA sequence dna1 is longer than D... | 18.27451 | 76 | 0.5397 |
9e3947207bbcf20d57c1d3da05a77bf5498b665b | 408 | py | Python | PYTHON/Itertools/compress_the_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/compress_the_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/compress_the_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
S = input()
n = 'a'
cnt = 1
l = []
for s in S:
if n != s:
if n != 'a':
# print(n, cnt)
l.append((cnt, int(n)))
n = s
cnt = 1
else:
cnt += 1
# print(s,... | 19.428571 | 39 | 0.35049 |
7b687a94a60e964bc9064965f0968a3f71903160 | 2,976 | py | Python | Generator/xml_laden.py | Design-Computation-RWTH/ILC_Demonstrator | 60046366383de053026a0d03b213f6af3610f608 | [
"MIT"
] | 1 | 2021-06-08T10:04:35.000Z | 2021-06-08T10:04:35.000Z | mvdXMLGen/ILC_Demonstrator-master/Generator/xml_laden.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | null | null | null | mvdXMLGen/ILC_Demonstrator-master/Generator/xml_laden.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | 1 | 2021-05-04T09:38:20.000Z | 2021-05-04T09:38:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from Generator import xml
from Generator import rules
from Generator import guid
import xml.etree.ElementTree as ET
#open adding template files to written rule classes
class_to_template_file = {
rules.ConceptTemplate: "02_ConceptTemplate.mvdxml",
rules.ModelView: ... | 48.786885 | 132 | 0.704301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.