source
stringlengths
3
86
python
stringlengths
75
1.04M
langserver.py
"""Langserver support for autocompletions.""" # TODO: CompletionProvider # TODO: error reporting in gui somehow from __future__ import annotations import dataclasses import errno import itertools import logging import os import pprint import queue import re import select import signal import socket import subprocess i...
websocket_client.py
# cbpro/WebsocketClient.py # original author: Daniel Paquin # mongo "support" added by Drew Rice # # # Template object to receive messages from the Coinbase Websocket Feed from __future__ import print_function import json import base64 import hmac import hashlib import time from threading import Thread from websocket ...
nanny.py
from datetime import timedelta import logging from multiprocessing.queues import Empty import os import psutil import shutil import threading import uuid import warnings import weakref import dask from tornado import gen from tornado.ioloop import IOLoop, TimeoutError from tornado.locks import Event from .comm import...
nighthawk_test_server.py
"""Contains the NighthawkTestServer class, which wraps the nighthawk_test_servern binary.""" import http.client import json import logging import os import socket import subprocess import sys import random import requests import tempfile import threading import time import yaml from string import Template from pathlib...
automate.py
import logging import time import io import zipfile import json import threading import inspect import datetime import handler import configuration import instance import utilities import aws_resources # The path at which to save the configuration in a worker Lambda. CONFIG_PATH = "/tmp/config.cfg" # The type of ins...
Client.py
#!/usr/bin/env python #-*-coding:utf-8-*- import tkinter, threading, socket class Client(tkinter.Tk): def __init__(self): tkinter.Tk.__init__(self) self.width, self.height = str(self.winfo_screenwidth()//2), str(self.winfo_screenheight()//2) self.title("Miauh - client") ...
clientMedia.py
import cv2 from socket import socket, AF_INET, SOCK_STREAM from imutils.video import WebcamVideoStream import pyaudio from array import array from threading import Thread import numpy as np import zlib import struct HOST = input("Enter Server IP\n") PORT_VIDEO = 3000 PORT_AUDIO = 4000 BufferSize = 4096 CHUNK=1024 lnF...
test_sys.py
import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support imp...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
particle01.py
# demonstration of a particle cloud (non-interacting) from random import random from pymol import cmd particle_count = 1000 box_size = 500.0 # constants half_box = box_size / 2 # create N particle system [x,y,z,r,vx,vy,vz] particle = [] for resi in range(0,particle_count): particle.append([resi] + ...
widget.py
from threading import Thread from abc import ABC, abstractmethod import tkinter as tk from lib.app import Application from lib.system import System class Control: _parent: Application _system: System def __init__(self, parent): self._parent = parent self._system = parent.system @pro...
ImdbScraper.py
import json import re import datetime as dt from scrapetools import * import logging import random import threading import queue import pandas as pd import timeit from bson import json_util logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s') class ImdbScraper: def __init__...
__init__.py
#!/usr/bin/python3 # @todo logging # @todo extra options for url like , verify=False etc. # @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option? # @todo option for interval day/6 hour/etc # @todo on change detected, config for calling some API # @todo fetch title into json # https://di...
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...
TFLite_detection_webcam.py
######## Webcam Object Detection Using Tensorflow-trained Classifier ######### # # Author: Gaurav Konde # Date: 10/27/19 # Description: # This program uses a TensorFlow Lite model to perform object detection on a live webcam # feed. It draws boxes and scores around the objects of interest in each frame from the ...
advanced-reboot.py
# # ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";...
context.py
# Licensed Materials - Property of IBM # Copyright IBM Corp. 2016,2017 from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import try: from future import standard_library standard_library.install_aliases() except (ImportEr...
httpie_consul_tests.py
import json try: import unittest2 as unittest except ImportError: import unittest import requests try: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler except ImportError: from http.server import HTTPServer, BaseHTTPRequestHandler import multiprocessing from httpie_consul import ConsulAdap...
Ghost.py
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (C) 2021 Ben Tettmar # 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 right...
agents.py
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
devicemonitor.py
#encoding:utf-8 ''' @author: look @copyright: 1999-2020 Alibaba.com. All rights reserved. @license: Apache Software License 2.0 @contact: 390125133@qq.com ''' import os import re import sys,csv import threading import random import time import traceback BaseDir=os.path.dirname(__file__) sys.path.append(...
main.py
#!/usr/bin/env python3 import argparse import logging from queue import Queue import subprocess from threading import Thread module_info = { # Name of the module (should be the same as the filename) "name": "s3__bucket_finder", # Name and any other notes about the author "author": "Dwight Hohnstein", ...
plotGraphs.py
import numpy import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pylab import os import multiprocessing as MP from P2P_CONSTANTS import * def plotGraph(x, y, z, filename): v = [0,5000,0,200] plt.axis(v) plt.scatter(x, y, alpha = 0.10, cmap=plt.cm.cool, edgecolors='None') # plt.colorbar()...
main.py
#!/usr/bin/env python3 # It is start of J-Robot. # J-Robot uses aiy.assistant.grpc and answers your questions. # Also, J-robot can do works that you defines. import threading import logging import aiy.assistant.grpc import aiy.audio import aiy.voicehat import subprocess import vision.camera as cam from serial_comm i...
initGUI.py
import sys import threading import pwndbg.perceptorGUI.memGUI import logging logging.getLogger("kivy").disabled = True def init(): global app app = pwndbg.perceptorGUI.memGUI.MemoryApp() th_app = threading.Thread(target=pwndbg.perceptorGUI.memGUI.app_run, args=(app,), daemon=True) th_app.star...
streaming.py
# Tweepy # Copyright 2009-2021 Joshua Roesslein # See LICENSE for details. # Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets import json import logging import re import ssl from threading import Thread from time import sleep import requests from tweepy.api im...
ProxyBoyServer.py
from functools import partial from http.server import HTTPServer import socketserver import socket import ssl import templates import threading """ Saturday 11/23/2019 I currently am getting an OSERROR as seen on socketserver.py line 312. When connecting explicitly to the server, I see that there is SSL available, bu...
session.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...
threads.py
from functools import singledispatchmethod from threading import Thread, Lock, Event, current_thread import zmq from zmq import Poller, Context from .manager import TubeMessage, Tube as AsyncTube, TubeNode as AsyncTubeNode,\ TubeMethodNotSupported, TubeMessageError, TubeMessageTimeout, \ TubeTopicNotConfigured...
build_chembl_data.py
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db import connection from django.db import IntegrityError from django.utils.text import slugify from django.http import HttpResponse, JsonResponse from build.management.commands.base_build import Command as B...
mqtt.py
import socket import threading import json from .const import ( LOGGER, SHELLY_TYPES ) class MQTT_connection: def __init__(self, mqtt, connection, client_address): self._mqtt = mqtt self._connection = connection #connection.settimeout(5) self._client_address = clie...
helper.py
import os import sys import distutils.spawn import time import subprocess from threading import Thread from tempfile import NamedTemporaryFile from unix_windows import IS_WIN # python 2/3 compatibility try: input = raw_input except NameError: pass def executable_exists(name): binary_path = distutils.spa...
controller.py
import glob import locale import os import re import shutil import subprocess import traceback from pathlib import Path from threading import Thread from typing import List, Type, Set, Tuple import requests import yaml from colorama import Fore from requests import exceptions from bauh.api.abstract.context import App...
model_test.py
# coding: utf-8 # アーム動作 import os _FILE_DIR=os.path.abspath(os.path.dirname(__file__)) import time import logging import threading import sys sys.path.append(_FILE_DIR+'/..') from lib import AI, SaveConfig from lib import SPI import cv2 import math import numpy as np # ログ設定 logging.basicConfig(level=logging.DEBUG, ...
test_scripts.py
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2014-2015, Michigan State University. # Copyright (C) 2015-2016, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
test_debug.py
import importlib import inspect import os import re import sys import tempfile import threading from io import StringIO from pathlib import Path from unittest import mock from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from djan...
parallel_render.py
""" Small addon for blender to help with rendering in VSE. It automates rendering with multiple instances of blender. It should come up as "Parallel Render" in addons list. Copyright (c) 2017 Krzysztof Trzcinski """ from bpy import props from bpy import types from collections import namedtuple from enum ...
feature_extract_vc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2019 Patrick Lumban Tobing (Nagoya University) # based on PyTorch implementation for WaveNet vocoder by Tomoki Hayashi (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division from __future__ import print_...
logging_functions.py
# The following code is based on the ProcHarvester implementation # See https://github.com/IAIK/ProcHarvester/tree/master/code/adb-record-tools import subprocess import time import config import pexpect import shutil import datetime import os from threading import Thread # Do not change these constants without chang...
test_upnpclient.py
import unittest import threading import os.path as path import os import datetime import base64 import binascii from uuid import UUID import mock import requests from requests.compat import basestring from lxml import etree import upnpclient as upnp try: import http.server as httpserver except ImportError: ...
cooperative_auth.py
# coding: utf-8 from logging import getLogger from multiprocessing import Manager, Process from os import getpid from boxsdk.auth.cooperatively_managed_oauth2 import CooperativelyManagedOAuth2 from boxsdk.util.log import setup_logging from boxsdk import Client from .auth import authenticate, CLIENT_ID, CLIENT_SECRET...
BatchingWithSimplygonGrid.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import math import os import sys import glob import gc import threading from pathlib import Path from simplygon9 import simplygon_loader from simplygon9 import Simplygon def CheckLog(sg: Simplygon.ISimplygon): # Check if any errors occur...
test_thread.py
import concurrent.futures import datetime import random import sys import threading import time sys.path.append('.') from factorys import time_it from milvus_cloud import Milvus dimension = 512 number = 100000 table_name = 'multi_task' def add_vector_task(milvus, vector): status, ids = milvus.insert(table_name=...
timeout.py
import multiprocessing import time from logging import Logger from typing import Callable, Union from modules.timeout.responder import Response def timeout(seconds: Union[int, float], function: Callable, args: Union[list, tuple] = None, kwargs: dict = None, logger: Logger = None) -> Response: """Runs...
llg.py
from autograd import numpy as np from autograd import grad, jacobian import numpy.matlib as nm from svgd import SVGD import sys #from mpltools import style #from mpltools import layout from multiprocessing import Process, Manager #style.use('ggplot') import matplotlib.pyplot as plt #-(1.0/(2*observation_variance))...
test_gcs_pubsub.py
import sys import threading import ray import ray._private.gcs_utils as gcs_utils from ray._private.gcs_pubsub import GcsPublisher, GcsErrorSubscriber, \ GcsLogSubscriber, GcsFunctionKeySubscriber, GcsAioPublisher, \ GcsAioErrorSubscriber, GcsAioLogSubscriber, GcsAioResourceUsageSubscriber from ray.core.genera...
client.py
""" Università degli Studi Di Palermo Corso di Laurea Magistrale in Informatica Anno Accademico 2020/2021 Cybersecurity @author:Salvatore Calderaro DH-AES256 - Chatter """ from tkinter import * from time import sleep import threading import os import socket import pickle import diffie_hellman as dh import configobj i...
test_datapipe.py
import http.server import itertools import os import os.path import pickle import random import socketserver import sys import tarfile import tempfile import threading import time import unittest import warnings import zipfile from functools import partial from typing import ( Any, Awaitable, Dict, Gene...
dag_processing.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...
event_loop.py
import os import imp import inspect import time import sys import traceback import commands import threading import json import pdb import pprint from datetime import datetime from collections import defaultdict from core.models import * from django.db.models import F, Q from django.db import connection #from opensta...
fuzzer.py
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
window.py
import psutil import logging from chartItem import * from PyQt5 import QtCore from PyQt5 import QtWidgets from PyQt5.QtGui import QIcon, QPixmap, QPalette from multiprocessing import Process, Queue sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.static import * class Window(Q...
workbench.py
#! /usr/bin/env python3 """This is the convenience script for developing, building, distributing, and running end-user copies of the Galois Format Analysis Workbench. """ # IMPORTANT - Only stdlib here! We want to minimize dependencies required by # downstream users. Other imports are allowed in functions not used by...
httpclient_test.py
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import base64 import binascii from contextlib import closing import functools import sys import threading import datetime from io import BytesIO from tornado.escape import utf8 from tornado.httpclient import HTTPRe...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable from PyQt5.QtCore import QRect, QEventLoo...
KeyboardUtils.py
import threading import time class KeyboardUtils: # Keyboard input on windows and linux ansiEscSeqCodes = { 49: [4, "HOME"], 50: [4, "INS"], 51: [4, "DEL"], 52: [4, "END"], 53: [4, "PAGEUP"], 54: [4, "PAGEDOWN"], 55: [4, "HOME"], ...
controller.py
#import vm import socket import math import json import threading import time from settings import * import pdb import copy T_DELTA = 1000 T_DELTA_curr = 0 tp_request = False tr_request = False t_timer = None tp_timer = None tr_timer = None T_INTERVAL = 90 TP_INTERVAL = 300 TR_INTERVAL = 60000 T_PRICE_INTERVAL = 60 T_...
upnp.py
import logging import threading from queue import Queue try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: def __init__(self): self.queue = Queue() def run(): try: self.upnp = miniupnpc.UPnP() self.up...
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...
model.py
# ------------------------------------------------------------------------------ # File: model.py # Author: Jan Kukacka # Date: 3/2021 # ------------------------------------------------------------------------------ # Application data model component # ---------------------------------------------------------------...
dnschef.py
#!/usr/bin/env python3 # # DNSChef is a highly configurable DNS Proxy for Penetration Testers # and Malware Analysts. Please visit http://thesprawl.org/projects/dnschef/ # for the latest version and documentation. Please forward all issues and # concerns to iphelix [at] thesprawl.org. DNSCHEF_VERSION = "0.4" # Copyr...
utils.py
import numpy as np from random import seed, shuffle import loss_funcs as lf # our implementation of loss funcs from scipy.optimize import minimize # for loss func minimization from multiprocessing import Pool, Process, Queue from collections import defaultdict from copy import deepcopy import sys SEED = 1122334455 see...
utils.py
# -*- coding: utf-8 -*- import base64 import functools import logging import os import re import time import warnings import zipfile from datetime import datetime from getpass import getpass from threading import Event, Thread from urllib.parse import quote from xml.etree import ElementTree import requests import xmlt...
test.py
''' 环境配置 IDE vscode pycharm 代码仓库 github gitee python 官方文档中文 https://docs.python.org/zh-cn/3.8/ 程序的基本编写方法 IPO I:Input 输入,程序的输入,数据机构。 P:Process 处理 程序的主要逻辑,算法。 O:Output 输出,程序的输出。 print([n*n for n in range(1,9)]) 列表推导 (n*n for n in range(9)) 生成器表达式 函数的复用 ''' # def getadd(): # return # def add(): # ...
vncoinbase.py
# encoding: UTF-8 from __future__ import print_function import hashlib import hmac import base64 import json import ssl import traceback from queue import Queue, Empty from multiprocessing.dummy import Pool from time import time from urlparse import urlparse from copy import copy from urllib import urlencode from th...
flow2npy.py
import cv2 import os import numpy as np import json import glob import multiprocessing as mp import argparse parser = argparse.ArgumentParser() parser.add_argument('thread_num', type=int) parser.add_argument('--video_info_path', type=str, default='datasets/activitynet/annotations/video_info_train_v...
test_exceptions.py
import os import re import threading import pytest import pexpect.fdpexpect from trunner.config import ALL_TARGETS from trunner.testcase import TestCase # Pytest tries to collect TestCase as a class to test # Mark TestCase as not testable TestCase.__test__ = False class TestPexpectException: """ Tests check i...
test_zmqrouter.py
import ast import datetime import logging import os import pathlib import shutil import tempfile import time import unittest from unittest.mock import MagicMock from threading import Thread import osgar.logger from osgar.zmqrouter import _Router, _Bus, record class Noop: def __init__(self, config, bus): ...
workdlg.py
import logging import os import queue import signal import subprocess import threading import time import tkinter as tk from tkinter import ttk, messagebox from typing import Optional from thonny import tktextext from thonny.languages import tr from thonny.misc_utils import running_on_windows from thonny.ui_utils impo...
worker_test.py
# Copyright (c) 2012 Spotify AB # # 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, s...
ecomap_etl.py
"""ECOMAP ETL.""" import logging import multiprocessing from etl import ETL from files import TXTFile from transactors import CSVTransactor from transactors import Neo4jTransactor class ECOMAPETL(ETL): """ECOMAP ETL.""" logger = logging.getLogger(__name__) # Query templates which take params and will ...
_index.py
import asyncio import os import re import shutil from abc import abstractmethod from collections import namedtuple from queue import Empty, Queue from threading import Thread from secedgar.client import NetworkClient from secedgar.filings._base import AbstractFiling from secedgar.utils import make_path from secedgar.u...
async_video_stream.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Christian Heider Nielsen" __doc__ = r""" Created on 25-01-2021 """ from threading import Thread from typing import Any, Union import cv2 __all__ = ["AsyncVideoStream"] class AsyncVideoStream: """ """ def __init__( ...
test_main.py
# -*- coding: utf-8 -*- """ Test module for poseidon.py Created on 28 June 2016 @author: Charlie Lewis, dgrossman, MShel """ import json import logging import queue import time import schedule from faucetconfgetsetter import FaucetLocalConfGetSetter from faucetconfgetsetter import get_sdn_connect from faucetconfgetse...
runner.py
#!/usr/bin/env python2 # Copyright 2010 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. """This is the Emscripten test runner. To run ...
SparkMQTTStage1.py
######################################################################## # This is implementation for Cloud + Edge = iotx Stage 1. Cloud is represented # by Apache Spark and Edge computing framework is Calvin. Apache Spark is # receiving temperature data from Calvin via MQTT (pub/sub model). This # program calculates r...
_testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import operator import os from shutil import rmtree import string import tempfile from typing import Any, Callable, ContextManager, List, Optional, Type, Union, cast imp...
submitty_autograding_shipper.py
#!/usr/bin/env python3 import os import time import signal import json import shutil import contextlib import datetime import multiprocessing from submitty_utils import dateutils, glob import operator import paramiko import tempfile import socket from autograder import grade_items_logging from autograder import grad...
module.py
#!/usr/bin/python3 # coding=utf-8 # Copyright 2021 getcarrier.io # # 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 req...
miniterm.py
#!/mnt/c/prog/hack/TigerHacks/env/bin/python3 # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import threading import serial from seri...
map_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
main.py
from parameters import * from oscillator import * import initialize import draw from globals import * from AbstractBacteriaCellCluster import * from AbstractHost import * from heapq import heappush, heappop from time import sleep import threading import webbrowser from SocketServerProtocol import * from autobahn.twiste...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
postprocess.py
"""Postprocesses data across dates and simulation runs before aggregating at geographic levels (ADM0, ADM1, or ADM2).""" import argparse import gc import glob import logging import os from multiprocessing import JoinableQueue, Pool, Process from pathlib import Path import numpy as np import pandas as pd import tqdm f...
sync_code.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -*- encoding: utf-8 -*- # # Copyright (c) 2020 anqi.huang@outlook.com # # 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.apach...
interactive.py
import asyncio import logging import os import tempfile import textwrap import uuid from functools import partial from multiprocessing import Process from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union import numpy as np from aiohttp import ClientError from colorclass import Color from sanic imp...
mario.py
import os import neat import gym, ppaquette_gym_super_mario import pickle import multiprocessing as mp import warnings import time warnings.filterwarnings("ignore") level = 'ppaquette/SuperMarioBros-1-1-Tiles-v0' gym.logger.set_level(40) class Mario: def __init__(self): self.actions = [[0, 0, 0, 1, 0, 1...
ViewWinRenderedGrid.py
''' Created on Oct 5, 2010 @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' import os, threading, time from tkinter import Menu, BooleanVar from arelle import (ViewWinGrid, ModelDocument, ModelDtsObject, ModelInstanceObject, XbrlConst, ModelXbrl, ...
px_poller.py
import os import time import threading from . import px_load from . import px_ioload from . import px_meminfo from . import px_process from . import px_launchcounter import sys if sys.version_info.major >= 3: # For mypy PEP-484 static typing validation from typing import Optional # NOQA from typing impo...
mockwin32.py
#!/usr/bin/python2.4 # # Copyright 2010 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 ...
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...
base.py
import os import re import logging import threading import ujson as json from abc import ABC, abstractmethod from datetime import datetime, timedelta from shutil import copy2 from flask_wtf import FlaskForm from wtforms import StringField, BooleanField from wtforms.validators import InputRequired, Optional, Validatio...
server.py
#!/usr/bin/env python """ SSL server for Forge tests. - The server changes to the directory of the server script. - SSL uses "server.key" and "server.crt". - Sever performs basic static file serving. - Starts Flash cross domain policy file server. - Defaults to HTTP/HTTPS port 19400. - Defaults to Flash socket policy...
grpc.py
import numpy as np import grpc from concurrent import futures import gnn_rpc_pb2 as pb import gnn_rpc_pb2_grpc as pb_rpc class GNNDataHandler(pb_rpc.GNNDataHandlerServicer): def __init__(self, x, y, indptr, indices, nodes_from): super().__init__() # self.x = x # self.y = y # self.in...
robusta_sink.py
import base64 import json import logging import time import threading from collections import defaultdict from hikaru.model import Deployment, StatefulSetList, DaemonSetList, ReplicaSetList, Node, NodeList, Taint, \ NodeCondition, PodList, Pod from typing import List, Dict from .robusta_sink_params import Robusta...
ign_demo.py
#!/bin/python3 import threading import rclpy from rclpy.node import Node from geometry_msgs.msg import Pose from ros_ign_gazebo_manager.ign_gazebo_interface import IgnGazeboInterface if __name__ == "__main__": rclpy.init() ign = IgnGazeboInterface() # Spin MoveIt2 node in the background executor =...
test.py
#!/usr/bin/env python3 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import libtorrent as lt import unittest import time import datetime import os import shutil import binascii import subprocess as sub import sys import pickle import threading import tempfile import socket import select import logging import...
test7.py
import multiprocessing import sys def worker_with(lock, f): with lock: fs = open(f, 'a+') n = 10 while n > 1: fs.write("Lockd acquired via with\n") n -= 1 fs.close() def worker_no_with(lock, f): lock.acquire() try: fs = open(f, 'a+') ...