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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4ba2324b30799bf1b627b25c99c498dc786813a6 | 1,950 | py | Python | utils/model_scaffolding/example/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | utils/model_scaffolding/example/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | utils/model_scaffolding/example/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.792453 | 96 | 0.705128 |
29bc17c74b614da677e4e2083c866bb872cd8287 | 628 | py | Python | migrations/versions/33453c1aaf10_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | migrations/versions/33453c1aaf10_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | migrations/versions/33453c1aaf10_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 33453c1aaf10
Revises: 9db14947d300
Create Date: 2022-04-27 20:48:46.801510
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "33453c1aaf10"
down_revision = "9db14947d300"
branch_lab... | 19.625 | 84 | 0.719745 |
d9a3d97d8e18d94058c06b4d2203090a0c0addae | 311 | py | Python | methods/transformers/examples/movement-pruning/emmental/__init__.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/examples/movement-pruning/emmental/__init__.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/examples/movement-pruning/emmental/__init__.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | # flake8: noqa
from .configuration_bert_masked import MaskedBertConfig
from .modeling_bert_masked import (
MaskedBertForMultipleChoice,
MaskedBertForQuestionAnswering,
MaskedBertForSequenceClassification,
MaskedBertForTokenClassification,
MaskedBertModel,
)
from .modules import *
| 28.272727 | 56 | 0.794212 |
8aafd4e8a5c72e7014dd30573dd7951e4030e191 | 3,225 | py | Python | xiaobu/robot/drivers/pixels.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | 1 | 2020-07-16T02:52:47.000Z | 2020-07-16T02:52:47.000Z | xiaobu/robot/drivers/pixels.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | xiaobu/robot/drivers/pixels.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | from . import apa102
import time
import threading
try:
import queue as Queue
except ImportError:
import Queue as Queue
class Pixels:
PIXELS_N = 3
def __init__(self):
self.basis = [0] * 3 * self.PIXELS_N
self.basis[0] = 1
self.basis[4] = 1
self.basis[8] = 2
sel... | 22.395833 | 95 | 0.493953 |
76e1a1da8f19650216887a4f0f75e9ef10bb8c06 | 656 | py | Python | python/generator_tricks_for_systemprogrammer/broadcast.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/broadcast.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/broadcast.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # broadcast.py
#
# Broadcast a generator source to a collection of consumers
def broadcast(source, consumers):
for item in source:
for c in consumers:
c.send(item)
class Consumer(object):
def __init__(self, name):
self.name = name
def send(self, item):
... | 19.878788 | 60 | 0.577744 |
0a06cafbffa99bac4d5bd641a0b9822f31abc966 | 359 | py | Python | nlp2go/cli.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 25 | 2020-02-20T14:25:58.000Z | 2022-01-05T03:32:37.000Z | nlp2go/cli.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 3 | 2020-10-21T15:03:39.000Z | 2020-10-21T15:03:48.000Z | nlp2go/cli.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 1 | 2020-09-15T15:22:49.000Z | 2020-09-15T15:22:49.000Z | import json
from nlp2go.util import NumpyEncoder
class Cli:
def start(self, models):
while True:
for path, model in models.items():
model.enable_panel = True
result_dict = model.predict()
print(json.dumps(result_dict, ensure_ascii=False, cls=Nu... | 25.642857 | 110 | 0.62117 |
0a1fc815a770761c581089327ebf95205bd5dbe9 | 1,601 | py | Python | research/cv/SRGAN/src/loss/Meanshift.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/SRGAN/src/loss/Meanshift.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/SRGAN/src/loss/Meanshift.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... | 40.025 | 110 | 0.650843 |
0a72c176d1453a1194843b68d07c6910ffcd0b14 | 663 | py | Python | api/api_server.py | krveronika/job-finder | fcb9f5124d809145c0e6749b077abf0c69128c63 | [
"MIT"
] | null | null | null | api/api_server.py | krveronika/job-finder | fcb9f5124d809145c0e6749b077abf0c69128c63 | [
"MIT"
] | null | null | null | api/api_server.py | krveronika/job-finder | fcb9f5124d809145c0e6749b077abf0c69128c63 | [
"MIT"
] | null | null | null | import os
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, PicklePersistence, CallbackQueryHandler
ACCESS_TOKEN = os.environ['JOB_FINDER_TOKEN']
def start(update, context):
return "Hello"
def reply(update, context):
return "not implemented yet"
def main():
pass
if __name__... | 24.555556 | 114 | 0.749623 |
7c265e7ccd69820604bdfb07b916232cbaae2b39 | 2,104 | py | Python | languages/python/exercises/concept/strings/loglines_test.py | imanc/v3 | dac09fd6e9b917dc7b5ac5ab9bfadb842049aee7 | [
"MIT"
] | 1 | 2020-02-15T08:03:01.000Z | 2020-02-15T08:03:01.000Z | languages/python/exercises/concept/strings/loglines_test.py | imanc/v3 | dac09fd6e9b917dc7b5ac5ab9bfadb842049aee7 | [
"MIT"
] | null | null | null | languages/python/exercises/concept/strings/loglines_test.py | imanc/v3 | dac09fd6e9b917dc7b5ac5ab9bfadb842049aee7 | [
"MIT"
] | null | null | null | import unittest
from loglines import extract_message, change_log_level, reformat
class TestLogLines(unittest.TestCase):
def test_message(self):
self.assertEqual(
extract_message("[INFO] Hello there."),
"Hello there.",
msg="Should correctly extract a basic message.",
... | 38.962963 | 141 | 0.631179 |
867947fad5955c31dddaacd327087190158a883f | 3,707 | py | Python | examples/dialogue/plato-2/readers/plato_reader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/dialogue/plato-2/readers/plato_reader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/dialogue/plato-2/readers/plato_reader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 41.188889 | 80 | 0.627192 |
867f3ca949e889b9802891bd66f4849d2be239fe | 94 | py | Python | python/python_backup/PRAC_PYTHON/hht.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/hht.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/hht.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | n=input("enter number")
for i in range(1,n,1):
for j in range(1,i,1):
print "x",
print | 18.8 | 24 | 0.595745 |
86d5b9d916411470dff77f7452ec2c81876fb12d | 420 | py | Python | code/sensors/ultrasonic/ultrasonic_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/ultrasonic/ultrasonic_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/ultrasonic/ultrasonic_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | from sensors.ultrasonic import ultrasonic
from sensors import pipeline
def get_distance_pipeline(us):
return pipeline.PipelineSequence(
pipeline.ConstantPipeline(us),
("us_distance", ultrasonic.USGetDistancePipeline())
)
def get_movement_pipeline(us):
return pipeline.PipelineSequence(
... | 26.25 | 59 | 0.733333 |
81211a8781698825de3819072f5a5c044a046dd1 | 661 | py | Python | python/coursera_python/MICHIGAN/WEB/test/email.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/WEB/test/email.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/WEB/test/email.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import re
x = "From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008"
y = re.findall('\S+@\S+',x)
# Here \S+ means one or more non-blank characters
print(y)
# To extract only which is in the bracket
y = re.findall('From (\S+@\S+)',x)
print(y)
# Dual split pattern
words = x.split() # Split the whole thing into word... | 14.369565 | 61 | 0.626324 |
07d33c48947b4a21163e17aedd7de8676afe8c54 | 7,575 | py | Python | suds/umx/core.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | suds/umx/core.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | suds/umx/core.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | 35.069444 | 90 | 0.592079 |
ed38515fa86162772dc2907a1f8a7291a3d60163 | 276 | py | Python | transonic/analyses/test_util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/analyses/test_util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/analyses/test_util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic.analyses.extast import parse
from transonic.analyses.util import print_dumped, print_unparsed
source = "def func(): return True"
def test_print_dumped():
print_dumped(source)
def test_print_unparsed():
node = parse(source)
print_unparsed(node)
| 19.714286 | 64 | 0.764493 |
ed53dc4d089011dc5588b3f3425948f8b98c061e | 1,829 | py | Python | Python-BlueEdTech-main/projeto-poo/pessoa.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | 3 | 2021-05-30T20:01:06.000Z | 2021-07-07T00:46:37.000Z | Python-BlueEdTech-main/projeto-poo/pessoa.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | Python-BlueEdTech-main/projeto-poo/pessoa.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | class Pessoa:
def __init__(self, nome):
self.nome = nome
self.dinheiro = 100
self.estressado = 0
self.saude = True
self.contador_academia = 3
self.fome = True
self.sujo = True
def salario(self, recebido):
if (recebido > 0):
self.dinhei... | 28.138462 | 79 | 0.531438 |
ed85266b5eecb6e5c9d9f060af0a64699f4e1857 | 2,481 | py | Python | toilet/train.py | kazunori279/ml-misc | 6cf25dd44522cd49e6a1c3edff38f7dfc70cba33 | [
"Apache-2.0"
] | 31 | 2017-08-30T23:27:33.000Z | 2022-01-18T19:37:40.000Z | toilet/train.py | kazunori279/ml-misc | 6cf25dd44522cd49e6a1c3edff38f7dfc70cba33 | [
"Apache-2.0"
] | null | null | null | toilet/train.py | kazunori279/ml-misc | 6cf25dd44522cd49e6a1c3edff38f7dfc70cba33 | [
"Apache-2.0"
] | 15 | 2017-10-16T01:15:44.000Z | 2021-12-24T03:36:11.000Z | #
# train.py
#
# uses VGG16 and an additional FC layer for finetune the model.
# based on saulthu's comment on:
# https://gist.github.com/fchollet/7eb39b44eb9e16e59632d25fb3119975
#
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models im... | 28.517241 | 96 | 0.762596 |
71e9b68e6ad1bbfc3baf2d95d65ac8be7dafd8bc | 12,174 | py | Python | storage/emulated/0/qpython/lib/python3.2/site-packages/aip/ocr.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/lib/python3.2/site-packages/aip/ocr.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/lib/python3.2/site-packages/aip/ocr.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
图像识别
"""
import re
import sys
import math
import time
from .base import AipBase
from .base import base64
from .base import json
from .base import urlencode
from .base import quote
class AipOcr(AipBase):
"""
图像识别
"""
__generalBasicUrl = 'https://ai... | 24.946721 | 102 | 0.537703 |
9c2aa2d365470a430f82e2370929debc4bb5d370 | 2,924 | py | Python | scrapers/scrape_gr.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 485 | 2020-03-10T20:10:44.000Z | 2022-03-27T16:11:30.000Z | scrapers/scrape_gr.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 682 | 2020-03-17T09:55:12.000Z | 2022-03-28T15:16:24.000Z | scrapers/scrape_gr.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 224 | 2020-03-09T11:42:13.000Z | 2022-03-22T13:16:33.000Z | #!/usr/bin/env python3
import datetime
import scrape_common as sc
json_url = 'https://services1.arcgis.com/YAuo6vcW85VPu7OE/arcgis/rest/services/Fallzahlen_Total_Kanton/FeatureServer/0/query?where=1%3D1&objectIds=&time=&resultType=none&outFields=*&returnHiddenFields=false&returnIdsOnly=false&returnUniqueIdsOnly=false... | 36.098765 | 458 | 0.662107 |
1339d6effa3a8b2a1092e11cb533b74721e8b9b1 | 1,475 | py | Python | Packs/CommonScripts/Scripts/RegexExtractAll/RegexExtractAll.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/RegexExtractAll/RegexExtractAll.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/RegexExtractAll/RegexExtractAll.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
import regex
from CommonServerPython import * # noqa: F401
def main():
match_target = demisto.args()['value']
re_flags = regex.V1
error_if_no_match = False
unpack_matches = False
try:
if demisto.args()['multi_line'].lower() == 'true':
... | 26.339286 | 90 | 0.577627 |
6a2dd12c223203f6eaa61b8515e7fbb29710b0c3 | 6,941 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/avi/avi_sslkeyandcertificate.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/avi/avi_sslkeyandcertificate.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/avi/avi_sslkeyandcertificate.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | 35.055556 | 125 | 0.628152 |
161d06234db9c5039e61fc07001044c341e420b2 | 2,074 | py | Python | Beginner/03. Python/SalsShipping.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-04T05:41:43.000Z | 2021-10-04T05:41:43.000Z | Beginner/03. Python/SalsShipping.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/SalsShipping.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | """
Sal runs the biggest shipping company in the tri-county area, Sal’s Shippers.
Sal wants to make sure that every single one of his customers has the best, and most affordable experience shipping their packages.
In this project, you’ll build a program that will take the weight of a package and determine the cheapest... | 31.907692 | 131 | 0.753616 |
165b68b0b0de2bf71bb6d901439965c6972ed0c1 | 2,447 | py | Python | project/api/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/resources.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from functools import wraps
from authlib.oauth2 import OAuth2Error
from authlib.oauth2.rfc6749 import MissingAuthorizationError
from flask import request
from flask_apispec import marshal_with
from flask_apispec.views import MethodResource
from flask_security import current_user
from project import db
from project.ap... | 32.197368 | 86 | 0.652636 |
16634bede3060645f1bfc5e6200c6e09ef702772 | 3,107 | py | Python | test/test_npu/test_network_ops/test_embedding.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_embedding.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_embedding.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... | 46.373134 | 83 | 0.587061 |
4c6056c2b28e71f8ca3802f227a494e65066ba5b | 237 | py | Python | dataset/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | dataset/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | dataset/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 数据集加载的设置文件
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/31
"""
import sys
import os
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(abs_path)
class ConfigData:
def __init__(self):
self. | 18.230769 | 53 | 0.708861 |
9141bce1bbc8f94df421f7dfe45eae72ebce3646 | 606 | py | Python | Python/Exercícios_Python/028_jogo_da_adivinhação.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/028_jogo_da_adivinhação.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/028_jogo_da_adivinhação.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""028 - Jogo da Adivinhação
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/16IAdDsRFtnb5s5HOqbOFuFwn6psmkjTj
"""
from random import choice
print('-=-'* 19)
print('Vou pensar em um número entre 0 e 5. Tente Adivinhar...')
print... | 27.545455 | 77 | 0.684818 |
b909716269b0009903405d74d0edc63eadc4a1e7 | 334 | py | Python | tests/etl/epic2op/alert_server.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | tests/etl/epic2op/alert_server.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | tests/etl/epic2op/alert_server.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import asyncio, logging
from etl.alerts.server import AlertServer
alert_dns = '127.0.0.1'
predictor_dns = '0.0.0.0'
alert_server_port = 31000
predictor_ports = [8181, 8182]
def main():
# Create alert server class
loop = asyncio.get_event_loop()
server = AlertServer(loop)
server.start()
if __name__ == '__main... | 19.647059 | 41 | 0.721557 |
53df1419f2af8a083a81c71847eee68545b727eb | 840 | py | Python | src/Themes/SizeTheme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/Themes/SizeTheme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/Themes/SizeTheme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | from .Theme import Theme
from src.Graph import Graph
class SizeTheme(Theme):
def __init__(self):
super().__init__()
self.node_sizes = []
self.max = 0
self.min = 0
def prepare(self, graph, shapes):
node_sizes = []
for shape in shapes:
size = shape.s... | 28 | 68 | 0.571429 |
07050fcd95623550b5cd0dd9f61f7d6c1913c090 | 1,461 | py | Python | model/critic.py | isadrtdinov/StarGAN | bdb33310817854802ebc6356b28303616f23060a | [
"MIT"
] | null | null | null | model/critic.py | isadrtdinov/StarGAN | bdb33310817854802ebc6356b28303616f23060a | [
"MIT"
] | null | null | null | model/critic.py | isadrtdinov/StarGAN | bdb33310817854802ebc6356b28303616f23060a | [
"MIT"
] | null | null | null | import math
from torch import nn
from torch.nn.utils import spectral_norm as SpectralNorm
from model.layers import CriticBlock
class Critic(nn.Module):
"""
Critic network with one patch adversarial head and one classification head
"""
def __init__(self, img_size=128, img_channels=3, cond_channels=5,
... | 41.742857 | 106 | 0.632444 |
db4b297cbf0a83c865e24f47ff6b23b4654fdc19 | 1,098 | py | Python | loesungsvorschlaege/ml_2_klassifikation_knn_svm/praxis/banknoten/svm_knn_banknoten.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/ml_2_klassifikation_knn_svm/praxis/banknoten/svm_knn_banknoten.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/ml_2_klassifikation_knn_svm/praxis/banknoten/svm_knn_banknoten.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | import pandas as pd
import sklearn.metrics as met
import sklearn.model_selection as modsel
import sklearn.neighbors as neigh
import sklearn.svm as svm
column_names = ["variance", "skewness", "curtosis", "entropy", "class"]
abstrakt_data_set = pd.read_csv("banknoten.csv", names=column_names, header=None)
matrix_X = ab... | 34.3125 | 94 | 0.801457 |
91d40e8e72cb537f356cdf22bf98639f4e4ac48e | 5,593 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_vpn_gateway.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_vpn_gateway.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_vpn_gateway.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 26.507109 | 92 | 0.632576 |
53117f65626928842cc5393a9b4d73b8857441a4 | 987 | py | Python | test/unit/align_test.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | test/unit/align_test.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | test/unit/align_test.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | #
# RawIO
# Copyright (c) 2021 Yusuf Olokoba.
#
from PIL import Image
from rawio.align import align_exposures
def test_align ():
exposure_paths = [
"test/media/align/1.jpg",
"test/media/align/2.jpg",
"test/media/align/3.jpg",
"test/media/align/4.jpg",
"test/media/align... | 30.84375 | 69 | 0.644377 |
5336343c7e5d3318a36eba16416ab9a4e2fd82bb | 613 | py | Python | hardware/bus/Key.py | BlueHC/TTHack-2018--Easy-Rider-1 | 8cd8f66de88ff80751a1083350c38985ac26914d | [
"Apache-2.0"
] | null | null | null | hardware/bus/Key.py | BlueHC/TTHack-2018--Easy-Rider-1 | 8cd8f66de88ff80751a1083350c38985ac26914d | [
"Apache-2.0"
] | null | null | null | hardware/bus/Key.py | BlueHC/TTHack-2018--Easy-Rider-1 | 8cd8f66de88ff80751a1083350c38985ac26914d | [
"Apache-2.0"
] | null | null | null | from pynput import keyboard
stations = {'1' : "Bf. Altona", '2' : "Gerichtstraße", '3' : "Max-Brauer-Allee",
'4' : "Sternbrücke", '5' : "Schulterblatt", '6' : "Sternschanze",
'7' : "Schlump", '8' : "Bundesstraße"}
def on_press(keyCode):
try:
key = keyCode.char
try:
... | 27.863636 | 80 | 0.564437 |
72b69c1913812b425c4e25fdea41f2f6f99da7e0 | 6,198 | py | Python | 2021-05-09/城市地图带后端/城市地图后端/coffee/views.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 395 | 2017-02-24T02:59:29.000Z | 2022-03-31T15:48:19.000Z | 2021-05-09/城市地图带后端/城市地图后端/coffee/views.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 7 | 2020-03-17T08:33:00.000Z | 2021-09-02T23:10:46.000Z | 2021-05-09/城市地图带后端/城市地图后端/coffee/views.py | ritaswc/wechat_app_template | d6ba56b70b09bc755f7d4d6b696b9e9b53511faa | [
"MIT"
] | 235 | 2017-03-14T03:31:38.000Z | 2022-03-29T16:14:51.000Z | from django.shortcuts import render
from django.core import serializers
from django.http import JsonResponse
import simplejson
from random import randint
from .models import Spot, Comment
from user.models import User
from rest_framework.decorators import api_view
from rest_framework.response import Response
from coff... | 35.417143 | 112 | 0.643272 |
beaca668badfbc510036f9fec83f46490ea0699c | 4,673 | py | Python | test/unit/v1beta1/suggestion/test_darts_service.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 17 | 2018-04-04T08:44:06.000Z | 2018-04-19T18:02:05.000Z | test/unit/v1beta1/suggestion/test_darts_service.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 58 | 2018-04-03T19:05:50.000Z | 2018-04-19T16:14:04.000Z | test/unit/v1beta1/suggestion/test_darts_service.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 10 | 2018-04-04T02:06:20.000Z | 2018-04-19T08:53:04.000Z | # Copyright 2022 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 39.268908 | 89 | 0.546972 |
4305f593103d3a93947e7a456311839724ad9665 | 111 | py | Python | src/server/app/endpoints/error/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/endpoints/error/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/endpoints/error/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from flask import render_template
def pagenotfound(e):
return render_template('./error/error-page.html')
| 18.5 | 53 | 0.765766 |
4328dcdca79a4aa2706b740c4c2839174fc7006f | 998 | py | Python | 0035search-insert-position.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0035search-insert-position.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0035search-insert-position.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Solution:
def searchInsert(self, nums, target):
left, right = 0, len(nums) - 1
while left < right: # 退出循环时,left==right
mid = (left + right) // 2 # 注意这里的向下取整,只剩2个元素时,mid会等于left
if nums[mid] < target:
... | 32.193548 | 94 | 0.452906 |
7187188895220689c197d4b611f57caa180776a4 | 7,084 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOwidgetsAsDialog.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOwidgetsAsDialog.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOwidgetsAsDialog.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt, QObject, QSize
from PyQt5.QtWidgets import QApplication, QDialog, QWidget, QAction, QToolBar, QDockWidget, QSizePolicy, QVBoxLayout, \
QScrollArea, QPlainTextEdit, QTextBrowser, QPushButton, QHBoxLayout, QSpacerItem, QToolBar, QMainWindow
from ... | 45.121019 | 123 | 0.497883 |
1cb1473fef9216d04f440c375d0bb9aabaf218c0 | 378 | py | Python | testlogin/main.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | testlogin/main.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | testlogin/main.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# encoding='utf-8'
# author:weibk
# time:2021/10/28 19:32
"""实例化两个测试对象,分别开启一个线程"""
from Report import Report
report1 = Report()
report2 = Report()
report1.pattern = 'TestLoginS.py'
report1.outname = r'report/logins.html'
report2.pattern = 'TestLoginF.py'
report2.outname = r'report/loginf.html'
repo... | 19.894737 | 39 | 0.732804 |
1cf537d158177b554c8897f1ec28ed9cc1b4dce6 | 1,061 | py | Python | Arrays and Strings/LeadersInArray.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/LeadersInArray.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/LeadersInArray.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | """
Leaders in an array
https://practice.geeksforgeeks.org/problems/leaders-in-an-array/0/?ref=self
"""
def leaders_in_array(numbers, size):
"""
Write a program to print all the LEADERS in the array. An element is leader
if it is greater than all the elements to its right side. The rightmost
element ... | 24.674419 | 79 | 0.551367 |
08fc77d9358034f4fee5c9e135d02693a98bb4f5 | 1,710 | py | Python | web/adminsite/views.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 1 | 2019-07-30T14:39:43.000Z | 2019-07-30T14:39:43.000Z | web/adminsite/views.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 11 | 2019-07-31T13:40:30.000Z | 2019-08-07T21:54:52.000Z | web/adminsite/views.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | null | null | null | from flask import render_template, redirect, url_for, request, flash
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField
from wtforms.validators import DataRequired, Length
from web import db
from web.models import Product
from . import admin
@admin.route('product_list')
def product_list(... | 36.382979 | 86 | 0.718713 |
90c3cd9774ee8bdeff88ccf1e2bbaa37efd82e72 | 428 | py | Python | src/tools/data/DataManualExamples/CreatingCompatible/vwpoint3d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/data/DataManualExamples/CreatingCompatible/vwpoint3d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/data/DataManualExamples/CreatingCompatible/vwpoint3d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import visit_writer, math
NPTS = 100
pts = []
data = []
for i in range(NPTS):
# Make a point
t = float(i) / float(NPTS-1)
angle = 3.14159 * 10. * t
pts = pts + [t * math.cos(angle), t * math.sin(angle), t]
# Make a scalar
data = data + [t * math.cos(angle)]
# Pass the data to visit_writer
var... | 23.777778 | 61 | 0.588785 |
9ef8a2f13cb9c7358cfb87f2d6fdd81524264f04 | 712 | py | Python | my_music_app/my_music_app/web/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | my_music_app/my_music_app/web/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | my_music_app/my_music_app/web/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.urls import path
from my_music_app.web.views import show_home, add_album, edit_album, delete_album, album_details, create_profile, \
delete_profile, profile_details
urlpatterns = (
path('', show_home, name='index'),
path('album/add/', add_album, name='add album'),
path('album/edit/<int:pk... | 39.555556 | 115 | 0.703652 |
73094e7bb460a1767ef0abb03289db320e1d1cb1 | 33,600 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/duaIterate.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/duaIterate.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/duaIterate.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is avail... | 50.224215 | 120 | 0.582649 |
7336b6c1d4267fafea61c5be27f91e33e9ee9c4a | 2,103 | py | Python | preprocess.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | preprocess.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | preprocess.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from apriori_TID import *
from apriori_interest import *
from apriori import *
#from fpgrowth import *
from fpgrowth import *
import time
import matplotlib.pyplot as plt
import sys
def PreprocessData (dataset,filepath,write_csv = True):
if dataset == 'GBIF':
... | 46.733333 | 160 | 0.654303 |
c330b50cb99e2938b74d3910997e09c39910fa0e | 8,355 | py | Python | fspke/simplebtree.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | fspke/simplebtree.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | fspke/simplebtree.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Joseph deBlaquiere <jadeblaquiere@yahoo.com>
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 40.362319 | 97 | 0.61137 |
6f444ffaecaf5f88ef519cbd20c659eaa9832fa3 | 304 | py | Python | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Lab/Solutions/P08_CinemaTicket.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Lab/Solutions/P08_CinemaTicket.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Lab/Solutions/P08_CinemaTicket.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | day = input()
price = 0
if day == 'Monday':
price = 12
elif day == 'Tuesday':
price = 12
elif day == 'Wednesday':
price = 14
elif day == 'Thursday':
price = 14
elif day == 'Friday':
price = 12
elif day == 'Saturday':
price = 16
elif day == 'Sunday':
price = 16
print(price)
| 15.2 | 24 | 0.559211 |
6f6ac445d97eb4b55fe383b9a49fd958af669c33 | 9,464 | py | Python | train.py | henrique/jigsaw20 | 5d12de807667810ea9b9bdb9cbccebabea7ed21d | [
"Apache-2.0"
] | 8 | 2020-06-23T13:42:34.000Z | 2022-01-25T11:00:01.000Z | train.py | henrique/jigsaw20 | 5d12de807667810ea9b9bdb9cbccebabea7ed21d | [
"Apache-2.0"
] | null | null | null | train.py | henrique/jigsaw20 | 5d12de807667810ea9b9bdb9cbccebabea7ed21d | [
"Apache-2.0"
] | 3 | 2020-06-24T03:18:26.000Z | 2020-07-30T01:22:53.000Z | """ build and train a TFAutoModel from npz or tfrec dataset """
import os
import gc
import time
import copy
import random
import logging
import numpy as np
import pandas as pd
# from tqdm.notebook import tqdm
import tensorflow_addons as tfa
# from tensorflow_addons.optimizers.utils import fit_bn
import tensorflow as... | 35.182156 | 98 | 0.610101 |
48bae86f44469530fe72145e47c52eb0edd40b4c | 176 | py | Python | exercises/zh/exc_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/exc_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/exc_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# 读取zh_core_web_md模型
nlp = ____
# 处理文本
doc = nlp("两只老虎跑得快")
for token in doc:
print(token.text)
# 获取词符"老虎"的向量
laohu_vector = ____.____
print(laohu_vector)
| 11.733333 | 24 | 0.715909 |
48f562a671c4b4db50bcd70fc9b20b1c28a06188 | 9,216 | py | Python | AP_SS16/703/python_custom_scripts/PeakDetect.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | FP_2017/18/python_custom_scripts/PeakDetect.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | latex-template/python_custom_scripts/PeakDetect.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import numpy as np
def peakdetect(y_axis, x_axis=None, lookahead=500, delta=0):
"""
Converted from/based on a MATLAB script at http://billauer.co.il/peakdet.html
Algorithm for detecting local maximas and minmias in a signal.
Discovers peaks by searching for values which are surrounded by lower
or l... | 38.560669 | 97 | 0.649197 |
8276e4f06f628808ab4fd023126e0ebe1b087549 | 4,741 | py | Python | src/onegov/org/views/editor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/editor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/editor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Implements the adding/editing/removing of pages. """
import morepath
from webob.exc import HTTPForbidden
from onegov.core.security import Private
from onegov.org import _, OrgApp
from onegov.org.forms.page import PageUrlForm
from onegov.org.layout import EditorLayout
from onegov.org.management import PageNameChan... | 31.397351 | 75 | 0.642691 |
827cbe2e4ce99507786cecab1d217bfd256daf4a | 938 | py | Python | Library/integration/test_instance_id.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | null | null | null | Library/integration/test_instance_id.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | null | null | null | Library/integration/test_instance_id.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.52 | 94 | 0.764392 |
82b2e7856668f291e08bcf9638f69c07ccc9655e | 3,316 | py | Python | fg/tournaments/management/commands/load_picks.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | fg/tournaments/management/commands/load_picks.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | fg/tournaments/management/commands/load_picks.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from tournaments.models import Player, Person, Tournament, TournamentPlayer, TournamentPick, GroupAPlayer, GroupBPlayer, GroupCPlayer, GroupDPlayer
import csv
import os
import sys
class Command(BaseCommand):
help = 'Loads Tournament Picks f... | 41.974684 | 147 | 0.618818 |
82cc803ab2350e127a925a645c40ef97f4c0c54c | 424 | py | Python | pacman-arch/test/pacman/tests/sync993.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/sync993.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/sync993.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Choose a dependency satisfier (target-list vs. database)"
sp1 = pmpkg("pkg1")
sp1.depends = ["dep"]
sp2 = pmpkg("pkg2")
sp2.provides = ["dep"]
sp3 = pmpkg("pkg3")
sp3.provides = ["dep"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p)
self.args = "-S pkg1 pkg3"
self.addrule("PACMAN_RE... | 20.190476 | 77 | 0.674528 |
7db2c1b2ed91905616f29cf46a774bbc8b548dc3 | 5,696 | py | Python | src/onegov/foundation/theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/foundation/theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/foundation/theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os.path
import sass
from collections import OrderedDict
from itertools import chain
from io import StringIO
from onegov.core.theme import Theme as CoreTheme
class BaseTheme(CoreTheme):
""" Base class for Zurb Foundation based themes. Use this class to
create a theme that customizes Zurb Foundation som... | 27.253589 | 79 | 0.564782 |
484d3ed1445b2c72736c154ddcedbc56a1270610 | 6,903 | py | Python | experimental/CommonMark/markdown.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | experimental/CommonMark/markdown.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | experimental/CommonMark/markdown.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""markdown.py - markdown compiler with parser combinators
Copyright 2016 by Eckhart Arnold
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/lice... | 32.71564 | 116 | 0.651311 |
485125c0e39610a954c787146400898b73d4a582 | 36,268 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/meta_import/mix_import_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/meta_import/mix_import_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/meta_import/mix_import_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from abc import abstractmethod
from enum import Enum
from typing import Callable, Dict, List, Optional, Tuple, Union
from fastapi import APIRouter, Depends
from pydantic import BaseModel
from watchmen_auth import PrincipalService
from watchmen_meta.admin import FactorService, PipelineService, SpaceService, TopicServi... | 39.593886 | 118 | 0.800623 |
488546e77bd65b08f5cf4ab80b089e09389d732d | 1,397 | py | Python | josefluispelz/EX1/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | josefluispelz/EX1/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | josefluispelz/EX1/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | #!/usr/bin/env python
import sys
import math
def geom_mean(value_list):
return math.pow(2, sum(math.log(value, 2) for value in value_list)/len(value_list))
loc_value = [[], []]
with open(sys.argv[-1], "r") as file:
for line_number, line in enumerate(file):
# check for comments
line = line.s... | 25.87037 | 123 | 0.547602 |
73dc53a558c78c02edebaff21dd407f14de82fac | 177 | py | Python | python/python_backup/PRAC_PYTHON/ab22.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab22.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab22.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | s=input("enter string:")
s1=s.capitalize()
print s1
i=0
s2=""
while i<len(s) :
print s[i]
s2=s2+s[i]
i=i+1
print s2
for i in s:
print s[i]
| 13.615385 | 25 | 0.497175 |
73e1a618a0aed1be0e27c4cf58ad91cf642493d7 | 5,005 | py | Python | research/cv/AVA_cifar/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/AVA_cifar/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/AVA_cifar/eval.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... | 40.691057 | 109 | 0.686314 |
f7c1c82671477ca0e47ab09cb83c3509604670a9 | 124 | py | Python | Chapter2_Python/Calculations.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/Calculations.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/Calculations.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | # Var name is left, value right
price_per_item = 0.5
amount = 10
total_price = amount * price_per_item
print(total_price)
| 15.5 | 37 | 0.758065 |
7906cfb86de423f9d982ed77fc575a8d59866742 | 8,765 | py | Python | Python/Programação_em_Python_Essencial/5- Coleções/listas.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Programação_em_Python_Essencial/5- Coleções/listas.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Programação_em_Python_Essencial/5- Coleções/listas.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | """
Listas
Listas em Python funcionam como vetores/matrizes (arrays) em outras linguagens, com a diferença
de serem DINÂMICO e também de podermos colocar QUALQUER tipo de dado.
Linguagens C/Java: Arrays
- Possuem tamanho e tipo de dado fixo;
Ou seja, nestas linguagens se você criar um array do tipo int e com tamanh... | 25.703812 | 116 | 0.712949 |
54494b072323a9f096f96bb6e49bf57d429e6bf9 | 12,714 | py | Python | research/gnn/sgcn/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/gnn/sgcn/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/gnn/sgcn/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.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... | 50.055118 | 120 | 0.654947 |
544aaa683e2698399ba187dd265ea0ed8ef6b8ee | 4,767 | py | Python | Strategy_I_portfolio_rebalance.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | Strategy_I_portfolio_rebalance.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | Strategy_I_portfolio_rebalance.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | # =============================================================================
# Backtesting strategy - I : Monthly portfolio rebalancing
# Author : Mayank Rasu
# Please report bug/issues in the Q&A section
# =============================================================================
import numpy as np
imp... | 39.07377 | 148 | 0.623243 |
42957a95a39f4dbcadf52d306676cb636b225c39 | 2,247 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/utils/create.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/utils/create.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/utils/create.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import os
from pathlib import Path
import json
server_path = dir_path = os.path.dirname(os.path.realpath(__file__))
def folder(name):
home = str(Path.home())
dir = ".filesystem_server"
path = os.path.join(home, dir)
path = os.path.join(path, name)
if not os.path.exists(path):
os.mkdir(path)
return path
def f... | 23.904255 | 68 | 0.701825 |
672e85824d618a0661519dc0ed3bb4dc85ed66f7 | 8,735 | py | Python | process_orders.py | vasmedvedev/automation | 98cdf5c577fc4dd57b2d9b7ccfd96e849394cc95 | [
"MIT"
] | null | null | null | process_orders.py | vasmedvedev/automation | 98cdf5c577fc4dd57b2d9b7ccfd96e849394cc95 | [
"MIT"
] | null | null | null | process_orders.py | vasmedvedev/automation | 98cdf5c577fc4dd57b2d9b7ccfd96e849394cc95 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import xmlrpclib
from time import sleep
from config import config_from_file
from db import db_connection
from pba import PBAProxy
def get_poa_api_address(cursor):
query = 'SELECT "PEMAddress", "PEMPort" FROM "PEMOptions"'
... | 38.311404 | 202 | 0.633085 |
67374bfcd0d87efdabfa2ed6a7d026e532d48bff | 11,330 | py | Python | Packs/Mimecast/Integrations/MimecastV2/mimecastV2_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Mimecast/Integrations/MimecastV2/mimecastV2_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Mimecast/Integrations/MimecastV2/mimecastV2_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from __future__ import print_function
import MimecastV2
from CommonServerPython import *
# Parameters for Get arguments test
policy_data = {
'description': 'new',
'fromPart': 'bla bla',
'fromType': 'free_mail_domains',
'fromValue': 'gmail.com',
'toType': 'email_domain',
'toValue': 'gmail.com'... | 35.29595 | 117 | 0.648985 |
674af085c91022e87015f24bc3323cf4a036d605 | 11,252 | py | Python | tests/ernie_information_extraction/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/ernie_information_extraction/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/ernie_information_extraction/predict.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 appli... | 41.065693 | 149 | 0.573854 |
e1d41a606ac8b3603d96cfbd8815e4e63b27cb3e | 476 | py | Python | packages/watchmen-inquiry-surface/src/watchmen_inquiry_surface/settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-surface/src/watchmen_inquiry_surface/settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-surface/src/watchmen_inquiry_surface/settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from logging import getLogger
from pydantic import BaseSettings
logger = getLogger(__name__)
class InquirySurfaceSettings(BaseSettings):
DATASET_PAGE_MAX_ROWS: int = 10000
class Config:
# secrets_dir = '/var/run'
env_file = '.env'
env_file_encoding = 'utf-8'
case_sensitive = True
settings = InquirySurf... | 19.833333 | 60 | 0.768908 |
c04a9f021ca273c7319c152944cf23ff57aff44f | 335 | py | Python | misc/Pysh/main.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | misc/Pysh/main.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | misc/Pysh/main.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import sys
black_list = "bcfghijkmnoqstuvwxz!@#|[]{}\"'&*()?01234569"
white_list = "adelpry78$^-_+="
your_input = raw_input(":")
for i in range(len(black_list)):
if black_list[i] in your_input:
print "Bad hacker...."
exit()
print os.system("bash -c '" + your_input + ... | 17.631579 | 58 | 0.61194 |
c061acc33787fe85cdd8a495733230e6f2c3a020 | 887 | py | Python | 0x41414141/2021/misc/pyjail/jailbreak.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | 0x41414141/2021/misc/pyjail/jailbreak.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | 0x41414141/2021/misc/pyjail/jailbreak.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
import re
from sys import modules, version
banned = "import|chr|os|sys|system|builtin|exec|eval|subprocess|pty|popen|read|get_data"
search_func = lambda word: re.compile(r"\b({0})\b".format(word), flags=re.IGNORECASE).search
modules.clear()
del modules
def main():
print(f"{version}\n")
... | 30.586207 | 92 | 0.588501 |
3f0ae7e555b75e910a8a1d0c035398c2c3dcbba9 | 418 | py | Python | day17/quiz-game/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day17/quiz-game/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day17/quiz-game/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from question_model import Question
from quiz_brain import QuizBrain
from data import question_data
questionBank = []
for data in question_data:
questionBank.append(Question(data["question"], data["correct_answer"]))
quiz = QuizBrain(questionBank)
while quiz.moreQuestions():
quiz.printScore()
question ... | 24.588235 | 75 | 0.767943 |
4537f8e85587d94a6ead71c89953d41cc4a2352a | 80,450 | py | Python | Backend/migrations/alembic/versions/91aca0bccf3f_create_population_rki_agegroup_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/91aca0bccf3f_create_population_rki_agegroup_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/91aca0bccf3f_create_population_rki_agegroup_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create population_rki_agegroup table
Revision ID: 91aca0bccf3f
Revises: 347eb1c14bd2
Create Date: 2020-11-25 21:26:40.327414
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '91aca0bccf3f'
down_revision = '347eb1c14bd2'
branch_labels = None
depends_on = None
def upgrade():
op.g... | 178.777778 | 222 | 0.67504 |
83427ef8befef71ce7d592bc14b7f0a98922f83f | 1,176 | py | Python | loesung/blatt1a_5.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | loesung/blatt1a_5.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | loesung/blatt1a_5.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | # Hier soll der User eine natürliche Zahl eingeben, solange bis er eine gültige
# Eingabe gemacht hat. Die Zahlen 1, 2, 3 und 5 sollen verdoppelt ausgegeben
# werden, die Zahlen 4, 6 und 7 sollen vervierfacht ausgegeben werden. Alle
# restlichen Zahlen sollen einfach ausgegeben werden. Auch hier gebe ich wieder
# die E... | 34.588235 | 79 | 0.728741 |
36661620a5cb4d0d961ff95bb68e989907e08fe4 | 7,049 | py | Python | python/oneflow/test/modules/test_optim_rmsprop.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_optim_rmsprop.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_optim_rmsprop.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 31.190265 | 86 | 0.5632 |
e9e3ee5c2699a94b14efff03fe2c5076b60c136b | 723 | py | Python | Packs/IntegrationsAndIncidentsHealthCheck/Scripts/InstancesCheck_NumberofEnabledInstances/InstancesCheck_NumberofEnabledInstances_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/IntegrationsAndIncidentsHealthCheck/Scripts/InstancesCheck_NumberofEnabledInstances/InstancesCheck_NumberofEnabledInstances_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/IntegrationsAndIncidentsHealthCheck/Scripts/InstancesCheck_NumberofEnabledInstances/InstancesCheck_NumberofEnabledInstances_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import demistomock as demisto
from InstancesCheck_NumberofEnabledInstances import main, ORANGE_HTML_STYLE, GREEN_HTML_STYLE
@pytest.mark.parametrize('incident_ids, expected', [
(5, f"<h1 style={ORANGE_HTML_STYLE}5</h1>"),
(1, f"<h1 style={ORANGE_HTML_STYLE}1</h1>"),
(0, f"<h1 style={GREEN_H... | 32.863636 | 93 | 0.688797 |
180eefddf428174375739f9139b1b0bf157f2b2e | 1,346 | py | Python | utest/prim1d_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | utest/prim1d_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | utest/prim1d_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import unittest
import zencad
class Prim1dProbber(unittest.TestCase):
def setUp(self):
zencad.lazy.encache = False
zencad.lazy.decache = False
zencad.lazy.fastdo = True
def test_segment_probe(self):
zencad.segment((0, 0, 0), (10, 20, 30))
def test_polysegment_probe(self):... | 32.047619 | 68 | 0.575037 |
a15ad4ce708ded35c75c0393a52d225dce7a8b32 | 137 | py | Python | exercises/zh/exc_01_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/exc_01_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/exc_01_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
# 读取"zh_core_web_sm"流程
nlp = ____
text = "写入历史了:苹果是美国第一家市值超过一万亿美元的上市公司。"
# 处理文本
doc = ____
# 打印doc中的文本
print(____.____)
| 10.538462 | 38 | 0.729927 |
a183f911c7b0372122ae797c733551afffdf14fa | 444 | py | Python | pacman-arch/test/pacman/tests/sync002.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/sync002.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/sync002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Upgrade a package from a sync db"
sp = pmpkg("dummy", "1.0-2")
sp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("sync", sp)
lp = pmpkg("dummy")
lp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("local", lp)
self.args = "-S %s" % sp.name
self.a... | 23.368421 | 53 | 0.630631 |
3d74c4b84ce3086a74442ec43093b802456bb397 | 2,291 | py | Python | rbac/processor/main.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | rbac/processor/main.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2018-09-10T19:12:31.000Z | 2018-09-10T19:12:31.000Z | rbac/processor/main.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.728571 | 87 | 0.706678 |
3dbc060ad787548f7fce4f778c6c21b1e9773b30 | 2,230 | py | Python | retro/cores/gba/src/platform/python/mgba/tile.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/cores/gba/src/platform/python/mgba/tile.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/cores/gba/src/platform/python/mgba/tile.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | # Copyright (c) 2013-2016 Jeffrey Pfau
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from ._pylib import ffi, lib
from . import image
class Tile:
def __init__(s... | 32.318841 | 136 | 0.602242 |
b12d569487645303a56e2b629347996031c66b23 | 1,861 | py | Python | python/en/archive/books/jump2python/j2p-02_2_6-string_built_in_methods.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/jump2python/j2p-02_2_6-string_built_in_methods.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/jump2python/j2p-02_2_6-string_built_in_methods.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jump2python-02_2-string_built_in_methods.py
P.59, 문자열 관련 함수들
"""
# 문자 개수 세기
a = 'hobby'
a.count('b')
# 2
a.count('bb')
# 1
a.count('oo')
# 0
# find 문자 위치 알려주기
a = 'Python is the best choice'
a.find('b')
# 14
# The first location of b
a.find('k')
# -1
# 0 means... | 16.182609 | 65 | 0.532509 |
6231bc0d052375bb9a86637c6c2d9c04053774a2 | 188 | py | Python | data_tests/saved__backend__/numba/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__py3.9/numba/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__py3.9/numba/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | # __protected__ from numba import njit
import numpy as np
# __protected__ @njit(cache=True, fastmath=True)
def func(a, b):
return (a * np.log(b)).max()
__transonic__ = ("0.4.7",)
| 15.666667 | 48 | 0.670213 |
b8ba7021898b6d3b031bd2fc147c01012b355d19 | 370 | py | Python | automation/ansible/roles/java/molecule/default/tests/test_default.py | nutstache/dockerlabs | acfb2b4e06e2c4092849be6dcc1f88038f64cfed | [
"MIT"
] | 2,521 | 2018-07-13T07:23:45.000Z | 2022-03-31T22:54:06.000Z | automation/ansible/roles/java/molecule/default/tests/test_default.py | nutstache/dockerlabs | acfb2b4e06e2c4092849be6dcc1f88038f64cfed | [
"MIT"
] | 171 | 2018-06-21T13:21:43.000Z | 2022-03-09T06:55:35.000Z | automation/ansible/roles/java/molecule/default/tests/test_default.py | nutstache/dockerlabs | acfb2b4e06e2c4092849be6dcc1f88038f64cfed | [
"MIT"
] | 1,250 | 2018-06-19T06:57:23.000Z | 2022-03-29T16:26:34.000Z | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_package(host):
if host.system_info.distribution == 'centos':
pkg = ["java-1.8.0-openjdk"]
else:
pkg = ["default... | 23.125 | 63 | 0.708108 |
a2a9d6591b49804ac19366338f16cca217fa03a4 | 795 | py | Python | hello/hello_es.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_es.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_es.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pip install elasticsearch elasticsearch-dsl
from elasticsearch import Elasticsearch
es = Elasticsearch([
'http://admin:adminadmin@hadoop-16:9200/',
'http://admin:adminadmin@hadoop-17:9200/',
'http://admin:adminadmin@hadoop-18:9200/'
])
res = es.search(index... | 29.444444 | 58 | 0.596226 |
a787e298844d95ebee3cd8aae729720dd5be5baa | 2,722 | py | Python | notebooks/guardian.py | EnginKarahan/python_data_scraping | 5cd04e0e92c66f26c22995a35d2517ada9e899ab | [
"CC0-1.0"
] | null | null | null | notebooks/guardian.py | EnginKarahan/python_data_scraping | 5cd04e0e92c66f26c22995a35d2517ada9e899ab | [
"CC0-1.0"
] | null | null | null | notebooks/guardian.py | EnginKarahan/python_data_scraping | 5cd04e0e92c66f26c22995a35d2517ada9e899ab | [
"CC0-1.0"
] | null | null | null | # Code für Grundlagenchallenge
import json
from collections import Counter
from pprint import pprint
with open('guardian_articles_corona.json', 'r', encoding='utf=8') as f:
guardian_raw = json.load(f)
def json_parser(file_to_pars):
parsed = []
for i in range(0, len(file_to_pars)):
for j in range(0... | 33.195122 | 79 | 0.603968 |
ac21b82d7ba01e37daded3bb56d70db9cca05a49 | 4,589 | py | Python | python/sbtab_sbtab2html.py | derHahn/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 4 | 2015-02-20T09:20:10.000Z | 2018-02-05T10:54:10.000Z | python/sbtab_sbtab2html.py | tlubitz/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 80 | 2018-04-13T13:46:24.000Z | 2022-02-16T16:01:46.000Z | python/sbtab_sbtab2html.py | tlubitz/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 6 | 2018-06-06T19:55:32.000Z | 2021-09-30T15:16:40.000Z | #!/usr/bin/env python
"""
SBtab to HTML commandline wrapper
===================================
See specification for further information.
"""
try:
from . import SBtab
from . import misc
except:
import SBtab
import misc
import argparse
import os
class SBtabError(Exception):
'''
Base class for... | 37.614754 | 255 | 0.636304 |
3bb43a980f114b6b3904cbe04efcfdf1c09f3025 | 190 | py | Python | listings/chapter17/iris-import1.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 6 | 2021-08-04T19:42:53.000Z | 2022-01-17T14:24:45.000Z | listings/chapter17/iris-import1.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2021-08-30T06:32:08.000Z | 2021-08-30T06:42:46.000Z | listings/chapter17/iris-import1.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2022-02-17T10:32:17.000Z | 2022-02-17T10:32:17.000Z | import csv
irises = []
iris_file = open('iris.csv', 'r')
for line in csv.reader(iris_file):
irises.append(line)
iris_file.close()
print(irises[0])
print(irises[50])
print(irises[100])
| 15.833333 | 34 | 0.694737 |
ce2e2171d3fdc877dfaec6cd3d5383e6447a2918 | 42,144 | py | Python | globals/subscriptions.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | globals/subscriptions.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | globals/subscriptions.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | subscriptions = {
'order': [
'EasyList',
'ABPindo',
'ABPVN List',
'Bulgarian list',
"Dandelion Sprout's Nordic Filters",
'EasyList China',
'EasyList Czech and Slovak',
'EasyList Dutch',
'EasyList Germany',
'EasyList Hebrew',
'Ea... | 40.21374 | 547 | 0.537989 |
ce664c21971dd8b3517d66cf632538fc15641a55 | 1,420 | py | Python | webapp/wine_dash/tabs/tab2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/wine_dash/tabs/tab2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/wine_dash/tabs/tab2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
from dash.dependencies import Input, Output
from app import app
from database import transforms
df = transforms.df
layout = html.Div(
id='table-paging-with-graph-container',
className='five columns'
)
@app.... | 25.357143 | 70 | 0.500704 |
ce73460b1a6b60b14c20987096d0ba5a54c9e88a | 6,788 | py | Python | exhibition.py | vlpolyansky/spotArt | b1a6df25b62cd61d9056d710f4a2cb9185f45f3c | [
"MIT"
] | null | null | null | exhibition.py | vlpolyansky/spotArt | b1a6df25b62cd61d9056d710f4a2cb9185f45f3c | [
"MIT"
] | null | null | null | exhibition.py | vlpolyansky/spotArt | b1a6df25b62cd61d9056d710f4a2cb9185f45f3c | [
"MIT"
] | null | null | null | from math import pi, sin, cos
import sys
from direct.gui.OnscreenText import OnscreenText
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from panda3d.core import CompassEffect, WindowProperties, VBase4, PointLight, CardMaker, CollisionRay, CollisionNode, \
CollisionHandlerQueue, Collisi... | 38.134831 | 122 | 0.607395 |
0cc075784463d2488b15ceb73d0cb19ae836e8e8 | 15,584 | py | Python | paddlenlp/taskflow/task.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/taskflow/task.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/taskflow/task.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# 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 req... | 43.049724 | 192 | 0.587076 |
d7a43b9ad88c2180a0452017d4f9ccf0e6821967 | 3,311 | py | Python | test_protocol/utils/online_val.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | test_protocol/utils/online_val.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | test_protocol/utils/online_val.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author Jun Wang
@data 20210630
@contact: jun21wangustc@gmail.com
"""
import sys
import yaml
import logging as logger
from torch.utils.data import DataLoader
sys.path.append('../../')
from data_processor.test_dataset import CommonTestDataset
from test_protocol.utils.extractor.feature_extractor import CommonExtrac... | 47.985507 | 114 | 0.640592 |
0bf168f425025f4b1316cfa79f7e244b01c964fb | 3,413 | py | Python | app/service/ep/footman/dao/bugly.py | 78182648/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | 22 | 2019-04-27T06:44:41.000Z | 2022-02-04T16:54:14.000Z | app/service/ep/footman/dao/bugly.py | YouthAge/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | null | null | null | app/service/ep/footman/dao/bugly.py | YouthAge/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | 34 | 2019-05-07T08:22:27.000Z | 2022-03-25T08:14:56.000Z |
from browsermobproxy import Server
from selenium import webdriver
import time
import os
from selenium.webdriver.chrome.options import Options
# configuration
#browsermobPath = './browsermob-proxy-2.1.4/bin/browsermob-proxy'
browsermobPath = 'D:\\fyf\\tool\\browsermob-proxy-2.1.4\\bin\\browsermob-proxy'
username = '9... | 37.505495 | 314 | 0.656607 |
041016924cfc5ba46986f503ec3d8d70a4e3f9da | 2,722 | py | Python | src/onegov/org/forms/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from sqlalchemy.orm import object_session
from onegov.core.utils import normalize_for_url
from onegov.form import Form
from onegov.org import _
from onegov.org.forms.fields import HtmlField
from wtforms import StringField, TextAreaField, validators, BooleanField
from wtforms.fields.html5 import URLField
from onegov.p... | 27.494949 | 72 | 0.590375 |
f09881fb71508c3ee694d72ce35299ce39c46f07 | 575 | py | Python | python/concurrency/concurrency_futures/deadlock.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/concurrency/concurrency_futures/deadlock.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/concurrency/concurrency_futures/deadlock.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import time
from concurrent.futures import ThreadPoolExecutor
def wait_on_b():
time.sleep(5)
print(b.result())
return 5
def wait_on_a():
time.sleep(5)
print(a.result())
return 6
with ThreadPoolExecutor(max_workers=2) as executor:
# here, the future from a depends on th... | 22.115385 | 59 | 0.652174 |
9bfd1eff85cb55508c377bbecf8667778fc79493 | 751 | py | Python | SoSe-21/Uebung-4/try-except.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-4/try-except.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-4/try-except.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
falsche_eingabe = True
# Schleife die solange läuft, bis das Alter korrekt eingegeben wurde
while falsche_eingabe:
# Try/Except, um etwaige Fehleingaben abzufangen
try:
# Nutzer um Eingabe des Alters bitten
alter = int(input("Bitte geben Sie Ihr Geburtsjahr ein: "))
print("Ihr Geburtsj... | 37.55 | 76 | 0.660453 |
a8677749ca2149c102753d838801af8cce3c207d | 199,521 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/plugins/mapmatching/mapmatching-12-oldpointassign.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/plugins/mapmatching/mapmatching-12-oldpointassign.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/plugins/mapmatching/mapmatching-12-oldpointassign.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 47.268657 | 265 | 0.490826 |
8c34743ae1d19881eb18e7bba79c398fc37dee37 | 378 | py | Python | project/api/user/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/user/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/user/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from marshmallow import fields
from project.api import marshmallow
from project.api.schemas import SQLAlchemyBaseSchema
from project.models import User
class UserModelSchema(SQLAlchemyBaseSchema):
class Meta:
model = User
load_instance = True
class UserSchema(UserModelSchema):
email = marsh... | 22.235294 | 52 | 0.759259 |
8c56bcc60e19c9fe7978ea278776738ba60a9213 | 647 | py | Python | Chapter2_Python/ListSlicing.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/ListSlicing.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/ListSlicing.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
x = [[1, 4, 3, 9],
[3, 1, 5, 2]]
y = ["red", "blue", "blue", "red"]
# P1 (x1=1, x2=3), Class="red"
# P2 (x1=4, x2=1), Class="blue"
# P3 (x1=3, x2=5), Class="blue"
# P3 (x1=9, x2=2), Class="red"
x1 = x[0]
x2 = x[1]
plt.scatter(x1, x2, color=y)
# plt.show()
w... | 19.029412 | 49 | 0.474498 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.