source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
tasks.py | from __future__ import absolute_import
import json
import logging
from datetime import datetime
from threading import Thread
from tornado import web
from tornado import gen
from tornado.escape import json_decode
from tornado.web import HTTPError
from celery import states
from celery.result import AsyncResult
from c... |
spec_listener.py | from threading import Thread
import time
from tanager_tcp.tanager_server import TanagerServer
from tanager_feeder.listeners.listener import Listener
from tanager_feeder import utils
from tanager_feeder.connection_checkers.spec_connection_checker import SpecConnectionChecker
from tanager_feeder.dialogs.error_dialog im... |
radio.py | from .exceptions import ProtocolError, PacketRadioError
from podcomm import crc
from .packet_radio import TxPower
from .pr_rileylink import RileyLink
from .message import Message, MessageState
from .packet import Packet
from .definitions import *
from threading import Thread, Event
class Radio:
def __init__(self, ... |
server.py | import os
import sys
import threading
import traceback
from . import common, compat, configs, utils
def _get_appsock_from_handshake(config, handshake_endpoint):
app_info = utils.create_rep_socket_bound_to_random()
handshake_sock = compat.MQ.socket(compat.MQ.REQ)
handshake_sock.connect(handshake_endpoint... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from detection.utils.general import xyxy2xywh, xywh2xyxy... |
RTB.py | #!/usr/bin/env python3
# Raid Toolbox
# Author: DeadBread76 - https://github.com/DeadBread76/
# February 23rd, 2019 - Yikes
#
# Copyright (c) 2019, DeadBread
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright ... |
webservice.py | #!/usr/bin/python
"""
The chorus webservice responsible for communicating with the CLI.
Allows you to distribute docker files for building and deploying containers inside a cloud environment.
"""
__author__ = 'nbyrne'
# Webservice allowing management of a fleet of machines running the docker service
import BaseHTTP... |
test_util.py | # Copyright 2015 The TensorFlow 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 applica... |
lfadsqueue.py | # Goals
# -----
#
# What we want is to launch and monitor multiple shell scripts simultaneously.
# We have a list of tasks. Each task has a certain amount of memory that it needs in GPU memory.
#
# Launch tensorboard with all runs queued.
#
# At the start, we loop through the queue and determine if the next task can ru... |
test_extending.py | import math
import operator
import sys
import pickle
import multiprocessing
import ctypes
import warnings
from distutils.version import LooseVersion
import re
import numpy as np
from numba import njit, jit, vectorize, guvectorize, objmode
from numba.core import types, errors, typing, compiler, cgutils
from numba.core... |
bdtest.py | import requests
import json
import sqlite3
import multiprocessing
import subprocess
import time
import eventlet
TABLENAME = 'onions_onionsites'
dbname = "db.sqlite3"
proxies = {
'http': 'socks5h://127.0.0.1:9150',
'https': 'socks5h://127.0.0.1:9150'
}
#print(data)
def get_bd_update_candi():
conn = sqlite3.... |
kaldi_io.py | #!/usr/bin/env python
# Copyright 2014-2016 Brno University of Technology (author: Karel Vesely)
# Licensed under the Apache License, Version 2.0 (the "License")
import numpy as np
import sys, os, re, gzip, struct
#################################################
# Adding kaldi tools to shell path,
# Select kaldi,
... |
test_failure.py | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
from ray.experimental.internal_kv import _internal_kv_get
from ray.autoscaler._private.util import DEBUG_AUTOSCALING_ERROR
import ray._private.utils
from ... |
tasks.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple, deque
import errno
import functools
import importlib
import json
import logging
import os
import shutil
import stat
import tempfile
import time
import traceback
from distutils.di... |
trainer.py | # Lint as: python2, python3
# Copyright 2018 The TensorFlow 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
#
... |
User.py | import pickle
import threading
import socket
from Messages.Info import Info
from Messages.Bcast import Bcast
from Messages.Error import Error
class User:
count = 0
notOnServer = Error("User not on server!")
def __init__(self, ip, conn, server):
self.admin = False
self.ip = ip
self... |
models.py | # -*- coding: utf-8 -*-
import os
os.environ['OMP_NUM_THREADS'] = '1'
os.environ['OPENBLAS_NUM_THREADS'] = '1'
import time
import queue
import datetime
import threading
import h5py
import psutil
import numpy as np
DB = {'kakao_reco_730m': './tmp/kakao_reco_730m.h5py',
'ml20m': './tmp/ml20m.h5py',
'ml100k... |
test_freezetime.py | import pytest
import random
import datetime
from threading import Thread, RLock
from Acquire.Accounting import Account, Transaction, TransactionRecord, Ledger, Receipt, Refund, create_decimal, Balance, Accounts
from Acquire.Identity import Authorisation
from Acquire.ObjectStore import get_datetime_now
from Acquire.... |
main.py | from trade_client import *
from store_order import *
from logger import logger
from load_config import *
from new_listings_scraper import *
import globals
from collections import defaultdict
from datetime import datetime, time
import time
import threading
import copy
import json
from json import JSONEncoder
import os.p... |
test_tcp.py | import asyncio
import asyncio.sslproto
import gc
import os
import select
import socket
import unittest.mock
import uvloop
import ssl
import sys
import threading
import time
import weakref
from OpenSSL import SSL as openssl_ssl
from uvloop import _testbase as tb
class MyBaseProto(asyncio.Protocol):
connected = No... |
collections_plasma.py | import random
import copy
from .base_gsi import BaseSecondaryIndexingTests
from collection.collections_rest_client import CollectionsRest
from collection.collections_stats import CollectionsStats
import threading
from couchbase_helper.query_definitions import SQLDefinitionGenerator
from lib.couchbase_helper.documentge... |
task.py | import atexit
import json
import os
import shutil
import signal
import sys
import threading
import time
from argparse import ArgumentParser
from logging import getLogger
from operator import attrgetter
from tempfile import mkstemp, mkdtemp
from zipfile import ZipFile, ZIP_DEFLATED
try:
# noinspection PyCompatibili... |
SoDark.py | # -*- coding: utf-8 -*-
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
try:
import mechanize
except ImportError:
os.system('pip2 install mechanize')
else:
try:
import requests
except ImportEr... |
client.py | from tkinter import *
import tkinter.messagebox
import time
from collections import defaultdict
import threading
import random
import socket
import pickle
class Network:
def __init__(self):
self.port = 50500
self.server = socket.gethostbyname(socket.gethostname())
self.client = socket.so... |
__init__.py | """
.. moduleauthor:: Fabio Manganiello <blacklight86@gmail.com>
"""
import os
import queue
import stat
import tempfile
import time
from enum import Enum
from threading import Thread, Event, RLock
from .core import Sound, Mix
from platypush.context import get_bus
from platypush.message.event.sound import \
Soun... |
keck_vnc_launcher.py | #! /usr/bin/env python3
## Import standard modules
import os
import argparse
import atexit
from datetime import datetime
from getpass import getpass
import logging
import math
import os
from pathlib import Path
import platform
import re
import socket
import subprocess
import sys
from telnetlib import Telnet
from threa... |
pytet.py |
from matrix import *
import LED_display as LMD
import threading
import random
import keyboard #sudo pip3 install keyboard
import time
import copy
import os
NowRoad=[10,10,10,10,10,10,10,10,0,0,0,0,0,0,0,0,10,10,10,10,10,10,10,10]
NList=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
#모든 방향은 LED Matrix 출... |
b_live_stream_test.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# setting up modules used in the program
import a_prefix_variable as apv
from pygame.locals import *
from socket import socket
import pygame.display
import numpy as np
import threading
import pygame
import socket
import time
import cv2
import sys
import os
# threading ... |
tasks.py | import random
from datetime import datetime
from threading import Thread
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import transaction
from os import path
from account.models import User
from account.payment import reward_problem_ac, reward_contest_ac
from disp... |
webshell.py | #!/usr/bin/python
""" WebShell Server """
""" Released under the GPL 2.0 by Marc S. Ressl """
"""
# Copyright 2012 iXsystems, Inc.
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistri... |
log_update_handler.py | #!/usr/bin/env python
##############################################################################
# Copyright 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
################################... |
HTTPListener.py | import logging
import os
import sys
import threading
import SocketServer
import BaseHTTPServer
import ssl
import socket
import posixpath
import mimetypes
import time
from . import *
MIME_FILE_RESPONSE = {
'text/html': 'FakeNet.html',
'image/png': 'FakeNet.png',
'image/ico': 'FakeNet.ico',
... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import os
import pickle
import random
import re
import subprocess
import sys
import textwrap
import threading
import time
import unitt... |
notifications.py | import smtplib
import threading
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from src import config, log
from src.alerts import get_alerts_by_type, TYPE_TWITTER
INSTA_EMAIL_SUBJECT = "{} - {} - Instagram alert"
INSTA_EMAIL_BODY = """
<html>
<body>
<h1><img src=... |
train_tcn.py | import os
import argparse
import torch
import numpy as np
from torch import optim
from torch import multiprocessing
from torch.optim import lr_scheduler
from torch.autograd import Variable
from torch.utils.data import DataLoader, ConcatDataset
from util import (SingleViewTripletBuilder, distance, Logger, ensure_folder)... |
site_list.py | #! /usr/bin/env python3
"""Snoop: скрипт для обновления БД списка сайтов
"""
import json
import sys
import requests
import threading
import xml.etree.ElementTree as ET
from datetime import datetime
from argparse import ArgumentParser, RawDescriptionHelpFormatter
pool = list()
pool1 = list()
def get_rank(domain_to_q... |
ram_usage.py | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... |
cpy.py | from .windowdata import SizeData, Window
from threading import Thread
from PIL import ImageGrab
import numpy as np
import win32gui
import sys
def capture(window, output_frame=np.zeros(1)):
Thread(target=_capture, args=(window, output_frame)).start()
return frame
def _capture(window, frame=np.zeros(1))
if ... |
simulator.py | from __future__ import division
import threading
import pygame
from .arenas import PiratePlunderArena, CTFArena, SunnySideUpArena, ABCArena, CalderaArena, TwoColoursArena
from .display import Display
DEFAULT_GAME = 'caldera'
GAMES = {'caldera': CalderaArena,
'pirate-plunder': PiratePlunderArena,
'... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... |
messagebus_test.py | # Copyright 2017 Mycroft AI Inc.
#
# 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 in writin... |
telloPose.py | """
tellotracker:
Allows manual operation of the drone and demo tracking mode.
Requires mplayer to record/save video.
Controls:
- tab to lift off
- WASD to move the drone
- space/shift to ascend/escent slowly
- Q/E to yaw slowly
- arrow keys to ascend, descend, or yaw quickly
- backspace to land, or P to palm-land
- en... |
test_s3boto3.py | import gzip
import pickle
import threading
from datetime import datetime
from textwrap import dedent
from unittest import mock, skipIf
from urllib.parse import urlparse
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.... |
log_handler.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
test_how_join_works.py | import multiprocessing, time
def foo():
print("foo starts")
time.sleep(5)
print("foo ends")
if __name__ == "__main__":
p = multiprocessing.Process(target=foo)
p.start()
p.join()
print("done")
|
message_manager.py | #!/bin/python3
import message_to_vk
from threading import Thread
import interaction_with_db
def main(table_name='accounts_bot'):
"""
Запускает message_to_vk.message() для каждого бота в отдельном потоке
"""
cur = interaction_with_db.get_cursor()
cur.execute("SELECT id FROM {}".format(table_name))
... |
server.py | #!/usr/bin/python3
import threading
import paramiko, base64
import sys
from json import dumps, loads, JSONEncoder, JSONDecoder
from flask import Flask, json, Response
from flask_cors import CORS, cross_origin
from flask import request
import settings as s
import crawler as c
import who
import requests
import logging
... |
worker1.py | from cerebral import logger as l
import Pyro4
from cerebral.nameserver import ports
from agility.gait import Dynamic
from cerebral.pack2.hippocampus import Android
from agility.main import Agility, ServoError
from threading import Thread, Lock, Event
from functools import lru_cache
import time
import logging
# Confi... |
te.py | # -*- coding: utf-8 -*-
import requests
import base64
import json
import random
import math
from threading import Thread
def read_data(file_name):
content = fp.read()
content_en = base64.urlsafe_b64encode(content)
content_str = str(content_en, encoding = "ascii")
return content_str
def ... |
graph_controller.py |
import threading
from .icontroller import IController
import time
import math
import numpy as np
from colormath.color_objects import LabColor, sRGBColor
from colormath.color_conversions import convert_color
class GraphAlgorithm(IController):
"""
The concrete controller. All the calculations are handled here... |
movie.py | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* --------... |
homecontrol_client.py | #!/usr/bin/python
import os
import sys
import socket
import time
from PIL import Image
from lglcd import LogitechLcd
from threading import Thread
def load_image(sprite):
im = Image.open(sprite)
im = im.convert('1')
return list(im.getdata())
def background(sprite):
lcd.set_background(load_image(sprit... |
extract_license.py | #!/usr/bin/env bash
import json
import re
import sqlite3
from multiprocessing import Process
import requests
import tqdm
from bs4 import BeautifulSoup as BS
import ray
def create_connection(db_file):
"""create db connection to db_file."""
conn = None
try:
conn = sqlite3.connect(db_file)
exc... |
camera_pi.py | #
# Camera streaming code based on https://github.com/miguelgrinberg/flask-video-streaming
#
import time
import io
import threading
import picamera
class Camera(object):
thread = None # background thread that reads frames from camera
frame = None # current frame is stored here by background thread
last_... |
server.py | #!/usr/bin/env python
"""
Dummy server used for unit testing.
"""
import logging
import os
import sys
from app import TestingApp
log = logging.getLogger(__name__)
CERTS_PATH = os.path.join(os.path.dirname(__file__), 'certs')
DEFAULT_CERTS = {
'certfile': os.path.join(CERTS_PATH, 'server.crt'),
'keyfile': ... |
zpp_hub_detect_loadgen.py | #!/usr/bin/env python3
import array
import json
import os
import struct
import sys
import threading
import time
import numpy as np
import zmq
import mlperf_loadgen as lg
###########################################################################################################
## NB: if you run into "zmq.error.ZMQE... |
tests.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
04_daynamic_web_server.py | # coding:utf-8
import socket
import re
import sys
from multiprocessing import Process
# 设置静态文件根目录
HTML_ROOT_DIR = "./html"
PYTHON_ROOT_DIR = "./wsgibins"
class HTTPServer(object):
""""""
def __init__(self):
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server_s... |
main.py | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
import wx
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
import threading
import inspect
import ctypes
from run import runcore
from ui import uidef
from ui import uilang
g_main_win = None
g_task_detectUsbhid = None
g_task_uartAllInOneAction =... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
main.py | import argparse
from threading import Event, Thread, Semaphore, Lock
DEBUG = True # 是否输出调试信息
class Bank:
"""表示银行服务的类"""
def __init__(self):
self.time = 0
self.queue = [] # 顾客的等待队列及其锁
self.mutex_queue = Lock()
self.customers = []
self.tellers = []
self.total_s... |
run.py | # -*- coding: utf-8 -*-
from app import logging
from app.remote.redis import Redis as redis
from app.telegram.app import get_client as telegram_get_client
from app.vk.app import start_polling as vk_start_polling
from threading import Thread
from time import sleep
import logging
import asyncio
if __name__ == "__main_... |
sensor2hass_mqtt.py | # -*- coding:utf-8 -*-
# author:hyz
import sys
import threading
import binascii
import re
import time
from datetime import datetime
import json
from mySerial import myserial
import paho.mqtt.client as mqtt
import config
class mqtt2sensor:
def __init__(self):
self.dict_num = config.doInit()
self.cl... |
example.py | from __future__ import print_function
import random
import time
from threading import Thread
from connector import Connector
from connector_types import TestType
Connector.log = lambda x, y: print(y)
client = None
def heartbeat(test_run_id):
while True:
print("Pinging test run: " + str(client.ping_run(t... |
aiointhread.py | import threading
import asyncio
async def io_work():
while True:
print('Hi from another thread!')
await asyncio.sleep(1)
def thread_worker():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop) # <<----- IMPORTANT!!
loop.create_task(io_work())
loop.run_forever()
thread ... |
data_handler.py | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 19 18:34:46 2019
@author: Branson
"""
from abc import ABCMeta, abstractmethod
import datetime
import os, os.path
import queue as queue
import numpy as np
import pandas as pd
from threading import Thread
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExec... |
Server.py | import socket
import threading
from threading import Thread
import pickle
import json
import requests
from tkinter import *
import tkinter
from tkinter import ttk
import datetime
import time
FORMAT = "utf8"
HOST = "127.0.0.1"
PORT = 65432
URL = 'https://tygia.com/json.php?ran=0&rate=0&gold=1&bank=VIETCO... |
aware_report.py | #take 3 days log,
#Print
# Self-Efficacy influences the choices we make, the efforts we put forth and how we feel.
# -somewhere on internet
# Keeping this as theme, I and Rahul have wrote a small software Aware. We hoped it would serve as a tool to help us calibrate our self-efficacy. We have been using if for someti... |
EKF_sonar_GPS.py | #!/usr/bin/env python3
import rospy as rp
import threading
import numpy as np
import math
from scipy.stats.distributions import chi2
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Imu
from std_msgs.msg import Float32
from watersampling_msgs.msg import EKFInfo
from watersampling_msgs.msg import SonarStam... |
daemon-mulproc.py | ###
# Daemon process for multi platform.
#
# License - MIT.
###
import os
import time
from multiprocessing import Process
# process_function1 - Process callback function.
def process_function1(param):
# {
i = 0
while True:
print('D: %d' % i)
i = i + 1
time.sleep(1)
# }
# process_f... |
test_errno.py | import unittest, os, errno, sys
from ctypes import *
from ctypes.util import find_library
from test import test_support
try:
import threading
except ImportError:
threading = None
class Test(unittest.TestCase):
@unittest.skipIf(sys.platform=='cli', "IronPython doen't support marshaling errno right now - htt... |
wallet.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Electron Cash - Bitcoin Cash thin client
# Copyright (C) 2017-2022 The Electron Cash Developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "... |
socket-server.py | import socket
import os
import signal
import threading
import hashlib
import fcntl
import struct
from Crypto import Random
import Crypto.Cipher.AES as AES
from Crypto.PublicKey import RSA
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
... |
RaspberryAgent.py | #!/usr/bin python
"""
/**
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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://ww... |
noTimeReference.py | import numpy as np
import matplotlib.pyplot as plt
from scipy import linalg
import math
import time
from threading import Thread
import pdb
import random
import copy
import re
"""
输入:车位宽度,车辆起始点,最小停车位宽度,车距离车位的最短距离和最长距离(这个可以根据具体车型事先计算好)
输出:计算避障点坐标,终止点坐标,以及每个控制点的航向角,避障点可以有多个:驶离车位时右前角,驶出车位时右后角;
根据控制点的约束条件,解线性方程... |
__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MIT License
# Copyright (c) 2020 Stɑrry Shivɑm // This file is part of nstcentertainmentbot
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICUL... |
start.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from contextlib import suppress
from itertools import cycle
from json import load
from math import trunc, log2
from os import urandom as randbytes
from pathlib import Path
from random import randint, choice as randchoice
from socket import (IP_HDRINCL, IPPROTO_IP, IPPROTO_... |
CThermal.py | #!/usr/bin/env python3
import argparse
import calendar
import io
import json
import os
import subprocess as sp
import sys
from decimal import Decimal
from math import exp, log, sqrt
from pathlib import Path
from threading import Thread
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
from PIL i... |
scanbackup_20210224150049.py | """
1、文件到这里
一份给ES 一份给自己
新增ES旧索引入库
在继承原有功能的基础上
重构备份程序,按照数据内的
国家-当前时间(年-月-日)
如果按照数据内的时间的话也会面临和按国家端口备份的问题
不用再分端口了
create by judy 20201217
"""
from pathlib import Path
import threading
import json
from queue import Queue
import traceback
import datetime
import time
from shutil import copyfile
import zipfile
import shutil
... |
bob.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
from PKC_Classes import NetworkUser, KDC
from DES import DES
from RSA_Class import RSA
import socket
import os
import sys
import threading
import time
if sys.version_info[0] < 3:
raise Exception("Must be using Python 3")
def reply_conn(conn, addr):
print('Accep... |
pwb.py | import sys, os, json, time
import settings
import threading
import numpy
from flask import Flask
from flask import request
from webworker import WebWorker
from excel import excel
from latexOutput import latexOutput
def createThreadObject():
# create thread objects for the current benchmark
i = 0
print(set... |
main.py | import urllib3, json, threading, requests
from urllib.request import Request, urlopen
import os, base64, sqlite3, win32crypt, shutil
from Crypto.Cipher import AES
from datetime import timezone, datetime, timedelta
import os.path, datetime, sys, time, glob, http.cookiejar, tempfile, lz4.block, configparser, keyring... |
m - request, threads.py | import requests
import threading
url = 'http://example.com'
data = {
'foo': 'a',
'bar': 'b',
'baz': 'c',
}
def make_request():
while True:
response = requests.post(url, data=data).text
print(response)
threads = []
for i in range(50):
t = threading.Thread(target=make_request)
t.daemon = True
threads.a... |
test.py | #
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
predict.py | import os
import pandas as pd
import numpy as np
from rdkit import Chem
from multiprocessing import Manager
from multiprocessing import Process
from multiprocessing import Queue
from openbabel import pybel
import subprocess
def ligand_preperation(smi, pH=7.4):
run_line = 'obabel -:%s -osmi --neutralize' % (smi)
... |
test_httplib.py | import errno
from http import client
import io
import itertools
import os
import array
import socket
import threading
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Sel... |
main.py | ''' Main script of the program '''
import logging
import sys
import threading
import tkinter as tk
import urllib3
from connection.league import LeagueConnection
from connection.riot import RiotConnection
from file import export_csv, import_csv
from macro import Macro
from macro.exceptions import (AuthenticationFailur... |
geemap.py | """Main module for interactive mapping using Google Earth Engine Python API and ipyleaflet.
Keep in mind that Earth Engine functions use both camel case and snake case, such as setOptions(), setCenter(), centerObject(), addLayer().
ipyleaflet functions use snake case, such as add_tile_layer(), add_wms_layer(), add_mi... |
supervised_popen.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2018, Fraunhofer FKIE/CMS, Alexander Tiderko
# 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 mu... |
Darktesv3.py | # -*- coding: utf-8 -*-
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
try:
import mechanize
except ImportError:
os.system('pip2 install mechanize')
else:
try:
import requests
except ImportEr... |
ThreadJoin.py | import threading
import time
import logging
def daemon():
logging.debug('Starting')
time.sleep(1)
logging.debug('Exiting')
def non_daemon():
logging.debug('Starting')
time.sleep(1)
logging.debug('Exiting')
logging.basicConfig(
level=logging.DEBUG,
format='(%(threadName)-10s) %(mess... |
test_execute.py | # pylint doesn't know about pytest fixtures
# pylint: disable=unused-argument
import os
from threading import Thread
import pytest
from dagster import (
CompositeSolidExecutionResult,
PipelineExecutionResult,
SolidExecutionResult,
execute_pipeline,
execute_pipeline_iterator,
seven,
)
from dags... |
vntq.py | # encoding: UTF-8
"""
对接天勤行情的网关接口,可以提供国内期货的报价/K线/Tick序列等数据的实时推送和历史仿真
使用时需要在本机先启动一个天勤终端进程
天勤行情终端: http://www.tq18.cn
"""
import json
import threading
import tornado
from tornado import websocket
from sortedcontainers import SortedDict
########################################################################
class T... |
pretrained.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... |
views.py | """Defines a number of routes/views for the flask app."""
from functools import wraps
import io
import os
import sys
import shutil
from tempfile import TemporaryDirectory, NamedTemporaryFile
import time
from typing import Callable, List, Tuple
import multiprocessing as mp
import zipfile
from flask import json, jsonif... |
assetlib.py | """
The asset loading system.
"""
import abc
import collections
import concurrent.futures
import logging
import queue
import sys
import threading
import weakref
import ppb.vfs as vfs
import ppb.events as events
from ppb.systemslib import System
__all__ = (
'AssetLoadingSystem',
'AbstractAsset', 'BackgroundMix... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
project_sync.py | #!/usr/bin/env python
import os
import sys
import json
import time
import datetime as dt
from logging import getLogger
import requests
from website.app import init_app
from website import settings
logger = getLogger(__name__)
CERT = settings.GAKUNIN_SP_CERT
KEY = settings.GAKUNIN_SP_KEY
HOST = settings.CLOUD_GATAW... |
sender.py | import os
import time
import json
import base64
from threading import Thread
from io import BytesIO
import re
import importlib
import requests
import pycurl
from vnpy.trader.app.ctaStrategy.plugins.ctaMetric.base import (
CtaMerticPlugin, CtaEngine as CtaEngineMetric)
from vnpy.trader.vtFunction import getJsonPat... |
test_rand_encscheme.py | """
File containing all tests regarding the RandomizedEncryptionScheme functionalities.
"""
from __future__ import annotations
import time
from pathlib import Path
from random import randint
from threading import Event, Thread
from typing import Any, Tuple, Type, Union
import pytest
from tno.mpc.encryption_schemes.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.