source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
TSocketTest.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# 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... |
build.py | # Copyright 2014 The Oppia 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 applicable ... |
sopel_discord.py | # coding=utf-8
from __future__ import (
unicode_literals,
absolute_import,
division,
print_function
)
import asyncio
import threading
import re
from sopel import module
from sopel.config.types import (
StaticSection, ValidatedAttribute, BaseValidated, NO_DEFAULT
)
from sopel.tools import get_inpu... |
ex2_sample.py | import time
import threading
from my_devices import device_list
from my_functions import ssh_command
def main():
"""
Use "legacy" threading to gather "show version" from the devices.
Record the total time required to do this.
"""
start_time = time.time()
# Create list to append threads to
... |
onnxruntime_test_python.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: UTF-8 -*-
import unittest
import os
import numpy as np
import onnxruntime as onnxrt
import threading
import sys
from helper import get_name
from onnxruntime.capi.onnxruntime_pybind11_state import Fail
class Te... |
server_finger_tapping_task.py | import csv
import json
import threading
import time
import psutil
import pygame
from common import record_metadata, request_clients_end
from config import UPDATE_RATE
from network import receive, send
from .config_finger_tapping_task import (COUNT_DOWN_MESSAGE,
SECONDS_COUNT_D... |
gmgr.py | import sys
import logging
from threading import Thread, Event
from multiprocessing import Manager
from Queue import Empty
import gpool
class GuestManager(object):
def __init__(self, vm_list):
self.log = logging.getLogger("vo2.%s" % __name__)
self.machines = vm_list
self.vm_map = {}
... |
reduction.py | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
__all__ = []
import os
import sys
import socket
import threading
import _multiprocessing
from multiprocessing import current_process
fr... |
__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 make tables responsive!
# @todo fe... |
__init__.py | from subprocess import Popen, PIPE, STDOUT
import socket
from multiprocessing import Process
from threading import Thread
from json import load, dump, JSONDecodeError
import shutil
import zipfile
import tempfile
import os
import time
def reportError(text,breaking=False):
print(text)
if breaking:
input(... |
test_clock.py | # ==================================================================================================
# Copyright 2015 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
test_numpy.py | import queue
import threading
import multiprocessing
import numpy as np
import pytest
from numpy.random import random
from numpy.testing import (
assert_array_almost_equal, assert_array_equal, assert_allclose
)
from pytest import raises as assert_raises
import scipy.fft as fft
def fft1(x):
L = len(... |
Hci.py | import threading
import math
import time
from . import Emit
from .BluetoothHCI import *
# from constants import *
from .constants2 import *
from os import popen
import codecs
from .Io import *
from .HciStatus import *
class Hci:
STATUS_MAPPER = STATUS_MAPPER
def __init__(self):
self._events = {}
... |
tc_ui.py | #!/usr/bin/python
#-*- coding:utf-8 -*-
'''
@Time : 2019/3/03
@Author : ZJF
@File : tc_ui.py
'''
import os
import time
import threading
import tkinter as tk
from tkinter import ttk
from tc_nb import *
from tc_lr import *
from tc_cnn import *
from tc_tool import *
from tc_data import *
from tc_datat... |
calvin_node.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson 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 ... |
test_core.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... |
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... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test pigeond shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framewor... |
test_browser.py | # coding=utf-8
# Copyright 2013 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.
import argparse
import json
import multiprocessing
imp... |
main.py | import threading
import queue
import re
import rx.subject
from bokeh.models import ColumnDataSource
from bokeh.plotting import curdoc, figure
from bokeh.layouts import column, row
from bokeh.models import FactorRange, Range1d
from bokeh.models import Select
from nanomsgnode import PropellerNodeController, CHANNEL_NAM... |
test_win32pipe.py | import unittest
import time
import threading
from pywin32_testutil import str2bytes # py3k-friendly helper
import win32pipe
import win32file
import win32event
import pywintypes
import winerror
import win32con
class PipeTests(unittest.TestCase):
pipename = "\\\\.\\pipe\\python_test_pipe"
def _serverThread(... |
PGinternet.py | import socket
from time import sleep
from threading import Thread
class PGinternet():
def __init__(self, updateTime = 1, IP = "127.0.0.1", host = 80):
self.__socket = None
self.__execute = True
self.__linkedserver = False
self.__getRecv = []
self.__willSend = []
self.__serverAt = (IP, host)
self.__upda... |
vm_util.py | # Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
_logger.py | """
.. References and links rendered by Sphinx are kept here as "module documentation" so that they can
be used in the ``Logger`` docstrings but do not pollute ``help(logger)`` output.
.. |Logger| replace:: :class:`~Logger`
.. |add| replace:: :meth:`~Logger.add()`
.. |remove| replace:: :meth:`~Logger.remove()`
.. |... |
morse_encoder.py | #!/usr/bin/env python3
from threading import Thread
import serial
from subprocess import DEVNULL, STDOUT, check_call
import sys
from time import sleep
short_beep_time = 0.1
codes = {
'A': '.-',
'B': '-...',
'C': '-.-.',
'D': '-..',
'E': '.',
'F': '..-.',
'G': '--.',
'H': '....',
'... |
event_predict_v1.py | import sys,os
sys.path.append("..")
import numpy as np
import tensorflow as tf
from example import bert_classifier_estimator
from bunch import Bunch
from data_generator import tokenization
from data_generator import tf_data_utils
from model_io import model_io
from example import feature_writer, write_to_tfrecords, clas... |
Motor Test A.py | #modified for compatability with new motor1 class
import threading
import time
import queue
import warnings
from motorcontrollib import M_28BJY48_ULN2003_RPI
from typing import *
#from .Config import *
class MotorControl:
"""A class to control the motors operation
Attributes:
M1: The first motor (x axis... |
multi_rand_test.py | from numpy import random
from multiprocessing import Process
def printrand(number):
rndn = random.random()
print "n:",number,"r:",rndn
if __name__=='__main__':
num = 1
p_list = []
for proc in range(10):
p_list.append(Process(target=printrand, args=(proc,)))
p_list[-1].start()
|
TestingScenario2920_OF10.py | import logging
from Configurations import SwitchParameters
from ExternalTools.DelayThread import DelayMonitor
from ExternalTools.IperfThread import BandwidthMeter
from Models.HPSDNController import HPSDNController
from Models.SwitchMonitor import SwitchMonitor
from datetime import datetime
import time
import threading... |
LedController.py | import RPi.GPIO as GPIO
import time
import threading
class LedController:
def __init__(self, gpioMode, greenLed, redLed):
self.GreenLed = greenLed
self.RedLed = redLed
GPIO.setmode(gpioMode)
GPIO.setwarnings(False)
GPIO.setup(self.GreenLed , GPIO.OUT)
GPIO.setup(sel... |
test_output.py | import subprocess
import sys
import pytest
import re
import signal
import time
import os
import ray
from ray._private.test_utils import (
run_string_as_driver_nonblocking,
run_string_as_driver,
)
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
def test_spill_logs():
script = "... |
websock.py | import threading
import struct
import socket
import hashlib
import base64
import sys
import logging
import os
from select import select
class WebSocketDelegate(object):
def __init__(self):
self.socket = None
self.thread = None
def OnConnect(self):
return None
def OnRecieve(self,data... |
to_h5.py | import numpy as np
import multiprocessing as mp
from queue import PriorityQueue
from multiprocessing.managers import SyncManager
from ..helper import *
import time
import h5py as h5
from ..misc.progressbar import progress
class MyManager(SyncManager):
pass
def Manager():
m = MyManager()
m.start()
re... |
framework.py | #!/usr/bin/env python3
from __future__ import print_function
import gc
import logging
import sys
import os
import select
import signal
import subprocess
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
import platform
from collections import deque
from threading i... |
helpers.py | """Supporting functions for polydata and grid objects."""
import collections
import ctypes
import logging
import warnings
from threading import Thread
import numpy as np
import scooby
import vtk
import vtk.util.numpy_support as nps
import pyvista
from .fileio import from_meshio
POINT_DATA_FIELD = 0
CELL_DATA_FIELD ... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import... |
game.py | import pygame
import colors
import board
import json
import threading
class Game:
def __init__(self, screen_width, screen_height):
pygame.init()
pygame.font.init()
pygame.display.set_caption('AOthello')
self.screen = pygame.display.set_mode((screen_width, screen_height))
se... |
app_utils.py | # From http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/
import struct
import six
import collections
import cv2
import datetime
from threading import Thread
from matplotlib import colors
class FPS:
def __init__(self):
# store the start time, end time, and total number ... |
_read_some_but_not_all_responses_test.py | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
controller.py | # Copyright 2020 Fortinet(c)
#
# 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, ... |
vehicle.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 10:44:24 2017
@author: wroscoe
"""
import time
from threading import Thread
from .memory import Memory
class Vehicle():
def __init__(self, mem=None):
if not mem:
mem = Memory()
self.mem = mem
self.parts... |
dubbo_test.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
... |
main.py | # -*- coding: utf-8 -*-
'''
@author: arcra
'''
import time, threading, os
import Tkinter as tk
import clipsFunctions
from clipsFunctions import clips
import pyRobotics.BB as BB
from pyRobotics.Messages import Command, Response
#from BBFunctions import gui
from BBFunctions import ResponseReceived, CreateSharedVar, Wr... |
test.py | import json
import os.path as p
import random
import subprocess
import threading
import logging
import time
from random import randrange
import math
import pika
import pytest
from google.protobuf.internal.encoder import _VarintBytes
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHous... |
front_end.py | #!/usr/bin/env impala-python
#
# 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 (... |
threadhandler.py | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# FEDERAL UNIVERSITY OF UBERLANDIA
# Faculty of Electrical Engineering
# Biomedical Engineering Lab
#------------------------------------------------------------------------------
# Author: Andrei Nakagawa, MSc... |
oke.py | # -*- coding: utf-8 -*-
#My Script by danrfq
#Support by My Beloved Team Ꭲ̡̦͎͇͈̘̻̎̉̅́̒͗ͅϵѧᴍ̸̩̟̗͎̯͙̺̺̜̬̙̟̀̑̓͋̐͆͌̓̒́̒͗͒͑̚͟͜ᎶʀҽѧᴛᏴøᴛ̢͓̹̗̘̠̪̖͗̃̄̅̆̽̀̕͜͞
#i'm Owner Ꭲ̡̦͎͇͈̘̻̎̉̅́̒͗ͅϵѧᴍ̸̩̟̗͎̯͙̺̺̜̬̙̟̀̑̓͋̐͆͌̓̒́̒͗͒͑̚͟͜ᎶʀҽѧᴛᏴøᴛ̢͓̹̗̘̠̪̖͗̃̄̅̆̽̀̕͜͞
import LINEFTB
from LINEFTB.lib.curve.ttypes import *
from datetime import datetime
i... |
__init__.py | from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
)
import warnings
import nu... |
sign.py | import sys
from os import path
import threading
import time
from ..prompt import Prompt
from ..document import Document
from ..results import with_simple_result
def sign(file: str):
"""Sign the given PDF document
- Argument file: absolute path to the document
"""
# Ask for the details: address, key,... |
WalkerServer.py | # !/usr/bin/env python
# -*- coding:utf-8 _*-
# @Author: swang
# @Contact: wang00sheng@gmail.com
# @Project Name: SmartWalker-master
# @File: temp3.py
# @Time: 2022/01/17/11:47
# @Software: PyCharm
import os, sys
CRT_DIR = os.path.dirname(os.path.abspath(__file__))
F_PATH = os.path.dirname(CRT_DIR)
FF_PATH = os.path.... |
server.py | import socket
import os
import time
import subprocess
import threading
from queue import Queue
import pynput
connections_allowed = 50
connections = []
addresses = []
THREADS = 2
JOB_NUMBER = [1, 2]
queue = Queue()
def socket_create():
try:
global host_list
global port
global s
ho... |
splunk_api.py | import os
import logging
import splunklib.client as client
import splunklib.results as results
from splunklib.binding import handler as base_handler
import random
import time
import threading
import re
from urllib.parse import urlparse
splunk = None
def connect():
global splunk
if not splunk:
app_nam... |
boommmm.py | #-*- coding: gbk -*-
import requests
from threading import Thread, activeCount
import Queue
from proxy import get_proxy as gp
queue = Queue.Queue()
dir_file=raw_input("dictionary:")
@gp.RequestWithProxy
def scan_target_url_exists(target_url, proxy):
headers={
'Accept': 'text/html,application/xht... |
sharedmem.py | """
desitarget.internal.sharedmem
=============================
Easier parallel programming on shared memory computers.
The source code is at http://github.com/rainwoodman/sharedmem .
.. contents:: Topics
:local:
Programming Model
-----------------
:py:class:`MapReduce` provides the equivalent to multiprocessin... |
test_random.py | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises, assert_equal,
assert_warns)
from numpy import random
from numpy.compat import asbytes
import sys
class TestSeed(TestCase):
def test_sc... |
midhaul_gurobi.py | """Midhaul Module.
Creating Gurobi Class for Journal 3.
"""
from datetime import datetime
from multiprocessing import Process
from gurobipy import * # GRB_INIT
from hcran_generic_gurobi import HcranGenericGurobi
from hcran_monitor import *
from midhaul import Midhaul
OUTPUT_PATH = "../output/"
class MidhaulGuro... |
__init__.py | # -*- coding: utf-8 -*-
"""
Implements context management so that nested/scoped contexts and threaded
contexts work properly and as expected.
"""
from __future__ import absolute_import
from __future__ import division
import collections
import functools
import logging
import os
import platform
import six
import socket
... |
BallDetection.py | #Importing libraries
import datetime
import cv2
import numpy as np
import math
import json
from networktables import NetworkTables
import threading
from threading import Thread
cv2.useOptimized()
class FPS:
def __init__(self):
# store the start time, end time, and total number of frames
# that wer... |
load_test.py | import os
import signal
import subprocess
from datetime import datetime
import pytz
from threading import Thread
from selenium.webdriver.firefox.webdriver import WebDriver
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from nayan.models import User, Profile, Question, Quiz, Course, QuestionPa... |
MyPrint_ReubenPython2and3Class.py | # -*- coding: utf-8 -*-
'''
Reuben Brewer, Ph.D.
reuben.brewer@gmail.com
www.reubotics.com
Apache 2 License
Software Revision G, 03/13/2022
Verified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet).
'''
__author__ = 'reuben.brewer'
import os, sys, p... |
client.py | import socket
import threading
#Creating an INET , STREAMing socket
client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
IP=socket.gethostbyname(socket.gethostname())
PORT=1234
ADDR=(IP,PORT)
MSG_SIZE=32
FORMAT='utf-8'
sending=False
printing=False
MsgList=[]
def send(username):
global sending,printing
whil... |
test_concurrency.py | import random
import threading
import time
from sqlalchemy import Column
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import contextlib
impo... |
run_auxcpvloss.py | import os
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["OPENBLAS_NUM_THREADS"] = "1"
os.environ["MKL_NUM_THREADS"] = "1"
os.environ["VECLIB_MAXIMUM_THREADS"] = "1"
os.environ["NUMEXPR_NUM_THREADS"] = "1"
# os.environ['TF_AUTO_MIXED_PRECISION_GRAPH_REWRITE_WHITELIST_ADD'] = 'Conv3D,Conv3DBackpropFilter,Conv3DBackprop... |
scheduler_job.py | # pylint: disable=no-name-in-module
#
# 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, Versio... |
eval_coco_format.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 applicab... |
monpoly.py | import os
import subprocess
import sys
from datetime import datetime
from datetime import timedelta
from threading import Thread
from typing import Any
from typing import Callable
from typing import Dict
from typing import IO
from typing import List
from typing import Optional
from typing import Tuple
import psutil
fr... |
basicgui.py | """
A GUI for the AIS decoder written with tkinter
"""
import datetime
import logging
import multiprocessing
import threading
import time
import tkinter
import tkinter.filedialog
import tkinter.messagebox
import tkinter.scrolledtext
import tkinter.ttk
import pyaisnmea.allmessages as allmessages
import pyaisnmea.ais a... |
time_ui.py | '''
Initialize UI
'''
import operator
import sys
import threading
from PySide2 import QtCore
from PySide2 import QtUiTools
from PySide2.QtWidgets import *
import time_tracker
class TimeTrackModel(QtCore.QAbstractTableModel):
def __init__(self, parent, custom_dict, header, *args):
QtCore.QAbstractTableM... |
__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... |
podman_compose.py | #! /usr/bin/python3
# -*- coding: utf-8 -*-
# https://docs.docker.com/compose/compose-file/#service-configuration-reference
# https://docs.docker.com/samples/
# https://docs.docker.com/compose/gettingstarted/
# https://docs.docker.com/compose/django/
# https://docs.docker.com/compose/wordpress/
from __future__ import... |
xbdm_bridge.py | """Manages a transport interface to an XBDM."""
from __future__ import annotations
import logging
import select
import socket
import time
import threading
from typing import Callable
from typing import Optional
from typing import Tuple
from . import rdcp_command
from . import remote_debugger_server
from . import xbdm... |
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
import linecache
from contextlib import ExitStack, redirect_stdout
from io import StringIO
from test import support
from test.suppor... |
asio_chat_client_test.py | import re
import os
import sys
from socket import *
from threading import Thread
import time
# this is a test case write with tiny-test-fw.
# to run test cases outside tiny-test-fw,
# we need to set environment variable `TEST_FW_PATH`,
# then get and insert `TEST_FW_PATH` to sys path before import FW module
test_fw_pa... |
controller.py | # Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019 Axel Gembe <derago@gmail.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 without limi... |
android_sqlitedb_analyzer.py | #-*- coding: utf-8 -*-
import os
import logging
import math
from modules.andForensics.modules.utils.android_sqlite3 import SQLite3
from multiprocessing import Process, Queue, Lock
import sqlite3
import binascii
import base64
import time
import re
import sys
logger = logging.getLogger('andForensics')
logging.basicConf... |
DeepSpeech.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import sys
log_level_index = sys.argv.index('--log_level') + 1 if '--log_level' in sys.argv else 0
os.environ['TF_CPP_MIN_LOG_LEVEL'] = sys.argv[log_level_index] if log_level_index > 0 and log_leve... |
training.py | from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import threading
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .. import backend as K
from .. import optimizers
from .. imp... |
device.py | # -*- coding: utf-8 -*-
'''
Device worker process
'''
from __future__ import absolute_import
# Import python stdlib
import os
import re
import signal
import logging
import threading
from datetime import datetime, timedelta
# Import thrid party libs
import zmq
import umsgpack
from prometheus_client import Counter
# I... |
ngrok.py | import os
import json
import time
import shutil
import logging
import zipfile
import platform
import tempfile
import subprocess
from pathlib import Path
from threading import Thread
import requests
from ...exceptions import BentoMLException
logger = logging.getLogger(__name__)
def get_command() -> str:
"""
... |
data_test.py | from colorama import Fore
import random as R
import threading as TR
import datetime
import time as T
DONE_FLAG = 0
START = 0
STOP = 999999
max_num = 200
THREADS = 20
compare_numbers = []
def average(lst):
return sum(lst) / len(lst)
def insertion_sort(numbers):
comparisons = 0
if(numbers):
... |
application.py | # -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France.
# =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement in the roo... |
transport_service.py | # Copyright 2019 Wirepas Ltd licensed under Apache License, Version 2.0
#
# See file LICENSE for full license details.
#
import logging
import os
from time import time
from uuid import getnode
from threading import Thread
import wirepas_messaging
from wirepas_gateway.dbus.dbus_client import BusClient
from wirepas_gate... |
openVisualizerWeb.py | #!/usr/bin/python
# Copyright (c) 2013, Ken Bannister.
# All rights reserved.
#
# Released under the BSD 2-Clause license as published at the link below.
# http://opensource.org/licenses/BSD-2-Clause
import sys
import os
if __name__=="__main__":
# Update pythonpath if running in in-tree development mode
based... |
rciw.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple IRC script to check for Recent Changes through IRC,
and to check for interwikis in those recently modified articles.
Can not be run manually/directly, but automatically by maintainer.py
In use on hu:, not sure if this scales well on a large wiki such
as en: ... |
contratos.py | import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.http import FormRequest
import urllib.parse
import os
from multiprocessing import Process, Queue
from twisted.internet import reactor
from settings import CONTRATOS_PATH, DB_PATH
import csv
import sqlite3
import time
import datetime
class ContratosSp... |
6.NAS.py | # NAS.py
# Network automation sys
#
# Created by yassen on 5/6/20.
# Copyright © 2021 yassen & nouhaila. All rights reserved.
from netmiko import ConnectHandler
from netmiko.ssh_exception import NetMikoTimeoutException, AuthenticationException
from paramiko.ssh_exception import SSHException
import getpass
from ti... |
condu.py | import signal
import socket
import time
from threading import Event
import sys
import gc
from condu.objects import MetaTask, TaskDef, WorkflowDef
from condu.conductor import WFClientMgr
import multiprocessing as mp
import logging
logger = logging.getLogger(__name__)
class Condu(WFClientMgr):
def __init__(self, ... |
run_py_tests.py | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""End to end tests for ChromeDriver."""
import base64
import json
import math
import optparse
import os
import shutil
import socket
i... |
unit_tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
import os
import sys
import json
import math
import atexit
import socket
import logging
import warnings
from glob import glob
from time import sleep, time
from threading import Thread
from unittest import TestCase, main
import protlib
from protl... |
django.py | import json
import logging
import os
import threading
from django.http import HttpResponse, HttpRequest
from .httpbased import HttpContext, HttpHandler, run_event_loop
from .utils import make_applications, cdn_validation
from ..utils import STATIC_PATH, iscoroutinefunction, isgeneratorfunction, get_free_port
logger ... |
_linux_driver.py | from __future__ import annotations
import asyncio
import os
from codecs import getincrementaldecoder
import selectors
import signal
import sys
import logging
import termios
from time import time
import tty
from typing import Any, TYPE_CHECKING
from threading import Event, Thread
if TYPE_CHECKING:
from rich.consol... |
controllers.py | from multiprocessing import Process
import kit
import parameters
import connectors
import extraction
import weeding
import processing
import traininig
class DataPreparationController:
def launch(self, pathTo, hyper):
targets = [extraction.launch, weeding.launch, processing.launch]
for target in ... |
stats.py | from client import client
from datetime import datetime
import discord
import os
import socket
import threading
import time
try:
import psutil
except ModuleNotFoundError:
has_psutil = False
else:
has_psutil = True
cmd_name = "stats"
client.basic_help(title=cmd_name, desc=f"shows various running statistics of {c... |
infolog.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... |
clang-tidy-diff.py | #!/usr/bin/env python
#
#===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------... |
runn.py | import json
import argparse
import configparser
import os
import platform
if "Windows" in platform.platform():
from symexe_win import conf_para
elif "Linux" in platform.platform():
from symexe import conf_para
import multiprocessing as mp
basedir = os.path.dirname(os.path.abspath(__file__))
cf = configparser... |
pyPlayMusic.py | """
Coded by Davi Innovation
davinnovation at gmail.com
playNotes
"""
import pyaudio
import os
import time
import numpy
global get_PyAudio
get_PyAudio = pyaudio.PyAudio()
class playNotes():
def __init__(self,codes=[40], chunk_size=2**15):
import wave
cwd = os.path.dirname(os.path.rea... |
System.py | #!/usr/bin/python
import ctypes
import sys
import logging
from multiprocessing import Process, Pipe, Value, Manager, Lock
from Platform import platform_unit as platform_unit
from Computation import computation_unit as computation_unit
# configure logging
logging.basicConfig(filename='computational_system.log',level... |
test_event_based_scheduler.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.