source
stringlengths
3
86
python
stringlengths
75
1.04M
PlexAPI.py
#!/usr/bin/env python """ Collection of "connector functions" to Plex Media Server/MyPlex PlexGDM: loosely based on hippojay's plexGDM: https://github.com/hippojay/script.plexbmc.helper... /resources/lib/plexgdm.py Plex Media Server communication: source (somewhat): https://github.com/hippojay/plugin.video.plexbmc...
toggle.py
import time from multiprocessing import Process, Lock, Pipe from multiprocessing.sharedctypes import Value, Array import pprint import socket import ctypes from struct import * from includes import config #local rtp_high_port = 5004 rtp_low_port = 5006 rtcp_receiver_port = 5009 #remote rtp_receiver_ip = '192.168.2.6...
app.py
import os import re import math import sys import shutil import json import traceback import PIL.Image as PilImage import threading import tkinter as tk from tkinter import messagebox from tkinter import ttk from tkinter import filedialog from constants import * from config import ModelConfig, OUTPUT_SHAPE1_MAP, NETWOR...
barreira.py
from random import randrange from threading import Barrier, Thread, current_thread from time import ctime, sleep b = Barrier(4) def player(): sleep(randrange(1, 6)) print("%s reached the barrier at: %s" % (current_thread().name, ctime())) b.wait() threads = [] print("Race starts now…") for i in range...
cmd_controller.py
#!/usr/bin/python #-*-coding:utf-8-*- import os import sys import re import json from threading import Thread import socket, select import fileinput import codecs cur_dir = os.path.split(os.path.realpath(__file__))[0] from human_role import HumanRole from robot_role import RobotRole from net_role import NetRole from...
DWX_ZeroMQ_Connector_v2_0_2_RC1.py
# -*- coding: utf-8 -*- """ DWX_ZeroMQ_Connector_v2_0_2_RC8.py -- @author: Darwinex Labs (www.darwinex.com) Copyright (c) 2017-2019, Darwinex. All rights reserved. Licensed under the BSD 3-Clause License, you may not use this file except in compliance with the License. You ...
start_node2.py
import asyncio import logging import sys from urllib.request import urlopen from functools import partial from secp256k1_zkp import PrivateKey, PublicKey from leer.syncer import Syncer from leer.transport.network_manager import NM_launcher from leer.rpc.rpc_manager import RPCM_launcher from leer.core.core_loop import...
projectUtils.py
""" This module contains utility functions used internally by the rtcloud services """ import os import sys import re import time import zlib import hashlib import logging import getpass import requests import threading import numpy from pathlib import Path from base64 import b64encode, b64decode import rtCommon.utils ...
run_manager.py
# -*- encoding: utf-8 -*- import errno import json import logging import os import re import signal import socket import stat import subprocess import sys import time from tempfile import NamedTemporaryFile import threading import yaml import numbers import inspect import glob import platform import fnmatch import cl...
td_realtime_target_network_update_line.py
import sys sys.path.insert(0, '../') from algo.td_realtime import run_td_realtime arguments = { 'game': 'Line', 'mode': 'train', 'vmodel': 'LineVNetwork', 'learning_rate': 0.0003, 'target_network_update': 30, 'egreedy_final': [0.01], 'egreedy_decay': [0.99], 'egreedy_props': [1], 'egreedy_final_step': [25000...
server.py
from six.moves import BaseHTTPServer import errno import os import socket from six.moves.socketserver import ThreadingMixIn import ssl import sys import threading import time import traceback from six import binary_type, text_type import uuid from collections import OrderedDict from six.moves.queue import Queue from ...
host.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # (c) Copyright 2013 Hewlett-Pa...
EnglishBidder.py
import zmq import utilities import json import threading import os # Shared variable among threads currentBestValue = 0 # Thread function for reading from server the other offers def offers_from_others(): global currentBestValue #creating subscriber endpoint context = zmq.Context.instance() ...
ic_node.py
import json import threading from .ic_peer import IndieCoinPeer from .. import blockchain from protocol.response import Response from protocol import protocol class IndieCoinNode(IndieCoinPeer): """ Indie Coin P2P Node Network module for indiecoin. Mantains communication with other nodes, liste...
vgg19_cifar100_fc_lr_grad_avg.py
import argparse import os import sys import numpy as np import torch import torch.distributed as dist from math import ceil from torch.multiprocessing import Process sys.path.append("../") sys.path.append("../../") from archived.ec2.trainer import Trainer from archived.ec2 import partition_vgg16_ci...
kutil.py
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. # # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ # # Kubernetes (kubectl) utilities # Use kubectl instead of the API so we go through the same code path as an end-user import os import subprocess impor...
datasets.py
from flask import request from flask_restplus import Namespace, Resource, reqparse, inputs from flask_login import login_required, current_user from werkzeug.datastructures import FileStorage from mongoengine.errors import NotUniqueError from mongoengine.queryset.visitor import Q from threading import Thread from goog...
index_win.py
import asyncio import threading from importlib import import_module import XsCore import ccxt import pyperclip from PySide6 import QtWidgets from PySide6.QtCore import QTimer from PySide6.QtGui import QAction, QIcon from PySide6.QtWidgets import QMainWindow from sub_wins.configs import CongisWin from sub_wins.help_do...
parasol.py
# Copyright (C) 2015-2016 Regents of the University of California # # 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 app...
progressbar.py
import sys import threading class ProgressBar(object): """ Print progress bar in the separated thread """ def __init__(self, interval=1, fp=sys.stdout): """ Start thread for progress bar :param interval: interval seconds to write dots :param fp: file pointer to write ...
algo_three.py
from functools import reduce from sys import * import numpy as np import random as r import socket import struct import subprocess as sp import threading from threading import Thread import ast import time import datetime as dt import os import psutil from netifaces import interfaces, ifaddresses, AF_INET import paho.m...
trader.py
#! /usr/bin/env python3 import os import sys import copy import time import logging import datetime import threading import trader_configuration as TC MULTI_DEPTH_INDICATORS = ['ema', 'sma', 'rma'] TRADER_SLEEP = 1 # Base commission fee with binance. COMMISION_FEE = 0.00075 # Base layout for market pricing. BASE_TRA...
mted.py
# preprocesses files for modified token edit distance (MTED) # assignment args: # - entries (array): # -- entryPoint (string): File that Clang should "compile". If using C++ templates, this may be an instructor-provided main file. # -- sources (string array): The files that have functions that we are interested in. Fir...
main.py
# _*_ coding:utf-8 _*_ import settings from settings import CfgKeyEnum from settings import ChoiceKeyTypes import utils from hot_key import HotKey from hot_key import KeyListener import queue import sys import gui_template import wx import key_scan_code_sender from collections import OrderedDict # import os # import t...
multiproc.py
# Copyright 2011 Omniscale GmbH & Co. KG # # 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 ...
mp_benchmarks.py
# # Simple benchmarks for the multiprocessing package # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # import time, sys, multiprocessing, threading, queue, gc if sys.platform == 'win32': _timer = time.clock else: _timer = time.time delta = 1 #### TEST_QUEUESPEED def queuespeed_func(q, c, it...
Tests.py
#!/usr/bin/python3 import random, string, subprocess from subprocess import check_output from subprocess import Popen, PIPE import random import time import logging import threading import os import datetime import configparser import requests mainProxyHost = "10.11.12.115" mainProxyPort = 80 shortList = [] # Lette...
asyncCallbackCaller.py
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2016 Bitcraze AB # # Th...
speed.py
# -*- coding: utf-8 -*- ## Part of the pyprimes.py package. ## ## Copyright © 2014 Steven D'Aprano. ## See the file __init__.py for the licence terms for this software. """\ ===================================== Timing the speed of primes algorithms ===================================== """ from __future__ imp...
reaper.py
# Copyright European Organization for Nuclear Research (CERN) # # 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 # # Authors: # - Vincent Garonne, <vin...
log_follower.py
# -*- coding: utf8 -*- """ Utility methods for to send processes logs to a python logger. """ import logging import sys from os.path import isfile from time import sleep from threading import Thread from traceback import format_exception class LogTracer: READ_SIZE = 1024 def __init__(self, logger...
DarkMatter.py
import socket import os from time import sleep import multiprocessing import random import platform print("Detecting System...") sysOS = platform.system() print("System detected: ", sysOS) if sysOS == "Linux": try: os.system("ulimit -n 1030000") except Exception as e: print(e) print("Could not start t...
jumper_test.py
import gym import gym_tensegrity import numpy as np import os from time import sleep # Discrete action space functions testing def main(port_num=10042): def print_observation(obs): print("Observations {:}".format(obs)) env = gym.make('gym_tensegrity:jumper-v0') # action = randint(0,15) action =...
shell.py
"""Common Shell Utilities.""" import os import sys from subprocess import Popen, PIPE from multiprocessing import Process from threading import Thread from ..core.meta import MetaMixin from ..core.exc import FrameworkError def exec_cmd(cmd_args, *args, **kw): """ Execute a shell call using Subprocess. All a...
auto-bak.py
#!/usr/bin/python #!coding=utf-8 import telnetlib import time import threading import sys import os import yaml import argparse class ConfigBackup: def __init__(self, ip_addr, debug=False, **kwargs): if 'port' in kwargs: port = kwargs['port'] else: port = 23 try: ...
test_asyncio_change_stream.py
# Copyright 2017-present MongoDB, 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 wri...
test_sys.py
from test import support from test.support.script_helper import assert_python_ok, assert_python_failure import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support import textwrap import unittest import wa...
util.py
# -*- coding: utf-8 -*- import random import re import string import sys import threading import traceback import six from six import string_types # Python3 queue support. try: import Queue except ImportError: import queue as Queue import logging logger = logging.getLogger('TeleBot') thread_local = threadi...
WebFuzzer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Testing Web Applications" - a chapter of "The Fuzzing Book" # Web site: https://www.fuzzingbook.org/html/WebFuzzer.html # Last change: 2022-05-18 12:46:31+02:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland Un...
thread_pool.py
""" "멀티스레드 애플리케이션 예시"절 예시 간단한 스레드풀 구현 방법을 소개한다. """ import time from queue import Queue, Empty from threading import Thread import requests THREAD_POOL_SIZE = 4 SYMBOLS = ("USD", "EUR", "PLN", "NOK", "CZK") BASES = ("USD", "EUR", "PLN", "NOK", "CZK") def fetch_rates(base): response = requests.get(f"https://ap...
downloadclient.py
# Copyright 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 appl...
game.py
################################################################################ # # rpiloui - a python game engine for hasbros looping loui game controlled via a # raspberry pi single board computer # # This code is released under: # # Copyright (c) 2020 nasrudin2468 # # Permission is hereby granted, free o...
logging_util.py
__package__ = 'archivebox' import re import os import sys import time import argparse from multiprocessing import Process from pathlib import Path from datetime import datetime from dataclasses import dataclass from typing import Optional, List, Dict, Union, IO, TYPE_CHECKING if TYPE_CHECKING: from .index.schema...
dameon_thread_01.py
import threading as th import logging as lg import time as t lg.basicConfig(level=lg.DEBUG,format="%(threadName)-10s %(message)10s") def f(): lg.debug('starting f') t.sleep(3) lg.debug('ending f') def h(): lg.debug('starting h') t.sleep(1) lg.debug('ending h') t1=th.Thread(target=f,daemon=True) ...
monitor.py
import sys sys.path.append(r"/home/anoldfriend/OpenFOAM/anoldfriend-7/utilities/") import signal import multiprocessing as mp import time from residual_monitor import read_residuals,plot_multiple_residuals,quit log="run.log" pressure_name="p_rgh" nCorrectors=2 interval=1 sample_size=200 m_residuals=[["Y","e"],["Ux...
onedrive.py
from __future__ import print_function import base64 import copy import json import os import re import time import traceback from builtins import object from builtins import str from datetime import datetime from pydispatch import dispatcher from requests import Request, Session from lib.common import bypasses from ...
app.py
#from gevent import monkey #monkey.patch_all() import copy import time import json from threading import Thread from flask import Flask, render_template, session, request, flash from flask.ext.socketio import SocketIO, emit, join_room, leave_room, close_room, disconnect from mongoengine import * from models.models i...
obj_detector.py
import os import cv2 import numpy as np import sys import time from threading import Thread import importlib.util class VideoStream: # Camera object that controls video streaming from Picamera def __init__(self, resolution=(640,480), framerate=30): # init PiCamera and image stream self.stream =...
fixrackdata.py
from queue import Queue from threading import Thread from multiprocessing import cpu_count from django.core.management.base import BaseCommand, CommandError from django.core.paginator import Paginator from idcops.models import Rack, Online, Unit, Pdu class Command(BaseCommand): help = "更新所有机柜的U位、PDU位" batc...
builtin.py
""" A library for integrating Python's builtin :py:mod:`ssl` library with Cheroot. The :py:mod:`ssl` module must be importable for SSL functionality. To use this module, set ``HTTPServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ from __future__ import absolute_import, division, print_function __meta...
deadloop.py
import threading, multiprocessing def loop(): x = 0 while True: x = x ^ 1 for i in range(multiprocessing.cpu_count()): t = threading.Thread(target=loop) t.start()
code_server.py
#!/usr/bin/env python """This server runs an HTTP server (using tornado) to which code can be submitted for checking. This is asynchronous so once submitted the user can check for the result. It *should* be run as root and will run as the user 'nobody' so as to minimize any damange by errant code. This can be configu...
remote.py
""" fs.remote ========= Utilities for interfacing with remote filesystems This module provides reusable utility functions that can be used to construct FS subclasses interfacing with a remote filesystem. These include: * RemoteFileBuffer: a file-like object that locally buffers the contents of ...
__init__.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...
map_stage_op_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...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum_vtc.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_vtc.bip32 import BIP32Node from electrum_vtc import constants from electrum...
multisimulation.py
# -*- coding: utf-8 -*- import random import os import time import sharedmem import numpy as np from folddata import get_fold_data from singlesimulation import SingleSimulation from multiprocessing import Process, Queue from Queue import Empty from utils.clicks import get_click_models class MultiSimulation(object): ...
patron_barrera.py
#!/usr/bin/python # *-* coding: utf-8 from threading import Semaphore, Thread from random import random from time import sleep num_hilos = 4 cuenta = 0 mutex = Semaphore(1) barrera = Semaphore(0) def vamos(id): global cuenta, mutex, barrera print "Inicializando al hilo %d" % id sleep(random()) mutex.ac...
build_imagenet_data.py
# Copyright 2016 Google 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
window.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi.repository import GLib # import threading from openssl_gtk import app_info as info from openssl_gtk import thread as thd import opylogger """ Bu dosya hakkinda, sürüm notları, şifreleme ve...
collectd.py
import re import time import socket import struct import logging import traceback from functools import wraps try: from Queue import Queue, Empty # Python 2 except ImportError: from queue import Queue, Empty # Python 3 from collections import defaultdict from threading import RLock, Thread, Semaphore __all_...
test_posix.py
import sys import asyncio import os import time import threading from signal import SIGINT, SIGTERM from concurrent.futures import ThreadPoolExecutor from aiorun import run, shutdown_waits_for, _DO_NOT_CANCEL_COROS import pytest # asyncio.Task.all_tasks is deprecated in favour of asyncio.all_tasks in Py3.7 try: fr...
collection.py
# standard python modules import logging import threading import math import inspect # import all local modules from the rest package from . import * class xMattersCollectionThread(object): # constructor def __init__(self, request): self.log = logging.getLogger(__name__) self.request = reques...
make_kmer_json.py
import csv, re, argparse, multiprocessing, math, json, ahocorasick, os from Bio import Seq, SeqIO """ This scripts creates the JSON to hold all kmer sets. """ def split_list(l,n): for i in range(0, len(l), n): yield l[i:i+n] def query_kmers(l, t, fasta, o): """Finds kmers in variant sequences""" ...
service.py
# Copyright 2017 Red Hat, 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, ...
thread_dispatcher.py
# Learning Python 101 import threading import time import random from utils import * class ThreadDispatcher: def __init__(self): self.__condition_ = threading.Condition() self.__exec_list_ = [] self.__thread_ = threading.Thread(target=self.__run) self.__is_running_ = False de...
remote_execution.py
# Copyright Epic Games, Inc. All Rights Reserved. import sys as _sys import json as _json import uuid as _uuid import time as _time import socket as _socket import logging as _logging import threading as _threading def hello(): _logging.debug("Hello from remote") # Protocol constants (see PythonScriptRemoteExe...
main.py
#from modules import logger import logger log = logger.logger_class() from random import randint import string import string import sys reload(sys) sys.setdefaultencoding('utf8') import os import MySQLdb import string import socket import codecs import settings setup = settings.settings_var from os import wa...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading import gc import textwrap import jso...
http-proxy.py
import sys import socket import threading import http import email.message _MAXLINE = 65536 def main(): if len(sys.argv) < 2: print("no port given, default port is 8080") port = 8080 else: port = int(sys.argv[1]) try: recv_socket = socket.socket(socket.AF_INET, socket.SOCK...
ood_histogram.py
import os, sys, inspect sys.path.insert(1, os.path.join(sys.path[0], '../../')) import ctypes import torch import torchvision as tv import argparse import time import numpy as np import scipy.sparse as sparse from scipy.stats import binom from PIL import Image import matplotlib import matplotlib.pyplot as plt import p...
automatic_upgrader.py
import threading import re import os import datetime import time import sublime from .console_write import console_write from .package_installer import PackageInstaller from .package_renamer import PackageRenamer from .open_compat import open_compat, read_compat from .settings import pc_settings_filename, load_list_s...
tests.py
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import absolute_import, unicode_literals import datetime import threading from django.conf import settings from django.core.management.color import no_style from django.core.exceptions import ImproperlyConfigured from django.d...
mixins.py
# -*- coding: utf-8 -*- ''' :codeauthor: Pedro Algarvio (pedro@algarvio.me) ============= Class Mix-Ins ============= Some reusable class Mixins ''' # pylint: disable=repr-flag-used-in-string # Import python libs from __future__ import absolute_import, print_function import os import sys import t...
test_smtpserver.py
import smtpd import threading import asyncore class AsyncCoreLoopThread(object): def wrap_loop(self, exit_condition, timeout=1.0, use_poll=False, map=None): if map is None: map = asyncore.socket_map while map and not exit_condition: asyncore.loop(timeout=1.0, use_po...
driver_cea2.py
# Driver for running the FCEA2m executable # Jason Chen, Project Caelus, 12/14/2019 import os import sys import time import subprocess import threading import pyautogui def type_with_delay(dir_name: str, delay: int or float): time.sleep(delay) pyautogui.typewrite(dir_name) pyautogui.press("enter") if _...
reporter.py
# -*- coding: utf-8 -*- # Adapted from a contribution of Johan Dahlin import collections import sys try: import multiprocessing except ImportError: # Python 2.5 multiprocessing = None import pep8 __all__ = ['multiprocessing', 'BaseQReport', 'QueueReport'] class BaseQReport(pep8.BaseReport): """Base...
bazelci.py
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
websocketconnection.py
import threading import websocket import gzip import ssl import logging from urllib import parse import urllib.parse from huobi.impl.utils.timeservice import get_current_timestamp from huobi.impl.utils.urlparamsbuilder import UrlParamsBuilder from huobi.impl.utils.apisignature import create_signature from huobi.excepti...
test_networking.py
import concurrent.futures import contextlib import json import logging import random import threading import time from collections import deque from subprocess import check_output import pytest import requests import retrying from pkgpanda.build import load_json from test_util.marathon import get_test_app, get_test_a...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
reader.py
# Copyright (c) 2019 PaddlePaddle 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 appli...
websocket_client.py
import json import logging import socket import ssl import sys import traceback from datetime import datetime from threading import Lock, Thread from time import sleep from typing import Optional import websocket from vnpy.trader.utility import get_file_logger class WebsocketClient: """ Websocket API A...
pyjukebox.py
#!/usr/bin/env python import os import subprocess import threading import time import yaml import glob config = yaml.safe_load(open(os.path.dirname(os.path.abspath(__file__)) + "/config.yml")) tmp_directory = os.path.dirname(os.path.abspath(__file__)) + "/tmp" last_song_file_location = tmp_directory + "/lastsong.txt"...
server2.py
import socket import threading import time class Server(object): def __init__(self, hostname, port): self.clients = {} self.istekListesi = {} self.machList={} self.chatRoomsList={} self.chatRooms=[] self.chatRoom1=[] self.chatRoom2 =[] self.chatRoo...
runCtaTrading.py
''' Project: Negociant Copyright (c) 2017 Xilin Jia <https://github.com/XilinJia> This software is released under the MIT license https://opensource.org/licenses/MIT ''' # encoding: UTF-8 from __future__ import print_function import sys try: reload(sys) # Python 2 sys.setdefaultencoding('utf8') except NameEr...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
utils.py
''' This contains the core test helper code used in Synapse. This gives the opportunity for third-party users of Synapse to test their code using some of the same helpers used to test Synapse. The core class, synapse.tests.utils.SynTest is a subclass of unittest.TestCase, with several wrapper functions to allow for e...
envs_runner_cen.py
import numpy as np import torch import IPython from multiprocessing import Process, Pipe from IPython.core.debugger import set_trace def worker(child, env): """ Worker function which interacts with the environment over remote """ try: while True: # wait cmd sent by parent ...
test_api.py
""" Tests for the crochet APIs. """ from __future__ import absolute_import import threading import subprocess import time import gc import sys import weakref import tempfile import os import imp import inspect from unittest import SkipTest from twisted.trial.unittest import TestCase from twisted.internet.defer impor...
main.py
from __future__ import print_function import time import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from train import train, test # Training settings parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--batch-s...
handlers.py
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
tcp_server.py
#!/usr/bin/env python import socket import sys import threading def create(ip='127.0.0.1', port=5555): server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((ip, port)) server.listen(5) print(f'[*] Listening on {ip}:{port}') return server def handle_client(client_socket): requ...
ddv-tg-x.py
# Python version 2: # sudo pip install flask (or apt-get install python-flask) # sudo pip install pandas (or apt-get install python-pandas) # sudo pip install requests (or apt-get install python-requests) # sudo pip install --pre scapy[basic] # sudo pip install pyopenssl # Python version 3: # sudo pip3 install flask (o...
__init__.py
import sys import threading import time import pcbnew import wx import wx.aui from .generate_interactive_bom import InteractiveHtmlBomPlugin def check_for_bom_button(): # From Miles McCoo's blog # https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/ def find_pcbnew_wind...
message_provider.py
"""Contract Message Provider.""" import os import time import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3 import Retry from multiprocessing import Process from .verifier import Verifier from .http_proxy import run_proxy import logging logging.getLogger("urllib3").setLevel(logging...
linz_data_importer.py
""" /*************************************************************************** LINZ Data Importer A QGIS plugin Import LINZ (and others) OGC Datasets into QGIS ------------------- begin : 2018-04-07 git sha : ...
master.py
try: import os,sys,socket,threading,zipfile,subprocess,random,Networking except Exception as e: print(e) sys.exit(1) finally: print("Imports Complete") #process folder to make pair of data and code to be sent to slave def processfolder(code='code.py',path=os.getcwd(),nodes=2): t=os.getcwd() d=os.listdir(path) ...
netcdf.py
#!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. # Author: Frank Warmerdam <warmerdam@pobox.com> # #############################################################...
MACServerDiscover.py
import socket, binascii, threading, time # MAC server discovery by BigNerd95 search = True devices = [] def discovery(sock): global search while search: sock.sendto(b"\x00\x00\x00\x00", ("255.255.255.254", 5678)) time.sleep(1) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sets...