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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7482a38f2007aa06c1e256fd7a87e012c082db11 | 19 | py | Python | RDS/circle3_central_services/research_manager/src/api/User/Research/Exports/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/api/User/Research/Imports/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/api/User/Research/Exports/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from .port import * | 19 | 19 | 0.736842 |
24a1e5763bdca4699fdfa7780b8f9098058dc206 | 1,691 | py | Python | Packs/Campaign/Scripts/ShowCampaignLastIncidentOccurred/ShowCampaignLastIncidentOccurred_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/ShowCampaignLastIncidentOccurred/ShowCampaignLastIncidentOccurred_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/ShowCampaignLastIncidentOccurred/ShowCampaignLastIncidentOccurred_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import pytest
import ShowCampaignLastIncidentOccurred
INCIDENT_IDS = [{"id": '1'}, {"id": '2'}, {"id": '3'}]
MULTIPLE_INCIDENT_CREATED = [
{
'Contents': '[{"created": "2021-07-27T15:09:35.269187268Z"}, {"created": "2021-07-28T15:06:33.100736309Z"}, \
{"... | 35.229167 | 118 | 0.644589 |
24daae4de5200a1f934639f4dddd7756332d6e70 | 2,676 | py | Python | master/generatesprites.py | dotlambda/metro-hd | 097359a45dc1e4f0802678e8ad4017e7d420e8fa | [
"MIT"
] | 3 | 2018-01-20T18:59:11.000Z | 2021-04-09T11:17:27.000Z | master/generatesprites.py | dotlambda/metro-hd | 097359a45dc1e4f0802678e8ad4017e7d420e8fa | [
"MIT"
] | null | null | null | master/generatesprites.py | dotlambda/metro-hd | 097359a45dc1e4f0802678e8ad4017e7d420e8fa | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import os
from skimage import io
from numpy import transpose
from math import ceil
with open('sprites.h', 'w') as hfile:
with open('sprites.c', 'w') as cfile:
hfile.write('#ifndef SPRITES_H\n#define SPRITES_H\n\n')
hfile.write('#include <inttypes.h>\n\n')
hfile.writ... | 41.8125 | 102 | 0.381166 |
7021aa479018fe680ea48c69a53fd1871ba349f3 | 546 | py | Python | exercises/pt/test_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/test_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/test_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
doc.text == "Eu tenho três cachorros e dois gatos."
), "Verifique se você processou o texto corretamente..."
assert (
tres_cachorros == doc[2:4]
), "Tem certeza que você selecionou a partição correta para tres_cachorros?"
assert (
tres_cachorros_dois_gato... | 42 | 91 | 0.67033 |
70a6059534d5fb118674704fa49aa143012cd043 | 433 | py | Python | src/aijack/attack/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | src/aijack/attack/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/attack/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:46.000Z | 2022-03-17T21:17:46.000Z | from .base_attack import BaseAttacker # noqa: F401
from .evasion import Evasion_attack_sklearn # noqa: F401
from .inversion import ( # noqa: F401
MI_FACE,
GAN_Attack,
Generator_Attack,
GradientInversion_Attack,
)
from .labelleakage import SplitNNNormAttack # noqa: F401
from .membership import Attack... | 36.083333 | 86 | 0.775982 |
8dd48144533ee56b4d00d27a2b616e45afed73e1 | 1,875 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_join.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_join.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_join.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformLength(unittest.TestCase):
def setUp(self):
self.data = {
"list": ["Das", "ist", "ein", "Testfall"]
}
def test_join(self):
values = [
{
... | 26.408451 | 86 | 0.4384 |
d6cb3a8018e3f17681deab1fcf90d636a5b8f972 | 6,798 | py | Python | tests/onegov/core/test_security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
import onegov.core.security
from onegov.core.framework import Framework
from onegov.core.security import Public, Personal, Private, Secret
from onegov.core.security import forget, remembered
from webtest import TestApp as Client
def spawn_basic_permissions_app(redis_url):
class App(Framework):
... | 34.507614 | 78 | 0.670197 |
d6e4272c4b36f3d9c7195d84349a44dd22f5ac15 | 679 | py | Python | models/hr_applicant_qualification.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_applicant_qualification.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_applicant_qualification.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | 3 | 2017-09-11T08:02:11.000Z | 2020-04-04T08:13:23.000Z | # -*- coding: utf-8 -*-
from openerp import api, exceptions, fields, models, _
class HrApplicantQualification(models.Model):
""" gestion des qualifications """
_name = 'hr.applicant.qualification'
_description = 'Qualification'
date = fields.Datetime(string='Date')
name = fields.Many2one(strin... | 35.736842 | 85 | 0.715758 |
240702d0aaf9c29cea5791887e0a264998bc2dcf | 1,219 | py | Python | Uebung2/Uebung2_Aufgabe4_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung2/Uebung2_Aufgabe4_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung2/Uebung2_Aufgabe4_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | from math import sqrt
# gesucht alle Primzahlpaare zwischen 10101 und 10901
p = 10101
# ab welcher Zahl soll geprüft werden?
ende = 10901
# bis welche Zahl soll geprüft werden?
while p <= (ende - 2):
# ende-2, damit 10901 letztmögliches Teil eines Primzahlzwillings ist.
teiler = 2
while teiler <= int(s... | 31.25641 | 89 | 0.561936 |
ebf6a68de80afd2b8081f4e4af870753c1190b60 | 861 | py | Python | update_gtn_posts.py | beatrizserrano/website | 73f915c1375169b2e8d0a2ec7da0b5e6eabe8fd5 | [
"MIT"
] | 14 | 2018-03-19T12:52:46.000Z | 2022-03-25T16:27:22.000Z | update_gtn_posts.py | beatrizserrano/website | 73f915c1375169b2e8d0a2ec7da0b5e6eabe8fd5 | [
"MIT"
] | 451 | 2018-02-23T23:08:51.000Z | 2022-03-25T15:27:04.000Z | update_gtn_posts.py | beatrizserrano/website | 73f915c1375169b2e8d0a2ec7da0b5e6eabe8fd5 | [
"MIT"
] | 98 | 2018-03-06T09:16:33.000Z | 2022-03-25T15:22:44.000Z | #!/usr/bin/env python
import feedparser
feedparser.sanitizer._HTMLSanitizer.acceptable_elements.remove('a')
feedparser.sanitizer._HTMLSanitizer.acceptable_elements.remove('img')
feeds = feedparser.parse('https://training.galaxyproject.org/training-material/feed.xml')
for entry in feeds.entries:
feed_title = f'[G... | 27.774194 | 89 | 0.70151 |
004806698c4004c9146b35ef0b86d4a98f2d66c0 | 1,446 | py | Python | research/nlp/textrcnn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/textrcnn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/textrcnn/postprocess.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.15 | 78 | 0.656985 |
c9f336a8417c4aa5182cb7692f0bfb9859fee4e5 | 4,207 | py | Python | SQL_python/DataBasePython/create_tab_animal.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | SQL_python/DataBasePython/create_tab_animal.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | SQL_python/DataBasePython/create_tab_animal.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | import psycopg2
from random import randint
import random
import time
import random
import sys
# from config import config
# random date
def strTimeProp(start, end, format):
stime = time.mktime(time.strptime(start, format))
etime = time.mktime(time.strptime(end, format))
ptime = stime + random.random() *... | 27.860927 | 159 | 0.553601 |
0167f238ca4a8e2f0ba25ebe6443c54868c027fd | 209 | py | Python | WD/Cwiczenia/obliczenia/wielokrotnosc4.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | 1 | 2020-02-29T14:38:33.000Z | 2020-02-29T14:38:33.000Z | WD/Cwiczenia/obliczenia/wielokrotnosc4.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | WD/Cwiczenia/obliczenia/wielokrotnosc4.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | #Chcemy napisać funkcję, która generuje liczby
#które są wielokrotnością 4
#Wykorzystamy Python Comprehension
def wielokrotnosc4(ile):
liczby=[x for x in range(4,(ile+1)*4,4) ]
return liczby
| 23.222222 | 47 | 0.717703 |
6df3ee96846cd61f3340b0cc010dfcbdafb582cf | 660 | py | Python | main.py | balazsgyenes/produktionsdaten | fb5741bed222eb178c83fe2f775756ef3c5d696a | [
"MIT"
] | null | null | null | main.py | balazsgyenes/produktionsdaten | fb5741bed222eb178c83fe2f775756ef3c5d696a | [
"MIT"
] | null | null | null | main.py | balazsgyenes/produktionsdaten | fb5741bed222eb178c83fe2f775756ef3c5d696a | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
filepath = "Produktionsdaten.xlsx"
# load spreadsheet as a dict of DataFrame
# setting sheet_name=None loads all sheets, not just the first one
data = pd.read_excel(filepath, sheet_name=None)
print(data)
# get the data just for 2017.
# The 3 DataFrames are called "2017", "2018"... | 28.695652 | 67 | 0.772727 |
09d6252221add9d15750a202379b0ce43e743cca | 1,055 | py | Python | python/en/archive/dropbox/udacity-ds_and_algos/2-strings-string_reverser.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/udacity-ds_and_algos/2-strings-string_reverser.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/udacity-ds_and_algos/2-strings-string_reverser.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
def string_reverser(our_string):
"""
Reverse the input string
Args:
our_string(string): String to be reversed
Returns:
string: The reversed string
"""
# TODO: Write your soluti... | 28.513514 | 124 | 0.602844 |
fec7a1b1a623d33df921f0e4f91936339e519bd7 | 327 | py | Python | src/bo4e/enum/nnrechnungsart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/nnrechnungsart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/nnrechnungsart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class NNRechnungsart(StrEnum):
"""
Abbildung verschiedener in der INVOIC angegebenen Rechnungsarten.
"""
HANDELSRECHNUNG = "HANDELSRECHNUNG" #: HANDELSRECHNUNG
SELBSTAUSGESTELLT = "SELBSTAUSGESTELLT" #: SELBSTAUSGE... | 27.25 | 69 | 0.755352 |
c902d7114ae705466bb70e92b5a55da52984533b | 1,307 | py | Python | Hello coding/Chap1_exam.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | Hello coding/Chap1_exam.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | Hello coding/Chap1_exam.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | # Coded by Sungwook Kim
# Date: 2019-07-30
# Python version: 3.6.5
# IDE: Spyder 3
'''
1. 128개의 이름이 정렬되어 있는 리스트가 있습니다. 이진 탐색으로 이름을 찾을 때 필요한 최대의 추측 횟수는 얼마일까요?
2. 만약 리스트의 크기가 두 배가 된다면 최대 추측 횟수는 어떻게 될까요?
다음 각각의 실행 시간을 빅오 표기법으로 표시하세요.
3. 어떤 사람의 이름을 알고 있습니다. 전화번호부에서 이 사람의 전화번호를 찾고 싶습니다.
4. 전화번호가 있습니다. 전화번호부에서 이 전... | 25.627451 | 81 | 0.672533 |
42fa1863940bdf5716853a366d45cd0cce2a90ae | 1,234 | py | Python | python_project/python/PythonProj/ReadWriteFile.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | python_project/python/PythonProj/ReadWriteFile.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | python_project/python/PythonProj/ReadWriteFile.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | outfile=open("helloworld.txt","w")
for num1 in range(1,10):
for num2 in range(1,10):
if num2<=num1 :
outfile.write("{}*{}={} ".format(num2, num1 ,num1 * num2))
outfile.write(" \n")
outfile.flush()
outfile.close()
infile=open("helloworld.txt","r")
for line in infile.readlines():
print... | 18.69697 | 70 | 0.632901 |
66bc68afe51a55517be4d346c72a2a16310bc3de | 3,252 | py | Python | web-scraping-tools/wingif.py | SonOfLysander/python-experiments | 526c69bd6f561858465706dd50cf096434ee2947 | [
"MIT"
] | null | null | null | web-scraping-tools/wingif.py | SonOfLysander/python-experiments | 526c69bd6f561858465706dd50cf096434ee2947 | [
"MIT"
] | null | null | null | web-scraping-tools/wingif.py | SonOfLysander/python-experiments | 526c69bd6f561858465706dd50cf096434ee2947 | [
"MIT"
] | null | null | null | __author__ = 'paulbaker'
'''
wingif.py aka: My Lazy Meme Getter
'''
import sys
from os import path
import os
import requests
from lxml import html
import re
def load_page(page_url):
print('Parsing ' + page_url)
r = requests.get(page_url)
tree = html.fromstring(r.text)
image_links = tree.xpath('//a[... | 36.133333 | 111 | 0.592866 |
dd4650bdc7629f2947334e641a1a2ce7900a2737 | 504 | py | Python | game1/Welcome.py | JordanG8/Bahr | 03911f3ac7275f46abc510cf85c8850c31572203 | [
"MIT"
] | null | null | null | game1/Welcome.py | JordanG8/Bahr | 03911f3ac7275f46abc510cf85c8850c31572203 | [
"MIT"
] | null | null | null | game1/Welcome.py | JordanG8/Bahr | 03911f3ac7275f46abc510cf85c8850c31572203 | [
"MIT"
] | null | null | null | def welcome():
print("Hello players! Welcome to Bahr's Digital Dice Games!\nTo try out your digital dice enter 'roll'\nYou can also pass by entering 'pass'")
while True:
inp1 = input()
if inp1 == "roll":
from DicesSet import d6_2Set
print("Great!\nYour roll is:" + s... | 38.769231 | 147 | 0.535714 |
059c212a2be618aa26673b56ea80d2cf45f8227f | 313 | py | Python | hist_find/term.py | szopu/hist-find | c594c81896223b5e0a15953b3756e9433ae1204d | [
"MIT"
] | 1 | 2017-07-09T17:26:29.000Z | 2017-07-09T17:26:29.000Z | hist_db/term.py | apragacz/hist-db | a2631a7eab004499dae98a0495bc17ee78c6be8a | [
"MIT"
] | null | null | null | hist_db/term.py | apragacz/hist-db | a2631a7eab004499dae98a0495bc17ee78c6be8a | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
import fcntl
import termios
def fill_terminal(line):
for c in line:
fcntl.ioctl(0, termios.TIOCSTI, c)
def escape_single_quote(text):
segments = text.split('\'')
return '"\'"'.join('\'' + s + '\'' for s in segments)
| 22.357143 | 72 | 0.680511 |
a55b398ada521adef5d035461908371d9e357853 | 1,889 | py | Python | Python/stone_paper_scissor.py | saurabhpal007/hacktoberfest2021-1 | 5abad37ab426a7b34fc7bcd98ded885fd6ce02ef | [
"CC0-1.0"
] | 81 | 2021-10-01T13:19:13.000Z | 2021-10-06T08:43:35.000Z | Python/stone_paper_scissor.py | saurabhpal007/hacktoberfest2021-1 | 5abad37ab426a7b34fc7bcd98ded885fd6ce02ef | [
"CC0-1.0"
] | 67 | 2021-10-01T13:43:46.000Z | 2021-10-06T13:55:49.000Z | Python/stone_paper_scissor.py | saurabhpal007/hacktoberfest2021-1 | 5abad37ab426a7b34fc7bcd98ded885fd6ce02ef | [
"CC0-1.0"
] | 394 | 2021-10-01T11:55:24.000Z | 2021-10-06T13:45:57.000Z | // this is stone paper scissor game in python
import random
print("STONE PAPER SCISSOR GAME")
print(''' s for Stone
p for paper
x for scissor ''')
lt = ["s","p","x"]
u_score = 0
bot_score = 0
tot_chances = 10
no_of_choices = 0
while(no_of_choices < tot_chances):
user = input("Enter you... | 28.19403 | 70 | 0.524087 |
a5712c76dccd8646cf19d1ea4b1d52c051235a81 | 1,383 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v9_0/student_admission_childtable_migrate.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/v9_0/student_admission_childtable_migrate.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_0/student_admission_childtable_migrate.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
# 'Schools' module changed to the 'Education'
# frappe.reload_doc('schools', 'doctype', 'Student Admission Program')
# frappe.reload_doc('scho... | 43.21875 | 94 | 0.764281 |
592fd82b1cdf1366783240396f4bbcf20ac49d14 | 71 | py | Python | GetUserAge.py | Abdalrahman-Nasr/YS | 5c341bccf7d9fa111aedb207c2ac45780f5fe78c | [
"MIT"
] | null | null | null | GetUserAge.py | Abdalrahman-Nasr/YS | 5c341bccf7d9fa111aedb207c2ac45780f5fe78c | [
"MIT"
] | null | null | null | GetUserAge.py | Abdalrahman-Nasr/YS | 5c341bccf7d9fa111aedb207c2ac45780f5fe78c | [
"MIT"
] | null | null | null | def getuserage():
age = input("Please Enter Your age: ")
return age
| 14.2 | 39 | 0.676056 |
3cb5cbad8aec7f79c211b45907b020e80e5e419b | 61 | py | Python | test/window_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/window_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/window_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | import tkinter as tk
top = tk.Tk()
# 进入消息循环
top.mainloop()
| 8.714286 | 20 | 0.672131 |
3ce20223fc099367c763aa88022296d49ebc4b2b | 673 | py | Python | nz_crawl_demo/day2/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from urllib import request
import json
headers = {
"User-Agent":"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11",
}
for i in range(10):
url = "https://movie.douban.com/j/search_subjects?type=movie&tag=%E7%83%AD%E9%97%A8&page_limit=50&page_start="+"%s" %(i*20)
req = request... | 35.421053 | 127 | 0.641902 |
a71316f01cba40cab997ef1587cbde82fa59b9b9 | 1,029 | py | Python | coding-200/chapter13/asyncio_lock.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | coding-200/chapter13/asyncio_lock.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | coding-200/chapter13/asyncio_lock.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # total = 0
#
# async def add():
# #1. dosomething1
# #2. io操作
# # 1. dosomething3
# global total
# for i in range(1000000):
# total += 1
#
# async def desc():
# global total
# for i in range(1000000):
# total -= 1
#
# if __name__ == "__main__":
# import asyncio
# tas... | 20.58 | 50 | 0.610301 |
59cf2cf181d0065634e22f63429e30477f26985c | 1,805 | py | Python | imwievaluation/utils.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/utils.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/utils.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | from unidecode import unidecode
def clean_string(string):
# only allow alphanumeric ascii characters
clean_string = ''.join(ch for ch in string if (ch.isalnum()
or (ch == ' ')))
clean_string = unidecode(clean_string)
return clean_string
def get_or_c... | 31.12069 | 111 | 0.648199 |
59e84ae7539039a720bfb02883eb15d11b202800 | 1,264 | py | Python | pyntcloud/ransac/models.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/ransac/models.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/ransac/models.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z |
import numpy as np
from abc import ABC, abstractmethod
from ..geometry import Plane, Sphere
class RansacModel(ABC):
"""
Base class for ransac models.
Parameters
----------
max_dist : float
Treshold distance to consider a point as an inlier.
"""
def __init__(self, max_dist=1e-4):... | 21.793103 | 64 | 0.621835 |
abd787838b1695de87d4cb6472dcca3b0fd09be9 | 5,236 | py | Python | src/onegov/translator_directory/collections/translator.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/collections/translator.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/collections/translator.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from sqlalchemy import desc, and_, or_
from onegov.core.collection import GenericCollection, Pagination
from onegov.gis import Coordinates
from onegov.translator_directory.constants import full_text_max_chars
from onegov.translator_directory.models.translator import Translator
order_cols = (
'last_name',
'driv... | 29.75 | 79 | 0.62013 |
e9651b922fd86b9f34877f8ae037cb39162a8b63 | 609 | py | Python | tests/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 17 | 2020-11-20T15:58:02.000Z | 2022-02-06T19:18:20.000Z | tests/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 3 | 2021-02-17T13:47:44.000Z | 2021-10-14T13:53:15.000Z | tests/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 6 | 2020-11-23T09:51:26.000Z | 2022-02-11T13:46:57.000Z | import argparse
import os
from universal_build import build_utils
HERE = os.path.abspath(os.path.dirname(__file__))
os.chdir(HERE)
if __name__ == "__main__":
# Custom CLI arguments
parser = argparse.ArgumentParser()
parser.add_argument(
"--deployment-token", help="This is a custom token.", defau... | 27.681818 | 88 | 0.706076 |
e996b6fc8184f1baf44e24c62dee48dabd3c9fa0 | 4,850 | py | Python | app.py | NETMVAS/feecc-agent-geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | 1 | 2021-05-13T09:03:51.000Z | 2021-05-13T09:03:51.000Z | app.py | arseniiarsenii/robonomics_qa_geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | null | null | null | app.py | arseniiarsenii/robonomics_qa_geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | 1 | 2021-05-24T15:45:01.000Z | 2021-05-24T15:45:01.000Z | from flask import Flask, request, Response
from flask_restful import Api, Resource
import typing as tp
import logging
import yaml
from sys import exit
import threading
from Agent import Agent
from Passport import Passport
# set up logging
logging.basicConfig(
level=logging.INFO,
filename="agent.log",
form... | 26.648352 | 119 | 0.604948 |
f9cd7972cc8eabbcc59ffbc9b6a71944f20975c5 | 8,610 | py | Python | blockchain/read.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | 1 | 2018-08-31T07:16:40.000Z | 2018-08-31T07:16:40.000Z | blockchain/read.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | null | null | null | blockchain/read.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | 1 | 2018-07-01T18:03:01.000Z | 2018-07-01T18:03:01.000Z | """
__author__ = Yash Patel
__name__ = __init__.py
__description__ = Part that constructs the graph given the input data dump
"""
import pickle
import os
import subprocess
import struct
import networkx as nx
import numpy as np
from networkx.drawing.nx_agraph import write_dot
from scipy.sparse import d... | 37.434783 | 101 | 0.61475 |
b5bb05a3919639d5e950ff959b05969ee717771b | 408 | py | Python | aoc2020/day_01/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_01/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_01/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
class Solution(SolutionABC):
expected = 514579
def solve(self) -> any:
return self.find_sum(2020, self.resource_lines("input", int))
@classmethod
def find_sum(cls, target, data) -> any:
members = set()
for n in data:
if target - n in members:... | 22.666667 | 69 | 0.561275 |
1f08a4fcb317239e545cc58e7f4b2e049bb9b96c | 184 | py | Python | evaluator/examples/submission_example/project_id/sample.py | jasmaa/submit-server | dafa919bcde2b56d59c91e2c9bee939bbb0c2dc3 | [
"MIT"
] | 1 | 2020-01-29T23:55:41.000Z | 2020-01-29T23:55:41.000Z | evaluator/examples/submission_example/project_id/sample.py | jasmaa/submit-server | dafa919bcde2b56d59c91e2c9bee939bbb0c2dc3 | [
"MIT"
] | null | null | null | evaluator/examples/submission_example/project_id/sample.py | jasmaa/submit-server | dafa919bcde2b56d59c91e2c9bee939bbb0c2dc3 | [
"MIT"
] | 1 | 2020-01-29T23:55:45.000Z | 2020-01-29T23:55:45.000Z |
def add(a, b):
"""Buggy add"""
while True:
pass
return a + b if a == 0 else a
def from_zero(x):
return list(range(x))
def prints_hello():
print("hello")
| 14.153846 | 33 | 0.543478 |
c096e06f3457e03e660e33ed096284077ff92fa2 | 386 | py | Python | 2-resources/_PYTHON/code-examples-master/elasticsearch/python/es_bulk_ingest.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/elasticsearch/python/es_bulk_ingest.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/elasticsearch/python/es_bulk_ingest.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | from elasticsearch import Elasticsearch, helpers
es = Elasticsearch(
hosts = [{'host': 'es-domain.es.amazonaws.com', 'port': 443}],
use_ssl=True, verify_certs=True
)
bulk_docs = []
list_of_dicts = [{"name": "ruan", "age": 32}, {"name": "stefan", "age": 31}]
for doc in list_of_dicts:
doc['_index'] = 'my-... | 24.125 | 76 | 0.647668 |
f1ab293b4b229bdd0967d321e3b7a5e519773c90 | 2,101 | py | Python | routes/account.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | routes/account.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | routes/account.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | import flask
from flask import Blueprint, redirect, url_for, request, render_template, flash
from flask_discord import Unauthorized
from globals import discord, login_redirects, app
views = Blueprint("account", __name__)
@views.route("/login/")
def login():
if discord.authorized:
return redirect(url_for(... | 36.859649 | 161 | 0.702999 |
cdf1322f135e541f44bd0f7ddb0a7feb78072b4f | 347 | py | Python | src/bo4e/enum/kontaktart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/kontaktart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/kontaktart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Kontaktart(StrEnum):
"""
Art des Kontaktes zwischen Geschäftspartnern.
"""
ANSCHREIBEN = "ANSCHREIBEN" #: Anschreiben
TELEFONAT = "TELEFONAT" #: Telefonat
FAX = "FAX" #: Fax
E_MAIL = "E_MAIL" #: Ema... | 21.6875 | 49 | 0.645533 |
a83668f8b04a9bf20f9ecc5fab1322165893732f | 419 | py | Python | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/08.09-Fibonacii.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/08.09-Fibonacii.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/08.09-Fibonacii.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | # def fibonacii(n):
# if (n <= 1):
# return n
# return fibonacii(n-1) + fibonacii(n-2)
# print(fibonacii(0), end=" ")
# print(fibonacii(1), end=" ")
# print(fibonacii(2), end=" ")
# print(fibonacii(3), end=" ")
# print(fibonacii(4), end=" ")
# print(fibonacii(5), end=" ")
def fib(len):
fb = [0,... | 18.217391 | 44 | 0.529833 |
b54ab702ae97a26c59aafdfc91773e6af722a78e | 932 | py | Python | static/posts/weak-dh-parameters/pem-dhgen.py | Enteee/duckpond.ch | 9fbcf5b684f3ebe63f054a9f3f59012298af90a4 | [
"MIT"
] | 1 | 2016-09-14T02:59:51.000Z | 2016-09-14T02:59:51.000Z | static/posts/weak-dh-parameters/pem-dhgen.py | Enteee/Enteee.github.io | a495f650a626f6aa4d90b46d86c0fb2b3416341c | [
"MIT"
] | 3 | 2016-05-24T16:13:00.000Z | 2016-06-04T12:07:40.000Z | static/posts/weak-dh-parameters/pem-dhgen.py | Enteee/duckpond.ch | 9fbcf5b684f3ebe63f054a9f3f59012298af90a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import base64
import textwrap
from math import *
from pyasn1.type import univ
from pyasn1.codec.ber import encoder
def usage():
"""print usage"""
print( """Usage: {} prime generator
NOTE: Numbers in hexadecimal""".format(sys.argv[0]))
sys.exit(-1)
PEM_LINE_LENGTH = 6... | 22.731707 | 60 | 0.633047 |
93d8c9078150bb269a1eecbb57af16570ea3f172 | 949 | py | Python | chapter100/meilisearch_02.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter100/meilisearch_02.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter100/meilisearch_02.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | import time
from datetime import datetime
from meilisearch import Client
start = datetime.now()
client = Client("http://127.0.0.1:7700", "password")
client.create_index("index_name")
package = []
_id = 0
with open("utils/trash.csv") as file:
for line in file.readlines():
name, description = line.split(... | 20.630435 | 61 | 0.596417 |
f50cb677564481013bee164a93b2735ada03c991 | 8,277 | py | Python | SLIX/visualization.py | oliviaguest/SLIX | 2f19382c650267d0a76456c796cd3e0afe04d880 | [
"MIT"
] | null | null | null | SLIX/visualization.py | oliviaguest/SLIX | 2f19382c650267d0a76456c796cd3e0afe04d880 | [
"MIT"
] | null | null | null | SLIX/visualization.py | oliviaguest/SLIX | 2f19382c650267d0a76456c796cd3e0afe04d880 | [
"MIT"
] | null | null | null | import numpy
import pymp
from matplotlib import pyplot as plt
from PIL import Image
import copy
from . import toolbox
CPU_COUNT = toolbox.CPU_COUNT
def unit_vectors(directions):
"""
Calculate the unit vectors (UnitX, UnitY) from a given direction angle.
Parameters
----------
directions: 3D NumPy... | 44.983696 | 144 | 0.664613 |
f535365f9a6c046bae6950697d5fd92365924f39 | 8,855 | py | Python | resources/mechanics_lib/api/edge.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/api/edge.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/api/edge.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z | import numpy as np
from api.symbolic import LinearExpr
class EdgeType:
"""
Values for the different modes of Edge instances
"""
( REG,
CUT,
FOLD,
FLEX,
FLAT,
NOEDGE
) = range(6)
def __init__(self, edgetype, angle=0):
self.edgetype = edgetype
self.angle = angle
def __repr__(s... | 27.246154 | 147 | 0.602259 |
f556eeae30504e5ca02332ee73779cd94cfdc71c | 2,253 | py | Python | hdg_test/2d/cg_test.py | BradHub/SL-SPH | 7bc86253277d27cbb04a9b5935fd4fc056266371 | [
"MIT"
] | 1 | 2018-02-19T01:52:58.000Z | 2018-02-19T01:52:58.000Z | hdg_test/2d/cg_test.py | BradHub/SL-SPH | 7bc86253277d27cbb04a9b5935fd4fc056266371 | [
"MIT"
] | null | null | null | hdg_test/2d/cg_test.py | BradHub/SL-SPH | 7bc86253277d27cbb04a9b5935fd4fc056266371 | [
"MIT"
] | null | null | null | import numpy as np
import dolfin
from dolfin import *
from mpi4py import MPI as pyMPI
comm = pyMPI.COMM_WORLD
mpi_comm = MPI.comm_world
#load mesh,boundaries and coefficients from file
mark = {"Internal":0, "wall": 1,"inlet": 2,"outlet": 3 }
#read mesh and boundaries from file
mesh = Mesh()
hdf = HDF5File(mesh.mpi_... | 28.884615 | 126 | 0.689747 |
192f90f5c92bc53db45f88f98b6937522e01a461 | 1,297 | py | Python | dialogs/main_dialog.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | null | null | null | dialogs/main_dialog.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | null | null | null | dialogs/main_dialog.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | 2 | 2020-03-22T11:38:54.000Z | 2020-03-24T11:11:56.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from botbuilder.dialogs import (
ComponentDialog,
WaterfallDialog,
WaterfallStepContext,
DialogTurnResult,
)
from botbuilder.core import MessageFactory, UserState
from data_models import UserProfile
from dial... | 30.880952 | 87 | 0.734002 |
279f949328bb0ad7ed3ea5a8ab9d83a81bb2a870 | 1,110 | py | Python | Hackerrank_problems/kangaroo/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/kangaroo/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/kangaroo/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #
# working
# the trick to this problem is understanding where both kangaroos will coincide
# case1: if either one of the kangaroo has start position and jump distance greater than the other one
# both kangaroos can never meet
# case2: both kangaroos can only meet if (x2-x1) % (v2-v1) is equal to 0... | 29.210526 | 103 | 0.609009 |
8bba69bbee47f6772d4182e18f89efcd98a0884e | 1,458 | py | Python | test.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 5 | 2015-07-28T17:45:21.000Z | 2019-11-24T15:47:01.000Z | test.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-22T15:21:36.000Z | 2020-05-22T15:38:48.000Z | test.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-09T21:23:59.000Z | 2020-05-09T21:23:59.000Z | #!/usr/bin/python
#Copyright (c) 2014 Gary Furnish
#Licensed under the MIT License (MIT)
import platform, json, os
from utilities import printing_chdir, printing_mkdir, do_cmake, printing_system
import multiprocessing
num_cores=multiprocessing.cpu_count()
from multiprocessing import Pool
with open("settings.json") as... | 45.5625 | 266 | 0.806584 |
7bdd8eab867bd2ecc6b94de8e0b2e6317254301e | 756 | py | Python | source/api/ptp_connector.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2018-04-07T14:56:12.000Z | 2020-03-26T12:06:51.000Z | source/api/ptp_connector.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2018-04-07T14:55:31.000Z | 2018-04-25T07:43:29.000Z | source/api/ptp_connector.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2019-09-06T22:31:43.000Z | 2020-03-26T12:06:51.000Z | from api.api_config import APIConfig
from lib.ptp.src.twitter import Twitter
class PTPConnector:
@staticmethod
def start_bot(access_info, method, args):
"""
Creates an PTP object and starts it.
:param access_info:
:param method:
:param args:
:return:
"""... | 28 | 66 | 0.617725 |
4bffcc62178dc8813c3c587598d842f31bdf91ce | 894 | py | Python | qmk_firmware/lib/python/qmk/datetime.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/lib/python/qmk/datetime.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/datetime.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Functions to work with dates and times in a uniform way.
The results of these functions are cached for 5 seconds to provide uniform time strings across short running processes. Long running processes that need more precise timekeeping should not use these functions.
"""
from time import gmtime, strftime
from qmk.c... | 29.8 | 209 | 0.748322 |
3245055a15f6baa3c140868077112cd8cb30048a | 3,013 | py | Python | research/cv/wideresnet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/wideresnet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/wideresnet/eval.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... | 35.869048 | 97 | 0.686691 |
32612b44ac231be177a963dfd423193e1e6da7bb | 28 | py | Python | hello.py | qq727923587/silver-spork | b64d114133ab45c36167a6ab43c76a26aea9894a | [
"Apache-2.0"
] | null | null | null | hello.py | qq727923587/silver-spork | b64d114133ab45c36167a6ab43c76a26aea9894a | [
"Apache-2.0"
] | null | null | null | hello.py | qq727923587/silver-spork | b64d114133ab45c36167a6ab43c76a26aea9894a | [
"Apache-2.0"
] | null | null | null | print("hello")
import pytest | 14 | 14 | 0.785714 |
089706c3823800dd03c9d9142dd2d44c951ecc8b | 920 | py | Python | Packs/CortexXDR/Scripts/CortexXDRAdditionalAlertInformationWidget/CortexXDRAdditionalAlertInformationWidget_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Scripts/CortexXDRAdditionalAlertInformationWidget/CortexXDRAdditionalAlertInformationWidget_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Scripts/CortexXDRAdditionalAlertInformationWidget/CortexXDRAdditionalAlertInformationWidget_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
import io
import pytest
from CommonServerPython import *
import CortexXDRAdditionalAlertInformationWidget
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
@pytest.mark.parametrize('context_data, expected_result', [
(util_load_json('test_data... | 40 | 105 | 0.766304 |
eb23aa55dfab7629d823682edc6d613ea9ab60e4 | 2,681 | py | Python | data-structures/ds-que/python3/queue.py | NuclearCactus/FOSSALGO | eb66f3bdcd6c42c66e8fc7110a32ac021596ca66 | [
"MIT"
] | 59 | 2018-09-11T17:40:25.000Z | 2022-03-03T14:40:39.000Z | data-structures/ds-que/python3/queue.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 468 | 2018-08-28T17:04:29.000Z | 2021-12-03T15:16:34.000Z | data-structures/ds-que/python3/queue.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 253 | 2018-08-28T17:08:51.000Z | 2021-11-01T12:30:39.000Z | class Queue():
def __init__(self):
"""Initialize this queue to the empty queue."""
self.queue = list()
self.rear = -1
self.front = 0
self.size = 0
def enqueue(self, data):
"""If queue already full can't add element further."""
if self.is_full():
... | 26.81 | 81 | 0.445729 |
eb399e8ca3fe5084061b40e772eea0774461cc3c | 908 | py | Python | scripts/test_vector_sizes.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | scripts/test_vector_sizes.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | scripts/test_vector_sizes.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import os, sys, re
from python_helpers import open_utf8
vector_sizes = [2]
current_dir = os.getcwd()
build_dir = os.path.join(os.getcwd(), 'build', 'release')
def execute_system_command(cmd):
print(cmd)
retcode = os.system(cmd)
print(retcode)
if retcode != 0:
raise Exception
def replace_in_file(fname, regex, ... | 31.310345 | 149 | 0.753304 |
eb3a5431135b7e419bfbae795900890dd6e05c7b | 915 | py | Python | 2018/beginners/pwn-poetry/src/exploit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/beginners/pwn-poetry/src/exploit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/beginners/pwn-poetry/src/exploit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/env python
'''
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... | 26.142857 | 76 | 0.713661 |
defc3d8327d8fc8fd79ceee0d88dd543318370bd | 9,517 | py | Python | research/nlp/textrcnn/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/textrcnn/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/textrcnn/modelarts/start.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... | 37.916335 | 115 | 0.672586 |
dfc52c6dab426a494983afcd7701450c2e7f18cb | 43,989 | py | Python | Backend/migrations/alembic/versions/cea34abda294_add_rki_agegroup2_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/cea34abda294_add_rki_agegroup2_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/cea34abda294_add_rki_agegroup2_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """add rki_agegroup2 table
Revision ID: cea34abda294
Revises: 86ec65c533a4
Create Date: 2021-03-17 19:27:41.684146
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = 'cea34abda294'
down_revision = '86ec65c533a4'
branch_labels = None
depends_on = None
def upgrade():
op.get_bind().exe... | 95.214286 | 113 | 0.777876 |
a0905b34311c5d9dd099a4ed94a387e09bc6b421 | 4,601 | py | Python | Bing-Parser-main/bing.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Bing-Parser-main/bing.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Bing-Parser-main/bing.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import requests, re, sys, os, time, threading, random;from re import search
dorks = [];proxies = []; good, cpm1, cpm2, error = 0,0,0,0; blacklisted = []; links = []
title = """ __ __ \n |/ | / / | / / \n |___| ___ ___ ( |(_/_ \n | )| | )| )| ) / )\n |__/ | | / |__/ |__/ /... | 93.897959 | 1,637 | 0.636383 |
2604850fa2f3090e6210e06054b4989f3b8ae18b | 412 | py | Python | RedBook/ch2/wsgi-server/my_wsgiserver.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | RedBook/ch2/wsgi-server/my_wsgiserver.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | RedBook/ch2/wsgi-server/my_wsgiserver.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from wsgiref.simple_server import make_server
def my_app(environ, start_response):
status = '200 OK'
headers = [('Content-Type', 'text/plain')]
start_response(status, headers)
response = [b"This is a sample WSGI Application"]
return response
if __name__ == "__main__":
print("Started WSGI Se... | 25.75 | 53 | 0.686893 |
cd327fcc742824ea520e6c49986a69691c636d41 | 4,639 | py | Python | research/audio/wavenet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/audio/wavenet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/audio/wavenet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.35514 | 109 | 0.706618 |
cd53c56d73a77be2a32cb248929759a67c0115f7 | 89 | py | Python | galgame/apps.py | ykomashiro/webtest | 2587d14de7ae9107e8d7d98c1db90f0a9608177e | [
"MIT"
] | null | null | null | galgame/apps.py | ykomashiro/webtest | 2587d14de7ae9107e8d7d98c1db90f0a9608177e | [
"MIT"
] | null | null | null | galgame/apps.py | ykomashiro/webtest | 2587d14de7ae9107e8d7d98c1db90f0a9608177e | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class GalgameConfig(AppConfig):
name = 'galgame'
| 14.833333 | 33 | 0.752809 |
3e167499de6b695b493bd8bbc42a861e7a1a33d5 | 428 | py | Python | ColoredTextInPython-main/tutorial.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ColoredTextInPython-main/tutorial.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ColoredTextInPython-main/tutorial.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import colorama
from colorama import Fore, Back, Style
colorama.init(autoreset=True)
print(Fore.RED + 'some red text')
print(Back.CYAN + 'cyan')
print(Style.BRIGHT + "BRIGHT")
print(Fore.RED + Back.GREEN + "red text on green back")
'''
Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
Bac... | 30.571429 | 68 | 0.691589 |
e4bf64f7303c737d3be7214c83acb37bfad0f4a4 | 1,335 | py | Python | erntehelfer/forms.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | erntehelfer/forms.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | erntehelfer/forms.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm, Form
from .models import User, CompanyProfile
class RegisterCompanyForm(Form):
username = forms.CharField(label='Benutzername', max_length=150)
company_name = forms.CharField(label='Betriebsname', max_length=250)
company_number = forms.CharFiel... | 31.785714 | 105 | 0.658427 |
e4cbea04fcd1d83c0df867841b4b16bede8095ae | 109 | py | Python | project/test.py | Hackathon2020/CoronaHackathon2020 | 1f27ad7406c9da50a3acfb48f970a0b0b51c47da | [
"MIT"
] | 5 | 2020-03-21T12:58:10.000Z | 2020-03-23T13:02:18.000Z | project/test.py | Hackathon2020/CoronaHackathon2020 | 1f27ad7406c9da50a3acfb48f970a0b0b51c47da | [
"MIT"
] | 26 | 2020-03-20T21:04:20.000Z | 2020-04-30T19:38:02.000Z | project/test.py | Hackathon2020/CoronaHackathon2020 | 1f27ad7406c9da50a3acfb48f970a0b0b51c47da | [
"MIT"
] | 1 | 2020-05-08T20:45:20.000Z | 2020-05-08T20:45:20.000Z | #This is a test file with some docstring
def example():
"""
This is a docstring
"""
return
| 12.111111 | 40 | 0.587156 |
5f85e478873a365a4aa33fbca8d0d4ab3900f978 | 5,021 | py | Python | test/test_npu/test_network_ops/test_sign.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_sign.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_sign.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... | 37.192593 | 78 | 0.668194 |
08426e00e2393aed6ebff7d47278ef9d658f2928 | 1,080 | py | Python | py/ask_db.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | py/ask_db.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | py/ask_db.py | bookmana/bookmana.github.io | 2ed7b023b0851c0c18ad8e7831ece910d9108852 | [
"MIT"
] | null | null | null | #-*-coding:utf-8
import pymysql
class AskDb:
def __init__(self, ip, user, pw, db):
self.conn = pymysql.connect(host=ip, user=user, password=pw, db=db,charset="utf8")
def getConnection(self):
return self.conn
#단축URL이 없는 상품 조회
def selectAll(self, sqlId):
self.cur = self.conn.cursor()
self... | 21.6 | 85 | 0.626852 |
f2abd0a29f7bb468799b6e38696705244f15f671 | 1,617 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex13_excel_magic_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex13_excel_magic_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex13_excel_magic_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch05_datastructures.solutions.ex13_excel_magic import generate_following_values, generate_following_values_for_predefined
@pytest.mark.parametrize("start_value, sequence_length, expected",
... | 41.461538 | 126 | 0.557205 |
4b5f1705ca25c3a66d461f81c8dbf52f9629acb3 | 1,666 | py | Python | FUll.py | DoraSoman/PLOW-Filter- | 4fd2be4cfab0e6ec479c0505317b132ebeefa3c4 | [
"MIT"
] | null | null | null | FUll.py | DoraSoman/PLOW-Filter- | 4fd2be4cfab0e6ec479c0505317b132ebeefa3c4 | [
"MIT"
] | null | null | null | FUll.py | DoraSoman/PLOW-Filter- | 4fd2be4cfab0e6ec479c0505317b132ebeefa3c4 | [
"MIT"
] | null | null | null | import os
import numpy as np
import scipy
from numpy.fft import fft2, ifft2
from scipy.signal import gaussian, convolve2d
import matplotlib.pyplot as plt
import collections
import random as rand
def patchify(img, patch_shape):
X, Y = img.shape
x, y = patch_shape
shape = (X - x + 1, Y - y + ... | 25.242424 | 78 | 0.645258 |
d9ac6cb0f659aa9f548b1832799211f49ac62f6a | 464 | py | Python | frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/setup.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/regional/saudi_arabia/setup.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/setup.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from erpnext.regional.united_arab_emirates.setup import make_custom_fields, add_print_formats
from erpnext.setup.setup_wizard.operations.taxes_setup im... | 33.142857 | 93 | 0.829741 |
8a0f163832dd9647c5f871543e8fb4ef279f3d9b | 11,757 | py | Python | myems-api/core/gateway.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 82 | 2021-02-19T10:24:31.000Z | 2022-03-28T06:30:18.000Z | myems-api/core/gateway.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 188 | 2021-02-22T07:08:30.000Z | 2022-03-02T04:11:03.000Z | myems-api/core/gateway.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 54 | 2021-02-19T08:48:46.000Z | 2022-03-30T06:21:34.000Z | import falcon
import simplejson as json
import mysql.connector
import config
import uuid
from datetime import datetime, timezone, timedelta
from core.useractivity import user_logger, access_control
class GatewayCollection:
@staticmethod
def __init__():
""""Initializes GatewayCollection"""
pass... | 38.048544 | 109 | 0.530918 |
8ab14d8eae691419023de2d9100330b41f545231 | 17,407 | py | Python | python/oneflow/compatible/single_client/test/ops/test_quantize_op.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_quantize_op.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_quantize_op.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.998047 | 88 | 0.623715 |
0a260efcbd0227a331b5ad99f1fca06fee6e6f54 | 8,153 | py | Python | Packs/ExpanseV2/Scripts/ExpanseGenerateIssueMapWidgetScript/ExpanseGenerateIssueMapWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/ExpanseGenerateIssueMapWidgetScript/ExpanseGenerateIssueMapWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/ExpanseGenerateIssueMapWidgetScript/ExpanseGenerateIssueMapWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa
from typing import Tuple, List
from math import floor
from functools import reduce
import ExpanseGenerateIssueMapWidgetScript
# taken from demistomock with only the relevant
# fields changed
EXAMPLE_INCIDENT = [
{
"Brand": "Builtin",
"Category": "Builtin",
... | 32.875 | 113 | 0.481663 |
8630fbe72751dac877508c8fee31bbca658e4777 | 1,721 | py | Python | sCRAPing/uib/studprog.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | sCRAPing/uib/studprog.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | sCRAPing/uib/studprog.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import requests
from os.path import isfile, exists
import os
import pickle
import studprogparser
from urllib.parse import urlparse
def mkdir(directory):
if not os.path.exists(directory):
os.makedirs(directory)
def loadorget(url, filename, reload=False):
if reload or not isfile(filename):
r = ... | 30.192982 | 112 | 0.581058 |
078c2c514470af27207a5c485e36f57189a260fb | 5,619 | py | Python | research/nlp/atae_lstm/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/nlp/atae_lstm/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/nlp/atae_lstm/train.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... | 35.789809 | 97 | 0.672184 |
07c1027a207c2b9bd1b14eb750a8d7d7b2b802a2 | 7,124 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/mfcc/feature_extractor.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/mfcc/feature_extractor.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/mfcc/feature_extractor.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | """
audio feature extract
"""
# coding: utf-8
import os
import numpy as np
import pickle
import mfcc.vgg_params as vgg_params
def frame(data, window_length, hop_length):
"""
frame
"""
num_samples = data.shape[0]
#print("window_length , hop_length", window_length, hop_length)
#print("num_sample... | 38.928962 | 83 | 0.637563 |
71fb62dbf794cfaa328d62175c3e72fc62f173d0 | 544 | py | Python | 63-unique-paths-ii/63-unique-paths-ii.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 63-unique-paths-ii/63-unique-paths-ii.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 63-unique-paths-ii/63-unique-paths-ii.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
m = len(obstacleGrid)
n = len(obstacleGrid[0])
dp=[[0 for _ in range(n)] for _ in range(m)]
dp[0][0]=1
for i in range(m):
for j in range(n):
if obstacleGrid[i... | 34 | 77 | 0.413603 |
9c712c9d72d1bac1c0fd1c5239156c2176bfe464 | 433 | py | Python | src/onegov/core/security/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security.identity_policy import forget
from onegov.core.security.identity_policy import remembered
from onegov.core.security.permissions import Personal
from onegov.core.security.permissions import Private
from onegov.core.security.permissions import Public
from onegov.core.security.permissions import ... | 25.470588 | 59 | 0.773672 |
92e5021834dc72a96f7e8c0172f04c31f8e5469d | 370 | py | Python | weibo/test/testDownUserDetail.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testDownUserDetail.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testDownUserDetail.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | # coding:utf8
'''
Created on 2016年4月13日
@author: wb-zhaohaibo
'''
from weibo.spider import html_downloader, html_outputer
html_download = html_downloader.HtmlDownloader()
html_out = html_outputer.Output()
url = "http://weibo.com/p/1005053059519877/info?mod=pedit_more"
html_cont = html_download.download... | 19.473684 | 64 | 0.751351 |
13abcb879e202cbd7666605380b7653264f26e39 | 10,191 | py | Python | research/cv/yolov3_tiny/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/yolov3_tiny/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/yolov3_tiny/train.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... | 39.653696 | 115 | 0.648121 |
b93b0a3fe1d3c3dd7bac85621c0f98ae735faa3e | 43,819 | py | Python | Packs/TrendMicroVisionOne/Integrations/TrendMicroVisionOne/TrendMicroVisionOne.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 1 | 2022-03-15T13:16:24.000Z | 2022-03-15T13:16:24.000Z | Packs/TrendMicroVisionOne/Integrations/TrendMicroVisionOne/TrendMicroVisionOne.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/TrendMicroVisionOne/Integrations/TrendMicroVisionOne/TrendMicroVisionOne.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | '''IMPORTS'''
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401 # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa: F401
import base64
import json
import requests
import re
from datetime import datetime, timezone, timedelta
from typing import ... | 35.252615 | 129 | 0.653164 |
dbe852d839b5af0a21e198c1c7e20531a41ff61d | 1,097 | py | Python | backend/migrate.py | SeanGau/vaccinate | f3d7388c666ee466da570e8c17bbe1f2caee912f | [
"MIT"
] | 39 | 2021-05-01T03:36:44.000Z | 2021-11-16T13:29:21.000Z | backend/migrate.py | SeanGau/vaccinate | f3d7388c666ee466da570e8c17bbe1f2caee912f | [
"MIT"
] | 50 | 2021-04-28T10:57:07.000Z | 2021-08-19T05:13:07.000Z | backend/migrate.py | SeanGau/vaccinate | f3d7388c666ee466da570e8c17bbe1f2caee912f | [
"MIT"
] | 19 | 2021-05-02T04:25:02.000Z | 2021-07-11T04:34:16.000Z | from hospital_types import (
Hospital,
AppointmentAvailability,
)
import csv, json
# Code for combining data from the `hospitals.csv` with the
# `hospitals.json` file that was taken from the MOHW website.
def main() -> None:
csvfile = open("../data/hospitals.csv")
reader = csv.DictReader(csvfile)
... | 26.756098 | 74 | 0.564266 |
dbf252a46982ff0db4cbd33f069d6eb926255a83 | 424 | py | Python | courseraweeks/week1_basic_data_structures/5_max_sliding_window/max_sliding_window.py | dhruvsharma1999/data-structures | f3b51ebca2f6e28eee3dcb5692f92d2f7f3533e5 | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Data Structures & Algorithms/Algorithm Toolbox/week1_basic_data_structures/5_max_sliding_window/max_sliding_window.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Data Structures & Algorithms/Algorithm Toolbox/week1_basic_data_structures/5_max_sliding_window/max_sliding_window.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | # python3
def max_sliding_window_naive(sequence, m):
maximums = []
for i in range(len(sequence) - m + 1):
maximums.append(max(sequence[i:i + m]))
return maximums
if __name__ == '__main__':
n = int(input())
input_sequence = [int(i) for i in input().split()]
assert len(input_sequence) ... | 22.315789 | 65 | 0.648585 |
e050c1ff0207f8a6dda95d3fefe0769190a83d11 | 617 | py | Python | HW1/p1.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/p1.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/p1.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#kverdey1@jhu.edu
#Computer Vision EN.601.461
#Assignment 1
#Programming section 1, p1
#p1.py: converts a gray-level image to a binary one using a threshold value
import cv2
import numpy as np
def p1(gray_image, thresh_val): #return binary_image
#retval, binary_out = cv2.threshold(gray_in, thresh_val, 2... | 41.133333 | 92 | 0.792545 |
168da8b84ca0d5707e87aef2826a878cabdd41ee | 21,115 | py | Python | frappe-bench/env/lib/python2.7/site-packages/dropbox/stone_validators.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | frappe-bench/env/lib/python2.7/site-packages/dropbox/stone_validators.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/dropbox/stone_validators.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2018-09-03T03:02:06.000Z | 2018-09-03T03:02:06.000Z | """
Defines classes to represent each Stone type in Python. These classes should
be used to validate Python objects and normalize them for a given type.
The data types defined here should not be specific to an RPC or serialization
format.
This module should be dropped into a project that requires the use of Stone. In... | 36.849913 | 115 | 0.602273 |
4c59904bb228be8af8763dff7470983ac97a1c3c | 410 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/70_exercicio_somando_listas/exercicios.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/70_exercicio_somando_listas/exercicios.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/70_exercicio_somando_listas/exercicios.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
lista1 = [1, 2, 3, 4, 5]
lista2 = [1, 2, 3, 4]
if lista1 < lista2:
for k, v in enumerate(lista1):
soma = 0
soma = v + lista2[k]
print(soma, end=" ")
else:
for k, v in enumerate(lista2):
soma = 0
soma += v + lista1[k]
print(soma, end=" ")
"""
lista1 = [1, 18, ... | 20.5 | 46 | 0.487805 |
fc7fae1dc612ab4d47450e211671e9ef71f73c71 | 4,957 | py | Python | src/lcdoc/mkdocs/lp/plugs/make_badges/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/mkdocs/lp/plugs/make_badges/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/mkdocs/lp/plugs/make_badges/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
### `make_badges`
Creates badges. Optionally writes the README.md
#### Format
Line separated badge function names with statement level lp parameters.
Functions:
- axblack
- docs (with value=[pagecount], default "mkdocs-material")
- gh_action (with action parameter, default ci)
- pypi
Params:... | 27.692737 | 88 | 0.553359 |
5d0eca82ec266941b2f6c39a98941e497bac2344 | 1,180 | py | Python | CS305/assignment7/rdt/udp.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS305/assignment7/rdt/udp.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS305/assignment7/rdt/udp.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from socket import *
import random
import time
class UDPsocket(socket):
def __init__(self, loss_rate=0.1, corruption_rate=0.3, delay_rate=0.1, delay=10):
super().__init__(AF_INET, SOCK_DGRAM)
self.loss_rate = loss_rate
self.corruption_rate = corruption_rate
self.delay_rate = delay_... | 29.5 | 85 | 0.605085 |
071f69a8bb0b7dbbdedce0b71c2dd3c85c279d34 | 492 | py | Python | SoSe-21/Code-Vorlesungen/VL-8/listen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/VL-8/listen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/VL-8/listen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
# a = 27 # int - Integer
# b = 3.1415 # float - Float
# c = True # bool - Boolean
# 0 1 2 3 4
einkaufsliste = ["Kiste Flens", "Grillkohle", "Grillanzünder", "Packung Würstchen", "Kräuterbaguette"] # l... | 35.142857 | 126 | 0.534553 |
076580628d664028f8a99a3e3101347c70d38306 | 838 | py | Python | python/python_binding/ctypes_test.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/python_binding/ctypes_test.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/python_binding/ctypes_test.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """ Simple examples of calling C functions through ctypes module """
import ctypes
import pathlib
if __name__ == '__main__':
# Load the shared library into c types
libname = pathlib.Path().absolute() / 'libcmult.so'
c_lib = ctypes.CDLL(libname)
# Sample data for our call:
x, y = 6, 2.3
# Thi... | 31.037037 | 75 | 0.650358 |
ab26190bfb91a03fa0b56706df5ab401695e73b3 | 8,580 | py | Python | official/cv/erfnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/erfnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/erfnet/train.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... | 42.26601 | 105 | 0.675758 |
ab4b5c30817ba17630c462b33dee823912e3feb6 | 872 | py | Python | Packs/MajorBreachesInvestigationandResponse/Scripts/RapidBreachResponseCompletedTasksCountWidget/RapidBreachResponseCompletedTasksCountWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MajorBreachesInvestigationandResponse/Scripts/RapidBreachResponseCompletedTasksCountWidget/RapidBreachResponseCompletedTasksCountWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MajorBreachesInvestigationandResponse/Scripts/RapidBreachResponseCompletedTasksCountWidget/RapidBreachResponseCompletedTasksCountWidget.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
from CommonServerPython import * # noqa: F401
ORANGE_HTML_STYLE = "'color:#EF9700;font-size:48px;padding: 60px; text-align:center;padding-left: 70px'>"
GREEN_HTML_STYLE = "'color:#1DB846;font-size:48px;padding: 60px; text-align:center;padding-left: 70px'>"
def main():
... | 31.142857 | 105 | 0.645642 |
db6b7ce2e0bed416c97ff0197c2a8149804365f8 | 8,719 | py | Python | research/cv/arcface/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/arcface/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/arcface/modelarts/start.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... | 43.163366 | 119 | 0.646863 |
dbb5b9e0008bb4c908bfd83a5eb829f222e743a5 | 1,827 | py | Python | rev/back2basic/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | rev/back2basic/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | rev/back2basic/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | # Fungsi hahaha() hanya mengubah nilai variabel v, yang mempengaruhi nilai x pada akhir program.
# Jika ditelaah lebih dalam, fungsi hahaha() mengubah nilai variabel v dengan pola deret biner negatif.
# Berikut contoh biner negatif: [-1, -2, 4, 8, -16, -32, ...]
# >>> (-1-2+4+8-16-32+64+128-256-512+1024+2048-4096-8192+... | 37.285714 | 134 | 0.610837 |
91ce4749e40ccd10750a27588c17dc128942dedb | 18,099 | py | Python | Packs/FireEyeCM/Integrations/FireEyeCM/FireEyeCM.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FireEyeCM/Integrations/FireEyeCM/FireEyeCM.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FireEyeCM/Integrations/FireEyeCM/FireEyeCM.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Tuple
from CommonServerPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CONSTANTS '''
INTEGRATION_NAME = 'FireEye Central Management'
INTEGRATION_COMMAND_NAME = 'fireeye-cm'
INTEGRATION_CONTEXT_NAME = 'FireEyeCM'
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO... | 40.22 | 125 | 0.655174 |
91ec81f104c484bd3e0eb44610131712acde57d8 | 1,128 | py | Python | WeChatTools/Utils/MailHelper.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/Utils/MailHelper.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/Utils/MailHelper.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# encoding: utf-8
import smtplib
from email.mime.text import MIMEText
from email.utils import formataddr
class MailHelper:
def __init__(self, username, password):
self.username = username
self.password = password
def sendmail(self, mail_to, subject, content):
... | 36.387097 | 99 | 0.628546 |
5327d2acc4486099795c12fdd5528e0b5001fb9d | 1,651 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/output/accelerations.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/output/accelerations.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/output/accelerations.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... | 37.522727 | 77 | 0.714113 |
72d9bec3c448eff40d4c7dc57861b451633f3217 | 7,337 | py | Python | Packs/Exabeam/Integrations/Exabeam/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Exabeam/Integrations/Exabeam/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Exabeam/Integrations/Exabeam/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | EXPECTED_PEER_GROUPS = {
'Exabeam.PeerGroup(val.Name && val.Name === obj.Name)': [
{'Name': "Marketing"},
{'Name': "usa"},
{'Name': "101"},
{'Name': "Program Manager"},
{'Name': "Channel Administrator"},
{'Name': "Chief Marketing Officer"},
{'Name': ""},
... | 37.243655 | 119 | 0.531552 |
72e5ae1693cb2b11b2e4380505bd1892705d3888 | 645 | py | Python | Veranstaltungen/migrations/0008_auto_20170511_1352.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Veranstaltungen/migrations/0008_auto_20170511_1352.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Veranstaltungen/migrations/0008_auto_20170511_1352.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-05-11 11:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Veranstaltungen', '0007_auto_20170511_1008'),
]
operations = [
migrations.A... | 25.8 | 90 | 0.620155 |
be544723055f8b3e6a74bf56933d20c8824aabaa | 740 | py | Python | examples/myqueryset/simplerelate/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/myqueryset/simplerelate/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/myqueryset/simplerelate/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
# Create your models here.
class Publication(models.Model):
title = models.CharField(max_length=30)
class Meta:
ordering = ['title']
def __str__(self):
return self.title
class Author(models.Model):
name = models.CharField(max_length=30)
class Tag(mode... | 21.764706 | 67 | 0.695946 |
be9dff86d085efd3b6573f3c78ac56e3dce49041 | 3,291 | py | Python | research/cv/autoaugment/src/dataset/autoaugment/ops/ops_test.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/autoaugment/src/dataset/autoaugment/ops/ops_test.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/autoaugment/src/dataset/autoaugment/ops/ops_test.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... | 31.644231 | 80 | 0.619569 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.