source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
sessions.py | import os
import time
from threading import Thread, Lock
from contextlib import contextmanager
import reloadium.vendored.sentry_sdk
from reloadium.vendored.sentry_sdk.envelope import Envelope
from reloadium.vendored.sentry_sdk.session import Session
from reloadium.vendored.sentry_sdk._types import MYPY
from reloadium.... |
webserver.py | import os
import threading
import traceback
import bottle
class WebServer(object):
def __init__(self, exporter, host, port, websocket_port, custom_component, encoder, api):
self._api = api
self._host = host
self._port = port
self._websocket_port = websocket_port
self._exp... |
tubygui.py | #!/usr/bin/python
from tkinter import *
from PIL import Image,ImageTk
import os,re,threading,pyfiglet
import validate, dengine
#beta version and will be added soon
class GifLabel(Label): #only gif player
global GifLabel
def __init__(self, master, filename,frame):
gif_image = Image.op... |
dbx.py | import base64
import random
import os
import time
import copy
import json
import dropbox
# from dropbox.exceptions import ApiError, AuthError
# from dropbox.files import FileMetadata, FolderMetadata, CreateFolderError
from pydispatch import dispatcher
# Invader imports
from lib.common import helpers
from lib.common im... |
runtest.py | #!/usr/bin/env python3
#
# Copyright 2017 Jeff Bush
#
# 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... |
client.py | import socket
import pickle
import tkinter
from tkinter import simpledialog
import tkinter.font as tkFont
import threading
from playsound import playsound
import time
import json
import random
import textwrap
import webbrowser #For /discord command
import hashlib
import difflib
HEADER = 64
FORMAT = 'utf-8'
DISCONNECT_... |
mpv.py | # -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
#
# Python MPV library module
# Copyright (C) 2017-2020 Sebastian Götte <code@jaseg.net>
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation, either... |
weixin.py | #!/usr/bin/env python
# coding: utf-8
import qrcode
from pyqrcode import QRCode
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import http.cookiejar
import requests
import xml.dom.minidom
import json
import time
import ssl
import re
import sys
import os
import subpro... |
clean.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from sys import exit
from .initialize import Initialize
from ..libraries.tools import save_setting
from ..libraries.thread... |
client.py | #!/usr/bin/python3
#-*-coding:utf-8-*-
import os
import socket
import time
import threading
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import utils
from worker import FileWorker
from worker import SockWorker
from worker import DataWorker
from authority import AuthClient... |
test_pebble.py | #!/usr/bin/python3
# Copyright 2021 Canonical 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 agre... |
n1ql_window_functions_syntax_check.py | from .tuq import QueryTests
import random
import string
from random import randint
from membase.api.exception import CBQError
import threading
import copy
class WindowFunctionsSyntaxTest(QueryTests):
def setUp(self):
super(WindowFunctionsSyntaxTest, self).setUp()
self.log_config_info()
sel... |
netdisco_wrapper.py | """
Periodically start netdisco and extract naming info about the network.
"""
import threading
import os
import stat
import utils
import requests
import subprocess
import json
import time
from netdisco.discovery import NetworkDiscovery
BASE_BINARY_PATH = 'https://github.com/noise-lab/netdisco-python-wrapper/raw/mast... |
register.py |
import logging
import socket
import threading
import time
import struct
from .settings import settings
from .utils import *
from .helper import MopidyPlexHelper as MPH
logger = logging.getLogger(__name__)
PLEX_GDM_IP = '239.0.0.250' #multicast ip to Plex server(s)
PLEX_MULTICAST_PORT = 32413
PLEX_GDM_CLIENT_PORT... |
scheduler_job.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... |
orchestration.py | import os
import hashlib
from fire import Fire
import concurrent.futures
from s import become_server, remote
from model import GrokkingConfig, GrokkingPerceiver, GrokkingTrainer
import threading
def thread_it(run_function):
def wrapper(*args, **kwargs):
temp = threading.Thread(target=run_function, args... |
LabConnection.py | from netmiko import ConnectHandler
from jinja2 import Environment,FileSystemLoader
import yaml
import threading
import os
import time
class LabConnection:
def push(self,host,port,commands,device):
cisco = {
'device_type' : 'cisco_ios_telnet',
'host' : host,
'port' : port,
'username':'username',
... |
runner.py | from __future__ import print_function
__true_print = print
import argparse
import datetime
import docker
import json
import multiprocessing
import numpy
import os
import psutil
import requests
import sys
import threading
import time
import psutil
def print(*args, **kwargs):
__true_print(*args, **kwargs)
sys.s... |
sql_db.py | import os
import concurrent
import queue
import threading
import asyncio
import sqlite3
from .logging import Logger
def sql(func):
"""wrapper for sql methods"""
def wrapper(self, *args, **kwargs):
assert threading.currentThread() != self.sql_thread
f = asyncio.Future()
self.db_request... |
manager.py | # -*- coding: utf-8 -*-
#
# profiler : a Wi-Fi client capability analyzer tool
# Copyright : (c) 2020-2021 Josh Schmelzle
# License : BSD-3-Clause
# Maintainer : josh@joshschmelzle.com
"""
profiler.manager
~~~~~~~~~~~~~~~~
handle profiler
"""
# standard library imports
import argparse
import inspect
import logging
... |
joy_control.py | #!/usr/bin/python3
import threading
import rospy as rp
from mavros_msgs.srv import SetMode, CommandBool
from std_srvs.srv import Trigger, SetBool
from sensor_msgs.msg import Joy
from mavros_msgs.msg import PositionTarget, State
class JoyRCNode():
def __init__(self, rate):
rp.init_node('joy_rc_node')
self... |
test_docxmlrpc.py | from xmlrpc.server import DocXMLRPCServer
import http.client
import re
import sys
import threading
from test import support
import unittest
def make_request_and_skipIf(condition, reason):
# If we skip the test, we have to make a request because
# the server created in setUp blocks expecting one to co... |
Confirm.py | from base64 import urlsafe_b64decode, urlsafe_b64encode
from binascii import Error as b64Error
from django.conf import settings
from django.contrib.auth import get_user_model, login, logout
from django.contrib.auth.tokens import default_token_generator
from django.template.loader import render_to_string
from django.url... |
GetLocationData.py | import sys
import os
import ssl
import time
import json
import MySQLdb
from datetime import datetime
from qpid.messaging import *
import socket
import logging
from logging.handlers import RotatingFileHandler
import threading
class GetSvaData():
isError = False
nowTime = datetime.now()
appname = ""
br... |
kaldi.py | # -*- coding: UTF-8 -*-
from __future__ import absolute_import
# Operates on sound fragments consisting of signed integer samples 8, 16
# or 32 bits wide, stored in Python strings.
import audioop
import os
import time
from contextlib import contextmanager
from ctypes import CFUNCTYPE, c_char_p, c_int, cdll
from threa... |
test_application.py | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... |
communicator.py | import socket
import os
import MySQLdb
import threading
import time
import dbapi
from Module import Module
# THREAD 1: Get modules state from NUCLEO
########################################################################
def recvUDP():
time.sleep(0.1)
print "[RECVTH] Receiving thread started..."
# While send... |
uWServer.py | #!/bin/env python3
'''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 ... |
test_restful.py | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
NOTE:
This unittest is being used as a procedural test.
The tests must be run in-order and CANNOT be parallelized!
Tests all but two RESTful interfaces:
* agent's POST /v2/keys/vkey
- Done by C... |
acl_store.py | # Copyright (c) 2014 Metaswitch Networks
# 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 r... |
test_fork1.py | """This test checks for correct fork() behavior.
"""
import imp
import os
import signal
import sys
import time
from test.fork_wait import ForkWait
from test.test_support import run_unittest, reap_children, get_attribute, import_module
threading = import_module('threading')
#Skip test if fork does not exist.
get_attr... |
ewelink_command.py | import requests
import json
import logging
import websocket
import time
import threading
import ssl
class Ewelink(websocket.WebSocketApp):
data = None
def __init__(self, config_class, access_token = ''):
self.config_class = config_class
self.get_ewelink_device_info()
super(Ewelink, sel... |
merge_logs.py | # this script parses several log files and merges important data from them in one
# resulting log. this log provides organizes information in easy and readable form,
# allowing to see how interests and data for individual video segments have traveled from
# producer to consumer and back
# resulting log is organized li... |
datasets.py | # YOLOv5 dataset utils and dataloaders
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool, Pool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch... |
job.py | # Copyright (c) 2019 PaddlePaddle 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 app... |
MocaDirectoryCache.py | # -- Imports --------------------------------------------------------------------------
from typing import (
Union, Dict, Tuple, List, Optional
)
from pathlib import Path
from gzip import compress, decompress
from threading import Thread
from time import sleep
from .utils import get_mime_type, get_timestamp
# ---... |
executors.py | # -*- coding: utf-8 -*-
""" Single and multi-threaded executors."""
import datetime
import os
import tempfile
import threading
from abc import ABCMeta, abstractmethod
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
import psutil
from six import string_types, with_metaclass
from typing_extensi... |
linutil.py | import os
import re
import glob
import socket
import struct
import logging
import binascii
import threading
import subprocess
import netfilterqueue
from collections import defaultdict
# Debug print levels for fine-grained debug trace output control
DNFQUEUE = (1 << 0) # netfilterqueue
DGENPKT = (1 << 1) # Gen... |
utils.py | # coding=utf-8
import functools
import multiprocessing
import sys
import traceback
def isolated(function):
def wrapper(queue, *args, **kwargs):
try:
(result, error) = (function(*args, **kwargs), None)
except Exception:
(ex_type, ex_value, tb) = sys.exc_info()
(... |
mp_synchronize.py | #
# A test file for the `multiprocessing` package
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
import time, sys, random
from Queue import Empty
import multiprocessing # may get overwritten
#### TEST_VALUE
def value_func(running, mutex):
random.seed()
time.sleep(random.rando... |
factory.py | """
RPyC connection factories: ease the creation of a connection for the common
cases)
"""
from __future__ import with_statement
import socket
from contextlib import closing
from functools import partial
import threading
try:
from thread import interrupt_main
except ImportError:
try:
from _thread import... |
pmctree.py | # !/usr/bin/python
# -*- coding:utf-8 -*-
import multiprocessing as mp
import tensorflow as tf
from sub_tree import sub_tree
from sub_tree import node
import sys
import logging
import time
import Queue
import numpy as np
from treelib import Tree
import copy
from utils import compute_bleu_rouge
from utils import norma... |
portable_runner.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... |
experiment.py | """
the polar plot downloads are 1 day long each
the request needs an URL and a params dictionary:
- station data in CSV requires params
- polar plots (fitted vectors) comes in netCDF and requires no params
- solar wind datas
- sme
- substorms
"""
import requests
import xarray as xr
from io import B... |
timeout.py | from threading import Thread
import functools
def timeout(timeout):
def deco(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
res = [Exception('function [%s] timeout [%s seconds] exceeded!' % (func.__name__, timeout))]
def newFunc():
try:
... |
rabbit.py | import json
import pika
import logging
from multiprocessing import Queue
from threading import Thread
from .model import EventSourceHook
logging.getLogger('pika').setLevel(logging.CRITICAL)
class RabbitMQEventSource(EventSourceHook):
def __init__(self,
event_queue: Queue,
amqp_... |
test_direct_transfer.py | import pickle
import threading
import time
import ray
import ray.streaming._streaming as _streaming
import ray.streaming.runtime.transfer as transfer
from ray._raylet import PythonFunctionDescriptor
from ray.streaming.config import Config
@ray.remote
class Worker:
def __init__(self):
self.writer_client =... |
client.py | #-*- coding:Utf-8 -*-
#To append the module to the path
import os
import sys
sys.path.append(os.path.realpath('module'));
import threading
#Our custom modules
from clientUDP import ClientUDP
from clientTCP import ClientTCP
from clientICMP import ClientICMP
import display
import fileReader
path = './data/addresses.... |
plate2kml.py | #!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2006-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NASA Vision Workbench is licensed under the Apache License,
# Version 2.0 (the "License"); you may... |
plumber.py | # coding: utf-8
import abc
try:
from queue import Queue
except ImportError: # PY2
from Queue import Queue
import threading
import multiprocessing
import logging
__version__ = ('0', '11')
__all__ = ['UnmetPrecondition', 'Filter', 'Pipe', 'Pipeline', 'precondition',
'filter', 'pipe']
logger = logging... |
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... |
test_client.py | """
Created on Aug 31, 2012
@author: eric
"""
import unittest
import os.path
import logging
import ambry.util
from testbundle.bundle import Bundle
from ambry.run import RunConfig
from test_base import TestBase
from ambry.client.rest import Rest #@UnresolvedImport
from ambry.library import QueryCommand, get_librar... |
TFTscreen_v2.py | import yaml
from OB_classesv3 import On_Box_Window
from RSU_classesv2 import RSU_Window
import Decoder
from threading import Thread
import serial.tools.list_ports
from glances_sub import system_specs
import watchdog
import os
import time
import datetime as dt
def packet_len_time_check(IMUPack, audpack, starttime):
... |
dirbustEVERYTHING.py | #!/usr/bin/python
import sys
import os
import subprocess
import errno
import multiprocessing
from multiprocessing import Process
import time
import argparse
import pathlib
from urllib.parse import urlparse
# mkdir_p function updated for >= python 3.5
def mkdir_p(path):
pathlib.Path(path).mkdir(parents=True, exist... |
chooser.py | import Tkinter
import yaml
import os
import subprocess
import re
import time
import threading
os.chdir(os.path.dirname(os.path.realpath(__file__)))
SCRIPTDIR = "../../../../scripts/"
# read a yaml file
def read_by_id(path):
by_id = {}
with open(path, 'r') as ymlfile:
root = yaml.load(ymlfile)
for node in root["... |
data_flow_alex.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
import threading
try:
# Python 2
import Queue as queue
except Exception:
# Python 3
import queue
import tensorflow as tf
from tflearn import utils
from datax.transform_patch import rotate_combin... |
server.py | import socket
import threading as thr
import time
# local host
host = 'server.srikar.tech' # Change the host
port = 55543
print(host,port)
header_Size = 10
publicKeys = []
# internet, TCP protocol
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#... |
p2p_stress.py | import testUtils
import p2p_test_peers
import random
import time
import copy
import threading
from core_symbol import CORE_SYMBOL
class StressNetwork:
speeds=[1,5,10,30,60,100,500]
sec=10
maxthreads=100
trList=[]
def maxIndex(self):
return len(self.speeds)
def randAcctName(self):
... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
import subprocess
import sys
import platform
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
import selectors
import sysconfig
import select
import shutil
import threading
i... |
interactive.py | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at... |
test_failure.py | import json
import logging
import os
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.ray_constants as ray_constants
from ray.cluster_utils import Cluster
from ray.test_utils import (
relevant_errors,
wait_for_condition,
wait_for_e... |
manager.py | # -*- coding: utf-8 -*-
"""
conpaas.core.manager
====================
ConPaaS core: service-independent manager code.
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
import os.path
from conpaas.core.log import create_logger
from conpaas.core.expose import expose
f... |
apProTomo2Aligner.py | #!/usr/bin/env python
from __future__ import division
import matplotlib
matplotlib.use('Agg') #Removes the X11 requirement for pylab
import os
import sys
import glob
import time
import scipy
import scipy.interpolate
import pylab
import subprocess
import numpy as np
import multiprocessing as mp
import matplotlib.pyplo... |
BaselineMerging.py |
# Implement UCB Vicon system for improved hardware functionality
#NKCKBaseline.py
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import math
from matplotlib import style
from Points import BuildPath
from std_msgs.msg import String
import rospy
import tf
import time
import datetime ##
import ... |
build_image_data.py | # Copyright 2016 Google 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 applicable law or a... |
PlexAPI.py | #!/usr/bin/env python
"""
Collection of "connector functions" to Plex Media Server/MyPlex
PlexGDM:
loosely based on hippojay's plexGDM:
https://github.com/hippojay/script.plexbmc.helper... /resources/lib/plexgdm.py
Plex Media Server communication:
source (somewhat): https://github.com/hippojay/plugin.video.plexbmc... |
alien_invasion.py | import sys
import random
from time import sleep
import threading
import pygame
import pygame.font
from alien import Alien
from bullet import Bullet
from button import Button
from game_stats import GameStats
from scoreboard import Scoreboard
from settings import Settings
from ship import Ship
from bunker import Bunker
f... |
__main__.py | from opcua import Client, ua, Node
import paho.mqtt.client as mqtt
from threading import Thread, Lock
from dotenv import load_dotenv
from OPCUA_MQTT_link.utils import (
getTagname,
getNewHash,
setTimestamp,
)
import time
import datetime
import json
import os
import logging
import copy
def buildNodeTree(pO... |
vpn_status.py | """
Drop-in replacement for i3status run_watch VPN module.
Expands on the i3status module by displaying the name of the connected vpn
using pydbus. Asynchronously updates on dbus signals unless check_pid is True.
Configuration parameters:
cache_timeout: How often to refresh in seconds when check_pid is True.
... |
RandomPlayer.py | from glob import glob
from multiprocessing import Process
from os import path
from random import randint, sample, shuffle
from typing import List, Optional
import simpleaudio as sa
from randomnipple.NippleOptionDict import NippleOptionDict
class RandomPlayer:
def __init__(self, vals: NippleOptionDict) -> None:
... |
windows.py | import contextlib
import ctypes
import ctypes.wintypes
import io
import json
import os
import re
import socket
import socketserver
import threading
import time
import typing
import click
import collections
import collections.abc
import pydivert
import pydivert.consts
if typing.TYPE_CHECKING:
class WindowsError(OS... |
ftp_cracker.py | import ftplib
from threading import Thread
import queue
from colorama import Fore, init # for fancy colors, nothing else
# init the console for colors (for Windows)
# init()
# initialize the queue
q = queue.Queue()
# port of FTP, aka 21
port = 21
def connect_ftp():
global q
while True:
... |
testwindow.py | """Class for adding functionality to Settings modal window."""
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.modalview import ModalView
from kivy.properties import StringProperty, BooleanProperty, ListProperty, ObjectProperty
from kivy.clock import C... |
_handler.py | import functools
import json
import multiprocessing
import sys
import threading
import traceback
import ansimarkup
class StrRecord(str):
__slots__ = ("record",)
class Handler:
def __init__(
self,
*,
writer,
stopper,
levelno,
formatter,
is_formatter_dy... |
discord_bot.py | # Standard library imports
import asyncio
import sys
import os
import logging
from logging.config import fileConfig
import argparse
import json
import threading
from typing import overload
from discord.message import Message
import emoji
# Third party imports
import discord
# Path hack
sys.path.insert(0, os.path.absp... |
pox-pydoc.py | #! /usr/bin/python2.7
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
server.py | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""ParlAI Server file"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... |
test_subprocess.py | import unittest
from test import script_helper
from test import support
import subprocess
import sys
import signal
import io
import locale
import os
import errno
import tempfile
import time
import re
import sysconfig
import warnings
import select
import shutil
import gc
import textwrap
try:
im... |
chrome_test_server_spawner.py | # Copyright 2017 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.
"""A "Test Server Spawner" that handles killing/stopping per-test test servers.
It's used to accept requests from the device to spawn and kill instances of ... |
ckck.py | import queue
import threading
from bgmtinygrail.model_link.accounts import all_accounts
from bgmtinygrail.tinygrail.api import *
xsb_player = all_accounts['xsb_player']
NUM_F_WORKERS = 4
call = queue.Queue()
back = queue.Queue()
cid_set = []
def main():
for cid in range(1, 100000):
call.put(cid)
w... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module.
Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through
3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use
... |
search.py | # -*- coding: utf-8 -*-
def __auth_service(core, service_name, request):
service = core.services[service_name]
response = core.request.execute(core, request)
if response.status_code == 200 and response.text:
service.parse_auth_response(core, service_name, response.text)
def __query_service(core, s... |
events.py | import sys
import time
import re
import inspect
import threading
from contextlib import contextmanager
from six.moves.queue import Queue
from lemoncheesecake.helpers.text import camel_case_to_snake_case
from lemoncheesecake.exceptions import serialize_current_exception
DEBUG = False
class Event(object):
def __... |
sorting_box_RGB_ROS.py | #! /usr/bin/env/python
import cv2
import numpy as np
import time
import rospy
from std_msgs.msg import Int32, Int32MultiArray
import threading
class spots:
loc = 0
def drawRectangle(img, a, b, c, d, i):
sub_img = img[b:b + d, a:a + c]
edges = cv2.Canny(sub_img, lowThreshold, highThreshold)
pix = cv2.... |
base.py | import base64
import hashlib
from six.moves.http_client import HTTPConnection
import io
import json
import os
import threading
import traceback
import socket
import sys
from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit
from abc import ABCMeta, abstractmethod
from ..testrunner import Stop
from .protocol ... |
main.py | """
Copyright (C) Cortic Technology Corp. - All Rights Reserved
Written by Michael Ng <michaelng@cortic.ca>, 2021
"""
from flask import Flask
from flask_autoindex import AutoIndex
from flask import render_template, request, redirect, session, jsonify, url_for
from flask_cors import CORS
from flask_login import (
... |
kivy_ui.py | import json
import re
import time
from copy import copy
from datetime import datetime
from functools import partial
import subprocess
from subprocess import Popen, PIPE
from threading import Thread
from collections import namedtuple
from kivy.logger import Logger
import io
import os
import atexit
import yaml
from PIL i... |
csc.py | '''
File name : csc.py
Description : check Cisco Nexus configs for security settings (using nxapi)
Created : 07/03/2018
Last Modified : 07/05/2018
Version : 0.8
Copyright 2018 M. Vollandt (github863027@s245050704.online.de) All rights reserved.
This script will read Cisco Nexus conf... |
job_worker.py | ###########################################################################
#
# Copyright 2019 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
#
# https://www.apache.org... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import os
import pickle
import random
import re
import subprocess
import sys
import textwrap
import threading
import time
import unitt... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
api.py | # Copyright (c) 2018 Bottersnike
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
saver.py | # Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
comm.py | #! /usr/bin/python
# encoding=utf-8
import os
import datetime,time
from selenium import webdriver
import config
import threading
import numpy as np
def writelog(msg,log):
nt=datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
text="[%s] %s " % (nt,msg)
os.system("echo %s >> %s" % (text.encode('utf8'),l... |
analysis_subprocess.py | #####################################################################
# #
# /analysis_subprocess.py #
# #
# Copyright 2013, Monash University ... |
SentenceTransformer.py | import json
import logging
import os
import shutil
from collections import OrderedDict
from typing import List, Dict, Tuple, Iterable, Type, Union, Callable
from zipfile import ZipFile
import requests
import numpy as np
from numpy import ndarray
import transformers
import torch
from torch import nn, Tensor, device
from... |
a_not_eq_a2.py | import threading
''' when is a != a ? '''
a = 1
a_ne_a = 0 # count when a != a
n = 10000000
lock1 = threading.Lock() # get lock
# only one thread can 'hold' the lock at a time
# the other waits for it to be released
def change_a():
''' change a n times '''
global a
for i in range(n):
with lock1:... |
util.py | # *****************************************************************************
# © Copyright IBM Corp. 2018. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0 license
# which accompanies this distribution, and is available at
# http://www.apac... |
integrate_main.py | #!/usr/bin/env python
import threading
import queue
import time
from integrate import integrate_numpy, f
def timer(func):
def wrapper(*arg, **kw):
'''
Secondary source: https://stackoverflow.com/questions/1622943/timeit-versus-timing-decorator
Primary source: http://www.daniweb.com/code/s... |
userInterface.py | import sys
from matplotlib import animation
sys.path.insert(0, '/home/pi/Documents/Cagius/Code/Main')
import init_stop_Sequences as iss
import threading
import time
import serial
import datetime as dt
from glob import glob
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.