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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
495acec50bd6f21079f085baddfb73193e2ecb61 | 1,022 | py | Python | src/server/tests/test_workspace.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/tests/test_workspace.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/tests/test_workspace.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | import pytest
from ..app.repository.WorkspaceRepository import WorkspaceRepository
import json
import re
import uuid
import time
from ..app.models.Workspace import Workspace
from mongoengine import disconnect, connect
workspace = WorkspaceRepository(testing=True)
@pytest.fixture(scope="session", autouse=True)
def ... | 29.2 | 96 | 0.704501 |
498419bd5e798d7306dbd9a50ecec8bcc71fafb0 | 1,690 | py | Python | dewar/config.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/config.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/config.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import json
import logging
def _get_from_env(name, default=None):
'''Get config from environ variable
:param name: the name of environ variable
:param default: the value return if there is no match environ variable
'''
raw_value = os.environ.get(name, default)
... | 25.606061 | 74 | 0.591716 |
77366386d6943f1ee0af0f1f10914ccc847f3336 | 2,134 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_rmedia.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_rmedia.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_rmedia.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 37.438596 | 132 | 0.655108 |
91f9f97310ef16042e6f4ce917fcf4d1be170aef | 1,952 | py | Python | Algorithms/Strings/weighted_uniform_strings.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/weighted_uniform_strings.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/weighted_uniform_strings.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from itertools import groupby
import string
def slow_work1():
L = list(string.ascii_lowercase)
S = list(map(str, input().strip()))
new_s = []
last_c = ''
last_cnt = 0
# print(S)
for i in range(0, len(S)):
if S[i] == last_c:
new_s.append(... | 21.688889 | 56 | 0.47541 |
627b40b5ccdb3a88cb0b99cc7699a42d4e3ff229 | 273 | py | Python | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/19.00-Multi-Threading.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/19.00-Multi-Threading.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/19.00-Multi-Threading.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | from threading import Thread
class Hello(Thread):
def run(self):
for i in range(100):
print("Hello", i)
class Hi(Thread):
def run(self):
for i in range(100):
print("Hi", i)
t1 = Hello()
t2 = Hi()
t1.start()
t2.start()
| 13 | 29 | 0.534799 |
6282ee2c30391802f3536270e998c39b87da2e0f | 624 | bzl | Python | source/pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-config.bzl,v 1.1 2021/02/15 14:50:23 ryoon Exp $
* For pkgsrc layout.
--- config.bzl.orig 2021-02-15 05:04:34.000000000 +0000
+++ config.bzl
@@ -30,9 +30,9 @@
BRANDING = "Mozc"
-LINUX_MOZC_SERVER_DIRECTORY = "/usr/lib/mozc"
-IBUS_MOZC_ICON_PATH = "/usr/share/ibus-mozc/product_icon.png"
-IBUS_MOZC_... | 31.2 | 66 | 0.733974 |
02a15b4bd771031e31ea680b30b2bf5577ac9847 | 2,736 | py | Python | tests/test_data_structures.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | tests/test_data_structures.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | tests/test_data_structures.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null |
import logging
from unittest import TestCase
from rengine.data_structures import StrengthExerciseQueue
import unittest
logging.basicConfig(level=logging.INFO)
class TestStrengthExerciseQueue(TestCase):
def test_add_element_to_queue(self):
queue = StrengthExerciseQueue()
queue.add("exercise 1", ... | 38 | 82 | 0.655336 |
b84e44dda4957d03254aea9c226fb5f218b0fe6e | 4,488 | py | Python | asteroid/filterbanks/__init__.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | asteroid/filterbanks/__init__.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | asteroid/filterbanks/__init__.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | from .analytic_free_fb import AnalyticFreeFB
from .free_fb import FreeFB
from .param_sinc_fb import ParamSincFB
from .stft_fb import STFTFB
from .enc_dec import Filterbank, Encoder, Decoder
from .griffin_lim import griffin_lim, misi
from .multiphase_gammatone_fb import MultiphaseGammatoneFB
def make_enc_dec(
fb_n... | 35.904 | 97 | 0.66377 |
b2280753deab10090d21de3c07994032fb4ef59e | 168 | py | Python | elements/python/5/2/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/5/2/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/5/2/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def swap(x, i, j):
"""
swap bits i and j of x.
"""
mask = (1<<i) | (1<<j)
m = x&mask
if m == 0 or m == mask:
return x
return x^mask
| 16.8 | 27 | 0.410714 |
a241235d87872ea1918bc8d11e8440b1a7c5a1d6 | 648 | py | Python | scripts/fabsp/haproxy.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/haproxy.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/haproxy.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import cd, settings, sudo
def download():
"""
curl -o haproxy.tar.gz https://www.haproxy.org/download/1.9/src/haproxy-1.9.0.tar.gz
tar xzf haproxy.tar.gz
"""
with cd("/usr/src"), settings(warn_only=True):
for line in download.... | 22.344828 | 88 | 0.609568 |
3ba485792af8aebcdce861f5a19f87548bc946e2 | 523 | py | Python | nz_crawl_demo/day2/demo5.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/demo5.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/demo5.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from urllib import parse
params = {'name':'张三','age':18,'greet':'hello world'}
qs = parse.urlencode(params)
print(qs) #name=%E5%BC%A0%E4%B8%89&age=18&greet=hello+world
res =parse.parse_qs(qs)
# print(res) #name=%E5%BC%A0%E4%B8%89&age=18&greet=hello+world
# https://www.baidu.com/s?wd=朱道布鲁克&rsv_spt=1&rsv_iqid=0
url = ... | 26.15 | 62 | 0.724665 |
5a8b4b3f544176021a82ef993e9f815f1df9b353 | 298 | py | Python | tests/src/utils/mask/test_mask.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | tests/src/utils/mask/test_mask.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | tests/src/utils/mask/test_mask.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | import numpy as np
from utils.mask.mask import get_systematic_mask
np.set_printoptions(threshold=np.inf)
def test_get_systematic_mask():
mask = get_systematic_mask(p=0.2, num_workers=2)
print(mask.sum())
print(mask.shape)
if __name__ == '__main__':
test_get_systematic_mask()
| 18.625 | 52 | 0.744966 |
ce9d7e30dfb975f1a93d7270d430594824fe127f | 213 | py | Python | pyScript_NodeManager/pyScript NodeManager.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | 18 | 2021-01-18T09:52:41.000Z | 2022-03-22T10:48:44.000Z | Ryven_NodeManager/Ryven NodeManager.py | xamofb-xsk/Ryven | 8c3dcc613098863ae9fb747e62c0bb9d9eb4cef1 | [
"MIT"
] | null | null | null | Ryven_NodeManager/Ryven NodeManager.py | xamofb-xsk/Ryven | 8c3dcc613098863ae9fb747e62c0bb9d9eb4cef1 | [
"MIT"
] | 3 | 2021-01-18T09:49:42.000Z | 2022-03-22T10:48:47.000Z | import sys
from MainWindow import MainWindow
from PySide2.QtWidgets import QApplication
if __name__ == '__main__':
app = QApplication(sys.argv)
mw = MainWindow()
mw.show()
sys.exit(app.exec_())
| 17.75 | 42 | 0.704225 |
0b717526b287ab9bb4ab30643b3ecd570faae387 | 490 | py | Python | exercises/ja/test_04_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/test_04_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/test_04_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
len(doc1.ents) == 2 and len(doc2.ents) == 2 and len(doc3.ents) == 2
), "各docに2つの固有表現が含まれています。"
assert any(
e.label_ == "PERSON" and e.text == "ピューディパイ" for e in doc2.ents
), "doc2のPERSONのスパンを確認してください"
assert any(
e.label_ == "PERSON" and e.text == "アレクシス・... | 32.666667 | 84 | 0.628571 |
65366a3101e223b5d71e9ae0a528e396527a899a | 909 | py | Python | nasahack-main/nasahack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | nasahack-main/nasahack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | nasahack-main/nasahack.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 os
import sys
import time
os.system("pkg install figlet")
os.system("clear")
os.system("figlet Hocker-X")
print("Enter your name")
name = input()
time.sleep(2)
print("====================================================")
print("----------------Ddos attack started!----------------")
print("=====================... | 34.961538 | 64 | 0.386139 |
333d18f0067fa20f32165f894eae890e7f475da2 | 1,059 | py | Python | KNN/standard_data.py | lance52587/MachineLearningNote | 0184f8de178990ee31ace2a43809830874313697 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | KNN/standard_data.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | KNN/standard_data.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | # -*- coding: utf-8 -*-
# @Date : 2017-04-03 16:04:19
# @Author : Alan Lau (rlalan@outlook.com)
import reader
import fwalker
import bfile
def change_data(files, inputpath):
trainpath = bfile.buildfile(inputpath+'\\'+'trainingDigits')
testpath = bfile.buildfile(inputpath+'\\'+'testDigits')
for file in ... | 33.09375 | 84 | 0.644004 |
d7a2e30221cf76ec6e88b56fee66bf736747c20e | 11,123 | py | Python | DatenbankEditWaffe.py | JoergRue/Sephrasto | a4fa3c2c1b095b674a9e71416ca448e3be3de225 | [
"MIT"
] | null | null | null | DatenbankEditWaffe.py | JoergRue/Sephrasto | a4fa3c2c1b095b674a9e71416ca448e3be3de225 | [
"MIT"
] | null | null | null | DatenbankEditWaffe.py | JoergRue/Sephrasto | a4fa3c2c1b095b674a9e71416ca448e3be3de225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'DatenbankEditWaffe.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_talentDialog(object):
def setupUi(self, talentDialog):
... | 55.338308 | 326 | 0.718511 |
d7a39c46efa880c87fd580503b5bb26859858408 | 169 | py | Python | exercises/ja/exc_02_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_02_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_02_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("ja_core_news_md")
doc = nlp("テレビと本")
token1, token2 = doc[0], doc[2]
# 「テレビ」と「本」の類似度を取得
similarity = ____.____(____)
print(similarity)
| 15.363636 | 35 | 0.698225 |
d7c43d06b3d06faa525dda5e58971c406d5df7a6 | 4,071 | py | Python | docker/api/api/endpoints/login.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | docker/api/api/endpoints/login.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | docker/api/api/endpoints/login.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Login API endpoint
from main import api, jwt, db
from flask import Flask, jsonify, request
from flask_jwt_extended import JWTManager, jwt_required, create_access_token, get_jwt_identity, get_raw_jwt, decode_token, set_access_cookies, unset_jwt_cookies
from models.users import users, tokens
fr... | 38.40566 | 160 | 0.718742 |
04496edbcf9915b6af86ea01ca629e27c55ae076 | 921 | py | Python | publishconf.py | fernanluis/fernanluis.github.io | eb063d40f2893fb9dd5b22662f343827aa6b157a | [
"MIT"
] | 1 | 2021-02-15T12:19:44.000Z | 2021-02-15T12:19:44.000Z | publishconf.py | fernanluis/fernanluis.github.io | eb063d40f2893fb9dd5b22662f343827aa6b157a | [
"MIT"
] | null | null | null | publishconf.py | fernanluis/fernanluis.github.io | eb063d40f2893fb9dd5b22662f343827aa6b157a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
OUTPUT_PATH = 'output/'
# If your site is available via HTTPS, make sure SITEURL begins with ht... | 25.583333 | 88 | 0.747014 |
f08b4ca3ddf7ca878f25cc73ca3b7c0741d467e8 | 982 | py | Python | elements/python/8/10/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/8/10/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/8/10/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, x, nxt):
self.x = x
self.next = nxt
def dedup(n):
"""
Remove duplicates from n, which is assumed to be sorted.
"""
s = n
while n is not None:
if n.x != s.x:
s.next = n
s = n
n = n.next
s.next = N... | 16.098361 | 60 | 0.495927 |
f0aff9c5751fa4aec3454a043147dd7f3a9da320 | 6,560 | py | Python | project/api/__init__.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/__init__.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/__init__.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from apispec import APISpec
from apispec.exceptions import DuplicateComponentNameError
from apispec.ext.marshmallow import MarshmallowPlugin
from flask import url_for
from flask_apispec.extension import FlaskApiSpec
from flask_babelex import gettext
from flask_marshmallow import Marshmallow
from flask_restful import Ap... | 32.8 | 107 | 0.587805 |
0b01868168370a93a329bd7cfa53033ba9d71217 | 2,175 | py | Python | backend/match4healthcare/settings/production.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/match4healthcare/settings/production.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/match4healthcare/settings/production.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | import logging
import os
from django.utils.log import DEFAULT_LOGGING
from match4healthcare.constants.enum import Environment
from match4healthcare.settings.common import * # noqa
from match4healthcare.settings.common import IS_FORK, MIDDLEWARE, RUN_DIR
logger = logging.getLogger(__name__)
THIS_ENV = Environment.P... | 28.618421 | 95 | 0.701149 |
a85b3a6886cef0211f17384d3e1ccdafa18fb1ed | 17,721 | py | Python | spangle/api.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | 2 | 2019-11-17T06:38:56.000Z | 2019-12-01T15:32:03.000Z | spangle/api.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | spangle/api.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | """
Main Api class.
"""
import asyncio
import inspect
import re
from collections.abc import Callable
from contextvars import Context, copy_context
from typing import Any, Literal, Optional
import jinja2
from starlette.middleware.errors import ServerErrorMiddleware
from starlette.staticfiles import StaticFiles
from st... | 35.091089 | 88 | 0.588059 |
76371e9732fabffddf37ff014a8ef866e24d5921 | 387 | py | Python | nz_crawl_demo/day2/demo6.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/demo6.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/demo6.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
url = 'http://www.httpbin.org/ip'
res = request.urlopen(url)
print(res.read().decode('utf-8'))
url1 = 'http://www.httpbin.org/ip'
#构建处理器
handler = request.ProxyHandler({'https':'221.224.136.211:35101'})
#创建打开器
opener = request.build_opener(handler)
#构建请求对象
req1 = request.Request(url)
#使用打开... | 21.5 | 65 | 0.715762 |
0f9965d0ffe0f78cb7ec29bd4e7fe7699d180bd9 | 1,071 | py | Python | src/csv_writer.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | src/csv_writer.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | src/csv_writer.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | import csv
# csv export freqItemSet
def write_csvfile_freq(fname,freqItemSet):
with open(fname, 'a') as csv_file:
writer = csv.writer(csv_file)
writer.writerow(['frequent itemsets:'])
writer.writerow('')
for key, value in freqItemSet.items():
writer.writerow([st... | 31.5 | 53 | 0.608777 |
ad24eda33da2d0f38f38bfddf72dbab4af193e99 | 1,663 | py | Python | docs/_ext/form_role.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | docs/_ext/form_role.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | docs/_ext/form_role.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | from docutils import nodes
import jinja2
from docutils.parsers.rst.directives import unchanged
from sphinx.util.docutils import SphinxDirective
FORM_TEMPLATE = jinja2.Template(
u"""
<div class="subscribe-form align-right newsletter-footer w-form">
<form id="subscribe-form-docs" name="subscribe-form-docs">
... | 28.186441 | 101 | 0.681299 |
a8e96ff89fa8e93b979c4519b03551d84777cd39 | 2,167 | py | Python | src/onegov/election_day/forms/archive.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/archive.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/archive.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.models import ArchivedResult
from onegov.form import Form
from onegov.form.fields import MultiCheckboxField
from wtforms.fields.html5 import DateField
from wtforms import StringField
from onegov.election_day import _
class ArchiveSearchForm(Form):
term = StringField(
label=_("Tex... | 29.684932 | 71 | 0.619289 |
a8ecae9d0b19ab8dcbe9119c937be289627eb6cf | 951 | py | Python | INBa/2015/SOSNOVY_M_S/task_6_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/SOSNOVY_M_S/task_6_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/SOSNOVY_M_S/task_6_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 6. Вариант 26.
#Создайте игру, в которой компьютер загадывает название одного из восьми категорий, на которые разделяются дорожные знаки в соответствии с Венской конвенцией о дорожных знаках и сигналах, а игрок должен его угадать.
#Sosnovy M.S.
#16.03.2016
import random
print("компьютер загадывает название од... | 43.227273 | 215 | 0.749737 |
7e23ce654109352e67b78f8a6c786f02f7a0e22c | 4,136 | py | Python | sketches/avoider4a/sprite.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/avoider4a/sprite.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/avoider4a/sprite.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from random import randint, choice
tw = th = 36
class Sprite(object):
def __init__(self, posX, posY):
self.x = posX
self.y = posY
def checkCollision(self, otherSprite):
if (self.x < otherSprite.x + tw and otherSprite.x < self.x + tw
and self.y < otherSprite.y + th and othe... | 26.683871 | 77 | 0.518375 |
cb33b9b0f4e2d8367e39736b498b74a8ecd35d7b | 5,296 | py | Python | examples/python/duckdb-python.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | examples/python/duckdb-python.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | examples/python/duckdb-python.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
# basic SQL API
# connect to an in-memory temporary database
conn = duckdb.connect()
# if you want, you can create a cursor() like described in PEP 249 but its fully redundant
cursor = conn.cursor()
# run arbitrary SQL commands
conn.execute("CREATE TABLE test_table (i INTEGER, j STRING)")
# add some ... | 28.473118 | 117 | 0.736405 |
69beedcd0b329108fc15129775fdf385394c4958 | 34,711 | py | Python | SiteGadget-main/modules/findShell.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | SiteGadget-main/modules/findShell.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | SiteGadget-main/modules/findShell.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, json
from insides.Colors import Colors
def findShell(site, _verbose=None):
if _verbose != None:
website = ("https://"+site)
shell = ["0day.php", "1.php", "10.php", "11.php", "12..php", "12.php", "123.php", "1234.php", "2.php", "3.php", "4.php", "404.php", "4ever.php", "5.php", "6.php", "7.php", ... | 1,826.894737 | 34,237 | 0.754084 |
2dc9fe61d4f6916d556cfcfffd8aa626b37acd85 | 10,897 | py | Python | ImageClassify/advanced CNN/Residual_Network_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | ImageClassify/advanced CNN/Residual_Network_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | ImageClassify/advanced CNN/Residual_Network_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# 适用于 tensorflow >= 2.0, keras 被直接集成到 tensorflow 的内部
# ref: https://keras.io/about/
from tensorflow.keras.layers import Input, Add, Dense, Activation, ZeroPadding2D, BatchNormalization, \
Flatten, Conv2D, AveragePooling2D, MaxPooling2D
from tensorflow.keras.models impo... | 33.121581 | 124 | 0.602001 |
fae80778c7030272b5324f67a16b75a6d3e5ae6b | 1,522 | py | Python | Algorithms/Implementation/acm_icpc_team.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/acm_icpc_team.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/acm_icpc_team.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
N, M = list(map(int, input().strip().split()))
topics = [int(input().strip(), 2) for _ in range(N)]
d = defaultdict(int)
for i in range(0, N - 1):
for j in range(i + 1, N):
d[bin(topics[i] | topics[j]).count("1")] += 1
print(max(d, key=int))
print... | 24.15873 | 111 | 0.557819 |
57b814a197c4dcc2f68f92d15a17ff0e176cc23d | 2,383 | py | Python | official/cv/lenet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/lenet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/lenet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.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... | 37.825397 | 88 | 0.685271 |
a4c40989d66f9fb6bfac0c9d4acd0a4aef40fa31 | 278 | py | Python | src/pg_controldata.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/pg_controldata.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/pg_controldata.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/python
'''
Copyright (c) 2009-2011 Vladimir Rusinov <vladimir@greenmice.info>
Copyright (c) 2012 Wrike, Inc. [http://www.wrike.com]
License: GNU GPL v.3
'''
from ztc.pgsql.pg_controldata import PgControldata
p = PgControldata()
m = p.args[0]
p.get(m, *p.args[1:])
| 19.857143 | 66 | 0.701439 |
1024e15720b69c2a4202d1eed5f2f1bd7f5bac9a | 1,109 | py | Python | tasks.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | 2 | 2021-03-18T04:34:23.000Z | 2021-03-23T17:35:07.000Z | tasks.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | null | null | null | tasks.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | null | null | null | import os
import shutil
from pathlib import Path
from invoke import task
SRC_DIR = Path("babelbox")
@task
def install(c):
""" Setup develoment environment. Install dependencies etc """
os.system("poetry lock -n")
os.system("poetry install -n")
os.system("poetry run pre-commit install --hook-type pr... | 29.184211 | 90 | 0.664563 |
5e3a5b228456dd05aac02549e97f25cb124b1625 | 2,428 | py | Python | official/cv/crnn_seq2seq_ocr/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/crnn_seq2seq_ocr/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/crnn_seq2seq_ocr/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... | 41.152542 | 111 | 0.667628 |
dc2efb06a7a7deaf024521486315dce925f41e8c | 35 | py | Python | WiSe-2122/Webscraper/test.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Webscraper/test.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Webscraper/test.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
a, b, c = 1,2,3
print(5 * a,b,c) | 7 | 16 | 0.428571 |
dc55f813edf14bf787b57af76a28dc0f580ffcaf | 252 | py | Python | utils/requests.py | nebulousdog/catcobralizard | 0be598b9e76addbe25684ca60aa5ae324cc42183 | [
"MIT"
] | null | null | null | utils/requests.py | nebulousdog/catcobralizard | 0be598b9e76addbe25684ca60aa5ae324cc42183 | [
"MIT"
] | null | null | null | utils/requests.py | nebulousdog/catcobralizard | 0be598b9e76addbe25684ca60aa5ae324cc42183 | [
"MIT"
] | null | null | null | """
Request related utils.
"""
def headers(token):
"""so far all headers are same. DRYs that up slightly."""
headers_obj = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
return headers_obj
| 18 | 61 | 0.607143 |
dcbbc90da9552c535a066777b8b7ec2a4ddd64fa | 6,518 | py | Python | code/diffie_hellman.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | code/diffie_hellman.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | code/diffie_hellman.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
""" Diffie-Hellman Key Exchange.
https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange
https://www.youtube.com/watch?v=Yjrfm_oRO0w
"""
import os
import random
import time
from armor import armor, dearmor
# https://www.ietf.org/rfc/rfc3526.txt
# 2048 bits
MODP14 = """
FFFFF... | 33.947917 | 89 | 0.774317 |
873a33a0792f3ea1ed9e44e52e6b1cb19a75b00c | 1,696 | py | Python | src/assets/experiences/sortierroboter/Demo/code_template.py | TU-Blueberry/bluestberry | fbde8dbcd730fe5c4e69ba15a1208a5c0903aa7d | [
"MIT"
] | 1 | 2022-03-28T17:23:03.000Z | 2022-03-28T17:23:03.000Z | src/assets/experiences/sortierroboter/Demo/code_template.py | TU-Blueberry/bluestberry | fbde8dbcd730fe5c4e69ba15a1208a5c0903aa7d | [
"MIT"
] | null | null | null | src/assets/experiences/sortierroboter/Demo/code_template.py | TU-Blueberry/bluestberry | fbde8dbcd730fe5c4e69ba15a1208a5c0903aa7d | [
"MIT"
] | null | null | null | path_prefix = "Demo/"
import imp
plotting = imp.load_source('plotting.py', path_prefix + 'plotting.py')
plot_model = plotting.plot_model
import numpy as np
import pandas as pd
from sklearn import linear_model
from sklearn.metrics import mean_squared_error, mean_absolute_error
# Hier können die verschiedenen Feature... | 38.545455 | 98 | 0.778892 |
0d6b1345559cd5b9072c1d78a388f06fe0a33b9a | 2,027 | py | Python | _bin/update-links.py | NicoKiaru/imagej.github.io | e334937e361f1aa0ad45cf46ba5c8fadfc32be28 | [
"CC-BY-3.0"
] | 16 | 2020-08-03T20:08:00.000Z | 2022-03-02T15:50:47.000Z | _bin/update-links.py | NicoKiaru/imagej.github.io | e334937e361f1aa0ad45cf46ba5c8fadfc32be28 | [
"CC-BY-3.0"
] | 196 | 2015-09-14T19:15:07.000Z | 2022-03-31T02:22:39.000Z | _bin/update-links.py | NicoKiaru/imagej.github.io | e334937e361f1aa0ad45cf46ba5c8fadfc32be28 | [
"CC-BY-3.0"
] | 60 | 2020-06-04T14:18:37.000Z | 2022-03-30T23:10:55.000Z | import os
def processfile(path):
with open(path, 'r') as f:
lines = f.readlines()
file_changed = False
while True:
line_changed = False
for old, new in redirects.items():
if new.startswith('TODO') or new == '<UNCHANGED>' or new == '???': continue
for i in ran... | 47.139535 | 102 | 0.500247 |
217fec9cbbf71836895c791c200a33cf869b04ea | 14,145 | py | Python | model_zoo/uie/utils.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | model_zoo/uie/utils.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | model_zoo/uie/utils.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.74026 | 108 | 0.517285 |
df4cab62531b93b4694eddb5a85bf10e75748e29 | 4,513 | py | Python | project/__init__.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/__init__.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/__init__.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | import logging
import os
from flask import Flask
from flask_babelex import Babel
from flask_cors import CORS
from flask_gzip import Gzip
from flask_migrate import Migrate
from flask_security import Security, SQLAlchemySessionUserDatastore
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
f... | 30.70068 | 85 | 0.75205 |
89af0abcf09f05340e40149e5396e89834cbdd4a | 1,374 | py | Python | src/doc/tutorials/tutorial_examples/scripting/listing_3_using_visits_building_blocks.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/doc/tutorials/tutorial_examples/scripting/listing_3_using_visits_building_blocks.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/doc/tutorials/tutorial_examples/scripting/listing_3_using_visits_building_blocks.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | ###########################################
# file: VisIt Scripting Tutorial Listing 3
###########################################
#
# 1) Open VisIt
# 2) Open 'example.silo'
# 3) Paste and execute via the Commands window, or the CLI.
#
# Clear any previous plots
DeleteAllPlots()
# Create a plot of the scalar field 'te... | 26.941176 | 59 | 0.721252 |
89b479ef2e80fa47ca24c9b4da43309719fb9fc9 | 636 | py | Python | Curso-Em-Video-Python/2Exercicios/078_maior_e_menor_valor_da_lista.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/078_maior_e_menor_valor_da_lista.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/078_maior_e_menor_valor_da_lista.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | lista = []
maior = menor = 0
for c in range(0, 5):
lista.append(int(input(f'Valor {c}°: ')))
if c == 0:
maior = menor = lista[c]
else:
if lista[c] > maior:
maior = lista[c]
if lista[c] < menor:
menor = lista[c]
print('=-' * 30)
print(f'Você digitou os valores:... | 27.652174 | 65 | 0.529874 |
983e9075456c59fe4b37140fa13fe10801da20b5 | 15,199 | py | Python | generate-html.py | lurch/Pinout2 | bd3b39de2c053607b9415dd9eb0297a401ba7162 | [
"CC-BY-4.0"
] | null | null | null | generate-html.py | lurch/Pinout2 | bd3b39de2c053607b9415dd9eb0297a401ba7162 | [
"CC-BY-4.0"
] | null | null | null | generate-html.py | lurch/Pinout2 | bd3b39de2c053607b9415dd9eb0297a401ba7162 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
import markdown
import unicodedata
import re
import os
import sys
import pinout
import markjaml
import urlmapper
reload(sys)
sys.setdefaultencoding('utf8')
def cssify(value):
value = slugify(value);
if value[0] == '3' or value[0] == '5':
value = 'pow' + value
return value
... | 31.467909 | 222 | 0.569972 |
98521738bed8f0fa77d96c427008b3797d8a1400 | 959 | py | Python | Unknown/mcts.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | Unknown/mcts.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | Unknown/mcts.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import random
MAX_ROUND = 1000
AVALIABLE_CHOICES = [-5, -4, -3, -2, -1, 0, 1, 2, 3]
class Node(object):
def __init__(self):
self.parent = None
self.children = []
self.visited = 0
self.value = 0.0
self.state = None
class State(object):
def __init__(self):
self... | 26.638889 | 81 | 0.645464 |
7f4253b8859cbe62ad159b4a5aa9271fd85103c7 | 1,939 | py | Python | app/auth/main.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/auth/main.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/auth/main.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import app
from app.common.user import User
from flask import abort, g, request, session
from utils import logger
from app.common.models import RoleName
import json
from functools import wraps
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, SignatureExpired, BadSignatur... | 32.316667 | 102 | 0.571944 |
63fb9027f0cab25b6ecdc27362213349567dba11 | 285 | py | Python | doc/examples/classic_func_using_func.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/classic_func_using_func.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/classic_func_using_func.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from local_module import multiply
from transonic import boost
# transonic def func(float[][], float[][])
# transonic def func(int[][], float[][])
def my_log(b):
return np.log(b)
@boost
def func(a, b):
c = multiply(a,b)
return (c * my_log(b)).max()
| 15.833333 | 42 | 0.642105 |
61b363784d717cb1c05eb026f312bbbd68dccc64 | 1,080 | py | Python | SVDD/demo_1.py | Mrxuelovecode/SVDD | fbd7df5cc7df0e24745b8f4df8fab237a2657e88 | [
"Apache-2.0"
] | 6 | 2020-01-08T02:41:10.000Z | 2020-07-24T13:59:04.000Z | SVDD/demo_1.py | Mrxuelovecode/SVDD | fbd7df5cc7df0e24745b8f4df8fab237a2657e88 | [
"Apache-2.0"
] | null | null | null | SVDD/demo_1.py | Mrxuelovecode/SVDD | fbd7df5cc7df0e24745b8f4df8fab237a2657e88 | [
"Apache-2.0"
] | 1 | 2020-03-05T04:21:16.000Z | 2020-03-05T04:21:16.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 24 10:37:51 2019
@author: Kepeng Qiu
"""
import numpy as np
import visualize
from Svdd import Svdd
import pandas as pd
import matplotlib.pyplot as plt
# load data
irisData = pd.read_csv(".\\SVDD\\SVDD\\data\\"+"SPE_teX_history.csv", header=0)
# irisData =... | 26.341463 | 81 | 0.607407 |
dce270de83cfcf68088900a72a3f21467d4646cd | 4,902 | py | Python | lib/python/qmk/tests/test_cli_commands.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/tests/test_cli_commands.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/tests/test_cli_commands.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | import subprocess
from qmk.commands import run
def check_subcommand(command, *args):
cmd = ['bin/qmk', command] + list(args)
result = run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
return result
def check_returncode(result, expected=0):
"""Print stdout if `result... | 31.625806 | 143 | 0.709506 |
b4f4496f95ab219e40e4733b597d17eb1c10b482 | 982 | py | Python | router/pipeline.py | half2me/gst-web | 1418d4fa3c11aab91296ce28a17dabcdd29b76c1 | [
"MIT"
] | 1 | 2020-11-17T09:08:24.000Z | 2020-11-17T09:08:24.000Z | router/pipeline.py | half2me/gst-web | 1418d4fa3c11aab91296ce28a17dabcdd29b76c1 | [
"MIT"
] | null | null | null | router/pipeline.py | half2me/gst-web | 1418d4fa3c11aab91296ce28a17dabcdd29b76c1 | [
"MIT"
] | 1 | 2020-11-17T09:08:26.000Z | 2020-11-17T09:08:26.000Z | from api.view.pipeline import *
def setup(app):
pre = '/api/pipelines'
app.router.add_get(pre, get_pipes)
app.router.add_put(pre, create_pipe)
app.router.add_get(pre + '/{id}', getPipelineInfo)
app.router.add_delete(pre + '/{id}', deletePipe)
app.router.add_post(pre + '/{id}/start', startSt... | 36.37037 | 80 | 0.673116 |
d3a61210bb0abaed0c81ea9109a68bd5741a7cab | 384 | py | Python | app/views/main.py | luoweis/xskAdmin | d92d0297102140ce5241a0c9f3a80f520bee96a8 | [
"MIT"
] | null | null | null | app/views/main.py | luoweis/xskAdmin | d92d0297102140ce5241a0c9f3a80f520bee96a8 | [
"MIT"
] | null | null | null | app/views/main.py | luoweis/xskAdmin | d92d0297102140ce5241a0c9f3a80f520bee96a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding=utf-8 -*-
from flask import render_template
from app.bpurls import mainBP
from app.common.xsk_mysql_utils import *
@mainBP.route('/', methods=['GET'])
@mainBP.route('/main',methods=['GET'])
def main():
context = {}
context["title"] = "青岛尚文"
context["content"] = "尚文教学资源管理... | 21.333333 | 56 | 0.664063 |
9f8a0468290f91be3eb9b58880bf1e1fbbd06dea | 1,181 | py | Python | project/cli/user.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/cli/user.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/cli/user.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import json
import click
from flask.cli import AppGroup
from flask_security.confirmable import confirm_user
from project import app, db
from project.services.user import (
add_admin_roles_to_user,
create_user,
find_user_by_email,
)
user_cli = AppGroup("user")
@user_cli.command("add-admin-roles")
@click... | 21.87037 | 54 | 0.715495 |
4c8dee2d452abcfab7941fcb3ecb096b164080e9 | 1,556 | py | Python | IVTa/2014/BRONNIKOV_I_S/task_8_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BRONNIKOV_I_S/task_8_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BRONNIKOV_I_S/task_8_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 8. Вариант 50
# Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4)
# так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право
# на подсказку в том случае, если у него нет никаких предположений.
# Разработайте систему начисления очков, по которой бы игроки, отгадав... | 33.826087 | 79 | 0.614396 |
e293fff9df3335e6d594b6f6e3c14c7e6feb5518 | 315 | py | Python | src/bo4e/enum/messart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/messart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/messart.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Messart(StrEnum):
"""
Gibt an, auf welche Art gemessen wurde.
"""
AKTUELLERWERT = "AKTUELLERWERT" #: AKTUELLERWERT
MITTELWERT = "MITTELWERT" #: MITTELWERT
MAXIMALWERT = "MAXIMALWERT" #: MAXIMALWERT
| 24.230769 | 53 | 0.695238 |
8095fe988188c2139394c5bc984d16c4c88b0a1c | 16,247 | py | Python | 03 Python/Smart Home Dashboard/aufgabe/main.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Smart Home Dashboard/aufgabe/main.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Smart Home Dashboard/aufgabe/main.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | 1 | 2020-10-10T20:24:05.000Z | 2020-10-10T20:24:05.000Z | #! /usr/bin/env python3
# Grafisches Dashboard zur Anzeige von Temparatur- und Luftfeuchtigkeit.
# Die Werte werden über einen angeschlossenen DHT11-Sensor ermittelt und
# in Echtzeit dargestellt.
#
# Zusätzlich können anhand zweier Grenzwerte zwei LEDs zum Blinken gebracht
# werden, wenn die gemessene Temparatur zu k... | 36.02439 | 107 | 0.598572 |
80a16a6e4ae560d9c45652f6746cdca99c08283e | 272 | py | Python | fanger-einer-ausnahme.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | fanger-einer-ausnahme.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | fanger-einer-ausnahme.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null |
try:
x = int(input("Ganzahl eingeben: "))
print("Gut gemacht")
except ValueError as e:
print("Falsche Eingabe")
print(e)
#--
x = int(input("Ganzahl eingeben: "))
if x < 0:
raise ValueError("Falsch gemacht")
print("Programmende")
| 15.111111 | 41 | 0.584559 |
80ae96439986b7e96a4f657148b1bfc71bfa2e84 | 3,180 | py | Python | test/test_npu/test_network_ops/test_detach.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_detach.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_detach.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... | 39.75 | 84 | 0.650943 |
039dfddafe42b2c00092a6017ed509878c91f838 | 3,269 | py | Python | PMIa/2015/KOLOV_A_A/task_10_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/KOLOV_A_A/task_10_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/KOLOV_A_A/task_10_14.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 10. Вариант 14.
# Напишите программу "Генератор персонажей" для игры. Пользователю должно быть предоставлено 30 пунктов, которые можно распределить между четырьмя характеристиками:
# Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но и... | 38.011628 | 209 | 0.646681 |
20c6a5d8d9764ec3eb593ae5467f1286b7599a5d | 721 | py | Python | display/_hd44780_lcd.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_hd44780_lcd.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_hd44780_lcd.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._lcd import Lcd
import RPi.GPIO as GPIO
from RPLCD import CharLCD
# GPIO.setmode(GPIO.BOARD)
# lcd = CharLCD(pin_rs=26, pin_rw=7, pin_e=24, pins_data=[16, 12, 10, 8], numbering_mode=GPIO.BOARD, cols=20, rows=4,
# dotsize=8)
class HD44780Lcd(Lcd):
_lines: list = ["", "", "", ""]
_lcd = Cha... | 30.041667 | 118 | 0.60749 |
640679f9e28570c4e2357132e1b8b9720bc1f411 | 4,020 | py | Python | top/clearlight/base/liaoxuefeng/function/FunctionParameter.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/function/FunctionParameter.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/function/FunctionParameter.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # 位置参数
def power(x):
return x * x
def n_power(x, n):
return x ** n;
def power(x, n):
s = 1
while n > 0:
n -= 1
s *= x
return s
# py不支持重载
# print(power(3))
print(power(3, 3))
print(n_power(3, 3))
# 默认参数
def power(x, n=2):
s = 1
while n > 0:
n -= 1
s *= ... | 17.631579 | 67 | 0.54801 |
ff5ae0b781aaa7b7b4fda99a27c474b1fbef5951 | 507 | py | Python | FuncoesAtivacao.py | petroniocandido/RNA | bdb727cc47baf0d8e04bce5af7e16ea3c07a6a3f | [
"MIT"
] | null | null | null | FuncoesAtivacao.py | petroniocandido/RNA | bdb727cc47baf0d8e04bce5af7e16ea3c07a6a3f | [
"MIT"
] | null | null | null | FuncoesAtivacao.py | petroniocandido/RNA | bdb727cc47baf0d8e04bce5af7e16ea3c07a6a3f | [
"MIT"
] | null | null | null | import numpy as np
def identidade(x, derivada = False):
if not derivada:
return x
else:
return 1
def degrau(x, derivada = False):
if not derivada:
return np.where(x > 0, 1, 0)
else:
return np.where(x > 0, 1, 0)
def sigmoide(x, derivada = False):
if not derivada:
return 1./(1. + np.exp(-... | 18.777778 | 48 | 0.599606 |
a60d7640ccaccaa77c3f5ed5523afbe6ef93ce92 | 4,623 | py | Python | data_preprocessing/preprocessing_corpus.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 1 | 2020-06-04T13:20:45.000Z | 2020-06-04T13:20:45.000Z | data_preprocessing/preprocessing_corpus.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 6 | 2020-06-03T18:45:11.000Z | 2022-02-10T01:51:03.000Z | data_preprocessing/preprocessing_corpus.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | null | null | null | """
Created by Florian Fricke.
"""
from ekphrasis.classes.preprocessor import TextPreProcessor
from ekphrasis.classes.tokenizer import SocialTokenizer
from ekphrasis.dicts.emoticons import emoticons
from textblob_de.lemmatizers import PatternParserLemmatizer
from tqdm import tqdm
from nltk.corpus import stopwords
from... | 40.552632 | 115 | 0.585551 |
5b5fc7ec5a07c50caca229bd799c7497962d1551 | 1,652 | py | Python | reports/AbstractReport.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | reports/AbstractReport.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | reports/AbstractReport.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.path.dirname(__file__))
from libs.ModelFactory import ModelFactory
from measure.StopWatch import StopWatch
class AbstractReport:
"""Common report interface for all the reports.
The class defines some common helper methods used by all reports.
Further more it define... | 30.592593 | 86 | 0.656174 |
5b9d2b87fdff6aae2a6d8fd17344d9bce94d3799 | 254 | py | Python | python/decorator/nesting_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/nesting_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/nesting_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def hello(func):
def wrapper():
print('Hello')
func()
return wrapper
def welcome(func):
def wrapper():
print('Welcome')
func()
return wrapper
@hello
@welcome
def say():
print('Greeting Dome')
say() | 12.7 | 26 | 0.551181 |
5beb2d56ed2ac42c97523f9c07977788bf0d7f42 | 1,445 | py | Python | product/migrations/0001_initial.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | product/migrations/0001_initial.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | product/migrations/0001_initial.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-10-28 09:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('user', '0001_initial'),
('order', '0001_initial'),
]
operations = [
... | 40.138889 | 144 | 0.561246 |
f3930451778a731af4d82fff7090479fd01ba1ba | 3,608 | py | Python | Movie_Recommender.py | Ash993/Movie-Recommender-System | ac0cd32003994f3870a6b2c17782599e2a53953b | [
"MIT"
] | 2 | 2020-04-18T06:33:22.000Z | 2021-02-12T02:47:03.000Z | Movie_Recommender.py | ayush1999guptA/Movie-Recommender-System | 56669a0ee7d0abca15a989cd6cd4b0fdff1f6061 | [
"MIT"
] | null | null | null | Movie_Recommender.py | ayush1999guptA/Movie-Recommender-System | 56669a0ee7d0abca15a989cd6cd4b0fdff1f6061 | [
"MIT"
] | null | null | null | import pandas as pd
from ast import literal_eval
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from surprise import Reader, Dataset, SVD, evaluate
def init():
data = pd.read_csv("dataset/movies_metadata.csv")
credits = pd.read_csv("dataset/c... | 29.096774 | 79 | 0.633038 |
04ef5550d7482811499638253f44f3be610d40a1 | 477 | py | Python | skimind/kernel/gFunctions/search.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/gFunctions/search.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/gFunctions/search.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #-*-coding: utf-8 -*-
# regular expressions module
import re as reg
def find_int_in_str(string=None):
"""
trouver les nombres entiers dans une chaine de caractere
en ignorant les signes
:param string: str
:reutrn: ['float', 'float', ...]
"""
response = []
if string: # si la ... | 23.85 | 81 | 0.620545 |
04f499c9c9b0fdebd08bb0e9e5f4bd3a2acc09a2 | 3,512 | py | Python | RDS/circle2_use_cases/exporter/tests/test_research.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/exporter/tests/test_research.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle2_use_cases/exporter/tests/test_research.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import unittest
import json
from lib.Research import Research
from lib.Service import Service
from pactman import Consumer, Provider
from .test_service import Test_Service
pact = Consumer("ServiceExporter").has_pact_with(Provider("Zenodo"), port=3000)
testingaddress = "http://localhost:3000"
class Test_Research(unit... | 34.097087 | 106 | 0.63639 |
f3f0af547525634de45a6258ac619fcb92461b63 | 535 | py | Python | scripts/qt1/pyqt_sw02_hello_world.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt1/pyqt_sw02_hello_world.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt1/pyqt_sw02_hello_world.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
# Hello World mit den Aenderungen fuer Qt5
from PyQt5 import QtWidgets
def window():
# App
app = QtWidgets.QApplication(sys.argv)
# Fenster instanziierem
window = QtWidgets.QWidget()
window.setGeometry(100, 100, 200, 50)
window.setWindowTitle("PyQt - Version Qt5... | 19.107143 | 47 | 0.66729 |
b68f5d1c06fb4b44ec3b1017264bdaa97910babf | 2,437 | py | Python | app/views/files.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/files.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/files.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | import logging
from flask import request
from flask_login import login_required, current_user
from flask_restplus import Namespace, Resource, abort
from app.services import FileServices
from app.services.file_services.exceptions import FileNotFound
from .models.commons import paginate as paginate_parser
from .models.... | 29.719512 | 79 | 0.685679 |
fce8d39ab696218566c19de0f4d31cf5a186ad32 | 516 | py | Python | benwaonline/gateways/post_gateway.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/gateways/post_gateway.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/gateways/post_gateway.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from benwaonline.assemblers import get_entity, make_entity
from benwaonline.gateways import EntityGateway
class PostGateway(EntityGateway):
_entity = 'post'
def tagged_with(self, tag_names, **kwargs):
'''Returns all Posts that are tagged with any of the given tags.'''
e = get_entity('tag')
... | 34.4 | 75 | 0.678295 |
1ec3be4d2ec1c41058d75ed54bd5c72a7f894487 | 33,595 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/framework/segment/utils.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/paddlevideo/modeling/framework/segment/utils.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/paddlevideo/modeling/framework/segment/utils.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applic... | 44.496689 | 98 | 0.582557 |
bfd6d54824faad5b9666689c45fcf9fcc5781497 | 3,911 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/test_payment_request.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/test_payment_request.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_request/test_payment_request.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.accounts.doctype.payment_request.payment_re... | 37.970874 | 104 | 0.743032 |
01e6b2ab85b2dbc58bf1f9d4f48cd8b64e371e6e | 546 | py | Python | DataStructures/Tree/PreorderTraversal.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/PreorderTraversal.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/PreorderTraversal.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def preOrder(root):
print root.data,
if root.left is not None:
preOrder(root.left)
if root.right is not None:
preOrder(root.right)
def preOrder_smart(root):
if root != None:
print root.data,
preOrder(root.left)
preOrder(root.right)
def pre... | 20.222222 | 36 | 0.569597 |
1715fe6a8acd276ff15214c9462316f2a306d739 | 1,176 | py | Python | socket_bot/colors.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | null | null | null | socket_bot/colors.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | 1 | 2020-07-31T16:37:23.000Z | 2020-07-31T16:37:23.000Z | socket_bot/colors.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | null | null | null | from typing import List, Dict
class CmdColors:
def __init__(self):
self.__colors = {
"HEADER": '\033[95m',
"OKBLUE": '\033[94m',
"OKGREEN": '\033[92m',
"WARNING": '\033[93m',
"FAIL": '\033[91m',
... | 33.6 | 78 | 0.488095 |
bd69020c7154ef687b8a433d8a95e9e9daa913f4 | 16,540 | py | Python | Routerhunter-2.0-master/routerhunter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Routerhunter-2.0-master/routerhunter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Routerhunter-2.0-master/routerhunter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================================================================================
# Scanner RouterHunterBR v2.0 - InurlBrasil Team
# Tool used to find and perform tests in vulnerable routers on the internet.
... | 54.407895 | 671 | 0.493712 |
bd803de1fd565af438e19a402185d4b3596ae308 | 751 | py | Python | Python/Exercícios_Python/066_maior_e_menor_valor.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/066_maior_e_menor_valor.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/066_maior_e_menor_valor.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""066 - Maior e Menor Valor
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1UUrzAsqtSesybaxwRqTfecPArsQtLE7V
"""
cont = soma = maior = menor = 0
não = False
while not não:
n = int(input('Digite um número: '))
soma += n... | 25.896552 | 77 | 0.579228 |
e5a52be6bca7d1a897b928adcb667d3e110a8252 | 1,173 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_and_another.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_and_another.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_and_another.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_model.dqc import MonitorRule
from watchmen_storage import EntityCriteriaExpression, EntityCriteriaOperator
from .data_service_utils import build_column_name_literal, build_date_range_criteria,... | 33.514286 | 97 | 0.826939 |
e5ec6732bcb837524650f0d39acdf093a78baf07 | 1,470 | py | Python | year_3/databases_sem2_cw/dbwrapper/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem2_cw/dbwrapper/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem2_cw/dbwrapper/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | class Market(object):
def __init__(self, market_id,
market_name):
self.id = market_id
self.name = market_name
class Cashier(object):
def __init__(self, cashier_id, cashier_market_id,
cashier_name, cashier_experience, cashier_totalclients, cashier_totalservices... | 33.409091 | 98 | 0.685034 |
0066d5217d0e5dfe2e0f0f40dfb6fb148b02d4cd | 117 | py | Python | areaOfCircle.py | mrmayurs4/Hacktoberfest-2020 | f2bc129bd8574d5870b9595a019bff3baddeaf73 | [
"MIT"
] | null | null | null | areaOfCircle.py | mrmayurs4/Hacktoberfest-2020 | f2bc129bd8574d5870b9595a019bff3baddeaf73 | [
"MIT"
] | null | null | null | areaOfCircle.py | mrmayurs4/Hacktoberfest-2020 | f2bc129bd8574d5870b9595a019bff3baddeaf73 | [
"MIT"
] | null | null | null | import math
r = float(input("Radius << "))
area = math.pi * r * r
print ("Area of Circle is {}".format(str(area))) | 29.25 | 48 | 0.606838 |
00be3201986574069a312623670c79ec129bccf0 | 228 | py | Python | exercises/fr/solution_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/solution_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/solution_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importe spaCy
import spacy
# Crée l'objet nlp anglais
nlp = spacy.blank("en")
# Traite un texte (il signifie "Ceci est une phrase" en anglais)
doc = nlp("This is a sentence.")
# Affiche le texte du document
print(doc.text)
| 19 | 64 | 0.714912 |
00ef5ddc1b78dea18bde190ec976e169009febe6 | 2,519 | py | Python | Packs/ModulesManagement/Scripts/GetInstances/GetInstances_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ModulesManagement/Scripts/GetInstances/GetInstances_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ModulesManagement/Scripts/GetInstances/GetInstances_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from GetInstances import *
ARGS_SYSTEM_FILTER = {'instance_status': 'both'}
ARGS_BRAND_FILTER = {'brand': 'EWS v2, splunk', 'instance_status': 'both'}
ARGS_IS_ENABLED_FILTER = {'instance_status': 'active'}
ARGS_ALL_FILTERS = {'brand': 'EWS v2, splunk', 'instance_status': 'active'}
PREPARED_ARGS_ALL_FILT... | 35.478873 | 106 | 0.748313 |
418ec5e9b5599bc9619b842c4130f18aeef015c2 | 79 | py | Python | Python/1. Introduction/7.Print_function.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Python/1. Introduction/7.Print_function.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Python/1. Introduction/7.Print_function.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | if __name__ == '__main__':
n = int(input())
print(*range (1, n+1), sep='')
| 19.75 | 30 | 0.544304 |
6bc5f1fb46e67e3d1fef1f517ee575b52ad2e931 | 220 | py | Python | languages/python/exercises/concept/basics/lasagna.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 200 | 2019-12-12T13:50:59.000Z | 2022-02-20T22:38:42.000Z | languages/python/exercises/concept/basics/lasagna.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 1,938 | 2019-12-12T08:07:10.000Z | 2021-01-29T12:56:13.000Z | languages/python/exercises/concept/basics/lasagna.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 239 | 2019-12-12T14:09:08.000Z | 2022-03-18T00:04:07.000Z | # TODO: define the 'EXPECTED_BAKE_TIME' constant
# TODO: define the 'bake_time_remaining()' function
# TODO: define the 'preparation_time_in_minutes()' function
# TODO: define the 'elapsed_time_in_minutes()' function
| 27.5 | 59 | 0.777273 |
6bfd532177a7551adb96a48ca81dae0ea4b93365 | 95,143 | py | Python | dnnme_backup-main/main.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | dnnme_backup-main/main.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | dnnme_backup-main/main.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | from pytransform import pyarmor_runtime
pyarmor_runtime()
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x08\x00\x55\x0d\x0d\x0a\x07\x2c\xa0\x01\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\x91\x5c\x00\x00\x00\x00\x00\x18\xbe\x99\x5e\xa8\xf6\x03\x2f\x62\xb1\x63\x53\xdb\xfb\x07\xf4\x8b\x... | 31,714.333333 | 95,083 | 0.75006 |
9997e501def860cfc0ff95e92b8751a0880bf7bf | 590 | py | Python | ais3-pre-exam-2022-writeup/Crypto/pettan/chall/server.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/pettan/chall/server.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/pettan/chall/server.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | from Crypto.Util.number import *
from random import getrandbits
import os
flag = bytes_to_long(os.environb[b"FLAG"])
N_BITS = 1024
PAD_SIZE = 64
p = getPrime(N_BITS // 2 + 1)
q = getPrime(N_BITS // 2 + 1)
n = p * q
e = 11
def generate_padding():
pad = getrandbits(PAD_SIZE)
s = 0
for _ in range(N_BITS //... | 16.857143 | 44 | 0.594915 |
851d7e77293c7c94383aa60e3a5c7dc556507e87 | 4,172 | py | Python | FileExport/FileOpener.py | Robsen01/Brain_Interface | 2525dc5e90bc5ac6b67f8f596fdf26a9ae6b391e | [
"Apache-2.0"
] | null | null | null | FileExport/FileOpener.py | Robsen01/Brain_Interface | 2525dc5e90bc5ac6b67f8f596fdf26a9ae6b391e | [
"Apache-2.0"
] | null | null | null | FileExport/FileOpener.py | Robsen01/Brain_Interface | 2525dc5e90bc5ac6b67f8f596fdf26a9ae6b391e | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append('../../Brain_Interface')
from FileExport.FileDialog import FileDialog
import math
'''
Expects the user to hook its on_new_data event to the event, where the new data appears.
This data is saved to temp-files.
'''
class FileOpener:
'''
int_byte_len is the length of bytes used t... | 33.918699 | 101 | 0.62464 |
85235e58c4b515c6fc6e07e732676dc77badc8c3 | 13,573 | py | Python | rnpflow_test/rmp_leaf.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | rnpflow_test/rmp_leaf.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | rnpflow_test/rmp_leaf.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | """rmp_mainとほぼ同じ"""
import numpy as np
import math
from math import pi, cos, sin, tan
import autograd.numpy as agnp
import autograd
import rmp_tree
def soft_normal(v, alpha):
"""ソフト正規化関数"""
v_norm = np.linalg.norm(v)
softmax = v_norm + 1 / alpha * np.log(1 + np.exp(-2 * alpha * v_norm))
return v / s... | 28.395397 | 94 | 0.504236 |
51c179c07dd026174f500764ebbe5fbfb9f424b7 | 628 | py | Python | PYTHON/Strings/alphabet_rangoli.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/alphabet_rangoli.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/alphabet_rangoli.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from string import ascii_lowercase
def print_rangoli(size):
width = size * 4 - 3
alphabet = (ascii_lowercase[0:size])[::-1]
res = []
for i in range(size):
s = ''
for a in alphabet[0:i+1]:
s = '%s-%s' % (s, a)
temp = s + s[::-1][1:]
... | 22.428571 | 53 | 0.503185 |
7a9fb6a21192582ccbf9e7f57e2c1f9a11a73cbb | 4,079 | py | Python | classification_snips/classifier/database_context.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification_snips/classifier/database_context.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification_snips/classifier/database_context.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | from cloudant.document import Document
from cloudant.database import CloudantDatabase
import sys
class DatabaseContext:
trainings_data = dict()
entity_key = 'entity_'
intent_key = 'intent_'
def __init__(self, client):
self.client = client
self.trainer_db = client["trainer"]
def ... | 28.725352 | 94 | 0.584947 |
8fc91d87d11b3889483e70eb9fce285b1630964d | 11,609 | py | Python | Tests/Data/Mechanics/MohrCoulombAbboSloanAnisotropic/run_script.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 111 | 2015-03-20T22:54:17.000Z | 2022-03-30T04:37:21.000Z | Tests/Data/Mechanics/MohrCoulombAbboSloanAnisotropic/run_script.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 3,015 | 2015-01-05T21:55:16.000Z | 2021-02-15T01:09:17.000Z | Tests/Data/Mechanics/MohrCoulombAbboSloanAnisotropic/run_script.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 250 | 2015-02-10T15:43:57.000Z | 2022-03-30T04:37:20.000Z | #!/ usr / bin / env python
#coding : utf - 8
#
#
#Run skript for Mohr Coulomb with anisotropy via stress scaling or \
embedded weakness planes.
#Comments to:
#
#* Prof.Dr.Thomas Nagel
#Chair of... | 80.618056 | 1,667 | 0.318718 |
85abc292708b8833c3f65776ee21503a4955aa58 | 1,610 | py | Python | docs/moxing_api_doc/scripts/train_tf_mnist.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | docs/moxing_api_doc/scripts/train_tf_mnist.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | docs/moxing_api_doc/scripts/train_tf_mnist.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | import sys
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
tf.flags.DEFINE_string('data_url', '/tmp/tensorflow/mnist/input_data', 'Directory for storing input data')
tf.flags.DEFINE_string('train_url', '/tmp/tensorflow/mnist/output_log', 'Directory for output logs')
flags = tf.flags.... | 32.857143 | 110 | 0.697516 |
bb08fa76395c1c37ef96b295c4b230f7052dfccd | 6,137 | py | Python | test/test_npu/test_margin_ranking_loss.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_margin_ranking_loss.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_margin_ranking_loss.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... | 44.151079 | 77 | 0.587421 |
701d7def5b4203799cbdc21ccb9fbccd6bcfb1a7 | 971 | py | Python | bewerte/erstelle_messung.py | jupfi81/NotenManager | ee96a41088bb898c025aed7b3c904741cb71d004 | [
"MIT"
] | null | null | null | bewerte/erstelle_messung.py | jupfi81/NotenManager | ee96a41088bb898c025aed7b3c904741cb71d004 | [
"MIT"
] | null | null | null | bewerte/erstelle_messung.py | jupfi81/NotenManager | ee96a41088bb898c025aed7b3c904741cb71d004 | [
"MIT"
] | null | null | null | """ Erstellt eine Ordner für eine neue Messung und frägt hierzu alle wichtigen Teile ab """
import os
import sys
class Messung:
"""
Messung hilft beim erstellen der "messungrc"-Datei
"""
def __init__(self):
""" Erstellt alle wichtigen Variablen """
self.place = os.listdir("./")
d... | 26.972222 | 91 | 0.584964 |
564e2a9c8d0da4c0fd1930abfc111d71f4565971 | 441 | py | Python | 1_basics/4_grundformen.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/4_grundformen.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/4_grundformen.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Grundformen:
Kreis, Rechteck, Linie
"""
newPage(1000, 1000)
oval(100, 100, 200, 200)
rect(500, 500, 500, 500)
stroke(0) # Linienfarbe Schwarz
line((300, 300), (400, 700))
"""
- Füge noch mehr Grundformen hinzu.
- Ändere die Werte, indem du die cmd-Taste und drückst
und am Trackpad nach links/rechts ziehst.
... | 18.375 | 54 | 0.69161 |
565d08ab05b227d09258d341c20a11fbbf02cb61 | 471 | py | Python | hausse/utils/functions.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | hausse/utils/functions.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | hausse/utils/functions.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | import logging
import os
import shutil
def clean_dir(dir):
for filename in os.listdir(dir):
file_path = os.path.join(dir, filename)
try:
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
... | 29.4375 | 88 | 0.611465 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.