source
stringlengths
3
86
python
stringlengths
75
1.04M
source code.py
# -*- coding: utf-8 -*- #coding:utf8 import datetime import threading; from tkinter.filedialog import * from tkinter.messagebox import * import xlrd; from docx import Document from xlrd import open_workbook from xlutils.copy import copy # -------------------------------File Names if getattr (sys, 'frozen', False): ...
fservwithconcatlen.py
import os,socket,threading,sys,ast, queue from pathlib import Path #import pickle MAX_MSG = 1024 START_PORT = 7777 MAX_SERVS = 3 Q = queue.Queue() localfilelist = [] class bcolors: HEADER = '\033[95m'#PURPLE OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m'#YELLOW FAIL = '\033[91m'#R...
real_functions.py
from __future__ import print_function from builtins import object import numpy from multiprocessing import Process, Queue import keras from keras import backend as K from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten...
trex_subscriber.py
#!/router/bin/python import json import threading import time import datetime import zmq import re import random import os import signal import traceback import sys from .trex_types import RC_OK, RC_ERR #from .trex_stats import * from ..utils.text_opts import format_num from ..utils.zipmsg import ZippedMsg # basic...
watch_test_queued.py
import gimpbbio.gpio as gpio import time import datetime import threading import queue # The queued approach seems to capture slightly more events at low rates, # but gets capped somewhere around 3.5k events per second. It might be # more worthwhile for slower writing operations (like remote HTTP). count = 0 data_fil...
server.py
import socket import selectors import types import os import sys import imp import json import logging from urllib.parse import splitnport as parse_addr from threading import Thread from thinrpc.message import RpcMessage from thinrpc.client import RpcRemote from thinrpc import logger, RECV_SIZE, ENC, OK ############...
generic.py
import pandas as pd import numpy as np import multiprocessing as mp import pyteomics.mass from ..constants import MAX_ION, ION_TYPES, MAX_FRAG_CHARGE from .. import utils aa_comp = dict(pyteomics.mass.std_aa_comp) aa_comp["o"] = pyteomics.mass.Composition({"O": 1}) translate2spectronaut = {"C": "C[Carbamidomethyl (C...
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...
mount_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import fuse import mock import os import six import stat import tempfile import threading import time from girder.cli import mount from girder.constants import SettingKey from girder.exceptions import ValidationException from girder.models.file import File...
VOCDataset.py
# ---------------------------------------- # Written by Yude Wang # ---------------------------------------- from __future__ import print_function, division import os import torch import pandas as pd import cv2 import multiprocessing from skimage import io from PIL import Image import numpy as np from torch.utils.data...
__init__.py
import os import sys from rich import print as pprint from rich.table import Table from rich import box from jina.helper import get_rich_console def _get_run_args(print_args: bool = True): from jina.parsers import get_main_parser console = get_rich_console() silent_print = {'help', 'hub'} parser =...
test_fx.py
# Owner(s): ["oncall: fx"] import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest from math import sqrt from torch.multiprocessin...
app.py
import json,requests,telegram,logging,re,os,threading from flask import Flask, jsonify, request from modules.books import Books from modules.kings import Kingstone from modules.taaze import Taaze from modules.mugi import Mugi from modules.chat import getResponseText from modules.hentai import Hentai from modules.av imp...
spawn.py
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
ServiceSocketSample.py
import socket import threading from functools import partial, lru_cache server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(("0.0.0.0", 8001)) server.listen() def handle_connect_socket(sock, addr): # 获取从客户端发送的数据 # 一次获取1k的数据 size = 1024 while True: data = sock.recv(size) ...
x.py
import argparse import datetime import importlib.util import logging import signal import sys import os from multiprocessing import get_context from typing import List, Text import questionary from rasa.cli.utils import print_success, get_validated_path from rasa.cli.arguments import x as arguments from rasa.constan...
__init__.py
""" objectstore package, abstraction for storing blobs of data for use in Galaxy, all providers ensure that data can be accessed on the filesystem for running tools """ import os import random import shutil import logging import threading from xml.etree import ElementTree from galaxy.util import umask_fix_perms, forc...
postproc.py
#!/usr/bin/python3 -OO # Copyright 2007-2022 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...
__init__.py
# -*- coding: utf-8 -*- import os import glob import argparse import time import itertools from prometheus_client import start_http_server, Gauge, REGISTRY from threading import Lock, Thread GAUGES = {} GAUGES_LAST_UPDATE = {} GAUGES_LABELS_LAST_UPDATE = {} GAUGES_LOCK = Lock() GAUGES_TTL = 60 SST_ABSPATH_TO_SIZE_IN...
setup.py
#!/usr/bin/env python #encoding: utf8 from __future__ import print_function import io import os import re import sys import inspect from glob import glob from itertools import chain from os.path import join, dirname, abspath from setuptools import setup from setuptools import find_packages from setuptools.command.t...
test_waagent.py
#!/usr/bin/python import os import sys import platform import socket import fcntl import struct import array import re import tempfile import unittest import random import string import threading from time import ctime, sleep import imp # waagent has no '.py' therefore create waagent module import manually. waagent=i...
crawler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar import datetime import json import logging import math import re import ssl import threading import urllib.request import urllib.parse from time import sleep, time from queue import Queue import requests from geopy import Point from geopy.distance import v...
resource_sharer.py
# # We use a background thread for sharing fds on Unix, and for sharing # sockets on Windows. # # A client which wants to pickle a resource registers it with the resource # sharer and gets an identifier in return. The unpickling process will connect # to the resource sharer, sends the identifier and its pid, and then ...
multiwoz_batcher.py
# Most of this file is copied form https://github.com/abisee/pointer-generator/blob/master/batcher.py import queue as Queue import time from random import shuffle from threading import Thread import numpy as np import config import data import random random.seed(1234) class Example(object): def __init__(self, arti...
plaso_xmlrpc.py
# -*- coding: utf-8 -*- """XML RPC server and client.""" from __future__ import unicode_literals import socketserver as SocketServer import threading from xmlrpc import server as SimpleXMLRPCServer from xmlrpc import client as xmlrpclib from xml.parsers import expat from plaso.multi_processing import logger from pl...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, Exif...
execute.py
""" Transforms and loads medical/scientific files into an articles database. """ import gzip import os from multiprocessing import Process, Queue from ..factory import Factory from .arx import ARX from .csvf import CSV from .pdf import PDF from .pmb import PMB from .tei import TEI class Execute: """ Trans...
main.py
''' @author: MRB ''' import socket import threading import time import os from gbn import SendingWindow, RecvingWindow import json from args import args from utils import * from gbn import * file_in = 'resource/Harry Potter.txt' ip = '127.0.0.1' # 服务器ip和端口 port1, port2, port3, port4 = args.port1, args.port2, args.p...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import argparse import json import multiprocessing imp...
example13_chime_n.py
#!/usr/bin/env python3 # coding: utf-8 # Example 13 チャイム+ボタン 【チャイム音の排他処理対応】 port_chime = 4 # チャイム用 GPIO ポート番号 port_btn = 26 # ボタン用 GPIO ポート番号 ping_f = 554 # チャイム音の周波数1 pong_f = 440 #...
mavproxy.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' mavproxy - a MAVLink proxy program Copyright Andrew Tridgell 2011 Released under the GNU GPL version 3 or later ''' import sys, os, time, socket, signal reload (sys) sys.setdefaultencoding('utf-8') import fnmatch, errno, threading import serial, Queue, select import t...
test_run.py
import contextvars import functools import platform import sys import threading import time import warnings from contextlib import contextmanager from math import inf import attr import outcome import pytest from async_generator import async_generator from .tutil import check_sequence_matches, gc_collect_harder from ...
test_integration.py
from __future__ import absolute_import, division, print_function import platform import sys from threading import Thread, Lock import json import warnings import time import stripe import pytest if platform.python_implementation() == "PyPy": pytest.skip("skip integration tests with PyPy", allow_module_level=True...
droidbot_app.py
import logging import socket import subprocess import time import json import struct import traceback from .adapter import Adapter DROIDBOT_APP_REMOTE_ADDR = "tcp:7336" DROIDBOT_APP_PACKAGE = "io.github.ylimit.droidbotapp" DROIDBOT_APP_PACKET_HEAD_LEN = 6 ACCESSIBILITY_SERVICE = DROIDBOT_APP_PACKAGE + "/io.github.priv...
backend_overview.py
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
server.py
# Copyright (c) 2016, Xilinx, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
wifi.py
from wpa_supplicant.core import WpaSupplicantDriver from twisted.internet.selectreactor import SelectReactor from subprocess import call import os.path import os from dbus import SystemBus, Interface import threading import logging import time class WifiNetwork(): def __init__(self, *args, **kwargs): self....
hci.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
main.py
from plugins.History_check import History_check from plugins.User_check import User_check from plugins.Backdoor_check import Backdoor_check from plugins.Config_check import Config_check from plugins.Log_check import Log_check from plugins.Proc_check import Proc_check from pre_check import host_infomation from plugins.c...
consume-mail.py
#!/usr/bin/env python3 # Consume mail received from PowerMTA # command-line params may also be present, as per PMTA Users Guide "3.3.12 Pipe Delivery Directives" # # Author: Steve Tuck. (c) 2018 SparkPost # # Pre-requisites: # pip3 install requests, dnspython # import os, email, time, glob, requests, dns.resolver, s...
test_process.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import, print_function, unicode_literals import io import os import sys import threading import time import signal import multiprocessing import functools # Import Salt Testing libs from tests.support.unit import TestCase, skipIf from tests....
learner.py
from typing import Tuple import glob import os import shutil import signal import threading import time from collections import OrderedDict, deque from os.path import join from queue import Empty, Queue, Full from threading import Thread import numpy as np import psutil import torch from torch.nn.utils.rnn import Pack...
down.py
import threading, argparse, requests, sys, os import urllib.request, urllib.error, socket from support.colors import c_white, c_green, c_red, c_yellow, c_blue from time import sleep from tqdm import tqdm from pytube import YouTube from selenium import webdriver from selenium.webdriver.firefox.options import Options #...
two_processes.py
import pyglet import multiprocessing class CustomMusic: def __init__(self): pyglet.options["audio"] = ("openal", "pulse", "directsound", "silent") self.soundtrack = pyglet.media.load("example.wav") self.soundtrack.play() def start_sub_process(): CustomMusic() pyglet.app.run() c...
proc_bing.py
#sub processes to scrape bing #include libs import sys sys.path.insert(0, '..') from include import * def bing_api(): call(["python3", "job_bing_api.py"]) process1 = threading.Thread(target=bing_api) process1.start()
common.py
import inspect import json import os import random import subprocess import time import requests import ast import paramiko import rancher import pytest from urllib.parse import urlparse from rancher import ApiError from lib.aws import AmazonWebServices from copy import deepcopy from threading import Lock from threadin...
main2.py
from UI_Function import * import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from UI_main import Ui_MainWindow import threading from UI_splashscreen import Ui_MainWindow as UI_splashscreen from RTC import GetTime from pyqtgraph impor...
run.py
# -*- coding: utf-8 -*- """ Created on Tue Jul 11 18:48:04 2017 @author: Yugal """ from keras.models import model_from_json from keras.preprocessing.image import ImageDataGenerator import cv2 import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np import threading from matplotlib.p...
threading_test.py
try: from queue import Empty, Full, Queue except ImportError: from Queue import Empty, Full, Queue import sys import threading import time import unittest import stomp from stomp.backward import monotonic from stomp.test.testutils import * class MQ(object): def __init__(self): sel...
_profiler.py
import cupy from time import sleep, time from threading import Thread import psutil import os import sys cupymem = cupy.get_default_memory_pool() output_file = "results/profiling_results.csv" process = psutil.Process(os.getpid()) def curr_ram(): if sys.platform == "win32": return process.memory_info().vms...
skin.py
################################################################################ # Copyright (C) 2019 drinfernoo # # # # This Program is free software; you can redistribute it and/or modify ...
main.py
import multiprocessing as mp import tensorflow as tf import numpy as np import gym, time import matplotlib.pyplot as plt UPDATE_GLOBAL_ITER = 10 GAMMA = 0.9 ENTROPY_BETA = 0.001 LR_A = 0.001 # learning rate for actor LR_C = 0.001 # learning rate for critic env = gym.make('CartPole-v0') N_S = env.observation_sp...
discuz_mlRce.py
#!/usr/bin/python # coding:utf-8 # Author:Vibhuti Nath # CVE-ID CVE-2019-13956 # POC https://www.esoln.net/blog/2019/06/14/discuzml-v-3-x-code-injection-vulnerability/ # Description:DISCUZ ML RCE in Language cookie # Date:20190614 import requests import optparse import sys import urllib3 import re from bs4 import Bea...
powerful_editor.py
import curses import time, filecmp import os, re, multiprocessing import sys import logging as log from depend import empty_right from depend import option from depend import copy import json # scroll : when reaching end, increase # lines : exact location of typing # cursor : cursor position on screen log.basicConfig...
test_state.py
# -*- coding: utf-8 -*- ''' Tests for the state runner ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import re import shutil import signal import tempfile import time import textwrap import threading # Import Salt Testing Libs f...
words2map.py
# -*- coding: utf-8 -*- from __future__ import division import numpy as np from gensim.models import Word2Vec from sklearn.manifold import TSNE from hdbscan import HDBSCAN from nltk import tokenize, bigrams, trigrams, everygrams, FreqDist, corpus from pattern.web import Google, SEARCH, download, plaintext, HTTPError, H...
crypto_util_test.py
"""Tests for acme.crypto_util.""" import itertools import socket import threading import time import unittest import six from six.moves import socketserver #type: ignore # pylint: disable=import-error import OpenSSL from acme import errors from acme import jose from acme import test_util class SSLSocketAndProbeS...
router.py
import yaml from gevent.pywsgi import WSGIServer from flask import request, json, Flask, jsonify, send_file from flask_cors import CORS import tweepy from web.service import Service from web.db import DB from web.plot import plot_ocean from web.id import PushID import threading from main import calculate_vector, clu...
order.py
# encoding: utf-8 import os import csv import json import os.path import requests import traceback import time,datetime import sched import xlrd from libs import my_utils from threading import Thread from libs import mediaJd from libs import alimama from libs import orther from libs import pingdd from libs.mysql impor...
main.py
from dearpygui.core import * from dearpygui.simple import * import cv2 import json import os import sys from time import time, gmtime from threading import Thread from math import sqrt def print_stamped(text): time_stamp = gmtime(time()) log_info(text, logger='reportLogger') class Camera: def __init__(sel...
pipeline.py
from multiprocessing import Process,Queue import importlib import hashlib import random import time class Pipeline: def __init__(self,steps): """ """ self.job_counter=0 self.done_jobs={} self.max_q_size=10 self.q_in=Queue(self.max_q_size) #where to send data to the whole pi...
multiproc_vec.py
from .utils.shared_array import SharedArray from .utils.space_wrapper import SpaceWrapper import multiprocessing as mp import numpy as np import traceback import gym.vector def compress_info(infos): non_empty_infs = [(i, info) for i, info in enumerate(infos) if info] return non_empty_infs def decompress_inf...
voronoi.py
""" Voronoi Mapping =============== """ from scipy.spatial import Voronoi from distopia.district import District from distopia.precinct import Precinct from distopia.mapping._voronoi import PolygonCollider, get_region_vertices import numpy as np from collections import defaultdict import logging import time from thread...
ship_data_converter.py
from optparse import OptionParser import os import zmq import numpy as np import datetime from numba import njit import cProfile import cython import multiprocessing import threading, Queue import time import logging from ctypes import c_ushort, c_int, c_char_p import tables as tb from pybar_fei4_interpreter.data_inte...
utils.py
import numpy import tensorflow as tf from . import settings as s import skimage.io import skimage.transform import tarfile from urllib.request import urlretrieve import threading import os import sys from functools import partial from contextlib import contextmanager import json import subprocess import zipfile def ...
mic.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...
sound.py
import pyaudio import wave import threading import time class Sound: CHUNK = 1024 # thread playing sound __thread = None __pause = False __playing = False repeat = False def __init__(self, player, file): self.player = player self.file = file def play(self): ...
draw_test.py
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version 1.0 ...
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 - ...
mproc.py
import os import time import multiprocessing import concurrent.futures import py from _pytest.junitxml import LogXML from _pytest.terminal import TerminalReporter from _pytest.junitxml import Junit from _pytest.junitxml import _NodeReporter from _pytest.junitxml import bin_xml_escape from _pytest.junitxml import mangl...
test__xxsubinterpreters.py
from collections import namedtuple import contextlib import itertools import os import pickle import sys from textwrap import dedent, indent import threading import time import unittest from test import support from test.support import script_helper interpreters = support.import_module('_xxsubinterpreters') ######...
GUI.py
import tkinter as tk from tkinter import ttk from tkinter.filedialog import askopenfilename, asksaveasfilename, askdirectory from tkinter.messagebox import showerror import threading # Teaching 需求 import sys import os from configparser import ConfigParser from Teaching import Teaching import random from os import listd...
sign_api.py
#!/usr/bin/env python2.7 import atexit import sys import time import threading from Queue import Queue, Empty from flask import Flask, request, render_template from sign import Sign queue = Queue() stop = threading.Event() t = None def do_command(sign, command, args): if command == 'change_modes': sign...
systemtools.py
# -*- coding: utf-8 -*- # script.module.python.koding.aio # Python Koding AIO (c) by whufclee (info@totalrevolution.tv) # Python Koding AIO is licensed under a # Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. # You should have received a copy of the license along with this # wor...
main.py
import argon2 import hashlib import json import ctypes import sys import os import cryptography from cryptography.fernet import Fernet from time import sleep from random import randint as rando from argon2 import PasswordHasher import logging import threading try: import string import re ...
http_dispatcher.py
#!/usr/bin/env python # coding:utf-8 """ This file manage the ssl connection dispatcher Include http/1.1 and http/2 workers. create ssl socket, then run worker on ssl. if ssl suppport http/2, run http/2 worker. provide simple https request block api. caller don't need to known ip/ssl/http2/appid. performance: ge...
cli.py
# -*- coding: utf-8 -*- ''' Linux + Windows Compatible install this script under startup menu sleep until 19:00 exit when 7:00 OPTION GPU this script is gonna do following things check if the gpu is using if it is used, exit program if not, start miner program OPTION CPU start miner program ''' import click impo...
__init__.py
from __future__ import annotations import logging import re from threading import Thread from typing import Any, List, TYPE_CHECKING, Tuple from bot import app_vars, errors from bot.TeamTalk.structs import Message, User, UserType from bot.commands import admin_commands, user_commands from bot.commands.task_...
redis_lock_test.py
import os import time import uuid from threading import Event, Thread import redis from redis_notes.common import redis_connection from redis_lock import lock from redis_notes.common.log import log_info from redis_notes.redis_lock.lock import Lock lock = None def w1(): global lock if lock._held: log_...
visualizerUI.py
from Tkinter import Tk, TclError, ALL, Canvas, TOP import threading import Queue import time import sys import SocketServer import platform import os os.sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import log from network_receiver import ThreadedDataServer, ThreadedDataHandler clas...
async_button.py
import logging import subprocess import threading import time import RPi.GPIO as GPIO import mpd_player import rgb_led import sound_effect from config import BUTTON as CONFIG log = logging.getLogger(__name__) # use board, since NFC/RFID Sensor library uses board GPIO.setmode(GPIO.BOARD) # next button GPIO.setup(CON...
base.py
import os import time import uuid import csv import logging import threading from abc import ABC, abstractmethod from typing import Type from pytimeparse import parse as parse_time logger = logging.getLogger(__name__) class Sensor: """Abstract sensor class""" def __init__(self, proxy, name: str, uses_heig...
postgres.py
import functools import json import logging import threading import time from signal import Signals from typing import Callable, Tuple, Union import psycopg2 import psycopg2.errors from psycopg2._psycopg import ReplicationMessage from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from psycopg2.extras import Di...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
udp_bridge_node.py
import numpy as np import yaml import pickle from src.telemetry_utils import * import argparse import yaml import os import time import signal import sys import threading class recorderClass(): def __init__(self, path, ports_list): self.path = path self.ports_list = ports_list self.data ={i...
gui.py
#!/usr/bin/env python2 # vim: sts=4 ts=4 sw=4 noet: import threading import sys, os, platform, time, errno import subprocess import logging import inspect from datetime import datetime import glob import configparser import queue import argparse import tkinter as Tk import tkinter.ttk import tkinter.filedialog, tkinte...
config.py
# -*- coding: utf-8 -*- from thrift.transport import THttpClient from thrift.protocol import TCompactProtocol from akad import AuthService, TalkService, ChannelService, CallService, SquareService from akad.ttypes import OpType, IdentityProvider, LoginResultType, LoginRequest, LoginType, ApplicationType, Message, MediaT...
__init__.py
import collections.abc from collections import namedtuple import asyncio import os import sys import signal import operator import uuid from functools import reduce from typing import Any, Optional, Callable from weakref import ref, WeakKeyDictionary import types import inspect from inspect import Parameter, Signature ...
server.py
import os import sys import struct import time import random import util import request import gui import threading import socket import socketserver class States(): WAIT_HANDSHAKE = 1 RECEIVE_LENGTH = 2 RECEIVE_DATA = 3 HANDLE_REQUEST = 4 WAIT_FOR_BACKEND = 5 SEND_RESPONSE = 6 def BGBPa...
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...
datalayer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __metaclss__=type from PIL import Image, ImageDraw, ImageFont import matplotlib.pyplot as plt import random import math import sys import os import numpy as np import time import collections import lmdb from multiprocessing import Process, Queue import signal from utils.c...
run.py
from multiprocessing import Process import os import subprocess def start_frontend(): subprocess.call(['npm', 'run', 'serve'], cwd='frontend') def start_backend(): subprocess.call(['python', 'app.py'], cwd='backend') if __name__ == '__main__': p1 = Process(target=start_frontend) p1.start() p2 ...
data.py
import os import csv import subprocess import matplotlib.pyplot as plt from math import ceil from tqdm import tqdm from pandas import read_csv from netCDF4 import Dataset, num2date from multiprocessing import cpu_count, Process from .plot import plot_filtered_profiles_data def download_data(files, storage_path): ...
concurrency_coroutines.py
from threading import Thread from time import sleep from module4.coroutine_decorator import coroutine @coroutine def my_slow_coroutine(): print(f'I am so slow') yield sleep(10) print(f'But I am done!') def run_coroutine(coro): try: coro.send(None) except StopIteration: print...
carbon_dioxide.py
import serial import socketserver as SocketServer import time from threading import Thread ''' NOTE: EDIT THIS LINE BELOW IF THE USB PORT ADDRESS CHANGED.''' arduino_port_address = "/dev/ttyUSB0" # Use "COM[NUMBER]"" for Windows | "/dev/ttyUSB0" for Linux/Mac serialLine = serial.Serial(arduino_port_address, baudrate=1...
sphase.py
''' Created on 15-June-2017 by basu_s ''' import os, sys, time import subprocess as sub import optparse, errno from ascii import ASCII import multiprocessing as mp def options(): parser = optparse.OptionParser() parser.add_option('-f', "--hkl", type=str, help="XDS_ASCII or XSCALE file abso...
base_state.py
# -*- coding: utf-8 -*- """ Base Logic State class Description: Todo: """ import os import sys import logging import time import threading class BaseState(object): """Base class for logic stage Args: state_controller: Class instance for main State_Controller in_state_callback: """ ...
core.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 #...
bridge.py
#!/usr/bin/env python3 import argparse import atexit import carla # pylint: disable=import-error import math import numpy as np import time import threading from cereal import log from typing import Any import cereal.messaging as messaging from common.params import Params from common.realtime import Ratekeeper, DT_DMO...
basic_server.py
import socket import threading #running locally hostname = socket.gethostname() HOST = socket.gethostbyname(hostname) print(f"HOSTNAME: {hostname}") print(f"HOST: {HOST}") PORT = 10098 """ Usado para criar TCP socket: socket.SOCK_STREAM Usado para criar UDP socket: socket.SOCK_DGRAM Utiliza protocolo IPv4: AF_INET ...