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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b513ce3a702014f9889c90bf2bd5086d9c735cdc | 8,007 | py | Python | test/test_npu/test_network_ops/test_sum.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_sum.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_sum.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 36.395455 | 101 | 0.602972 |
d229a1b2c7c4ee26ce595f4530a0e3002db4154d | 159 | py | Python | authApp/serializers/__init__.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | null | null | null | authApp/serializers/__init__.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | 1 | 2022-01-05T23:52:37.000Z | 2022-01-05T23:52:37.000Z | authApp/serializers/__init__.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | null | null | null | from .accountSerializer import AccountSerializer
from .userSerializer import UserSerializer
from .transactionSerializer import TransactionSerializer | 53 | 56 | 0.842767 |
963bda3aee11a37471955b23e99d3fe764e2003c | 2,236 | py | Python | scripts/style/verify-fidl-libraries.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/style/verify-fidl-libraries.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/style/verify-fidl-libraries.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import re
import subprocess
import sys
FUCHSIA_ROOT = os.path.dirname( # $root
os.path.dirname( ... | 29.813333 | 87 | 0.584526 |
73c6d2ee07602868c843e60fd5e8beb01c55f767 | 1,902 | py | Python | Packs/ApiModules/Scripts/FireEyeApiModule/FireEyeApiModule_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ApiModules/Scripts/FireEyeApiModule/FireEyeApiModule_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/ApiModules/Scripts/FireEyeApiModule/FireEyeApiModule_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
from CommonServerPython import BaseClient, DemistoException
from FireEyeApiModule import FireEyeClient, to_fe_datetime_converter, alert_severity_to_dbot_score
def test_to_fe_datetime_converter():
"""Unit test
Given
- to_fe_datetime_converter command
- time in a string
When
- run... | 30.677419 | 120 | 0.701893 |
5825b1513f0ec09c96610411070edb7da4855884 | 1,081 | py | Python | OWO.py | anSEpranks/OWO | 45d1bc14c74e5b3089212eb8c8e2077e7a0e7c5b | [
"MIT"
] | null | null | null | OWO.py | anSEpranks/OWO | 45d1bc14c74e5b3089212eb8c8e2077e7a0e7c5b | [
"MIT"
] | null | null | null | OWO.py | anSEpranks/OWO | 45d1bc14c74e5b3089212eb8c8e2077e7a0e7c5b | [
"MIT"
] | null | null | null | import pyperclip
import time
import os
from OWO_string import UWU
#responses
def ask(string, truth):
#truth is a string
while True:
mode = input(string + "\n").lower()
if mode in truth.split() or mode == '':
return mode
else:
continue
#conerts files
def OWO_fi... | 23.5 | 247 | 0.604995 |
5867acc82eef39536edac3d2ffe71d699baf8fab | 7,443 | py | Python | src/main/python/tools/image_rebuild.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/tools/image_rebuild.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/tools/image_rebuild.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | import os, random, string, shutil
from tools import logger
from tools import logger
from context import resource_manager
from tools import file_manage
log = logger.getLogger()
"""
def rename():
for f in files:
if os.path.isfile(os.path.join(path,f))==True:
i=i+1;
name='{0}_{1:0{2}d}'.format(prefi... | 39.173684 | 178 | 0.533253 |
b7342d49e2eddfdf888aa37e67d571523899d6d4 | 207 | py | Python | volley/models/__init__.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | volley/models/__init__.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | volley/models/__init__.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | from volley.models.pydantic_model import (
GenericMessage,
PydanticModelHandler,
PydanticParserModelHandler,
)
__all__ = ["GenericMessage", "PydanticModelHandler", "PydanticParserModelHandler"]
| 25.875 | 82 | 0.78744 |
3f7c5354bcaa4c73951717aa95c43a082e57e18e | 7,209 | py | Python | backend/apps/iamstudent/management/commands/_utils.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/management/commands/_utils.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/management/commands/_utils.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | BIG_CITY_PLZS = [
"01067",
"01069",
"01097",
"01099",
"01109",
"01127",
"01129",
"01139",
"01157",
"01159",
"01169",
"01187",
"01189",
"01217",
"01219",
"01237",
"01239",
"01257",
"01259",
"01277",
"01279",
"01307",
"01309",
... | 12.965827 | 17 | 0.385352 |
3fff841da36d4a13ba5a35a97f975ca479e06660 | 1,645 | py | Python | Packs/Lokpath_Keylight/Scripts/KeylightCreateIssue/KeylightCreateIssue_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Lokpath_Keylight/Scripts/KeylightCreateIssue/KeylightCreateIssue_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Lokpath_Keylight/Scripts/KeylightCreateIssue/KeylightCreateIssue_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import CommonServerPython as csp
from pytest import raises
import json
def test_script(mocker):
return_data = [
[
{
'Contents':
[
{
'Name': 'Audit Projects',
... | 27.881356 | 111 | 0.432219 |
4dfdc3bb06ea67ab0972fd63fa9ba64f8754f8b1 | 201 | py | Python | top/clearlight/reptile/sxt/spider/the_first_spider.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/reptile/sxt/spider/the_first_spider.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/reptile/sxt/spider/the_first_spider.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | from urllib.request import urlopen
url = 'http://www.baidu.com'
# 发送请求
response = urlopen(url)
# 读取内容
info = response.read().decode()
# 打印内容
print(info)
print(response.geturl())
print(response.info()) | 18.272727 | 34 | 0.721393 |
4215f743689c2df3a5548c56c4d593ab90b6f352 | 25,082 | py | Python | myems-normalization/virtualmeter.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 82 | 2021-02-19T10:24:31.000Z | 2022-03-28T06:30:18.000Z | myems-normalization/virtualmeter.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 188 | 2021-02-22T07:08:30.000Z | 2022-03-02T04:11:03.000Z | myems-normalization/virtualmeter.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 54 | 2021-02-19T08:48:46.000Z | 2022-03-30T06:21:34.000Z | import time
from datetime import datetime, timedelta
import mysql.connector
from sympy import sympify
from multiprocessing import Pool
import random
import config
########################################################################################################################
# PROCEDURES:
# Step 1: Query all ... | 52.804211 | 120 | 0.540069 |
67ed411b06d895299549095a2ba6a0a68282f69d | 3,084 | py | Python | ALBERT/dataset/vocab/vocab.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | ALBERT/dataset/vocab/vocab.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | ALBERT/dataset/vocab/vocab.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 字典的文件
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/30
"""
import os
import nltk
class Vocab:
def __init__(self, vocab_path):
""" 字典初始化
@param:
:vocab_path: 字典文件路径
"""
super().__init__()
self._stoi_ = {}
self._itos_ = {}
... | 28.555556 | 109 | 0.511349 |
3f19bf8278f8e2cef3de32642835e2e4831e0c88 | 494 | py | Python | updateAddons.py | cranus/wowAddonUpdater | bb0cfac5c4f3f17ff02f54d977fe25df4599a260 | [
"MIT"
] | null | null | null | updateAddons.py | cranus/wowAddonUpdater | bb0cfac5c4f3f17ff02f54d977fe25df4599a260 | [
"MIT"
] | null | null | null | updateAddons.py | cranus/wowAddonUpdater | bb0cfac5c4f3f17ff02f54d977fe25df4599a260 | [
"MIT"
] | null | null | null | import json
import urllib.request
import zipfile
with open('addons.json') as f:
data = json.load(f)
config = data["config"]
for (i, addon) in enumerate(data["addons"]):
print ("Download: " + addon["name"])
file = config["tmp"] + addon["name"]+'.zip'
urllib.request.urlretrieve(addon["... | 27.444444 | 51 | 0.609312 |
e159940088c530897da97fc8050624d25cc27a8b | 575 | py | Python | solutions/MFA/webserver/src/common/config.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/MFA/webserver/src/common/config.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/MFA/webserver/src/common/config.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import os
MILVUS_HOST = os.getenv("MILVUS_HOST", "192.168.1.85")
MILVUS_PORT = os.getenv("MILVUS_PORT", 19530)
VECTOR_DIMENSION = os.getenv("VECTOR_DIMENSION", 512)
NUM = os.getenv("TOPK_NUM", 100)
IMG_TABLE = os.getenv("IMG_TABLE", "face_table")
VOC_TABLE = os.getenv("VOC_TABLE", "voice_table")
PG_HOST = os.getenv(... | 35.9375 | 54 | 0.725217 |
55e42793c138d3cdebc04febd0d2c9214b33ebe1 | 274 | py | Python | Python/Docs/The-Python-Tutorial.python.org/4.3-The-range-Function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Docs/The-Python-Tutorial.python.org/4.3-The-range-Function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Docs/The-Python-Tutorial.python.org/4.3-The-range-Function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | for i in range(5):
print(i)
print(type(range(5)))
print(list(range(5, 10)))
print(list(range(0, 10, 3)))
print(list(range(-10, -100, -30)))
a = ["Mary", "had", "a", "little", "lamb"]
for i in range(len(a)):
print(i, a[i])
print(range(10))
print(sum(range(4)))
| 15.222222 | 42 | 0.572993 |
36e182dfa87bfd79c3a7514fa1b1a52a2735cf71 | 145 | py | Python | packages/watchmen-rest-dqc/src/app.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-dqc/src/app.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-dqc/src/app.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from uvicorn import run
if __name__ == "__main__":
run("watchmen_rest_dqc.main:app", host="127.0.0.1", port=8800, log_level="info", workers=1)
| 29 | 92 | 0.717241 |
b110ff9ffe5fad9ca568ee61d99837d5ceee0c08 | 2,884 | py | Python | perplexity.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | perplexity.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | perplexity.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 16:46:55 2018
@author: 月神少女
"""
import math
import matplotlib.pyplot as plt
def dictionary_found(wordlist): #对模型训练出来的词转换成一个词为KEY,概率为值的字典。
word_dictionary1={}
for i in range(len(wordlist)):
if i%2==0:
if word_dictionary1.__con... | 31.692308 | 109 | 0.643551 |
b15c59d8065c8a248b9b50fbad6bd01e84c8838a | 33,614 | py | Python | src/comex_stat/assets/schema.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | src/comex_stat/assets/schema.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | src/comex_stat/assets/schema.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | from comex_stat.assets.models import (CGCE, CUCI, NCM, SH, AssetExportFacts,
AssetImportFacts, Country,
FederativeUnit, TradeBlocs,
Transportation, Urf)
from graphene_django.filter.fields import DjangoFilte... | 38.241183 | 82 | 0.662968 |
b170c15ce3c946c572ea5aa52fb8e5eb2828f05c | 1,265 | py | Python | src/ztc/vm/memory.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/vm/memory.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/vm/memory.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
"""Memory check class for ztc.
This file is part of ZTC and distributed under the same license
Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
"""
from ztc.check import ZTCCheck
class Memory(ZTCCheck):
name = 'memory'
def _get_amount(self, name):
""" Get amount ... | 27.5 | 77 | 0.6 |
b190672ea9bbcffec8cf746c7d582b38f7bff041 | 3,820 | py | Python | e3/bravo/E3_2021ss_bravo.py | hka-mmv/dscb-exercise | 7a3081074b36ac3242282f89480eb03535ba40d3 | [
"MIT"
] | 5 | 2021-03-29T17:27:14.000Z | 2022-03-15T08:53:12.000Z | e3/bravo/E3_2021ss_bravo.py | hka-mmv/dscb-exercise | 7a3081074b36ac3242282f89480eb03535ba40d3 | [
"MIT"
] | 32 | 2021-04-28T21:02:16.000Z | 2021-06-28T14:56:53.000Z | e3/bravo/E3_2021ss_bravo.py | hka-mmv/dscb-exercise | 7a3081074b36ac3242282f89480eb03535ba40d3 | [
"MIT"
] | 3 | 2021-06-01T08:06:19.000Z | 2021-06-07T14:28:09.000Z | import pandas as pd
import matplotlib.pyplot as plt
from pandas.io.parsers import read_csv
import seaborn as sns
# TODO import module for requests
import requests
class example:
def __init__(self):
self.data = self.read("AB_NYC_2019cleaned.csv")
self.url = "https://github.com/hka-mmv/dscb230-exe... | 32.10084 | 135 | 0.630366 |
620e4f5b542a22def6aa0e39d017eb5f60dc36cb | 422 | py | Python | pacman-arch/test/pacman/tests/deptest001.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/deptest001.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/deptest001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "test deptest (-T) functionality"
lp1 = pmpkg("pkg1")
self.addpkg2db("local", lp1)
lp3 = pmpkg("pkg3", "2.0-1")
lp3.provides = ("prov=3.0")
self.addpkg2db("local", lp3)
self.args = "-T pkg1 pkg2 pkg3\>2.1 prov\>\=3.0"
self.addrule("PACMAN_RETCODE=127")
self.addrule("!PACMAN_OUTPUT=^pkg1")
self.ad... | 24.823529 | 52 | 0.699052 |
f323f912f9ad823f5afd28ca651927d1beb22a3a | 620 | py | Python | Python/examples/try_except.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 133 | 2021-01-15T16:29:40.000Z | 2022-03-21T16:35:42.000Z | Python/examples/try_except.py | Amirmohammadkazemi/Hello-World | 4b4549b690b76d90129748aac1fdf10fcb59f4da | [
"MIT"
] | 117 | 2021-01-17T08:54:22.000Z | 2022-01-17T16:38:11.000Z | Python/examples/try_except.py | Amirmohammadkazemi/Hello-World | 4b4549b690b76d90129748aac1fdf10fcb59f4da | [
"MIT"
] | 146 | 2021-01-15T12:57:19.000Z | 2022-03-15T20:10:23.000Z | # It's good for handling errors
try: # use "try" and "except" keywords
# your code to be handled
pass
except Exception as err: # you can see your error as Exception object and we put it in a variable named `err`
print("You have an error:", err) # print error
# this example for importing a module:
try:
import o... | 29.52381 | 109 | 0.679032 |
b87ff9ac168ae7d627a115ec377bd90a11cdfae3 | 444 | py | Python | PYTHON/Itertools/combinations.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/combinations.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/combinations.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from itertools import combinations
if __name__ == '__main__':
k = input().split()
S, n = k[0], int(k[1])
res = []
for i in range(1, n + 1):
temp = [''.join(p) for p in combinations(S, i)]
if i > 1:
for i, t in enumerate(temp):
temp[i] =... | 24.666667 | 55 | 0.515766 |
b277a066a2e5aeee5a52455d5deee637ad94ec8e | 547 | py | Python | Curso-Em-Video-Python/2Exercicios/079_valores_unicos_em_uma_lista.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/079_valores_unicos_em_uma_lista.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/079_valores_unicos_em_uma_lista.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | lista = list()
while True:
valor = int(input('Digite um Valor: '))
continuar = str(input('Deseja continuar? [S/N] ')).upper()
if valor not in lista:
lista.append(valor)
print('valor adicionado com sucesso...')
else:
contador
print('Valor duplicado! não vou adicionar...')
... | 28.789474 | 62 | 0.575868 |
0c0431ae3d3e5e532c3681d3dfbfa4cf82470cc0 | 5,375 | py | Python | Packs/FeedCofense/Integrations/FeedCofense/FeedCofense_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedCofense/Integrations/FeedCofense/FeedCofense_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedCofense/Integrations/FeedCofense/FeedCofense_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import pytest
from FeedCofense import Client, fetch_indicators_command
from CommonServerPython import FeedIndicatorType
with open("test_data/search_output.json") as f:
raw: dict = json.load(f)
data = raw["data"]
threats = data["threats"]
client = Client("https://www.threathq.com", ("username", "passwo... | 35.596026 | 109 | 0.574512 |
5a6e3ed4136c83f4ae52e9cbc3bfde0b5f6fa019 | 6,331 | py | Python | Mock/Api.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | Mock/Api.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | Mock/Api.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | # pylint: disable=C0114
from collections import namedtuple
import tweepy # for exceptions
from Externals import TwitterBase
from Externals.twitter.Measure import Measure
from AnswerMachine.tweet import Tweet
import Persistence.log as log
from .Tweet import User, mocked_source, mocked_tweets
log_ = log.getLogger(__name... | 43.662069 | 94 | 0.574317 |
ce6fe2dcb0606bda51a67fd563fc8568fa4ed3de | 4,720 | py | Python | Metadataextraction/test_whole.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | null | null | null | Metadataextraction/test_whole.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 47 | 2018-11-13T13:55:01.000Z | 2019-09-16T13:38:11.000Z | Metadataextraction/test_whole.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 4 | 2018-11-27T12:36:51.000Z | 2020-10-14T18:07:04.000Z | import click # used to print something
import os # used to get the location of the testdata
import extractTool # used to invoke the getMetadata function
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
# Tests to check folders
###############################
# -... | 44.952381 | 198 | 0.654661 |
cea86e003c58fc5eb8940bb6308a9b1d6a6a578d | 545 | py | Python | setup.py | wille430/index-renamer | 95b925a26d7db2b4dc4365107368c7ea8e9b24f7 | [
"MIT"
] | null | null | null | setup.py | wille430/index-renamer | 95b925a26d7db2b4dc4365107368c7ea8e9b24f7 | [
"MIT"
] | null | null | null | setup.py | wille430/index-renamer | 95b925a26d7db2b4dc4365107368c7ea8e9b24f7 | [
"MIT"
] | null | null | null | from setuptools import setup
def readfile(filename):
with open(filename, 'r+') as f:
return f.read()
setup(
name="index-renamer",
version="0.0.3",
description="Recursively rename index to its parent folder",
long_description=readfile('README.md'),
author="William Wigemo",
author_... | 22.708333 | 64 | 0.623853 |
0cbd0e6363a0ab6bff43f2abf82d117edf340ce5 | 370 | py | Python | tests/onegov/election_day/utils/test_last_modified.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/utils/test_last_modified.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/utils/test_last_modified.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import datetime
from mock import Mock
from onegov.election_day.utils import add_last_modified_header
def test_add_last_modified_header():
response = Mock()
add_last_modified_header(response, datetime(2011, 12, 31, 12, 1))
assert str(response.method_calls[0]) \
== "call.headers.add('... | 30.833333 | 79 | 0.737838 |
0b73d87d2b08d0bc8b2895775d369d4c90354e4d | 2,441 | py | Python | Project Euler Questions 21 - 30/Project Euler Question 23.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 21 - 30/Project Euler Question 23.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 21 - 30/Project Euler Question 23.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 23
#A perfect number is a number for which the sum of its proper divisors is exactly equal to the number.
#For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
#A number n is called deficient if the sum of its proper divi... | 36.984848 | 146 | 0.603851 |
0b7489ab7cde168da3d604ed55100908964db4c8 | 1,152 | py | Python | sample/create_ngram.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | sample/create_ngram.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | sample/create_ngram.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | import argparse
import pickle
import os
import sys
dir_path = os.path.dirname(os.path.abspath(__file__))
module_path = os.path.join(dir_path, "../src")
if module_path not in sys.path:
sys.path.append(module_path)
def main():
from counter.lossy_counting import LossyCountingNGram
parser = argparse.Argumen... | 28.097561 | 79 | 0.664931 |
0b937e6f265076a82fb0a33d132875f3e47e1369 | 3,827 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/eigen.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/eigen.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/eigen.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | # Author : Fabian Jakobs
r"""
This module provides functions for computing eigenvalues and eigenvectors of
matrices using the gsl.
There are routines for real symmetric and complex hermitian matrices, and
eigenvalues can be computed with or without eigenvectors. The algorithms used
are symmetric bidiagonaliza... | 36.447619 | 78 | 0.725111 |
f0514bda4b6098d394cf2b6ff90a49b740d4201e | 263 | py | Python | src/aijack/collaborative/utils.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/collaborative/utils.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/collaborative/utils.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import numpy as np
import torch
def transform_list_to_tensor(model_params_list):
for k in model_params_list.keys():
model_params_list[k] = torch.from_numpy(
np.asarray(model_params_list[k])
).float()
return model_params_list
| 23.909091 | 48 | 0.703422 |
33722ecab3af9b5ba7963c1c5b8522530327f912 | 15,394 | py | Python | Packs/Accessdata/Integrations/Accessdata/Accessdata.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Accessdata/Integrations/Accessdata/Accessdata.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Accessdata/Integrations/Accessdata/Accessdata.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import os
import json
import requests
from requests.exceptions import HTTPError
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CONSTANTS '''
DATE_FORMAT = "%Y-%m-%dT%H:... | 35.88345 | 97 | 0.590165 |
687da3eb3b0ed41c0ad6cd679709bddf87abb223 | 1,658 | py | Python | train_online.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 7 | 2020-02-05T20:42:48.000Z | 2020-02-09T15:39:07.000Z | train_online.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 7 | 2020-02-04T17:26:35.000Z | 2020-02-04T17:27:45.000Z | train_online.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 1 | 2021-09-30T13:56:26.000Z | 2021-09-30T13:56:26.000Z | #! /usr/local/bin/python3.6
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from rasa_core.channels.console import ConsoleInputChannel
from rasa_core.agent import Agent
from rasa_core.policies.keras_po... | 33.16 | 77 | 0.698432 |
4a0671ee1ddfcaa48a6a94b12999ebd8638b93c9 | 760 | py | Python | redis_test.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | redis_test.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | redis_test.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | import CralwerSet.connect_mysql as connect_mysql
import time
import json
classify = 2
info = '付製这行话¥daxi1oVNWaF¥转移至淘宀┡ē【不会自行车的我,不想买贵的大的电动车,怕学不会,就入手了希洛普的电动滑板车,车子价位从1K多起步】;或https://m.tb.cn/h.VjtdO5K?sm=4d4548 點击链街,再选择瀏..覽..噐dakai'
temp = str(int(time.time() * 1000))
r = connect_mysql.Redis()
key = temp + '|' + str(class... | 27.142857 | 142 | 0.627632 |
76c453e7a9efade0b2615949b9661c12f5c0fb79 | 4,216 | py | Python | tests/onegov/user/test_auth_clients.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/user/test_auth_clients.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/user/test_auth_clients.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import kerberos
import morepath
import pytest
from hashlib import sha256
from onegov.core import Framework
from onegov.core.security import Public
from onegov.core.utils import scan_morepath_modules, module_path
from onegov.user import UserApp
from onegov.user.auth.clients import KerberosClient, LDAPClient
from tests.... | 28.680272 | 74 | 0.63259 |
8c768632acdd998b900f00d65e556bfc549958b1 | 973 | py | Python | sort_algorithm/01_merge_sort.py | Jeson1g/Dawson | b65f2347110cf56d13e9fcf8f08a3b38af53af77 | [
"MIT"
] | 2 | 2018-06-19T08:46:10.000Z | 2018-11-05T02:15:34.000Z | sort_algorithm/01_merge_sort.py | Jeson1g/Dawson | b65f2347110cf56d13e9fcf8f08a3b38af53af77 | [
"MIT"
] | null | null | null | sort_algorithm/01_merge_sort.py | Jeson1g/Dawson | b65f2347110cf56d13e9fcf8f08a3b38af53af77 | [
"MIT"
] | null | null | null | def merge_sort(alist):
"""归并排序"""
n = len(alist)
if 1 == n:
return alist
mid = n // 2
# 对左半部分进行归并排序
left_sorted_li = merge_sort(alist[:mid])
# 对右半部分进行归并排序
right_sorted_li = merge_sort(alist[mid:])
# 合并两个有序集合
left, right = 0, 0
merge_sorted_li = []
left_n = len... | 24.325 | 58 | 0.610483 |
50d4154c27d00278ade437cb50f33c282aa89b21 | 948 | py | Python | src/onegov/wtfs/models/pickup_date.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/pickup_date.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/pickup_date.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UUID
from onegov.wtfs.models.municipality import Municipality
from sqlalchemy import Column
from sqlalchemy import Date
from sqlalchemy import ForeignKey
from sqlalchemy.orm import backref
from sqlalchem... | 27.882353 | 79 | 0.712025 |
0f95421780dce31efbf29a72554358146bdc43c4 | 2,302 | py | Python | research/cv/AttGAN/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/AttGAN/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/AttGAN/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.689655 | 108 | 0.729366 |
fa41d0dca6ae6abf9e2d6e77e4d5627f93a4c0fa | 194 | py | Python | zencad/examples/0.Base/helloworld.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/0.Base/helloworld.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/0.Base/helloworld.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from zencad import *
print("HelloWorld!")
a = box(200, 200, 200, center=True)
b = sphere(120)
c = sphere(60)
model = a - b + c
display(model)
show()
| 11.411765 | 35 | 0.634021 |
fa445024306a755614bb20de950c1dfd71bc4c76 | 1,696 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/screed-0.7.1-py2.7.egg/screed/fasta.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/screed-0.7.1-py2.7.egg/screed/fasta.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/screed-0.7.1-py2.7.egg/screed/fasta.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | import DBConstants
from screedRecord import _screed_record_dict, _Writer
FieldTypes = (('name', DBConstants._INDEXED_TEXT_KEY),
('description', DBConstants._STANDARD_TEXT),
('sequence', DBConstants._SLICEABLE_TEXT))
def fasta_iter(handle, parse_description=True, line=None):
"""
Ite... | 33.254902 | 77 | 0.572524 |
d7943b72a17cbde57f590e6e9ea17b07356678e1 | 1,178 | py | Python | tests/plugins/test_metadata.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | tests/plugins/test_metadata.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | tests/plugins/test_metadata.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | # import pytest
# import logging
# from hausse.plugins import Metadata
# LOG = logging.getLogger(__name__)
# def test_metadata_warn_underscore(caplog):
# metadata = {"a": 1}
# new = {"_b": 2}
# m = Metadata(new)
# with caplog.at_level(logging.WARNING):
# m(None, metadata, None)
# ... | 21.035714 | 44 | 0.564516 |
ad405657a39f20199c993dad406e13e392c26128 | 682 | py | Python | leo_markdown/package.py | junefish/kurso-zagreba-metodo | d057192dd28b85710614cdf2425bebd52d04b775 | [
"CC-BY-4.0"
] | 124 | 2016-03-22T16:53:28.000Z | 2022-03-10T15:10:10.000Z | leo_markdown/package.py | junefish/kurso-zagreba-metodo | d057192dd28b85710614cdf2425bebd52d04b775 | [
"CC-BY-4.0"
] | 55 | 2016-02-01T19:47:49.000Z | 2022-02-23T00:00:15.000Z | leo_markdown/package.py | junefish/kurso-zagreba-metodo | d057192dd28b85710614cdf2425bebd52d04b775 | [
"CC-BY-4.0"
] | 55 | 2016-02-16T19:18:49.000Z | 2021-07-04T22:33:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import jinja2, mistune
def kreu_md(enhavo, printendaj):
md = mistune.Markdown()
env = jinja2.Environment()
env.filters['markdown'] = lambda text: jinja2.Markup(md(text))
env.trim_blocks = True
env.lstrip_blocks = True
env.loader=jinja2.FileSystemLoa... | 31 | 118 | 0.684751 |
7e29238b4db675911df64d879438eace370dac08 | 2,152 | py | Python | p01/cifastapi/main.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/cifastapi/main.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/cifastapi/main.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | from typing import Optional
from enum import Enum
from fastapi import FastAPI, Body, HTTPException, status
from pydantic import BaseModel, Field
import time
import producer
import json
from apiClasses import AZ, Datacenter, TShirtSize, OperatingSystem, VMRequest, VMInstance
from apiClasses import Item, GenericTask
fr... | 21.959184 | 89 | 0.650558 |
7e31f044edebae298a115c59f4ae190c07ac6aeb | 14,459 | py | Python | Modell/CSV/diagramm_stille_genauigkeit .py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | Modell/CSV/diagramm_stille_genauigkeit .py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | Modell/CSV/diagramm_stille_genauigkeit .py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
#Input = Sprache
#datenTF
#output sprache
st_spOut = np.array([0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,... | 77.736559 | 1,827 | 0.594301 |
7e33dbacd043b09a7de12f2d7b72da14ea3e10fa | 6,065 | py | Python | test/test_npu/test_atan.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_atan.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_atan.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 36.981707 | 74 | 0.583677 |
7d32044cb6a723ae7f74861da3ef991d2f23adf8 | 18,876 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cnos/cnos_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cnos/cnos_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cnos/cnos_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
# (c) 2017, Ansible by Red Hat, inc
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | 33.94964 | 117 | 0.620206 |
add6dfa1f102f24f571ede5ddfe2467b75bc1083 | 7,462 | pyw | Python | session6/ibox.pyw | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 2 | 2019-10-26T12:47:05.000Z | 2020-07-07T16:36:19.000Z | session6/ibox.pyw | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | null | null | null | session6/ibox.pyw | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 4 | 2020-02-28T13:43:05.000Z | 2020-12-02T10:39:46.000Z | import json
import os
class IdeenBoxModel:
def __init__(self):
self.data = self.load()
def load(self, filename='data.json'):
if not os.path.exists(filename):
json.dump([['new item', "description", ['tags'], 'white', 'more information']], open(filename, 'w'))
return json... | 36.048309 | 112 | 0.626776 |
1dc509f832c6a948fb3926581ff9003dde832ad5 | 6,982 | py | Python | api/dashan_universe/med_regex.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | api/dashan_universe/med_regex.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | api/dashan_universe/med_regex.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | med_regex = [
{
'fid': 'albumin_dose',
'pos': '^albumin human \(PLASBUMIN\)',
'neg': 'injection|flush syringe|nebulizer',
# 'part_of': ['fluids_intake'],
}, {
'fid': 'amoxicillin_dose',
'pos': '^amoxicillin',
'neg': 'gel|vaginal|cream|ophthalmic|ointment|n... | 37.945652 | 179 | 0.562876 |
2a147452a292104d6f7ab4140d3d52ff74de0ab7 | 543 | py | Python | Camera/Pi_Camera.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | Camera/Pi_Camera.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | Camera/Pi_Camera.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | """
Simple Camera (used on Raspberry 3b) Example
https://picamera.readthedocs.io/en/release-1.13/recipes1.html
"""
from time import sleep
from picamera import PiCamera
def take_picture(name):
camera = PiCamera()
camera.resolution = (200, 266)
# setting the camera settings
camera.saturation = 50... | 20.884615 | 65 | 0.685083 |
63310937618898dd715c2f48f5a0f4ef177daf61 | 5,577 | py | Python | examples/text_to_sql/RAT-SQL/text2sql/dataproc/dataloader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_sql/RAT-SQL/text2sql/dataproc/dataloader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_sql/RAT-SQL/text2sql/dataproc/dataloader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 34.214724 | 79 | 0.630446 |
2d96b129e0079e661fb30f3a6b690c95583b40fe | 5,571 | py | Python | src/main/python/atorlib/guiiconvaluebattery.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/atorlib/guiiconvaluebattery.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/atorlib/guiiconvaluebattery.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
sys.path.append('..')
from abc import abstractmethod
import os
import logging
import threading
import time
# GUI
import tkinter as tk
import tkinter.font as tkFont
import tkinter.tix as tix
import cairosvg
import io
from PIL import Image, ImageTk
import tooltip
import atorlib
cl... | 35.711538 | 108 | 0.532041 |
fa9235f9fa57fc3610d38beb1c5f89cef3b22109 | 10,928 | py | Python | src/common/image_processor/mini_batch_loader.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/common/image_processor/mini_batch_loader.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/common/image_processor/mini_batch_loader.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | import os, sys
sys.path.append('./src/common/image_processor')
sys.path.append('./src/common/text_processor')
import chainer
import cv2
from matplotlib import pylab as plt
import numpy as np
np.random.seed(555)
from contextlib import ExitStack
import numbers
from image_normalizer import ImageNormalizer
from tokenizer i... | 36.426667 | 113 | 0.598371 |
faf050ce2c6584d3fcdaaae26997353cbecbed96 | 7,901 | py | Python | Packs/Microsoft365Defender/Integrations/Microsoft365DefenderEventCollector/Microsoft365DefenderEventCollector_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-11-02T05:36:38.000Z | 2021-11-02T05:36:38.000Z | Packs/Microsoft365Defender/Integrations/Microsoft365DefenderEventCollector/Microsoft365DefenderEventCollector_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/Microsoft365Defender/Integrations/Microsoft365DefenderEventCollector/Microsoft365DefenderEventCollector_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import pytest
import re
import demistomock as demisto
import Microsoft365DefenderEventCollector
import datetime
from Microsoft365DefenderEventCollector import DefenderClient, main, MAX_ALERTS_PAGE_SIZE, DemistoException
"""
Test:
1. - Happy Path
1.1 - fetch events first time - ensure dateparser was called with... | 36.077626 | 107 | 0.60524 |
ea8e1652a7691f8e3a439b2cd6694c841afc9833 | 6,890 | py | Python | tests/components/test_preprocessors.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/test_preprocessors.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/test_preprocessors.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | from os import environ, path, remove
from requests import get
from pytest import fixture
from papermill import execute_notebook
from .utils import creates_boston_metadata, creates_iris_metadata, creates_titanic_metadata, \
creates_mock_dataset, creates_eucalyptus_metadata, delete_mock_dataset
from projects.contro... | 36.84492 | 115 | 0.734688 |
576a8bb908d32a087d474bde6f7276c991dcb09a | 7,656 | py | Python | src/server/models.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/models.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/models.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import uuid
from dataclasses import dataclass, field
from datetime import datetime
from sqlalchemy import (
Boolean,
Column,
DateTime,
Float,
Integer,
Sequence,
String,
UniqueConstraint,
)
from sqlalchemy.orm import registry
from sqlalchemy.sql import func
from sqlalchemy.sql.schema impo... | 42.065934 | 149 | 0.689133 |
57b0b0015289a95d045bbff874ef193c4dedcd44 | 1,048 | py | Python | trainers/base_trainer.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | trainers/base_trainer.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | trainers/base_trainer.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | class BaseTrainer:
def __init__(self):
self.work_dir = None
self.log_dir = None
self.env = None
self.agent = None
self.replay_buffer = None
self.optimizer = None
self.tb_logger = None
raise NotImplementedError
def i_iter_dict(self):
"""
... | 23.818182 | 57 | 0.60687 |
17f3c3d9ced56463482a5420aafbc21dc83178f8 | 1,742 | py | Python | misc/deepestdepth.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | misc/deepestdepth.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | misc/deepestdepth.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | """
A recursive function to find the depth of the deepest node of a certain value
in a binary tree, for Ryan.
"""
from typing import Optional, NamedTuple
class TreeNode(NamedTuple): # Integer Binary Tree Node
value: int
left: Optional["TreeNode"]
right: Optional["TreeNode"]
def opt_increment(z: Option... | 24.535211 | 77 | 0.519518 |
76191d4adb9b7bdcec5afa7b2790c9a054d96bea | 9,580 | py | Python | KHM_Friedrichshagen_500x500_delta-x_10m_modflow2005_neu2.py | KWB-R/geosalz.mf | 0393744effd521ee7a90969ba9b2ce04276f7c00 | [
"MIT"
] | null | null | null | KHM_Friedrichshagen_500x500_delta-x_10m_modflow2005_neu2.py | KWB-R/geosalz.mf | 0393744effd521ee7a90969ba9b2ce04276f7c00 | [
"MIT"
] | null | null | null | KHM_Friedrichshagen_500x500_delta-x_10m_modflow2005_neu2.py | KWB-R/geosalz.mf | 0393744effd521ee7a90969ba9b2ce04276f7c00 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import flopy
import flopy.utils.binaryfile as bf
sys.path.append('modules')
from get_layerbudget import get_layerbudget
#sys.path.append(os.path.join("..", "common")) # why is this needed?????
### Download latest Modflow 2005 from
### https://wat... | 28.176471 | 196 | 0.631837 |
2199949f6b9cf0d8a9a7860237a0be77572e26c7 | 517 | py | Python | apps/node/admin.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/node/admin.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/node/admin.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Node, DataUsageRecord
@admin.register(Node)
class NodeAdmin(admin.ModelAdmin):
list_display = ['id', 'node_id', 'name', 'ip']
ordering = ['id']
list_filter = ['id', 'node_id', 'name', 'ip']
@admin.register(DataUsageRecord)
class DataUsageRecordAdmin(... | 28.722222 | 81 | 0.676983 |
df3b2cced55363003da41f378e36c79ef5da8d6b | 1,411 | py | Python | tests/onegov/server/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/server/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/server/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from onegov.server import errors
from onegov.server.application import Application
from onegov.server.collection import ApplicationCollection, CachedApplication
def test_cached_application():
cached = CachedApplication(Application, 'ns')
assert cached.get() is cached.get()
def test_collection... | 26.12963 | 77 | 0.720057 |
df704aad03a7b105ab667a701c208d6ce6630567 | 1,120 | py | Python | api/constants.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | api/constants.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | api/constants.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | # Custom antibiotics per hospital
bmc_jhh_icu_disease_antibiotics = [
{'display_name': 'medication name', 'key': 'xxx' },
]
bmc_jhh_ed_disease_antibiotics = [
{'display_name': 'medication name', 'key': 'xxx' },
]
bmc_jhh_antibiotics = {
'action' : 'antibiotics_order',
'locations': [... | 20.363636 | 83 | 0.520536 |
802297aa47d65791c07593a6a6adee7d2a19a904 | 7,609 | py | Python | zfas.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | 1 | 2019-12-21T02:32:07.000Z | 2019-12-21T02:32:07.000Z | zfas.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | null | null | null | zfas.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
from InputGenerator import InputGenerator
from Reporter import Reporter
from HeuristicLimitOnly import HeuristicLimitOnly
from HeuristicAvgBlock import HeuristicAvgBlock
from HeuristicAvgMetaslab import HeuristicAvgMetaslab
from HeuristicAvgMsBlockLog import HeuristicAvgMsBlockLog
fr... | 42.272222 | 111 | 0.669339 |
d5975cca7efdcf018218c30db117bd7b76895e32 | 2,605 | pyde | Python | sketches/demokratiespiel/demokratiespiel.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/demokratiespiel/demokratiespiel.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/demokratiespiel/demokratiespiel.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | import random as r
rep = 0
dem = 1
nReps = nDems = 0
nCols = nRows = 20
w = h = 34
def setup():
global grid, reps, dems, nReps, nDems
size(680, 680)
reps = loadImage("rep.png")
dems = loadImage("dem.png")
grid = []
for x in xrange(nRows):
grid.append([])
for y in xrange(nCols)... | 29.602273 | 107 | 0.540115 |
6373abaf55764f703bdefe5b01df90a0312a3127 | 93 | py | Python | usc-20211-ee-109-31019/lab4/uwu.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | usc-20211-ee-109-31019/lab4/uwu.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | usc-20211-ee-109-31019/lab4/uwu.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | def uwu(s: str) -> str:
return "{{{}}}".format(", ".join(map(lambda c: str(ord(c)), s)))
| 31 | 68 | 0.505376 |
89b0a9ea5eb6a60705b79070405401d1ed4d3fa4 | 5,280 | py | Python | session7/sqlite_demo.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 2 | 2019-10-26T12:47:05.000Z | 2020-07-07T16:36:19.000Z | session7/sqlite_demo.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | null | null | null | session7/sqlite_demo.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 4 | 2020-02-28T13:43:05.000Z | 2020-12-02T10:39:46.000Z |
import sqlite3
from pprint import pprint
def createCustomer(cur):
sql_stmt = """
CREATE TABLE CUSTOMER (
ID INTEGER PRIMARY KEY,
NAME TEXT,
STREET TEXT,
POSTCODE TEXT,
CITY TEXT,
COUNTRY TEXT);"""
try:
cur.execute(sql_stmt)
... | 38.823529 | 226 | 0.595833 |
98226e7548b382336725d011022692587382767c | 5,718 | py | Python | src/nfz_module/processor/CameraDataProcessor.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/processor/CameraDataProcessor.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/processor/CameraDataProcessor.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | __author__ = 'Hans-Werner Roitzsch'
from datetime import datetime
import sched
import cv2 as opencv
import numpy as np
from config import *
from processor.SensorDataProcessor import SensorDataProcessor
from model.ProcessedCameraData import ProcessedCameraData
from writer.ImageFileWriter import ImageFileWriter
cl... | 36.653846 | 143 | 0.721406 |
9890150106764678f1afbb90698394912bcaed35 | 198 | py | Python | Python/Strings/string_validators.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/string_validators.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/string_validators.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | str = input()
print(any(c.isalnum() for c in str))
print(any(c.isalpha() for c in str))
print(any(c.isdigit() for c in str))
print(any(c.islower() for c in str))
print(any(c.isupper() for c in str)) | 33 | 36 | 0.671717 |
7f9a7a946176e499222f453451f8876d539e5d44 | 462 | py | Python | frontend/infra/provision/cloudfront.py | jim-hill-r/BlueSteel | fa3ac479096679146b99bf5b12792fad25d9d0f1 | [
"MIT"
] | 2 | 2020-04-03T12:19:00.000Z | 2020-04-03T13:32:11.000Z | frontend/infra/provision/cloudfront.py | jim-hill-r/BlueSteel | fa3ac479096679146b99bf5b12792fad25d9d0f1 | [
"MIT"
] | 25 | 2020-04-23T23:17:20.000Z | 2020-05-29T21:00:44.000Z | frontend/infra/provision/cloudfront.py | jim-hill-r/BlueSteel | fa3ac479096679146b99bf5b12792fad25d9d0f1 | [
"MIT"
] | null | null | null | import json
try:
import boto3
except ImportError:
print(f'Error: boto3 is required. Please install.')
print(f'Try: pip install boto3')
def provision(name,region):
cloudfront = boto3.client('cloudfront',region_name=region)
print ('Creating cloudfront...')
#TODO: Automate this by comparing what wo... | 27.176471 | 83 | 0.718615 |
f6c4efd79821a97466a248840866bf5d7d0d4f2c | 447 | py | Python | Python/Exercícios_Python/006_dobro,_triplo_e_raiz_quadrada.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/006_dobro,_triplo_e_raiz_quadrada.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/006_dobro,_triplo_e_raiz_quadrada.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""006 - Dobro, Triplo e Raiz Quadrada
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1f3iXHfpvvq9sJyIzYdTE84YAkztcGzyW
"""
n = int(input('Digite um número: '))
d = n * 2
t = n * 3
r = float(n ** (1 / 2))
print('O dobro de {} v... | 27.9375 | 77 | 0.639821 |
f6d9b526090d124d5d33a61a742c1b2da7f01739 | 882 | py | Python | Algorithms/Strings/Sherlock.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Strings/Sherlock.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Strings/Sherlock.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
#T = int(raw_input())
T = 1
for _ in xrange(T):
#s = raw_input()
s = 'ifailuhkqqhucpoltgtyovarjsnrbfpvmupwjjjfiwwhrlkpekxxnebfrwibylcvkfealgonjkzwlyfhhkefuvgndgdnbelgruel'
length = len(s)
count = 0
for i in xrange(length):
dic = {}
for j in xrange(le... | 23.210526 | 111 | 0.495465 |
89edc8b7b3301e808b9d0c4c2c7ff2a7d23110f2 | 1,006 | py | Python | Curso_Python/Exercicio_banco/opcoes.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Exercicio_banco/opcoes.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Exercicio_banco/opcoes.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from utilidades import *
from dados.dados import Cliente, Dados
lista_clientes = list()
def func_opcoes(op=0):
if op == 1:
while True:
nome = input('Nome: ').upper()
idade = input('Idade: ')
profissao = input('Profissão: ').upper()
add = Cliente(nome, idade... | 27.944444 | 56 | 0.55666 |
f64fbec1acca08553044f46e1bcaac6047bfabf5 | 927 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/71a1/applications/word_count/test_word_count.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71a1/applications/word_count/test_word_count.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71a1/applications/word_count/test_word_count.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import unittest
from word_count import word_count
class TestWordCount(unittest.TestCase):
def test_word_count(self):
x = word_count("")
self.assertTrue(x == {})
x = word_count("Hello hello.")
self.assertTrue(x == {"hello": 2})
x = word_count('Hello, my cat. And my c... | 31.965517 | 145 | 0.533981 |
14b3020e46e4abee09280cc8d9d70eb77eb0cbaa | 1,148 | py | Python | scripts/initialise_new_semester.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | scripts/initialise_new_semester.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | scripts/initialise_new_semester.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | #!/usr/bin/env python3
import os
import logging
from configparser import ConfigParser
logger = logging.getLogger(__name__)
configParser = ConfigParser()
configParser.read('config.ini')
def generate_semester_directory_structure(semester, basepath):
semester_directory = os.path.join(basepath, semester)
if not ... | 27.333333 | 76 | 0.736934 |
21380bde07c9cb2b4ae1bc201c63ac511d11e8fb | 1,790 | py | Python | src/pepper_ddpg_model_evaluator.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | src/pepper_ddpg_model_evaluator.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | src/pepper_ddpg_model_evaluator.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Run with newer tensorflow version.
import json
import keras
from keras import Sequential
from keras.layers import Dense, BatchNormalization
import numpy
from Settings import *
seed = 7
numpy.random.seed(seed)
# Get Trainingsdata
dataset = numpy.loadtxt("training_set.csv", delimiter=",")
X =... | 33.773585 | 108 | 0.701117 |
3703b2e4691ad0ed95f5e56576b7b7187a6d0496 | 816 | py | Python | Source/04_Pop/app.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | 1 | 2022-02-28T09:49:35.000Z | 2022-02-28T09:49:35.000Z | Source/04_Pop/app.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | null | null | null | Source/04_Pop/app.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | null | null | null | """
POP3: Post Office Protocol Version3
"""
import poplib
import json
import os
from pathlib import Path
os.chdir(Path(__file__).parent)
# Read Credentials from JSON File
with open("./email.json", mode = "r", encoding= "UTF-8") as f:
json_text = f.read()
json_dict = json.loads(json_text)
# Define Cre... | 16.653061 | 70 | 0.660539 |
2ea715cae46aefabb0e604c12fd6e3b58024e561 | 184 | py | Python | Euler-2.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | Euler-2.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | Euler-2.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def fibbonaci_soda(n):
vsota = 0
x1 = 1
x2 = 2
while x1 <= n:
if x1 % 2 == 0:
vsota += x1
x1, x2 = x2, x1 + x2
return vsota
print(fibbonaci_soda(4000000)) | 16.727273 | 30 | 0.532609 |
6cb5382de73fcd3721c9090fd251a425c948bb65 | 2,026 | py | Python | 006-C102-TaskAutomation/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 006-C102-TaskAutomation/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 006-C102-TaskAutomation/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # TaskAutomation
# This is a python script made by @somePythonProgrammer
# for a WhiteHat Junior project.
# imports
import os
import shutil
import tqdm
from datetime import datetime
import time
# This function lists all directories
# and subdirectories in a list.
def list_dirs(path):
dirs_ = []
for dirpath,... | 31.169231 | 90 | 0.647088 |
4ce82509a65238e2609a058024cc6cbab47e4f7e | 562 | py | Python | source/pkgsrc/mail/thunderbird52/patches/patch-mozilla_gfx_skia_generate__mozbuild.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/mail/thunderbird52/patches/patch-mozilla_gfx_skia_generate__mozbuild.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/mail/thunderbird52/patches/patch-mozilla_gfx_skia_generate__mozbuild.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-mozilla_gfx_skia_generate__mozbuild.py,v 1.1 2018/12/16 08:29:48 ryoon Exp $
--- mozilla/gfx/skia/generate_mozbuild.py.orig 2017-04-14 04:53:08.000000000 +0000
+++ mozilla/gfx/skia/generate_mozbuild.py
@@ -140,6 +140,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
'-Wno-unused-private-field',
... | 37.466667 | 91 | 0.697509 |
981d65024cd9e9cafdf991041b156695cd06c09d | 3,782 | py | Python | tools/legacy/veh-parser/weaponInfo.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/legacy/veh-parser/weaponInfo.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/legacy/veh-parser/weaponInfo.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | import parseFiles
from functools import partial
def createExecContext():
sfxStrings = parseFiles.parseStringsFromFile("sfx.strings.cs")
result = {
"weapons": [],
"currentWeapon": {},
"A": "all",
"H": "human",
"C": "cybrid",
"X": "xl",
"x": "xl",
"... | 34.697248 | 120 | 0.633263 |
b3941bb48186343b54e3d5958ec947b8d1565162 | 4,285 | py | Python | Session01_MLOPs_Introduction_and_Version_Control/train1.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session01_MLOPs_Introduction_and_Version_Control/train1.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session01_MLOPs_Introduction_and_Version_Control/train1.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import torch.nn.functional as F
import torchvision
from torchvision import models, transforms
import pytorch_lightning as pl
from pytorch_lightning import Trainer
from pytorch_lightning... | 35.413223 | 106 | 0.636173 |
b3e734a06c47b11b386a9b9ab21caaee86b22354 | 2,241 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/doc_fragments/aireos.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/plugins/doc_fragments/aireos.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/plugins/doc_fragments/aireos.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, James Mighion <@jmighion>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
provider:
description:
- A ... | 40.017857 | 116 | 0.655957 |
80648f56210817926d1444b1840bfff1a52cf099 | 12,282 | py | Python | src/universal_build/helpers/build_python.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 17 | 2020-11-20T15:58:02.000Z | 2022-02-06T19:18:20.000Z | src/universal_build/helpers/build_python.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 3 | 2021-02-17T13:47:44.000Z | 2021-10-14T13:53:15.000Z | src/universal_build/helpers/build_python.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 6 | 2020-11-23T09:51:26.000Z | 2022-02-11T13:46:57.000Z | """Utilities to help building Python libraries."""
import argparse
import os
import re
import sys
from shutil import rmtree
from typing import List, Optional
from universal_build import build_utils
FLAG_PYPI_TOKEN = "pypi_token"
FLAG_PYPI_REPOSITORY = "pypi_repository"
def parse_arguments(
input_args: List[str... | 31.492308 | 205 | 0.632389 |
03b3250a51fe4ef664132b506f2205adbf47d970 | 448 | py | Python | DataStructures/Tree/LCA.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/LCA.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/LCA.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def lca(root, v1, v2):
while 1:
if v1 < root.data and v2 < root.data:
root = root.left
elif v1 > root.data and v2 > root.data:
root = root.right
else:
return root
def lca_recu(root, v1, v2):
if root.data < v1 and root.data < v2:
... | 24.888889 | 47 | 0.542411 |
03cfcd2e83bc51cf14e0679f0b9371bb7b2773f9 | 3,326 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/01_grundlagen_dictionaries.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/01_grundlagen_dictionaries.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/01_grundlagen_dictionaries.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 01_grundlagen_dictionaries.py
# Project: Kapitel_08_Dictionaries
# Created Date: Thursday 07.03.2019, 11:46
# Author: Apop85
# -----
# Last Modified: Thursday 07.03.2019, 12:22
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MIT licens... | 63.961538 | 329 | 0.752556 |
b324b4eec5679769068465d1ea4f94b7f28eeec5 | 610 | py | Python | Backend/views/health.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/views/health.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/views/health.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | import logging
from flask import Blueprint, jsonify
from db import db
routes = Blueprint('health', __name__, url_prefix='/health')
@routes.route('')
def healthcheck():
is_database_working = True
output = 'database is ok'
try:
# to check database we will execute raw query
db.engine.exec... | 25.416667 | 86 | 0.690164 |
4432a8fbd993c5a31c13491be9911f6975f3b5bc | 3,931 | py | Python | doc/precursers/2019_09-Sneakernet/Sneakernet/export-to.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | doc/precursers/2019_09-Sneakernet/Sneakernet/export-to.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | doc/precursers/2019_09-Sneakernet/Sneakernet/export-to.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | #!/usr/bin/env python3
# Sneakernet/export-to.py
"""
given: dir
check if export dir exists
have_db = {}
have_max = {}
for each file in dir:
for each block:
feed,seq,transfer <- block
have_db[feed] = {} if not already existing
# have_db[feed]['file'] = dir+file
have_db[feed][seq... | 28.280576 | 88 | 0.501399 |
929b1b2246da2ae54308aa85a03ddda4fba14bf6 | 4,164 | py | Python | hisim/postprocessing/report.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 12 | 2021-10-05T11:38:24.000Z | 2022-03-25T09:56:08.000Z | hisim/postprocessing/report.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 6 | 2021-10-06T13:27:55.000Z | 2022-03-10T12:55:15.000Z | hisim/postprocessing/report.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 4 | 2022-02-21T19:00:50.000Z | 2022-03-22T11:01:38.000Z | from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.platypus import Table
import copy
impo... | 35.896552 | 99 | 0.573967 |
92b9d12440de81bc8e0cb684f333142593c35e86 | 2,126 | py | Python | SBTK_League_Helper/user_interfaces/__DEPRECATED/console_ui/mock_widgets/display_elements.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/user_interfaces/__DEPRECATED/console_ui/mock_widgets/display_elements.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/user_interfaces/__DEPRECATED/console_ui/mock_widgets/display_elements.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from .drawing import BoxDrawingOperations, BufferedMatrix_CP850
class ConsoleDisplayObject(object):
def __init__(self, parent):
self.parent = parent
if parent is not None:
parent.add_child(self)
self.__callback = lambda slf , evnt: None
self.__trigger_fun = lambda evnt:... | 28.346667 | 110 | 0.606773 |
9206efab7bc271b4ae776d54f6a485f816f50505 | 100 | py | Python | src/db/db_interface.py | MBogert/ReminderCory | a687c70a12f49a807d9fb023d45f799292a37f26 | [
"MIT"
] | null | null | null | src/db/db_interface.py | MBogert/ReminderCory | a687c70a12f49a807d9fb023d45f799292a37f26 | [
"MIT"
] | null | null | null | src/db/db_interface.py | MBogert/ReminderCory | a687c70a12f49a807d9fb023d45f799292a37f26 | [
"MIT"
] | null | null | null |
class DbInterface:
def __init__(self):
self.db
def insert():
def select():
def delete():
| 8.333333 | 20 | 0.64 |
a6db723050f2163ce646f6f85e44f0d4fcea83b3 | 315 | py | Python | src/visitpy/examples/simple.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/examples/simple.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/examples/simple.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# Test script that creates a plot
#
# Modifications:
#
# ----------------------------------------------------------------------------
OpenDatabase("localhost:/usr/gapps/visit/data/globe.silo")
AddPlot("Pseudocolor", "u")
DrawPlots()
| 28.636364 | 78 | 0.361905 |
753401d7019b8c0eb798050e18b31a652ddc55be | 1,684 | py | Python | fastapi_boilerplate/main.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 14 | 2021-03-27T22:18:56.000Z | 2022-03-21T19:04:48.000Z | fastapi_boilerplate/main.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 33 | 2021-03-28T21:06:22.000Z | 2022-03-07T14:18:26.000Z | fastapi_boilerplate/main.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | null | null | null | import typer
from cookiecutter.exceptions import OutputDirExistsException
from cookiecutter.main import cookiecutter
from typer import Option, Typer
from fastapi_boilerplate import __version__
from fastapi_boilerplate.constants import Packaging, RunServer, YesOrNo
app = Typer()
def version_callback(value: bool):
... | 29.034483 | 87 | 0.631235 |
f36ea22981b1d6fa777c01767c8460ff0583ae26 | 759 | py | Python | Algorithms/Strings/TwoCharacters.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Strings/TwoCharacters.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Strings/TwoCharacters.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
N = int(raw_input())
string = raw_input()
prev = None
chr_set = set()
del_set = set()
for char in string:
if char != prev and char not in del_set:
chr_set.add(char)
elif char == prev and char in chr_set:
chr_set.remove(char)
del_set.add(char)
prev = char
def get_t_le... | 19.973684 | 50 | 0.588933 |
3414d7b981369e69e8c6dde1ea792f75d3c2bb7d | 603 | py | Python | Backend/mfund.py | ganges10/FinAdBackend | a54f0a3e091971e950655b5f581c5934824bcaf4 | [
"MIT"
] | null | null | null | Backend/mfund.py | ganges10/FinAdBackend | a54f0a3e091971e950655b5f581c5934824bcaf4 | [
"MIT"
] | null | null | null | Backend/mfund.py | ganges10/FinAdBackend | a54f0a3e091971e950655b5f581c5934824bcaf4 | [
"MIT"
] | null | null | null | from mftool import Mftool
import pandas as pd
obj= Mftool()
symbol = ['120828','119598','125497','118758','118759','135808','135811','119277','118564','120069','100967','119133','123654','147587','147591','145819','147481','138311','147704']
#print(symbol)
scheme_name=[]
nav=[]
for key in symbol:
data = obj.get_sc... | 28.714286 | 181 | 0.699834 |
048e6d9509ab88ce719dad829e516db349783e48 | 1,245 | py | Python | ladon-server/software/src/python/ripening-classifier/RipeningClassifier.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | 1 | 2018-04-29T22:33:42.000Z | 2018-04-29T22:33:42.000Z | ladon-server/software/src/python/ripening-classifier/RipeningClassifier.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | ladon-server/software/src/python/ripening-classifier/RipeningClassifier.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | ## IMPORTS ##
import json # Json: is a lightweight data interchange format inspired by JavaScript object literal syntax
import sys # Sys: system-specific parameters and functions
import numpy as np # NumPy: the fundamental package for scientific computing with Python
import pandas as pd # Pandas: easy... | 31.923077 | 110 | 0.737349 |
f3d645c223ca6a30d7e19414c7d2fcc968146936 | 251 | py | Python | baseline.py | StanislavVolodarskiy/trie | fd3c462a0338f9cfdca45d7ddeb6647a9b6b5a57 | [
"MIT"
] | null | null | null | baseline.py | StanislavVolodarskiy/trie | fd3c462a0338f9cfdca45d7ddeb6647a9b6b5a57 | [
"MIT"
] | null | null | null | baseline.py | StanislavVolodarskiy/trie | fd3c462a0338f9cfdca45d7ddeb6647a9b6b5a57 | [
"MIT"
] | null | null | null | with open('patterns.txt') as f:
patterns = tuple(line.replace('\n','') for line in f)
with open('corpus.txt') as f:
for line in f:
for p in patterns:
if p in line:
print(line, end='')
break
| 25.1 | 57 | 0.505976 |
6d5deb92ebec0699fa6fa2754aa01a38aa23521e | 183 | py | Python | Persistence/__init__.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | Persistence/__init__.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | Persistence/__init__.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | """This module contains all functions that make the bot remember things"""
from .gitdescribe import notify_new_version, store_version
from .since import store_since_id, get_since_id
| 36.6 | 74 | 0.825137 |
fcd7a8c4db864137267cb57ce89ec0388f9df2e5 | 8,109 | py | Python | src/arg_parser/arg_parser.py | kkaruso/niv | 67ba82c93279db4dae503d4dceec7ba5e9931c0a | [
"MIT"
] | null | null | null | src/arg_parser/arg_parser.py | kkaruso/niv | 67ba82c93279db4dae503d4dceec7ba5e9931c0a | [
"MIT"
] | null | null | null | src/arg_parser/arg_parser.py | kkaruso/niv | 67ba82c93279db4dae503d4dceec7ba5e9931c0a | [
"MIT"
] | null | null | null | """
Parser class for Arguments when you start NIV
"""
import argparse
import os
import pkg_resources
from src import pathname_validitor as pv
from src.niv_logger.niv_logger import NivLogger
from src.yaml_parser import yaml_parser
class ArgParser:
"""
A class for parsing the console arguments
Methods
... | 36.692308 | 117 | 0.571957 |
1e7ea885577ee3a11ce95224dc58cef0ce06296d | 2,934 | py | Python | repo/plugin.video.zappntv/favorite.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/plugin.video.zappntv/favorite.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/plugin.video.zappntv/favorite.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | # -*- coding: utf-8 -*-
import logging
import json
import sys
import xbmcaddon
import xbmcvfs
import xbmc
from resources.lib import kodiutils
from resources.lib import kodilogging
try:
from urllib.parse import quote, unquote, quote_plus, unquote_plus
except ImportError:
from urllib import quote, unquote, qu... | 31.548387 | 105 | 0.637696 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.