source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
okta.py | """
Copyright 2016-present Nike, 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 writing, softw... |
netease_music_db.py | # -*- coding: utf-8 -*-
# @Description: V2 netease spider
# @Author: gunjianpan
# @Date: 2018-10-21 11:00:24
# @Last Modified by: gunjianpan
# @Last Modified time: 2019-03-27 23:49:14
import codecs
import threading
from bs4 import BeautifulSoup
from proxy.getproxy import GetFreeProxy
from util.db import Db
from u... |
test_interrupt.py | import os
import time
from threading import Thread
import pytest
from dagster import (
DagsterEventType,
DagsterSubprocessError,
ExecutionTargetHandle,
Field,
ModeDefinition,
String,
execute_pipeline_iterator,
pipeline,
resource,
seven,
solid,
)
from dagster.core.instance i... |
update_server.py | from flask import Flask, jsonify, request, current_app
from functools import wraps
from werkzeug.routing import BaseConverter
from werkzeug.contrib.fixers import ProxyFix
import yaml
import re
import datetime
import logging
import os
import sys
import Queue
import threading
# Configuration and static variables
def op... |
client_handler.py | from threading import *
class ClientHandler(Thread):
def __init__(self, connection, address, function):
Thread.__init__(self)
self.connection = connection
self.address = address
self.function = function
self.handle()
def handle(self):
handler = Th... |
prankself.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
#from imgurpython import ImgurClient
import time, random, sys, re, os, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, tempfile, glob, shut... |
__init__.py | """
Entry Points for Hyde Engine
"""
import imp
import mimetypes
import os
import sys
import subprocess
import urllib
from collections import defaultdict
from Queue import Queue, Empty
from threading import Thread, Event
from django.conf import settings
from django.template import add_to_builtins
from file_system... |
PaperPad.py | import cv2
import numpy as np
import math
import sounddevice
import threading
import mousecontrol
# camera setup
camera = cv2.VideoCapture(0) # 0 for built-in webcam, 1 for external webcam
camera.set(10,200)
# variables
frame_size_l = False
points = []
uncovered_point = True
points_logged = False
TL = (0, 0)
TR = (0,... |
QCWY.py | __author__ = 'Joynice'
from utils.utils import get_header, get_time
import requests
import queue
from lxml import etree
import threading
import os
import csv
class QCWY(object):
'''
前程无忧
:param
传入参数:关键字、城市、线程数
传出:csv文件
'''
def __init__(self, keyword, city='北京', thread=10, path=os.getcwd()... |
gasPriceApi.py | import time
import sys
import json
import math
import traceback
import os
import pandas as pd
import numpy as np
from web3 import Web3, HTTPProvider
## newly added packages for api
import click
import logging
from threading import Thread
from sanic import Sanic, response
from retry import retry
web3 = Web3(HTTPProvide... |
utils.py | import asyncio
from asyncio import TimeoutError
import atexit
import click
from collections import deque, OrderedDict, UserDict
from concurrent.futures import ThreadPoolExecutor, CancelledError # noqa: F401
from contextlib import contextmanager
import functools
from hashlib import md5
import html
import json
import lo... |
main.py | import requests
import random
import threading
import names
import string
from termcolor import cprint
def do_request():
while True:
name = (names.get_full_name()).replace(" ", ".").lower()
print('Sent Message')
data={
'categories': "Games",
'keyword':"",
'blockedReason': "site",
... |
app.py | import datetime
import logging
import threading
import time
import traceback
from time import sleep
import textwrap
from typing import Dict, List, Tuple
PARTICIPANT = (True, False)
COORDINATOR = (False, True)
BOTH = (True, True)
STATE_RUNNING = 'running'
STATE_ERROR = 'error'
STATE_ACTION = 'action_required'
def... |
main.py | import traceback
import StellarPlayer
import importlib
import requests
import threading
import json
import time
import inspect
import os
import sys
from bs4 import BeautifulSoup as bs
from .sites import match
plugin_dir = os.path.dirname(__file__)
sys.path.append(plugin_dir) # for js2py
class MyPlugin(StellarPlaye... |
_util.py |
###################### GPU Manager ######################
# gpus = tf.config.experimental.list_physical_devices('GPU')
# if gpus:
# try:
# for gpu in gpus:
# tf.config.experimental.set_memory_growth(gpu, True)
# except RuntimeError as e:
# print(e)
######################
# !for i in... |
yycboost.py | # -*- coding: utf-8 -*-
import json
import os
import os.path
import signal
import sys
import time
import subprocess
import traceback
import atexit
import threading
import datetime
from subprocess import DEVNULL, CREATE_NO_WINDOW
from multiprocessing import (
Process, Queue, cpu_count, freeze_support, ... |
pyvisualize.py | #!/usr/bin/env python
'''
Author: John D. Anderson
Email: jander43@vols.utk.edu
Description:
This program allows for quick visuzalition of large
NetLogo BehaviorSpace data sets.
Attributions:
martineau, Wed Oct 05 2016, renegade, "Heat map from data
points in python", Mar 25, 2015 at 22:11.
http://... |
Binance Detect Moonings.py | """
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed as, a recommendation
or as a guarantee... |
_kit2fiff_gui.py | """Mayavi/traits GUI for converting data from KIT systems."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD-3-Clause
from collections import Counter
from contextlib import nullcontext
import os
import queue
import sys
from threading import Thread
import numpy as np
from mayavi.core.ui.m... |
control_panel_vista_win7.py | # Author : Pavel Vitis "blackdaemon"
# Email : blackdaemon@seznam.cz
#
# Copyright (c) 2010, Pavel Vitis <blackdaemon@seznam.cz>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistri... |
flask_helper.py | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import atexit
import logging
import socket
import threading
import time
import uuid
from flask import Flask
from gevent.pywsgi import WSGIServer
from .environment_detector import build_environment
from .environments.credentialed_vm_environment i... |
human_play.py | # -*- coding: utf-8 -*-
"""
human VS AI models
Input your move in the format: 2,3
@author: Junxiao Song
"""
from __future__ import print_function
from mytoolkit import print_time, load_config
import logging.config
# logging设置只能执行一次,要确保最先执行,在其它包含文件之前,否则包含文件会WARNING及以上才会记录。
logging.config.dictConfig(load_config('./conf... |
ddp.py | import calendar
import alsaaudio
import cStringIO
import os
import requests
import socket
import subprocess
from threading import Event, Thread
import time
import uuid
import gobject
from MeteorClient import MeteorClient
import pyscreenshot as ImageGrab
import galicaster
from galicaster.core import context
conf = c... |
worker_test.py | # Copyright (c) 2012 Spotify AB
#
# 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 writing, s... |
voltaware_connect.py | #!/usr/bin/env python3
from config import read_config
import typing as tp
import threading
import logging
import json
import time
import pika
import robonomicsinterface as RI
def callback(ch, method, properties, body) -> None:
"""
get data from sensors and save it to dictionary
"""
data = body.decod... |
eval_representative_cell.py | import os
import sys
import multiprocessing as mp
import numpy as np
import util
import util_batch
import util_meta
import util_feature_IO
import util_morphology
import util_amira
def getEmptyStatsSoma():
return {
"ids" : []
}
def findInnervating(batchIndex, results, preIds, networkDir, postId):
... |
server3.py | ################################################################################
#
# 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 limitation
# ... |
screens.py | import asyncio
from weakref import ref
from decimal import Decimal
import re
import threading
import traceback, sys
from typing import TYPE_CHECKING, List, Optional
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (Objec... |
_lib.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""Management of MPI worker processes."""
# pylint: disable=broad-except
# pylint: disable=too-many-lines
# pylint: disable=protected-access
# pylint: disable=missing-docstring
# pylint: disable=import-outside-toplevel
import os
import sys
import time
import atex... |
tpu_estimator.py | # Copyright 2017 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... |
pylocker.py | # -*- coding: utf-8 -*-
#qpy:console
#
"""
Created on Tue Dec 31 15:59:17 2013
@author: Kjetil Wormnes
The AES implementation used in this script is based on the code by Bo Zhu,
http://about.bozhu.me, the only changes are in the interface with it and
no credit is taken for its implementation, nor any responsability... |
run-spec-test.py | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py --spec=opam-1.1.1
# ./run-spec-test.py .spec-v1.1/core/i32.json
# ./run-spec-test.py .spec-v1.1/core/float_exprs.json --line 2070
# ./run-spec-test.py .spec-v1.1/proposals/tail-call/*.json
# ./run-spec-... |
dag_processing.py | # -*- coding: utf-8 -*-
#
# 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
#... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import _
from electrum.... |
AlembicSceneTest.py | ##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
import sock... |
mergepdf.py | #!/usr/bin/python
#
# @author rubienr 2/2016
#
from Tkinter import *
from Tkinter import IntVar
import tkFileDialog
import tkMessageBox
from os.path import expanduser
from os import path
from os import makedirs
import subprocess
import shelve
from Pdftk import Pdftk
from UpdateCheck import UpdateCheck
from threading im... |
main.py | import copy
import os
import os.path
import threading
from datetime import datetime, time
import globals
from load_config import load_config
from logger import logger
from new_listings_scraper import get_all_currencies, search_and_update
from store_order import load_order, store_order
from trade_client import get_las... |
Analyst.py | from multiprocessing import Process
from datetime import datetime
import pandas as pd
import numpy as np
import json
import uuid
import re
from buildAnalyst import buildAnalyst
packageVersion = "sakdas version 2.10.88"
class Analyst:
def __init__(self,df,df_name, *args, **kwargs):
self.df ... |
dataserver.py | #!/usr/bin/env python
"""
Author: David Wolinsky
Version: 0.03
Description:
The XmlRpc API for this library is:
get(base64 key)
Returns the value associated with the given key using a dictionary
or an empty dictionary if there is no matching key
Example usage:
rv = rpc.get(Binary("key"))
pr... |
local_server.py | from __future__ import print_function
# Borrowed wholesale from https://github.com/globus/globus-cli/
import logging
import os
import sys
import threading
from string import Template
from contextlib import contextmanager
import six
try:
import http.client as http_client
except ImportError:
import httplib as ... |
discordimpl.py | # coding: utf-8
# Simple module to send messages through a Discord WebHook
# post a message to discord api via a bot
# bot must be added to the server and have write access to the channel
import asyncio
from asyncio import Event
import re
import time
from threading import Thread
from typing import Optional, Tuple, Lis... |
recorder.py | import os
import time
import json
import operator
from threading import Thread
import numpy as np
import pyaudio
import datetime
import math
try:
import tflite_runtime.interpreter as tflite
except:
from tensorflow import lite as tflite
from config import config as cfg
from utils import audio
from utils impor... |
networksource.py | # Copyright 2014-2015 Whitewood Encryption Systems, 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 l... |
optimize_crystal_volume.py | """ Optimize the volume for the conducting ions
"""
import argparse
import logging
import math
import os
import random
import time
from collections import defaultdict
from pymatgen.analysis import local_env
from pymatgen.core import Structure
from rlmolecule.crystal import utils
from rlmolecule.crystal.builder impor... |
video_aggregation.py | import argparse
import asyncio
import logging
import queue
import threading
import time
from datetime import datetime
from io import BytesIO
import cv2
import numpy as np
from grpclib.client import Channel
import detection
import helper
import tracking
import cProfile
import pstats
class Ingestion():
def __ini... |
decorators.py | # coding=utf-8
import base64
import copy
import random
import uuid
from flask import request as flask_request
# noinspection PyUnresolvedReferences
from contextlib import contextmanager
import functools
import json
import os
import sys
import threading
import time
import traceback
import unittest
from functools import... |
search.py | from __future__ import print_function
from pypge import model
from pypge import expand
from pypge import filters
from pypge import algebra
from pypge import memoize
from pypge import evaluate
from pypge import fitness_funcs
from pypge import selection
from pypge import parallel
from pypge.timer import timewith
impor... |
tests.py | # Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import copy
import io
import os
import pickle
import re
import shutil
import tempfile
import threading
import time
import unittest
from unittest import mock
from django.conf import settings
from django.core import manageme... |
semgcn.py | from models import Model
from helper import *
import tensorflow as tf
from web.embedding import Embedding
from web.evaluate import evaluate_on_all
class SemGCN(Model):
def make_batch(self, shuffle = True):
"""
Generates batches and puts them in the queue
Parameters
----------
shuffle: Whether to shuffl... |
concurrency.py |
import time
import threading
from datetime import datetime
from assemblyline.common.timeout import timeout, TimeoutException
class SkipException(Exception):
pass
def execute_concurrently(execution_plan, calculate_timers=False, max_timeout=None):
"""
This is a semi-async execution of a given set of fu... |
backend.py | # Copyright 2020 Supun Nakandala, Yuhao Zhang, and Arun Kumar. All Rights Reserved.
# Copyright 2019 Uber Technologies, Inc. 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 ... |
webServer.py | #!/usr/bin/env/python
# File name : server.py
# Production : Upper Ctrl for Robots
# Author : WaveShare
import time
import threading
import os
import socket
import info
#websocket
import asyncio
import websockets
import json
import app
ipaddr_check = "192.168.4.1"
def ap_thread():
os.system("sudo create_ap... |
video_stream.py | """
Manager class for handling video stream. Modified code of the imutils
package, WebcamVideoStream class:
https://github.com/jrosebr1/imutils/blob/master/imutils/video/webcamvideostream.py
"""
from threading import Thread
import cv2 as cv
class StreamManager:
def __init__(self, src=0):
sel... |
iap_tunnel_websocket_helper.py | # -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. 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 requir... |
process.py | # -*- coding: utf-8 -*-
'''
Functions for daemonizing and otherwise modifying running processes
'''
# Import python libs
from __future__ import absolute_import, with_statement, print_function, unicode_literals
import copy
import os
import sys
import time
import errno
import types
import signal
import logging
import th... |
process_barrier.py | #Synchronize processes with barrier – Chapter 3: Process Based Parallelism
import multiprocessing
from multiprocessing import Barrier, Lock, Process
from time import time
from datetime import datetime
def test_with_barrier(synchronizer, serializer):
name = multiprocessing.current_process().name
synchronizer.... |
test_protocols.py | import time
import threading
import pytest
import pynng
from test._test_util import wait_pipe_len
# TODO: all sockets need timeouts
addr = 'tcp://127.0.0.1:13131'
def test_bus():
with pynng.Bus0(recv_timeout=100) as s0, \
pynng.Bus0(recv_timeout=100) as s1, \
pynng.Bus0(recv_timeout=... |
example_test.py | import re
import os
import socket
import BaseHTTPServer
import SimpleHTTPServer
from threading import Thread
import ssl
from tiny_test_fw import DUT
import ttfw_idf
import random
import subprocess
server_cert = "-----BEGIN CERTIFICATE-----\n" \
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCz... |
app.py | import threading
from logging.config import dictConfig
from timer.tasks.core import Manager, Task
from timer.scheduler.core import Manager as SchedManager
from flask import Flask
from flask import jsonify
task_manager = Manager()
sched_manager = SchedManager()
tasks = task_manager.get_tasks()
app = Flask(__name__)
... |
email.py | from flask_mail import Message
from flask import render_template
from threading import Thread
from app import mail, app
def send_password_reset_email(user):
token = user.get_reset_password_token()
send_email('[Microblog] Reset Your Password',
sender=app.config['ADMINS'][0],
recipi... |
data_manager.py | import time
from kivy.clock import Clock
from data_structures import AVLTree
from GUI.airport_marker import AirportMarker
from GUI.airplane_marker import AirplaneMarker
from kivy.app import App
from GUI.popups import show_loading_popup
from opensky_api import OpenSkyApi
import sqlite3
from threading import Thread
from... |
running.py | # -*- coding: utf-8 -*-
"""Code for maintaining the background process and for running
user programs
Commands get executed via shell, this way the command line in the
shell becomes kind of title for the execution.
"""
import os.path
import shlex
import tkinter as tk
import traceback
from logging import getLogger
... |
email.py | from flask import render_template, current_app
from flask_mail import Message
from flask_babel import _
from app import mail
from threading import Thread
import smtplib
import ssl
def send_async_email(current_app, msg):
with current_app.app_context():
mail.send(msg)
def send_mail(subject, sender, reci... |
eeg.py | # -*- coding: utf-8 -*-
"""
biosppy.signals.eeg
-------------------
This module provides methods to process Electroencephalographic (EEG)
signals.
:copyright: (c) 2015-2018 by Instituto de Telecomunicacoes
:license: BSD 3-clause, see LICENSE for more details.
"""
# Imports
# compat
from __future__ import absolute_im... |
main.py | import os, sys
from quads import main
from multiprocessing import Process
img_ext = ['.png', '.jpg', '.jpeg', '.bmp', '.tiff', '.webp']
def execute_main(dir, file):
os.chdir(dir)
main(file)
def do_quads(folder):
cur_dir = os.getcwd()
processes = []
for root, dirs, files in os.walk(fo... |
main.py | import argparse, sys, socket # Import all
from threading import Thread
import json
# We use threading, cuz multiprocessing is bad at passing arguments to targets
# also, we don`t need GIL unlocking.
VERSION = "v0.2"
class Client:
def __init__(self):
self.clients = set()
self... |
util.py | # -*- coding: utf-8 -*-
__all__ = [
"calc_checksum", "wget", "call_thread", "call_proc", "determine_xrd_redirector",
"parse_leaf_list", "get_tree_names", "get_trees", "copy_trees", "TreeExtender",
"TreeInFileExtender", "walk_categories", "format_shifts", "build_hist_envelope",
]
import os
import array
i... |
serializers.py | from rest_framework import serializers
from rest_framework.serializers import SerializerMethodField
from rest_framework.validators import UniqueValidator, UniqueTogetherValidator
from public.serializers import BaseModelSerializer
from rest_framework.utils import model_meta
from .models import *
import time
import datet... |
reporter.py | from airflow.models.baseoperator import BaseOperator
from airflow.models import Variable
from pymongo import MongoClient
import json
from datetime import datetime
from threading import Thread, Event
import time
breaker = Event()
def timeout_fn():
while True:
time.sleep(1)
if breaker.is_set():
... |
PyKinectBodyGame.py | from pykinect2 import PyKinectV2
from pykinect2.PyKinectV2 import *
# from pykinect2 import PyKinectRuntime
import ctypes
import _ctypes
import pygame
import sys
import numpy
if sys.hexversion >= 0x03000000:
import _thread as thread
else:
import thread
from pygame.locals import *
from pgu import gui
import... |
tcpClient.py | import socket
import os
import struct
import threading
import cv2
import numpy
import datetime
def get_time_now():
return datetime.datetime.now().strftime('%m-%d %H:%M:%S')
class TcpClient:
# 每个摄像头处理线程都独享一个tcp连接
def __init__(self, server_ip, server_port, camera_id, room_id):
self.tcp_server_ip =... |
eventbus_test.py | import logging
import json
import time
import asyncio
import threading
import pytest
from vertx import EventBusAsync, EventBusPayload
API_VERSION = 1.1
PORT = 8765
HOST = '127.0.0.1'
LOGGER = logging.getLogger(__name__)
class MockServer:
def __init__(self):
self.loop = asyncio.get_event_loop()
def... |
hardware.py | import os
import glob
import time
import timeit
import threading
class HdwInterface: # pragma: no cover
""" Only a common hardware interface """
def __init__(self):
pass
def read_temp(self):
raise NotImplementedError()
def set_heater_output(self, val: bool):
raise NotImpleme... |
task_manager.py | # coding=utf-8
# Progetto: Selfie-O-Matic
from threading import Thread
import time
__author__ = "Fabrizio Guglielmino"
class TaskManager(object):
__tasks = []
__async_tasks = []
SCHEDULE_DELAY = 60 # Periodicita' in sec tra un esecuzione schedulata e la successiva
__scheduled_tasks = []
__wo... |
logging_test.py | # Copyright 2017 The Abseil Authors.
#
# 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 ... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
proc.py | # Subprocess containers
"""
A mechanism to run subprocesses asynchronously and with non-blocking read.
"""
import atexit
import multiprocessing
import Queue
import shlex
import subprocess
import sys
import threading
import time
class WrapException(Exception):
def __init__(self, exc, msg):
"""
Assumes being crea... |
deploy.py | """
采集服务的定时任务管理模块
"""
__all__ = ["TasksScheduler", "CollectorScheduler", "CollaboratorScheduler"]
import ast
import math
import os
import threading
import time
from datetime import datetime, timedelta
from uuid import uuid4
import gevent
from apscheduler.events import (
EVENT_JOB_SUBMITTED,
EVENT_JOB_MAX_INST... |
vias.py | # -*- coding: utf-8 -*-
"""Process tasks in several modes."""
import logging
from ..config import options
LOGGER = logging.getLogger(__name__)
# pylint: disable=broad-except
def serial(named_tasks, arg):
"""Use serial calls."""
results = {}
for name, task in named_tasks:
try:
result... |
gnupg.py | """ A wrapper for the 'gpg' command::
Portions of this module are derived from A.M. Kuchling's well-designed
GPG.py, using Richard Jones' updated version 1.3, which can be found
in the pycrypto CVS repository on Sourceforge:
http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py
This module is *not* forward-... |
make_ucf101.py | import argparse
import os
from multiprocessing import Pool
from multiprocessing import Process
from multiprocessing import Queue
import cv2
import h5py
import imageio
import numpy
import pandas
from tqdm import tqdm
def process_video(in_queue, out_queue):
while True:
ret = in_queue.get()
if ret i... |
test_cuda.py | # Owner(s): ["module: cuda"]
from itertools import repeat, chain, product
from typing import NamedTuple
import collections
import contextlib
import ctypes
import gc
import io
import pickle
import queue
import sys
import tempfile
import threading
import unittest
import torch
import torch.cuda
import torch.cuda.comm as... |
vnrpc.py | # encoding: UTF-8
import threading
import traceback
import signal
import zmq
from msgpack import packb, unpackb
from json import dumps, loads
try:
import pickle as pickle
except:
# 对 python3 的支持
import pickle
pDumps = pickle.dumps
pLoads = pickle.loads
# 实现Ctrl-c中断recv
signal.signal(signal.SIGINT, sign... |
swarm.py | # Adapted from boids implementation by Stephen Chappell
# Accessed on 11/20/2012 at http://code.activestate.com/recipes/502240/
# Which was in turn motivated by the following pseudocode:
# http://www.vergenet.net/~conrad/boids/pseudocode.html
# Note: OSC messages (incoming and outgoing) are
# normalized to the r... |
bot.py | # -*- coding: utf-8 -*-
# AIOGRAM
import aiogram.utils.markdown as md
from aiogram import Bot, Dispatcher, types, filters
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Text
from aiogram.utils.exceptions import Throttled
fro... |
bot.py | import telebot
import datetime
import requests
import random
from threading import Thread
bot = telebot.TeleBot('токен бота')
aid = ID админа
#начало диалога
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, 'Привет, ' + str(message.from_user.first_name) + '!' + '\... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
collectData.py | # -*- coding: utf-8 -*-
"""
@author: stoberblog
@detail: This is the main script for the Fronius
MODbus project. It calls the read functions,
and then sends them to a database
@created: Thurs 16th Feburary 2017
@modified: Saturday 25th Fe... |
Applet.py | import threading
import loadConfig
from tkinter import *
from UDP import UDPProtocol
def callback(frame):
return frame
name = "Alice"
#name = "Bob"
def app_pack(message):
message = name+": "+message
return message
def app_repack(message):
return message
def send():
message = str(enterBox.get()) # 从调试窗口获取... |
helpers.py | # -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
nvpmodel.py | # -*- coding: UTF-8 -*-
# This file is part of the jetson_stats package (https://github.com/rbonghi/jetson_stats or http://rnext.it).
# Copyright (c) 2019 Raffaello Bonghi.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published... |
test_nnf.py | import copy
import pathlib
import pickle
import platform
import shutil
import threading
import types
import typing as t
import pytest
from hypothesis import (assume, event, given, strategies as st, settings,
HealthCheck)
import nnf
from nnf import (Var, And, Or, amc, dimacs, dsharp, operator... |
smtio.py | #
# yosys -- Yosys Open SYnthesis Suite
#
# Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
#
# 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 notice and this permission notice appear in all copies.
#... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
ssl = support.import_... |
module.py | '''
Harness Toolset
Copyright (c) 2015 Rich Kelley
Contact:
@RGKelley5
RK5DEVMAIL[A T]gmail[D O T]com
www.frogstarworldc.com
License: MIT
'''
import threading
import builtins
import sys
from random import randint
from harness.core import framework
from harness.core import threads
from collect... |
__main__.py | #!/usr/bin/env python
from __future__ import print_function
import sys
from time import sleep
from threading import Thread
from getopt import getopt, GetoptError
from .ui import ui
from .api import Server
from .ui import term_wh
from .color import colors
from .banner import bannerize
USAGE = """\
Usage %s [-h|--hel... |
kb_ea_utilsServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
traffic_util.py | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
node_client.py | import os
import subprocess
import threading
import time
import json
import sublime
import sublime_plugin
import time
from .logger import log
from . import json_helpers
from . import global_vars
# queue module name changed from Python 2 to 3
if int(sublime.version()) < 3000:
import Queue as queue
else:
import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.