source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
testMovement.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from rosi_defy.msg import RosiMovementArray
from rosi_defy.msg import RosiMovement
import time
import threading
from getkey import getkey, keys
class RosiNode():
def __init__(self):
rospy.init_node('rosi_node')
print(" W - Andar para frent... |
glprogram.py | """This module defines convenient classes for building 3D GUI programs.
- GLProgram takes care of basic user input.
- GLNavigationProgram allows 3D navigation with the mouse.
- GLRealtimeProgram calls a subclass-defined idle() function roughly on a
constant time step.
"""
from OpenGL.GL import *
from OpenGL.GLU imp... |
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... |
walkbyunits.py |
import time
import threading
# import json
import pymem
import keys
# import keyboard
# import mouse
from pymem import Pymem
# from math import acos, pi, sin, sqrt, isclose
import utils
KOEF = 1
INDEX = 0
USING_WEAPON = False
# x, y, cos, sin
CURRENT_POSITION = (1, 1, 0.5, 0.5,)
CURRE... |
rapid.py | import os
import sys
from termcolor import colored
import traceback
import subprocess
import queue
import threading
import multiprocessing
worker_data=["BloodHoundAD/BloodHound",
"GhostPack/Seatbelt",
"GhostPack/SharpUp",
"yeyintminthuhtut/Awesome-Red-Teaming",
"byt3bl33d3r... |
screens.py | import asyncio
from weakref import ref
from decimal import Decimal
import re
import threading
import traceback, sys
from typing import TYPE_CHECKING, List
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (ObjectProperty,... |
search_keywords.py | import requests
import time
from bs4 import BeautifulSoup
import os
import glob
import random
import numpy as np
from code.tools.multi_download import download
from tqdm import tqdm
from code.downloader.gather_info import create_markdown # AOverview
from code.configs import proxy, root_path
from code.tools.zip_tools i... |
__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@author: rainsty
@file: __init__.py
@time: 2020-09-22 15:24:29
@description:
"""
from .agent import action
from .agent import get_action_list
# # !/usr/bin/env python
# # encoding: utf-8
# # 如果觉得不错,可以推荐给你的朋友!http://tool.lu/pyc
# import sys
# import importlib
# import... |
dataset.py | import os
import cv2
import socket
import time
import threading
import winsound
if not os.path.exists('images'):
os.makedirs('images')
def receiveData():
global response
while True:
try:
response, _ = clientSocket.recvfrom(1024)
except:
break
de... |
run.py | import webview
import threading, sys
from fup import create_app
app = create_app()
def runInBrowser(run=True):
#run in browser or in pywebview browser
if run:
if __name__ == "__main__":
app.run(host='127.0.0.1', port=5000, debug=True)
else:
def start_server():
... |
start_subscribers.py | from project.model.subscriber.baby_monitor_subscriber import BabyMonitorSubscriber
from project.model.subscriber.smartphone_subscriber import SmartphoneSubscriber
from project.model.subscriber.smart_tv_subscriber import SmartTvSubscriber
from multiprocessing import Process
from time import sleep
import pika
# baby_moni... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from Queue import Queue, Empty
from threading import Thread
from time import sleep
from collections import defaultdict
# 第三方模块
from qtpy.QtCore import QTimer
# 自己开发的模块
from .eventType import *
import traceback
########################################################################
class ... |
main.py | #!/usr/bin/env python3
# Copyright 2017 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 or... |
client.py | from vidstream import CameraClient
from vidstream import VideoClient
from vidstream import ScreenShareClient
import threading
# Choose One
# client3 = CameraClient('127.0.0.1', 9998)
# client2 = VideoClient('127.0.0.1', 9999, 'video.mp4')
client3 = ScreenShareClient('127.0.0.1', 9999)
t= threading.Thread(target=clien... |
crypto_balance.py | #!/usr/bin/env python2
# CONFIGURE THESE AS DESIRED
client_id = "CLIENT_ID"
pairs = [
{"name": "Bitcoin", "ticker": "btcusd"},
{"name": "Ethereum", "ticker": "ethusd"},
{"name": "Bitcoin Cash", "ticker": "bchusd"},
{"name": "Ripple", "ticker": "xrpusd"}
]
api_keys = {
"btcusd": {"api_key": ... |
test_odata2_sqlds.py | #! /usr/bin/env python
import logging
import random
import sqlite3
import threading
import uuid
import unittest
from pyslet.http import params
from pyslet.odata2 import core
from pyslet.odata2 import csdl as edm
from pyslet.odata2 import metadata as edmx
from pyslet.odata2 import sqlds
from pyslet.py2 import (
lo... |
model.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import threading
import random
import tensorflow as tf
import torch
import torchvision as tv
import numpy as np
import skeleton
from architectures.resnet import ResNet18
from skeleton.projects import LogicModel, get_logger
from skeleton.projects... |
common.py | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
testrunner.py | # Copyright 2010 Orbitz WorldWide
#
# 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... |
daemon.py | from . import tempserver as ts
import multiprocessing as mp
import webbrowser
import os
def auth_upstox() -> str:
"""Helps in authorizing Upstox user and returns the access_token.
Returns
-------
str
Returns the access token for the verified individual.
"""
def start_server(queue):
... |
utils.py | import asyncio
import atexit
from collections import deque, OrderedDict, UserDict
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from datetime import timedelta
import functools
from hashlib import md5
import html
import inspect
import json
import logging
import multiprocessing
i... |
tpu_estimator_new.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... |
tello.py | import socket
import threading
import time
from stats import Stats
class Tello(object):
def __init__(self):
"""
Constructor.
"""
self.local_ip = ''
self.local_port = 8889
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.socket.bind((self.lo... |
lesson4.py | #!/usr/bin/env python
# _*_coding:utf-8_*_
import time
from multiprocessing import Process
class MyProcess(Process):
def __init__(self, num):
self.num = num
def run(self):
pass
def foo(j):
time.sleep(1)
print(p.is_alive(), j, p.pid)
time.sleep(1)
if __name__ == '__main__':
... |
engine.py | """
Event-driven framework of vn.py framework.
"""
import asyncio
from asyncio import iscoroutinefunction
from collections import defaultdict
from datetime import datetime
from queue import Empty, Queue
from threading import Thread
from time import sleep
from typing import Any, Callable
EVENT_TIMER = "eTimer"
class ... |
heartbeats.py | # this is the MAIN script
import multiprocessing
import multiprocessing.forking
import os
import sys
import socket
from parseConfig import parseConfig
from hbProcess import heartbeat_process
from notiManager import notification_process
from colorama import init
#from statusMonitor import systemMonitor
import globalPar... |
statemachine.py | # -*- coding: utf-8 -*-
"""
bromelia.statemachine
~~~~~~~~~~~~~~~~~~~~~
This module contains the finite state machine defined in Section 5.6 of
IETF RFC 6733.
:copyright: (c) 2020-present Henrique Marques Ribeiro.
:license: MIT, see LICENSE for more details.
"""
import logging
import threadin... |
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... |
pool.py | import os
import threading
import multiprocessing.pool as pool
from multiprocessing.pool import TERMINATE
from torch.multiprocessing.pool import clean_worker
from torch.multiprocessing import get_context
from .pickle import dumps, loads
from .queue import SimpleQueue, MultiP2PQueue
def proxy_caller(*input_):
"""... |
query.py | #!/usr/bin/env python
from collections import OrderedDict
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
import code
import datetime
import logging
import os
import os.path as op
import pickle
import random
import sy... |
dns.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import re
import socket
import threading
import time
class DNSQuery(object):
"""
Used for making fake DNS resolution responses based on received
raw req... |
__main__.py | from scapy.all import DHCP, Ether
from scapy.all import sniff
from threading import Thread
from slacker import Slacker
import subprocess
from time import sleep, time, mktime
from datetime import datetime, timedelta
mac_to_name = {"<mac-id>": "<Name of the person belonging to this id>", }
token = "<your-slack-token>"
c... |
mail.py | from tkinter import *
import tkinter as tk
from tkinter import (
ttk,
filedialog as fd,
)
from .utils import (
Section,
BASE_FONT,
EXCEL_FILES,
CSV_FILES
)
from .modtorpedo import (
CSVReader,
ExcelReader,
Template,
Snippet,
Sender
)
import threading
import json
class Pass... |
make.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Cubic spline fitter
from __future__ import print_function
import re
import sys
import threading
import subprocess
import glob
import sys
import ntpath
import os
import platform
import argparse
import ctypes as c
from collections import namedtuple
try:
# Python 3 na... |
TestSimplePooledPg.py | """Test the SimplePooledPg module.
Note:
We don't test performance here, so the test does not predicate
whether SimplePooledPg actually will help in improving performance or not.
Copyright and credit info:
* This test was contributed by Christoph Zwerschke
"""
__version__ = '1.1'
__revision__ = "$Rev: 8218 $"
__d... |
test_recv_op.py | # Copyright (c) 2018 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... |
test_SeqIO_index.py | # Copyright 2009-2017 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Unit tests for Bio.SeqIO.index(...) and index_db() functions."""
try:
import sqlite3
... |
signals.py |
from django.dispatch import receiver
from django.db.models.signals import pre_save,post_save,pre_delete,post_delete,m2m_changed
from .import models
import datetime
from django.db import transaction
from multiprocessing.pool import ThreadPool
from threading import Thread
from clouds import utils
from clouds.signals imp... |
dmscope.py | #!/usr/bin/env python3
# Copyright (c) 2014,2020,2021 BladeSabre
#
# 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,... |
env_wrappers.py | """
Modified from OpenAI Baselines code to work with multi-agent envs
"""
import numpy as np
from multiprocessing import Process, Pipe
from baselines.common.vec_env import VecEnv, CloudpickleWrapper
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
while Tru... |
test_system_mutex.py | def test_system_mutex():
from robocode_ls_core.system_mutex import SystemMutex
from robocode_ls_core.system_mutex import timed_acquire_mutex
from robocode_ls_core.subprocess_wrapper import subprocess
import sys
import pytest
import time
import threading
import weakref
mutex_name = "... |
dispatcher_class.py | """
Central communication agent in the manageability framework responsible
for issuing commands and signals to other tools/agents
Copyright (C) 2017-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import datetime
import json
import platform
import signal
import sys
from logging.config i... |
core_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... |
game.py | # -*- coding: utf-8 -*-
import Game_lib.game
import threading
import pygame
from time import sleep as delay
import random
import numpy
from PIL import Image
default_speed=12
# define colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
spee... |
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_tracer.py | """
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
import os
from os import getpid
import warnings
from unittest.case import SkipTest
import mock
import pytest
import ddtrace
from ddtrace.ext import system
from ddtrace.context import Context
from ddtrace.constants import VERSION_KEY, EN... |
console.py | # -*- coding: utf-8 -*-
"""
StepPy
:copyright: (c) 2016-2017 by Yann Gravrand.
:license: BSD, see LICENSE for more details.
"""
import pyfiglet
from multiprocessing import Process, Queue
from six.moves import queue
class Console(object):
configspec = {
'console': {
'font': 'strin... |
myplex.py | # -*- coding: utf-8 -*-
import copy
import threading
import time
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT,
X_PLEX_IDENTIFIER, log, logfilter, utils)
from plexapi.base import PlexObject
from plexapi.client impor... |
utils.py | import threading
from django.db import connection
from six.moves import queue
def run_concurrently(fn, kwargs=None, num_threads=5):
exceptions = queue.Queue()
def worker(**kwargs):
try:
fn(**kwargs)
except Exception as exc:
exceptions.put(exc)
... |
main.py | #!/usr/bin/python
'''
Generic JSON HTTP(S) API exporter.
Based on
https://www.robustperception.io/writing-json-exporters-in-python/
https://www.robustperception.io/writing-a-jenkins-exporter-in-python/
'''
import sys
import time
import argparse
import logging
import logging.config
import re
import threading
import sign... |
tinychain.py | #!/usr/bin/env python3
"""
⛼ tinychain
putting the rough in "rough consensus"
Some terminology:
- Chain: an ordered list of Blocks, each of which refers to the last and
cryptographically preserves a history of Transactions.
- Transaction (or tx or txn): a list of inputs (i.e. past outputs being spent)
... |
plugin.py | from binascii import hexlify, unhexlify
from electrum_bitcoinprivate.util import bfh, bh2u
from electrum_bitcoinprivate.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum_bitcoinprivate import constants
from electrum_bitcoinprivate.i18... |
test_gc.py | import unittest
from test.support import (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
temp_dir, requires_type_collecting)
from test.support.script_helper import assert_python_ok, make_script
import sys
import time
import gc... |
plugin_event_multiplexer.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
ws_server.py | import asyncio
import websockets
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import socket
import datetime
import time
import threading
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
#set GPIO numbering mode and define output pins
GPIO.setmode(GPIO.BOARD)
motor1a = 1... |
anialtools.py | import hdnntools as hdt
import nmstools as nmt
import pyanitools as pyt
import pyaniasetools as aat
import pyanitrainer as atr
import pymolfrag as pmf
from pyNeuroChem import cachegenerator as cg
import numpy as np
from time import sleep
import subprocess
import random
#import pyssh
import re
import os
import pyani... |
signal.py | import os
import time
import sys
import psutil
import threading
from cklib.logging import log
from cklib.event import dispatch_event, Event, EventType
from signal import signal, Signals, SIGTERM, SIGINT
parent_pid = None
def delayed_exit(delay: int = 3) -> None:
time.sleep(delay)
os._exit(0)
def handler(s... |
interface.py | # Date: 06/07/2018
# Author: Pure-L0G1C
# Description: Interface for the master
from re import match
from lib import const
from hashlib import sha256
from time import time, sleep
from os import urandom, path
from threading import Thread
from datetime import datetime
from os import getcwd, path, remove
from... |
blogDWdata.py | from __future__ import generators, print_function
import numpy as np
from random import shuffle
from scipy.io import loadmat
import functools
import Queue
#from multiprocessing import Process, Queue, Manager, Pool
import threading
import time
from collections import defaultdict
def async_prefetch_wrapper(iterable, b... |
test_tcp.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Thomas Jackson <jacksontj.89@gmail.com>`
'''
# Import python libs
from __future__ import absolute_import
import threading
import tornado.gen
import tornado.ioloop
import tornado.concurrent
from tornado.testing import AsyncTestCase, gen_test
import salt.config
from... |
random_select_multi.py | import random
import numpy as np
import os
import sys
import getopt
import matplotlib.pyplot as plt
from multiprocessing import Process
from multiprocessing import Semaphore
def usage():
"""Simple function returning the usage information for the script."""
print("\n")
print("Usage: python random_select_m... |
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):
... |
tasks.py | import json
import logging
import os
import time
import traceback
from multiprocessing.pool import ThreadPool
from tempfile import NamedTemporaryFile
from threading import Thread
from uuid import uuid4
import requests
import urllib3
import config
import database
from database import Website
from search.search import ... |
silvia-pi.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
from datetime import datetime
from multiprocessing import Process, Manager
from subprocess import call
from time import sleep, time
from urllib.request import urlopen
import board
import schedule
from adafruit_max31855 import MAX31855
from busio im... |
plc.py | import threading
import time
from asyncio import Queue
from collections import deque
from pprint import pprint
from typing import List, Optional, Any
import snap7
from snap7.types import S7AreaDB, S7WLReal, S7WLBit, S7WLByte
from stream2py import SourceReader
from stream2py.sources.raw_plc import PlcRawRead, PlcDataI... |
gitfs.py | # -*- coding: utf-8 -*-
'''
Base classes for gitfs/git_pillar integration tests
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import sys
import copy
import errno
import logging
import os
import pprint
import shutil
import tempfile
import textwrap
import threading
imp... |
test_stub.py | '''
Create an unified test_stub to share test operations
@author: Carl
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.co... |
plot_position.py | import argparse
import logging
import socketserver
import sys
import threading
import time
from google.protobuf import text_format
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
from math import degrees
from cvra_studio.viewers.LivePlotter2D import LivePlotter2D
import messages
from log_udp_protobuf import... |
set-all-clipboard.py | #!/usr/bin/env python3
import sys
import os
from threading import Thread
inp = sys.stdin.read()
def myfunc(cmd):
p = os.popen("xsel -i -%s" % (i, ), "w")
p.write(inp)
p.close()
threads = []
for i in ["p", "s", "b"]:
t = Thread(target=myfunc, args=(i,))
t.start()
threads.append(t)
for threa... |
monitored_session_test.py | # pylint: disable=g-bad-file-header
# 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/LICENS... |
__main__.py | import hashlib
import os
import time
import datetime
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
import logging
import tkinter as tk
import threading
import sys
from threading import Thread
from tkinter.scrolledtext import ScrolledText
from win10toast import ToastNotifier
import sm... |
AVR_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.4)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
from socket import socket
from threading impor... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
run_summarization.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
btcomm.py | from __future__ import unicode_literals
import socket
import sys
import errno
from .utils import (
register_spp,
get_mac,
get_adapter_powered_status,
get_adapter_discoverable_status,
get_adapter_pairable_status,
get_paired_devices,
device_pairable,
device_discoverable,
device_power... |
test_attenuator.py | import logging
import time
import threading
import pytest
from unittest.mock import Mock
from ophyd.sim import make_fake_device
from ophyd.status import wait as status_wait
from pcdsdevices.attenuator import (Attenuator, MAX_FILTERS,
_att_classes, _att3_classes,
... |
test_signal.py | import errno
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import time
import unittest
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, spawn_python
try:
import _testcapi
except ImportError:
... |
main_app.py | ################################################################################
# main_app.py
#-------------------------------------------------------------------------------
# Application framework for running apps on an LED display.
#
# By Malcolm Stagg
#
# Copyright (c) 2021 SODIUM-24, LLC
#
# Permission is hereb... |
ifstool.py | import getopt
from sys import argv
from os import getenv
import tempfile
import subprocess
from file_index import FileIndex
from file_action import FileAction
from configuration import Configuration
from os_abstraction import *
from extension import Extension, ExtensionParam
from extensions.df import Extension_df
from... |
socketserver.py | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc 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 your option) any later ... |
memory_receiver.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from queue import Queue, Full, Empty
import threading
import numpy as np
import torch
from datetime import datetime
fr... |
main.py | import time
import math
from threading import Thread, Lock
from flask import Flask, render_template, session, request
from flask_socketio import SocketIO, emit, join_room, leave_room,close_room, rooms, disconnect
# Set this variable to "threading", "eventlet" or "gevent" to test the
# different async modes, or leave i... |
__init__.py | # vim: ts=4:sw=4:et:cc=120
import collections
import datetime
import gc
import importlib
import inspect
import io
import logging
import os, os.path
import queue
import shutil
import signal
import socket
import ssl
import stat
import sys
import tarfile
import tempfile
import threading
import time
import uuid
from mult... |
mqtt_ssl_example_test.py | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import re
import os
import sys
import ssl
import paho.mqtt.client as mqtt
from threading import Thread, Event
try:
import IDF
from IDF.IDFDUT import ESP32DUT
except ImportError:
# this is a test case wri... |
main.py | from git import Repo
import os, shutil
import logging
import subprocess
import threading
import json
import sys
import time
def setup(config):
DIR_NAME = "Deployment"
logging.info(f"Thread {config['DockerImageName']} : Started thread.")
#Change this to whatever docker repo on github
REMOTE_URL = con... |
averagedLearning.py | #-*- coding: utf-8 -*-
import os
import pickle as pi
import scipy as sp
import numpy as np
from sklearn import svm
from sklearn.linear_model import LogisticRegression
from sklearn import decomposition
from sklearn import lda
from sklearn import neighbors
from sklearn.metrics import precision_recall_curve
from sklearn... |
conftest.py | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
slack.py | """Slack adapter for willbot
"""
# pylint: disable=no-member
import json
import logging
import random
import sys
import time
import traceback
import urllib
from multiprocessing import Process
from threading import Thread
from typing import Dict, Optional
import slack_sdk
from markdownify import MarkdownConverter
from ... |
simple_http_server.py | import os
import urlparse
import datetime
import threading
import mimetools
import socket
import errno
import sys
import select
import time
import json
import base64
import hashlib
import struct
import xlog
class GetReqTimeout(Exception):
pass
class ParseReqFail(Exception):
def __init__(self, message):
... |
views.py | """Defines a number of routes/views for the flask app."""
from argparse import ArgumentParser, Namespace
from functools import wraps
import io
import os
import sys
import shutil
from tempfile import TemporaryDirectory, NamedTemporaryFile
import time
from typing import Callable, List, Tuple
import multiprocessing as mp... |
comfoconnect.py | import queue
import struct
import threading
import time
from .bridge import Bridge
from .error import *
from .message import Message
from .zehnder_pb2 import *
KEEPALIVE = 60
DEFAULT_LOCAL_UUID = bytes.fromhex('00000000000000000000000000001337')
DEFAULT_LOCAL_DEVICENAME = 'pycomfoconnect'
DEFAULT_PIN = 0
# Sensor v... |
test_forward.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... |
ccpp.py | import os
import sys
import time
import ftfy
import ujson
import gcld3
import uuid
import shutil
import argparse
import hashlib
import tarfile
import psycopg2
import requests
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from random import randint
from datetime import datetime
from sqlalchemy import... |
multi_process_runner.py | # Lint as: python3
# 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 ... |
connection.py | import sched
from threading import Thread
from collections import defaultdict
import websocket
import logging
import time
import json
class Connection(Thread):
def __init__(self, event_handler, url, reconnect_handler=None, log_level=None,
daemon=True, reconnect_interval=10, socket_kwargs=None, **... |
block_reporter_test.py |
import os
import time
import unittest
import random
import threading
try:
# python 2
from urllib2 import urlopen
except ImportError:
# python 3
from urllib.request import urlopen
import stackimpact
from stackimpact.runtime import min_version, runtime_info
from test_server import TestServer
class ... |
run.py | import numpy as np
import multiprocessing as mp
import os
import tensorflow as tf
import tensorflow.contrib.eager as tfe
from deprecated.policies import CRPolicy
from deprecated.utils import discount, boltzmann, make_atari
gpu_options = tf.GPUOptions(allow_growth=True)
config = tf.ConfigProto(gpu_options=gpu_options)... |
tests.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import errno
import os
import shutil
import tempfile
import time
from datetime import datetime, timedelta
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
import threading
except ImportError:
impor... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import math
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
try:
import _tes... |
main.py | #!/usr/bin/python
from p4app import P4Mininet
from p4app import P4Mininet, P4Program
from mininet.topo import Topo
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.net import Mininet
from mininet.log import lg
from mininet.util import dumpNodeConnections, custom
from mininet.cli imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.