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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5e27bbc5f26fa49ea5270c471f12f80ffeeb7f61 | 1,213 | py | Python | ppyt/filters/__init__.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 4 | 2016-08-16T07:47:15.000Z | 2017-12-11T10:08:47.000Z | ppyt/filters/__init__.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | null | null | null | ppyt/filters/__init__.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 2 | 2018-06-15T04:43:15.000Z | 2020-05-02T07:47:15.000Z | # coding: utf-8
import logging
import abc
from ppyt.mixins import FinderMixin, ArgumentValidationMixin
logger = logging.getLogger(__name__)
class FilterBase(FinderMixin, ArgumentValidationMixin, metaclass=abc.ABCMeta):
"""フィルタ(銘柄絞り込み)の規定クラスです。"""
def __init__(self, *args, **kwds):
self._setup(*args,... | 19.564516 | 78 | 0.568838 |
eaacaf6b2f5441b4a080d2667504325eff8074b6 | 1,418 | py | Python | src/logging/setup.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/logging/setup.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/logging/setup.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PIP setup script for the SDP Logging package."""
import setuptools
import ska_sdp_logging
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name='ska-sdp-logging',
version=ska_sdp_logging.__version__,
description='SKA st... | 29.541667 | 70 | 0.624824 |
dcae171beeca5eb934298983e9c7a0332454a93a | 802 | py | Python | Dynamic Programming/CoinChangeMinCount.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Dynamic Programming/CoinChangeMinCount.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Dynamic Programming/CoinChangeMinCount.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | """
https://leetcode.com/problems/coin-change/
"""
from sys import maxsize
class Solution:
def coinChangeMin(self, coins, amount, tbl):
if amount == 0:
return 0
if amount in tbl:
return tbl[amount]
minCount = maxsize
for i in range(len(coins)):
... | 25.870968 | 87 | 0.578554 |
df8b001c2242f4e848ca4d5a2d222f4619f840fd | 1,267 | py | Python | multimeter/deploy.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/deploy.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/deploy.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | '''
Created on 24.02.2017
@author: steinorb
'''
import paramiko
import traceback
import socket
import sys
paramiko.util.log_to_file('log/deploy.log')
UseGSSAPI = True # enable GSS-API / SSPI authentication
DoGSSAPIKeyExchange = True
Port = 22
username = 'pi'
hostname = 'raspberry'
pass... | 24.843137 | 82 | 0.640884 |
63c1d4c16e02f5101db92e658957cd6bb8464a36 | 4,477 | py | Python | src/onegov/agency/forms/mutation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/forms/mutation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/forms/mutation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.agency import _
from onegov.core.utils import ensure_scheme
from onegov.form import Form
from onegov.form.fields import HoneyPotField
from onegov.form.fields import MultiCheckboxField
from wtforms import StringField
from wtforms import TextAreaField
from wtforms import validators
from wtforms.fields.html5 i... | 25.151685 | 76 | 0.594595 |
895722a3e032a0d8313f9809e50dda7949e2918f | 21,122 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_coordinate.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_coordinate.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_coordinate.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QDockWidget, QWidget, QComboBox, QVBoxLayout, QTableWidget, QTableWidgetItem, QLabel, \
QHeaderView, QHBoxLayout, QToolButton, QAbstractItemView
from PyQt5.QtCore import Qt, QPersistentModelIndex, pyqtSignal, QSize, QEvent, QTimer
from PyQt5.QtG... | 41.093385 | 120 | 0.575608 |
7fb03d330734ba0696eb47f6185730a01cc8346b | 104,530 | py | Python | DarkFAST-main/saya_gans/__init__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | DarkFAST-main/saya_gans/__init__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | DarkFAST-main/saya_gans/__init__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z |
# Obfuscated By Arya77
#################
# Time : Tue Jun 22 15:58:44 2021
# Platform : Linux aarch64
#################
import codecs,base64
htr = [73, 121, 77, 106, 73, 121, 77, 106, 73, 119, 111, 106, 83, 109, 70, 117, 90, 50, 70, 117, 73, 69, 82, 112, 82, 87, 82, 112, 100, 67, 52, 117, 73, 69, 86, 107, 97, 8... | 6,968.666667 | 84,612 | 0.625706 |
1238cca540ec3ec8fc619043850a16b7f288b66f | 17,005 | py | Python | sentiment_app.py | pythonista4life/dash_app | 254304ee49c5fe7608a44cea918efff0babfb9aa | [
"MIT"
] | null | null | null | sentiment_app.py | pythonista4life/dash_app | 254304ee49c5fe7608a44cea918efff0babfb9aa | [
"MIT"
] | null | null | null | sentiment_app.py | pythonista4life/dash_app | 254304ee49c5fe7608a44cea918efff0babfb9aa | [
"MIT"
] | null | null | null | import dash
import sqlite3
from dash import dcc
from dash import html
import pandas as pd
import pandas_datareader.data as web
from dash import dash_table
import plotly.graph_objects as go
from datetime import datetime as dt
from dash.dependencies import Input, Output
external_stylesheets = ['https://codepen.io/chridd... | 44.399478 | 118 | 0.473037 |
7f14da70acc9ce388155c59217355d2ebbba17b1 | 561 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/50. return rows in pascal's triangle.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/50. return rows in pascal's triangle.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/50. return rows in pascal's triangle.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that chooses a random number 'n' between 2 and 8 (inclusive)
and returns the first n lines of the Pascal’s triangle in the form of a list.
Example:
n = 7
Expected output:
output_list = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1], [1, 5, 10, 10, 5, 1], [1, 6, 15, 20, 15,... | 23.375 | 123 | 0.559715 |
9ce610a09051ff92b3bb972a6861e1ca06efaeda | 2,893 | py | Python | tests/onegov/agency/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from click.testing import CliRunner
from onegov.agency.cli import cli
from onegov.org.cli import cli as org_cli
from onegov.org.models import Organisation
from pathlib import Path
@pytest.mark.skip('Provide the files if you want to test this import again')
def test_bs_data_import(cfg_path, session_manag... | 26.3 | 78 | 0.618735 |
1461793943ae7a006cd7f70320494855fb47d5aa | 647 | py | Python | leetcode/043-Multiply-Strings/MultiplyStrings_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/043-Multiply-Strings/MultiplyStrings_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/043-Multiply-Strings/MultiplyStrings_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def multiply(self, num1, num2):
"""
:type num1: str
:type num2: str
:rtype: str
"""
if num1 == '0' or num2 == '0':
return '0'
res = [0] * (len(num1) + len(num2))
for j in xrange(len(num2)):
for i in xrang... | 26.958333 | 59 | 0.408037 |
210d5bec38794316d007e6d1ed9f567a1bdc24ea | 2,286 | py | Python | research/cv/CGAN/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/CGAN/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/CGAN/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... | 35.169231 | 98 | 0.685477 |
25909d680b89ce389c47bc073937de5c2cf40d86 | 1,282 | py | Python | python/unittest/mock/realpython/managing_side_effects.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/realpython/managing_side_effects.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/realpython/managing_side_effects.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import Mock
from requests.exceptions import Timeout
# Mock requests to control its behavior
requests = Mock()
def get_holidays():
r = requests.get("http://localhost/api/holidays")
if r.status_code == 200:
return r.json()
return None
class TestCalendar(unittes... | 28.488889 | 59 | 0.641186 |
d3003d89d16a8b8b801f97bbce3f977216ff38f9 | 1,276 | py | Python | books/PythonAutomate/file_organize/find_big_files.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/file_organize/find_big_files.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/file_organize/find_big_files.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """find_big_files.py
용량이 지정한 용량 이상인 파일을 찾아 경로 출력
"""
import os
import enum
class SIZE_UNIT(enum.Enum):
BYTE = 1
KB = 2
MB = 3
GB = 4
def get_keyword(unit: SIZE_UNIT):
if unit == SIZE_UNIT.BYTE:
return 'bytes'
elif unit == SIZE_UNIT.KB:
return 'KB'
elif ... | 24.538462 | 87 | 0.595611 |
6cc7a5ed13a47bae367fa98c30a4dce5df559ba4 | 1,283 | py | Python | SpamMail-master/src/mediatek.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 11 | 2019-01-20T17:11:11.000Z | 2021-12-17T05:00:15.000Z | SpamMail-master/src/mediatek.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | SpamMail-master/src/mediatek.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 10 | 2019-05-12T02:28:06.000Z | 2022-03-06T14:21:43.000Z | try:
import mechanize,os,sys,time,json
except ModuleNotFoundError as mdl:
exit('Module Err: %s'%(mdl))
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.addheaders = [("User-Agent","Mozilla/5.0 (Linux; U; Android 7.1)")]
class Mediatek:
def __... | 24.207547 | 71 | 0.601715 |
646d44141fac00336727f45672e278373a328529 | 768 | py | Python | programm/video_speech_handler.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/video_speech_handler.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/video_speech_handler.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | """
Main Python-Script for human interaction and object detection
@author: wimmer, simon-justus
"""
from video_detection import FaceQrSearch
import database.database_handler as db_ha
import log
import sys
import time
import general
logger_builder = log.logger_builder(log_name='RootLogger')
logger1 = logger_builder.get... | 24.774194 | 104 | 0.738281 |
64764f287b0929925c9212daac711363ca833c30 | 534 | py | Python | verto/errors/ArgumentMissingError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/errors/ArgumentMissingError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/errors/ArgumentMissingError.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from verto.errors.Error import Error
class ArgumentMissingError(Error):
'''Exception raised when a required or dependent argument is not found.
Attributes:
tag: tag which was not matched
block: block where tag was not matched
argument: the argument that was not found
message: ... | 28.105263 | 75 | 0.664794 |
374a8e3776511da3b4f46b7c76eef433f4a4be42 | 2,553 | py | Python | extractorcromatogramas/extractorcrom.py | rvalenciaaz/lmmba | d5959ea4b84cf0d8f5c0f0cae376f6b6c069cdb1 | [
"MIT"
] | null | null | null | extractorcromatogramas/extractorcrom.py | rvalenciaaz/lmmba | d5959ea4b84cf0d8f5c0f0cae376f6b6c069cdb1 | [
"MIT"
] | null | null | null | extractorcromatogramas/extractorcrom.py | rvalenciaaz/lmmba | d5959ea4b84cf0d8f5c0f0cae376f6b6c069cdb1 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
from PyPDF2 import PdfFileWriter, PdfFileReader
from os import listdir
from os.path import isfile, join
#from joblib import Parallel, delayed
import multiprocessing
import subprocess
import argparse
import tabula
import pandas as pd
from functools import reduce
from tqdm import tqdm
num_cores=... | 30.759036 | 177 | 0.707795 |
2fc232ce28aa4d32f8ceba277f338f18e56dee82 | 2,588 | py | Python | FrontEnd/app.py | nisargap/SRR-webapp | b0352b8a901eddc7c9885be50da9e051d4e5f270 | [
"Apache-2.0"
] | 1 | 2016-05-01T19:19:28.000Z | 2016-05-01T19:19:28.000Z | FrontEnd/app.py | nisargap/SRR-webapp | b0352b8a901eddc7c9885be50da9e051d4e5f270 | [
"Apache-2.0"
] | null | null | null | FrontEnd/app.py | nisargap/SRR-webapp | b0352b8a901eddc7c9885be50da9e051d4e5f270 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template,jsonify, request
from pymongo import MongoClient
from subprocess import Popen, call
import time
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route("/")
def index():
# System call here to wifite
# and then kill process
return render_template("inde... | 27.531915 | 87 | 0.673879 |
2fff206a27226852dcddc344e5dd67baf19839c5 | 759 | py | Python | leetcode/277-Find-the-Celebrity/FindtheCelebrity_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/277-Find-the-Celebrity/FindtheCelebrity_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/277-Find-the-Celebrity/FindtheCelebrity_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # The knows API is already defined for you.
# @param a, person a
# @param b, person b
# @return a boolean, whether a knows b
# def knows(a, b):
class Solution(object):
def findCelebrity(self, n):
"""
:type n: int
:rtype: int
"""
if n < 2:
return -1
candi... | 24.483871 | 67 | 0.428195 |
2bc754a189affbd3d7759647fc6f04b069dfc176 | 648 | py | Python | exercise8.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | 1 | 2020-11-21T16:57:40.000Z | 2020-11-21T16:57:40.000Z | exercise8.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null | exercise8.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null |
data_file = open("example.txt", "r")
def clean_word(word):
"""Return word in lowercase stripped of whitespace"""
return word.strip().lower()
def get_vowels_in_word(word):
"""Return vowels in string word--include repeats."""
vowel_str = "aeiou"
vowels_in_word = ""
for char in word:
if... | 24 | 61 | 0.643519 |
9218da22176cda380206425b0cf3e6c05d86c8ef | 4,172 | py | Python | extractTool/extractTool/getNetCDFInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | null | null | null | extractTool/extractTool/getNetCDFInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 47 | 2018-11-13T13:55:01.000Z | 2019-09-16T13:38:11.000Z | extractTool/extractTool/getNetCDFInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 4 | 2018-11-27T12:36:51.000Z | 2020-10-14T18:07:04.000Z | import click, json, sqlite3, csv, pygeoj, extractTool
from osgeo import gdal, ogr, osr
import pandas as pd
import numpy as np
import xarray as xr
import os
import dateparser
def getNetCDFbbx(filepath, detail, folder, time):
"""returns the bounding Box NetCDF
@param path Path to the file """
print("drin")
... | 35.058824 | 89 | 0.519415 |
753540eb42c09ae6fb8196d4c77e617cb80fa7f6 | 6,004 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from frappe.utils import flt, nowdate
from frappe.model.document import Document
class Openi... | 31.434555 | 107 | 0.713191 |
9401e2a95b6b43ea90d27acdf1b4133e3fdf72f7 | 2,785 | py | Python | code/gestures/gestures.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/gestures/gestures.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/gestures/gestures.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | import os
import time # import the time library for the sleep function
from threading import Thread, Condition, Lock
from config import config
from gestures.screen import Screen
from gestures.sound import Sound
class Gesture(Thread):
PICTURES = {
"default": "default_new.gif",
"wait": [0, 1],
... | 29.315789 | 77 | 0.600359 |
9415b1fffc411fcb9e96db90af2ccb5c1132afbd | 374 | py | Python | 0001TwoSum.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0001TwoSum.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0001TwoSum.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!env python3
class Solution:
def twoSum(self, nums, target):
m = dict()
for i,n in enumerate(nums):
ret = target - n
if ret in m:
return [i, m[ret]]
m[n] = i
if __name__ == "__main__":
s = Solution()
nums = [2, 7, 11, 15]
target = 9
... | 20.777778 | 35 | 0.483957 |
ca59ab6ca81019641f6f9c8cfbc3c3ea8f3e159d | 1,524 | py | Python | leetcode/0133-Clone-Graph/clone_graph.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/0133-Clone-Graph/clone_graph.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/0133-Clone-Graph/clone_graph.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | """
# Definition for a Node.
class Node:
def __init__(self, val = 0, neighbors = None):
self.val = val
self.neighbors = neighbors if neighbors is not None else []
"""
"""
Solution 1: iter, bfs, queue, node first edge later
"""
class Solution1:
def cloneGraph(self, node: 'Node') -> 'Node':
... | 23.8125 | 94 | 0.574147 |
ca7e6271f70b335f8ab82dbc51e092cd27c0f1bc | 6,802 | py | Python | Packs/CheckPhish/Integrations/CheckPhish/CheckPhish.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CheckPhish/Integrations/CheckPhish/CheckPhish.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CheckPhish/Integrations/CheckPhish/CheckPhish.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import json
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
HEADERS = {
'Content-Type': 'application/json',
'Accept': 'applica... | 26.061303 | 117 | 0.604822 |
8e29586a1499c3a9d9a8f8d38211e06172967bd0 | 625 | py | Python | autojail/utils/string.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/utils/string.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/utils/string.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | def remove_prefix(text: str, prefix: str) -> str:
"""Remove prefix from text if prefix exists"""
return text[text.startswith(prefix) and len(prefix) :]
def pprint_tree(node, file=None, _prefix="", _last=True):
"""pretty print a tree like datastructure"""
# FIXME: make output method configurable
pr... | 36.764706 | 73 | 0.6272 |
edf3428dea1dc219ea323f499f364b25e11680f0 | 381 | py | Python | Test Code.py | abbashan03/Kinduino | 292be35053763ee593b5721bf7ce450ec4dc1603 | [
"MIT"
] | null | null | null | Test Code.py | abbashan03/Kinduino | 292be35053763ee593b5721bf7ce450ec4dc1603 | [
"MIT"
] | null | null | null | Test Code.py | abbashan03/Kinduino | 292be35053763ee593b5721bf7ce450ec4dc1603 | [
"MIT"
] | null | null | null | abc = { "1":"a",
"2":"b",
"3":"c"}
deutsch = {'key':['Schlüssel', 'Taste'],
'slice':['Scheibe', 'Stück'],
'value':['Wert']}
f = open("Testabc.txt", "r")
daten = f.read()
text = input("Drücken sie Enter ")
abctext = [print(daten)]
for buchstabe in text:
if buchsta... | 22.411765 | 41 | 0.496063 |
b6a57d34164caa4a273275852d6089a8f0605be9 | 3,066 | py | Python | src/onegov/election_day/views/election/connections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/election/connections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/election/connections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Election
from onegov.core.security import Public
from onegov.election_day import ElectionDayApp
from onegov.election_day.hidden_by_principal import \
hide_connections_chart
from onegov.election_day.layouts import DefaultLayout
from onegov.election_day.layouts import ElectionLayout
from one... | 27.132743 | 78 | 0.715917 |
1ead978b753dfcda78bef9e810bd86ccd2588d91 | 174 | py | Python | Prototype/logpy proto/log.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/logpy proto/log.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/logpy proto/log.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | from logpy import *
from logpy.arith import add,gt,sub,mul,div
x=var()
y=var()
z=var()
expr2=(add,x,y)
expr3=(add,z,3)
asdf=run(1,z,eq(x,3),eq(y,6),eq(z,expr2))
print(asdf) | 15.818182 | 42 | 0.66092 |
44a501ec0c9c8479d862c8c9a3c9ad6e778ea199 | 1,218 | py | Python | nz_crawl_demo/day3/demo5.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day3/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/day3/demo5.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | #encoding: utf-8
import requests
from lxml import etree
# 1. 将目标网站上的页面抓取下来
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
'Referer': 'https://movie.douban.com/'
}
url = 'https://movie.douban.com/cinema/nowplaying/... | 25.914894 | 135 | 0.641215 |
78d15f6c114a59cbb3548a048a20f6be38104c18 | 1,335 | py | Python | 数据结构/NowCode/17_LastRemaining.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/17_LastRemaining.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/17_LastRemaining.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | # 孩子们的游戏(圆圈中最后剩下的数)
# 每年六一儿童节,牛客都会准备一些小礼物去看望孤儿院的小朋友,今年亦是如此。HF作为牛客的资深元老,
# 自然也准备了一些小游戏。其中,有个游戏是这样的:首先,让小朋友们围成一个大圈。然后,他随机指定一个数m,
# 让编号为0的小朋友开始报数。每次喊到m-1的那个小朋友要出列唱首歌,然后可以在礼品箱中任意的挑选礼物,
# 并且不再回到圈中,从他的下一个小朋友开始,继续0...m-1报数....这样下去....直到剩下最后一个小朋友,
# 可以不用表演,并且拿到牛客名贵的“名侦探柯南”典藏版(名额有限哦!!^_^)。请你试着想下,哪个小朋友会得到这份礼品呢?
# (注:小朋友的编号是从0到n... | 26.7 | 62 | 0.548315 |
1549e10422576c49dc5431141649c41a7d658cc8 | 686 | py | Python | src/onegov/election_day/collections/upload_tokens.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/collections/upload_tokens.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/collections/upload_tokens.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.models import UploadToken
class UploadTokenCollection(object):
def __init__(self, session):
self.session = session
def query(self):
return self.session.query(UploadToken).order_by(UploadToken.created)
def create(self):
""" Creates a new token. """
... | 22.866667 | 76 | 0.61516 |
1567a8bc81286172983347092f627c5cf7988cbc | 3,629 | py | Python | python_experiments/paper_figures/vldbj/draw_index_update_time.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/paper_figures/vldbj/draw_index_update_time.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/paper_figures/vldbj/draw_index_update_time.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import matplotlib.pyplot as plt
import numpy as np
from data_analysis.vldbj_data_parsing.generate_index_markdown import *
def get_name_dict():
with open('data_names.json') as ifs:
return eval(''.join(ifs.readlines()))
# data set abbreviation dictionary
data_names = get_name_dict()
# figure parameters
... | 34.561905 | 109 | 0.628823 |
ec678bca8e2c88a1809dbfab32385dcfecb9dcb4 | 899 | py | Python | 01.DataStructure/Stack&Queue/NY/B1966_NY.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 01.DataStructure/Stack&Queue/NY/B1966_NY.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 01.DataStructure/Stack&Queue/NY/B1966_NY.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | #백준 - 1966
import sys
repeat = int(input())
for r in range (repeat) :
num, wonder = map(int, sys.stdin.readline().split())
tmpList = list(map(int, sys.stdin.readline().split()))
docs = []
priority = []
printNum = 0
big = 0
for n in range(len(tmpList)) :
docs.append([tmpList[n], n]... | 24.972222 | 58 | 0.480534 |
ec6bdddc376a0909f07d778693e63219002f86e9 | 8,412 | py | Python | Proxverter-main/proxverter/certgen.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Proxverter-main/proxverter/certgen.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Proxverter-main/proxverter/certgen.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 OpenSSL import crypto, SSL
import OpenSSL
import random
import re
import os
import shutil
import platform
import subprocess
class Generator:
def __init__(self, email=None, country=None, province=None, locality=None, organization=None, unit=None, commonname=None):
self.email = email
self.cou... | 38.587156 | 176 | 0.596291 |
ece058ebda948d85cff79a90cb3167f1fd861c29 | 20 | py | Python | api/wsgi/src/devices/bpm/migrations/__init__.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 2 | 2020-06-08T19:17:10.000Z | 2020-06-08T20:45:07.000Z | api/wsgi/src/devices/bpm/migrations/__init__.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 14 | 2015-10-07T09:31:50.000Z | 2022-02-23T07:34:10.000Z | api/wsgi/src/devices/bpm/migrations/__init__.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | null | null | null | __author__ = 'easy'
| 10 | 19 | 0.7 |
bf3b083b1d000bd4b64b7e23ff60782a3b0a0528 | 1,784 | py | Python | oldp/utils/__init__.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/utils/__init__.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/utils/__init__.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import logging.config
import os
import re
from django.conf import settings
logger = logging.getLogger(__name__)
@DeprecationWarning
class Logger(object):
logger = logging.getLogger()
def __init__(self):
super(Logger, self).__init__()
# Logging settings
# TODO Update path
# ... | 25.126761 | 91 | 0.641816 |
175950554876a4083bf9f0c1acd084a7e867085e | 3,458 | py | Python | practices/practice_4/task1.2.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_4/task1.2.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_4/task1.2.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | from libs.can import CANSocket
from libs.myactuator import MyActuator
from time import perf_counter
from math import pi
import numpy as np
# the serial port of device
# you may find one by examing /dev/ folder,
# this is usually devices ttyACM
serial_device = "ttyACM0"
# Initiate the can bus socket
can_bus = CANSocke... | 27.664 | 99 | 0.559861 |
da429c640ec0357c4e477c8ca1c4f9f96b1acf73 | 5,325 | py | Python | test/test_npu/test_network_ops/test_hamming_window.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_hamming_window.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_hamming_window.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# 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 ap... | 40.037594 | 97 | 0.631362 |
e5ac909e23ed38b2c86599b9270d092529fa3e40 | 4,035 | py | Python | examples/chk-dec.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | examples/chk-dec.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | examples/chk-dec.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Joseph deBlaquiere <jadeblaquiere@yahoo.com>
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 37.71028 | 100 | 0.744238 |
f91130f0b43910def4293581e3fd355ae7154173 | 4,633 | py | Python | Paddle_Industry_Practice_Sample_Library/nlp_projects/nlu/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-12T06:52:43.000Z | 2022-01-12T06:52:43.000Z | Paddle_Industry_Practice_Sample_Library/nlp_projects/nlu/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/nlp_projects/nlu/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 45.421569 | 192 | 0.747248 |
f914bef65ffc19e9d6a16f1e1b418ba9b979f605 | 157 | py | Python | year_3/comppi_0/publication/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_0/publication/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_0/publication/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | class ScheduledEvent(object):
def __init__(self, time, cb, arg):
self.timeexecute = time
self.callback = cb
self.arguments = arg
| 26.166667 | 38 | 0.624204 |
0064a8fd92f2d5c8127062ccc55fd51183d7212a | 289 | py | Python | listings/chapter04/points.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter04/points.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter04/points.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
plt.xlabel('x')
plt.ylabel('y')
plt.scatter([3, -3, -3, 3], [3, 3, -3, -3])
plt.annotate('A', (3, 3))
plt.annotate('B', (-3, 3))
plt.annotate('C', (-3, -3))
plt.annotate('D', (3, -3))
plt.grid()
plt.axhline(linewidth=2)
plt.axvline(linewidth=2)
plt.show()
| 20.642857 | 43 | 0.605536 |
006b5948a9cece3189b12ba719749907dc334cf5 | 2,918 | py | Python | listings/chapter05/game-of-life-genetic.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter05/game-of-life-genetic.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter05/game-of-life-genetic.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | from random import random, randint
from genetic import Chromosome, Genetic
from game_of_life import Grid
# Chromosom (mögliche Anfangspopulation) für Game of Life
class GoLChromosome(Chromosome):
def __init__(self, start):
self.start = start
self.score = -1
self.string = None
# Zufäll... | 32.065934 | 62 | 0.524332 |
00c958f87c280c96285bd3060708fa702d79fc79 | 171 | py | Python | v602/python/kennlinie.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v602/python/kennlinie.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v602/python/kennlinie.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
from uncertainties import ufloat
from scipy import optimize
import scipy.constants as const
from scipy.stats import sem
| 24.428571 | 32 | 0.842105 |
c11209d03505c2f2f1d734442c074268b04d60c2 | 1,058 | py | Python | data_inst.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | data_inst.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | data_inst.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*-coding:Latin-1 -*
import re
import sys
import subprocess
NOM_URL = "VIDE"
URL = "VIDE"
CODE = "VIDE"
def Arguments():
global NOM_URL
print "Arguments: ", sys.argv
print "NB d'arguments: ", len(sys.argv)
for i in range (0,len(sys.argv)):
print sys.argv[i]
... | 15.333333 | 72 | 0.597353 |
c19429fa9cb53449b4aab4c304732a02c721e77a | 1,008 | bzl | Python | kythe/cxx/extractor/textproto/testdata/textproto_extractor_test.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 1,168 | 2015-01-27T10:19:25.000Z | 2018-10-30T15:07:11.000Z | kythe/cxx/extractor/textproto/testdata/textproto_extractor_test.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 2,811 | 2015-01-29T16:19:04.000Z | 2018-11-01T19:48:06.000Z | kythe/cxx/extractor/textproto/testdata/textproto_extractor_test.bzl | wcalandro/kythe | 64969a853711c228b4e3cfc3ce91b84b5bb853d7 | [
"Apache-2.0"
] | 165 | 2015-01-27T19:06:27.000Z | 2018-10-30T17:31:10.000Z | """Rules for testing the textproto extractor"""
# Copyright 2019 The Kythe 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/... | 38.769231 | 94 | 0.752976 |
ec39a08b79461e439f47a53e4d75f7280cf6b785 | 131 | py | Python | src/nfz_module/model/PinMode.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/model/PinMode.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/model/PinMode.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | from enum import Enum
__author__ = 'Hans-Werner Roitzsch'
class PinMode(Enum):
INPUT = 0
OUTPUT = 1
ALTERNATIVE_FUNCTION = 2
| 13.1 | 35 | 0.732824 |
6b4ee4ce63f0047cf17426a31345c97b910dd74d | 729 | py | Python | Packs/DeprecatedContent/Scripts/DBotPredictPhishingLabel/DBotPredictPhishingLabel.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeprecatedContent/Scripts/DBotPredictPhishingLabel/DBotPredictPhishingLabel.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeprecatedContent/Scripts/DBotPredictPhishingLabel/DBotPredictPhishingLabel.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
args = dict(demisto.args())
args['inputText'] = args.get('emailSubject', '') + ' ' + args.get('emailBody', '')
res = demisto.executeCommand('DBotPredictTextLabel', args)
res = res[-1]
if is_error(res):
return_error(... | 36.45 | 82 | 0.750343 |
2e902e75e412d27fd08a59166c1be9309e08d534 | 1,354 | py | Python | pyntcloud/filters/xyz.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/filters/xyz.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/filters/xyz.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import numpy as np
from .base import Filter
class XYZFilter(Filter):
def extract_info(self):
self.points = self.pyntcloud.xyz
class BoundingBoxFilter(XYZFilter):
"""
Compute a bounding box filter for the given points.
Parameters
----------
min_x, max_x, min_y, max_y, min_z, max_z: ... | 31.488372 | 80 | 0.591581 |
5cf76c842c84c65b004c1f1767213d1440ba7fb8 | 47 | py | Python | ___Python/Michael/p08_generatoren_iteratoren/m01_iterator.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p08_generatoren_iteratoren/m01_iterator.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p08_generatoren_iteratoren/m01_iterator.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | l = [2, 3, 5, 7, 11]
for x in l:
print(x) | 15.666667 | 21 | 0.425532 |
cf0fd31cf0e92cc5f7e49c41723ab7ffae33c751 | 1,136 | py | Python | INBa/2015/Ermashov_A_V/task_9_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_9_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_9_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать.
#Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове,
#причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробовать отгадать слово.
# Ерма... | 43.692308 | 137 | 0.745599 |
d896de2045176a9068228af09bde6d9d13e50c68 | 1,714 | py | Python | cs/lambda_cs/06_graphs/projects/words/words.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/06_graphs/projects/words/words.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/06_graphs/projects/words/words.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Graphs :: Day 3
Given two words (begin_word and end_word), and a dictionary's word list,
return the shortest transformation sequence from begin_word to end_word,
such that:
* Only one letter can be changed at a time.
* Each transformed word must exist in the word list.
* Note that begin_word is not a transforme... | 23.162162 | 76 | 0.651692 |
510de57d15b49da6649d31aacd7624635418e044 | 20,997 | py | Python | ui/Ui_MainWindow2.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | ui/Ui_MainWindow2.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | ui/Ui_MainWindow2.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Ui_MainWindow2.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###########... | 49.755924 | 162 | 0.733438 |
51f82cd217bc91afb4823ae5a328f2e97943c6db | 436 | py | Python | SoSe-21/Uebung-4/A3-Pascalsches-Dreieck.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-4/A3-Pascalsches-Dreieck.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-4/A3-Pascalsches-Dreieck.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
# Definieren einer Zähl-Variable mit dem Wert 9
zaehl_variable = 9
for zeilen in range(1, zaehl_variable+1):
# Einfügen der Leerzeichen
for leerzeichen in range(zaehl_variable-zeilen+1):
print(" ", end =" ")
# Hochzählen der Werte
for werte in range(1, zeilen+1):
print(werte, end= " "... | 25.647059 | 54 | 0.626147 |
a407d1a07cbf7c211da7c1952391f9bd21ac0ab9 | 394 | py | Python | verto/errors/InteractiveTextContainsInteractiveError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/errors/InteractiveTextContainsInteractiveError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/errors/InteractiveTextContainsInteractiveError.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from verto.errors.Error import Error
class InteractiveTextContainsInteractiveError(Error):
'''Exception raised when a text includes an interactive block.
Attributes:
tag: tag which was not matched
'''
def __init__(self, tag):
self.tag = tag
self.message = 'Interactive text ca... | 26.266667 | 77 | 0.692893 |
5c6f12caf8622308b93b950bf76a11ae5c174720 | 1,027 | py | Python | sonderzeichen.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 3 | 2019-05-04T21:34:33.000Z | 2022-01-25T10:00:25.000Z | sonderzeichen.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 4 | 2019-04-11T05:03:55.000Z | 2020-07-09T06:52:58.000Z | sonderzeichen.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 1 | 2020-02-13T19:04:31.000Z | 2020-02-13T19:04:31.000Z | class Sonderzeichen:
def __init__(self, lcd):
self.lcd = lcd
def char_rechteck_rand(self):
rechteck_rand = (
0b11111,
0b10001,
0b10001,
0b10001,
0b10001,
0b10001,
0b10001,
0b11111
)
s... | 22.326087 | 53 | 0.471276 |
8fa9a8da7cb17293c40cb8a342f5acd35ea9d945 | 1,374 | py | Python | renko.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | renko.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | renko.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | # =============================================================================
# Import OHLCV data and transform it to Renko
# Author : Mayank Rasu
# Please report bug/issues in the Q&A section
# =============================================================================
# Import necesary libraries
import ... | 36.157895 | 103 | 0.55313 |
64e94215522a0c8f60bbe26563ad48f40a718579 | 68,207 | py | Python | Vorlesungsbeispiele/UA_TrafficLight/tools/pyUANamespace/ua_node_types.py | zmanjiyani/PLT_MRT_ARM-RPi2 | da77ab8ddf652a12ae6a6647c993daa2f94b39fb | [
"MIT"
] | 4 | 2015-11-11T14:02:17.000Z | 2021-11-29T16:07:38.000Z | Vorlesungsbeispiele/UA_TrafficLight/tools/pyUANamespace/ua_node_types.py | zmanjiyani/PLT_MRT_ARM-RPi2 | da77ab8ddf652a12ae6a6647c993daa2f94b39fb | [
"MIT"
] | 6 | 2019-04-20T14:48:58.000Z | 2020-08-26T15:13:02.000Z | Vorlesungsbeispiele/UA_TrafficLight/tools/pyUANamespace/ua_node_types.py | zmanjiyani/PLT_MRT_ARM-RPi2 | da77ab8ddf652a12ae6a6647c993daa2f94b39fb | [
"MIT"
] | 9 | 2016-01-10T15:14:28.000Z | 2021-10-13T22:45:19.000Z | #!/usr/bin/env/python
# -*- coding: utf-8 -*-
###
### Author: Chris Iatrou (ichrispa@core-vector.net)
### Version: rev 13
###
### This program was created for educational purposes and has been
### contributed to the open62541 project by the author. All licensing
### terms for this source is inherited by the terms and... | 38.556812 | 172 | 0.649567 |
56d7a0ff1071de3fe35a3163809c62b75235dd92 | 246 | py | Python | Problems/Dynamic Programming/Medium/PanlindromicSubstrings/test_panlindromic_substrings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Medium/PanlindromicSubstrings/test_panlindromic_substrings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/PanlindromicSubstrings/test_panlindromic_substrings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from panlindromic_substrings import countSubstrings
class Test(TestCase):
def test_count_substrings(self):
self.assertEqual(countSubstrings("abc"), 3)
self.assertEqual(countSubstrings("aaa"), 6)
| 30.75 | 51 | 0.760163 |
71143f4e14222dfda97682f31e60e217a3c37869 | 10,118 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/user_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/user_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/user_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Callable, List, Optional
from fastapi import APIRouter, Body, Depends
from watchmen_auth import PrincipalService
from watchmen_meta.admin import UserGroupService, UserService
from watchmen_meta.common import ask_meta_storage, ask_snowflake_generator
from watchmen_model.admin import User, UserGroup,... | 33.95302 | 112 | 0.781281 |
a43922b6174037289f5c1f7c6d501164ba217fce | 1,264 | py | Python | TestCodeArchive/PythonCode/SocketTest/ui.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | TestCodeArchive/PythonCode/SocketTest/ui.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | TestCodeArchive/PythonCode/SocketTest/ui.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | from tkinter import *
import socket
import sys
HOST = '192.168.178.' + str(sys.argv[1]) # The server's hostname or IP address
PORT = 80 # The port used by the server
print('Connecting to ' + HOST + ':' + str(PORT))
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((HOST, PORT))
print('Con... | 27.478261 | 103 | 0.717563 |
f10766c139d5faaec4396e7c9b1c756b88683bd8 | 462 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/73. remove empty items from a Dictionary.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/73. remove empty items from a Dictionary.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/73. remove empty items from a Dictionary.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function to remove empty items from the below dictionary.
input_dict = {'Box1':'Apple', 'Box2':'Mango', 'Box3': ' ', 'Box4': ' ', 'Box5':'Orange'}
Expected output : {'Box1': 'Apple', 'Box2': 'Mango', 'Box5': 'Orange'}
"""
#Solution is:
def remove_empty(input_dict):
output_dict = {}
... | 23.1 | 90 | 0.560606 |
7424de031480e2acfe20ade4c36c0052783f961c | 4,497 | py | Python | scriptsForPreprocessing/data_augumentation.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | scriptsForPreprocessing/data_augumentation.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | scriptsForPreprocessing/data_augumentation.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import imgaug as ia
import os, json
from shutil import copyfile
import cv2
import imgaug.augmenters as iaa
from imgaug.augmentables.polys import Polygon
from createing_dataset.src.helper import get_format_dict
import warnings
def save_dict(dictionary, path):
with open(path, 'w') as fp:
json.dump(dictionar... | 38.767241 | 94 | 0.625083 |
7498be8337b56a6487e005b303ceb5dc46a84ca0 | 1,984 | py | Python | tools/legacy/veh-parser/parseFiles.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/legacy/veh-parser/parseFiles.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/legacy/veh-parser/parseFiles.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | import json
def parseStringsFromFile(importFilename):
translations = {}
with open(importFilename, "r") as stringFile:
lines = stringFile.read().splitlines()
for line in lines:
if "=" in line and ";" in line:
(name, values) = line.split("=")
name = nam... | 37.433962 | 101 | 0.55746 |
7ad673d5355e526a9884137c1a7968722b203052 | 2,596 | py | Python | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.healthcare.doctype.patient_appointment.patient_appointment import invoice_appointment
from frappe.utils.make_random import get_random
from frappe.u... | 39.333333 | 98 | 0.783513 |
bb374ec59278d0932361b065472f7491620e29e5 | 469 | py | Python | loghub-master/datagenerator.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | loghub-master/datagenerator.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | 3 | 2021-03-10T13:18:31.000Z | 2021-05-11T09:20:11.000Z | loghub-master/datagenerator.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | import argparse
import datetime
import requests
import random
parser = argparse.ArgumentParser()
parser.add_argument('amount')
parser.add_argument('url')
args = parser.parse_args()
for i in range(0, int(args.amount)):
print(requests.put(args.url,
json={'datetime': str(datetime.datetime.now... | 27.588235 | 78 | 0.588486 |
24cffe10604b20b48c4b81d38aa7037e8fc985ee | 10,392 | py | Python | tests/web.adblockplus.org/tests/test_StripeDonations.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/tests/test_StripeDonations.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/tests/test_StripeDonations.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pages.genericDonationPage import GenericDonationPage
import data.dataStripe as td
import utils.global_functions as gf
# CAUTION: THESE TESTS SHOULD ONLY BE RUN IN STAGING, WITH TEST KEYS IN PLACE
@pytest.fixtu... | 48.111111 | 108 | 0.817648 |
70993a54962d986052c360cedd004c7ec9990e35 | 7,473 | py | Python | internal/api.py | Saeldur/sl-shadow-priest | a7b027506e52db8e7786ed9d67971adbba7389bd | [
"MIT"
] | null | null | null | internal/api.py | Saeldur/sl-shadow-priest | a7b027506e52db8e7786ed9d67971adbba7389bd | [
"MIT"
] | null | null | null | internal/api.py | Saeldur/sl-shadow-priest | a7b027506e52db8e7786ed9d67971adbba7389bd | [
"MIT"
] | null | null | null | """submits sims to raidbots and waits for the result"""
import json
import time
import requests
import yaml
with open("config.yml", "r") as ymlfile:
config = yaml.load(ymlfile, Loader=yaml.FullLoader)
def submit_sim(api_url_base, api_key, profile_location, simc_build, report_name, iterations):
# pylint: disa... | 39.962567 | 94 | 0.581025 |
c615a7413cd0093edba0cad142dffd2027e79df7 | 253 | py | Python | aoc2020/day_20/utils.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_20/utils.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_20/utils.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | def rotate_matrix(matrix):
return matrix
def cache(fn):
_cache = {}
def _wrap(tile):
k, m = tile
key = f"{k}:{m}"
if key not in _cache:
_cache[key] = fn(tile)
return _cache[key]
return _wrap
| 18.071429 | 34 | 0.517787 |
d6bd533b2740f900f1520d62d071e81bb93b7b86 | 10,942 | py | Python | tests/onegov/election_day/formats/vote/test_internal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/vote/test_internal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/vote/test_internal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from io import BytesIO
from onegov.ballot import Vote
from onegov.core.csv import convert_list_of_dicts_to_csv
from onegov.election_day.formats import import_vote_internal
from onegov.election_day.models import Canton
from tests.onegov.election_day.common import create_principal
def test_im... | 31.715942 | 77 | 0.39618 |
ba73a8e09cbec8f6feef55d618cdd59ba2ff99a4 | 3,089 | py | Python | StudentAverage/stu_mean.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | StudentAverage/stu_mean.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | StudentAverage/stu_mean.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Khyber Sen and Irene Lam
SoftDev1 pd7
HW10 -- Average
2017-10-16
"""
from __future__ import print_function
from students import Students
__authors__ = ['Khyber Sen', 'Irene Lam']
__date__ = '2017-10-16'
from collections import namedtuple
from csv2db import Database
# Dep... | 30.584158 | 100 | 0.608611 |
3032fd5490b8037e3b9ad6a8d6b62b2ed37b5b09 | 5,933 | py | Python | mobile/tools/python/misc/fluidtools.py | jameswu2014/Paddle-Lite | 827e349ac8eb769a873fe9b3aa961af8b8b20a96 | [
"Apache-2.0"
] | 3 | 2018-08-01T09:45:48.000Z | 2021-01-06T14:55:10.000Z | mobile/tools/python/misc/fluidtools.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | null | null | null | mobile/tools/python/misc/fluidtools.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | 5 | 2020-10-13T09:30:16.000Z | 2021-06-08T02:46:17.000Z | # -*- coding: utf-8 -*
import os
import sys
import math
import struct
import subprocess
import numpy as np
import paddle.fluid as fluid
fast_check = False
exe = fluid.Executor(fluid.CPUPlace())
exe.run(fluid.default_startup_program())
ops = None
def check_model(model_path, dump_data_and_model):
check_model_impl(... | 33.710227 | 201 | 0.563459 |
30428602a40d07c987068eaa1c611f602c1f8f72 | 3,057 | py | Python | backend/alembic/versions/a5e49aaba65b_tasks_can_be_optionally_solvedn.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/alembic/versions/a5e49aaba65b_tasks_can_be_optionally_solvedn.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/alembic/versions/a5e49aaba65b_tasks_can_be_optionally_solvedn.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | """Tasks can be optionally solvedn
Revision ID: a5e49aaba65b
Revises: d898dc181fa0
Create Date: 2021-10-27 19:35:01.682120
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
from sqlalchemy.engine.reflection import Inspector
# revision identifiers, used by Alembic.
revision = "a... | 32.870968 | 86 | 0.626431 |
231c03a0c64329d7b907175fadd6f5dab056b859 | 651 | py | Python | listings/chapter03/animals.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter03/animals.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter03/animals.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | class Animal:
def __init__(self, name, legs, superspecies = None):
self.name = name
self.legs = legs
self.superspecies = superspecies
def __str__(self):
result = self.name
if self.superspecies is not None:
result += f" ist eine Art von {self.superspecies.nam... | 25.038462 | 71 | 0.597542 |
ccbad7ff5e7377ee7384243e51de596095ebfd40 | 4,859 | py | Python | official/cv/yolov3_darknet53_quant/export_bin_file.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-07-03T06:52:20.000Z | 2021-07-03T06:52:20.000Z | official/cv/yolov3_darknet53_quant/export_bin_file.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/yolov3_darknet53_quant/export_bin_file.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.383929 | 114 | 0.687178 |
4e033a4e85bdb57ad410ebc0c9e659fbe5bab059 | 4,558 | py | Python | test/test_npu/test_network_ops/test_erfinv.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_erfinv.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_erfinv.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... | 36.758065 | 74 | 0.587319 |
9de20bc945bbbeb2074eff04ff07164a240a5fdf | 513 | py | Python | 7-assets/past-student-repos/_DS-Python/Algorithms-master/stock_prices/stock_prices.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-master/stock_prices/stock_prices.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-master/stock_prices/stock_prices.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
def find_max_profit(prices):
pass
if __name__ == '__main__':
# This is just some code to accept inputs from the command line
parser = argparse.ArgumentParser(description='Find max profit from prices.')
parser.add_argument('integers', metavar='N', type=int, nargs='+', help='... | 34.2 | 144 | 0.736842 |
d1f6baad5b6eb8853af276b143d24d49cb05d053 | 7,098 | py | Python | rdlcompiler/systemrdl/properties.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | 4 | 2016-05-10T20:40:34.000Z | 2020-04-09T13:23:33.000Z | rdlcompiler/systemrdl/properties.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | rdlcompiler/systemrdl/properties.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | __author__ = 'MegabytePhreak'
from enum import Enum, unique
@unique
class RdlType(Enum):
sizedNumeric = 'sn'
unsizedNumeric = 'un'
numeric = 'n'
boolean = 'b'
string = 's'
AddressMode = 'AddressMode'
Precedence = 'Precedence'
AccessMode = 'AccessMode'
enum = 'Enum'
SignalDest ... | 42 | 76 | 0.439279 |
8851bd98bbccde6f71bbc35e178ec15d83082567 | 5,623 | py | Python | plotting/plot_merged_rho.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/plot_merged_rho.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/plot_merged_rho.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Standard Packages
import sys; sys.path.insert(0, '../')
import logging
# 3rd Party Packages
import numpy as np
import matplotlib.pyplot as plt
# Local Packages
import settings
import modules.options
import modules.utils as utils
import modules.datahelper as datahelper
import modules.constants as... | 32.883041 | 112 | 0.669394 |
c9a68b5de36eea6ad2ebdafff07e7c107f463515 | 197 | py | Python | ParsingAndScraping/kinopoisk/main.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T13:06:11.000Z | 2021-06-23T13:06:11.000Z | ParsingAndScraping/kinopoisk/main.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T21:21:52.000Z | 2021-06-23T21:21:52.000Z | ParsingAndScraping/kinopoisk/main.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T19:14:19.000Z | 2021-06-28T19:14:19.000Z | from ParsingAndScraping.kinopoisk.kinopoisk_parser import KinopoiskParser
def main():
parser = KinopoiskParser()
parser.parse_film_price('Начало')
if __name__ == '__main__':
main()
| 17.909091 | 73 | 0.741117 |
11f2fdd1476bd8f418bd3edaa0b6817177da6eb9 | 143 | py | Python | testserver/blueprints/casemanager/cases.py | IfengAutomation/AutomationTestServer | b16ad0fae9cd7198a93cf2f3cd68d46fdae2dbdd | [
"Apache-2.0"
] | null | null | null | testserver/blueprints/casemanager/cases.py | IfengAutomation/AutomationTestServer | b16ad0fae9cd7198a93cf2f3cd68d46fdae2dbdd | [
"Apache-2.0"
] | null | null | null | testserver/blueprints/casemanager/cases.py | IfengAutomation/AutomationTestServer | b16ad0fae9cd7198a93cf2f3cd68d46fdae2dbdd | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint
cases = Blueprint('cases', __name__, url_prefix='/cases')
@cases.route('/')
def root():
return 'CASES ROOT'
| 15.888889 | 57 | 0.685315 |
eecfd42d83517e4dd284850cfc7b00ee9c92c906 | 337 | py | Python | Packs/CommonScripts/Scripts/StringToArray/StringToArray_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/StringToArray/StringToArray_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/StringToArray/StringToArray_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from StringToArray import *
def test_string_to_array():
"""Unit test
Given
- url to tranform.
When
- call StringToArray transformer.
Then
- validate The transformed url.
"""
res = main({'value': "http://example.com/?score:1,4,time:55"})
assert res == '["http://example.com/?scor... | 22.466667 | 66 | 0.617211 |
3a27238f2a438f247af0e87655cc8706e3a91508 | 311 | py | Python | pacman-arch/test/pacman/tests/sync1102.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sync1102.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sync1102.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Get URL on package from a sync db"
sp = pmpkg("dummy")
sp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("sync", sp)
self.args = "-Sp %s" % sp.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PACMAN_OUTPUT=%s" % sp.name)
self.addrule("PACMAN_OUTPUT=file://")
| 23.923077 | 54 | 0.659164 |
e916a5a836b9a51ea8cb01348e98ab88f479d64b | 7,895 | py | Python | Project4/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project4/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project4/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
'''
This package is to be used as a library. Please do not edit.
'''
def runge_function(n: int = 100, min_x: float = -5.0, max_x: float = 5.0) -> (np.ndarray, np.ndarray):
"""
Compute the discrete Runge function on the l... | 31.706827 | 110 | 0.619126 |
c982aaa8373a65a1e5cd41571e02d529277ae46b | 826 | pyde | Python | sketches/mandelbrot2a/mandelbrot2a.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/mandelbrot2a/mandelbrot2a.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/mandelbrot2a/mandelbrot2a.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | left = -2.25
right = 0.75
bottom = -1.5
top = 1.5
maxlimit = 4.0
maxiter = 100
def setup():
size(600, 600)
background("#ffffff")
colorMode(HSB, 255, 100, 100)
noLoop()
def draw():
loadPixels()
for x in range(width):
cr = left + x*(right - left)/width
for y in range(height... | 25.030303 | 69 | 0.438257 |
95b7f41c525de1b3d0e36a68c9b25c016d105eef | 2,248 | py | Python | CodeStatistics/test.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/test.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/test.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Datetime: 2018/12/25
@Author: Zhang Yafei
"""
"""1.加密"""
# import hashlib
#
# md5 = hashlib.md5(b'zhang')
# md5.update(bytes('666666',encoding='utf8'))
# ret = md5.hexdigest()
# print(ret)
"""2.数据库操作"""
# import pymysql
#
# conn = pymysql.Connect(host='localhost', user='root', password='0... | 35.68254 | 161 | 0.696619 |
c2c48f5f1188247b5382c43c7b6e5a81973ec3fd | 35 | py | Python | deutschland/bundesnetzagentur/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 445 | 2021-07-26T22:00:26.000Z | 2022-03-31T08:31:08.000Z | deutschland/bundesnetzagentur/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 30 | 2021-07-27T15:42:23.000Z | 2022-03-26T16:14:11.000Z | deutschland/bundesnetzagentur/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 28 | 2021-07-27T10:48:43.000Z | 2022-03-26T14:31:30.000Z | from .rufzeichen import Rufzeichen
| 17.5 | 34 | 0.857143 |
c2cddb8477dd5bea3559c5ed9aeacadc41033571 | 3,770 | py | Python | rfvision/models/detectors3d/category_ppf/dataset.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/detectors3d/category_ppf/dataset.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/detectors3d/category_ppf/dataset.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | import glob
import os
import numpy as np
from tqdm import tqdm
import pickle
import cv2
from utils import *
import torch
class NOCSForPPF:
def __init__(self,
data_root,
category=2,
):
intrinsics = np.array([[591.0125, 0, 322.525], [0, 590.16775, 244.11084]... | 39.270833 | 142 | 0.546154 |
6c5d48e24ebe3264ed326a72fd440a1cb9fc367a | 3,991 | py | Python | python_experiments/data_analysis/parallel_statistics/generate_parallel_speedup_md.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/parallel_statistics/generate_parallel_speedup_md.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/parallel_statistics/generate_parallel_speedup_md.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import decimal
from data_analysis.parallel_statistics.parallel_time_speedup import *
prlp_tag = 'prlp-with-lock'
prlp_lock_free_tag = 'prlp-lock-free'
pflp_tag = 'pflp-with-lock'
rlp_tag = 'rlp'
flp_tag = 'flp'
rlp_old_tag = 'rlp-old'
flp_old_tag = 'flp-old'
def format_str(float_num):
my_str = str(decimal.Decim... | 41.572917 | 114 | 0.596843 |
b0957c203ca91d3e38766af0adeef4fca6688340 | 2,057 | py | Python | python_reference/useful_scripts/preprocess_first_last_names.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | python_reference/useful_scripts/preprocess_first_last_names.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | python_reference/useful_scripts/preprocess_first_last_names.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | # Sebastian Raschka 2014
#
# A Python function to generalize first and last names.
# The typical use case of such a function to merge data that have been collected
# from different sources (e.g., names of soccer players as shown in the doctest.)
#
import unicodedata
import string
import re
def preprocess_names(name... | 25.7125 | 99 | 0.599417 |
b0e2b4fd19483734dc613ef2fcc01fbaf95c047a | 667 | py | Python | iscsi_initiator/test_iscsi.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | iscsi_initiator/test_iscsi.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | iscsi_initiator/test_iscsi.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | import os
import libiscsi
import scandev
# check the following functions
# libiscsi.discover_sendtargets | iscsi discovery
# node.login() | iscsi login
# node.logout() | iscsi logout
# scandev.get_blockdev_by_targetname() | get block device name
#discover nodes from ipaddress '19... | 24.703704 | 63 | 0.728636 |
b0283496e44905bf7f843e589cf14334e2a89f0d | 643 | py | Python | depth2colormap.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | depth2colormap.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | depth2colormap.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | import cv2
import matplotlib.pyplot as plt
def depth2colormap(filename):
image_GT=cv2.imread("./%s_GT.png"%filename,2) #读取灰度图像
image_HR=cv2.imread("./%s_HR.png"%filename,2) #读取灰度图像
image_LR=cv2.imread("./%s_LR.png"%filename,2) #读取灰度图像
image1=cv2.applyColorMap(image_GT, cv2.COLORMAP_JET)
ima... | 40.1875 | 58 | 0.718507 |
b051b26f4fae71201ac564250b760351a5a29e5e | 297 | py | Python | mutations.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | mutations.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | mutations.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | def mutate_string(string, position, character):
list1 = list(s)
index = int(i)
list1[index] = c
string1 = (''.join(map(str, list1)))
return string1
if __name__ == '__main__':
s = input()
i, c = input().split()
s_new = mutate_string(s, int(i), c)
print(s_new)
| 21.214286 | 47 | 0.585859 |
c6a995c39fd65bc0610f5353ab8063413da48429 | 1,746 | py | Python | kNN/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2018-04-25T18:00:28.000Z | 2018-08-08T09:39:18.000Z | kNN/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | null | null | null | kNN/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2019-03-03T02:55:48.000Z | 2021-01-21T04:50:46.000Z | # Conventional Machine Learning Algorithms
# The Script to Test Class "kNN".
# Author: Qixun Qu
# Create on: 2018/04/30
# Modify on: 2018/05/04
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $$$$ .$... | 24.25 | 65 | 0.58362 |
c6e30e6795f5319d9bc2e458e7f4816fa61e2af7 | 4,495 | py | Python | NahamCon/2021/web/AgentTester/app/backend/backend.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | NahamCon/2021/web/AgentTester/app/backend/backend.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | NahamCon/2021/web/AgentTester/app/backend/backend.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from flask import (
Flask,
render_template,
render_template_string,
request,
redirect,
make_response,
session,
jsonify,
url_for,
g,
)
from functools import wraps
from sqlalchemy import or_
from backend.models import db, User
import os
template_dir = os.path.abspath(".")
app = Fl... | 27.408537 | 106 | 0.588432 |
05d98dae8e1c0d37352bf1e1e63da3c53b8e248b | 1,258 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex01_number_conversions.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex01_number_conversions.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex01_number_conversions.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch04_strings.solutions.ex01_number_conversions import is_binary_number, binary_to_decimal, hex_to_decimal, \
is_binary_number_v2
@pytest.mark.parametrize("value, expected",
[("10101... | 32.25641 | 113 | 0.569952 |
05e99a2028ddb28cb81c79f8d7c379739798988d | 1,140 | py | Python | transonic/test_build_ext.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/test_build_ext.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/test_build_ext.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import os
from pathlib import Path
import runpy
import shutil
from contextlib import suppress
import pytest
from transonic.dist import make_backend_files
from transonic.mpi import nb_proc
from transonic.path_data_tests import path_data_tests
from transonic.config import backend_default
cwd = Path.cwd().absolute()
se... | 27.804878 | 74 | 0.736842 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.