source
stringlengths
3
86
python
stringlengths
75
1.04M
test_client_reconnect.py
from concurrent import futures import contextlib import os import threading import sys import grpc import time import random import pytest from typing import Any, Callable, Optional from unittest.mock import patch import ray import ray.core.generated.ray_client_pb2 as ray_client_pb2 import ray.core.generated.ray_clie...
sync.py
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
__init__.py
"""Miscellaneous helper functions (not wiki-dependent).""" # # (C) Pywikibot team, 2008-2022 # # Distributed under the terms of the MIT license. # import collections import gzip import hashlib import ipaddress import itertools import os import queue import re import stat import subprocess import sys import threading im...
subproc_vec_env.py
# From https://github.com/hill-a/stable-baselines # Stable Baselines' license is located at https://github.com/hill-a/stable-baselines/blob/master/LICENSE from abc import ABC, abstractmethod import torch from baselines import logger from baselines.common.tile_images import tile_images from baselines.common.vec_env im...
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...
main.py
from PyQt4 import QtCore, QtGui from threading import Thread import uimainwindow as mw import kratom import sys def main(): app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() ui = mw.UiMainWindow() ui.setupUi(MainWindow) # DB STUFF kratom.initialize_db() # refresh subsc...
__init__.py
import copy import os import threading import time import json import operator import pkg_resources # anchore modules import anchore_engine.clients.localanchore_standalone import anchore_engine.common.helpers from anchore_engine.clients.services import internal_client_for from anchore_engine.clients.services.simpleque...
limit_.py
import sys import dill import time import psutil from collections import namedtuple from multiprocessing import Process, freeze_support, Pipe class SignalException(Exception): pass class TimeoutException(Exception): pass class OutOfMemoryLimitException(Exception): pass def get_platform(): platfo...
sdk_worker_main.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...
manager.py
import argparse import webbrowser import json import traceback import socket import threading import signal import os from lyrebird import log from lyrebird import application from lyrebird.config import Rescource, ConfigManager from lyrebird.mock.mock_server import LyrebirdMockServer from lyrebird.proxy.proxy_server i...
oepoll.py
# -*- coding: utf-8 -*- from .client import LINE from types import * import os, sys, threading, time class OEPoll(object): OpInterrupt = {} client = None __squareSubId = {} __squareSyncToken = {} def __init__(self, client): if type(client) is not LINE: raise Exception('You nee...
aprilboard_plots_classical.py
import numpy as np import matplotlib.pyplot as plt import random import pickle import cv2 as cv import glob from time import sleep from multiprocessing import Process, Manager def process_image(L,params, i): corners, objPoints, gray_shape = params ret, mtx, dist, rvecs, tvecs, stdDeviationsIntrinsics, stdDe...
misc.py
import subprocess from fnmatch import fnmatch import multiprocessing multiprocessing.set_start_method('fork') from time import sleep, time import itertools __copyright__ = "Copyright 2016-2020, Netflix, Inc." __license__ = "BSD+Patent" import sys import errno import os import re from vmaf import run_process from vma...
callbacks_test.py
# Copyright 2016 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...
cta_trader_no_ui.py
# encoding: UTF-8 import sys reload(sys) sys.setdefaultencoding('utf8') import multiprocessing from time import sleep from datetime import datetime, time from event import EventEngine2 from trader.vtEvent import EVENT_LOG, EVENT_ERROR from trader.vtEngine import MainEngine, LogEngine from trader.gateway import ctpGa...
run_sniper.py
import sys, os, time, subprocess, threading, tempfile, sniper_lib def Tee(filename, prefix = ''): open(filename, 'w').close() # Make sure is writeable and empty obj = subprocess.Popen(['bash', '-c', 'while read line; do echo "%s"$line; echo $line >> %s; done' % (prefix, filename)], stdin = subprocess.PIPE) retur...
interface.py
#!/usr/bin/python3 -OO # Copyright 2007-2021 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...
web.py
""" Websocket server entry """ import os import sys import json import traceback import threading import tornado.websocket import tornado.ioloop import tornado.httpserver import tornado.web from tornado import gen from .. import VERSION from ..devices.base.event_base import EventBase from ..framework.communicator impo...
test_dgx.py
import multiprocessing as mp import os import subprocess from enum import Enum, auto from time import sleep import numpy import pytest from tornado.ioloop import IOLoop from dask import array as da from distributed import Client from distributed.utils import get_ip_interface from dask_cuda import LocalCUDACluster fr...
smart_explainer.py
""" Smart explainer module """ import logging import copy import tempfile import shutil import pandas as pd from shapash.webapp.smart_app import SmartApp from shapash.utils.io import save_pickle from shapash.utils.io import load_pickle from shapash.utils.transform import inverse_transform, apply_postprocessing from sha...
test_jdatetime.py
import datetime import locale import pickle import platform import sys import threading import time from unittest import TestCase, skipIf, skipUnless import jdatetime try: import greenlet greenlet_installed = True except ImportError: greenlet_installed = False try: import zoneinfo except ImportError:...
bazel_build.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2016 The Tulsi 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/LICE...
stopwatch.py
import tkinter as tk from tkinter.font import Font from time import sleep from threading import Thread class Stopwatch(tk.Frame): def __init__(self, parent): tk.Frame.__init__(self, parent) self.saved = [] self.seconds = 0 self.minutes = 0 self.hours = 0 self.time =...
camTest_bulletTimeServer.py
import time from SimpleCV import Camera import threading from threading import Thread from flask import Flask from flask import send_file import shutil from os import listdir from os.path import isfile, join import json from pprint import pprint data = [] with open('settings.json') as data_file: data = j...
views.py
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.viewsets import ReadOnlyModelViewSet, GenericViewSet from rest_framework.mixins import RetrieveModelMixin, CreateModelMixin from django_redis import get_redis_connection from wechat.core.bot import SaveModelMessa...
bazel_build.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2016 The Tulsi 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/LICE...
autocast_variable_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_s3.py
import boto3 import botocore.session from botocore.exceptions import ClientError from botocore.exceptions import ParamValidationError from nose.tools import eq_ as eq from nose.plugins.attrib import attr from nose.plugins.skip import SkipTest import isodate import email.utils import datetime import threading import re ...
requests-threading.py
#!/usr/bin/env python3 import requests import threading import time def print_report(total_count, total_time_ms): print("Total time for {} requests = {} ms.".format( total_count, total_time_ms)) print("Avg time per request = {} ms.\n".format( total_time_ms / total_count)) print("----------...
readclients.py
from threading import Thread import os import datetime client=16 mountdir="/home/hemalkumar/kalpit/mount_dir/" buff = "" for i in range(1024*1024): buff=buff+"a" def task(i): temp = open(mountdir+str(i),"r") t1=datetime.datetime.now() read=temp.read() t2=datetime.datetime.now() temp.close() ...
visualize_sensors.py
# Author: Shing-Yan Loo (yan99033@gmail.com) # This script spawns a car at a random spawn point in the map # and then visualize the sensor signals # The list of sensors used are as follows: # - camera (only for visualization, not being used for localization) # - IMU # - GNSS import glob import os import sys try: s...
h.py
from pynput.keyboard import Key,Listener from playsound import playsound from json import load import ctypes from os import system from threading import Thread from time import sleep, time from WConio2 import getkey, setcursortype, kbhit from subprocess import Popen path = load(open('s.json')) system('mode 40,7') syste...
vbulletin5-rce.py
```python # coding:utf-8 # Author:LSA # Description:vbulletin 5 rce # Date:20190927 # vbulletin5-rce利用工具(批量检测/getshell) import requests import sys import optparse import threading import datetime import os import Queue import urllib3 from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.pa...
tornado.py
import asyncio import fnmatch import json import logging import os import threading import webbrowser from functools import partial from urllib.parse import urlparse import tornado import tornado.httpserver import tornado.ioloop from tornado.web import StaticFileHandler from tornado.websocket import WebSocketHandler ...
bot.py
# -*- coding: utf-8 -*- from linepy import * from datetime import datetime from threading import Thread from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from string import Template from pathlib import Path from websocket import create_connection import os,sys,youtube_dl,pafy,requests,...
consumer.py
from kafka import KafkaConsumer import json import re # from database_configuration import insert_tweet from nltk.sentiment.vader import SentimentIntensityAnalyzer from time import sleep from multiprocessing import Process, Queue import matplotlib.pyplot as plt import matplotlib.animation as animation topic_name = 'tw...
deploy.py
#Librerias #Camera Streaming from threading import Thread import cv2 #OpenCV #Georeferenciación import numpy as np import serial import re from math import radians, cos, sin, asin, sqrt # FUNCIONES #FUNCION GEOREFERENCIACIÓN def distance(lat1, lat2, lon1, lon2,lat_sgn, lon_sgn): lat1=lat1....
run_exp.py
import os import sys import funcs import time from multiprocessing import Process #dbs = ["vtable"] disk = "/dev/sdc1" isRaid = False paths = {"vtablelarge":"/mnt/vtable/","vtable":"/mnt/vtable/","rocksdb":"/mnt/rocksdb/","titandb":"/mnt/titan/","pebblesdb":"/mnt/pebbles/","rocksdb_tiered":"/mnt/rocksdb/"} backupPath...
test_promise.py
# Copyright 1999-2018 Alibaba Group Holding 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 a...
run.py
#!/usr/bin/env python3 __copyright__ = """ Copyright 2018 Miguel E. Coimbra 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 applic...
test_sparqlstore.py
from rdflib import Graph, URIRef, Literal from six.moves.urllib.request import urlopen import os import unittest from nose import SkipTest from requests import HTTPError from http.server import BaseHTTPRequestHandler, HTTPServer import socket from threading import Thread import requests try: assert len(urlopen("ht...
connect_manager.py
#!/usr/bin/env python # coding:utf-8 import os import errno import binascii import time import socket import select import Queue import struct import threading import operator import httplib import socks from proxy import xlog current_path = os.path.dirname(os.path.abspath(__file__)) import OpenSSL SSLError = OpenSS...
pushbullet.py
""" Pushbullet platform for sensor component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.pushbullet/ """ import logging import voluptuous as vol from homeassistant.const import (CONF_API_KEY, CONF_MONITORED_CONDITIONS) from homeassistant.com...
listen.py
from typing import List from rtlsdr import RtlSdr import argparse import datetime import numpy as np import pyaudio import scipy.signal as signal import speech_recognition as sr import threading import time import requests import os from dotenv import load_dotenv load_dotenv() SampleStream = List[float] AudioStream ...
http.py
""" Http handler for interactive mode. """ import json import six import uuid import inspect import threading from six.moves.BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from six.moves.socketserver import ThreadingMixIn from six.moves.urllib.parse import urlparse from testplan.common.utils.exceptions imp...
fbx_patch.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 later version. # # This program is distrib...
FTnetmap.py
'''Example : python FTnetmap.py -r 192.168.0.0-192.168.2.0 if you run like python FTnetmap.py, defaultly assing ip 192.168.0.0-192.168.2.0 ----Function structure---- usage() convert_ip_int(ip) main() parse_arguments() start_scanning(ip) handle_ip_format(ip) ping_...
market_app.py
# !-*-coding:utf-8 -*- # @TIME : 2018/6/11/0011 15:32 # @Author : Nogo import math import time import talib import numpy as np import logging from collections import defaultdict from threading import Thread from fcoin import Fcoin from WSS.fcoin_client import fcoin_client from balance import balance import config...
test_index.py
import logging import time import pdb import threading from multiprocessing import Pool, Process import numpy import pytest import sklearn.preprocessing from utils import * nb = 6000 dim = 128 index_file_size = 10 BUILD_TIMEOUT = 300 nprobe = 1 top_k = 5 tag = "1970_01_01" NLIST = 4046 INVALID_NLIST = 100000000 field_...
process_attr.py
from multiprocessing import Process from time import sleep def fun(): print("开始运行一个进程喽") sleep(2) print("终于完成事情结束喽") p=Process(target=fun,name="Aid",daemon=True) p.start() print(p.name) #进程名称 print(p.pid) #对应子进程的PID号 print(p.is_alive()) #查看子进程是否在生命周期
import_logs.py
#!/usr/bin/python3 # vim: et sw=4 ts=4: # -*- coding: utf-8 -*- # # Matomo - free/libre analytics platform # # @link https://matomo.org # @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later # @version $Id$ # # For more info see: https://matomo.org/log-analytics/ and https://matomo.org/docs/log-analytics-...
stoppable_thread.py
from collections import deque from threading import Lock, Thread from typing import Callable, List class ThreadSafeVariable: """ Represents a thread safe variable. All accesses are protected by a lock using the Python "with" statement """ def __init__(self): self.lock = Lock() self.v...
data_writer.py
# Copyright 2020 KCL-BMEIS - King's College London # 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...
compile_mjml.py
import subprocess import shutil import os import argparse from pathlib import Path from threading import Thread parser = argparse.ArgumentParser() parser.add_argument("-o", "--output", help="output directory for .html and .txt files") args = parser.parse_args() def runcmd(cmd): if os.name == "nt": return...
run_end_to_end_tests.py
#!/usr/bin/env python3 # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
context_sort.py
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from random import shuffle from time import sleep from sort import Sort from db import DataSort from threading import Thread, stack_size import os import pandas as pd stack_size(134217728) class ContextSort(object): """ ...
ssh_threads.py
#!/usr/bin/env python # Foundations of Python Network Programming - Chapter 16 - ssh_threads.py # Running two remote commands simultaneously in different channels import threading import paramiko class AllowAnythingPolicy(paramiko.MissingHostKeyPolicy): def missing_host_key(self, client, hostname, key): r...
utils.py
#================================================================ # # File name : utils.py # Author : PyLessons # Created date: 2020-09-27 # Website : https://pylessons.com/ # GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3 # Description : additional yolov3 and yolov4 functio...
s3.py
""" Object Store plugin for the Amazon Simple Storage Service (S3) """ import logging import multiprocessing import os import shutil import subprocess import threading import time from datetime import datetime try: # Imports are done this way to allow objectstore code to be used outside of Galaxy. import boto ...
test_etcd_engine.py
# (C) Copyright 1996- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernment...
test_locks.py
# -*- coding:utf-8 -*- from threading import Thread import pytest from django.db import OperationalError, connection from django.db.transaction import TransactionManagementError, atomic from django.test import TestCase, TransactionTestCase from django.utils.six.moves import queue from django_mysql.exceptions import T...
wikisourcetext.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ This bot applies to wikisource sites to upload text. Text is uploaded to pages in Page ns, for a specified Index. Text to be stored, if the page is not-existing, is preloaded from the file used to create the Index page, making the upload feature independent from the forma...
cached_data_server.py
#!/usr/bin/env python3 """Accept data in DASRecord or dict format via the cache_record() method, then serve it to anyone who connects via a websocket. A CachedDataServer can be instantiated by running this script from the command line and providing one or more UDP ports on which to listen for timestamped text data tha...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
tello.py
import socket import threading import time from stats import Stats class Tello: def __init__(self): self.local_ip = '' self.local_port = 8889 self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # socket for sending cmd self.socket.bind((self.local_ip, self.local_port)) ...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform import functools impor...
cifar100_to_mr.py
# Copyright 2019 Huawei Technologies Co., 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...
classes.py
import pickle import threading from qiskit import IBMQ, Aer, execute from exceptions import InvalidDeviceException, DuplicateNameException, InvalidTupleTypeException from qiskit.ignis.characterization.coherence import t1_circuits, t2_circuits from qiskit.ignis.characterization.coherence import T1Fitter, T2StarFitter,...
__init__.py
''' PyMOL Molecular Graphics System Copyright (c) Schrodinger, Inc. Supported ways to launch PyMOL: If $PYMOL_PATH is a non-default location, it must be set and exported before launching PyMOL. From a terminal: shell> python /path/to/pymol/__init__.py [args] From a python main thread: >>> # with G...
env.py
""" jupylet/env.py Copyright (c) 2020, Nir Aides - nir@winpdb.org 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 li...
server Non Blocking.py
import socket import threading from queue import Queue import datetime import sys import json sc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) port = 2000 try: sc.bind(('', port)) except Exception as e: print(e) print("Waiting for connections") sc.listen() byteLen = 90023 def recvMsg(leng, client): ...
server_test.py
# Import RangeHTTPServer from this project, not the global install. import sys sys.path = ['.'] + sys.path from RangeHTTPServer import RangeRequestHandler from nose.tools import * try: # Python 3 from http.server import HTTPServer except ImportError: # Python2 from BaseHTTPServer import HTTPServer i...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper from test.support import warnings_helper import sock...
clusterTable.py
""" clusterTable.py Copyright 2008 Andres Riancho This file is part of w3af, http://w3af.org/ . w3af 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 version 2 of the License. w3af is distributed in the hope tha...
util.py
"""Utilities for working with mulled abstractions outside the mulled package.""" import collections import hashlib import logging import re import sys import tarfile import threading from io import BytesIO import packaging.version import requests log = logging.getLogger(__name__) QUAY_REPOSITORY_API_ENDPOINT = 'htt...
process_replay.py
#!/usr/bin/env python3 import importlib import os import sys import threading import time import signal from collections import namedtuple import capnp from tqdm import tqdm import cereal.messaging as messaging from cereal import car, log from cereal.services import service_list from common.params import Params from ...
proxyscraper.py
import json import os import requests import time scrapeortest = input("Scrape, Test or both? (1, 2 or 3) ") if scrapeortest == str(1): # Executing Status Request ProxyStatus = requests.get("https://api.proxyscrape.com/v2/?request=proxyinfo&simplified=true") OnlyPS = input("Do you wa...
test_enum.py
import enum import inspect import pydoc import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test import support from datetime import timede...
threading_utils_test.py
#!/usr/bin/env python # Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import functools import signal import sys import threading import time import traceback import unittest # Mutates sys.path....
sttools.py
from threading import Thread from functools import wraps, partial from concurrent.futures import ThreadPoolExecutor import sublime import sublime_plugin class _Singleton(type): def __init__(self, *args, **kwargs): self.__instance = None super().__init__(*args, **kwargs) def __call__(self, *...
playground.py
# To use Inference Engine backend, specify location of plugins: # export LD_LIBRARY_PATH=/opt/intel/deeplearning_deploymenttoolkit/deployment_tools/external/mklml_lnx/lib:$LD_LIBRARY_PATH import argparse import random import threading import time import cv2 as cv import playsound import pyttsx3 def thread_second(): ...
Logger.py
import logging import os import queue import threading import time import Settings from logging import handlers from Utils import utils class MyLogger(logging.Logger): def __init__(self, name, level='INFO', fmt=None, interval=1, backup_count=10, when='D'): super().__init__(name) self.setLevel(lev...
distributed.py
import sys import os current_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(root_path) import json import signal import threading import torch from flownmt.data import NMTDataSet import experiments.options as options from ex...
browser.py
import asyncio import pyppeteer import random import time import string import requests import logging from threading import Thread # Import Detection From Stealth from .stealth import stealth from .get_acrawler import get_acrawler async_support = False def set_async(): global async_support async_support = T...
hoymiles.py
__author__ = 'dmslabs' from os.path import realpath import requests from requests.models import HTTPBasicAuth, Response, StreamConsumedError from requests import Request, Session import hashlib from string import Template import json import configparser import logging import dmslibs as dl import comum from dmslibs im...
tests.py
""" Unit tests for reverse URL lookups. """ import sys import threading from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist from django.http import ( HttpRequest, ...
ALL_IN_ONE.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # Импорт библиотек import math import rospy import time from sensor_msgs.msg import Image from sensor_msgs.msg import CameraInfo from std_msgs.msg import Int32, Header, Float32 from cv_bridge import CvBridge, CvBridgeError import cv2 import numpy as np from threading impo...
unity_client.py
from __future__ import division, print_function import sys import os import threading # _thread was called thread in Python 2.7 # threading.get_ident was called thread.get_ident in Python 2.7 if sys.version_info.major < 3: import thread as _thread threading.get_ident = _thread.get_ident else: import _thre...
plugin_event_multiplexer.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...
test_gluon_utils.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...
FlatCAMApp.py
############################################################ # FlatCAM: 2D Post-processing for Manufacturing # # http://caram.cl/software/flatcam # # Author: Juan Pablo Caram (c) # # Date: 2/5/2014 # # MIT Licence ...
bluetooth_audio.py
#!/usr/bin/env python3 import bluetooth import logging import time import threading import struct import sys import math # from specs SOL_BLUETOOTH = 274 SOL_SCO = 17 BT_VOICE = 11 BT_VOICE_TRANSPARENT = 0x0003 BT_VOICE_CVSD_16BIT = 0x0060 SCO_OPTIONS = 1 L2CAP_UUID = "0100" SCO_HEADERS_SIZE = 16 class BluetoothAudi...
controllers.py
import threading, wx, time, sys, logging, Queue import numpy as np from session import Session from views import View, MP285View from subjects import Subject, list_subjects, list_rewards from settings import manipulations, conditions, manip_strs, default_manipulation from settings.param_handlers import ParamHandler fro...
precompute_guides_msgpack_CFD+FD.py
import msgpack import json import pickle import os.path from Queue import PriorityQueue import re import doench_score import azimuth.model_comparison import numpy as np import pandas as pd import csv from intervaltree import IntervalTree from multiprocessing import Process import os import time start_time = time.time(...
main.py
import logging from logging.handlers import RotatingFileHandler from multiprocessing import Process import meter import offlinemeter import virtualmeter import virtualpoint def main(): """main""" # create logger logger = logging.getLogger('myems-normalization') # specifies the lowest-severity log mess...
codecs_socket_fail.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2008 Doug Hellmann All rights reserved. # import sys import SocketServer class Echo(SocketServer.BaseRequestHandler): def handle(self): # Get some bytes and echo them back to the client. data = self.request.recv(1024) self.req...
dokku-installer.py
#!/usr/bin/env python2.7 import cgi import json import os import re import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.12.13' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = ...
basic_functions.py
# -*- coding: utf-8 -*- import os import tempfile import copy import sys import subprocess import logging import queue import threading import numpy as np from .data_structures import Parameter, ParameterSet, SimulationSetup, \ SimulationSetupSet, Relation ##################### # INPUT FILE HANDLING def create...
data_processing.py
import numpy as np import sys import os sys.path.append('utils/') from config import * from utils import * sys.path.append(pycaffe_dir) import time import pdb import random import pickle as pkl import caffe from multiprocessing import Pool from threading import Thread import random import h5py import itertools import m...
machine.py
from contextlib import _GeneratorContextManager from pathlib import Path from queue import Queue from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple import base64 import io import os import queue import re import shlex import shutil import socket import subprocess import sys import tempfile import t...