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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2760195f59959101395299755b41ed8e07f0030a | 697 | py | Python | python/python_backup/PRAC_PYTHON/ab31.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab31.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab31.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # pascal's triangle using square matrix
#define row and column
r=input("Give row:");
n=r
m=r
# define matrix filled with 0
a=[[0 for i in range(r)] for j in range(r)]
#input 1 upto left diagonal of matrix
for i in range(0,r,1):
for j in range(0,i,1):
a[i][j]=1
#calculation of triangle
for... | 24.892857 | 44 | 0.509326 |
2794a2228ad91e20d3f061c7ae719833a1921758 | 713 | py | Python | raspberry-code/cloud.py | maschnetwork/raspberry-alexa-iot | e75d1f1363010beacc105536cf6866e4f9fe9f7f | [
"MIT"
] | null | null | null | raspberry-code/cloud.py | maschnetwork/raspberry-alexa-iot | e75d1f1363010beacc105536cf6866e4f9fe9f7f | [
"MIT"
] | null | null | null | raspberry-code/cloud.py | maschnetwork/raspberry-alexa-iot | e75d1f1363010beacc105536cf6866e4f9fe9f7f | [
"MIT"
] | null | null | null | import requests
import threading
import time
BASE_API_URL = 'localhost'
class Cloud:
def __init__(self, device, cbk):
self.device = device
self.cbk = cbk
self.state = None
thread = threading.Thread(target=self.loop, args=())
thread.daemon = True
thread.start()
... | 25.464286 | 71 | 0.59467 |
fd7f3acb0027b8eac3f63c2bd6ad5c63baffb252 | 863 | py | Python | Kapitel_1/_2_Klassenattribute_1.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | 1 | 2020-12-24T15:42:54.000Z | 2020-12-24T15:42:54.000Z | Kapitel_1/_2_Klassenattribute_1.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | Kapitel_1/_2_Klassenattribute_1.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | # --- Deklaration der Klasse mit einem Klassenattribut--- #
class PC:
klassen_attribut = "Ich bin ein Klassenattribut"
# --- Instanziierung einer Klasse ohne Konstruktor eigenen Konstruktor --- #
meine_pc_instanz = PC()
# --- Lesen der Dictionarys, um die Inahlte der Obejkte zu bekommen --- #
print("Instanz Dict... | 37.521739 | 83 | 0.745075 |
e3583c4f84e004ef0e5e92f614035f0483516485 | 294 | py | Python | RunFaster/concurrency/Code-01-Single_thread_program_execution.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | RunFaster/concurrency/Code-01-Single_thread_program_execution.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | RunFaster/concurrency/Code-01-Single_thread_program_execution.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | '''
DEVELOPER NAME : BALAVIGNESH.M
IMPLEMENTED DATE: 16-11-2018
'''
import threading
class SingleThread:
@staticmethod
def ExtraInfo():
print("Mark Antony is the next Emprorer of the Rome")
single = SingleThread()
s = threading.Thread(target = single.ExtraInfo())
s.start()
| 17.294118 | 61 | 0.70068 |
efb533e3803335082bf5e50100725162f1ce9113 | 38 | py | Python | WifiEnigma/WifiUnhacking/insert_psk.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | WifiEnigma/WifiUnhacking/insert_psk.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | WifiEnigma/WifiUnhacking/insert_psk.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | print("INSERER VOTRE MOT DE PASSE")
| 9.5 | 35 | 0.710526 |
4bd0d83f2d305db68a73e7c8991dff4f53c85a5b | 7,223 | py | Python | Packs/GDPR/Scripts/GDPRContactAuthorities/GDPRContactAuthorities.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GDPR/Scripts/GDPRContactAuthorities/GDPRContactAuthorities.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GDPR/Scripts/GDPRContactAuthorities/GDPRContactAuthorities.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 *
AUTHORITY_DETAILS = {
'Austria': {
'Name': 'Österreichische Datenschutzbehörde',
'Email': 'dsb@dsb.gv.at',
'Tel': '+43 1 531 15 202525',
'Site': 'http://www.dsb.gv.at/'
},
'Belgium': {
'Name': 'Commission... | 32.831818 | 98 | 0.534542 |
410c714b66ee5637fa1e9563e425734a830bb648 | 857 | py | Python | setup.py | fgoettel/wgt | e093e2a003fa6c9d4c2082cebbc95701d7f9089d | [
"Unlicense"
] | null | null | null | setup.py | fgoettel/wgt | e093e2a003fa6c9d4c2082cebbc95701d7f9089d | [
"Unlicense"
] | null | null | null | setup.py | fgoettel/wgt | e093e2a003fa6c9d4c2082cebbc95701d7f9089d | [
"Unlicense"
] | 1 | 2022-01-29T12:01:47.000Z | 2022-01-29T12:01:47.000Z | #!/usr/bin/env python
"""The setup script."""
from setuptools import find_packages, setup
with open("README.md") as readme_file:
readme = readme_file.read()
requirements = ["pymodbus==2.4.0"]
test_requirements = [
"pytest>=3",
]
setup(
author="Fabian Göttel",
author_email="fabian.goettel@gmail.com... | 23.162162 | 54 | 0.656943 |
f5c2855eb892a64009b863963a8a20edbded7429 | 97 | py | Python | checklisten/apps.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/checklisten/apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/checklisten/apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.apps import AppConfig
class ChecklistenConfig(AppConfig):
name = 'checklisten'
| 16.166667 | 35 | 0.773196 |
eb2d54d7f878f538d97d83e8d07a3cfa52987940 | 5,887 | py | Python | erntehelfer/views.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | erntehelfer/views.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | erntehelfer/views.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.views import View
from django.views.generic import TemplateView, UpdateView, FormView
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
fro... | 34.629412 | 130 | 0.675726 |
eb2df81ca1fc07147f05f672dec19e2898398121 | 5,588 | py | Python | src/sharex.py | Fuhrmann/keypirinha-sharex | 79d1ce93b737d0950ce720c904d96f938e810277 | [
"MIT"
] | 10 | 2018-03-07T17:48:48.000Z | 2021-03-19T12:26:52.000Z | src/sharex.py | Fuhrmann/keypirinha-sharex | 79d1ce93b737d0950ce720c904d96f938e810277 | [
"MIT"
] | 1 | 2019-02-04T21:36:47.000Z | 2022-01-22T16:04:39.000Z | src/sharex.py | Fuhrmann/keypirinha-sharex | 79d1ce93b737d0950ce720c904d96f938e810277 | [
"MIT"
] | null | null | null | # Keypirinha launcher (keypirinha.com)
import keypirinha as kp
import keypirinha_util as kpu
import keypirinha_net as kpnet
import os
import json
class ShareX(kp.Plugin):
"""
Command ShareX using Keypirinha.
"""
# The default path for the sharex executable
DEFAULT_SHAREX_PATH = "C:\Program Files\... | 38.013605 | 137 | 0.586077 |
9d0d72faacc28957c7de00930b29ea40f645661a | 66,486 | py | Python | Packs/FireEyeHelix/Integrations/FireEyeHelix/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FireEyeHelix/Integrations/FireEyeHelix/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FireEyeHelix/Integrations/FireEyeHelix/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | ALERT_RESP = {
"primary_id": 3232,
"alert_type": {
"id": 1793,
"created_at": "2019-05-25T19:40:09.132456Z",
"updated_at": "2019-08-12T18:40:12.132456Z",
"type_id": "8916-1b5d68c0519f",
"category": "Host",
"detail_fields": [
"username"
],
... | 35.899568 | 146 | 0.334672 |
c22bd224794ffa201529ca5e3b66c077f152834a | 250,322 | py | Python | Admin/res/LOGO_rc.py | BlaCkinkGJ/SFSH | 0134f1e4698ef34caee2d5a8cd875c51507b3527 | [
"MIT"
] | 1 | 2019-02-28T08:39:55.000Z | 2019-02-28T08:39:55.000Z | Admin/res/LOGO_rc.py | BlaCkinkGJ/SFSH | 0134f1e4698ef34caee2d5a8cd875c51507b3527 | [
"MIT"
] | 5 | 2018-07-17T13:09:34.000Z | 2018-09-11T13:55:33.000Z | Admin/res/LOGO_rc.py | BlaCkinkGJ/SFSH | 0134f1e4698ef34caee2d5a8cd875c51507b3527 | [
"MIT"
] | 2 | 2019-05-17T03:07:08.000Z | 2022-01-01T07:04:31.000Z | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\xeb\xad\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x04\x5b\x0... | 65.392372 | 103 | 0.727263 |
dfdba9287c36c3d69d78b6d6e6e17ec4ebbd4b41 | 619 | py | Python | split.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | split.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | split.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | null | null | null | import glob
depths = glob.glob('./depths/*.png')
with open('./train.txt','r') as f:
train = list(f)
for i in range(len(train)-1):
train[i]=train[i][:-1]
for i in range(len(depths)):
depths[i]=depths[i][9:-4]
import os
import shutil
for i in depths:
if i in train:
shutil... | 25.791667 | 74 | 0.533118 |
2608c00327f59b67190fcc186bbb9f672d0f45c6 | 181 | py | Python | src/onegov/notice/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/notice/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/notice/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.notice.models import OfficialNotice
from onegov.notice.collections import OfficialNoticeCollection
__all__ = [
'OfficialNotice',
'OfficialNoticeCollection',
]
| 20.111111 | 62 | 0.79558 |
2626ae87c3fb4c0a71eafe50db4f6a0f83f32dcd | 285 | py | Python | top/clearlight/base/liaoxuefeng/functional_programming/Decorator.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/functional_programming/Decorator.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/functional_programming/Decorator.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # 装饰器
def now():
print('2020-1-17')
# print(now())
f = now
f()
# 函数对象的属性__name__, 可以拿到函数的名字
print(now.__name__)
print(f.__name__)
def log(func):
def wrapper(*args, **kw):
print('call %s():' % func.__name__)
return func(*args, **kw)
return wrapper
| 11.4 | 43 | 0.578947 |
26d362148d492aae489f9fce2da98a0d65afab40 | 713 | py | Python | SiteGadget-main/modules/Hunter.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/Hunter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | SiteGadget-main/modules/Hunter.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 bs4 import BeautifulSoup
import json, requests
from insides.Colors import Colors
def Hunter(site,confHunter,_verbose=None):
if _verbose != None:
try:
dmnlist = ["gmail.com","outlook.com","hotmail.com","yahoo.com","hotmail.co.uk","icloud.com," ,"google.com"]
if (site in dmnlist):
print(f"{bcolors.FAI... | 29.708333 | 110 | 0.617111 |
e46f65d6114b0eb6cec2f322891aa2ff0ce6ca21 | 5,778 | py | Python | research/cv/fairmot/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/fairmot/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/fairmot/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.568345 | 115 | 0.682762 |
f2ffaf6a2d904742b1a72b6fb7b7d9f0797a92e5 | 5,951 | py | Python | prototype.py | adwasser/Schwarz.jl | b7420fcea2b467096c1d46db5722bcfa06458be8 | [
"MIT"
] | 1 | 2017-06-15T04:16:24.000Z | 2017-06-15T04:16:24.000Z | prototype.py | adwasser/Schwarz.jl | b7420fcea2b467096c1d46db5722bcfa06458be8 | [
"MIT"
] | null | null | null | prototype.py | adwasser/Schwarz.jl | b7420fcea2b467096c1d46db5722bcfa06458be8 | [
"MIT"
] | null | null | null | """Test script for sanity checking.
Units
-----
length : kpc
velocity : km/s
mass : Msun
=>
time : kpc/km s ~ 0.978 Gyr
specific energy : km2 / s2
specific angular momentum : kpc km/s
"""
import numpy as np
from scipy import integrate, optimize
from astropy import units as u
from astropy import constants as c
# G ... | 31.654255 | 111 | 0.494203 |
843343f7ed6609153daa8705be8f889342e9f224 | 1,293 | py | Python | tensorflow/basic-rl/tutorial14/code/train_vpg.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial14/code/train_vpg.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial14/code/train_vpg.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | import gym
from baselines.vpg import vpg
import tensorflow as tf
import argparse
#parser
parser = argparse.ArgumentParser()
parser.add_argument('--environment', dest='environment', type=str, default='MountainCarContinuous-v0')
parser.add_argument('--num_timesteps', dest='num_timesteps', type=int, default=10000)
args =... | 34.026316 | 102 | 0.676721 |
ffd60efb65b2c7b0e9eb328f3484d1c7079cd0b4 | 756 | py | Python | other/addition_in_array.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | other/addition_in_array.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | other/addition_in_array.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | 1 | 2020-04-16T01:17:04.000Z | 2020-04-16T01:17:04.000Z | #!/usr/bin/python2.7
import sys
def add_one(input_array):
#raw_array = input_array[:] # another way to copy list
raw_array = list(input_array)
carry = 1
for i in range(len(input_array)-1, -1, -1):
new_num = input_array[i] + carry
if new_num >= 10:
input_array[i] = 0
... | 24.387097 | 58 | 0.542328 |
081b0da8743f5ed60913194ede7984cbd52fa36a | 1,017 | py | Python | Misc/Caesar_Cipher_Encryptor/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Misc/Caesar_Cipher_Encryptor/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Misc/Caesar_Cipher_Encryptor/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | from string import ascii_lowercase as letters
def shift(list, num):
"""
this function shifts the position of an existing list or string and returns it as a new list
"""
list = [x for x in list]
for i in range(num):
first = list[0]
list.pop(0)
list.append(first)
return ... | 22.108696 | 96 | 0.60472 |
4b828127cbd52d708a6dec348d24506fe87344a9 | 4,162 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/07_kapitel_12_repetitionsfragen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/07_kapitel_12_repetitionsfragen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/07_kapitel_12_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 07_kapitel_12_repetitionsfragen.py
import os, re
max_text_length=70
max_text_delta=20
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
print('║ '+title.center(max_text_length+7).upper()+'║')
print('╠'+''.center(max_text_length+8, '═')+'╣')
string=string+' '*max_text_lengt... | 54.051948 | 299 | 0.738107 |
4b01d69ceedabdf009d7aefd214e671a0419e2b3 | 2,352 | py | Python | api/db/clickhouse_dw.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/db/clickhouse_dw.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/db/clickhouse_dw.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | 1 | 2022-02-11T04:44:37.000Z | 2022-02-11T04:44:37.000Z | # !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/7/28 下午5:11
# @Author : Latent
# @Email : latentsky@gmail.com
# @File : clickhouse_dw.py
# @Software: PyCharm
# @class : clickhouse 操作
from abstract.db_base import DB_BASE
from clickhouse_driver import Client
class ClickHouse(DB_BASE):
host = '127.0.0.1'
... | 39.2 | 120 | 0.593963 |
d9b67097922c00b4c5c943680885d6b932abcae8 | 842 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_0/party_model_patch_fix.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v5_0/party_model_patch_fix.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/party_model_patch_fix.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
for company in frappe.get_all("Company",
["name", "default_receivable_account", "default_payable_account"]):
if company.default_receivable_account:
frappe.db.sql("""update `tabSales Invoice` invoice set `debit_to`=%(account)s
where comp... | 44.315789 | 99 | 0.750594 |
d9db600f8be478d9bd046b31e45f4fdc338ced65 | 7,883 | py | Python | azext_keyvault/_command_type.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 2 | 2019-06-12T13:44:34.000Z | 2020-06-01T13:24:04.000Z | azext_keyvault/_command_type.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 5 | 2018-04-26T01:14:29.000Z | 2021-01-05T00:45:39.000Z | azext_keyvault/_command_type.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 8 | 2018-04-24T22:52:48.000Z | 2021-11-16T06:29:28.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 49.578616 | 124 | 0.641 |
0a25ec1fe9875570a9269a9b2ee80b97768587fb | 557 | py | Python | perf/summary.py | Software-Knife-and-Tool/xian | bd5c77a222bfa9c18379510e63930627cb2f028a | [
"MIT"
] | null | null | null | perf/summary.py | Software-Knife-and-Tool/xian | bd5c77a222bfa9c18379510e63930627cb2f028a | [
"MIT"
] | 96 | 2021-08-07T11:57:22.000Z | 2022-01-09T19:31:43.000Z | perf/summary.py | Software-Knife-and-Tool/xian | bd5c77a222bfa9c18379510e63930627cb2f028a | [
"MIT"
] | null | null | null | #! /usr/bin/python
import sys
def main():
totals = [0.0 for i in range(14)]
length = 0.0
title = sys.argv[1]
infile = open(sys.argv[2], 'r')
line = infile.readline()
counts = line.rstrip().split()
labels = [
"conses",
"exceptions",
"functions",
"streams",
... | 19.206897 | 89 | 0.477558 |
6a5f1f025793357aad7aad0896ccb3886219f057 | 423 | py | Python | python/image_processing/affine.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/image_processing/affine.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/image_processing/affine.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('cadillac.png')
rows,cols,ch = img.shape()
pts1 = np.float32([[50,50],[200,50],[50,200]])
pts2 = np.float32([[10,100],[200,50],[100,250]])
M = cv2.getAffineTransform(pts1,pts2)
dst = cv2.warpAffine(img,M,(cols,rows))
plt.subplot(12... | 22.263158 | 52 | 0.695035 |
7c4df8ab0f5472d6c2f7a9b0d3cda9b0ece8fa63 | 2,358 | py | Python | tspdb/src/tslb/src/lzw.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 43 | 2019-12-10T00:05:51.000Z | 2022-03-31T21:21:20.000Z | tspdb/src/tslb/src/lzw.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 5 | 2021-05-09T01:12:31.000Z | 2022-03-29T17:34:15.000Z | tspdb/src/tslb/src/lzw.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 14 | 2020-01-13T21:20:07.000Z | 2022-03-31T02:11:26.000Z | ######################################################
#
# LZW compression
#
######################################################
from io import StringIO
def get_string(uncomp_numbers, n):
# uncomp_number is a list of numbers
# max(n) = 256 is the alphabet size
# make dictionary
dictionary = {i : chr... | 28.409639 | 60 | 0.57676 |
7c69cb1afd8f5e1e920ab69147c283e6ac126cb9 | 1,711 | py | Python | src/main/python/qxy/rename_test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/qxy/rename_test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/qxy/rename_test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | import os
import logging
import numpy as np
def rename_dir(url,reverse=True):
""""
根据static的值进行文件夹自动重命名,命名规则
YYYYMMDDhhmmsss+3[001]
directory.ini
网->0
于->1
:param url:,文件夹地址,
:param static:给出的需要进是关于地址是否是相对地址
:param reverse:确定是行反向目录生成,还是正向目录生成
:return:
Ti... | 23.121622 | 99 | 0.573349 |
7ccf4712ac58b2406244edd3a5efbb16553fab70 | 2,445 | py | Python | Python/flask/app.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/flask/app.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/flask/app.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
app = Flask(__name__)
class Item:
def __init__(self, name, amount):
self.name = name
self.amount = amount
@app.route('/')
def hello_world(): # put application's code here
items_class = [Item("Apfel", 1),
Item("Birne", 3),... | 28.764706 | 96 | 0.537832 |
861db294a2ca7d79d1ce0a112fba0becd9e7c762 | 4,438 | py | Python | SuperBench/Source/test.py | FBerendsen/SuperElastix-1 | 69d97589e34f6f2109621e917792ce18e32442fe | [
"Apache-2.0"
] | null | null | null | SuperBench/Source/test.py | FBerendsen/SuperElastix-1 | 69d97589e34f6f2109621e917792ce18e32442fe | [
"Apache-2.0"
] | null | null | null | SuperBench/Source/test.py | FBerendsen/SuperElastix-1 | 69d97589e34f6f2109621e917792ce18e32442fe | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
import subprocess
import json
from popi import POPI
def load_submissions(parameters):
logging.info('Loading blueprints ...')
submissions = [(team_name, os.path.join(parameters.submissions_directory, team_name, file_name))
for team_name in os... | 46.715789 | 132 | 0.562866 |
8106eca16734ec8208c9192231b50ff388f62fb7 | 5,894 | py | Python | image_segmentation/tf1_train.py | gitskim/DnntalPrivate | 20f84782e9ab20c68b43f32efb16cd22262b8ceb | [
"MIT"
] | null | null | null | image_segmentation/tf1_train.py | gitskim/DnntalPrivate | 20f84782e9ab20c68b43f32efb16cd22262b8ceb | [
"MIT"
] | null | null | null | image_segmentation/tf1_train.py | gitskim/DnntalPrivate | 20f84782e9ab20c68b43f32efb16cd22262b8ceb | [
"MIT"
] | 2 | 2019-05-16T05:48:26.000Z | 2021-01-27T01:26:22.000Z | import os
import numpy as np
import zipfile
import subprocess
import glob
import cv2
from tqdm import tqdm
import sys
# For building the model_2
import tensorflow as tf
import keras as keras
from keras.models import Model, load_model
from keras import backend as K
from sklearn.model_selection import train_test_split
fr... | 35.721212 | 118 | 0.73244 |
0791ccc7eea02b87628716c9c0a4ef9a203603c5 | 802 | py | Python | exercises/pt/exc_04_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_04_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_04_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import json
import spacy
from spacy.matcher import Matcher
from spacy.tokens import Span
with open("exercises/en/iphone.json", encoding="utf8") as f:
TEXTS = json.loads(f.read())
nlp = spacy.blank("en")
matcher = Matcher(nlp.vocab)
# Dois tokens cujo formato em minúsculas corresponda a "iphone" e "x"
pattern1 = ... | 29.703704 | 87 | 0.710723 |
07f332cc82ddb3cb0e149a56f616a5a6b4114f55 | 899 | py | Python | plot-graphs.py | Kingpin007/SC-Lab | ba8fa9dfca4b950ebcb8c8d409f7e215c7971925 | [
"MIT"
] | null | null | null | plot-graphs.py | Kingpin007/SC-Lab | ba8fa9dfca4b950ebcb8c8d409f7e215c7971925 | [
"MIT"
] | null | null | null | plot-graphs.py | Kingpin007/SC-Lab | ba8fa9dfca4b950ebcb8c8d409f7e215c7971925 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 26 09:34:42 2018
@author: Kingpin007
Equation: 1/(1+x^2)
"""
import matplotlib.pyplot as plt
from scipy.special import gamma as Gamma
from scipy import signal
from pylab import *
def gamma(x):
return Gamma(x)
def gauss(x,sigma):
return signal.gaussian(x,std=sigm... | 17.98 | 46 | 0.608454 |
ed0f7d1ac129106c717d07b7d98aaf6fce7d9bb6 | 256 | py | Python | Boot2Root/hackthebox/Sneaky/scripts/bof.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 21 | 2016-02-06T14:30:01.000Z | 2020-09-11T05:39:17.000Z | Boot2Root/hackthebox/Sneaky/scripts/bof.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | null | null | null | Boot2Root/hackthebox/Sneaky/scripts/bof.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 7 | 2017-02-02T16:27:02.000Z | 2021-04-30T17:14:53.000Z | buffer_size = 362
shellcode = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"
nopsled = "\x90" * (362-len(shellcode))
eip = "\xb0\xf3\xff\xbf" #0xbffff3b0
payload = nopsled + shellcode + eip
print payload | 23.272727 | 106 | 0.703125 |
92f9e0fc16177854dfc23466237b71836f246368 | 484 | py | Python | exercises/es/exc_01_09.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/exc_01_09.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/exc_01_09.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.load("es_core_news_sm")
text = (
"Los Olímpicos de Tokio 2020 son la inspiración para la nueva "
"colección de zapatillas adidas zx."
)
# Procesa el texto
doc = ____
# Itera sobre las entidades
for ____ in ____.____:
# Imprime en pantalla el texto de la entidad y su etiqueta
... | 21.043478 | 67 | 0.719008 |
13db9d206b48833504c9d45b0d16c82ace93b7d4 | 3,695 | py | Python | herokubot.py | Corina-Chatbot/TelegramIntegration | f0296b698c9f5b8c5d21247d6ce514d0b4b94d21 | [
"MIT"
] | 1 | 2020-03-22T21:42:06.000Z | 2020-03-22T21:42:06.000Z | herokubot.py | Corina-Chatbot/TelegramIntegration | f0296b698c9f5b8c5d21247d6ce514d0b4b94d21 | [
"MIT"
] | null | null | null | herokubot.py | Corina-Chatbot/TelegramIntegration | f0296b698c9f5b8c5d21247d6ce514d0b4b94d21 | [
"MIT"
] | null | null | null | import logging
import os
import corina_api
from telegram import KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler
faq_examples = ["Was ist Corona?",
"Wie s... | 35.190476 | 121 | 0.668742 |
6a48b6e932e3ecd198999f11ab1cdadbadc32135 | 1,246 | py | Python | Packs/StarterPack/Integrations/BaseIntegration/BaseIntegration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/StarterPack/Integrations/BaseIntegration/BaseIntegration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/StarterPack/Integrations/BaseIntegration/BaseIntegration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """Base Integration for Cortex XSOAR - Unit Tests file
Pytest Unit Tests: all funcion names must start with "test_"
More details: https://xsoar.pan.dev/docs/integrations/unit-testing
MAKE SURE YOU REVIEW/REPLACE ALL THE COMMENTS MARKED AS "TODO"
You must add at least a Unit Test function for every XSOAR command
you... | 28.976744 | 74 | 0.74077 |
bcfffcd2a9e241669151beb0bb8e9a4cd7e9e813 | 537 | py | Python | DnD/dice.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | DnD/dice.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | DnD/dice.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
import logging
from random import randint
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(logging.Formatter('[%(asctime)s - %(name)s - %(levelname)s] %(message)s'))
log.addHandler(stream_h... | 28.263158 | 102 | 0.757914 |
4c4f09e21e4d7ec6948c4c09a57abd248c879619 | 2,161 | py | Python | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/chart_message.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 14 | 2016-11-03T19:06:21.000Z | 2021-11-24T09:05:09.000Z | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/chart_message.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 10 | 2022-02-16T07:17:49.000Z | 2022-03-08T12:43:51.000Z | asset/integrations/django/samples/fusioncharts/samples/chart_message.py | Piusshungu/catherine-junior-school | 5356f4ff5a5c8383849d32e22a60d638c35b1a48 | [
"MIT"
] | 17 | 2016-05-19T13:16:34.000Z | 2021-04-30T14:38:42.000Z | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file which has required functions to embed the charts in html page
from ..fusioncharts import FusionCharts
# Loading Data from a Static JSON String
# It is a example to show how to attach message in chart.
# The `... | 36.627119 | 134 | 0.504859 |
4c7a5094ca818f2c0e8cc3149634d02367c6c370 | 89 | py | Python | Python/temp-converter.py | saurabhpal007/hacktoberfest2021-1 | 5abad37ab426a7b34fc7bcd98ded885fd6ce02ef | [
"CC0-1.0"
] | 81 | 2021-10-01T13:19:13.000Z | 2021-10-06T08:43:35.000Z | Python/temp-converter.py | saurabhpal007/hacktoberfest2021-1 | 5abad37ab426a7b34fc7bcd98ded885fd6ce02ef | [
"CC0-1.0"
] | 67 | 2021-10-01T13:43:46.000Z | 2021-10-06T13:55:49.000Z | Python/temp-converter.py | saurabhpal007/hacktoberfest2021-1 | 5abad37ab426a7b34fc7bcd98ded885fd6ce02ef | [
"CC0-1.0"
] | 394 | 2021-10-01T11:55:24.000Z | 2021-10-06T13:45:57.000Z | def convert(s):
f = float(s)
c = (f - 32) * 5/9
return c
print(convert(78))
| 12.714286 | 22 | 0.505618 |
e6ccf88a7dbcf8909f9674328b03fd57db6ec562 | 5,206 | py | Python | y_gears/scripts/Python/tembase_split.py | 42sol/termbase_de_shared | 09ec09d3542ad72bfd3b351dd59c2aecdd52e6f4 | [
"Unlicense"
] | 1 | 2022-01-06T22:42:01.000Z | 2022-01-06T22:42:01.000Z | y_gears/scripts/Python/tembase_split.py | 42sol/termbase_de_shared | 09ec09d3542ad72bfd3b351dd59c2aecdd52e6f4 | [
"Unlicense"
] | 1 | 2022-01-07T11:01:03.000Z | 2022-01-07T11:01:03.000Z | y_gears/scripts/Python/tembase_split.py | 42sol/termbase_de_shared | 09ec09d3542ad72bfd3b351dd59c2aecdd52e6f4 | [
"Unlicense"
] | 1 | 2022-01-06T22:42:07.000Z | 2022-01-06T22:42:07.000Z | from core_setup import *
p = Parameters()
test.info(p.language)
test.info(f'Found at {p.termbase_path} ')
g_count = 0
g_diffs = 0 # a duplicate entry with at least one difference
g_doubles = 0 # a duplicate entry with no differences
show_only = 0
def is_table_line( x_line, with_columns, x_seperator = '|', x_li... | 26.561224 | 99 | 0.53957 |
fc801741081c907083224655cde3b9e51ea6911b | 6,219 | py | Python | IsingEnergy.py | Zhangyanbo/Energy-and-IIT | 6de269109cad4744f54e63d7d4ab2fdd4687a40d | [
"MIT"
] | null | null | null | IsingEnergy.py | Zhangyanbo/Energy-and-IIT | 6de269109cad4744f54e63d7d4ab2fdd4687a40d | [
"MIT"
] | null | null | null | IsingEnergy.py | Zhangyanbo/Energy-and-IIT | 6de269109cad4744f54e63d7d4ab2fdd4687a40d | [
"MIT"
] | null | null | null | from sympy.combinatorics.graycode import GrayCode
from itertools import permutations
import numpy as np
import warnings
import pyphi
import pandas as pd
import time
import sys
start = time.time()
################
# Terminal input:
# **.py start end total filename
# Note: the end is not included
################
star... | 28.791667 | 124 | 0.595433 |
5d78ff3caeb46adbe6ada6b7cefbeb16785e015b | 5,866 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/edgeswitch/test_edgeswitch_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/edgeswitch/test_edgeswitch_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/edgeswitch/test_edgeswitch_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2018 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | 38.339869 | 146 | 0.619161 |
5d89472ce81860c9566db65f9f0d1230de80f519 | 1,495 | py | Python | trinkets/build_trinket.py | cixel/sl-shadow-priest | 3159c79fb305a226aeddfa6b884734ddfc108ccd | [
"MIT"
] | null | null | null | trinkets/build_trinket.py | cixel/sl-shadow-priest | 3159c79fb305a226aeddfa6b884734ddfc108ccd | [
"MIT"
] | null | null | null | trinkets/build_trinket.py | cixel/sl-shadow-priest | 3159c79fb305a226aeddfa6b884734ddfc108ccd | [
"MIT"
] | null | null | null | """
builds trinket strings
python build_trinket.py Empyreal_Ordnance 180117 158 226
"""
import argparse
import numpy
def build_range(min_ilevel, max_ilevel):
"""build the numpy range"""
return numpy.arange(min_ilevel, (max_ilevel + 5), 3)
def build_trinket(name, item_id, ilevel):
"""build the correct tr... | 29.313725 | 76 | 0.655518 |
5d313b525c62d972b43afe2827a9d61d5dc6e19d | 15,550 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_powermeter.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_powermeter.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_powermeter.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.
import ct... | 39.367089 | 149 | 0.601415 |
53f20553872db1db4ab1683817ef807e0c11fae0 | 1,263 | py | Python | Tries/Trie.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Tries/Trie.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Tries/Trie.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | from collections import defaultdict
import unittest as ut
class Trie:
"""
Basic implementation of Trie with insert and search operation.
"""
def __init__(self):
self.head = defaultdict()
def insert(self, word):
"""
Inserts a word into the trie
"""
current ... | 23.388889 | 66 | 0.543151 |
53f7fbd1254ebeb215ac92e2a59a2744e92f80e3 | 6,474 | py | Python | src/test/tests/databases/pdbdatabase.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/pdbdatabase.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/pdbdatabase.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: pdbdatabase.py
#
# Tests: mesh - 2D,3D curvilinear, single domain
# plots - Pseudocolor, Subset, Vector
# operators - Clip
#
# Programmer: Brad Whitlock
# Date: ... | 26.532787 | 78 | 0.632221 |
071ecbcf10e3ec28308fd0f567073310ed7be6ed | 424 | py | Python | DataProcess/utils/myplot.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/utils/myplot.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/utils/myplot.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project :DataProcess
@File :myplot.py
@Author :Zhang Qihang
@Date :2021/11/8 14:41
"""
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
def phase_heatmap(phase_mat):
sns.set_context({"figure.figsize": (8, 8)})
sns.heatmap(phas... | 18.434783 | 47 | 0.665094 |
ab05a5fa51a53915ad1a9dcb412673a8ae78c27a | 383 | py | Python | pk/data/qxy/json-test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/qxy/json-test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/qxy/json-test.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z |
import json
import demjson
import numpy
from context import resource_manager
from tools import file_manage
def json_test():
"""with open('data'+resource_manager.getSeparator()+'json'+resource_manager.getSeparator()+'cluster.json','r') as f:
data=json.load(f)"""
x=numpy.array([1,2,3,4,5,6,7,2,2,2,3,2... | 25.533333 | 120 | 0.686684 |
db67aff61fe5ffb9625a0e14dea1fb3125446353 | 298 | py | Python | historie/tests/test_apps.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/historie/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/historie/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.apps import apps
from django.test import TestCase
from historie.apps import HistorieConfig
class ReportsConfigTest(TestCase):
def test_apps(self):
self.assertEqual(HistorieConfig.name, 'historie')
self.assertEqual(apps.get_app_config('historie').name, 'historie')
| 29.8 | 74 | 0.765101 |
db8d57669b6e859c20c336a219adeb409ba8f857 | 14,883 | py | Python | test/ao/sparsity/test_sparsifier.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | test/ao/sparsity/test_sparsifier.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | test/ao/sparsity/test_sparsifier.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | # -*- coding: utf-8 -*-
# Owner(s): ["module: unknown"]
import itertools
import logging
import re
import torch
from torch import nn
from torch.ao.sparsity import BaseSparsifier, WeightNormSparsifier, FakeSparsity
from torch.nn.utils.parametrize import is_parametrized
from torch.testing._internal.common_utils import ... | 42.644699 | 123 | 0.607068 |
db9a35827565b7368207c737d5bf904672b9f55b | 333 | py | Python | ZDT4.py | jmorenov/BBOMO | 572965579928b532b6ae70e4dd468fcc734019da | [
"MIT"
] | null | null | null | ZDT4.py | jmorenov/BBOMO | 572965579928b532b6ae70e4dd468fcc734019da | [
"MIT"
] | null | null | null | ZDT4.py | jmorenov/BBOMO | 572965579928b532b6ae70e4dd468fcc734019da | [
"MIT"
] | null | null | null | import math
def F1(x):
return x[0]
def F2(x):
def g(x2m):
sum = 0
for i in x2m:
sum = sum + (i * i - 10 * math.cos(4 * math.pi * i))
return 1 + 10 * (len(x) - 1) + sum
def h(f1, g):
return 1 - math.sqrt(f1 / g)
x2m = x[1:len(x)]
return g(x2m) * h(F... | 16.65 | 65 | 0.432432 |
4aa37f110f1b72a6307e28d702ff51269138cc45 | 366 | py | Python | tests/_calc/distributions_test.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | tests/_calc/distributions_test.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | tests/_calc/distributions_test.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | import chex
import jax
import jax.numpy as jnp
import shinrl as srl
def test_squashed_normal():
loc = jnp.array([0.1, 0.5, 0.2])
scale = jnp.array([1.0, 5.0, 10.0])
dist = srl.SquashedNormal(loc, scale)
sample = dist.sample(seed=jax.random.PRNGKey(0), sample_shape=10)
log_prob = dist.log_prob(sam... | 24.4 | 69 | 0.677596 |
43da548ce1c3f735608e169ce5cc6839e185b860 | 479 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 91/91.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 91/91.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 91/91.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Please download the database file database.db and and the ten_more_countries.txt file. Then, add the rows of the text file to the database file.
import sqlite3
import pandas
data = pandas.read_csv("ten_more_countries.txt")
conn = sqlite3.connect("database.db")
cur = conn.cursor()
for index, row in data.iterrows():
... | 34.214286 | 145 | 0.726514 |
60614f44372c59cfdeab16f66ecbf69419ed8a84 | 6,061 | py | Python | src/onegov/election_day/views/vote/entities.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/vote/entities.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/vote/entities.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from onegov.ballot import Ballot
from onegov.ballot import Vote
from onegov.core.security import Public
from onegov.election_day import _
from onegov.election_day import ElectionDayApp
from onegov.election_day.layouts import DefaultLayout
from onegov.election_day.layouts import VoteLayout
... | 23.583658 | 75 | 0.671341 |
608e157f690067acc86b284788a51ca17d7c5494 | 1,667 | py | Python | solutions/pedestrian_search/webserver/src/encoder/encode.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/pedestrian_search/webserver/src/encoder/encode.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/pedestrian_search/webserver/src/encoder/encode.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import os
# import numpy as np
# from common.config import DATA_PATH as database_path
# from encoder.utils import get_imlist
# from preprocessor.vggnet import VGGNet
from diskcache import Cache
from common.const import default_cache_dir
import torch
from service.utils.metric import AverageMeter
import time
def feature... | 37.044444 | 88 | 0.656869 |
e07d02c312fbbd8c9b4fc0764d5162d5a61c0bdc | 219 | py | Python | 2.py | alvinbengeorge/HackerRank | 11101db16df57736cbcacd0a7d9e0b61069ba750 | [
"MIT"
] | 1 | 2021-11-06T13:24:58.000Z | 2021-11-06T13:24:58.000Z | 2.py | alvinbengeorge/HackerRank | 11101db16df57736cbcacd0a7d9e0b61069ba750 | [
"MIT"
] | null | null | null | 2.py | alvinbengeorge/HackerRank | 11101db16df57736cbcacd0a7d9e0b61069ba750 | [
"MIT"
] | null | null | null | #https://www.hackerrank.com/challenges/python-loops/problem?isFullScreen=true&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen
if __name__ == '__main__':
n = int(input())
[print(i*i) for i in range(n)] | 43.8 | 132 | 0.707763 |
46067cec4951c5515f874ae0d6eef4a5bec5b6de | 403 | py | Python | models/hr_job_aptitude.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_job_aptitude.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_job_aptitude.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | 3 | 2017-09-11T08:02:11.000Z | 2020-04-04T08:13:23.000Z | # -*- coding: utf-8 -*-
from openerp import api, exceptions, fields, models, _
class HrJobAptitude(models.Model):
_name = "hr.job.aptitude"
_description = "Aptitude necessaire pour un poste"
name = fields.Many2one(comodel_name='aptitude.type', string='Aptitude Requis')
job_id = fields.Many2one(como... | 28.785714 | 82 | 0.704715 |
1cbfe2ad400a7e1ac3b3a2fc51c4cacb0cd1e804 | 693 | py | Python | 2_Iterables/Lists/list_comprehensions.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 2_Iterables/Lists/list_comprehensions.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 2_Iterables/Lists/list_comprehensions.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | import random
list1 = [x for x in range(0,10)]
print(list1)
list2 = [x**2 for x in range(0,5)]
print(list2)
values = ['hi', 'by', 'eye']
list3 = [x*3 for x in values]
print(list3)
list4 = [random.randint(-10, 10) for _ in range(10)] # _ falls Variable nicht weiter benötigt wird
print(list4)
# nur positiven Werte ... | 21 | 99 | 0.676768 |
1c86d531697a72e22bb5805b54eea97b77d8a3e9 | 670 | py | Python | platform/mcu/haas1000/prebuild/data/python-apps/ml/recognize-expression/main.py | NEXTLEO/AliOS-Things | 117ca103144a7bf6a394455bcc59698b7e1dd79d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | platform/mcu/haas1000/prebuild/data/python-apps/ml/recognize-expression/main.py | NEXTLEO/AliOS-Things | 117ca103144a7bf6a394455bcc59698b7e1dd79d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/ml/recognize-expression/main.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z |
from minicv import ML
print("-------------------Welcome HaasAI MicroPython--------------------")
print("-----ml ucloud RecognizeExpression demo start-----")
OSS_ACCESS_KEY = "xxxx"
OSS_ACCESS_SECRET = "xxxx"
OSS_ENDPOINT = "xxxx"
OSS_BUCKET = "xxxx"
ml = ML()
ml.open(ml.ML_ENGINE_CLOUD)
ml.config(OSS_ACCESS_KEY, OSS... | 29.130435 | 78 | 0.722388 |
c7de8c5d554e53b7632a140b461d8dfddd13c0ea | 579 | py | Python | python/coursera_python/RICE/PPE/b.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/RICE/PPE/b.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/RICE/PPE/b.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | p = True
q = True
not (p or not q)
# False
p = True
q = False
not (p or not q)
p = False
q = True
not (p or not q)
p = False
q = False
not (p or not q)
# False False True False
def nand(bool1, bool2):
"""
Take two Boolean values bool1 and bool2
and return the specified Boolean values
"""
i... | 11.816327 | 46 | 0.525043 |
40cf0b2fdf52ce2f3e3eb91397cb633e393eed48 | 381 | py | Python | python/concurrency/concurrency_futures/deadlock2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/concurrency/concurrency_futures/deadlock2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/concurrency/concurrency_futures/deadlock2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor
def wait_on_future():
f = executor.submit(pow, 5, 2)
# This will never complete because there is only one worker thread and
# it is executing this function
print(f.result())
with ThreadPoolExecutor(max_workers=1) as executor:
future = ... | 27.214286 | 75 | 0.711286 |
40f6f096c9fbcc28a975d3b283c35d3e0d016a35 | 13,206 | py | Python | tests/shared/core/training_data/story_reader/test_markdown_story_reader.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 1 | 2020-09-12T17:27:21.000Z | 2020-09-12T17:27:21.000Z | tests/shared/core/training_data/story_reader/test_markdown_story_reader.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 9 | 2020-09-15T20:10:23.000Z | 2020-09-15T20:19:07.000Z | tests/shared/core/training_data/story_reader/test_markdown_story_reader.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Dict, Text
import pytest
import rasa.shared.utils.io
import rasa.utils.io
from rasa.core import training
from rasa.shared.core.domain import Domain
from rasa.shared.core.events import (
UserUttered,
ActionExecuted,
ActionExecutionRejected,
ActiveLoop,
Fo... | 31.898551 | 85 | 0.580039 |
46756a28c5364aee100e9856c3b79ac083616a0f | 83 | py | Python | dtdocker/managers/__init__.py | oxsoftdev/dt-docker | 8ba30bf5ca2a7b89f3c7658a7768b16dbf8514a5 | [
"MIT"
] | null | null | null | dtdocker/managers/__init__.py | oxsoftdev/dt-docker | 8ba30bf5ca2a7b89f3c7658a7768b16dbf8514a5 | [
"MIT"
] | null | null | null | dtdocker/managers/__init__.py | oxsoftdev/dt-docker | 8ba30bf5ca2a7b89f3c7658a7768b16dbf8514a5 | [
"MIT"
] | null | null | null | from .ImageManager import ImageManager
from .NetworkManager import NetworkManager
| 20.75 | 42 | 0.86747 |
9efb707caacee135905827c75f551e780cbe7307 | 5,782 | py | Python | etc/old/es/opt/misc/visited.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | 1 | 2021-03-31T03:41:06.000Z | 2021-03-31T03:41:06.000Z | etc/old/es/opt/misc/visited.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | etc/old/es/opt/misc/visited.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
""""
many things that you might think to test, wont ever happen
of the things that do happen, a happen happen a lot and the others much less o
"""
import random,sys
import itertools,math
import numpy as np
from math import prod
from sparklines import sparklines
def pdf(alpha,bins):
x=[1]
for... | 59.608247 | 102 | 0.345555 |
48f65de97e77f13ebe5a88566c62893ae1dee9ed | 1,899 | py | Python | Invent Your Own Computer Games with Python/ch11_the_bagels_deduction_game/bagels.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | Invent Your Own Computer Games with Python/ch11_the_bagels_deduction_game/bagels.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | Invent Your Own Computer Games with Python/ch11_the_bagels_deduction_game/bagels.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import random
NUM_DIGITS = 3
MAX_GUESS = 10
def getsecretNum():
# Returns a string of unique random digits that is NUM_DIGITS long.
numbers = list(range(10))
random.shuffle(numbers)
secretNum = ''
for i in range(NUM_DIGITS):
secretNum += str(numbers[i])
return secretNum
def getClues(guess, sec... | 24.662338 | 84 | 0.641917 |
c49a59f4ca34339e960a96f089ee41b8d1bca6fc | 114 | py | Python | myspiders/ruia/ruia_pyppeteer/__init__.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/ruia/ruia_pyppeteer/__init__.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/ruia/ruia_pyppeteer/__init__.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | from .request import PyppeteerRequest
from .response import PyppeteerResponse
from .spider import PyppeteerSpider
| 28.5 | 39 | 0.868421 |
c4a532b40d136219b9a72e9723dd82f802f1deef | 18,191 | py | Python | research/nlp/gpt2/src/utils/data_preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | research/nlp/gpt2/src/utils/data_preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/nlp/gpt2/src/utils/data_preprocess.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.200409 | 104 | 0.524215 |
6fcde9cb2cd6068991bd2d73830e8a7ca3094f3f | 2,117 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/settings.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/settings.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/settings.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | _bedtools_path = ""
_R_path = ""
tempfile_prefix = 'pybedtools.'
tempfile_suffix = '.tmp'
# Checking for BEDTools will happen when creating the first BedTool; other
# checks happen at first use (BAM object creation; tabix-ing a BedTool)
_bedtools_installed = False
_R_installed = False
_v_2_15_plus = False
KEEP_TEMP... | 24.333333 | 102 | 0.62069 |
82fd3b1bbd6742834ed8bbf1128b823b9b54d9b3 | 559 | py | Python | Curso_Python/Secao5-modulos-uteis/126_JSON_javascript_Object_Notation/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/126_JSON_javascript_Object_Notation/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/126_JSON_javascript_Object_Notation/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null |
from dados import *
import json
# Converte um dicionário em JSON
# útil para salvar informações de qualquer tipo
dados = json.dumps(clientes_dicionario, indent=4)
# Converte JSON em um dicionário
# útil para carregar informações de qualquer tipo
dados = json.loads(clientes_json)
print(dados)
# Exporta dicionário pa... | 24.304348 | 60 | 0.751342 |
d20422a2e661c658065e92cba23e21e0e355980c | 180 | py | Python | Road_safety/hackathon/forms.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 3 | 2019-07-05T16:52:34.000Z | 2021-07-09T09:01:03.000Z | Road_safety/hackathon/forms.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 5 | 2020-08-18T21:45:56.000Z | 2021-04-13T14:36:47.000Z | Road_safety/hackathon/forms.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 2 | 2019-07-02T21:36:40.000Z | 2019-08-23T16:17:11.000Z | from django import forms
class LoginForm(forms.Form):
username = forms.CharField(max_length=60)
password = forms.CharField(max_length=60, widget=forms.PasswordInput()) | 36 | 75 | 0.755556 |
d21155226aaa273e531e2e440cd661d5ae94682f | 6,926 | py | Python | controls.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | controls.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | controls.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | import gzip, re, csv, math
from pathlib import Path
from collections import Counter
from pipeline import PipeLine
from tqdm import tqdm
from util import Protein, Target
from configparser import ConfigParser
class ControlMatch:
def __init__(self, id, location):
self.positive = True
self.id = id
... | 29.10084 | 165 | 0.565406 |
d26a70eae072667871222a984a03f6424396b325 | 4,793 | py | Python | Packs/FeedGCPWhitelist/Integrations/FeedGCPWhitelist/FeedGCPWhitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedGCPWhitelist/Integrations/FeedGCPWhitelist/FeedGCPWhitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedGCPWhitelist/Integrations/FeedGCPWhitelist/FeedGCPWhitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
# IMPORTS
import dns.resolver
import re
from typing import List, Dict, Callable, Tuple, Any
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# CONSTANTS
GOOGLE_BASE_DNS = "_cloud-netblocks.googleusercontent.com"
def fetch_cidr(dns_address: str) -> List[Dict]... | 29.95625 | 127 | 0.615272 |
968515a9e531a8f1aba21f46d0fe7f75dac10e06 | 616 | py | Python | Python/EstruturaSequencial/Exercicios/Exercicio11.py | ekballo/Back-End | b252e3b2a16ce36486344823f14afa6691fde9bc | [
"MIT"
] | null | null | null | Python/EstruturaSequencial/Exercicios/Exercicio11.py | ekballo/Back-End | b252e3b2a16ce36486344823f14afa6691fde9bc | [
"MIT"
] | null | null | null | Python/EstruturaSequencial/Exercicios/Exercicio11.py | ekballo/Back-End | b252e3b2a16ce36486344823f14afa6691fde9bc | [
"MIT"
] | null | null | null | #Faça um Programa que peça 2 números inteiros e um número real. Calcule e mostre:
#o produto do dobro do primeiro com metade do segundo .
#a soma do triplo do primeiro com o terceiro.
#o terceiro elevado ao cubo.
n1 = float(input('Digite Primeiro Numero: '))
n2 = float(input('Digite Segundo Numero: '))
n3 = float(inpu... | 38.5 | 81 | 0.676948 |
fb76b0497d538cb0a9d29b86f9f13c699cefbe26 | 569 | py | Python | exercises/pt/test_03_09_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/test_03_09_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/test_03_09_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert Token.has_extension(
"is_country"
), "Você registrou a extensão no token?"
ext = Token.get_extension("is_country")
assert ext[0] == False, "Você definiu o valor padrão corretamente?"
country_values = [False, False, False, True, False]
assert [
t._.is_country fo... | 35.5625 | 71 | 0.655536 |
fbb19a1738f48d98f52af22084573c8e2567b552 | 506 | py | Python | python/coursera_python/WESLEYAN/week2/5.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/WESLEYAN/week2/5.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/WESLEYAN/week2/5.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import random
def problem2_5():
lst = []
random.seed(171) # don't remove when you submit for grading
""" Simulates rolling a die 10 times."""
for i in range(10):
# Setting the seed makes the random numbers always the same
# This is to make the auto-grader's job easier.
... | 28.111111 | 68 | 0.604743 |
790214d60cffa2a494c5dcf9a8ff558464d131ab | 149 | py | Python | src/aijack/defense/ckks/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/ckks/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/ckks/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | from .encoder import CKKSEncoder # noqa: F401
from .encrypter import CKKSEncrypter # noqa: F401
from .plaintext import CKKSPlaintext # noqa: F401
| 37.25 | 50 | 0.778523 |
f70a0e8a1e36c7d6b49ffd219b5fb6ca1c543c6b | 14,575 | py | Python | Packs/DeprecatedContent/Integrations/Cymon/Cymon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeprecatedContent/Integrations/Cymon/Cymon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeprecatedContent/Integrations/Cymon/Cymon.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 requests
import os
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
if not demisto.params().get('useProxy', False):
del os.environ['HTTP_PROXY']
del os.environ['H... | 31.344086 | 124 | 0.535232 |
f75cae3ef15c74f6137f36f710d86cec18262151 | 324 | py | Python | rgr_user.py | sayanss2/rgr | bee688b4fa9d51af2dada3a3b674f8b25e872e31 | [
"Apache-2.0"
] | null | null | null | rgr_user.py | sayanss2/rgr | bee688b4fa9d51af2dada3a3b674f8b25e872e31 | [
"Apache-2.0"
] | null | null | null | rgr_user.py | sayanss2/rgr | bee688b4fa9d51af2dada3a3b674f8b25e872e31 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python3
import socket
import getpass
user = str(getpass.getuser())
out = 'error'
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
sock.sendto(user.encode('utf-8'), ('127.0.0.1',40069))
date, addr = sock.recvfrom(1024)
if date:
out = date.decode('utf-8')
print(user + ", Ваш вариант № " + ... | 27 | 62 | 0.685185 |
f7973b341dc7df568c4c9576ec39378bead52777 | 7,480 | py | Python | 20-fs-ias-lec/groups/09-loraSense/SenseLink/LoRaSense - Interface/sensui/MainWindow.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/09-loraSense/SenseLink/LoRaSense - Interface/sensui/MainWindow.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/09-loraSense/SenseLink/LoRaSense - Interface/sensui/MainWindow.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import sys
import os
import ast
import jsonpickle
import datetime
# PyQt5
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtWidgets import QTabWidget, QTabBar
from PyQt5 import uic
from PyQt5 import QtCore
# Own Modules
from NodeManager import NodeManager
from ViewManager import ViewManager
from View... | 34.155251 | 204 | 0.651738 |
e3b95ab4c3db7d046f9e007a3ce84abfbe4769a9 | 4,324 | py | Python | week4/assignment_week03_answer.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 12 | 2020-05-25T08:21:25.000Z | 2022-02-22T09:02:00.000Z | week4/assignment_week03_answer.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | null | null | null | week4/assignment_week03_answer.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 6 | 2020-06-02T11:54:03.000Z | 2022-02-22T09:03:05.000Z | # coding:utf-8
# code for week3
import torch
from torch.autograd import Variable as V
def generate_data():
# 本函数生成0-9,10个数字的图片矩阵
image_data = []
num_0 = torch.tensor(
[[0, 0, 1, 1, 0, 0],
[0, 1, 0, 0, 1, 0],
[0, 1, 0, 0, 1, 0],
[0, 1, 0, 0, 1, 0],
[0, 0, 1, 1, 0... | 27.896774 | 95 | 0.442877 |
582fa8a788a8a9a68f4c27b76ebfc912a507ab12 | 466 | py | Python | exercises/en/test_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/en/test_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/en/test_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
import spacy.tokens
import spacy.lang.es
assert isinstance(
nlp, spacy.lang.es.Spanish
), "The nlp object should be an instance of the Spanish class."
assert isinstance(
doc, spacy.tokens.Doc
), "Did you process the text with the nlp object to create a doc?"
asse... | 33.285714 | 76 | 0.671674 |
3f9e57756d17c633ec5bc1ae0fac1071586798e2 | 392 | py | Python | PINp/2014/KOROTKOVA_D_S/task_5_39.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/KOROTKOVA_D_S/task_5_39.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/KOROTKOVA_D_S/task_5_39.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5. Вариант 39.
# Напишите программу, которая бы при запуске случайным образом отображала название одной из четырех основных мастей лошадей.
# Korotkova D.S.
# 26.03.2016
print("Одной из основны мастей лошадей является:")
import random
mast=("Вороная масть","Гнедая масть","Рыжая масть","Пегая масть")
B=ran... | 28 | 124 | 0.752551 |
b7f4bf67d264d8989353e2eff1b1fc17972471bf | 19,466 | py | Python | lbry/tests/integration/test_resolve_command.py | xeddmc/lbry | af1c8ec35ce394d6b09acc02ed650879ef06a2f4 | [
"MIT"
] | null | null | null | lbry/tests/integration/test_resolve_command.py | xeddmc/lbry | af1c8ec35ce394d6b09acc02ed650879ef06a2f4 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/tests/integration/test_resolve_command.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import asyncio
import json
import hashlib
from unittest import skip
from binascii import hexlify, unhexlify
from lbry.testcase import CommandTestCase
from lbry.wallet.transaction import Transaction, Output
from lbry.schema.compat import OldClaimMessage
from torba.client.hash import sha256, Base58
class BaseResolveTes... | 49.658163 | 123 | 0.689715 |
151a4679bd8cc4c497f3c60f609749066884974f | 12,196 | py | Python | mlir/test/Bindings/Python/ir_types.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | mlir/test/Bindings/Python/ir_types.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | mlir/test/Bindings/Python/ir_types.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | # RUN: %PYTHON %s | FileCheck %s
import gc
import mlir
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert mlir.ir.Context._get_live_count() == 0
# CHECK-LABEL: TEST: testParsePrint
def testParsePrint():
ctx = mlir.ir.Context()
t = ctx.parse_type("i32")
assert t.context is ctx
ctx = Non... | 29.746341 | 79 | 0.698344 |
12a430981f69a7c7840cad765671e6d030973cb9 | 3,636 | py | Python | Project5/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project5/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project5/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
import scipy.io.wavfile as wavio
from main import dft_matrix, is_unitary, fft
'''
This package is to be used as a library. Please do not edit.
'''
# convenience adjustments
np.set_printoptions(precision=3)
np.set_printoptions(suppress=True)
np.set_printoptions(l... | 25.787234 | 88 | 0.65154 |
42952d8edcda5073a23f283a19364bd69de21be4 | 526 | py | Python | Prediction/show.py | Nivram710/Seretra | dc7a509ff37e07ea4688a87ab89d13783299c069 | [
"Apache-2.0"
] | 2 | 2018-04-12T14:24:33.000Z | 2020-09-16T07:03:28.000Z | Prediction/show.py | Nivram710/Seretra | dc7a509ff37e07ea4688a87ab89d13783299c069 | [
"Apache-2.0"
] | null | null | null | Prediction/show.py | Nivram710/Seretra | dc7a509ff37e07ea4688a87ab89d13783299c069 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
from read import read_data
def show(objects, points=[]):
if len(objects) == 0:
print("Nothing to show")
for obj in objects.values():
obj_interpolated = obj # interpolate(obj, 100)
xs = list(map(lambda d: d[0].x, obj_interpolated))
ys = list(map(... | 22.869565 | 58 | 0.602662 |
db13016d2a25538a520fe4dc634210bbce0adbe3 | 15,081 | py | Python | sim/lib/town_maps.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | null | null | null | sim/lib/town_maps.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | null | null | null | sim/lib/town_maps.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | 1 | 2021-07-28T13:52:58.000Z | 2021-07-28T13:52:58.000Z | import numpy as np
import folium
import folium.plugins
import matplotlib
import os
from lib.measures import (MeasureList, SocialDistancingForAllMeasure,
SocialDistancingForPositiveMeasure, SocialDistancingByAgeMeasure,
SocialDistancingForSmartTracing, ComplianceForAllMea... | 42.601695 | 161 | 0.55865 |
c0070b301f7e323498694df3fe44a99daf19b1d9 | 65 | py | Python | PYTHON/Introduction/hello_world.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Introduction/hello_world.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Introduction/hello_world.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
anything = input()
print('Hello world!')
| 13 | 22 | 0.676923 |
c06c3fb41b06655211cb21e366efc46ebd209cf1 | 10,072 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/plot_trajectories.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/plot_trajectories.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/plot_trajectories.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2007-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 40.449799 | 114 | 0.593824 |
22367576a8623485cecd336ead894a0615791a42 | 941 | py | Python | Algorithms/Implementation/almost_sorted.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/almost_sorted.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/almost_sorted.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from copy import copy
def possible_swap(dn, i, j, sorted_dn):
temp_dn = copy(dn)
temp_dn[i], temp_dn[j] = temp_dn[j], temp_dn[i]
if temp_dn == sorted_dn:
return True
else:
return False
def possible_reverse(dn, i, j, sorted_dn):
temp = dn[i: j + 1]
temp_... | 20.456522 | 51 | 0.55898 |
225e74f1a7c4fe96a649e605c9fd7b0561510a0a | 3,269 | py | Python | turngen/alphazero/NeuralNet.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/alphazero/NeuralNet.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/alphazero/NeuralNet.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import state as s
import game as g
from keras.models import Model
from keras.layers import *
from keras.utils.vis_utils import plot_model
# this is hacky, but we dont want every file in the same folder
import sys
sys.path.insert(0,'..')
class NeuralNet:
def __init__(self)... | 31.737864 | 107 | 0.650046 |
3f672638aed455bcb0b9488f5e40f1df36ace910 | 2,412 | py | Python | text_clf/launch.py | kejunxiao/TextClf | aa1c195cb5908c32a3e6ed6891142603cb198d87 | [
"BSD-3-Clause"
] | 2 | 2018-05-13T13:00:10.000Z | 2018-05-13T13:00:12.000Z | text_clf/launch.py | kejunxiao/TextClf | aa1c195cb5908c32a3e6ed6891142603cb198d87 | [
"BSD-3-Clause"
] | null | null | null | text_clf/launch.py | kejunxiao/TextClf | aa1c195cb5908c32a3e6ed6891142603cb198d87 | [
"BSD-3-Clause"
] | null | null | null | import tensorflow as tf
from train import train
from evaluate import evaluate
if __name__ == '__main__':
# Parameters
# Data loading parameters
tf.app.flags.DEFINE_float("dev_sample_rate", .05,
"Percentage of the training data to use for validation(default:0.05)")
tf.app.f... | 46.384615 | 100 | 0.572139 |
58bca90a7bddd7766f2bc00fd30c28b1b0bbb771 | 658 | py | Python | python_project/python/time_cmp.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | python_project/python/time_cmp.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | python_project/python/time_cmp.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/python
# coding=utf-8
import time
#from datetime import datetime
import argparse
def TimeCmp(lPara, rPara):
return int(time.strftime("%H%M", lPara)) - int(time.strftime("%H%M", rPara))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--execute-time', dest='ex... | 29.909091 | 88 | 0.612462 |
58d8a2363d788366d9c677086db11552afa23ac2 | 2,316 | py | Python | DailyDataUpdater.py | Yashraj890/StockAnalyzer | 96311362c85a224833a23c08148df956a64e177c | [
"MIT"
] | null | null | null | DailyDataUpdater.py | Yashraj890/StockAnalyzer | 96311362c85a224833a23c08148df956a64e177c | [
"MIT"
] | null | null | null | DailyDataUpdater.py | Yashraj890/StockAnalyzer | 96311362c85a224833a23c08148df956a64e177c | [
"MIT"
] | null | null | null | import pandas as pd
from openpyxl import Workbook
from openpyxl import load_workbook
# let's read the sectors data from workbook
Sectorswb = load_workbook(r'D:\NSEData\Sectors.xlsx')
# let's read the sectorswise company data from workbook
SectorwiseCompanieswb = load_workbook(r'D:\NSEData\SectorWiseCompanies.xlsx')
... | 38.6 | 141 | 0.691278 |
3606cba4f57635aa1544853e23db842fb2bb2f77 | 3,220 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/eventreplay/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/eventreplay/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/eventreplay/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #! /usr/bin/env python
#
# BitBake Toaster Implementation
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
# Tests were part of openembedded-core oe selftest Authored by: Lucian Musat
# Ionut Chisanovici, Paul Eggleton and Cristian Iorga
"""
Test toaster backend by playing build ev... | 37.44186 | 81 | 0.589441 |
368d802acdab27822ac32f761ec02f05820c674f | 492 | py | Python | gdp1/assignment_2/y2k_age_calculator.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_2/y2k_age_calculator.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_2/y2k_age_calculator.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | from gdp1.common.input_helpers import int_input
def main():
year_of_birth = int_input("Enter your year of birth (yy): ", minmax=(0, 99))
current_year = int_input("Enter the current year (yy): ", minmax=(0, 99))
if year_of_birth > current_year:
# e.g. 100 - 95 + 14 = 19
age = 100 - year_... | 27.333333 | 80 | 0.634146 |
3d1eb88e24340872c57cd06a5bc3aec8fb18f3fa | 21,985 | py | Python | matbench/task.py | knc6/matbench | 93b46afcc0481d50e4320e9a366d50d521bc8fd9 | [
"MIT"
] | 15 | 2021-11-01T09:02:19.000Z | 2022-03-19T10:59:41.000Z | matbench/task.py | knc6/matbench | 93b46afcc0481d50e4320e9a366d50d521bc8fd9 | [
"MIT"
] | 62 | 2021-09-20T14:09:59.000Z | 2022-03-30T19:03:22.000Z | matbench/task.py | ardunn/matbench | 7d11a2d63766339ec00e610e2255be29b81544d3 | [
"MIT"
] | 4 | 2021-03-22T10:37:42.000Z | 2021-07-20T14:11:28.000Z | import copy
import logging
import numpy as np
from matminer.datasets import get_all_dataset_info
from matminer.featurizers.conversions import (
StrToComposition,
StructureToComposition,
)
from monty.json import MSONable
from matbench.constants import (
CLF_KEY,
CLF_METRICS,
FOLD_DIST_METRICS,
... | 37.905172 | 85 | 0.556561 |
a17c41a086f1585d89538a16c7d5bb25e52659f7 | 10,410 | py | Python | test_docbuilder.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | test_docbuilder.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | 1 | 2020-09-23T21:03:00.000Z | 2020-09-23T21:03:00.000Z | test_docbuilder.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | import unittest
from docBuilder import *
class MyTestCase(unittest.TestCase):
def test_createDoc(self):
tDoc1 = Doc()
tDoc2 = Doc("TestDoc2")
def test_createClass(self):
tClass1 = Class()
tClass2 = Class("TestClass2")
def test_createFunction(self):
tFunc1 = Functi... | 38.131868 | 758 | 0.636023 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.