source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
conductor.py | # Copyright (c) 2014 Rackspace, 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 agreed to in writ... |
files.py | """
Tests file interactions.
"""
# External
import unittest
import threading
# Local
import util
import config
class FilesTests(unittest.TestCase):
_team = None
_projName = None
@classmethod
def setUpClass(cls):
# Log In
data = dict(username = config.username, password = config.password)
util.makeIDERequ... |
teamwork.py | # Team of agents that attempts to capture a flag without being caught by enemies
# Agents:
# Explorer - minimize distance between self and goal location
# Distractor - maximize distance between explorer and enemy (new)
# Enemy - minimize distance between self and explorer and distractor
# Base - deploy distractor ... |
views.py | from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http import HttpResponse, HttpResponseRedirect, QueryDict
from django.core.serializers.json import DjangoJSONEncoder
from django.contrib.auth import authenticate, login, logout
from django.views.generic import View, TemplateView
from d... |
specter_desktop.py | from PyQt5.QtGui import QIcon, QCursor, QDesktopServices
from PyQt5.QtWidgets import (
QApplication,
QSystemTrayIcon,
QMenu,
QAction,
QDialog,
QDialogButtonBox,
QVBoxLayout,
QRadioButton,
QLineEdit,
QFileDialog,
QLabel,
QWidget,
)
from PyQt5.QtCore import (
QRunnable,... |
test_serverapp.py | import sys
sys.path.append("yam")
sys.path.append("../../yam")
from serverapp import YamTcpServer
from devices import DeviceWatcher
from player import RemoteClient
import config as config
import serverapp
import time
import SocketServer
import threading
request_received = False
answer = None
tcpServer = None
tcpServe... |
diff.py | #!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
import argparse
import sys
from typing import (
Any,
Callable,
Dict,
Iterator,
List,
Match,
NoReturn,
Optional,
Pattern,
Set,
Tuple,
Type,
Union,
)
def fail(msg: str) -> NoReturn:
print(msg, file=sys.stderr)
sys... |
filemanager.py | import os
import re
import threading
import urllib
try:
import urllib.parse as urlparse
except ImportError: # py2
import urlparse
import xbmc
import xbmcvfs
from contextlib import closing
from lib import cleaner
from lib.libs import mediainfo as info, mediatypes, pykodi, quickjson, utils
from lib.libs.addonset... |
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... |
ray.py | from queue import Queue
import asyncio
import threading
import uuid
from towhee.hub.file_manager import FileManagerConfig
from towhee.utils.log import engine_log
from towhee.functional.option import Option, Empty, _Reason
from towhee.functional.mixins.parallel import EOS
def _map_task_ray(unary_op):
def map_wrap... |
update_manager.py | """
Determine if installed tool shed repositories have updates available in their respective tool sheds.
"""
import threading, urllib2, logging
from galaxy.util import string_as_bool
import galaxy.util.shed_util as shed_util
from galaxy.model.orm import and_
log = logging.getLogger( __name__ )
class UpdateManager( ob... |
servers.py | """
Starting in CherryPy 3.1, cherrypy.server is implemented as an
:ref:`Engine Plugin<plugins>`. It's an instance of
:class:`cherrypy._cpserver.Server`, which is a subclass of
:class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class
is designed to control other servers, as well.
Multiple servers/p... |
dcp_tests.py | from dcp_base import DCPBase
from dcp_new.constants import *
from dcp_bin_client import *
from mc_bin_client import MemcachedClient as McdClient
from memcached.helper.data_helper import MemcachedClientHelper
import unittest
from memcacheConstants import *
from threading import Thread
from remote.remote_util import Remo... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
from test import support
from io import BytesIO
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
try:
import threading
except ImportError:
threading = None
TIMEOU... |
lect_escr.py | from random import random
from time import sleep
import threading
lectores = 0
mutex = threading.Semaphore(1)
cuarto_vacio = threading.Semaphore(1)
torniquete = threading.Semaphore(1)
def escritor(id):
sleep(random())
print(" Escritor %d iniciando" % id)
torniquete.acquire()
print(" Escritor %d: En... |
ble_logger.py | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import atexit
import logging
import collections
import os
import pty
import select
import subprocess
from StringIO import StringIO
from io import SEEK_CUR
import json
import errno
from datetime import datetime, timedelta... |
servefiles.py | import atexit
import os
import sys
import tempfile
import threading
import urllib
import netifaces
import qrcode
from PIL import ImageTk
try:
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SocketServer import TCPServer
from Tkinter import Tk, Frame, Label, BitmapImage
from urlparse import urljoin
fr... |
scheduler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-07 17:05:11
import itertools
import json
import logging
import os
import time
from collections import deque
from six import iteritems, itervalues
f... |
FunkyWebServer.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import *
from builtins import object
from future.utils import PY2
__author__ = 'matth'... |
threads_netmiko.py | #!/usr/bin/env python
import threading
from datetime import datetime
from netmiko import ConnectHandler
from my_devices import device_list as devices
def show_version(a_device):
"""Execute show version command using Netmiko."""
remote_conn = ConnectHandler(**a_device)
print()
print("#" * 80)
print... |
auth.py | #-------------------------------------------------------------------------
#
# Batch Apps Blender Addon
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (t... |
test_core.py | import unittest
import time
import asyncio
from unittest import mock
from requests.exceptions import ProxyError
from Tea.vendored.aiohttp.client_exceptions import ClientProxyConnectionError
from Tea.model import TeaModel
from Tea.core import TeaCore
from Tea.request import TeaRequest
from Tea.exceptions import TeaExc... |
py_two_stage_rule_check_v0_copy.98_2 copy.py | # -*- coding:utf-8 -*-
# @Time : 2020/07/19
# @Author : WangHongGang
# @File : py_two_stage_rule_check
# 代码更新0.98_1版 by WangHongGang 20200730
# 1. 重新设计查询语句,建立新结果表s_rwgl_zxjg_new, 原有执行方式推翻.
# 代码更新0.98_2版 by WangHongGang 20210117
# 1. 重新设计_run_check()函数执行逻辑。
# a. 取消主键判定,不再判定主键是否为空
# b. SQL主代码增加重点字段判定,结果为... |
ssh_remote_port.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
##############################################################################
#
# Acrisel LTD
# Copyright (C) 2008- Acrisel (acrisel.com) . All Rights Reserved
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... |
resource.py | import logging
from functools import wraps
from itertools import groupby
from multiprocessing import Process
from threading import Lock, Thread
import arrow
from rdflib import Literal
from rdflib.namespace import XSD
from lakesuperior.config_parser import config
from lakesuperior.dictionaries.namespaces import ns_c... |
a3c_tryout_2.py | # Baby Advantage Actor-Critic | Sam Greydanus | October 2017 | MIT License
from __future__ import print_function
import torch, os, gym, time, glob, argparse, sys
import numpy as np
from scipy.signal import lfilter
# from scipy.misc import imresize # preserves single-pixel info _unlike_ img = img[::2,::2]
from collecti... |
utils.py | # From http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/
import cv2
import datetime
from threading import Thread
class FPS:
def __init__(self):
# store the start time, end time, and total number of frames
# that were examined between the start and end intervals... |
concurrent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-core/ampel/util/concurrent.py
# License : BSD-3-Clause
# Author : Jakob van Santen <jakob.van.santen@desy.de>
# Date : 07.08.2020
# Last Modified Date: 07.08.2020
# Last Modified By : Jakob van Santen <jakob.van... |
__init__.py | import functools
import io
import logging
import mimetypes
import os
import os.path
import pathlib
import re
import socketserver
import threading
import time
import warnings
import wsgiref.simple_server
import watchdog.events
import watchdog.observers
class _LoggerAdapter(logging.LoggerAdapter):
def process(self... |
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... |
tasks.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple
import errno
import functools
import importlib
import json
import logging
import os
import shutil
import stat
import tempfile
import time
import traceback
from distutils.dir_util ... |
exploitsambacry.py | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import os
from impacket.dcerpc.v5 import transport
from impacket.smbconnection import *
import sys
import time
import socket
from threading import Thread
class SambaCry:
"""
Sambacry (CVE-2017-7494)
Tested on samba 5.4.9
"""
port = 445
... |
agent.py | import multiprocessing
from utils.replay_memory import Memory
from utils.torch import *
import math
import time
import os
import numpy as np
def collect_samples(pid, queue, env, policy, custom_reward,
mean_action, render, running_state, min_batch_size, max_reward, save_render, iter,env_rand):
i... |
audio_client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde and Jonas Wacker'
import argparse
from ws4py.client.threadedclient import WebSocketClient
import threading
import sys
import urllib
import Queue
import json
import time
import traceback
import os
from mutagen.mp3 import MP3
from bridge import ... |
HiwinRA605_socket_ros_test_20190625195912.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
smads_endpoints_node.py | #!/usr/bin/env python3
import rospy
import threading
from enum import Enum
from smads_core.client import JackalClient
from smads_core.client import SpotClient
from smads_core.client import RobotClient
from smads_core.interface import RobotSensorInterface
from smads_core.interface import RobotNavigationInterface
cl... |
utils.py | #!/user/bin/env python
import time
import datetime
import threading
import sys
import os
import re
import signal
import copy
import six
from traceback import print_exception
import logbook
from pystalkd.Beanstalkd import Connection
import anyjson
import tweetsclient
def dict_mget(subject, *keys, **kwargs):
cur... |
catalog_collections.py | """catalog collections
"""
import argparse
import hashlib
import json
import multiprocessing
import os
import re
import subprocess
import sys
from collections import Counter
from collections import OrderedDict
from datetime import datetime
from glob import glob
from json.decoder import JSONDecodeError
from typing impo... |
hub.py | """hub.py -- ImagHub and Settings classes
Copyright (c) 2018 by Jeff Bass.
License: MIT, see LICENSE for more details.
"""
import os
import sys
import yaml
import pprint
import signal
import logging
import itertools
import threading
from time import sleep
from ast import literal_eval
from datetime import datetime
fro... |
script.py | """
All Work with linux scripting
"""
__author__ = ('Reza Zeiny <rezazeiny1998@gmail.com>',)
import logging
import random
import string
import subprocess
from threading import Thread
logger = logging.getLogger(__name__)
PIPE = -1
STDOUT = -2
DEVNULL = -3
def id_generator(size: int = 6, chars: list = string.asc... |
main.py | import logging
import multiprocessing
import os
import signal
import sys
import time
from typing import Any
from datastore.reader.app import register_services
from gunicorn.app.base import BaseApplication
from migrations import assert_migration_index as assert_migration_index
from .shared.env import is_dev_mode
from... |
test_remote_signer.py |
from isign import isign
from isign_base_test import IsignBaseTest
from multiprocessing import Process
from signing_service import SigningService
from signing_service_config import SigningServiceConfig
import time
from TestPythonLibDir.RemotePkcs1Signer import RemotePkcs1Signer
CONFIG = SigningServiceConfig()
class... |
tooling.py | # TODO: add support for external tools: btmon, serial port output,
# file management with result sorting
import subprocess
import threading
import serial
import os
import time
import logging
import signal
from queue import Queue
from fcntl import fcntl, F_GETFL, F_SETFL
from os import O_NONBLOCK
from pathlib impo... |
penv.py | from multiprocessing import Process, Pipe
import gym
def worker(conn, env):
while True:
cmd, data = conn.recv()
if cmd == "step":
maxsteps = 100
obs, reward, done, info = env.step(data)
info['obs'] = obs
if done or env.step_count>=maxsteps:
... |
runScrape.py | #!flask/bin/python
if __name__ == "__main__":
import logSetup
import logging
logSetup.initLogging()
# logSetup.initLogging(logging.WARNING)
# Shut up fucking annoying psycopg2 vomit every exec.
import warnings
from sqlalchemy import exc as sa_exc
warnings.filterwarnings("ignore", category=UserWarning, module=... |
MouseJiggle.py | import os, sys
import ctypes
import time
import multiprocessing
# # see http://msdn.microsoft.com/en-us/library/ms646260(VS.85).aspx for details
# ctypes.windll.user32.SetCursorPos(100, 20)
# ctypes.windll.user32.mouse_event(2, 0, 0, 0,0) # left down
# ctypes.windll.user32.mouse_event(4, 0, 0, 0,0) # left up
... |
formula_lookup.py | import time
import search_engine.utils as utils
import multiprocessing
from search_engine import seq_list_numeric
from search_engine import seq_list
from .math_exp_eval_engine import NumericStringParser
"""
This file contains the implementations for formula lookup algorithm
"""
return_dic: dict
progress: multiproces... |
file_monitor.py |
import threading
import pyinotify
import logging
import atexit
from abc import abstractmethod
from pytos.common.logging.definitions import COMMON_LOGGER_NAME
logger = logging.getLogger(COMMON_LOGGER_NAME)
class ModifiedFileEventHandler(pyinotify.ProcessEvent):
def my_init(self, callback=None):
self._ca... |
test_neos_updater.py | #!/usr/bin/env python3
import hashlib
import http.server
import json
import os
import unittest
import random
import requests
import shutil
import socketserver
import tempfile
import multiprocessing
from pathlib import Path
from selfdrive.hardware.eon.neos import RECOVERY_DEV, NEOSUPDATE_DIR, get_fn, download_file, \
... |
pcap_subscriber.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import asyncio
import socket
import threading
from fboss.thrift_clients import PcapPushSubClient
from neteng.fboss.asyncio.pcap_pubsub import PcapSubscriber as ThriftSub
... |
common.py | #
# Phoenix-RTOS test runner
#
# Common parts of phoenix-rtos test runners
#
# Copyright 2021 Phoenix SYstems
# Authors: Jakub Sarzyński, Mateusz Niewiadomski, Damian Loewnau
#
import importlib
import logging
import os
import signal
import sys
import threading
import time
from abc import ABC, abstractmethod
from path... |
dense_update_ops_no_tsan_test.py | <<<<<<< HEAD
# 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 requir... |
practice_01.py | import requests
import json
import threading
import random
def get_requestHeaders():
headers = {
# 'accept': 'application/json, text/plain, */*',
# 'accept-encoding': 'gzip, deflate, br',
# 'accept-language': 'zh-CN,zh;q=0.9',
# 'content-length': '172',
# 'content-type': 'a... |
auracle_test.py | #!/usr/bin/env python
import fakeaur.server
import glob
import multiprocessing
import os.path
import subprocess
import tempfile
import time
import unittest
def FindMesonBuildDir():
# When run through meson or ninja, we're already in the build dir
if os.path.exists('.ninja_log'):
return os.path.curdir... |
executor.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... |
pydht.py | import math
import json
import random
import uuid
import SocketServer
import threading
import time
import key_derivation
from .bucketset import BucketSet
from .hashing import hash_function, random_id
from .peer import Peer
from .shortlist import Shortlist
k = 20
alpha = 3
id_bits = 128
iteration_sleep = 1
keysize = 2... |
aplicativo.pyw | #! /usr/bin/python3.7
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter import filedialog
import subprocess
import threading
import chardet
import sys
import os
from aspecto import Aspecto
from widgets.barrasuperior import BarraSuperior
from widgets.conteudo import Conteudo
from widgets.barrainferior import... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
parser_node.py | #!/usr/bin/env python
import rospy
import math as m
from communication.serial_handler import SerialThread
import json
from threading import Thread
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Joy
from std_msgs.msg import Empty
from std_msgs.msg import String
global_data = ""
global_xbox_data = {}
g... |
policy_gradient.py | import tensorflow as tf
import numpy as np
import os
import time
from shutil import move
from threading import Thread
from watcher import Watcher
from tensorflow.keras.callbacks import TensorBoard
LOGDIR = 'logs/tensorboard/'
class Environment(object):
def __init__(self, start_state, w):
self.w = w
... |
crawler.py | import requests
from lxml.html import fromstring
from redisqueue.scheduler import PipeScheduler
from concurrent.futures import ThreadPoolExecutor
import logging
import re
import importlib
import six
import time
from redisqueue import connection
class Crawler(PipeScheduler):
"""从redis-queue中获取url,进行爬取,然后再存放到另一个re... |
httpserver.py | import SimpleHTTPServer
import multiprocessing
import os
class HTTPServer(SimpleHTTPServer.BaseHTTPServer.HTTPServer):
def server_start(self, root_dir):
os.chdir(root_dir)
self.serve_forever()
class HTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def log_message(self, format_s... |
poisson_tests_v0.py | import math, sys, threading, time, requests, random
from time import sleep
from dataclasses import dataclass
@dataclass
class ConnectivityServiceData:
start_TS: int = -1
inter_arrival_time: float = -0.1
end_TS: int = -1
type: str = ''
result: str = ''
uuid: str = ''
ber: bool = True
def mi... |
gmproc.py |
import multiprocessing as mp
import time
class Workers:
def __init__(self):
self.targets = {}
self.queue = mp.Queue()
self.results = {}
def add(self, id, target, params=None):
self.targets[id] = ProcessWrapper(id, target, params)
def set_params(self, id, new_value):
self.targets[id].param... |
labels.py | import os
import shutil
import threading
import time
from functools import lru_cache
from glob import glob
from queue import SimpleQueue
from typing import Dict, Literal, Tuple, cast, Optional, List
import numpy as np
import pandas as pd
from fastapi import FastAPI
from ..utils import get_project_path, deepmerge, get... |
music_player.py | import os
from typing import List
from numpy.lib.function_base import msort
from pygame import mixer
from random import shuffle, triangular
from tkinter import Listbox, Tk, Button, Label
import socket
import time
import torch
import numpy as np
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from... |
main.py | #!/usr/bin/env pybricks-micropython
from pybricks import ev3brick as brick
from pybricks.ev3devices import Motor, TouchSensor, UltrasonicSensor, GyroSensor
from pybricks.parameters import Port, Direction, Color
from pybricks.tools import print, wait
from pybricks.robotics import DriveBase
from threading import Thread
... |
__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) Sebastian Klaassen. All Rights Reserved.
# Distributed under the MIT License. See LICENSE file for more info.
import abc
import collections
import collections.abc
import datetime
import enum
import inspect
import logging
import sys
import threading
import os
import queue
import ... |
video.py | # -*- coding: utf-8 -*-
import os
import json
import struct
import hashlib
import re
import threading
from .kodi import xbmc, xbmcvfs, get_bool_setting
from . import logger, cache, utils, request
__64k = 65536
__longlong_format_char = 'q'
__byte_size = struct.calcsize(__longlong_format_char)
def __sum_64k_bytes(fil... |
pyminer.py | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
main.py | """
This is the main file that runs the OpenEEW code package
"""
from threading import Thread
from params import params
from src import receive_topic, data_holders, ibm_topic
def main():
"""Does everything"""
# Create a Detections DataFrame.
detections = data_holders.Detections()
# Create a Events... |
object_tracker_edit.py | import time, random
import numpy as np
from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import matplotlib.pyplot as plt
import tensorflow as tf
from yolov3_tf2.models import (
YoloV3
)
from yolov3_tf2.dataset import transform_images
from yolov3_tf2.utils import draw_outputs, c... |
ZeroConfClient.py | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from queue import Queue
from threading import Thread, Event
from time import time
from typing import Optional
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo
from UM.Logger import Logger
from... |
versiondetect.py | from http import client as httpsconn
import queue
import threading
import time
#import config
wf=open('./versions.txt',mode='w')
def write_version(s):
global wf
wf.write(s+'\n')
def trystr():
while True:
s=versions.get()
conn=httpsconn.HTTPSConnection('zjzksvr.xiimoon.com',port=443)
... |
stats_multi_proc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# : XXX{Information about this code}XXX
# Author:
# c(Developer) -> {'Egor Savin'}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
kncloudevents.py | #!/usr/bin/env python
"""
Copyright 2019 The Elegant Monkeys
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... |
pl_3_23.py | import os, sys
import multiprocessing
"""
def files_w():
file=open("TMP"+str(os.getpid()),'w')
file.close()
for i in range(8):
newp = multiprocessing.Process(target=files_w)
newp.start()
newp.join()
"""
for i in range(8):
os.fork()
file=open("TMP"+str(os.getpid()),'w')
file.close() |
controller.py | import glob
import json
import os
import re
import shutil
import subprocess
import tarfile
import time
import traceback
from datetime import datetime
from math import floor
from pathlib import Path
from threading import Thread
from typing import List, Set, Type, Tuple, Dict, Iterable, Optional, Collection
import reque... |
decorator.py | # Copyright (c) 2016 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 applic... |
reporter.py | import logging
import signal
import threading
from context import get_context
from message_constants import MessageTypes, Topics
import parse_params as pp
from plugins import get_plugin, PluginType
from pubsub_client import make_sub_client
from remote_logging import configure_logging
from serialization import read_rep... |
main.py | import sys
import telegram
import time
from multiprocessing import Process, Value, Array
from PyQt5.QtWidgets import *
from KK1StockSupportBot import KK1StockSupportBot
from KK1StockAPI import KK1StockAPI
def callback_help_command(update: telegram.Update, context):
reply_text = str()
reply_text += "☆ 현재 명령어는 ... |
app.py | import threading
import os
import subprocess
import json
import sys
import re
import time
import netifaces
port = 12345
def my_server(local_ip,response_json):
while(True):
try:
cmd = 'nc -l -p {}'.format(port)
process = subprocess.Popen(
cmd,
stdout=subproc... |
Server.py | import socket
import time
import struct
from random import randint
from threading import Thread
import os
from scapy.arch import get_if_addr
os.system("")
# Colors for prints
class Colors:
GREEN = '\033[32m'
BLUE = '\033[34m'
PINK = '\033[35m'
UDP_DEST_IP = '<broadcast>'
UDP_DEST_PORT = 13117
TCP_DEST_... |
Astep_locus.py | #!/usr/bin/env python
##
# Copyright (C) 2016 University of Southern California and
# Nan Hua
#
# Authors: Nan Hua, Ke Gong, Harianto Tjong, and Hanjun Shin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
server.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import threading
import SocketServer
import re
import json
import signal
import random
import pymysql
import mysql.connector
import MySQLdb
import urllib2
from crawler import Crawler
from pymongo import MongoClient
from time import sleep
from kazoo.client import KazooClient... |
test_functional.py | """
Simulate feeding from the collectors or cans on S3 using a local can
"""
# Format with black -t py37 -l 110 --fast
from collections import Counter
from datetime import date, timedelta
from pathlib import Path
from unittest.mock import MagicMock
import logging
import os
import time
import ujson
import pytest # de... |
pipetool.py | #! /usr/bin/env python
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
from __future__ import print_function
import os
import subprocess
import itertools
import collect... |
eval_motifs.py | import os
import sys
import multiprocessing as mp
import numpy as np
import json
import traceback
import warnings
import util
import util_meta
import util_filter
import motif_combinations
import constants
import util_intersomatic_distance
def getMotifIndex_16():
return {
(0,0,0,0,0,0) : 16, # no edges ... |
11.robot_servo_ball.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
* @par Copyright (C): 2010-2020, Hunan CLB Tech
* @file robot_sevo_ball
* @version V1.0
* @details
* @par History
@author: zhulin
"""
from __future__ import division
import cv2
import time
import numpy as np
from LOBOROBOT import L... |
start_api_integ_base.py | import shutil
import uuid
from typing import List, Optional, Dict
from unittest import TestCase, skipIf
import threading
from subprocess import Popen, PIPE
import time
import os
import random
from pathlib import Path
import docker
from tests.testing_utils import SKIP_DOCKER_MESSAGE, SKIP_DOCKER_TESTS, run_command
@... |
aggregate_accuracy.py | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
walker.py | #!/usr/bin/env python
#
# Copyright (c) 2018-2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
Classes to handle Carla pedestrians
"""
#import rospy
from derived_object_msgs.msg import Object
import threading
from threadi... |
deako.py | from threading import Timer
import socket
import select
import threading
import json
import asyncio
device_list_dict = {
"transactionId": "015c44d3-abec-4be0-bb0d-34adb4b81559",
"type": "DEVICE_LIST",
"dst": "deako",
"src": "ACME Corp"
}
state_change_dict = {
"transactionId": "015c44d3-abec-4be0-b... |
DialogPackageManager.py | '''
Created on Oct 6, 2013 (from DialogPluginManager.py)
@author: Mark V Systems Limited
(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
'''
from tkinter import simpledialog, Toplevel, font, messagebox, VERTICAL, HORIZONTAL, N, S, E, W
from tkinter.constants import DISABLED, ACTIVE
try:
from tkinte... |
test_utils.py | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
tcp_server.py | '''
Made By Sai Harsha Kottapalli
Tested on python3
About : TCP Server
Use : for command shells or proxy
'''
import socket
import argparse
from threading import Thread
def handler(s_client):
resp = s_client.recv(1024).decode("utf-8") #response
print("[*]Received: %s " % resp)
s_client.send(b"hi")
s_client... |
ServerUpdater.py |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
proxy.py | import enum
import functools
import json
import logging
import pathlib
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import threading
import time
import uuid
import zlib
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import docker
import msgpack
log = logging.getLogger(... |
editor_session.py | # EditorSession.py
import socket
import struct
import json
import threading
import queue
class EditorSession(object):
CONNECTION_TIMEOUT = 2
BUFFER_SIZE = 2 ** 14
SEQUENCE_NUMBER_SIZE = 4
CONTENT_LENGTH_SIZE = 4
# Sequence number indicating that this message is not associated with a known sequen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.