source
stringlengths
3
86
python
stringlengths
75
1.04M
sdmain.py
import sublime import sublime_plugin import subprocess import threading import traceback import os import sys import re import signal import uuid import datetime import ctypes from GoDebug.sdconst import DlvConst from GoDebug.sdlogger import DlvLogger from GoDebug.sdworker import DlvWorker from GoDebug.sdview import...
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
inference.py
## 기본 라이브러리 Import import sys import numpy as np import torch import os import argparse ## WaveGlow 프로젝트 위치 설정 sys.path.append('waveglow/') ## Tacontron2 프로젝트 위치 설정 sys.path.append('tacotron2/') ## 프로젝트 라이브러리 Import from .tacotron2.hparams import defaults from .tacotron2.model import Tacotron2 from .tacotron2.layers ...
base.py
import logging import queue import threading import time from typing import Any, Dict, List class SensorBase: def __init__(self, options: Any): self._options = options or {} @property def options(self): return self._options @property def name(self): return self.options["n...
upgrade_tests_collections.py
from .newupgradebasetest import NewUpgradeBaseTest import queue import copy import threading from random import randint from remote.remote_util import RemoteMachineShellConnection from couchbase_helper.tuq_helper import N1QLHelper from pytests.eventing.eventing_helper import EventingHelper from eventing.eventing_base i...
maintenance.py
# Copyright 2019 Red Hat, 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...
transports.py
from .logging import exception_log, debug from .types import TCP_CONNECT_TIMEOUT from .types import TransportConfig from .typing import Dict, Any, Optional, IO, Protocol, List, Callable, Tuple from abc import ABCMeta, abstractmethod from contextlib import closing from functools import partial from queue import Queue im...
ui.py
import os import time from tkinter import * from tkinter import filedialog from tkinter.ttk import * from threading import Thread from .version import * from .mflash import MFlash, CalledProcessError root = Tk() root.title('mfash tools') root.resizable(0, 0) config = LabelFrame(root, labelanchor=N, text='Configure',...
_refdaemon.py
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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...
dumping_callback_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...
compat.py
import threading import logging import sys from xml.etree import cElementTree as ET import os if sys.version_info < (3,): # python 2 import Queue as queue else: # python 3 import queue if sys.version_info < (3,): # python 2 str_ = basestring def clean_repr(x): if isinstance(x, uni...
__init__.py
#!/usr/bin/env python """ fs.tests: testcases for the fs module """ from __future__ import with_statement # Send any output from the logging module to stdout, so it will # be captured by nose and reported appropriately import sys import logging logging.basicConfig(level=logging.ERROR, stream=sys.stdout) from ...
mpris.py
""" Display song/video and control MPRIS compatible players. There are two ways to control the media player. Either by clicking with a mouse button in the text information or by using buttons. For former you have to define the button parameters in your config. Configuration parameters: button_next: mouse button t...
iot_server.py
from essentials import socket_ops_v2 as socket_ops import threading, time from .. import verification from . import messaging class IOT_Server(object): def __init__(self, HOST=None, PORT=None, on_new_connection=None, password=None, on_data=None, on_question=None, on_video_frame=None, on_audio_frame=None, on_...
server.py
#!/usr/bin/python # -*- coding: utf-8 -*- import io import socket import struct import time import picamera import fcntl import sys import threading from Motor import * from servo import * from Led import * from Buzzer import * from ADC import * from Thread import * from Light import * from Ultrasonic import * from L...
common.py
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
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 law ...
get_instance.py
from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep from threading import Thread import VINI_voice from predict_intent import PredictIntent import click_command_interpret from click_command_interpret import get_the_objective import tab_command_parser as tcp fro...
stim_server_client.py
# Author: Mainak Jas <mainak@neuro.hut.fi> # License: BSD (3-clause) from ..externals.six.moves import queue import time import socket from ..externals.six.moves import socketserver import threading import numpy as np from ..utils import logger, verbose class _ThreadedTCPServer(socketserver.ThreadingMixIn, sockets...
ThreadPoolManager.py
# -*- coding: UTF-8 -*- import math import threading import time import traceback import threadpool import Logger from DBUtil import DBUtil from Interpreter import Interpreter from ProxyUtil import ProxyUtil from Spider import Spider ''' 线程池管理类:处理抓取、解析、保存的调度处理 ''' class ThreadPoolManager(): ...
server.py
import os import threading import time import weakref import json from queue import Queue import requests import src.server.req as req import src.server.res as res from src.util import ToolUtil, Singleton, Log from conf import config from src.util.status import Status import urllib3 urllib3.disable_warnings() def ha...
scoring_functions.py
#!/usr/bin/env python from __future__ import print_function, division import numpy as np from rdkit import Chem from rdkit import rdBase from rdkit.Chem import AllChem from rdkit import DataStructs import time import pickle import re import threading import pexpect rdBase.DisableLog('rdApp.error') from utils import ge...
fangcore.py
''' November 2020 - FangCore - Jacob Scrapchansky FangCore is a python library built for creating highly customizable Operating systems. It has incredibly high-level command parsing, script management, remote terminal, and distributed processing tools ''' ''' to add: V1.2: Filer Add Html ssl Make HTTP r...
test_fx.py
# Owner(s): ["oncall: fx"] import builtins import contextlib import copy import functools import inspect import math import numbers import io import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest import torch.nn.utils._stateless as _...
flamaster.py
import multiprocessing import time import wrongs import json class GetWords(object): def __init__(self, words): self.words = words self.shortenwords = [] self.preparedwords = [] def preparation(self): wrongs.notletterCheck(self.words) for word in self.words: ...
screens.py
import asyncio from weakref import ref from decimal import Decimal import re import threading import traceback, sys from typing import TYPE_CHECKING, List from kivy.app import App from kivy.cache import Cache from kivy.clock import Clock from kivy.compat import string_types from kivy.properties import (ObjectProperty,...
test_artifact_cache.py
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import Sim...
test_callback.py
import math import textwrap import sys import pytest import threading import traceback import time import random import numpy as np from numpy.testing import assert_, assert_equal, IS_PYPY from . import util class TestF77Callback(util.F2PyTest): code = """ subroutine t(fun,a) integ...
thread_demo.py
# # # Copyright (C) 2010-2011 Huang Xin # # See LICENSE.TXT that came with this file. import threading import time from StimControl.mangrating import FrameSweep,stimulus_control,stimulus_left,stimulus_right sweep = FrameSweep() def stimcontrol(sweep): sweep.add_stimulus(stimulus_control) sweep.add_stimulus(s...
utils.py
import subprocess import multiprocessing as mp from typing import Optional def run(ssh_cmd): subprocess.check_call(ssh_cmd, shell=True) def execute_remote( cmd: str, ip: str, port: Optional[int] = 22, username: Optional[str] = "" ) -> mp.Process: """Execute command line on remote machine via...
fixdevicedata.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 Device class Command(BaseCommand): help = "更新所有设备的高度(U)、U位范围" batch_size = 256 ...
server.py
import threading import time import socket import os from datetime import datetime from datetime import timedelta import morsepacket events = None #event list to replay at the right time delay = 3 #number of seconds to delay the playback of received morse messages startTime = datetime.now...
main.py
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with # * this work for additional information regarding copyright ownership. # * The OpenAirInterface Software Alliance licenses this file to You under # * the OAI Public L...
downloader.py
#!/usr/bin/env python import ftplib import gzip import logging import os import re import subprocess import tarfile import time from multiprocessing.dummy import Process, Queue from urllib.error import HTTPError from urllib.request import urlretrieve from pavooc.config import (BASEDIR, CHROMOSOMES, DATADIR, GENOME, ...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import codecs import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testin...
balancer.py
from threading import Thread import pika # RabbitMQ import sys import os import random import datetime class Balancer: def __init__(self): print("[*] Creating Balancer.\n") self.trasactions = [] self.balances = {} # {"S0":0} NUMBER OF TRANSACTIONS FOR EACH SERVER self.capacities...
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_system.py
# Copyright 2016 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 ag...
skeletonAppiumRealBrokerPlus.py
################################################################### # Skeleton for Appium tests on Sauce Labs RDC #################################################################### ################################################################### # Imports that are good to use ####################################...
logging_util.py
__package__ = 'archivebox' import re import os import sys import stat import time import argparse from math import log from multiprocessing import Process from pathlib import Path from datetime import datetime, timezone from dataclasses import dataclass from typing import Any, Optional, List, Dict, Union, IO, TYPE_CH...
server.py
import os import os.path as osp import sys BUILD_DIR = osp.join(osp.dirname(osp.abspath(__file__)), "build/service/") sys.path.insert(0, BUILD_DIR) import argparse import threading import grpc from concurrent import futures import paho.mqtt.client as mqtt import fib_pb2 import fib_pb2_grpc history=[] class FibCalcula...
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...
EventLoop.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
utils.py
import psutil import shutil import os import os.path as osp from enum import Enum import multiprocessing as mp from queue import Queue import time import threading from ctypes import CDLL, c_char, c_uint, c_ulonglong from _ctypes import byref, Structure, POINTER import platform import string import logging import socke...
mtime_file_watcher.py
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
crawler.py
import boto import warc from boto.s3.key import Key from gzipstream import GzipStreamFile import sys import gzip import multiprocessing import datetime import re class Process: def __init__(self): global worker self.count = 0 self.start = datetime.datetime.now() sys.stderr.write...
app.py
from flask import Flask, render_template, request, jsonify import database.database as database import milk.milk as milk from threading import Thread app = Flask(__name__) @app.route("/milk", methods=["GET", "POST"]) def milk_index(): if request.method == "POST": if "get_num" in request.form: ...
PingPong.py
import socket import threading import sys import time flagLogin = False #Wait for incoming data from server def receive(socket, signal): print("Recive thread created") while signal: try: data = socket.recv(40) print(str(data.decode("utf-8"))) except: print(...
app.py
from json import dumps, loads from os import environ from threading import Thread from flask import Flask, request from pika import BlockingConnection, ConnectionParameters from helpers import json_respone from srm2local import execute_entrypoint ### Config amqp_host = environ['AMQP_HOST'] amqp_exchange = 'function...
render.py
from pathlib import Path from threading import Thread from renderable_core.models import State, TaskMessage from renderable_core.services import Configuration, APIClient, Renderer, WorkQueue, Executor class Render: def build_parser(self, subparsers): parser = subparsers.add_parser('render', description = 'Rend...
tfactorial.py
import argparse import threading import time # Calculate the factorial def factorial(n, t): time.sleep(n*t/4) print("Start: " + str(t) + ": " + str(n)) if n == 1: res = 1 if t == 1: print("Feel free to break here") else: res = n * factorial(n-1, t) return res ...
02_static_web_server_file.py
import socket import re from multiprocessing import Process # 设置静态文件根目录 HTML_ROOT_DIR = "./html" def handle_client(client_socket): """处理客户端请求""" # 获取客户端请求数据 request_data = client_socket.recv(1024) print("request data:", request_data) request_lines = request_data.splitlines() for line in requ...
test_crt_sp_simultaneously.py
''' Test create 100 snapshots simultaneously @author: Mirabel ''' import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.operations.config_operations as con_ops import zstackwoodpecker.zstack_test.zstack_test_volume as zstack_volume_header import zstackwoodpecker.header.volume as vol...
test_utility.py
import threading import pytest from base.client_base import TestcaseBase from base.utility_wrapper import ApiUtilityWrapper from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks prefix = "utility" defau...
SCHCTimer.py
import threading import time from Entities.exceptions import SCHCTimeoutError class SCHCTimer: def __init__(self, timeout): self.timeout = timeout @staticmethod def wait(timeout, raise_exception=False): t_i = time.perf_counter() while True: t_f = time.perf_counter() ...
ghspider.py
import requests import json import os import datetime import sys from git import Repo from kivy.app import App from kivy.uix.widget import Widget import threading now = datetime.datetime.now() scriptdir = "/ghspider-%d-%d-%d/" % (now.year, now.month, now.day) ghuser = "" if len(sys.argv) > 1: ghuser = sys.argv[1]...
test_sys.py
import unittest, test.support from test.support.script_helper import assert_python_ok, assert_python_failure import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import locale import threading # count the number of test runs, used t...
default.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Source: https://github.com/RyanMelenaNoesis/XbmcSecurityCamOverlayAddOn" # and kodi forum discussion: https://forum.kodi.tv/showthread.php?tid=182540 # # JSONRPC Call to trigger this script: # # curl -s -u <user>:<password> -H "Content-Type: application/json" -X POST -d '{...
core.py
""" Copyright notice ================ Copyright (C) 2018 Julian Gruendner <juliangruendner@googlemail.com> """ import queue import socketserver import threading import time import ssl import uuid import os import json import ipaddress from ds_http.ds_http import HTTPRequest, HTTPResponse from logger i...
mel_scanner.py
""" ROSWELD Version 0.0.1, March 2019 http://rosin-project.eu/ftp/rosweld Copyright (c) 2019 PPM Robotics AS This library is part of ROSWELD project, the Focused Technical Project ROSWELD - ROS based framework for planning, monitoring and control of multi-pass robot welding is co-financed by the EU project ROSIN (www...
wizard.py
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
_runner.py
# Copyright 2015, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
worker_handlers.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...
train.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division from comet_ml import Experiment import argparse import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main ...
monthly.py
# coding: utf-8 import requests import threading import time from queue import Queue import prettytable as pt from app.utils import Loadconfig ifproxy = Loadconfig.ifproxy proxy = Loadconfig.proxy proxies = {'http': 'http://%s'%proxy, 'https': 'http://%s'%proxy} headers = {'User-Agent':'Mozilla/5.0 (Windows NT 1...
example_parallel.py
# -*- encoding: utf-8 -*- import multiprocessing import shutil import sklearn.cross_validation import sklearn.datasets import sklearn.metrics from autosklearn.classification import AutoSklearnClassifier from autosklearn.constants import * tmp_folder = '/tmp/autosklearn_parallel_example_tmp' output_folder = '/tmp/aut...
main.py
from spotify import DOWNLOADMP3 as SONGDOWNLOADER import telepot import spotify import requests import threading import os if 'BOT_TOKEN' in os.environ: token = 5179683696:AAGox1Mbq-jwyI1s8pxaF3VzZuW28XgZZHw else: token = 'token bot' bot = telepot.Bot(token) sort = {} def txtfinder(txt): a = txt.find("...
TestPythonParaViewWebMPI.py
#/usr/bin/env python # Global python import import exceptions, traceback, logging, random, sys, threading, time, os # Update python path to have ParaView libs build_path='/Volumes/SebKitSSD/Kitware/code/ParaView/build-ninja' sys.path.append('%s/lib'%build_path) sys.path.append('%s/lib/site-packages'%build_path) # Pa...
benchmark_client.py
#!/usr/bin/env python import socket, time from threading import Thread import argparse,os DEFAULT_ALGORITHM_USED = 'BEST' DEFAULT_TARGET_IP = 'localhost' DEFAULT_TARGET_PORT = 5600 MATRIX_FOLDER_NAME = 'data/matricies/' SOLUTION_FOLDER_NAME = '' DEFAULT_BUFFER_SIZE = 2**14 DEFAULT_SLEEP_TIME = 0.1 class Matrix: ...
_utils.py
# Original work Copyright 2017 Palantir Technologies, Inc. (MIT) # See ThirdPartyNotices.txt in the project root for license information. # All modifications Copyright (c) Robocorp Technologies Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file exc...
bridge.py
#!/usr/bin/env python3 import carla import os import time, termios, tty, sys import math import atexit import numpy as np import threading import random import cereal.messaging as messaging import argparse import queue from common.params import Params from common.realtime import Ratekeeper from lib.can import can_funct...
__init__.py
# -*- coding: utf-8 -*- # MIT License (see LICENSE.txt or https://opensource.org/licenses/MIT) """Implements the main InputStream Helper class""" from __future__ import absolute_import, division, unicode_literals import os from . import config from .kodiutils import (addon_profile, addon_version, browsesingle, get_pro...
debug.py
import code import gc import logging import os import signal import socket import threading import traceback import tracemalloc from types import FrameType from django.conf import settings from django.utils.timezone import now as timezone_now from typing import Optional logger = logging.getLogger('zulip.debug') # In...
test_sftpclone.py
#!/usr/bin/env python # coding=utf-8 # author=Adriano Di Luzio """SFTPClone tests.""" # Simply launch me by using nosetests and I'll do the magic. # I require paramiko # Python 2.7 backward compatibility from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_liter...
GUI.py
from tic_tac_toe_AI import min_max_ai from tkinter import * from tkinter import Tk,messagebox from threading import Thread from time import sleep as nap class GUI(min_max_ai): def __init__(self,root): super().__init__() self.title = 'X-O AI' self.root = root self.root.confi...
main.py
import sys, time, gc, configparser, inspect import webserver, multiprocessing # The webserver frontend bits from transformers import AutoModelForCausalLM, AutoTokenizer # The transformer bits import torch if len(sys.argv) < 2: print("") print("Arguments: main.py <path to model>") print("Example: python3 m...
is_bst_hard.py
import sys, threading # In Order Traversal of the Tree: # Time Complexity: O(n) # Space Complxity: O(height) def IsBinarySearchTree(tree, v, subtreeMinMax): if len(tree) < 2: return True vSubtreeMinMax = [] if tree[v][1] == -1: subtreeMinMax[0] = tree[v][0] else: vSubtreeMinMax = [0,0] if no...
timed_subprocess.py
"""For running command line executables with a timeout""" import subprocess import threading import salt.exceptions class TimedProc(object): ''' Create a TimedProc object, calls subprocess.Popen with passed args and **kwargs ''' def __init__(self, args, **kwargs): self.command = args ...
homedialog.py
from PyQt5 import QtWidgets import random from urllib import request from threading import Thread name = random.randrange(1,1000) class HomeDialog(QtWidgets.QDialog): def __init__(self): super().__init__() layout = QtWidgets.QVBoxLayout() self.name = QtWidgets.QLabel("AUR KAISA HAI") ...
_cherrypy_server.py
import os import sys from contextlib import contextmanager class CherryPyServer(object): """ cherrypy is really practical to host a webpage. However it is one big drawback: it is mostly intended to run a single server per process, as it stores lots of its configuration in globals. This can be tro...
server.py
#server import socket from threading import Thread def send(message, sender): for client in clients: if sender != client: client.send(message) def listen(client): while True: message = client.recv(9988) send(message, client) conn = socket.socket(socket.AF_INET, socket.SO...
recipe-576520.py
# Author: David Decotigny, Oct 1, 2008 # @brief Multiplexer for parallel transactions over a single data # channel. This is like a pipe on which we provide a multithreaded # request/response messaging system. This system allows multiple # threads to issue several requests in parallel: they are treated in # parall...
main.py
#!/usr/bin/env python3 import logging import os import ssl import threading from aiohttp import web import dnslib import dnslib.server import influxdb_client DNS_HOST = os.getenv('GLOW_TRAP_DNS_HOST', '0.0.0.0') DNS_PORT = int(os.getenv('GLOW_TRAP_DNS_PORT', '8053')) HTTPS_HOST = os.getenv('GLOW_TRAP_HTTPS_HOST', ...
power_monitoring.py
import datetime import random import threading import time from statistics import mean from cereal import log from common.realtime import sec_since_boot from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5.28 # Parameters def get_battery_capacity(): return _read_param("/sys/class/power_supply/battery/c...
cross_device_ops_test.py
# Copyright 2018 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...
conftest.py
# coding: utf-8 from __future__ import ( absolute_import, division, print_function, unicode_literals, ) from contextlib import contextmanager import httplib import multiprocessing import socket import time from elasticsearch_dsl import Index from mock import Mock from pathlib2 import Path import pyte...
views.py
from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from developers_app.forms import ServiceForm from django.contrib import messages from django.db import IntegrityError from developers_app.models import Services from providers_app.models import Job from django.core.e...
feeder.py
import os import threading import time import traceback import numpy as np import tensorflow as tf from infolog import log from sklearn.model_selection import train_test_split from tacotron.utils.text import text_to_sequence_MIX_Phoneme_Version _batches_per_group = 64 class Feeder: """ Feeds batches of data into ...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developed and maintained by the Spyder Proj...
gameClient.py
import socket, threading from pygame import * TCP_IP = '192.227.178.111' TCP_PORT = 5005 BUFFER_SIZE = 100 running = True screen = display.set_mode((800,600)) playerList = ['macbook',(0,0)] otherPlayers = {} def getData(): global BUFFER_SIZE global running global playerList global otherPlayers s = s...
jm.py
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2015 Caian Benedicto <caian@ggaunicamp.com> # # 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 w...
connection.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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...
client.py
import threading from time import sleep import requests from pycrowdsec.cache import Cache class StreamClient: def __init__( self, api_key, lapi_url, scopes, interval, user_agent="CrowdSec-Python-StreamClient" ): self.cache = Cache() self.api_key = api_key self.scopes = scope...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import (verbose, import_module, cpython_only, requires_type_collecting) from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import...
myapp.py
from os import path, makedirs from threading import Thread from time import sleep from re import match, sub from base64 import b64decode, b64encode from binascii import b2a_hex from locale import getpreferredencoding from platform import system from pprint import pprint from random import choice, randint, sample from s...
scheduler.py
import logging import datetime import imp import time import traceback import threading from mixins import ScheduleMixin, PluginModulesLibraryMixin class Scheduler(ScheduleMixin, PluginModulesLibraryMixin): @classmethod def clear_locks(cls, bot): bot.save("scheduler_add_lock", False) bot.sav...
client.py
import time import queue import json from urllib import parse from typing import Any from threading import Thread import httpx import websocket import webbrowser from .config import settings CODE = "code" AUTHORIZATION_CODE = "authorization_code" CLIENT_CREDENTIALS = "client_credentials" REFRESH_TOKEN = "refresh_tok...
extract_scene_features.py
import numpy as np import h5py import torchvision.transforms as transforms from PIL import Image import pretrainedmodels import torch import argparse import torch.multiprocessing as mp ROBOTHOR_SCENES=["FloorPlan_Train{}_{}".format(i,j) for i in range(1, 13) for j in range(1,6)] ITHOR_SCENES=["FloorPlan{}".format(i) f...
service_caller.py
import rospy from threading import Thread import traceback class ServiceCaller(object): ''' Simple helper class built around calling a ROS service. Typically this will handle executing an action and receiving the reply, such as a SmartGrasp or SmartRelease request. ''' def __init__(self, *args,...
run.py
import os import select import subprocess import sys from threading import Thread from typing import List, Any import config_generator binary = '../build/og' params = '-c configs/config_XX.toml -d data/d_XX -l data/datadir_XX -n -M run' current_node_id = 0 pids: List[subprocess.Popen] = [] def keep_read(process, ...