source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
terminal_instances.py | #!/usr/bin/env python
#coding:utf-8
'''
Created on 2019-03-05
@author: yunify
'''
import qingcloud.iaas
import threading
import time
from optparse import OptionParser
import sys
import os
import qingcloud.iaas.constants as const
import common.common as Common
def leave_vxnet(conn,user_id,instance_id):
print("lea... |
test_utils.py | """Module for testing the natcap.invest.utils module.."""
import unittest
import os
import tempfile
import shutil
import logging
import threading
import warnings
import re
import glob
import textwrap
from pygeoprocessing.testing import scm
import pygeoprocessing.testing
from osgeo import gdal
class ... |
test_driver_remote_connection_threaded.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 use this ... |
clock.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
__version__ = "3.0.0"
"""
********* TRANSPARENT CLOCK by alef *********
This is just a transparent, always-on-top, movable, count-down/alarm digital clock
I couldn't find anything similar, so I decided to code it!
Feel free to use it, modify it, distribute it or whatever...... |
lishogi-bot.py | import argparse
import shogi
import engine_wrapper
import model
import json
import lishogi
import logging
import multiprocessing
import logging_pool
import signal
import time
import backoff
import threading
from config import load_config
from conversation import Conversation, ChatLine
from functools import partial
from... |
node_registry_test.py | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
fxstart.py | # import flexio as flexioext
# def flexio_start_handler(context):
# import fxmodule
# handler = getattr(fxmodule, 'flexio_handler', None)
# if callable(handler):
# handler(context)
# flexioext.run(flexio_start_handler)
import flexio as flexioext
import sys
import subprocess
import select
impo... |
__init__.py | """Easy to use python subprocess interface."""
import logging
import os.path
import signal
import subprocess
import tempfile
import threading
import time
from typing import Any, List, Optional, Union
from easyprocess.about import __version__
from easyprocess.unicodeutil import split_command, unidecode
log = logging.g... |
loadingDots.py | from .loading import customLoad
from .color import textManage
import multiprocessing as mp
import time
import sys
from .cursor import hide
from .cursor import show
class loadingDots(customLoad):
"""
Use as context manger to start a process for showing a loading dots as the interior code runs
Attributes
... |
sensorserver.py | import SocketServer
import boto.dynamodb2
import threading
import socket
import time
import ParkingDYDBLoader
#from atomicLong import AtomicLong
from boto.dynamodb2.table import Table
from boto.dynamodb2.items import Item
global listab
listab=list()
global listad
listad={}
global numoperations
numoperations=0
clas... |
tabs.py | import os
import glob
import logging
import threading
import Tkinter, ttk, tkFileDialog
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from mesher.voxel import Point
class Tab(Tkinter.Frame):
def __init__(se... |
geo_locations.py | __author__ = 'Harsh'
import threading
import mongo_connect
main_list=[]
def get_geo(a,b):
print('thread start'+str(a)+" "+str(b))
connection=mongo_connect.connect()
mylist=[]
for post in range(a,b):
mylist.append(connection.find()[post]["GEO"])
mylist=list(dict.fromkeys(mylist))
main_lis... |
WikidataBuilder.py | #!/usr/bin/env python3
from threading import Thread
from typing import List, Tuple
from wikidata.entity import EntityId
from builder.CharacterBuilder import CharacterBuilder
from models.Character import Character
from models.LineageMethod import LineageMethod
from mywikidata.WikidataWrapper import WikidataWrapper
c... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
launcher.py | from tkinter import *
from tkinter import ttk
from tkinter.messagebox import *
from lib.cartesian import *
import threading
import subprocess
import sys
import os
import time
import hid
import struct
FRAME_HEADER = 0x55
CMD_SERVO_MOVE = 0x03
CMD_MULT_SERVO_UNLOAD = 0x14
CMD_MULT_SERVO_POS_READ = 0x15
RASPBERRY_PI ... |
test_bz2.py | from test import support
from test.support import bigmemtest, _4G
import unittest
from io import BytesIO, DEFAULT_BUFFER_SIZE
import os
import pickle
import glob
import tempfile
import pathlib
import random
import shutil
import subprocess
import threading
from test.support import unlink
import _compression
import sys
... |
bp.py | """
# ===========================================================================
# Interface between the ION's implementation of the Bundle Protocol and Python.
# Internally, all classes call the C Extension _bp.
#
# Author: Marc Sanchez Net
# Date: 04/17/2019
# Copyright (c) 2019, California Institute of Technolo... |
gui.py | ###########################################################
# gui.py
# GUI script file of DetExploit.
# DetExploit (https://github.com/moppoi5168/DetExploit)
# Licensed by GPL License
###########################################################
import base64
import configparser
import datetime
import platform
import th... |
bot.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys
import config
import time
import datetime
import subprocess
import json
import logging
import threading
import re
import telebot
from telebot import types
from telebot import util
# ##### TONTgBot
# API Token
bot = telebot.TeleBot(config.TgBotAPIKey)
# /A... |
lm_client_tests.py | #!/usr/bin/env python3
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from builtins import... |
conftest.py | from multiprocessing import Process
from .. import server
import pytest
@pytest.fixture(scope='session', autouse=True)
def server_setup():
instance = server.create_server()
process = Process(target=instance.serve_forever)
process.daemon = True
process.start()
|
models.py | """ Module to expose trained models for inference."""
from queue import Queue
from threading import Thread
import tensorflow as tf
from tensorflow.contrib.learn import RunConfig
from threaded_estimator import iris_data
class FlowerClassifier:
""" A light wrapper to handle training and inference with the Iris c... |
webcam.py | # import the necessary packages
import time
from threading import Thread
import cv2
class WebcamVideoStream:
def __init__(self, src=0, name="WebcamVideoStream"):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
#self.stream.set(cv2.CAP_PR... |
analysis.py | from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import object
import re, collections
import threading, queue, time
from reston.core.anconf import error, warning, debug, is_ascii_problem
from... |
home.py | import time
import threading
import re
import xbmc
import xbmcgui
import kodigui
from lib import util
from lib import backgroundthread
from lib import colors
from lib import player
import plexnet
from plexnet import plexapp
import windowutils
import playlists
import busy
import opener
import search
import optionsdi... |
dandine.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import pypot.robot
import time
import json
import math
import sys
import threading
import time
import queue
from serial import Serial
def dist(a,b):
return math.sqrt((a*a)+(b*b))
def get_y_rotation(x,y,z):
radians = math.atan2(x, dist(y,z))
r... |
master.py | """
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
"""
import collections
import copy
import ctypes
import functools
import logging
import multiprocessing
import os
import re
import signal
import stat
import sy... |
daemon.py | import logging
import multiprocessing
import os
import signal
import socket
import sys
from pathlib import Path
from queue import Queue, Empty as EmptyQueue
from threading import Barrier, Event, Thread
from time import sleep
from .. import utils
from ..messages import Request, ShellResponse
from ..messages.startup imp... |
modular_synthetic_dataset_maker.py | import os, multiprocessing, timeit
from SyntheticDataset2.ImageCreator import *
from SyntheticDataset2.logger import Logger
class ModularSyntheticDatasetMaker(object):
@staticmethod
def run_modular_target_maps_generator(number_of_target_maps, number_of_targets_on_each_map, process_number):
for index i... |
__init__.py | import os.path
import sys
import threading
from time import sleep
from tkinter import messagebox, ttk
from thonny import get_workbench, ui_utils
from thonny.languages import tr
from thonny.misc_utils import find_volume_by_name
from thonny.plugins.micropython import (
BareMetalMicroPythonConfigPage,
BareMetalMi... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
WebApp.py | # WebApp
# Brandon Joffe
# 2016
#
# Copyright 2016, Brandon Joffe, 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
#
# ... |
fault_tolerance_test.py | # Lint as: python3
# Copyright 2020 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 requ... |
mati.py | import os, sys, time
try:
import socks, requests, wget, cfscrape, urllib3, time
except:
if sys.platform.startswith("linux"):
os.system("pip3 install pysocks requests wget cfscrape urllib3 scapy")
elif sys.platform.startswith("freebsd"):
os.system("pip3 install pysocks requests wget cfscrape... |
test_io.py | import sys
import gzip
import os
import threading
from tempfile import mkstemp, NamedTemporaryFile
import time
from datetime import datetime
import warnings
import gc
from numpy.testing.utils import WarningManager
import numpy as np
import numpy.ma as ma
from numpy.lib._iotools import ConverterError, ConverterLockErro... |
_coreg_gui.py | # -*- coding: utf-8 -*-
u"""Traits-based GUI for head-MRI coregistration.
Hierarchy
---------
This is the hierarchy of classes for control. Brackets like [1] denote
properties that are set to be equivalent.
::
CoregFrame: GUI for head-MRI coregistration.
|-- CoregModel (model): Traits object for estimating the h... |
stock_scheduler_compute.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
#
# Order Point Method:
# - Order if the virtual stock of today is below the min of the defined order point
#
from odoo import api, models, tools
import logging
import threading
_logger = logging.getLogger(__name__... |
run.py | import configuration
import time
import multiprocessing
import os
# Create logging directories
if not os.path.exists(configuration.logging_details['CHK_POINT_DIR']):
os.makedirs(configuration.logging_details['CHK_POINT_DIR'])
if not os.path.exists(configuration.logging_details['LOG_FILE_PATH']):
os.makedirs(c... |
test_attention.py | import torch_blocksparse
import torch
import multiprocessing
from utils import *
from nose.tools import nottest
from parameterized import parameterized
def task(query, key, value, add_mask, Embed, NumHeads, sparsity):
mha = torch_blocksparse.MultiheadAttention(Embed, NumHeads, sparsity).cuda()
mha(query, key,... |
Chess_v0_8_threading.py | import multiprocessing
import threading
import pygame
from pygame.locals import *
import os
import os.path
import random
import time
from tkinter import Tk
import math
from copy import deepcopy
import numpy
class Board():
def __init__(self):
self.dark_square = pygame.image.load(os.path.j... |
indexing.py | # Copyright (c) 2014, 2015, 2017 Lukas Lalinsky, Wieland Hoffmann, MetaBrainz Foundation
# License: MIT, see LICENSE for details
import multiprocessing
import signal
import sentry_sdk
from . import config, querying, util
from .schema import SCHEMA
from ConfigParser import NoOptionError
from functools import partial
f... |
flask_ngrok_url_tg.py | from flask import Flask
from pyngrok import ngrok
import threading,time
import telebot
app = Flask(__name__)
port = 4567
bot_token = "1234567890:AABBCCDDEEffggaasadasb_hfgm6eJ5df"
telegram_user_id_for_new_url=123456789
bot = telebot.TeleBot(bot_token)
@app.route('/', methods=['post', 'get'])
def main():
return 'wor... |
user_profile_cache.py | from threading import Thread
import time
from JobBrowserBFF.cache.UserProfileCache import UserProfileCache
from JobBrowserBFF.Config import Config
config = Config()
LOOP_INTERVAL = config.get_int("cache-refresh-interval")
INITIAL_DELAY = config.get_int("cache-refresh-initial-delay")
def refresh_cache():
cache_pa... |
stockpanel.py | """ Stock panel
Displays and updates information about various stocks with some interactive ability for a user to choose the stock
being displayed and to change the timeframe over which information is displayed.
Note that this panel is not intended to be used for professional investing.
"""
from typing import Iterab... |
rpc.py | # coding: utf-8
import sys
import types
import importlib
import threading
import socket
if sys.version_info.major >= 3:
import xmlrpc.server as _xmlrpc_server
import xmlrpc.client as _xmlrpc_client
else:
import SimpleXMLRPCServer as _xmlrpc_server
import xmlrpclib as _xmlrpc_client
import yurlungur
fr... |
make_maps.py |
'''
Created on Nov 9, 2011
@author: Mirna Lerotic, 2nd Look Consulting
http://www.2ndlookconsulting.com/
Copyright (c) 2013, Stefan Vogt, Argonne National Laboratory
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the ... |
celery_command.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... |
onnxruntime_test_python.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: UTF-8 -*-
import unittest
import os
import numpy as np
import onnxruntime as onnxrt
import threading
import sys
from helper import get_name
from onnxruntime.capi.onnxruntime_pybind11_state import Fail
class Tes... |
smtio.py | #
# yosys -- Yosys Open SYnthesis Suite
#
# Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#... |
OutputRedirectionTest.py | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Red... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
concurrency_test.py | # Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
model_logging.py | import tensorflow as tf
import numpy as np
import scipy.misc
import threading
try:
from StringIO import StringIO # Python 2.7
except ImportError:
from io import BytesIO # Python 3.x
class Logger:
def __init__(self,
log_interval=50,
validation_interval=200,
... |
process.py | # coding: utf-8
"""JupyterLab Server process handler"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import atexit
import logging
import os
import re
from shutil import which as _which
import signal
import subprocess
import sys
import threading
import time
impor... |
socketer.py | # Using sockets to transfer data between Ren'Py and MASM
# TODO: Ping-Pong alive check messages
import json
import time
import socket
import threading
class MASM:
data = {}
commThread = None
serverSocket = None
commRun = threading.Event()
commLock = threading.Lock()
@staticmethod
def _startThread():
MASM._co... |
manualpeak.py | from clicky2d import Clicky2D
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from qkinz import Qkinz
from itertools import zip_longest
import threading
from sklearn.linear_model import LinearRegression
import argparse
import yaml
from typing import Tuple, List, Callable
Peaklist = Tuple[L... |
benchmark.py | #!/usr/bin/env python
# ======================================================================
# This software is distributed under the MIT license reproduced below:
#
# Copyright (C) 2009-2014 Giampaolo Rodola' <g.rodola@gmail.com>
#
# Permission to use, copy, modify, and distribute this software and
# its docum... |
car_helpers.py | import os
from typing import Dict, List
from cereal import car
from common.params import Params
from common.basedir import BASEDIR
# from system.version import is_comma_remote, is_tested_branch
from selfdrive.car.interfaces import get_interface_attr
from selfdrive.car.fingerprints import eliminate_incompatible_cars, a... |
mp_det_coco_fmt_pipe.py | # Run detection in real-time setting on a COCO-format dataset
# import os
# os.system('taskset -p 0xffffffff %d' % os.getpid())
import argparse, json, pickle
from os.path import join, isfile, basename
from glob import glob
from time import perf_counter
import multiprocessing as mp
import traceback
from t... |
LocalDiscovery.py | # Zeroconf discovery of other BT clients on the local network.
#
# by Greg Hazel
import sys
import random
import socket
import logging
import Zeroconf
from BTL import stackthreading as threading
from BTL.HostIP import get_deferred_host_ip, get_host_ip
discovery_logger = logging.getLogger('LocalDiscovery')
discovery_l... |
bridge.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
import inject
import paho.mqtt.client as mqtt
import rospy
from .util import lookup_object, extract_values, populate_instance
from threading import Condition
from queue import Queue
from uuid import uuid4
from th... |
Tab2.py | # coding: utf-8
import tkinter as tk
from tkinter import ttk
import os
from os import path
from tkinter import filedialog as fd
import sys
from threading import Thread
from Tooltip import createToolTip
sys.path.append('../')
from Fun.pdf2txt import trans
class Tab2():
def __init__(self,tab,i18n):
self._cr... |
racunalnik.py | import threading # za vzporedno izvajanje
import logging
from alfabeta import *
######################################################################
## Igralec računalnik
class Racunalnik():
def __init__(self, gui, algoritem):
self.gui = gui
self.algoritem = algoritem # Algoritem, ki izračuna ... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
import os
import pickle
import random
import re
import subprocess
import sys
import sysconfig
import textwrap
import time
import unittest
from test import support
from te... |
moca_memory.py | # Ω*
# ■ ■■■■■
# ■ ■■ ■■
# ■ ■■ ■
# ■ ■■
# ■■■■■ ■ ■■■
# ■■ ■■ ■ ■■■
# ■■ ■■ ■ ■■■■
# ■■ ■■ ■ ■■■■
# ■■■■■■■■■ ■ ■■■
... |
utils.py | """This module includes some general-purpose utility functions and classes
"""
import os
import shutil
import socket
import pickle
import logging
import time
from multiprocessing import Process, Queue
from queue import Empty
__all__ = [
"ParallerRunner",
"SocketCollector",
"TestDirectory",
]
class Socke... |
kb_prodegeServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
tool.py | #!/usr/bin/env python3
##
# 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
... |
longshort.py | import alpaca_trade_api as tradeapi
import threading
import time
import datetime
import multiprocessing as mp
from .basestrat import BaseStrat
API_KEY = None
API_SECRET = None
APCA_API_BASE_URL = "https://paper-api.alpaca.markets"
class LongShort(BaseStrat):
def __init__(self, _API_KEY, _API_SECRET, pip... |
packing_launcher.py | import os
import threading
scriptpath = "C:/Users/..." # MODIFY ME -> this will be the backdoor (clientwin.exe)
exepath = "C:/Users/..." # MODIFY ME -> this will be the fron program (minesweeper.exe)
backupexe = "C:/Users/..." # MODIFY ME -> this will be bacup.exe or b2.exe
def front():
os.startfile(exepath)
de... |
server.py | # -*- coding: utf-8 -*-
"""
livereload.server
~~~~~~~~~~~~~~~~~
WSGI app server for livereload.
:copyright: (c) 2013 - 2015 by Hsiaoming Yang
:license: BSD, see LICENSE for more details.
"""
import os
import time
import shlex
import logging
import threading
import webbrowser
from subprocess impor... |
integration.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 u... |
conditon_var_problem_fix.py | import time
from threading import Condition, Lock, Thread
cv = Condition()
done = 0
def thread1():
global done
with cv:
print("the notifer is runnnning")
time.sleep(2)
done = 1
cv.notify()
print("notifer finishhhh and notify all other waiting threads (i hope so)")
def... |
scanner.py | #!/usr/bin/python3
from ipaddress import IPv4Network
from threading import Thread, Lock
from queue import Queue
from configuration import env
import socket
import select
import errno
import time
import re
scan_nthreads=int(env.get("SCAN_NTHREADS","32"))
scan_batch=int(env.get("SCAN_BATCH","64"))
scan_timeout=float(en... |
findduplicates-t.py | #!/usr/bin/env python3
# Copyright (c) 2008-11 Qtrac Ltd. All rights reserved.
# This program or module 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 option) an... |
control.py | from __future__ import absolute_import
from select import select
import errno
import functools
import itertools
import json
import logging
import os
import socket
import threading
import time
import traceback
log = logging.getLogger(__name__)
from .utils import makedirs, unlink
class TimeOut(Exception):
pass
... |
EXECUTE.py | from GUI import GUI
from TCP import TCP_RUN
from threading import Thread
import queue
#COMPARTIR VARIABLES ENTRE THREADS
def TEST(share):
while True:
print(share.get())
if __name__=="__main__":
share=queue.Queue()
share.put("Default")
Process1=Thread(target=TCP_RUN,args=(share,))
Process2=... |
multiChatServer.py | """ Script for TCP chat server - relays messages to all clients """
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
clients = {}
addresses = {}
HOST = "192.168.1.123";#"127.0.0.1"
PORT = 5000
BUFSIZ = 1024
ADDR = (HOST, PORT)
SOCK = socket(AF_INET, SOCK_STREAM)
SOCK.bind(ADDR)
def acce... |
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... |
test_zmq.py | # Copyright 2015 Oursky Ltd.
#
# 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, ... |
utils.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-11-06 11:50:13
import math
import logging
import hashlib
import datetime
import socket
import base64
import warnings
import threading
import six
from... |
train_faster_rcnn_alt_opt.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
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>
#
#############################################################... |
vlc.py |
import asynchat
import asyncore
import os
import random
import re
import socket
import subprocess
import sys
import threading
import time
import urllib.error
import urllib.parse
import urllib.request
from syncplay import constants, utils
from syncplay.messages import getMessage
from syncplay.players.basePlayer import... |
knn.py | from math import pow
from collections import defaultdict
from multiprocessing import Process, cpu_count, Queue
import numpy as np
class Neighbor(object):
"""
一个结构体,用来描述一个邻居所属的类别和与该邻居的距离
"""
def __init__(self, class_label, distance):
"""
:param class_label: 类别(y).
:param distan... |
client.py | import socket,time
from threading import Thread
from subprocess import call
server_down=0
webserver_owner=0
chat_admin=0
chatroom=0
chatroom_name=""
username=""
file_size=0
file_name=""
global file_transfer
file_transfer=0
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
def sendMsg():
while True:
... |
fsfloader.py | from simconnect.utils import *
from ctypes import *
from ctypes.wintypes import *
import time, sys, subprocess, threading, configparser, os
import psutil
WM_DESTROY = 0x02
WNDPROCTYPE = WINFUNCTYPE(c_longlong, HWND, c_uint, WPARAM, LPARAM)
class WNDCLASSEX(Structure):
_fields_ = [("cbSize", c_uint), ("style", c_ui... |
tspmt.py | # Mishukov Konstantin
# 2021
import os
import getopt
from multiprocessing import *
import sys
import time
from typing import Optional
import multiprocessing
from myQueue import Queue
import numpy as np
# tspmt.py -i m.txt
path = ''
testing = False
try:
opts, args = getopt.getopt(sys.argv[1:], "hi:t", ["ifile="]... |
threading.py | import threading
import time
from threading import Thread
from typing import Callable
def _start_thread_periodically(dt: int, func: Callable) -> Thread:
thread = threading.Thread(target=_periodically(dt, func))
thread.daemon = True
thread.start()
return thread
def _periodically(dt: int, func: Callab... |
save_logs_periodically.py | import os
import sys
import time
import subprocess
from threading import Thread
from metaflow.metaflow_profile import profile
from metaflow.sidecar import SidecarSubProcess
from . import update_delay, BASH_SAVE_LOGS_ARGS
class SaveLogsPeriodicallySidecar(object):
def __init__(self):
self._thread = Thread... |
bpytop.py | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member, unsubscriptable-object
# indent = tab
# tab-size = 4
# Copyright 2021 Aristocratos (jakob@qvantnet.com)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
video_writing.py | from threading import Thread
import cv2
class VideoWritingThreading(object):
def __init__(self, src=0):
# Create a VideoCapture object
self.capture = cv2.VideoCapture(src)
# Default resolutions of the frame are obtained (system dependent)
self.frame_width = int(self.capture.get(3))... |
signal_monitor.py | # ------------------------------------------------------------------------------
# Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0. "
#
# F... |
central_spooler.py | import logging
import socket
import json
import base64
import Queue
import os
import threading
class IncommingJob():
def __init__(self, con, addr, toRelease):
self.toRelease = toRelease
self.con = con
self.addr = addr
self.logger = logging.getLogger("JobHandler")
jobRaw = ... |
dbt_integration_test.py | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, modify, merge, pu... |
__init__.py | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__release__ = '3.0-dev'
__version__ = '$Id: ede13695872939f4cedbb139bd03ead318ef64cb $'
__u... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from socketserver import ThreadingMixIn
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
import threading
import http.server
import json
import queue
import socket
import subprocess
import time
... |
websocket_client.py | import json
import logging
import gzip
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:
"""
Websocke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.