source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
botline.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from gtts import gTTS
import time, random, sys, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, urllib2, wikipedia,tempfile,glob,shutil,unicod... |
xla_client_test.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... |
test_schieber_env.py | import sys
import time
import logging
from multiprocessing import Process
import gym
import gym_jass
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
def test_run_once():
run_one_episode()
def test_run_twice():
run_one_episode()
time.sleep(1)
run_one_episode()
def test_run_with_process... |
DEM_run_all_benchmarks_grid.py | import os
import subprocess
import sys
import multiprocessing as mp
import queue
from threading import Thread
import threading
from glob import glob
import shutil
import KratosMultiphysics.kratos_utilities as kratos_utils
from KratosMultiphysics.testing.utilities import GetPython3Command
kratos_benchmarking_path = os... |
miniterm.py | #!C:\MicroPythonProjects\ch2\pyboard_d\Threads\venv\Scripts\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading... |
server.py | import rpyc
from rpyc.utils.server import ThreadedServer
import time
import threading
class Web8Service(rpyc.Service):
def exposed_get_page(self, gtk, content, page):
self.gtk = gtk
self.content = content
page = page.replace(" ", "_").lower()
pagefunc = getattr(self, "page_%s" % (p... |
deploy.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import datetime, time
from http.server import HTTPServer, BaseHTTPRequestHandler
import io, shutil , urllib, cgi
import os, sys, pexpect, threading
#
#----------------------------------------------------------------------------------------------------------------------... |
service.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import random
import threading
import timeunit
import requests
import time
import math
import signal
import subprocess
from .killer import *
PD_TREND_API = "http://{host}:{port}/pd/api/v1/trend"
# FIXME 可配置化
FETCH_INTERVAL = 100 # ms
KILL_INTERVAL = 500 ... |
ninja_scons_daemon.py | #!/usr/bin/env python3
#
# MIT License
#
# Copyright The SCons Foundation
#
# 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 the rights to u... |
server.py | #!/usr/bin/env python3
import socket
import threading
from protocolo import Protocolo
from utills import *
class Servidor:
def __init__(self,host='localhost',port=50000,n=None,ip=None,estado=None):
if not estado:
self.tokens=[ True for _ in range(n)]
self.ip=[]
else:
... |
bazin_sem_mediana.py | #!/usr/bin/env python3
# A idéia é calcular o ranking (Bazin) das ações analisando os dados fundamentalistas de todas as empresas da bolsa B3
# Para a análise, são utilizados princípios do Décio Bazin
# Ele é autor do livro: "Faça Fortuna Com Ações", que é tido como literatura indicada
# por Luis Barsi, o maior inves... |
run_crystfel_HH.py | #
# Copyright (c) European Molecular Biology Laboratory (EMBL)
#
# 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 the rights to
# use, copy, m... |
email.py | from flask import render_template
from flask_mail import Message
from app import mail, app
from flask_babel import _
from threading import Thread
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipients=recipients)
msg.body = text_body
msg.html = h... |
test_daemon_factory.py | import functools
import logging
import pprint
import re
import sys
import time
import attr
import psutil
import pytest
from saltfactories.bases import Daemon
from saltfactories.exceptions import FactoryNotRunning
from saltfactories.exceptions import FactoryNotStarted
from saltfactories.utils import platform
from salt... |
database.py | # -*- coding: UTF-8 -*-
"""
This is a class to deal with all the variables in the system.
Main features needed:
- multithread safe
- a thread can wait until a variable changes his value
- contains value and time at witch was the last change
Every variable has properties:
name: string that identify the vari... |
printy-threads.py | import threading
import time
import tkinter
from tkinter import ttk
# in a real program it's best to use after callbacks instead of
# sleeping in a thread, this is just an example
def blocking_function():
print("blocking function starts")
time.sleep(1)
print("blocking function ends")
def start_new_threa... |
box.py | # Copyright 2018 Gabriel Lasaro
#
# 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... |
rebalancein.py | import time, os
from threading import Thread
import threading
from basetestcase import BaseTestCase
from rebalance.rebalance_base import RebalanceBaseTest
from membase.api.exception import RebalanceFailedException
from membase.api.rest_client import RestConnection, RestHelper
from couchbase_helper.documentgenerator im... |
worker.py | import threading as th
from ipywidgets_runner.utils import dprint
class Worker:
def __init__(self, supervisor):
self.supervisor = supervisor
self.consumer_thread = th.Thread(target=self.consume)
self.consumer_thread.start()
self.stale = False
def interrupt... |
server3.py | from random import normalvariate, random
from datetime import timedelta, datetime
import csv
import dateutil.parser
import os.path
import operator
import json
import re
import threading
#from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import http.server
from socketserver import Threa... |
program_v2.py | import numpy as np
import cv2
import threading
import time
def kamera0():
temp = False
while True:
try:
cap0 = cv2.VideoCapture("USB/VID_05A3&PID_9210&MI_00")
except:
pass
while cap0.isOpened():
ret0 , frame = cap0.read()
if ret0==False:
... |
command.py | import signal
import subprocess
import sys
import threading
import time
from collections import deque
from datetime import timedelta
from os import close, getpgid, getpid
import discordify.utils as utils
import discordify.exit_codes as codes
from discordify.mode import Mode
from discordify.data import Data
from discor... |
serial_connection.py | import serial
from thonny.plugins.micropython.connection import MicroPythonConnection, ConnectionFailedException
import threading
import time
from serial.serialutil import SerialException
import logging
import platform
from textwrap import dedent
class SerialConnection(MicroPythonConnection):
def __init__(self, p... |
cache_server.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import http.server
import os
import re
import socketserver
from contextlib import contextmanager
from multiprocessing import Process, Queue
from pants.util.contextutil import pushd, tempo... |
fusion_particle.py | # coding: utf-8
# Copyright (c) 2017-present, Facebook, 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 applica... |
neurogpu_multistim_evaluator_par.py | import os
#os.environ['OPENBLAS_NUM_THREADS'] = '1'
import numpy as np
import os
import subprocess
import shutil
import bluepyopt as bpop
import struct
import time
import pandas as pd
import efel_ext
import time
import glob
import ctypes
import matplotlib.pyplot as plt
import bluepyopt.deapext.algorithms as algo
from ... |
test_socket.py | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... |
bench_multigpu_sage.py | from types import SimpleNamespace
from typing import NamedTuple
import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
import dgl.nn.pytorch as dglnn
import time
import math
import argparse
from torch.nn.paral... |
record-video copy.py | import time, cv2, sys, os
from threading import Thread
from djitellopy import Tello
video_file="phone_test.avi"
path= "C:/Users/65965/Desktop/School/FYPS2"
path_to_weights= f"{path}/yolov5/weights/v8best.pt"
def videoRecorder():
height, width, _ = frame_read.frame.shape
video = cv2.VideoWriter( f'{path}\DJI... |
CasesSolver_cropfromMap.py | import os
import cv2
import sys
import time
import yaml
import random
import signal
import argparse
import itertools
import subprocess
import numpy as np
import matplotlib.cm as cm
import drawSvg as draw
import scipy.io as sio
from PIL import Image
from multiprocessing import Queue, Pool, Lock, Manager, Process
from o... |
command_cli.py | import getpass
import configparser
import logging
import os
import sys
import time
from os.path import join, expanduser
import traceback
import threading
import urllib
import urllib.request
import urllib.parse
# TODO implement progress bar
#from progressbar import ReverseBar, Percentage, ETA, RotatingMarker, Timer, Pr... |
testpopup.py | from kivy.app import App
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.clock import Clock, mainthread
from kivy.clock import Clock
import t... |
notify_selector_test.py | # Copyright (c) 2020 AllSeeingEyeTolledEweSew
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERC... |
SimpleServer.py | import socket
import threading
class SimpleServer:
def __init__(self,host,port):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(None)
self.client_sockets = []
def initialise(self):
try:
self.sock.bind((self.host, s... |
test_contextvars.py | import random
import time
import pytest
import gevent
from sentry_sdk.utils import _is_threading_local_monkey_patched
def try_gevent_patch_all():
try:
gevent.monkey.patch_all()
except Exception as e:
if "_RLock__owner" in str(e):
pytest.skip("https://github.com/gevent/gevent/iss... |
app_reveal.py | # -*- coding: utf-8 -*-
"""
In this example, we want to show you how you can take isolated blocks of code
(featuring different kinds of Bokeh visualizations) and rearrange them in a
bigger (encompassing) flask-based application without losing the independence
of each example. This is the reason of some weirdness throug... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import unittest
import subprocess
import textwrap
from test import support
# This little helper class is essential for testing pdb under doctest.
from test.test_doctest import _FakeInput
class P... |
ffplay.py | import logging
import subprocess
import threading
from platypush.plugins.camera.model.writer.image import MJPEGStreamWriter
from platypush.plugins.camera.model.writer.preview import PreviewWriter
class FFplayPreviewWriter(PreviewWriter, MJPEGStreamWriter):
"""
General class for managing previews from camera ... |
threaded_crawler.py | import re
import socket
import threading
import time
from urllib import robotparser
from urllib.parse import urljoin, urlparse
from chp3.downloader import Downloader
SLEEP_TIME = 1
socket.setdefaulttimeout(60)
def get_robots_parser(robots_url):
" Return the robots parser object using the robots_url "
try:
... |
run_nvmf.py | #!/usr/bin/env python3
import os
import re
import sys
import json
import paramiko
import zipfile
import threading
import subprocess
import itertools
import time
import uuid
import rpc
import rpc.client
import pandas as pd
from collections import OrderedDict
from common import *
class Server:
def __init__(self, n... |
helpers.py | """
: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
"""
import base64
import builtins
import errno
import fnmatch
import functools
import insp... |
handlers.py | # Copyright (C) 2013 Google Inc.
# 2017 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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 op... |
udpSocket.py | #!/usr/bin/env python3
# Copyright 2019 Nina Marie Wahl and Charlotte Heggem.
# Copyright 2019 Norwegian University of Science and Technology.
#
# 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
... |
sfc_onos.py | import os
import re
import time
import json
import requests
from multiprocessing import Process
from multiprocessing import Queue
from pexpect import pxssh
import functest.utils.functest_logger as ft_logger
OK = 200
CREATED = 201
ACCEPTED = 202
NO_CONTENT = 204
class SfcOnos:
"""Defines all the def function o... |
paqufeiyang.py | import requests
from lxml import etree
import json
import time
import threading
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.62 Safari/537.36"
}
News_set = set()
#单线程版,获取网易新闻里面新冠肺炎的实时数据
def getData():
url = "https://wp.m.163.com/163... |
inference_request.py | import grpc
import time
import json
import sys
from arch.api.proto import inference_service_pb2
from arch.api.proto import inference_service_pb2_grpc
import threading
def run(address):
ths = []
with grpc.insecure_channel(address) as channel:
for i in range(1):
th = threading.Thread(target=... |
client.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
import os
import select
import socket
import threading
import warnings
from .. import log
from ..extern.six.moves.urllib.parse impor... |
crawl_moretickets.py | # -*- coding:utf-8 -*-
from bs4 import BeautifulSoup
import urllib.request
import urllib.parse
import urllib.error
import urllib
import http.cookiejar
import re
import sys
import string
import threading
import queue
import os
import re
import pickle
import time
import json
from pymysql import *
from pymongo import *
fr... |
CoLAB_sendLocation.py | """This module is used to receive the location data from the UWB tags, process the data and publish the processed data on the MQTT network on a separate thread"""
import paho.mqtt.publish as publish
from statistics import mean
import threading
import serial
import math
import time
import json
import CoLAB_c... |
HiwinRA605_socket_ros_20190604112003.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
football_env_test.py | # coding=utf-8
# Copyright 2019 Google LLC
# 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 ... |
service.py | import io
import os
import shutil
import subprocess
import uuid
import threading
import wave
import librosa
import numpy as np
try:
import torch
import torch.nn.functional as F
except ImportError:
pass
try:
import onnx
import onnx_caffe2.backend
except ImportError:
pass
from utils.manage_audio... |
dhcp.py | #!/usr/bin/python3
import time
import threading
import queue
import collections
import traceback
import socket
from random import randrange
import uuid
from .listener import *
"""
This class contains specified attributes which will be populated, these attributes are associated with
the required options for our DHCP+PX... |
__init__.py | """
A library of various helpers functions and classes
"""
import inspect
import sys
import socket
import logging
import threading
import time
import random
from pyaedt.third_party.ironpython.rpyc_27.lib.compat import maxint # noqa: F401
class MissingModule(object):
__slots__ = ["__name"]
def __init__(self,... |
tasks.py | #!/usr/bin/env python
# -*- python -*-
import atexit
import base64
import glob
import gzip
import hashlib
import io
import mmap
import optparse
import os
import re
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import threading
import time
import traceback
import urllib.error
imp... |
audioplayer.py | from loguru import logger
import time
import os
import ffmpeg
import sounddevice as sd
import soundfile as sf
import multiprocessing
import queue
import numpy as np
class AudioPlayer:
def __init__(self):
self._process = None
self._volume = 0.5
def play_file(self, file):
if self._process:
self.stop()
... |
ethscanner.py | #!encoding:utf8
"""
author: yqq
date : 2019-05-01
description: 以太坊区块监测程序, 获取交易交易所用户地址的充币信息
"""
import sys
if sys.version_info < (3, 0):
print("please use python3")
raise Exception("please use python3 !!")
import sys
import traceback
from ethproxy import EthProxy
import json
import sql
import time
from t... |
test_output.py | import subprocess
import sys
import pytest
import re
import signal
import time
import os
import ray
from ray._private.test_utils import (
run_string_as_driver_nonblocking,
run_string_as_driver,
)
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
def test_spill_logs():
script = "... |
n1ql_fts_integration_phase2.py | from tuq import QueryTests
from membase.api.exception import CBQError
from lib.membase.api.rest_client import RestConnection
from pytests.fts.fts_base import CouchbaseCluster
from remote.remote_util import RemoteMachineShellConnection
import json
from pytests.security.rbac_base import RbacBase
from lib.remote.remote_ut... |
cartpole_ac_comparison.py | """
This Experiment runs Sarsa-λ A2C versus Sarsa-λ Value based learning.
All parameters on the Value Function Approximator are the same,
but Value based learning uses epsilon-greedy and A2C uses a policy approximator NN using the A2C loss function
"""
def run_a2c_experiment(entropy_reg, run: int):
... |
logsetup.py | """
Convenience logging setup
"""
import faulthandler
import logging
import os
import signal
import sys
import threading
import time
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler
from typing import List, Optional
from runez.ascii import AsciiAnimation
from runez.convert import to_bytesize... |
_v5_proc_txtreader.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# COPYRIGHT (C) 2014-2020 Mitsuo KONDOU.
# This software is released under the MIT License.
# https://github.com/konsan1101
# Thank you for keeping the rules.
import sys
import os
import time
import datetime
import codecs
import glob
import queue
impo... |
vmtop.py | #!/usr/bin/python3
# TODO:
# - system-wide metrics
# - /sys/devices/system/node/nodeX/numastat
# - can we get guest throttling data (for live migration) ?
# - user-controlled list metrics to show, the list is getting large
# - vmexit rate + reasons
# - arbitrary groups of processes metrics (kernel threads,
# ... |
test_submit_handlers.py | # Copyright 2017 Intel Corporation
#
# 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 wri... |
test_dp_with_orc8r.py | """
Copyright 2022 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... |
tcpSocket.py | #!/usr/bin/env python3
# Copyright 2019 Nina Marie Wahl and Charlotte Heggem.
# Copyright 2019 Norwegian University of Science and Technology.
#
# 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... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
import logging
import re
import requests
from requests.exceptions import Timeout... |
detector.py | #!/usr/bin/env python3
import ccxt
from configparser import ConfigParser
import json
import os
import pickle
import redis
import socket
import tempfile
import time
import threading
import zlib
import numpy as np
import talib.abstract as ta
from pandas import DataFrame, Series
from requests_futures.sessions import Futu... |
nntest.py | import tensorflow as tf
from utils.nn import linearND, linear
from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph, smiles2graph_test, bond_types
from models import *
import math, sys, random
from optparse import OptionParser
import threading
from multiprocessing import Queue
import rdkit
fr... |
Pose_recv.py | #
# Created on Wed Sep 22 2021
# Author: Owen Yip
# Mail: me@owenyip.com
#
# Socket number:
# RpLidar is 5450, IMU is 5451, Driver is 5452
#
import os,sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
import thre... |
s3booster-upload-dir.py | #!/bin/env python3
'''
** Chaveat: not suitable for millions of files, it shows slow performance to get object list
ChangeLogs
- 2021.08.03:
- support multiprocessing(spawn)
- fixing windows path delimeter (\)
- support compatibility of file name between MAC and Windows
- 2021.08.02:
- adding logger
- fixin... |
populate_sql.py | import multiprocessing
import uuid,secrets,string,datetime,psycopg2
from psycopg2.pool import ThreadedConnectionPool
from multiprocessing import Pool
import time
def random_str(N):
return ''.join(secrets.choice(string.ascii_uppercase + string.digits) for i in range(N))
count_insert=0
# just give evenly divida... |
context.py | # Ravestate context class
from threading import Thread, RLock, Event
from typing import Optional, Any, Tuple, Set, Dict, Iterable, List, Generator
from collections import defaultdict
from math import ceil
from copy import deepcopy
import gc
import importlib
from ravestate.wrappers import PropertyWrapper
from ravestat... |
core.py | """
Shared code for builders.
For developers implementing a new builder,
you should inherit from :class:`Builder`.
"""
__author__ = 'Dan Gunter <dkgunter@lbl.gov>'
__date__ = '5/29/13'
## Imports
# system
from abc import ABCMeta, abstractmethod
import copy
import logging
import multiprocessing
import Queue
import tr... |
client.py | import datetime
import hashlib
import pickle
import threading
import urllib.parse
import logging
from typing import Union, Optional
import requests
import simplejson as json
from django.core.cache import cache
from django.core.management.base import OutputWrapper
from django.db import connections
from django.db.models... |
api_test.py | import datetime
import json
import os
import re
import shutil
import socket
import sys
import tempfile
import threading
import time
import io
import docker
import requests
from requests.packages import urllib3
import six
from .. import base
from . import fake_api
import pytest
try:
from unittest import mock
exc... |
ssh.py | from __future__ import absolute_import
import inspect
import logging
import os
import re
import shutil
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from pwnlib import term
from pwnlib.context import context
from pwnlib.log import Logger
from pwnlib.log import getLo... |
build.py | ## @file
# build a platform or a module
#
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
... |
measurePerformance.py | # ########################################################################
# Copyright 2013 Advanced Micro Devices, 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.apach... |
results_watcher.py | #!/usr/bin/python3
'''
* Copyright (C) 2019-2020 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
'''
import json
import time
import socket
from threading import Thread, Event
from abc import ABC, abstractmethod
from kafka import KafkaConsumer, TopicPartition
import paho.mqtt.client as mqtt
WATCHER_POLL_... |
server-chat.py | import socket
import sys
import argparse
import threading
address = "127.0.0.1"
port = 4444
username = "Me"
clientname = "Received"
def recv_data(conn):
while True:
try:
data=conn.recv(1024)
print(f"\n{clientname}: {data.decode()}\n{username}: ", end="")
exce... |
server.py | import socket
from threading import Thread
from lesson11n203.states.out import OutState
from lesson11n203_projects.house2.data.const import OUT
from lesson11n203_projects.house2.data.state_gen import house2_state_gen
class Server:
def __init__(self, transition_doc, host="0.0.0.0", port=5002, message_size=1024):
... |
cli.py | # encoding: utf-8
import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import itertools
import json
import logging
import urlparse
from optparse import OptionConflictError
import sqlalchemy as sa
import routes
import paste.script
from past... |
ledstrip.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Raspiled - LED strip light control from Raspberry Pi!
SM5050 (tricolour LED chips) wavelengths:
Red = 625nm
Green = 523nm
Blue = 468nm
@author: Dr Mike Brooks
"""
from __future__ import unicode_literals
from named_colours import NA... |
FrightenDevice.py | from __future__ import unicode_literals
import struct
import threading
from time import gmtime, sleep
from time import strftime
from tkinter import messagebox
import functools
import yaml
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from matplotlib.font_manager... |
base_camera.py | import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a ne... |
executor.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2014 Yahoo! 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 at
#
# ... |
dataloader_webcam_new.py | import os
import torch
from torch.autograd import Variable
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image, ImageDraw
from SPPE.src.utils.img import load_image, cropBox, im_to_torch
from opt import opt
from yolo.preprocess import prep_image, prep_frame, inp_to_image
fro... |
omsagent.py | #!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft Corporation
#
# 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.... |
optimization_checks.py | # Copyright 2019 WebPageTest LLC.
# Copyright 2017 Google Inc.
# Use of this source code is governed by the Apache 2.0 license that can be
# found in the LICENSE file.
"""Run the various optimization checks"""
import binascii
import gzip
import logging
import multiprocessing
import os
import re
import shutil
import str... |
audio_module.py | import logging
import threading
from collections import Collection
from time import sleep
import numpy as np
import soundcard as sc
from multipledispatch import dispatch
from datastructs.assignment import Assignment
from datastructs.speech_data import SpeechData
from dialogue_state import DialogueState
from modules.m... |
consumer.py | # Copyright 2014-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
test_base_events.py | """Tests for base_events.py"""
import errno
import logging
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from asyncio import events
from test.test_asyncio import utils a... |
fake_swarming.py | # Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import BaseHTTPServer
import json
import logging
import os
import SocketServer
import sys
import threading
BOT_DIR = os.path.dirname(os.path.absp... |
wrappers.py | # Copyright 2019 The PlaNet 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 applicable... |
send.py | import asyncio
import atexit
from queue import Queue
from datetime import datetime
from asyncio import CancelledError
from concurrent.futures.thread import ThreadPoolExecutor
from threading import Thread, current_thread
from time import time
__all__ = ('ThreadSender',)
from typing import List
import httpx
class Th... |
debuggee.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import atexit
import os
import struct
import subprocess
import sys
impo... |
iCallSV_dmp_wrapper.py | """
iCallSV_dmp_wrapper
~~~~~~~~~~~~~~~~~~~
:Description: iCallSV is a wrapper to run the iCallSV package on MSKCC data
:author: Ronak H Shah
:copyright: (c) 2015-2016 by Ronak H Shah for Memorial Sloan Kettering Cancer Center. All rights reserved.
:license: Apache License 2.0
:contact: rons.shah@gmail.com
... |
microdot.py | try:
from sys import print_exception
except ImportError: # pragma: no cover
import traceback
def print_exception(exc):
traceback.print_exc()
concurrency_mode = 'threaded'
try: # pragma: no cover
import threading
def create_thread(f, *args, **kwargs):
"""Use the threading module... |
main.py | import os
import time
import tkinter as tk
from threading import Thread
from tkinter import Menu
from tkinter.filedialog import askopenfilename, asksaveasfilename
from kwordslist import kwlist
from win10toast import ToastNotifier
# TODO create auto-save function (DONE)
# TODO create notifier function (DONE)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.