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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4c08d48b19f075dae23585000733938c8ac68391 | 698 | py | Python | python/coding_dojang/decorator_class_param_return.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/decorator_class_param_return.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/decorator_class_param_return.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class Trace:
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
r = self.func(*args, **kwargs)
print('{0}(args={1}, kwargs={2}) -> {3})'.format(self.func.__name__, args, kwargs, r))
return r
class Trace2:
def __call__(self, func):
d... | 21.151515 | 94 | 0.537249 |
d5d52baa97d1d0595989dc9119a6764cb3021caf | 498 | py | Python | apps/multivers/migrations/0008_product_margin.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/multivers/migrations/0008_product_margin.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/multivers/migrations/0008_product_margin.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-03 13:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('multivers', '0007_auto_20170203_1408'),
]
operations = [
migrations.AddFiel... | 23.714286 | 96 | 0.610442 |
9112e971dae6cf9bd9a1aa319883d48f351d8c4e | 1,281 | py | Python | ParsingAndScraping/ivi/parser.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T13:06:11.000Z | 2021-06-23T13:06:11.000Z | ParsingAndScraping/ivi/parser.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T21:21:52.000Z | 2021-06-23T21:21:52.000Z | ParsingAndScraping/ivi/parser.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T19:14:19.000Z | 2021-06-28T19:14:19.000Z | import requests
from ParsingAndScraping.ivi.scrapper import ivi_search
from ParsingAndScraping.assistants import big_num
from ParsingAndScraping.assistants import empty_string_cleaner
from bs4 import BeautifulSoup
def parse_this(film_name):
url = ivi_search(film_name)
if len(url) == 0:
return ['Not av... | 32.025 | 90 | 0.662763 |
5dc8644b81f7188968ee0814223ec9552db416ee | 426 | py | Python | nz_crawl_demo/day9/Agent/useragent_demo/useragent_demo/spiders/httpbin.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day9/Agent/useragent_demo/useragent_demo/spiders/httpbin.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day9/Agent/useragent_demo/useragent_demo/spiders/httpbin.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # -*- coding: utf-8 -*-
import scrapy
import json
class HttpbinSpider(scrapy.Spider):
name = 'httpbin'
allowed_domains = ['httpbin.org']
start_urls = ['http://httpbin.org/user-agent']
def parse(self, response):
user_agent = json.loads(response.text)['user-agent']
print("="*30)
... | 26.625 | 65 | 0.629108 |
5dd5ed93ae3e4c2eb0399723f48425243f45c730 | 20,896 | py | Python | tests/transformers/bigbird/test_modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/transformers/bigbird/test_modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/transformers/bigbird/test_modeling.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... | 42.995885 | 94 | 0.633949 |
f8e57bcbc7b33d06b69243aff9192b57cec80693 | 1,051 | py | Python | examples/myqueryset/delete_/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/myqueryset/delete_/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/myqueryset/delete_/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.db import models
from django.utils import timezone
from django.template.defaultfilters import truncatechars
# Create your models here.
class brand(models.Model):
name = models.CharField(verbose_name="品牌名称", max_length=50)
description = models.TextField(verbose_name="品牌描述")
class product(models.M... | 38.925926 | 96 | 0.759277 |
5d4478fcbd1601df16142faba97152e21a159835 | 1,256 | py | Python | Packs/RiskSense/Scripts/RiskSenseDisplayCVEChartScript/RiskSenseDisplayCVEChartScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/RiskSense/Scripts/RiskSenseDisplayCVEChartScript/RiskSenseDisplayCVEChartScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/RiskSense/Scripts/RiskSenseDisplayCVEChartScript/RiskSenseDisplayCVEChartScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from typing import Dict, Any
def display_cve_chart() -> Dict[str, Any]:
cves_count = demisto.args().get('CvesCount', 0)
trending_cves_count = demisto.args().get('TrendingCvesCount', 0)
entry_result = {
"Type": 17,
"ContentsFormat": "bar",
"Contents... | 27.304348 | 68 | 0.444268 |
5390439ba6c39c31ba4c90c3427c225d8387ddd4 | 3,316 | py | Python | tests/unit/scalar_fields/test_xyz_scalar_fields.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | tests/unit/scalar_fields/test_xyz_scalar_fields.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | tests/unit/scalar_fields/test_xyz_scalar_fields.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import pytest
import numpy as np
from pyntcloud.scalar_fields.xyz import (
PlaneFit,
SphereFit,
SphericalCoordinates,
CylindricalCoordinates
)
@pytest.mark.usefixtures("plane_pyntcloud")
def test_PlaneFit_max_dist(plane_pyntcloud):
scalar_field = PlaneFit(
pyntcloud=plane_pyntcloud)
... | 33.16 | 80 | 0.723764 |
54e69e22cf9e1c4bba203d3f9b559bd796901852 | 442 | py | Python | exercises/de/exc_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("de_core_news_sm")
text = "Apple wurde 1976 von Steve Wozniak, Steve Jobs und Ron Wayne gegründet."
# Verarbeite den Text
doc = ____
for token in doc:
# Greife auf den Text, die Wortart und die Dependenzrelation des Tokens zu
token_text = ____.____
token_pos = ____.____
... | 26 | 80 | 0.714932 |
5310e4e7d6e5b0b13113a263604d8b9627a5af03 | 11,671 | py | Python | _Dist/NeuralNetworks/_Tests/_UnitTests/d_Dist.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/_Tests/_UnitTests/d_Dist.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/_Tests/_UnitTests/d_Dist.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../../../../")
if root_path not in sys.path:
sys.path.append(root_path)
import copy
import unittest
import numpy as np
from Util.Util import DataUtil
from _Dist.NeuralNetworks.b_TraditionalML.SVM import DistLinearSVM
from _Dist.NeuralNetworks.g_DistNN.NN import Di... | 41.982014 | 114 | 0.599177 |
f4220eb4da2293b0fe13bff2a676cb524c93d605 | 1,759 | py | Python | tests/test_serializers/test_serializers.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | tests/test_serializers/test_serializers.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | tests/test_serializers/test_serializers.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | """handles tests for both base json and orjson serializers"""
from json import JSONDecodeError
from typing import List
from uuid import uuid4
import pytest
from msgpack.exceptions import ExtraData
from volley.serializers.base import BaseSerialization
from volley.serializers.json_serializer import JsonSerialization
fr... | 30.859649 | 79 | 0.727118 |
f440f8694ff344576e8577e1e8b7347b4a77f290 | 557 | py | Python | larq_compute_engine/tf/python/ops/compute_engine_ops.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/tf/python/ops/compute_engine_ops.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/tf/python/ops/compute_engine_ops.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | """Use larq compute engine ops in python."""
from tensorflow.python.framework import load_library
from tensorflow.python.platform import resource_loader
_ops_lib = load_library.load_op_library(
resource_loader.get_path_to_datafile("_larq_compute_engine_ops.so")
)
bsign = _ops_lib.lqce_bsign
# binary convolution... | 30.944444 | 76 | 0.829443 |
be3a27e435a0c3555f093f226c3fe7d5335d5da0 | 545 | py | Python | scripts/fabsp/screen.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/screen.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/screen.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import cd, settings, sudo
def download():
"""
curl -o screen.tar.gz http://ftp.gnu.org/gnu/screen/screen-4.6.0.tar.gz
tar xzf screen.tar.gz
"""
with cd("/usr/src"), settings(warn_only=True):
for line in download.__doc__.split(... | 20.185185 | 75 | 0.570642 |
fe00935e83684dbf848a3e9b06fd9ba859dad86f | 1,561 | py | Python | test/test_tag18.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag18.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag18.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
try:
from pyventskalender import tag18_loesung as heute
except ImportError:
from pyventskalender import tag18 as heute
class Tag18Tests(TestCase):
def test_10_elemente_in_satz(self):
frischer_satz = heute.Satz()
for satzteil in ["adverbiale", "verb", "subjek... | 44.6 | 88 | 0.700833 |
a3c02d7aae64130057a57dcc5a85383c7056ccfc | 1,461 | py | Python | src/test/tests/hybrid/mir_cache.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/mir_cache.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/hybrid/mir_cache.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: mir_cache.py
#
# Tests: mesh - 3D curvilinear,multi-domain,ghost zones replicated.
# plots - volume, PC
#
# Defect ID: '3542
#
# Programmer: Hank Childs
# Date: July ... | 21.80597 | 78 | 0.613279 |
430a657b957501807ccf91597f8bfedc08ceead7 | 99 | py | Python | Projects/Naver_map_halte_navigator.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | Projects/Naver_map_halte_navigator.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | Projects/Naver_map_halte_navigator.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | # Travling salesperson problem using Naver Map Application. (Map App. only can use halte under 5) | 99 | 99 | 0.777778 |
4a4cd94229030b2fb72f219d6c73d096757e5f31 | 215 | py | Python | exercises/fr/exc_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importe spaCy
import ____
# Crée l'objet nlp anglais
nlp = ____
# Traite un texte (il signifie "Ceci est une phrase" en anglais)
doc = nlp("This is a sentence.")
# Affiche le texte du document
print(____.text)
| 17.916667 | 64 | 0.72093 |
4a81802e06cf756a1f503bf3bead3e73eab8e0ab | 8,027 | py | Python | helper/segmentation/report/utils.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | helper/segmentation/report/utils.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | helper/segmentation/report/utils.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import os
import sys
import cv2
import json
import shutil
import numpy as np
import pandas as pd
from tqdm import tqdm
from datetime import datetime
from os.path import isfile, join
from os import listdir
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.structures import BoxMode
f... | 33.726891 | 155 | 0.592251 |
6017d42bab57671f20a5df829f82afb4a8055a39 | 2,261 | pyde | Python | sketches/fire/fire.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/fire/fire.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/fire/fire.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from random import randint
empty = 0
tree = 1
burning = 20
a = 40
g = 1
nRows = 40
nCols = 40
w = h = 16
grid = []
newgrid = []
def setup():
global trees, fire
size(640, 640)
background(210, 180, 140)
trees = loadImage("tree.png")
fire = loadImage("fire.png")
for x in range(nRows):
... | 27.240964 | 101 | 0.435206 |
6025ef7f9bf178fcd286a805eee2c78eee9a92dd | 1,524 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_price/item_price.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import throw, _
class ItemPriceDuplicateItem(frappe.ValidationError): pass
from frappe.model.document import Document
class... | 34.636364 | 111 | 0.744751 |
607343d1bdf1b9e2ee33a1c5f5fe3ddc4b6936fd | 3,748 | py | Python | language/mutator.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | language/mutator.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | language/mutator.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
import random
from collections import OrderedDict
import numpy as np
from utils.lib import O
from technix.tech_utils import Point, three_others, choice, S... | 33.168142 | 110 | 0.638741 |
60a6a1f50f00532b93420defeddef7429dd97f57 | 40,903 | py | Python | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/macosx/crashlog.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | 3 | 2016-02-10T14:18:40.000Z | 2018-02-05T03:15:56.000Z | lldb/crashlog.py | ddeville/scripts | 672ac037952e0945a0575712ef2c2821e288a6ca | [
"MIT"
] | 4 | 2019-06-16T09:52:03.000Z | 2019-08-18T02:11:35.000Z | lldb/crashlog.py | ddeville/scripts | 672ac037952e0945a0575712ef2c2821e288a6ca | [
"MIT"
] | null | null | null | #!/usr/bin/python
#----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
#
# To use this in the embedded python interpreter using "lldb":
#
# cd /path/containing/crashlog.py
# lldb
# (lldb) script import crashlog
# "crash... | 49.280723 | 218 | 0.556854 |
714e8a46a11a60eb8c0e661eacd5f4a91b1a32bf | 2,160 | py | Python | util/ap/py/LongestNonIncreasingSubseq.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | util/ap/py/LongestNonIncreasingSubseq.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | util/ap/py/LongestNonIncreasingSubseq.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | '''
You can run it directly to see results.
'''
def lnis(nums):
# res is a 0-based array where
# res[i] stores the length
# of lnis ending the number nums[i]
#
# So when we output the length of
# lnis of the whole integer array,
# we will print max(res) instead of
# the last one ... | 21.818182 | 65 | 0.513426 |
1c3a5319a9e2f955caf7dd2d1ca5fa42ac6dd3c8 | 2,226 | py | Python | Main App/app/main.py | Rathore25/Sapiens-QA | 0bf794784c3a3b26b541dbc2fa894756c979e5c4 | [
"MIT"
] | null | null | null | Main App/app/main.py | Rathore25/Sapiens-QA | 0bf794784c3a3b26b541dbc2fa894756c979e5c4 | [
"MIT"
] | null | null | null | Main App/app/main.py | Rathore25/Sapiens-QA | 0bf794784c3a3b26b541dbc2fa894756c979e5c4 | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify
from flask_cors import CORS
import os
import pandas as pd
import requests
import wget
import json
import wget
from cdqa.pipeline import QAPipeline
app = Flask(__name__)
CORS(app)
print("Started main.py !!!")
response = requests.get('https://docs.google.com/uc?export=downlo... | 30.916667 | 122 | 0.754717 |
c777a80aa72aea59183b054b6dd45d2f639227fc | 261 | py | Python | src/monoalpha/main.py | hacker-school/Kryptografie | de033d435ca5bbb908968596dfa8d12c26317167 | [
"CC0-1.0"
] | null | null | null | src/monoalpha/main.py | hacker-school/Kryptografie | de033d435ca5bbb908968596dfa8d12c26317167 | [
"CC0-1.0"
] | null | null | null | src/monoalpha/main.py | hacker-school/Kryptografie | de033d435ca5bbb908968596dfa8d12c26317167 | [
"CC0-1.0"
] | null | null | null | import monoalphabeticCipher as mc
cipher = mc.random_monoalpha_cipher()
print(cipher)
encrypted = mc.encrypt_with_monoalpha('Hello all you hackers out there!', cipher)
decrypted = mc.decrypt_with_monoalpha(encrypted, cipher)
print(encrypted)
print(decrypted)
| 26.1 | 81 | 0.816092 |
c7b95bcbc8e3e77affcc8c9dd34811fed84b27ca | 19,949 | py | Python | aci_app_creator.py | HyechurnJang/genaci | aac26c8b59a5d8b3884aa6f588f40f2e741c1cc3 | [
"Apache-2.0"
] | null | null | null | aci_app_creator.py | HyechurnJang/genaci | aac26c8b59a5d8b3884aa6f588f40f2e741c1cc3 | [
"Apache-2.0"
] | null | null | null | aci_app_creator.py | HyechurnJang/genaci | aac26c8b59a5d8b3884aa6f588f40f2e741c1cc3 | [
"Apache-2.0"
] | null | null | null | '''
ACI APIC AppCreator
@contact: aciappcenter-support@cisco.com
@version: 1.1
'''
from __future__ import print_function
import argparse
import json
import os
import re
import readline
import shutil
import signal
import sys
signal.signal(signal.SIGINT, lambda x, y: sys.exit(0))
import logging
import aci_app_validat... | 36.009025 | 148 | 0.632312 |
1be5cac2ead63e9044d2ba8d27c327dce3d7b124 | 576 | py | Python | scripts/ping_database.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | scripts/ping_database.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | scripts/ping_database.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | #! python
import click
import veras
@click.command()
@click.option("--protocol", "-c", default="bolt")
@click.option("--host", "-h", default="localhost")
@click.option("--port", "-p", default=7687)
@click.option("--username", "-u", default="neo4j")
@click.option("--password", "-i", default="neo4j")
def ping_database... | 27.428571 | 100 | 0.670139 |
403be07bfa3783f0c2b73ba11312f3329752835d | 15,265 | py | Python | src/game_sim.py | Gandagorn/PySchnaps | e8cd865fd60553e36e424eb82be81462f57e6f1f | [
"MIT"
] | null | null | null | src/game_sim.py | Gandagorn/PySchnaps | e8cd865fd60553e36e424eb82be81462f57e6f1f | [
"MIT"
] | null | null | null | src/game_sim.py | Gandagorn/PySchnaps | e8cd865fd60553e36e424eb82be81462f57e6f1f | [
"MIT"
] | null | null | null | """
28.09.2019
Schnapsen Simulation
Rules:
4 Farben:
H Herz 0
K Karo 1
P Pik 2
K Kreuz 3
Werte:
A Ass 11
Z Zehner 10
K König 4
D Dame 3
B Bube 2
Players:
G Geber
V Vorhand
Geben:
5 cards each (= 10... | 31.216769 | 195 | 0.532853 |
408ad44e6e4b5f4c2aff4fbdc17258ec9a6ac689 | 24,041 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #
# BitBake Toaster Implementation
#
# Copyright (C) 2018 Wind River Systems
#
# SPDX-License-Identifier: GPL-2.0-only
#
# buildimport: import a project for project specific configuration
#
# Usage:
# (a) Set up Toaster environent
#
# (b) Call buildimport
# $ /path/to/bitbake/lib/toaster/manage.py buildi... | 42.02972 | 203 | 0.549104 |
46268c046a00724cf26ff86383d189c22e9d74cc | 6,274 | py | Python | mumath/glyph.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/glyph.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/glyph.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | from .context.tokens import *
from .context import base
from .util import listify
from importlib import import_module
from collections import namedtuple
from types import ModuleType, SimpleNamespace
try:
from functools import cache
except importError:
from functools import lru_cache as cache
# For diffs
# Th... | 26.472574 | 90 | 0.601371 |
d3c2bfdf03de23c30f4f5ead11f0837b38ddbcda | 241 | py | Python | 1-two-sum/1-two-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1-two-sum/1-two-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1-two-sum/1-two-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
for i, num in enumerate(nums[:-1]):
for j in range(i+1, len(nums)):
if num+nums[j]==target:
return [i,j] | 40.166667 | 64 | 0.497925 |
312e852e0ab25283164f049be99b9003dc3a7086 | 662 | py | Python | src/bo4e/enum/netzebene.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/netzebene.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/netzebene.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Netzebene(StrEnum):
"""
Auflistung möglicher Netzebenen innerhalb der Energiearten Strom und Gas.
"""
NSP = "NSP" #: Niederspannung; Strom
MSP = "MSP" #: Mittelspannung; Strom
HSP = "HSP" #: Hochspannung... | 31.52381 | 77 | 0.655589 |
5b04761ada7382d0d888d035ba0424a1b72c73c2 | 2,392 | py | Python | tests/onegov/core/test_browser_session.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_browser_session.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_browser_session.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from dogpile.cache import make_region
from dogpile.cache.api import NO_VALUE
from onegov.core.browser_session import BrowserSession
from onegov.core import cache
def test_browser_session_mangle():
session = BrowserSession({}, 'token')
assert session._cache.mangle('test')\
== 'e352b6fc45... | 24.408163 | 75 | 0.674749 |
818d96f792b14d7ccf99e03db9f6973b1a67e7bf | 676 | py | Python | crawlab/flower.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | 1 | 2019-08-20T14:26:39.000Z | 2019-08-20T14:26:39.000Z | crawlab/flower.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | null | null | null | crawlab/flower.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import subprocess
# make sure the working directory is in system path
FILE_DIR = os.path.dirname(os.path.realpath(__file__))
ROOT_PATH = os.path.abspath(os.path.join(FILE_DIR, '..'))
sys.path.append(ROOT_PATH)
from utils.log import other
from config import BROKER_URL
if __name__ == '__main__':
... | 32.190476 | 86 | 0.622781 |
81912007bd471b663a28440263224fd9aac8139e | 3,136 | py | Python | research/cv/inception_resnet_v2/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/inception_resnet_v2/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/inception_resnet_v2/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.72043 | 107 | 0.655293 |
8191879558f66b4817abb137a9ce2a5b4339a098 | 32,601 | py | Python | skripte/python/edit_tools/wortliste.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/edit_tools/wortliste.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/edit_tools/wortliste.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# :Copyright: © 2012 Günter Milde.
# :Licence: This work may be distributed and/or modified under
# the conditions of the `LaTeX Project Public License`,
# either version 1.3 of this license or (at your option)
# any later version.
# :V... | 29.529891 | 89 | 0.58851 |
c4d4a4be09ac53d98f5066b2ab316b38c36ca046 | 674 | py | Python | easy/4/python/config.py | carlan/dailyprogrammer | f8448c6a35277c567d0f1ecab781d45b294c8d0f | [
"MIT"
] | 1 | 2019-02-26T16:34:06.000Z | 2019-02-26T16:34:06.000Z | easy/4/python/config.py | carlan/dailyprogrammer | f8448c6a35277c567d0f1ecab781d45b294c8d0f | [
"MIT"
] | null | null | null | easy/4/python/config.py | carlan/dailyprogrammer | f8448c6a35277c567d0f1ecab781d45b294c8d0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""config.py: challenge #4"""
__author__ = "Carlan Calazans"
__copyright__ = "Copyright 2016, Carlan Calazans"
__credits__ = ["Carlan Calazans"]
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Carlan Calazans"
__email__ = "carlancalazans at gmail dot ... | 30.636364 | 158 | 0.676558 |
48217dfaf1efc2c3038caec0116cfdc8b9f7f904 | 610 | py | Python | aoc2020/day_06/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_06/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_06/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from .part_1 import Solution as Part1
class Solution(Part1):
expected = 6
count = lambda s, f, l: len(list(filter(f, l)))
def solve(self) -> any:
grp_size, rt, yes_answers = 0, 0, [0] * 26
for line in self.resource_lines("input"):
if line == "":
rt += self.coun... | 32.105263 | 70 | 0.514754 |
485a95b7fb38df76b358e2331f5333070b3b8a5d | 21,436 | py | Python | wz/ui_modules/PUPILS.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui_modules/PUPILS.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui_modules/PUPILS.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ui_modules/PUPILS.py
Last updated: 2021-05-23
Pupil table management.
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may o... | 33.598746 | 78 | 0.608836 |
6f9335269b376a8d3e3bf661559622e426576304 | 4,666 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_2/party_model.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/party_model.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/party_model.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
def execute():
frappe.reload_doc("accounts", "doctype", "account")
frappe.reload_doc("setup", "doctype", "company")
fr... | 39.542373 | 108 | 0.729104 |
fba41cb91da20a3719f2c7d150788a524e270931 | 864 | py | Python | bot/exts/fun/conversation_starters.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/fun/conversation_starters.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/fun/conversation_starters.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import pathlib
import random
import discord
from discord.ext import commands
import yaml
from bot.bot import Bot
FORM_URL = "https://forms.gle/sb2jNbvVcTorNPTX6"
with pathlib.Path("bot/resources/fun/starters.yaml").open("r", encoding="utf8") as f:
STARTERS = yaml.load(f, Loader=yaml.FullLoader)
class Conversa... | 26.181818 | 85 | 0.694444 |
83b7a3131f12c060d9d815727925d0311b38b78f | 17,094 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/traci/_simulation.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/traci/_simulation.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/traci/_simulation.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.... | 37.986667 | 117 | 0.648707 |
79105e9db751863b607396d1a212e15dddfc2736 | 2,450 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/03_xkcd_multithread_download/03_xkcd_multithread_download.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/03_xkcd_multithread_download/03_xkcd_multithread_download.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/03_xkcd_multithread_download/03_xkcd_multithread_download.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 03_xkcd_multithread_download.py
# In dieser Übung geht es darum den Download der Comics zu beschleunigen
# indem man mehrere Threads zum downloaden nutzt.
import os, threading, requests, bs4
os.chdir(os.path.dirname(__file__))
target_dir='.\\comics'
source_url='https://xkcd.com'
# Prüfe ob Seite erreichbar
url_con... | 34.507042 | 106 | 0.672653 |
f73d121b6b27b06f03eb59a172064c7c0937ce64 | 6,791 | py | Python | lib/moerdergraphall.py | orithena/moerderspiel | 7a11598cd80f26824376207805d3a937b9c1d831 | [
"MIT"
] | 16 | 2015-09-30T13:45:07.000Z | 2022-01-31T16:45:50.000Z | lib/moerdergraphall.py | orithena/moerderspiel | 7a11598cd80f26824376207805d3a937b9c1d831 | [
"MIT"
] | 5 | 2015-09-16T13:44:08.000Z | 2018-02-06T11:24:59.000Z | lib/moerdergraphall.py | orithena/moerderspiel | 7a11598cd80f26824376207805d3a937b9c1d831 | [
"MIT"
] | 4 | 2015-05-28T17:39:55.000Z | 2022-01-29T01:27:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os.path
import yapgvb as graph
from yapgvb import RenderingContext, CLIRenderError
import textwrap
import math
import colorsys
import pickle
from moerderklassen import *
from utils import colorgen
import utils
class MyRenderingContext(RenderingContext):
... | 33.453202 | 114 | 0.709616 |
e39a5d6c0dd8a167e618783026d23eebbd516c13 | 386 | py | Python | zencad/examples/1.GeomPrim/2.prim2d/rectangle.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/1.GeomPrim/2.prim2d/rectangle.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/1.GeomPrim/2.prim2d/rectangle.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: rectangle
last update: 04.10.2019
"""
from zencad import *
m0 = rectangle(a=10, b=6, center=True)
m1 = rectangle(a=10, b=6)
m2 = rectangle(6, center=True)
m3 = square(6)
display(m0, color=color.yellow)
display(m1.up(0.3), color=color.green)
display(m2.forw(10), color=c... | 18.380952 | 47 | 0.69171 |
e3c9369aafadd50d504b5c7d342598f8599cf3ed | 5,265 | py | Python | app/datasources/stac/query.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | 18 | 2019-03-27T20:09:37.000Z | 2022-02-04T17:38:07.000Z | app/datasources/stac/query.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | 3 | 2019-06-05T15:12:17.000Z | 2020-04-30T17:54:37.000Z | app/datasources/stac/query.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | 3 | 2019-06-29T01:16:37.000Z | 2020-04-30T17:25:26.000Z | import operator
from datetime import datetime
import os
from schema import Schema, And
from geomet import wkt
class STACQueryError(BaseException):
pass
class STACQuery(object):
@staticmethod
def load_spatial(spatial):
schema = Schema({
"type": And(
str,
... | 38.430657 | 133 | 0.501235 |
540ff5820e3c35112a173c155f318b432f0522a1 | 94 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/03funcionario/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/03funcionario/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/03funcionario/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from funcionario import Funcionario
f1 = Funcionario('Pedro', 1000, 30)
print(f1.aumento()) | 15.666667 | 35 | 0.744681 |
58a5dbcb6f54bba29816586a72929ce30ada4ee5 | 23,205 | py | Python | tests/notest_server_tcp.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | tests/notest_server_tcp.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | tests/notest_server_tcp.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""notest_server_tcp.py - tests of the server module of DHParser,
connections via tcp.
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2019 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in co... | 39.397284 | 135 | 0.573195 |
58a948501ba68feaeb97009250070f3c3e45c847 | 9,719 | py | Python | examples/readme_example/readme_exampleParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | examples/readme_example/readme_exampleParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | examples/readme_example/readme_exampleParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#######################################################################
#
# SYMBOLS SECTION - Can be edited. Changes will be preserved.
#
#######################################################################
import collections
from functools import partial
import os
import sys
try:
scri... | 37.380769 | 103 | 0.642967 |
49ff16c4b485979ee35f59bc06e7ca34e0b7a947 | 1,604 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/06_pdf_seiten_mit_bestimmtem_textinhalt_finden/06_pdf_seiten_mit_bestimmtem_textinhalt_finden.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/06_pdf_seiten_mit_bestimmtem_textinhalt_finden/06_pdf_seiten_mit_bestimmtem_textinhalt_finden.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/06_pdf_seiten_mit_bestimmtem_textinhalt_finden/06_pdf_seiten_mit_bestimmtem_textinhalt_finden.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 06_pdf_seiten_mit_bestimmtem_textinhalt_finden.py
# Dieses Übungsscript soll alle PDF-Dateien eines Unterordners durchsuchen, diese Auslesen
# und wenn eine Seite den gesuchten String enthält in ein neues File speichern.
import os, PyPDF2, re
os.chdir(os.path.dirname(__file__))
target_path='.\\search_me'
target_fi... | 34.12766 | 91 | 0.703865 |
4d73a64f545af771e2745579aa71d4923068637b | 29,106 | py | Python | research/cvtmodel/regnet/src/regnet_x_400mf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/regnet/src/regnet_x_400mf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/regnet/src/regnet_x_400mf.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... | 60.26087 | 119 | 0.517969 |
4d96a5fc4581769bfa4cb282a742bdb3dcd6371c | 5,109 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/spline.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/spline.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/spline.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z |
#!/usr/bin/env python
# Author : Pierre Schnizer
"""
Wrapper for the splines of gsl. This solver wraps all features as described
in Chapter 26 of the gsl documentation.
Difference between spline and interpolation module:
--------------------------------------------------
In the interpolation module the data for the... | 29.531792 | 82 | 0.609121 |
4d9fa403ce6b252624dbc04df0771323c80ccee8 | 20,327 | py | Python | create_delete_transaction_from_search_bundle.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | create_delete_transaction_from_search_bundle.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | create_delete_transaction_from_search_bundle.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | from json import dumps
# put search bundle inline here
dict_b = {
"resourceType": "Bundle",
"id": "5d592a0c-1d5a-4de0-8eb8-619f1fb8391e",
"meta": {
"lastUpdated": "2021-01-07T05:37:25.388+00:00"
},
"type": "searchset",
"total": 25,
"link": [
{
"relation": "self"... | 37.093066 | 172 | 0.348797 |
678627b10248706b9bfd99f6c69f2414e1874355 | 1,704 | py | Python | terminal_blog/models/menu.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | terminal_blog/models/menu.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | terminal_blog/models/menu.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | from models.database import Database
from models.blog import Blog
class Menu(object):
def __init__(self):
self.user = input("Enter your author name: ")
self.user_blog = None
if self._user_has_account():
print("Welcome back {}".format(self.user))
else:
self._p... | 35.5 | 109 | 0.587441 |
67c17a1c17c00d3caed7a53ce51ec94727f86b6d | 5,893 | py | Python | lale/lib/lale/map.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | lale/lib/lale/map.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | lale/lib/lale/map.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 IBM Corporation
#
# 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, ... | 36.83125 | 190 | 0.555405 |
c05ae130bc62cfb660f95c99a67eedcfe2179a96 | 7,599 | py | Python | covidash/dashboard/app.py | CRitter93/covidash | 9daaa8e17c2487068bfd7a7b581880ee6698cedd | [
"Apache-2.0"
] | 1 | 2020-05-11T17:54:58.000Z | 2020-05-11T17:54:58.000Z | covidash/dashboard/app.py | CRitter93/covidash | 9daaa8e17c2487068bfd7a7b581880ee6698cedd | [
"Apache-2.0"
] | null | null | null | covidash/dashboard/app.py | CRitter93/covidash | 9daaa8e17c2487068bfd7a7b581880ee6698cedd | [
"Apache-2.0"
] | null | null | null | import json
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from covidash.dashboard.data_store import DataStore
import covidash.dashboard.figures as figures
from covidash.dashboard.figures import DATA_TYPE_MAPPING
data_store = Data... | 45.232143 | 162 | 0.504803 |
97d804b6b5c7ff541e4e008c3133e89951c5fdb4 | 280 | py | Python | weibo/test/testZZ.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testZZ.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testZZ.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #coding:utf8
'''
Created on 2016年6月6日
@author: wb-zhaohaibo
'''
# import re
# detail_cont = "411023199112300511"
# pattern = re.compile(ur'/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/')
# aa = re.match(pattern, detail_cont, 0)
# print aa
import this
print this
| 14.736842 | 67 | 0.592857 |
3f37e5c2431a14543279c7f67d969c5845bd49e2 | 10,720 | py | Python | Packs/PhishLabs/Integrations/PhishLabsIOC/PhishLabsIOC_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PhishLabs/Integrations/PhishLabsIOC/PhishLabsIOC_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PhishLabs/Integrations/PhishLabsIOC/PhishLabsIOC_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
def test_create_indicator_no_date():
from PhishLabsIOC import create_indicator_content
files_json = """
{
"attributes": [
{
"createdAt": "2019-05-14T13:03:45Z",
"id": "xyz",
... | 31.43695 | 99 | 0.445336 |
e13e0016be4333c45b0e4ead7742b3210fc1cb51 | 12,505 | py | Python | Packs/ApiModules/Scripts/GSuiteApiModule/GSuiteApiModule_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ApiModules/Scripts/GSuiteApiModule/GSuiteApiModule_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ApiModules/Scripts/GSuiteApiModule/GSuiteApiModule_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 GSuiteApiModule import DemistoException, COMMON_MESSAGES, GSuiteClient
with open('test_data/service_account_json.txt') as f:
TEST_JSON = f.read()
PROXY_METHOD_NAME = 'GSuiteApiModule.handle_proxy'
CREDENTIAL_SUBJECT = 'test@org.com'
MOCKER_HTTP_METHOD = 'GSuiteApiModule.GSuiteCl... | 33.257979 | 114 | 0.722671 |
e1882bb8873cd8b16dc3263d1574bf6fcbfe54ae | 138 | py | Python | backend/parser.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | backend/parser.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | 12 | 2017-09-25T20:13:29.000Z | 2020-02-12T00:12:41.000Z | backend/parser.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | from songwriter.parser import Parser
parser = Parser("../data/file/word/document.xml")
parser.parse()
parser.save_songs()
parser.compile() | 27.6 | 49 | 0.775362 |
8311e94e16aac9bbe67ce428d4f4a2e4bea2f7c6 | 103 | py | Python | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Lab/Solutions/P06_NumberInRange.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Lab/Solutions/P06_NumberInRange.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Lab/Solutions/P06_NumberInRange.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | number = int(input())
if -100 <= number <= 100 and number != 0:
print('Yes')
else:
print('No') | 17.166667 | 41 | 0.553398 |
831fa34d1ba29f04e0ddb0a332450fbc8c6ccbfe | 3,786 | py | Python | official/cv/ADNet/src/utils/precision_plot.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/utils/precision_plot.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/utils/precision_plot.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... | 35.716981 | 119 | 0.658214 |
7fecff4e502e25dcfb1a0010472a0d8f6da1744f | 1,133 | py | Python | Aggregator/agg_zugdaten.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | Aggregator/agg_zugdaten.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | Aggregator/agg_zugdaten.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | import os
import re
import pandas as pd
from datetime import datetime, timedelta, date
# compatibility with ipython
#os.chdir(os.path.dirname(__file__))
import json
import boto3
from pathlib import Path
from coords_to_kreis import coords_convert
import settings
def aggregate(date):
client_s3 = boto3.client("s3")
... | 35.40625 | 167 | 0.68579 |
a1280907fe5372581a6729c778029088ec482c1f | 3,431 | py | Python | deploy/deployctl/subcommands/elasticsearch.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | deploy/deployctl/subcommands/elasticsearch.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | deploy/deployctl/subcommands/elasticsearch.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | import argparse
import os
import subprocess
import sys
import typing
import jinja2
from deployctl.shell import kubectl
def deployment_directory() -> str:
return os.path.realpath(os.path.join(os.path.dirname(__file__), "../../manifests/elasticsearch"))
def render_template_and_apply(
template_path: str, con... | 33.31068 | 120 | 0.686097 |
a1d2649c25a7509b7550a1be1ffdfccaab1a95f9 | 5,407 | py | Python | docker/api/api/endpoints/measures.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | docker/api/api/endpoints/measures.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | docker/api/api/endpoints/measures.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Corona-Info-App
# measures endpoint
# © 2020 Tobias Höpp.
# Include dependencies
from flask import request, jsonify
# Include modules
from main import api, db
from models.measures import displayGroup, display, displayGroupHasDisplay
from models.districts import districts
from utils.flexstrin... | 51.009434 | 512 | 0.591825 |
62f105101b0379598784d69cb1714d2fd448b2c7 | 237 | py | Python | PYTHON/Itertools/product.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/product.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/product.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from itertools import product
if __name__ == '__main__':
x = list(map(int, (input().split())))
y = list(map(int, (input().split())))
for n in list(product(x, y)):
print(n, end=" ")
print()
| 23.7 | 41 | 0.56962 |
c5657079b338cccc8e5d7010bf817e347f462ced | 818 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("hr", "doctype", "expense_claim_type")
frappe.reload_doc("hr", "doctype", "expense_claim_account")
if not frappe.db.has_column('Expense Claim Type', 'default_account'):
return
for expense_claim_type in frappe.get_all("Expens... | 40.9 | 100 | 0.761614 |
9a9dc3d1911158b36b5e225e7ff4f5208ac444ba | 5,486 | py | Python | data_acquire_store/netease/user_data.py | PatrickNgZh/RecommenderSystem | 0dbd3ac05ca8c1b5948a2605f1a9407f1ec59d39 | [
"Apache-2.0"
] | 1 | 2020-03-18T12:34:39.000Z | 2020-03-18T12:34:39.000Z | data_acquire_store/netease/user_data.py | PatrickNgZh/RecommenderSystem | 0dbd3ac05ca8c1b5948a2605f1a9407f1ec59d39 | [
"Apache-2.0"
] | 1 | 2021-06-02T01:30:56.000Z | 2021-06-02T01:30:56.000Z | data_acquire_store/netease/user_data.py | PatrickNgZh/RecommenderSystem | 0dbd3ac05ca8c1b5948a2605f1a9407f1ec59d39 | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# author: humingk
# ----------------------
import time
from concurrent.futures import ThreadPoolExecutor
import config
import sys
from my_tools.database_tool import database_tool
from netease.user_ranklist_songs import user_ranklist_songs
from netease.playlist_songs impo... | 38.097222 | 115 | 0.585308 |
b14c7cc6a5baabd76609ac9139f1e6d2ff0ca70a | 170 | py | Python | twitoff/__init__.py | Pdugovich/TwitOff | 9c06677ed763cf5d14fec53a10024126792681c4 | [
"MIT"
] | null | null | null | twitoff/__init__.py | Pdugovich/TwitOff | 9c06677ed763cf5d14fec53a10024126792681c4 | [
"MIT"
] | 1 | 2021-06-02T00:47:17.000Z | 2021-06-02T00:47:17.000Z | twitoff/__init__.py | Pdugovich/TwitOff | 9c06677ed763cf5d14fec53a10024126792681c4 | [
"MIT"
] | null | null | null | """Entry point for TwitOff."""
from .app import create_app
#APP is a global variable
APP = create_app()
# run this in terminal with
# set FLASK_APP=TWITOFF
# flask run | 17 | 30 | 0.729412 |
6207cdeeb519029022e3cd898bb388fd2e0c2afe | 566 | py | Python | Packs/DeveloperTools/Integrations/CustomIndicatorDemo/CustomIndicatorDemo_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeveloperTools/Integrations/CustomIndicatorDemo/CustomIndicatorDemo_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeveloperTools/Integrations/CustomIndicatorDemo/CustomIndicatorDemo_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CustomIndicatorDemo import Client, custom_indicator_creation
def test_custom_indicator_test():
"""
Given
- Dummy result
When
- dummy client is passed
Then
- return enriched indicator and result
"""
client = Client(base_url='some_mock_url', verify=False)
res = c... | 28.3 | 65 | 0.674912 |
6562af1cc42aa3ea520841a9fe8ecb554a7b021b | 775 | py | Python | misc/update_portfolio.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | misc/update_portfolio.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | misc/update_portfolio.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | """
A function to update a bad representation of a portfolio, for Rayan.
"Write a function update_portfolio that takes a portfolio (as a list of tuples), a ticker, and the
number of shares. The function should return the updated portfolio. A positive value for the
number of shares means 'buy', a negative value for the... | 43.055556 | 98 | 0.673548 |
028e7f4cad8c5de957d700cf6e535d684c530b2e | 3,203 | py | Python | src/ztc/php/fpm.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/php/fpm.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/php/fpm.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
# pylint: disable = W0613
"""
<description>
This file is part of ZTC and distributed under the same license.
http://bitbucket.org/rvs/ztc/
Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
"""
import time
from ztc.check import ZTCCheck, CheckFail
import ztc.lib.flup_fcgi_client as ... | 31.712871 | 79 | 0.53606 |
f303fc453e5bd388b82d179080888aac435cbde0 | 589 | py | Python | library/tests/test_buttons.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | 1 | 2017-08-09T23:15:15.000Z | 2017-08-09T23:15:15.000Z | library/tests/test_buttons.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | library/tests/test_buttons.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'Amy'
from library.TestApp import BaseTestCase
from library.core.controls import NginxControl,PhpControl
class TestApp(BaseTestCase):
def setUp(self):
super(TestApp, self).setUp()
def tearDown(self):
super(TestApp, self).tearDown()
def test_nginx_start(self):
nginx = ... | 22.653846 | 57 | 0.660441 |
b88e0c4b99797be5f9c2480abf50aefa87a0f41e | 9,427 | py | Python | KassenberichtGenerator.py | EEaglEEyEE/JTLKassenberichtGenerator | 52d425f6e35758364b56de7512e05ce4d1d056e8 | [
"WTFPL"
] | null | null | null | KassenberichtGenerator.py | EEaglEEyEE/JTLKassenberichtGenerator | 52d425f6e35758364b56de7512e05ce4d1d056e8 | [
"WTFPL"
] | null | null | null | KassenberichtGenerator.py | EEaglEEyEE/JTLKassenberichtGenerator | 52d425f6e35758364b56de7512e05ce4d1d056e8 | [
"WTFPL"
] | null | null | null | #
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name ... | 35.980916 | 188 | 0.610693 |
b217a42354efe7142e427e945e402d0af8cc4703 | 4,490 | py | Python | zencad/geom/operations.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/geom/operations.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/geom/operations.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | from zencad.lazifier import *
from zencad.geom.shape import Shape, nocached_shape_generator, shape_generator
from OCC.Core.BRepExtrema import BRepExtrema_DistShapeShape
from OCC.Core.BRepFilletAPI import BRepFilletAPI_MakeChamfer, BRepFilletAPI_MakeFillet, BRepFilletAPI_MakeFillet2d
from OCC.Core.BRepMesh import BRepM... | 24.67033 | 114 | 0.599555 |
a23480f6f46a5826fae88d710b9fa71492bcb71f | 425 | py | Python | LeetCode_problems/Array Partition 1/solution(1).py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/Array Partition 1/solution(1).py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/Array Partition 1/solution(1).py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #we first sort the array, then we traverse the array by a step of 2 hence we get the required sum. we need the minimum value of a pair
#so if the array is [2,1,3,4] it sorts to [1,2,3,4] then it takes the sum of 1 and 3 which is required.
class Solution:
def arrayPairSum(self, nums: List[int]) -> int:
nums=... | 42.5 | 134 | 0.632941 |
02767bacd9c58666bc909df1fc25b4195a0a01d3 | 34,476 | py | Python | Packs/CortexXDR/Integrations/XQLQueryingEngine/XQLQueryingEngine.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Integrations/XQLQueryingEngine/XQLQueryingEngine.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Integrations/XQLQueryingEngine/XQLQueryingEngine.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import copy
import gzip
import hashlib
import secrets
import string
import traceback
from typing import Any, Dict, Tuple
import requests
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disab... | 39.58209 | 129 | 0.682156 |
5a2f550a120855aa680a90a6d218dd794dc46ea1 | 529 | py | Python | py-test1/py-test2.py | isdev0/sel-9-test1 | 82469a87aa3804efc4881e9a37878da912d5fc3f | [
"Apache-2.0"
] | null | null | null | py-test1/py-test2.py | isdev0/sel-9-test1 | 82469a87aa3804efc4881e9a37878da912d5fc3f | [
"Apache-2.0"
] | null | null | null | py-test1/py-test2.py | isdev0/sel-9-test1 | 82469a87aa3804efc4881e9a37878da912d5fc3f | [
"Apache-2.0"
] | null | null | null | import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
@pytest.fixture(scope='module')
def driver(request):
wd = webdriver.Firefox()
request.addfinalizer(wd.quit)
return wd
def test_adm_login(driver):
driver.get('http://rubberducks.com:8880/litecart/admi... | 31.117647 | 62 | 0.756144 |
ce9875a5413e8399efd79336237fbdcbd3530a6c | 509 | py | Python | Projects/Giffy/main.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | Projects/Giffy/main.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | Projects/Giffy/main.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | import imageio.v3 as iio
import matplotlib.pyplot as plt
import numpy as np
def rgb2gray(rgb):
return np.dot(rgb[...,:3], [0.2989, 0.5870, 0.1140])
n = 60
gif_path = "out.gif"
frames = []
for v in range(n):
data = np.random.randint(0, 255, size=(200, 200))
mask = np.fromfunction(lambda i, j: ((i + v) % 2... | 20.36 | 101 | 0.605108 |
0b582b3afab21efe4cf715c7cae37614f5e5159a | 262 | py | Python | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/08.1-Loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/08.1-Loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/08.1-Loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def is_even(number):
if number % 2 == 0:
return True
return False
even_number = []
user_input = int(input("Limit: "))
for num in range(0, user_input):
if is_even(num):
even_number.append(num)
print(f"Even numbers: {even_number}")
| 17.466667 | 37 | 0.629771 |
e7ed0d07aeba7f278b6efe4c8c0d94dee7dda59c | 734 | py | Python | Kapitel_4/_2_basic_descriptor.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | 1 | 2020-12-24T15:42:54.000Z | 2020-12-24T15:42:54.000Z | Kapitel_4/_2_basic_descriptor.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | Kapitel_4/_2_basic_descriptor.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | class Descriptor:
def __set_name__(self, owner_cls, name):
self.name = name
def __get__(self, instance, owner_cls=None):
print(f"Get {self.name!r}")
return instance.__dict__[self.name]
def __set__(self, instance, value):
print(f"Set {self.name!r} to {value!r}")
inst... | 26.214286 | 79 | 0.643052 |
685868954c949c3154e2bcea2c9e92dff6da8897 | 8,635 | py | Python | 3DNet/datasets/TReNDs.py | BhaveshJP25/RSNA | 48d85faf82651b1ae4fdcd829ce2d4978a858d3f | [
"MIT"
] | null | null | null | 3DNet/datasets/TReNDs.py | BhaveshJP25/RSNA | 48d85faf82651b1ae4fdcd829ce2d4978a858d3f | [
"MIT"
] | null | null | null | 3DNet/datasets/TReNDs.py | BhaveshJP25/RSNA | 48d85faf82651b1ae4fdcd829ce2d4978a858d3f | [
"MIT"
] | null | null | null | import os
import h5py
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import GridSearchCV, KFold,StratifiedKFold, GroupKFold, KFold
import nilearn as nl
import torch
import random
from tqdm import tqdm
import mo... | 39.072398 | 144 | 0.590272 |
688d1702f92cf1c12416f0cff71c5e2430c9f2af | 2,711 | py | Python | 21-fs-ias-lec/03-BACnetCore/src/core/node.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/03-BACnetCore/src/core/node.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/03-BACnetCore/src/core/node.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from .storage_controller import StorageController
from .com_link import ComLink, OperationModes
from .interface.owned_masterfeed import OwnedMasterFeed
from ..constants import SQLITE
class Node:
"""
This class is the main class for every Node in the BACnet. It creates all components such as the com-link and
... | 41.075758 | 115 | 0.690151 |
cc223ff1c14b50a11e927e3f1135db0fee7f5853 | 2,470 | py | Python | S5/CS331-SS/PGM_003 - Producer Consumer.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S5/CS331-SS/PGM_003 - Producer Consumer.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S5/CS331-SS/PGM_003 - Producer Consumer.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | #https://www.studytonight.com/python/python-threading-condition-object
#gedit font preferences Source Code Pro
'''
Note: the notify() and notifyAll() methods don’t release the lock; this means that the thread or threads awakened will not return from their wait() call immediately, but only when the thread that called no... | 35.797101 | 292 | 0.715789 |
accaf4cdb6f6950c27a717b8c94d51efab4d6e31 | 2,527 | py | Python | Backend/migrations/alembic/versions/296c837aaf67_create_survstat_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/296c837aaf67_create_survstat_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/296c837aaf67_create_survstat_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create survstat table
Revision ID: 296c837aaf67
Revises: d5d392162842
Create Date: 2021-03-12 17:41:02.421128
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '296c837aaf67'
down_revision = 'd5d392162842'
branch_labels = None
depends_on = None
ages = ""
for a in range(0, 80):
a... | 20.884298 | 45 | 0.619707 |
680975928a048a83ee677f5dbc8d49ae33bfe253 | 680 | py | Python | 2-resources/__DATA-Structures/Code-Challenges/cc72permutationPalindrome/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc72permutationPalindrome/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc72permutationPalindrome/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | #
from collections import Counter
import timeit
def is_permutation_palindrome(string):
unpaired_chars = set()
for char in string:
if char in unpaired_chars:
unpaired_chars.remove(char)
else:
unpaired_chars.add(char)
return len(unpaired_chars) <= 1
def is_permutation_palindrome2(string):
... | 21.935484 | 58 | 0.733824 |
4f35e60b84b561c40deeb817ba5b0b3a37ec6a56 | 5,275 | py | Python | PlaidCTF/2021/web/Pearl_U-Stor/app/app.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | PlaidCTF/2021/web/Pearl_U-Stor/app/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | PlaidCTF/2021/web/Pearl_U-Stor/app/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from flask import Flask, render_template, url_for, request, send_from_directory, send_file, make_response, abort, redirect
from forms import AppFileForm
import os
from io import BytesIO
from werkzeug.utils import secure_filename
from subprocess import Popen
import uuid
import sys
from paste.translogger import T... | 40.891473 | 125 | 0.61782 |
4f4a0ab729afd80258b75aaeebfcf85278a75a2b | 637 | py | Python | demos/System_Dynamics/prey_predator_sd/model/run.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/prey_predator_sd/model/run.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/prey_predator_sd/model/run.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | import pandas as pd
from model import config
from cadCAD.engine import ExecutionMode, ExecutionContext,Executor
from cadCAD import configs
def run():
'''
Definition:
Run simulation
'''
# Single
exec_mode = ExecutionMode()
local_mode_ctx = ExecutionContext(context=exec_mode.local_mode)
... | 26.541667 | 71 | 0.711146 |
4ff39b2a5b27aca51de5fac71c57dd9ec5f13506 | 275 | py | Python | src/using_tips/decorator/dec3.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/using_tips/decorator/dec3.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/using_tips/decorator/dec3.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | def log(func):
def wrapper(area):
print
'call %s():' % func.__name__
return func(area)
return wrapper
def now(area):
print
area, '2016-01-23'
now = log(now)
now('Beijing')
print
'The name of function now() is:', now.__name__
| 13.75 | 46 | 0.570909 |
8b1ea3e1923b29fff66477bdaf9bc60977915398 | 1,122 | py | Python | rawio/raw/metadata.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | rawio/raw/metadata.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | rawio/raw/metadata.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | #
# RawIO
# Copyright (c) 2021 Yusuf Olokoba.
#
from piexif import load as load_exif, dump as dump_exif
from PIL import Image
def exifread (image_path: str) -> dict: # INCOMPLETE # Switch to whitelist
"""
Read the EXIF dictionary from a file.
Parameters:
image_path (str): Path to image.
... | 24.933333 | 74 | 0.599822 |
8c6b3feac4cc95e58b724ebb95a164d916e199bd | 4,060 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/visualization/plot_net_speeds.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/visualization/plot_net_speeds.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/visualization/plot_net_speeds.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# 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 available at
# https://www.ec... | 38.666667 | 110 | 0.664778 |
8ca311cd2bc5ab67573cbe29594e505e30a2c2f1 | 1,332 | py | Python | library/core/ptwebpage.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | 1 | 2017-08-09T23:15:15.000Z | 2017-08-09T23:15:15.000Z | library/core/ptwebpage.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | library/core/ptwebpage.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | from PySide.QtWebKit import QWebPage
from .ptnetworkaccessmanager import PtNetworkAccessManager
import webbrowser
class PtWebPage(QWebPage):
def __init__(self, parent):
QWebPage.__init__(self, parent)
manager = PtNetworkAccessManager(self)
manager.set_proxy("127.0.0.1:8888")
self.s... | 44.4 | 126 | 0.662913 |
8cbcc4d4d1667278c220135b9e8d73b3174ac79c | 417 | py | Python | python_reference/useful_scripts/find_file.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | python_reference/useful_scripts/find_file.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | python_reference/useful_scripts/find_file.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | # Sebastian Raschka 2014
#
# A Python function to find files in a directory based on a substring search.
import os
def find_files(substring, path):
results = []
for f in os.listdir(path):
if substring in f:
results.append(os.path.join(path, f))
return results
# E.g.
# find_files(... | 23.166667 | 77 | 0.669065 |
e88127452f8513b689893088aac6b48c4dbe3287 | 271 | py | Python | Online-Judges/CodingBat/Python/Logic-01/Logic_1-04-caught_speeding.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Logic-01/Logic_1-04-caught_speeding.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Logic-01/Logic_1-04-caught_speeding.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def caught_speeding(speed, is_birthday):
if speed <= 60 or is_birthday is True and speed <= 65:
return 0
elif speed <= 80 or is_birthday is True and speed <= 85:
return 1
elif speed > 80 or is_birthday is True and speed > 85:
return 2
| 33.875 | 60 | 0.638376 |
fa60fcccfcec138fda470cfb83d8c15d8eb2095d | 411 | py | Python | simple-tensorflow-demo/3.neural network/tf_3rd_2_training_data.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-tensorflow-demo/3.neural network/tf_3rd_2_training_data.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-tensorflow-demo/3.neural network/tf_3rd_2_training_data.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | import numpy as np
import matplotlib.pyplot as plt
# 构造训练数据
train_X = np.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779, 6.182, 7.59, 2.167, 7.042, 10.791, 5.313, 7.997, 5.654, 9.27, 3.1])
train_Y = np.asarray([1.7, 2.76, 2.09, 3.19, 1.694, 1.573, 3.366, 2.596, 2.53, 1.221, 2.827, 3.465, 1.65, 2.904, 2.42, 2.94, 1.... | 29.357143 | 130 | 0.613139 |
a8eb55650d3c64a8cc7d22736d87188168bae76b | 1,367 | py | Python | leetcode-and-lintcode/DP/arithmetic_slices_982_lintcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode-and-lintcode/DP/arithmetic_slices_982_lintcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode-and-lintcode/DP/arithmetic_slices_982_lintcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | '''
Permutation, Combination, how much is added
Don't forget the context is, continuous subarray.
So the calculation formulas of Permutation and Combination don't apply.
'''
'''
Non-DP, Space O(1)
'''
class Solution1:
"""
@param A: an array
@return: the number of arithmetic slices in the array A.
"... | 21.359375 | 78 | 0.529627 |
7e2473ce5ebf177c07e496ec6d4c9e282c6275ac | 879 | py | Python | mod/units/gpa_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 1 | 2015-06-28T15:26:52.000Z | 2015-06-28T15:26:52.000Z | mod/units/gpa_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | null | null | null | mod/units/gpa_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 6 | 2015-03-20T16:36:22.000Z | 2021-08-28T07:58:18.000Z | # -*- coding: utf-8 -*-
# @Date : 2014-07-01 22:00:36
# @Author : xindervella@gamil.com
import tornado.web
from ..models.gpa import Detail as GPAD
from collections import OrderedDict
class GPAHandler(tornado.web.RequestHandler):
@property
def db(self):
return self.application.db
... | 28.354839 | 72 | 0.588168 |
0e297b2c95c4f81d337027512d3154e1afab7019 | 913 | py | Python | DCM/programs/bilinearModel.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | 1 | 2018-04-20T07:44:11.000Z | 2018-04-20T07:44:11.000Z | DCM/programs/bilinearModel.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | null | null | null | DCM/programs/bilinearModel.py | l-althueser/NiMoNa_DCM16 | d93ee253ade8ccb4da1f17a91f064258adcf29c0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Tobias
Timo
Beschreibung:
Implementierung des bilinearen Modells zur Simulation der Hirnaktivität als Reaktion
auf einen äußeren Stimulus
Funktionsweise:
Die Zustandgleichungen werden mit dem RK4 oder Eulerverfahren gelöst. Um eine Simulation zu starten, müssen folgende S... | 29.451613 | 149 | 0.685652 |
7ee6db1839dca7ddd5a36d20b1c6e72ed0026fb1 | 1,016 | py | Python | OMH/2021/crypto/cry_for_help/cry_for_help.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | OMH/2021/crypto/cry_for_help/cry_for_help.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | OMH/2021/crypto/cry_for_help/cry_for_help.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import random
import flag
import collections
import os
import pow
def xorshift64(x):
x ^= (x << 13) & 0xffffffffffffffff
x ^= (x >> 7) & 0xffffffffffffffff
x ^= (x << 17) & 0xffffffffffffffff
return x
def main():
r = os.urandom(10)
random.seed(r)
SEEDS = 18
seed = input("give me the seed: ")
seed = seed.st... | 18.142857 | 61 | 0.628937 |
382c38ad3bc07f410983f32922400f6bfc98e253 | 4,119 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# (c) 2016 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, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | 38.495327 | 103 | 0.706239 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.