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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
60265d265af67a60c8310b3c7b6bc835c1c18030 | 5,031 | py | Python | official/nlp/gpt/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/gpt/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/gpt/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 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.194245 | 112 | 0.665077 |
7181f884797da347d5aaef10e120f0aaeb1fae5f | 2,458 | py | Python | feature_selection.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | 1 | 2020-07-16T02:52:47.000Z | 2020-07-16T02:52:47.000Z | feature_selection.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | feature_selection.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import time
import signal
def sh_process_info(process_name):
command = "ps aux | grep " + process_name
out = os.popen(command).read()
for line in out.splitlines():
print(line)
if "sh " + process_name in line:
pi... | 30.345679 | 146 | 0.474776 |
1ca69b5ce5305ed67bbb5188cf1e2b67f993de68 | 583 | py | Python | controller/singleton.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | 1 | 2021-06-15T08:59:02.000Z | 2021-06-15T08:59:02.000Z | controller/singleton.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | controller/singleton.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | # https://stackoverflow.com/questions/31875/is-there-a-simple-elegant-way-to-define-singletons
class Singleton(object):
"""Use to create a singleton"""
def __new__(cls, *args, **kwds):
"""
>>> s = Singleton()
>>> p = Singleton()
>>> id(s) == id(p)
True
"""
... | 27.761905 | 94 | 0.530017 |
1c095a48387ff8288fcd69cfb91e3801faf082a7 | 1,107 | py | Python | Doser-main/doser.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Doser-main/doser.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Doser-main/doser.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import requests
from threading import Thread
import random
import os
print("head...")
users = [
"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
"Mozilla / 5.0 (Macintosh; Intel Mac OS X 10.14; rv: 75.0) Gecko / 20100101 Firefox / 75.0"
"Mozilla/5.0 (Windows NT 1... | 29.918919 | 121 | 0.611563 |
1c28c37d8224373ff2f35c14791d856de1a07c96 | 1,237 | py | Python | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
Note :: some songs donot have JSON, cannot be downloaded!
__author__ : Jimut Bahan Pal
__date__ : June 11 2018
'''
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx... | 24.74 | 94 | 0.703314 |
98bc55da6ce07acfc2eecb548f5ad77a7dafa257 | 1,744 | py | Python | research/cv/sknet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/sknet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/sknet/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... | 44.717949 | 102 | 0.696101 |
40c6bb7a3df4745e2e5a2753b981380cba2cec26 | 480 | py | Python | examples/keras-iris-pipeline/run_pipeline.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | examples/keras-iris-pipeline/run_pipeline.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | examples/keras-iris-pipeline/run_pipeline.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import skil
import numpy as np
skil_server = skil.Skil()
work_space = skil.WorkSpace(skil_server)
experiment = skil.Experiment(work_space)
transform = skil.Transform(transform='iris_tp.json', experiment=experiment)
model = skil.Model(model='iris_model.h5', experiment=experiment)
deployment = skil.Deployment(skil_serv... | 28.235294 | 75 | 0.76875 |
908e22253121e7c3ac9efdd2a0145cb6070966b8 | 3,072 | py | Python | feedcrawler/sites/content_all_ff.py | rix1337/FeedCrawler | 6c104c39f1bd45e5d49c02c90bb8d9fd35f9709e | [
"MIT"
] | 16 | 2021-04-06T07:37:18.000Z | 2022-03-27T15:05:32.000Z | feedcrawler/sites/content_all_ff.py | rix1337/FeedCrawler | 6c104c39f1bd45e5d49c02c90bb8d9fd35f9709e | [
"MIT"
] | 17 | 2021-06-09T10:37:49.000Z | 2022-03-31T07:29:36.000Z | feedcrawler/sites/content_all_ff.py | rix1337/FeedCrawler | 6c104c39f1bd45e5d49c02c90bb8d9fd35f9709e | [
"MIT"
] | 3 | 2021-05-22T13:49:57.000Z | 2022-01-05T11:15:47.000Z | # -*- coding: utf-8 -*-
# FeedCrawler
# Projekt von https://github.com/rix1337
import datetime
import feedcrawler.sites.shared.content_all as shared_blogs
from feedcrawler.config import CrawlerConfig
from feedcrawler.db import FeedDb
from feedcrawler.sites.shared.internal_feed import add_decrypt_instead_of_download
f... | 40.421053 | 120 | 0.660482 |
29068a4e23c4cd10b66532441c893cf2582d6c49 | 305 | py | Python | exercises/en/solution_02_05_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/en/solution_02_05_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/en/solution_02_05_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("en")
# Import the Doc class
from spacy.tokens import Doc
# Desired text: "spaCy is cool!"
words = ["spaCy", "is", "cool", "!"]
spaces = [True, True, False, False]
# Create a Doc from the words and spaces
doc = Doc(nlp.vocab, words=words, spaces=spaces)
print(doc.text)
| 20.333333 | 48 | 0.681967 |
2922ad8229ddca85bc27619d4887f7bc191cd490 | 344 | py | Python | Problems/Two Pointers/easy/ValidPalindrome/valid_palindrome.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Two Pointers/easy/ValidPalindrome/valid_palindrome.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Two Pointers/easy/ValidPalindrome/valid_palindrome.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | def isPalindrome(s: str) -> bool:
n = len(s)
p1, p2 = 0, n - 1
while p1 < p2:
while not s[p1].isalnum() and p1 < p2:
p1 += 1
while not s[p2].isalnum() and p1 < p2:
p2 -= 1
if s[p1].lower() != s[p2].lower():
return False
p1 += 1
... | 19.111111 | 46 | 0.421512 |
d3d095cc9bf792e8e1fd5d0a147418ef52a9d0f3 | 282 | py | Python | SBTK_League_Helper/src/interfacing/ogs/abstract.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/abstract.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/abstract.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from ..abstract import ServerElement
from .resources import main_server, beta_server
class OGSElement(ServerElement):
server = main_server
server_shortname = str(server)
class OGSBetaElement(ServerElement):
server = beta_server
server_shortname = str(server) | 23.5 | 47 | 0.765957 |
d3f67286b287cd7740715133994015e8b58a1ed6 | 378 | py | Python | ACM Training/2018-08-19 牛客多校第九场/1004_test.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | ACM Training/2018-08-19 牛客多校第九场/1004_test.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | ACM Training/2018-08-19 牛客多校第九场/1004_test.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | def getx(a, b):
c = [b[i] - a[i] for i in range(0, 5)]
d = [c[i] - c[i - 1] for i in range(1, 5)]
d = [0] + d
print(d)
x, y = [0, 0, 0, 0, 0], [0, 1, 1, 1, 0]
getx(x, y)
x, y = y, [0, 1, 2, 3, 3]
getx(x, y)
x, y = y, [0, 3, 4, 5, 3]
getx(x, y)
x, y = y, [0, 3, 7, 12, 15]
getx(x, y)
x, y = y, [0, 3, 10, ... | 22.235294 | 46 | 0.399471 |
b46d8eb54b02d30368ece200a0079efed8ead6f9 | 752 | py | Python | Pwn2Win/2021/crypto/A2S/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Pwn2Win/2021/crypto/A2S/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Pwn2Win/2021/crypto/A2S/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from a2s import A2S
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
import hashlib
from uuid import uuid4
key = uuid4().bytes
cipher = A2S(key)
p = []
c = []
for _ in range(3):
plaintext = uuid4().bytes
p.append(plaintext.hex())
ciphertext = cipher.encrypt_block(plaintext)
... | 22.787879 | 48 | 0.674202 |
6f68c04ace747b16c60ab6c1f660ead4510c6e49 | 2,821 | py | Python | tests/rbac/testdata/user.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | tests/rbac/testdata/user.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | tests/rbac/testdata/user.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 34.402439 | 87 | 0.640553 |
48bdc789e5a852a243432fe177fb2af56fa1abd6 | 2,392 | py | Python | src/onegov/election_day/views/manage/notifications.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/notifications.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/notifications.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from onegov.election_day import _
from onegov.election_day import ElectionDayApp
from onegov.election_day.collections import NotificationCollection
from onegov.election_day.forms import TriggerNotificationsForm
from onegov.election_day.layouts import ManageLayout
from onegov.election_day.m... | 31.893333 | 78 | 0.663462 |
9624e7317d0313d02dfa78e916f0bfa7e26f5190 | 284 | py | Python | Verzweigungen/Logische Operationen/operator_logisch.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Verzweigungen/Logische Operationen/operator_logisch.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Verzweigungen/Logische Operationen/operator_logisch.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | x = 12
y = 15
z = 20
print("x:", x)
print("y:", y)
print("z:", z)
# Bedingung 1
if x < y and x < z:
print("x ist die kleinste Zahl")
# Bedingung 2
if y > x or y > z:
print("y ist nicht die kleinste Zahl")
# Bedingung 3
if not y < x:
print("y ist nicht kleiner als x")
| 14.947368 | 42 | 0.570423 |
82a0a987a3d9065064063c9f3fd7c6443a4ad115 | 1,035 | py | Python | kiosk/migrations/0008_start_news.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | kiosk/migrations/0008_start_news.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | kiosk/migrations/0008_start_news.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-14 14:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('kiosk', '0007_kontakt_nachricht'),
]
operations = [
... | 34.5 | 114 | 0.602899 |
c4e6e093b09e7727a22487939afda7c8a022d2b0 | 100 | py | Python | StateTracing/__init__.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | StateTracing/__init__.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | StateTracing/__init__.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | 1 | 2020-09-08T13:42:16.000Z | 2020-09-08T13:42:16.000Z | from .model import Model
from .dataloader import DataLoader
__all__ = ['Model','DataLoader'] | 16.666667 | 35 | 0.72 |
fb96481d9ca6b4d07917fe599f40d1724dce3429 | 3,652 | py | Python | main.py | anysz/SQLiteWeb | d0bc61a578828ae90d44a0b62545bdf854deef66 | [
"MIT"
] | null | null | null | main.py | anysz/SQLiteWeb | d0bc61a578828ae90d44a0b62545bdf854deef66 | [
"MIT"
] | null | null | null | main.py | anysz/SQLiteWeb | d0bc61a578828ae90d44a0b62545bdf854deef66 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ==============
# SQLITE3 Explorer (Webapp)
# Written by Anysz
# ==============
# (!!!) WARNING: DO NOT RUN THIS AS PUBLIC SERVICE.
# ==============
import os, sys
from flask import (
Flask,
render_template, abort,
request, Response, url_for,
session, jsonify, redirect,
)
i... | 25.538462 | 99 | 0.643209 |
fbb943121239bc61009fe4c8a8beb1fd6cb4f8b9 | 2,857 | py | Python | src/db/mapper.py | TimHabeck/blockchain-lab | 3cd050ee43f26cf0a1f70869100f0b40a6abae07 | [
"RSA-MD"
] | null | null | null | src/db/mapper.py | TimHabeck/blockchain-lab | 3cd050ee43f26cf0a1f70869100f0b40a6abae07 | [
"RSA-MD"
] | null | null | null | src/db/mapper.py | TimHabeck/blockchain-lab | 3cd050ee43f26cf0a1f70869100f0b40a6abae07 | [
"RSA-MD"
] | null | null | null | import json
import logging
import os
class Mapper():
blockchain_dir = os.path.dirname(
os.path.realpath(__file__)) + "/blocks"
latest_block_hash_file = os.path.dirname(
os.path.realpath(__file__)) + "/latest_block_hash"
db_dir = os.path.dirname(os.path.realpath(__file__))
... | 32.83908 | 89 | 0.550228 |
f730495e98e013a7ae5f3395303f9cca988c62f0 | 439 | py | Python | aoc2020/day_03/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_03/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_03/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
class Solution(SolutionABC):
expected = 7
def solve(self) -> any:
x, rt, rows = 0, 0, self.resource_lines("input")
try:
# Discard the first row
next(rows)
while True:
row = next(rows)
x = (x + 3) % len(... | 21.95 | 56 | 0.43508 |
f784d5dd448b281bfe210e8cf46627d13c2b130f | 630 | py | Python | radiomics/get_test_features.py | RimeT/p3_radio | 3d522a4356c62255cd93c6d74eb388a2e474dd00 | [
"Apache-2.0"
] | null | null | null | radiomics/get_test_features.py | RimeT/p3_radio | 3d522a4356c62255cd93c6d74eb388a2e474dd00 | [
"Apache-2.0"
] | null | null | null | radiomics/get_test_features.py | RimeT/p3_radio | 3d522a4356c62255cd93c6d74eb388a2e474dd00 | [
"Apache-2.0"
] | null | null | null | import argparse
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# debug
parser.add_argument('feature_csv', help='feature csv file')
parser.add_argument('tags_csv', help='tags csv. extract dataset=1 samples')
parser.add_argument('out_csv', help='feature csv file')
... | 31.5 | 79 | 0.696825 |
e3f474790959574b029ec73b4530c071597059d2 | 193 | py | Python | py-basics/src/lectures/django/mysite/polls/admin.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/django/mysite/polls/admin.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/django/mysite/polls/admin.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | from django.contrib import admin
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin)
| 19.3 | 44 | 0.777202 |
5816ae28f15db460ab0c54298de1fa14e4d2a595 | 10,356 | py | Python | dbm.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | dbm.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | dbm.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | import sqlite3
import hashlib
from defines import *
from logm import LogManager
from objects import *
class DataBaseManager:
@staticmethod
def md5(string: str):
return hashlib.md5(string.encode("utf-8")).hexdigest()
@staticmethod
def strd_from_str(date: str):
date = da... | 39.079245 | 98 | 0.502028 |
49ca1eee4038687941af15e287954037975ca88c | 257 | py | Python | cversuch/MaxGeschenk/makechiffre.py | Faldrian/AVRKnobel | f9b17b132c576e91d3df1db00d54334f7a434143 | [
"MIT"
] | null | null | null | cversuch/MaxGeschenk/makechiffre.py | Faldrian/AVRKnobel | f9b17b132c576e91d3df1db00d54334f7a434143 | [
"MIT"
] | null | null | null | cversuch/MaxGeschenk/makechiffre.py | Faldrian/AVRKnobel | f9b17b132c576e91d3df1db00d54334f7a434143 | [
"MIT"
] | null | null | null |
a = "Hallo Max! Wunderbar, du hast auch den zweiten Teil des Raetsels entschluesselt. Ich hoffe du hast noch Lust, denn jetzt kommmt der dritte Teil - wenn du den schaffst, gibts Kuchen! Vierzehn und Fuenfzehn an Ground."
b = "HerzlichenGlueckwunsch"
| 28.555556 | 221 | 0.762646 |
b724c7fa2747470cd5f50fafd6764c23d23a47f4 | 397 | py | Python | diversos/funcoes.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/funcoes.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/funcoes.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | # -*- coding: utf-8 -*-
## Funções???
def soma1 (x, y):
print (x + y )
def soma2 (x, y):
return (x + y )
soma1 (1,5)
soma1 ("OI, meuu nome é ", " Luiz ConZê")
print ("-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=")
print ("SOma2 ")
soma2(9,9)
var1 = soma2 (1,5)
var2 = soma2 ("OI, meuu nome é ", " Luiz ConZê")
... | 18.045455 | 50 | 0.425693 |
4d04c7150de73fa021ce97dc5cafe585abe3e459 | 2,159 | py | Python | ScanQLi-master/progressbar.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ScanQLi-master/progressbar.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ScanQLi-master/progressbar.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 sys
import time
import re
logfile = None
class progressbar():
def __init__(self, typestat, status, totalcount=1, count=1, text = None):
self.typestat = typestat
self.status = status
self.total = 1
self.value = 0
self.totalcount = totalcount
self.count = count... | 34.822581 | 141 | 0.525706 |
c44674adba17c6b327a2c57fa432e61afa88f8e4 | 1,442 | py | Python | panzee/unit.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | panzee/unit.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | panzee/unit.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null | import yaml
import panzee.damage
import panzee.weapon
class Unit(object):
name = ""
weapons = {}
internal_name = ""
def __init__(self, unit_base):
for data in yaml.load_all(unit_base): break
self.name = data["stats"]["-name"]
self.internal_name = data["stats"]["-internal_name"]
... | 28.27451 | 86 | 0.617892 |
676af550b54a1a699238a97eba98bb7a5a861a36 | 2,766 | py | Python | tests/integration/structures/test_voxelgrid_structures.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | tests/integration/structures/test_voxelgrid_structures.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | tests/integration/structures/test_voxelgrid_structures.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
import pandas as pd
from pyntcloud import PyntCloud
def test_default_number_of_voxels_per_axis(simple_pyntcloud):
voxelgrid_id = simple_pyntcloud.add_structure("voxelgrid")
voxelgrid = simple_pyntcloud.structures[voxelgrid_id]
assert voxelgrid.n_voxels == 1
assert np... | 36.394737 | 117 | 0.642805 |
677c515064db53eed4794a34e3b1a0a33a68e493 | 746 | py | Python | SoSe-21/Uebung-4/try-except-2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-4/try-except-2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-4/try-except-2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # try, except
falsche_eingabe = True
# While Schleife die solange läuft, bis der Nutzer eine technisch korrekte Eingabe tätig
while falsche_eingabe:
# Versuche den Code innerhalb von "try" auszuführen
try:
alter = int(input("Bitte geben Sie Ihr Alter ein: "))
if alter >= 18:
print(... | 41.444444 | 88 | 0.66756 |
db1ce830fe0673f006dfa65117c542685150097c | 21,037 | py | Python | src/data_science/data_science/data_transfer/data_api.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/data_transfer/data_api.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/data_transfer/data_api.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | import requests
import json
import pandas as pd
from ipywidgets import FloatProgress
import math
from data_science.tools.objects import attr_in_object, \
assign_attr_from_dictionary
import data_science.tools.transformations as tr
class APIBaseClass:
"""
Class with basic API interacting functionality.
... | 38.179673 | 79 | 0.579075 |
db31948145eb00ae01ddb3e7c72dc65d12d3e2fc | 688 | py | Python | server/apps/users/adminx.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/users/adminx.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/users/adminx.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-19 17:34
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : adminx.py
# @Software: PyCharm
import xadmin
from xadmin import views
class BaseSetting(object):
#添加主题功能
enable_themes = True
use_bootswatch = True
cl... | 20.848485 | 57 | 0.688953 |
3f42444adcf64702fab92dfcadee2896249ab520 | 1,175 | py | Python | BIZa/2014/DubsAlexandra/task_9_47.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/DubsAlexandra/task_9_47.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/DubsAlexandra/task_9_47.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 9.
# Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать.
# Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток
# узнать, есть ли какая-либо буква в слове,
# причем программа может отвечать только "Да" и "Нет".
# Вслед за тем игрок должен попробовать ... | 26.111111 | 159 | 0.702128 |
58af77b9c8311694e6e5a7a41acee8fb02c63db0 | 11,894 | py | Python | src/test/tests/rendering/annotation.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/rendering/annotation.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/rendering/annotation.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: annotation.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - pc, subset
# operators - none
# selection - none
#
# Defect ID: none
#
# P... | 25.633621 | 78 | 0.736001 |
e1a208fd3e26d3954d5a9bd08c74afee0a545f97 | 420 | py | Python | files/meas/Experiment_01/04_blink.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_01/04_blink.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_01/04_blink.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import time
from redpitaya import redpitaya_scpi as scpi
rp_s = scpi.scpi(sys.argv[1])
if (len(sys.argv) > 2):
led = int(sys.argv[2])
else:
led = 0
print ("Blinking LED["+str(led)+"]")
period = 1 # seconds
while 1:
time.sleep(period/2.0)
rp_s.tx_txt('DIG:PIN LED' + str(led) ... | 18.26087 | 56 | 0.616667 |
36192cef0ab847d0f8ea6d1fb00715fa6f4a9ab1 | 893 | py | Python | elements/python/9/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/9/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/9/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Stack(object):
def __init__(self):
self.stack = []
def push(self, x):
self.stack.append(x)
def pop(self):
if self.size() == 0:
return None
return self.stack.pop(-1)
def peek(self):
if self.size() == 0:
return None
return se... | 19.844444 | 79 | 0.524076 |
365a19ff99c993e7572443273bf8b483dc07cc5c | 3,658 | py | Python | field.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | 1 | 2019-04-27T07:28:52.000Z | 2019-04-27T07:28:52.000Z | field.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | field.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | from block import Block
BLACK = [0, 0, 0]
class Field:
NoCollision = 0
Collision = 1
GameOverCollision = 2
def __init__(self, width, height):
self.width = width
self.height = height
self.field = []
self.generate_field()
def set_all_pixels_to_black(self):
... | 38.914894 | 147 | 0.566156 |
36f36ef154deae1b8c401a0d0a32d641f459c57b | 1,901 | py | Python | src/lcdoc/mkdocs/lp/plugs/bash/__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/bash/__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/bash/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
### `bash`
Runs the given statements within a bash shell.
This is the default evaluation mode.
When you supply a session parameter, we will send the statements over into tmux and run
them there.
"""
from lcdoc import lp
from lcdoc.lp_session import srun, tmux_kill_session
multi_line_to_list = True
class S... | 26.402778 | 87 | 0.567596 |
e9ef83457dba1ed4cd22998c85a08c7aa8dd2a21 | 3,243 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/network/ftd/test_fdm_swagger_with_real_data.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/network/ftd/test_fdm_swagger_with_real_data.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/network/ftd/test_fdm_swagger_with_real_data.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | import json
import os
import unittest
from ansible_collections.community.general.plugins.module_utils.network.ftd.fdm_swagger_client import FdmSwaggerValidator, FdmSwaggerParser
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
TEST_DATA_FOLDER = os.path.join(DIR_PATH, 'test_data')
class TestFdmSwagger(unittest... | 42.671053 | 139 | 0.553808 |
a191bedf2b4040cdfc0b7c17eed2bedd473e164f | 532 | py | Python | Project Euler Questions 31 - 40/Project Euler Question 36.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 31 - 40/Project Euler Question 36.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 31 - 40/Project Euler Question 36.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 36
#Double-base palindromes
def pal(x):
num = str(x)
if num == num[::-1]:
return True
else:
return False
def check(num):
double_base_list = set()
for x in range(1, (num + 1)):
if pal(x) is True:
#print (x)
base2 = (bin(x))[2:]... | 23.130435 | 49 | 0.533835 |
b11b0f8e8b0c7ae760d2f400563aa9f4e89a5109 | 1,464 | py | Python | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from JoinListsOfDicts import main as JoinListsOfDicts
LEFT_DICTS = [{
"insightIds": ['1', '2', '3'],
"value": "value123"
}, {
"insightIds": ['1'],
"value": "value1"
}, {
"insightIds": ['3'],
"value": "value3"
}]
RIGHT_DICTS = [{
"id": 1,
"name": "someInsig... | 25.241379 | 68 | 0.595628 |
b159bb64eb5d03f172f2e9a947272bc6f2390113 | 2,763 | py | Python | nayuki_qrcodegen/qrcodegen-worker.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/qrcodegen/python/qrcodegen-worker.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2019-10-19T09:24:56.000Z | 2019-10-20T05:37:06.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/qrcodegen/python/qrcodegen-worker.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2019-10-18T14:18:28.000Z | 2019-10-18T14:18:28.000Z | #
# QR Code generator test worker (Python 2, 3)
#
# This program reads data and encoding parameters from standard input and writes
# QR Code bitmaps to standard output. The I/O format is one integer per line.
# Run with no command line arguments. The program is intended for automated
# batch testing of end-to-end fun... | 33.289157 | 114 | 0.726022 |
494ac1db9d4ad5a6d847418a028847085330f076 | 2,045 | py | Python | src/compet.py | TheMagnat/Projet-RP | 74d5bb7c07705b06fbdf93e5587568d9ecf574e0 | [
"MIT"
] | null | null | null | src/compet.py | TheMagnat/Projet-RP | 74d5bb7c07705b06fbdf93e5587568d9ecf574e0 | [
"MIT"
] | null | null | null | src/compet.py | TheMagnat/Projet-RP | 74d5bb7c07705b06fbdf93e5587568d9ecf574e0 | [
"MIT"
] | null | null | null |
import helper
import algorithm
import numpy as np
#Generation d'instances random
n = 50
#error = 0.1
testRange = 1000
results = np.empty((testRange, 6), dtype=np.float64)
errors = [0.01, 0.05, 0.1, 0.2, 0.3, 0.5, 1]
for err in errors:
for i in range(testRange):
#Generate testing samples
durations = he... | 32.460317 | 146 | 0.767237 |
7755328bb9cd5c39a308f38cccdd829a5ab35f9b | 1,186 | py | Python | tools/poll.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 10 | 2021-01-28T21:43:22.000Z | 2022-01-15T16:50:34.000Z | tools/poll.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 7 | 2021-06-10T07:19:21.000Z | 2022-03-22T15:11:17.000Z | tools/poll.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 5 | 2021-01-29T14:14:45.000Z | 2022-01-09T15:37:36.000Z | import sys
import telebot
import time
import traceback
import pollers
telegram_bot = None
telegram_debug_chatid = None
telegram_public_chatid = None
if len(sys.argv) == 1:
# no telegram used
pass
elif len(sys.argv) == 3 or len(sys.argv) == 4:
telegram_token = sys.argv[1]
telegram_debug_chatid = sys.argv[2]
... | 21.563636 | 123 | 0.689713 |
775ac864ef3cd503b8ebf2f2019957c763d38b9f | 1,879 | py | Python | python/postgresql/create_tables.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/postgresql/create_tables.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/postgresql/create_tables.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import psycopg2
from config import config
def create_tables():
""" create tables in the PostgreSQL database """
commands = (
"""
CREATE TABLE vendors (
vendor_id SERIAL PRIMARY KEY,
vendor_name VARCHAR(255) NOT NULL
)
""",
"""
... | 27.231884 | 65 | 0.54231 |
65dd6a3bd17bd52946d6e8bed42dc791e5b63902 | 2,558 | py | Python | intelligence/anthill/src/router.py | FoxComm/highlander | 1aaf8f9e5353b94c34d574c2a92206a1c363b5be | [
"MIT"
] | 10 | 2018-04-12T22:29:52.000Z | 2021-10-18T17:07:45.000Z | intelligence/anthill/src/router.py | FoxComm/highlander | 1aaf8f9e5353b94c34d574c2a92206a1c363b5be | [
"MIT"
] | null | null | null | intelligence/anthill/src/router.py | FoxComm/highlander | 1aaf8f9e5353b94c34d574c2a92206a1c363b5be | [
"MIT"
] | 1 | 2018-07-06T18:42:05.000Z | 2018-07-06T18:42:05.000Z | import os
from flask import Flask, request, jsonify
from managers.Prod_Prod_Manager import Prod_Prod_Manager
from util.ES_Client import ES_Client
from util.InvalidUsage import InvalidUsage
from util.neo4j_utils import Neo4j_Client
APP = Flask(__name__)
NEO4J_CLIENT = Neo4j_Client()
ES_CLIENT = ES_Client(
os.g... | 30.819277 | 91 | 0.703675 |
f303b08fdb283294573ec816ef457b19f6ad6b66 | 155 | py | Python | 1461-check-if-a-string-contains-all-binary-codes-of-size-k/1461-check-if-a-string-contains-all-binary-codes-of-size-k.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1461-check-if-a-string-contains-all-binary-codes-of-size-k/1461-check-if-a-string-contains-all-binary-codes-of-size-k.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1461-check-if-a-string-contains-all-binary-codes-of-size-k/1461-check-if-a-string-contains-all-binary-codes-of-size-k.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | import math
class Solution:
def hasAllCodes(self, s: str, k: int) -> bool:
return 2**k==len({s[i:i+k] for i in range(len(s)-k+1)})
| 31 | 63 | 0.548387 |
b8436aa053c26b889ce194079bc6f37694ce556d | 8,536 | py | Python | Packs/iDefense/Integrations/iDefense_v2/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/iDefense/Integrations/iDefense_v2/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/iDefense/Integrations/iDefense_v2/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
URL_RES_JSON = {
'results': [{'confidence': 50, 'display_text': 'http://www.malware.com',
'files': [{'confidence': 50, 'display_text': '934a72f37d861097c85dc3c2e16bca3c',
'key': '934a72f37d861097c85dc3c2e16bca3c', 'last_seen': '2020-10-07T20:26:30.000Z',
... | 45.164021 | 120 | 0.534091 |
b2a0ace4734475bb38fc5132d418aaa35f422345 | 523 | py | Python | leetcode/199-Binary-Tree-Right-Side-View/BinTreeRightSideView_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/199-Binary-Tree-Right-Side-View/BinTreeRightSideView_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/199-Binary-Tree-Right-Side-View/BinTreeRightSideView_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a list of integers
def rightSideView(self, root):
if root == None:
retu... | 22.73913 | 43 | 0.543021 |
ac38e8c3d58492d535722316030779cc94ee70e4 | 1,041 | py | Python | .venv/Lib/site-packages/pyDOE/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/pyDOE/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/pyDOE/__init__.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | """
================================================================================
pyDOE: Design of Experiments for Python
================================================================================
This code was originally published by the following individuals for use with
Scilab:
Copyright (C) 2012 - 201... | 31.545455 | 80 | 0.634006 |
ce27f722c08cdee84e50a72b31f09fe884b9fdc9 | 533 | py | Python | Online-Judges/DimikOJ/Python/63-caesar-cipher-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/63-caesar-cipher-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/63-caesar-cipher-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def caesar_cipher_gen(text, key):
all_lower = ""
for j in range(97, 123):
all_lower += chr(j)
all_lower = all_lower * 2
all_upper = all_lower.upper()
encrypeted = ""
for i in text:
if i in all_lower:
encrypeted += all_lower[(all_lower.index(i) + key)]
elif i ... | 25.380952 | 63 | 0.58349 |
02466317b5ee33778c51945bff282b372ea9ba09 | 1,884 | py | Python | setup.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | setup.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | setup.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | #!/usr/bin/env python
from os import path
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
version = {}
with open(path.join(this_directory, "wagtail_localize", "version.py")) as f:
exec(f.read(), version)
with open(path.join(this_directory, "README.md"), encodi... | 31.932203 | 84 | 0.60138 |
0283cd8307bad40781a1356408128973eb891570 | 7,663 | py | Python | model/mgn.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 794 | 2018-09-06T07:38:41.000Z | 2022-03-16T06:30:37.000Z | model/mgn.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 111 | 2018-12-04T11:18:27.000Z | 2022-03-31T07:39:11.000Z | model/mgn.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 221 | 2018-11-22T08:11:03.000Z | 2022-03-16T07:11:43.000Z | import copy
import torch
import torch.nn.functional as F
from torchvision.models.resnet import Bottleneck,resnet50
import torch.nn as nn
def make_model(args):
return MGN(args)
class MGN(nn.Module):
def __init__(self, args):
super(MGN, self).__init__()
num_classes = args.num_classes
... | 36.490476 | 121 | 0.591022 |
e7ffa518f3500b3f758abb11e00e0f2b7c4ce4a4 | 552 | py | Python | SPS-Variants/backup/top-k-overview/backup/preZhi/genData/undir2dir.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | related_projects/source_codes/top-k-overview/preZhi/genData/undir2dir.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | related_projects/source_codes/top-k-overview/preZhi/genData/undir2dir.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import sys
import random
if __name__ == '__main__':
gname = sys.argv[1]
gname2 = gname + '.directed'
isDirected = False
if gname == '':
print 'Usage: undir2dir <file>'
sys.exit(1)
else:
with open(gname) as gdata, open(gname2, 'w') as gout:
for line in gdata:
... | 27.6 | 72 | 0.474638 |
687e82facb1c566f3053458fc624743ceebb30e4 | 2,916 | py | Python | easyp2p/platforms/grupeer.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/platforms/grupeer.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/platforms/grupeer.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Download and parse Grupeer statement.
"""
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from easyp2p.p2p_parser import P2PParser
from easyp2p.p2p_webdriver import P2PWebDriver
from easyp2p.platforms.base... | 31.695652 | 78 | 0.641632 |
76748a7ef2f9b444d43283ed37f7ae3fa6259e04 | 35 | py | Python | modules/ui/__init__.py | cloud441/Procerfa | 7472aeecc4eb3003e2e0f09bb0ae71f1b33e9ccf | [
"MIT"
] | 14 | 2019-12-08T11:37:35.000Z | 2022-03-22T03:07:17.000Z | modules/ui/__init__.py | cloud441/Procerfa | 7472aeecc4eb3003e2e0f09bb0ae71f1b33e9ccf | [
"MIT"
] | null | null | null | modules/ui/__init__.py | cloud441/Procerfa | 7472aeecc4eb3003e2e0f09bb0ae71f1b33e9ccf | [
"MIT"
] | 3 | 2019-12-03T09:21:21.000Z | 2022-01-15T02:53:36.000Z | from .mainwindow import MainWindow
| 17.5 | 34 | 0.857143 |
8c9e5de97624840d4650a685df25413f3f6f5b80 | 312 | py | Python | tests/test_assemblers.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | tests/test_assemblers.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | tests/test_assemblers.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | import pytest
from benwaonline.entities import User
from benwaonline.schemas import UserSchema
from benwaonline.assemblers import get_entity, get_schema
def test_get_entity():
assert issubclass(get_entity('user'), User)
def test_get_schema():
assert issubclass(get_schema(User._schema), UserSchema)
| 22.285714 | 59 | 0.804487 |
50eb159f349687db4132019105e5d138548b667d | 16 | py | Python | migratory-birds.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | migratory-birds.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | migratory-birds.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | #!/bin/python3
| 5.333333 | 14 | 0.625 |
50f118b97cd8c133030655cec2916f3edceca7da | 6,482 | py | Python | src/onegov/election_day/models/archived_result.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/archived_result.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/archived_result.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from copy import deepcopy
from onegov.ballot.models.mixins import DomainOfInfluenceMixin
from onegov.ballot.models.mixins import TitleTranslationsMixin
from onegov.core.orm import Base
from onegov.core.orm import translation_hybrid
from onegov.core.orm.mixins import ContentMixin
from onegov.core.orm.mixins import meta_... | 32.737374 | 78 | 0.685745 |
e86b111a4524ffb2b15638488406bb3d7a158c2d | 387 | py | Python | App/ext.py | linzhendemo2/linzhne00 | 767f75af53749d50986abba7a56b40bf4f706c4c | [
"Apache-2.0"
] | null | null | null | App/ext.py | linzhendemo2/linzhne00 | 767f75af53749d50986abba7a56b40bf4f706c4c | [
"Apache-2.0"
] | null | null | null | App/ext.py | linzhendemo2/linzhne00 | 767f75af53749d50986abba7a56b40bf4f706c4c | [
"Apache-2.0"
] | null | null | null | from flask_migrate import Migrate
from App.apis import blue
from App.models import db
migrate = Migrate()
def init_ext(app):
app.register_blueprint(blueprint=blue)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:123456@localhost:3306/linzhen'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = ... | 25.8 | 96 | 0.757106 |
fa09990eab7ab9401787362328d194040dcb5ebe | 1,166 | py | Python | tools/pythonpkg/tests/fast/arrow/test_binary_type.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/arrow/test_binary_type.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/arrow/test_binary_type.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
import os
try:
import pyarrow as pa
from pyarrow import parquet as pq
import numpy as np
can_run = True
except:
can_run = False
def create_binary_table(type):
schema = pa.schema([("data", type)])
inputs = [pa.array([b"foo", b"bar", b"baz"], type=type)]
return pa.Table.from... | 29.897436 | 60 | 0.608062 |
7e4837d4c5b3aad7275da0d1b065876d8f74e838 | 1,537 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_copy.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_copy.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_copy.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 TestTransformCopy(unittest.TestCase):
def setUp(self):
self.data = {
"test": "test1",
"hallo": "Hallo",
"test2": "visuanalytics"
}
def test_transfo... | 24.790323 | 86 | 0.412492 |
2ad432d73c72dd0a227b9c74c92b9e4a829e5bcf | 499 | py | Python | setup.py | wizzzard91/trie | ad8f921ab8c3809f674740741dd74f16293b04c0 | [
"MIT"
] | null | null | null | setup.py | wizzzard91/trie | ad8f921ab8c3809f674740741dd74f16293b04c0 | [
"MIT"
] | null | null | null | setup.py | wizzzard91/trie | ad8f921ab8c3809f674740741dd74f16293b04c0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(name='trie',
version='1.0',
description='Trie',
classifiers=[
'Programming Language :: Python :: 3.5',
'Topic :: Text Processing',
],
keywords='trie',
url='https://github.com/wizzzard91/trie',
author='Bulat ... | 27.722222 | 52 | 0.617234 |
fac8515606d1de327e33e77ba089716f0a809f26 | 3,069 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex10_symmetry.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex10_symmetry.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex10_symmetry.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch08_binary_trees.util import TreeUtils
from ch08_binary_trees.intro import ExampleTrees
from ch08_binary_trees.intro.intro_binary_tree_node import BinaryTreeNode
def is_symmetric(node):
if node is None:
return T... | 26.008475 | 86 | 0.692408 |
faca0ad588ac299cbc59993715440d5042d31496 | 13,618 | py | Python | Packs/CommonScripts/Scripts/FormatURL/FormatURL_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | Packs/CommonScripts/Scripts/FormatURL/FormatURL_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/CommonScripts/Scripts/FormatURL/FormatURL_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | from typing import List, Union
from urllib.parse import urlparse
import pytest
TEST_URL_HTTP = 'http://www.test.com'
TEST_URL_HTTPS = 'https://www.test.com'
NOT_FORMAT_TO_FORMAT = [ # Start of http:/ replacements.
('http:/www.test.com', TEST_URL_HTTP),
('https:/www.test.com', TEST_URL_HTTPS),
('http:\\\... | 44.214286 | 119 | 0.664635 |
87af0bbec1402cd750c7b8b573478040c263d371 | 1,525 | py | Python | django_project/apps/cms/staff_views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | django_project/apps/cms/staff_views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | django_project/apps/cms/staff_views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.contrib.auth import get_user_model
User = get_user_model()
from django.shortcuts import render,redirect,reverse
from django.views.generic import View
from django.contrib.auth.models import Group
from django.contrib import messages
from apps.qfauth.decorators import qf_superuser_required
from django.utils.de... | 36.309524 | 67 | 0.671475 |
87c5d06fc04fa1aa168d923db558765d9f3a33cc | 6,861 | py | Python | Packs/ArcusTeam/Integrations/ArcusTeam/ArcusTeam.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ArcusTeam/Integrations/ArcusTeam/ArcusTeam.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ArcusTeam/Integrations/ArcusTeam/ArcusTeam.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import urllib3
import traceback
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from typing import Any, Dict
# Disable insecure warnings
urllib3.disable_warnings()
""" CONSTANTS """
VERSION = "1.0.0"
""" CLIENT CLASS """
class Client(BaseClient):
def __init__(self,... | 33.144928 | 120 | 0.600204 |
35b3aa328a9867e7648674ccba838c2d9e2f48c2 | 49 | py | Python | api/__init__.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | api/__init__.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | api/__init__.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | from nlp_services import AllenNLP,StanfordCoreNLP | 49 | 49 | 0.918367 |
10b00c8e4e5210e0402ac82a1a49e99271d82db9 | 4,332 | py | Python | solutions/mols_search/mols-search-webserver/src/app.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-04-06T06:13:20.000Z | 2021-04-06T06:13:20.000Z | solutions/mols_search/mols-search-webserver/src/app.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/mols_search/mols-search-webserver/src/app.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2020-04-03T05:24:47.000Z | 2020-04-03T05:24:47.000Z | import os
import os.path as path
import logging
from common.config import DEFAULT_TABLE
from common.const import UPLOAD_PATH
from common.const import default_cache_dir
from service.load import do_load
from service.search import do_search
from service.count import do_count
from service.delete import do_delete
from servi... | 31.620438 | 169 | 0.657895 |
52aabb46ae3af0931745a4a7870fb277bbfa3735 | 1,009 | py | Python | tests/web.adblockplus.org/utils/global_functions.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/utils/global_functions.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/utils/global_functions.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | import os
import time
def setup(options):
options.add_argument('--no-sandbox')
options.add_argument('--window-size=1420,1080')
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument("--disable-dev-shm-usage");
def click_menu_item(driver, list_item_id, item_... | 26.552632 | 62 | 0.647175 |
52dcfe28e6a76fccf2a6502b3e33dd69b9b55b79 | 20,239 | py | Python | dailyTasks.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | dailyTasks.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | dailyTasks.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import django
# Setup the Django environment of the Kiosk
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ffeKiosk.settings")
django.setup()
# Import the Modules
from django.conf import settings
from django.db.models import Q
from datetime import datetime, timedelta
impor... | 40.640562 | 717 | 0.672563 |
5e138faabeb17d01d09da0210731743c96b7bda3 | 5,412 | py | Python | skripte/python/edit_tools/abgleich_sprachvarianten.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/edit_tools/abgleich_sprachvarianten.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/edit_tools/abgleich_sprachvarianten.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# :Copyright: © 2014 Günter Milde.
# Released without warranty under the terms of the
# GNU General Public License (v. 2 or later)
# :Id: $Id: $
# Abgleich der Trennstellen zwischen Sprachvarianten
# =================================================... | 39.217391 | 80 | 0.476349 |
d805618d1565a9e726a375fddc3e6df747c411eb | 550 | py | Python | RedBook/ch8/mysite/views.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | RedBook/ch8/mysite/views.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | RedBook/ch8/mysite/views.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from django.views.generic.base import TemplateView
from django.apps import apps
#--- TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
# context['app_list'] = ['polls', 'books']
dict... | 34.375 | 57 | 0.645455 |
525ae7470baccf24c92735d6536b741fd5112f2c | 29,359 | py | Python | Packs/CyberTotal/Integrations/CyberTotal/CyberTotal.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CyberTotal/Integrations/CyberTotal/CyberTotal.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CyberTotal/Integrations/CyberTotal/CyberTotal.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import traceback
from typing import Any, Dict, List
from urllib.parse import urlparse
from datetime import timezone
import dateparser
import requests
import demistomock as demisto
from CommonServerPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CONSTANTS '''
''' CLIENT C... | 37.022699 | 127 | 0.630369 |
df610ba9983f2ee2d8c45097f0819431a8622d2a | 4,722 | py | Python | prototype/examples/user_support/lab_orchestrator_prototype/api.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/user_support/lab_orchestrator_prototype/api.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/user_support/lab_orchestrator_prototype/api.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | 1 | 2021-09-26T12:09:52.000Z | 2021-09-26T12:09:52.000Z | from distutils.util import strtobool
import os
import logging
from lab_orchestrator_prototype.kubernetes.api import Proxy, APIRegistry
from lab_orchestrator_prototype.kubernetes.controller import NamespaceController, NetworkPolicyController, \
DockerImageController, VirtualMachineInstanceController, LabController,... | 43.321101 | 131 | 0.7446 |
1d645475562cfe7e61978555fbc4c0908eeb9a9f | 396 | py | Python | Algorithms/Strings/ValidString.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Strings/ValidString.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Strings/ValidString.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
from collections import Counter
S = raw_input()
counter = Counter(S)
dic = dict()
for value in counter.values():
dic[value] = dic.get(value, 0) + 1
size = len(dic)
if size > 2:
print 'NO'
elif size == 1:
print 'YES'
else:
if dic.get(1) == 1:
print 'YES'
elif dic.get(min(dic... | 15.84 | 41 | 0.550505 |
63c2a35aa6c445f52013e76b1bb1c2a5582612f2 | 39 | py | Python | python/python_backup/PRAC_PYTHON/1_add.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/1_add.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/1_add.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | a=10
b=20
c=a+b
print("output",c);
| 7.8 | 19 | 0.538462 |
d604cd67b63a68516bdc9285a926fbd5a0ea7014 | 485 | py | Python | sandbox/world/world.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | sandbox/world/world.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | 1 | 2022-03-22T23:50:32.000Z | 2022-03-22T23:50:32.000Z | sandbox/world/world.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | from typing import List
from sandbox.character.character import Character
from sandbox.location.map import Map
class World:
current_time: int = 0
characters: List[Character]
map: Map
def __init__(self, world_map: Map, characters: List[Character]) -> None:
self.characters = characters
... | 25.526316 | 76 | 0.686598 |
c3b235ee9c1a4978d65e8c075307fef710c91737 | 754 | py | Python | Tutorials/10 Days of Statistics/Day 1/interquartile_range.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Tutorials/10 Days of Statistics/Day 1/interquartile_range.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/10 Days of Statistics/Day 1/interquartile_range.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
n = int(input().strip())
values = [int(arr_i) for arr_i in input().strip().split(' ')]
freqs = [int(arr_i) for arr_i in input().strip().split(' ')]
arr = []
for i in range(n):
current = [values[i]] * freqs[i]
arr.extend(current)
sorted_arr = sorted(arr)
def my_median(arr):
leng... | 20.944444 | 61 | 0.592838 |
61a5a0c2015b07b4fc9e0ec3564ac9b020a99102 | 6,845 | py | Python | adni_to_numpy.py | bsolano/Alzheimer-Resnets | b7b4f0d240f932513ef3427924894358b87dd68f | [
"MIT"
] | 3 | 2020-04-01T08:13:31.000Z | 2020-10-30T01:01:41.000Z | adni_to_numpy.py | bsolano/Alzheimer-Resnets | b7b4f0d240f932513ef3427924894358b87dd68f | [
"MIT"
] | null | null | null | adni_to_numpy.py | bsolano/Alzheimer-Resnets | b7b4f0d240f932513ef3427924894358b87dd68f | [
"MIT"
] | 1 | 2021-01-27T11:46:49.000Z | 2021-01-27T11:46:49.000Z | import pydicom as dcm
from pathlib import Path
import itertools
import re
import csv
import torch
import numpy as np
import scipy
import skimage.transform
import os
CLASS_NAMES = [ 'CN', 'EMCI', 'MCI', 'LMCI', 'AD']
DATA_DIR = './ADNI'
SAVE_DIR = './NumpyADNI'
def getlabels():
''' '''
labels = {}
with ope... | 35.102564 | 161 | 0.582469 |
61babc21557b17fed436adf065b79f7f90e201fe | 324 | py | Python | kernel/accounts/actions.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/accounts/actions.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/accounts/actions.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | # Register your actions here.
def make_active(modeladmin, request, queryset):
queryset.update(is_active = True)
def make_deactive(modeladmin, request, queryset):
queryset.update(is_active = False)
make_active.short_description = 'Make User Activated.'
make_deactive.short_description = 'Make User Deactivat... | 24.923077 | 58 | 0.777778 |
4ee9f0173cae0bae620a1a48b346969ed46b2faa | 2,776 | py | Python | flogger/author/tests.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | flogger/author/tests.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | flogger/author/tests.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | import os
import unittest
import pathlib
from flask import session
from dotenv import load_dotenv
env_dir = pathlib.Path(__file__).parents[1]
load_dotenv(os.path.join(env_dir, '.flaskenv'))
from author.models import Author
from application import db
from application import create_app as create_app_base
from utils.tes... | 31.908046 | 87 | 0.600144 |
9cc72b109ee6afd893247941bfbf3526c5964a1f | 608 | py | Python | source/pkgsrc/math/py-ephem/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/math/py-ephem/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/math/py-ephem/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2020/05/31 20:49:33 joerg Exp $
Python 3.6 doesn't default to UTF-8, but still tries to convert to Unicode.
--- setup.py.orig 2020-05-31 17:37:01.440042910 +0000
+++ setup.py
@@ -24,7 +24,7 @@ libastro_files = glob('libastro-%s/*.c'
libastro_data = glob('extensions/data/*.c')
def re... | 38 | 142 | 0.671053 |
210da718f22319ef36c3f5ef501d2926d5b7073e | 35 | py | Python | lib/python3.5/fnmatch.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/fnmatch.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/fnmatch.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/fnmatch.py | 35 | 35 | 0.8 |
4caa4fd03bf48da831e8a7c6582076aa37c91df0 | 884 | py | Python | courses/2020-LMU-RDM/NDA2015_nix_excercise/readdata_py.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | courses/2020-LMU-RDM/NDA2015_nix_excercise/readdata_py.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | courses/2020-LMU-RDM/NDA2015_nix_excercise/readdata_py.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | import matplotlib.pyplot as plot
import numpy as np
import nixio as nix
# read data from file
nixf = nix.File.open("module2x.h5", nix.FileMode.ReadOnly)
# inspect contents
print(nixf.blocks)
# get overview of block contents
for b in nixf.blocks:
tlst = list(filter(lambda x: x.type == "nix.trial", b.tags))
... | 24.555556 | 72 | 0.611991 |
e2c684c51db4be1465cbfc741728617116bc4c91 | 2,140 | py | Python | pk/data/qxy/config_test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/qxy/config_test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/qxy/config_test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | import configparser
import os
""""def _store_(doc_name, a):
store = open("directory.ini", "a+")
conf=configparser.ConfigParser()
conf.read(store)
list = [doc_name, '=', a]
print(doc_name+"="+str(a)+"\n",file=store)
conf.set("info", "b_newkey", "new-value")
conf.add_section(section="info")
... | 31.470588 | 84 | 0.638318 |
e2d8fefe39c64595ded2c379b20f213258bf0b95 | 3,014 | py | Python | src/classifier/data_processing/splitting/create_splits.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/classifier/data_processing/splitting/create_splits.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/classifier/data_processing/splitting/create_splits.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | import os
import pickle
from sklearn.model_selection import train_test_split, StratifiedKFold
from src.classifier.data_processing.annotate.annotate_sentences import (
label_with_aggregate_annotation,
)
def create_or_load_indcs(dcfg, label_col, df, annotator_names):
if dcfg.balance_on_majority or dcfg.k_fold:... | 37.675 | 82 | 0.63205 |
46cbcf15916ce42108f5b2fe287c8bf7543a2397 | 1,775 | py | Python | rabbitmq/tutorial/rpc_client.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/rpc_client.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/rpc_client.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pika
import uuid
import sys
import time
class FibonacciRpcClient(object):
def __init__(self):
credentials = pika.PlainCredentials('admin', '1q2w3e')
parameters = pika.ConnectionParameters('192.168.1.197', 5672, '/', credentials)
self.connection = pika.BlockingConnection(parameters)... | 29.098361 | 87 | 0.59831 |
807a81dcb7b7d768c95ac813149d3c5fcdf182e4 | 4,008 | py | Python | Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from GoogleCloudCompute import parse_resource_ids, parse_firewall_rule, \
parse_metadata_items, parse_labels
class TestHelperFunctions:
def test_parse_resource_ids(self):
"""
Given:
- resource ids with 2 items and spaces between them
When:
- callin... | 32.585366 | 97 | 0.601048 |
b30bdfa6d0c3dd269a6c3e355855ed86926221fc | 5,752 | py | Python | Packs/CommonScripts/Scripts/IndicatorMaliciousRatioCalculation/IndicatorMaliciousRatioCalculation.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/CommonScripts/Scripts/IndicatorMaliciousRatioCalculation/IndicatorMaliciousRatioCalculation.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/CommonScripts/Scripts/IndicatorMaliciousRatioCalculation/IndicatorMaliciousRatioCalculation.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import traceback
import hashlib
import json
from dateutil import parser # type: ignore[import]
def get_incident_labels_map(labels):
if labels is None:
return {}
labels_map = {}
for label in labe... | 39.129252 | 120 | 0.642211 |
6408012995a544762eb6823340ba773389f9ab7f | 1,636 | py | Python | IVTp/2014/Shcherbakov_R_A/task_10_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Shcherbakov_R_A/task_10_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Shcherbakov_R_A/task_10_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 10. Вариант 22.
# Напишите программу "Генератор персонажей" для игры. Пользователю должно
# быть предоставлено 30 пунктов, которые можно распределить между четырьмя
# характеристиками: Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы
# пользователь мог не только брать эти пункты из общего "пула", н... | 40.9 | 96 | 0.666259 |
442cae63927e05b568d113901a726f37f6d12f76 | 1,487 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_01_bis_03/01_kapitel_03_repetitionsaufgabe_1.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_01_bis_03/01_kapitel_03_repetitionsaufgabe_1.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_01_bis_03/01_kapitel_03_repetitionsaufgabe_1.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 01_kapitel_03_repetitionsaufgabe_1.py
# Project: Buch_Python3_Das_umfassende_Praxisbuch
# Created Date: Friday 22.02.2019, 16:12
# Author: Apop85
# -----
# Last Modified: Friday 22.02.2019, 19:58
# -----
# Copyright (c) 2019 Apop85
# This software is published u... | 57.192308 | 655 | 0.773369 |
921ecd132f27c51b8caf9ea32cdfeab01e3317d6 | 4,612 | py | Python | 2018/quals/web-js-safe-2/src/generate.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/quals/web-js-safe-2/src/generate.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/quals/web-js-safe-2/src/generate.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
# -*- coding: utf-8 -*-
# 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 requi... | 30.543046 | 135 | 0.6134 |
a6166f5f9754d0e85f75d52c6df1f6d13d63e3ee | 1,018 | py | Python | INBa/2015/Ionova_A_K/task_7_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ionova_A_K/task_7_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ionova_A_K/task_7_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 8.
# Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
# Ionova A.K.
# 30.04.2016
import random
print ("Компьютер загадал название одного из семи холмов, на которых по легенде XVI века была построе... | 31.8125 | 152 | 0.700393 |
45fa398e9634054727831787142b110c49113d11 | 12,399 | py | Python | official/recommend/deep_and_cross/src/deep_and_cross.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/deep_and_cross/src/deep_and_cross.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/deep_and_cross/src/deep_and_cross.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.387622 | 116 | 0.631099 |
3412cccc1299dab55d7fe8034e71ccad3753bf7a | 6,779 | py | Python | official/cv/ADNet/src/datasets/rl_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/datasets/rl_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/datasets/rl_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... | 41.335366 | 118 | 0.597728 |
1b869bf5bf46b2be9bcbfc5bb8a8d936942b97d1 | 1,264 | py | Python | tests/model/test_action.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | tests/model/test_action.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | tests/model/test_action.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import unittest
from chillow.model.action import Action
class ActionTest(unittest.TestCase):
def test_should_have_five_different_actions(self):
self.assertEqual(len(Action), 5)
def test_get_actions_in_order(self):
expected = []
for action in list(Action):
expected.append... | 26.893617 | 69 | 0.669304 |
942dd99f47424568a8a8ab2dbd133091bdbc08f8 | 1,896 | py | Python | Server/client/user.py | TateYdq/DietRegimen | 66c88e84b7c4d9226db1d9567d300b1c6f7344b7 | [
"MIT"
] | null | null | null | Server/client/user.py | TateYdq/DietRegimen | 66c88e84b7c4d9226db1d9567d300b1c6f7344b7 | [
"MIT"
] | null | null | null | Server/client/user.py | TateYdq/DietRegimen | 66c88e84b7c4d9226db1d9567d300b1c6f7344b7 | [
"MIT"
] | null | null | null | import requests
import json
from utils.config import *
ss = requests.session()
def getUserInfo():
data = {
"token":"13"
}
url = URL.format(env=cur_url, term=client_url, action="/user/getUserInfo")
getReq(url, ss, data=data,token=user_token)
def updateUserInfo():
data = json.dumps({
... | 24 | 84 | 0.597574 |
94331c8d7412acf8a3033a934e44150bc2a21be6 | 165 | py | Python | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/16.04-Method-Overriding.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/16.04-Method-Overriding.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/16.04-Method-Overriding.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | class A:
def show(self):
print("in A show")
class B(A):
def show(self):
print("in B show")
var = A()
var.show()
var2 = B()
var2.show()
| 9.705882 | 26 | 0.50303 |
ca559a9aa0bf2caf37fa53399e781882e8cdc593 | 105 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/ph-9.10-list-count-method.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/ph-9.10-list-count-method.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/ph-9.10-list-count-method.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | li = [1, 2, 3, 3, 4, 5, 6]
a = li.count(3)
print(a)
a = li.count(5)
print(a)
a = li.count(10)
print(a)
| 10.5 | 26 | 0.52381 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.