source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
traffic_sign_node.py | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... |
spider_blogtitle.py | __author__ = "Lucky"
## -*- coding:utf-8 -*-
# Get article Names from my CSDN blog
import urllib
import urllib2
import re,time
import threading
class Collector:
def __init__(self):
self.article_number = 0
self.article_name = []
def add(self, name):
self.article_number += 1
self.article_name.append(name)
... |
websocketconnection.py | import threading
import websocket
import gzip
import ssl
import logging
from urllib import parse
import urllib.parse
from huobi.base.printtime import PrintDate
from huobi.constant.system import ApiVersion
from huobi.impl.utils.apisignaturev2 import create_signature_v2
from huobi.impl.utils.timeservice import get_curre... |
screenshots.py | import logging
from threading import Thread
from typing import List
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QPixmap, QCursor
from PyQt5.QtWidgets import QDialog, QLabel, QPushButton, QVBoxLayout, QProgressBar, QApplication, QWidget, \
QSizePolicy, QHBoxLayout
from bauh.api.abstract.cache import... |
service_test.py | from pytest import fixture
from jgikbase.idmapping.service.mapper_service import create_app
from jgikbase.test.idmapping import test_utils
from jgikbase.test.idmapping.mongo_controller import MongoController
from threading import Thread
from flask import request
from configparser import ConfigParser
import os
import te... |
task.py | """ Backend task management support """
import itertools
import json
import logging
import os
import re
import sys
import warnings
from copy import copy
from datetime import datetime
from enum import Enum
from multiprocessing import RLock
from operator import itemgetter
from tempfile import gettempdir
from threading im... |
runCtaTrading.py | # encoding: UTF-8
from __future__ import print_function
import sys
try:
reload(sys) # Python 2
sys.setdefaultencoding('utf8')
except NameError:
pass # Python 3
import multiprocessing
from time import sleep
from datetime import datetime, time
from vnpy.event import EventEngine2
from vnpy.trader.v... |
test_connection_pool.py | import os
import pytest
import redis
import time
import re
from threading import Thread
from redis.connection import ssl_available, to_bool
from .conftest import skip_if_server_version_lt
class DummyConnection(object):
description_format = "DummyConnection<>"
def __init__(self, **kwargs):
self.kwarg... |
cheap_image.py | __cheap_image_perf__ = False
if (__cheap_image_perf__) :
import time
print("--- %15.8g --- cheap_image.py start"%(time.perf_counter()))
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mi
import matplotlib.tri as tri
from matplotlib.backends.backend_agg import FigureCanvasAgg as F... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations, chain
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
import os
import weakref
import gc
from w... |
googlenet_resnet50.py | #!/usr/bin/env python
# Copyright 2019 Xilinx 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 ... |
supertty.py | #!/usr/bin/env python
"""SuperTTY v1.0
Usage:
supertty.py --port <port> --host <host> [--udp] [--shell <shell>]
supertty.py --port <port> [--ip <ip>] [--udp] [--shell <shell>]
supertty.py (-h | --help)
Options:
-h --help Show this screen
--port <port> Port number to listen on to to ... |
utils.py | import numpy as np
from queue import Queue
from threading import Thread
# Yield successive {n}-sized chunks from {lst}.
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
def _map_reduce_thread(map_fn, input, q):
q.put(map_fn(input))
# Performs a multi-threaded map-reduce operatio... |
testing.py | """Pytest fixtures and other helpers for doing testing by end-users."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from contextlib import closing
import errno
import socket
import threading
import time
import pytest
from six.moves import http_client
import cheroot.server
f... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
webclient.py | """
CPAchecker is a tool for configurable software verification.
This file is part of CPAchecker.
Copyright (C) 2007-2014 Dirk Beyer
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 Licen... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from vec_env import VecEnv, CloudpickleWrapper
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
while True:
cmd, data = remote.recv()
if cmd == 'step':
ob, reward, done,... |
util.py | import sys
import os
import json
import numpy as np
from itertools import cycle
from config import BASE_DIR, DATA_DIR
""" Custom Logger """
import sys
class Logger:
def __init__(self, filename):
self.console = sys.stdout
self.file = open(filename, 'w')
def write(self, message):
self.... |
football_env_test.py | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
tunnel.py | """Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
Authors
-------
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full... |
gap.py | # -*- coding: utf-8 -*-
r"""
Interface to GAP
Sage provides an interface to the GAP system. This system provides
extensive group theory, combinatorics, etc.
The GAP interface will only work if GAP is installed on your
computer; this should be the case, since GAP is included with Sage.
The interface offers three piece... |
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
... |
training.py | from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .. import backend as K
f... |
coach.py | #
# Copyright (c) 2017 Intel Corporation
#
# 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... |
wrapper.py | #!-*- encoding: utf-8 -*-
import os
import sys
import json
import time
import signal
import logging
import threading
import subprocess
from peewee import DoesNotExist
from distsuper.models.models import Process as ProcessModel
from distsuper.common import tools
from distsuper.common.constant import STATUS
logger = l... |
logging.py | # -*- coding: utf-8 -*-
import queue
import logging
from threading import Thread
from datetime import timedelta
from loguru._file_sink import FileSink
from najapy.common.async_base import Utils
class LogFileRotator:
@classmethod
def make(cls, _size=500, _time=r'00:00'):
return cls(_size, _time).s... |
http.py | from __future__ import print_function
import base64
import copy
import json
import logging
import os
import random
import ssl
import string
import sys
import threading
import time
from builtins import object
from builtins import str
from flask import Flask, request, make_response, send_from_directory
from werkzeug.se... |
context_management.py | """Tools for manual context management."""
import asyncio
from contextvars import Context, copy_context
from functools import partial, wraps
from typing import Callable, Coroutine, TypeVar
_ReturnT = TypeVar("_ReturnT")
def bind_to_snapshot_context(
fn: Callable[..., _ReturnT], *args, **kwargs
) -> Callable[...... |
Procesor_Flooder.py |
from random import randint
import colorama
import os
import threading
from threading import Lock
"""
github.com/Cloudzik1337
github.com/Cloudzik1337
github.com/Cloudzik1337
Procesor Flooder based on os.urandom()
I don't recomend going higher than 500 threads it may freeze windows.
Im not responsible how u wil... |
test_ISLO3.py | #!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu" at 00:03, 15/08/2021 %
# ... |
randomforestparallelthreading.py | import pandas as pd
import houghtest
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
import cv2
import numpy as np
import pickle
from multiprocessing import Process
import tim... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import _
from electrum.transaction im... |
_channel_test.py | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
test_stdout.py | from __future__ import print_function
import os
import random
import string
import sys
import time
import pytest
from dagster import (
DagsterEventType,
ExecutionTargetHandle,
InputDefinition,
ModeDefinition,
execute_pipeline,
pipeline,
resource,
solid,
)
from dagster.core.execution.c... |
lightwave.py | """Python library to provide reliable communication link with LightWaveRF lights and switches."""
import json
import logging
import socket
import time
from itertools import cycle
from queue import Queue
from threading import Thread
_LOGGER = logging.getLogger(__name__)
class LWLink():
"""LWLink provides a commun... |
pydoc.py | #!/usr/bin/env python
# -*- 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... |
__init__.py | """
An OAuth integration
"""
import concurrent.futures
import http.server
import logging
import socketserver
import threading
import urllib.parse
import uuid
import webbrowser
from collections.abc import Callable
from dataclasses import dataclass
from typing import Union, Optional
import requests
from ..rest import d... |
main.py |
#from modules import *
#from modules.core import *
from config import *
import modules.core.database as database
import modules.core.welcome as welcome
#import modules.core.extract as extract
import modules.core.filter as filter
import modules.core.unparse as unparse
import modules.delete as de... |
transaction.py | #!/usr/bin/env python3
#
# 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 withou... |
application.py | # -*- coding: utf-8 -*-
from flask import Flask, request, render_template
from flask_cors import CORS
from concurrent.futures import ThreadPoolExecutor
import threading
import json
from swap_class import *
import time
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s.%(mse... |
__init__.py |
# encoding: utf-8
import imp
from itertools import repeat
from multiprocessing import Value, RLock, cpu_count
from multiprocessing.process import Process
import os
import sys
from androlyze import settings
from androlyze.loader.exception import ApkImportError
from androlyze.log.Log import clilog, log
from androlyze.... |
tftp.py | # import click
from socket import AF_INET, SOCK_DGRAM, socket
from struct import unpack, pack
from threading import Thread
from zipfile import ZipFile
import io
import os
from piman import logger
"""
This code is modified following Prof. Reed suggestion
"""
"""
The TFTPServer class encapsulates the methods required... |
server_get_scene_test.py | import socket
import time
import sys
import random
import math
import threading
HOST = ''
PORT = 8089
skt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
skt.bind( (HOST, PORT) )
except socket.error as msg:
print 'Bind failed. Error Code: ' + str(msg[0]) + 'Message' + msg[1]
sys.exit()
skt.listen(10)
de... |
test_transaction.py | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
import time
import pytest
import dns.name
import dns.rdataclass
import dns.rdatatype
import dns.rdataset
import dns.rrset
import dns.transaction
import dns.versioned
import dns.zone
class DB(dns.transaction.TransactionManager):
def __i... |
nc_grpc_server.py | """This is test gRPC server implemented to test the gRPC client"""
from __future__ import print_function
from concurrent import futures
import time
import math
import logging
import sys
import os,socket,json
import argparse
import signal
import grpc
import subprocess
import select
import threading
import jnx_netconf... |
DNbackend.py | __author__ = 'alejandroaguado'
import redis, logging, sys, json, time
import netifaces as ni
from subprocess import check_output
from docker import Client
import traceback
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging... |
eval_lib.py | import functools
import multiprocessing as mp
from typing import Callable, Mapping, NamedTuple, Tuple
import numpy as np
import tensorflow as tf
import melee
from slippi_ai import embed, policies, data, saving, dolphin
expected_players = (1, 2)
class Policy(NamedTuple):
sample: Callable[
[data.CompressedGa... |
event_loop.py | import os
import imp
import inspect
import time
import traceback
import commands
import threading
import json
import pdb
from datetime import datetime
from collections import defaultdict
from core.models import *
from django.db.models import F, Q
#from openstack.manager import OpenStackManager
from openstack.driver im... |
image_app_core.py | import time
from multiprocessing import Process, Queue
from flask import Flask, render_template, Response, request
app = Flask(__name__)
control_queue = Queue()
display_queue = Queue(maxsize=2)
display_template = 'image_server.html'
@app.route('/')
def index():
return render_template(display_template)
def frame... |
test_base.py | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... |
test_executor_sequential.py | # Copyright 2016-2018 Dirk Thomas
# Licensed under the Apache License, Version 2.0
import asyncio
from collections import OrderedDict
import os
import signal
import sys
from threading import Thread
import time
from colcon_core.executor import Job
from colcon_core.executor import OnError
from colcon_core.executor.sequ... |
base.py | import base64
import hashlib
import io
import json
import os
import threading
import traceback
import socket
import sys
from abc import ABCMeta, abstractmethod
from http.client import HTTPConnection
from urllib.parse import urljoin, urlsplit, urlunsplit
from .actions import actions
from .protocol import Protocol, Base... |
user.py | '''test
用于引用utils.py中的函数
'''
import sys
import os
sys.path.append('./../')
from tools import utils
from db import db_helper, app, model_repr
from threading import Timer, Thread, Lock
import time
import collections
import sched
codes = collections.OrderedDict()
s = sched.scheduler(time.time, time.sleep) # 用来定时删除过期验证码的调度... |
multiprocessed_parsing.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2010-2011 University of Zürich
# Author: Rico Sennrich <sennrich@cl.uzh.ch>
# Implements multiprocessed parsing
from __future__ import unicode_literals
import sys
import os
import time
import multiprocessing
import codecs
from subprocess import Popen, PIPE
clas... |
rpc.py | """ an XML-RPC server to allow remote control of PyMol
Author: Greg Landrum (glandrum@users.sourceforge.net)
Created: January 2002
$LastChangedDate$
License: PyMol
Requires:
- a python xmlrpclib distribution containing the SimpleXMLRPCServer
module (1.0 or greater should be ... |
__init__.py | #!/usr/bin/python
import base64
from binascii import hexlify
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from distutils.spawn import find_executable
from kvirt import common
from kvirt.common import error, pprint, warning
from... |
process.py | import importlib
import os
import signal
import struct
import time
import subprocess
from abc import ABC, abstractmethod
from multiprocessing import Process
from setproctitle import setproctitle # pylint: disable=no-name-in-module
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.based... |
getData.py | import plyvel
import argparse
import base64
import binascii
from datetime import datetime
import json
import sys
from qrl.core.PaginatedData import PaginatedData
from qrl.core.PaginatedBitfield import PaginatedBitfield
from qrl.core.misc.db import DB
from qrl.generated import qrl_pb2
from google.protobuf.json_format ... |
task.py | import atexit
import json
import os
import shutil
import signal
import sys
import threading
import time
from argparse import ArgumentParser
from logging import getLogger
from operator import attrgetter
from tempfile import mkstemp, mkdtemp
from zipfile import ZipFile, ZIP_DEFLATED
try:
# noinspection PyCompatibili... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "By Hama-Kurdsh"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
Server.py | # -*- coding: utf-8 -*-
import socket
import threading
import time
# 沙雕回复语料库
keywords = {'你是谁': '我是人工智障聊天机器人',
'今天天气如何': '荆州的天气可说不准呢',
'现在几点': '不要逗我了, 你电脑的任务栏上一眼就可以看到时间',
'吃饭了吗': '吃吃吃就知道吃',
'你昨天几点睡的': '真正的强者不需要睡觉',
'阿米娅是兔子还是驴': '是驴',
'我想睡觉': 'Doct... |
mp_webserver.py | #
# Example where a pool of http servers share a single listening socket
#
# On Windows this module depends on the ability to pickle a socket
# object so that the worker processes can inherit a copy of the server
# object. (We import `multiprocessing.reduction` to enable this pickling.)
#
# Not sure if we should synch... |
host.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... |
serve.py | #!/usr/bin/env python
# Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved
"""
Ion Job Server
==============
The Job Server connects the Torrent PC Analysis frontend to the
compute infrastructure that performs actual data analysis. It is a
tool for monitoring and managing the computational tasks require... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
impo... |
host.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt # Import mqtt
import paho.mqtt.publish as publish # Import mqtt
from os import path # Import the path function to check if a userdata file exists or not
import json # Used to read and write userdata
import sensors # Import the sensors.py fil... |
HTTPgen.py | #!/usr/bin/env python2.7
# BSD 3-Clause License
#
# Copyright (c) 2018, Ondrej Holecek <ondrej at holecek dot eu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... |
webui.py | #!/usr/bin/env python
"""
A Web UI for RED, the Resource Expert Droid.
"""
__author__ = "Mark Nottingham <mnot@mnot.net>"
__copyright__ = """\
Copyright (c) 2008-2011 Mark Nottingham
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the ... |
scdlbot.py | # -*- coding: utf-8 -*-
"""Main module."""
import gc
import pathlib
import random
import shelve
import shutil
from datetime import datetime
from multiprocessing import Process, Queue
from queue import Empty
from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404
from urllib.parse import urljoin
from uuid impo... |
server.py | import os
import io
import json
import time
import threading
import queue
from http import HTTPStatus
from urllib.parse import unquote
from PIL import Image
from network import HTTPBaseServer, HTTPResponseHeader
app_dir = os.path.split(os.path.realpath(__file__))[0]
index_path = os.path.join(app_dir, '... |
webserver.py |
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Webserver OK, Discord Bot OK"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
count.py | #!/usr/bin/env python3
#
# Trireme
#
# Cassandra database row counter and manipulator.
#
# kaspars@fx.lv
#
import argparse
import datetime
import logging
import queue
import sys
import threading
import multiprocessing
import time
import platform
import os
import random
from ssl import SSLContext, PROTOCOL_TLSv1, PROTOC... |
start.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from contextlib import suppress
from itertools import cycle
from json import load
from math import trunc, log2
from os import urandom as randbytes
from pathlib import Path
from random import randint, choice as randchoice
from socket import (IP_HDRINCL, IPPROTO_IP, IPPROTO_... |
RestClientWindow.py | #RestClientThreads.py
import requests
import json
import time
import threading
#TYPE: ORIGINAL FILE
#MODIFICATION: This file NEEDS TO BE MODIFIED
#-According to the layer, a different NUMBER_POA_SCENARIO is required
#DATE: 15-04-2020
#TO-DOs:
# -Testing not updated
"""
DESCRIPTION:
#Implements the window app... |
donlonder.py | from threading import Thread, Lock
import requests
import shutil
import time
import os
DATA_PATH = "data"
ipsw_url = "http://updates-http.cdn-apple.com/2019FallFCS/fullrestores/061-08416/B909A8DE-C875-11E9-BEC0-C95359F8FB35/iPhone11,8_13.0_17A577_Restore.ipsw"
info = requests.head(ipsw_url).headers
content_length = ... |
gen_protos.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... |
multiprocess_test.py | import multiprocessing
num_procs = 4
def do_work(message):
print ("work",message ,"completed")
def worker():
for item in iter( q.get, None ):
do_work(item)
q.task_done()
q.task_done()
q = multiprocessing.JoinableQueue()
procs = []
for i in range(num_procs):
procs.append( multiprocessing.Process(targe... |
remote_manager.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... |
test_numpy.py | import queue
import threading
import multiprocessing
import numpy as np
import pytest
from numpy.random import random
from numpy.testing import (
assert_array_almost_equal, assert_array_equal, assert_allclose
)
from pytest import raises as assert_raises
import scipy.fft as fft
def fft1(x):
L = len(... |
main.py | import sys # sys нужен для передачи argv в QApplication
import os
import time
import threading
from multiprocessing import Queue, Pool, Manager, Lock, current_process
import psutil
import shutil
import cv2
from PyQt5 import QtWidgets, QtGui, QtCore
import design # Это наш конвертированный файл дизайна
import image... |
tests.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... |
csv_to_mr.py | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
server.py | from concurrent import futures
from forecaster.prophet import Forecaster as ProphetForecaster
from multiprocessing import Event, Process, cpu_count
from pythonjsonlogger import jsonlogger
import contextlib
import grpc
import logging
import model.api.forecast_pb2_grpc as grpc_lib
import os
import signal
import socket
im... |
batched_pixel_sum_controller.py | from __future__ import absolute_import, print_function
import os
import sys
import gzip
import time
import six
from six.moves import cPickle
from multiprocessing import Process
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from platoon.channel import Controller
class BatchedPixelSumController(... |
External_Processing.py | #!/usr/bin/env python
import cv2
import numpy as np
from utils import detector_utils as detector_utils
from utils import gesture_utils as gesture_utils
import datetime
from multiprocessing import Queue
import threading
import roslib
import rospy
import sys, time, os
from sensor_msgs.msg import CompressedImage
from st... |
utils.py | from bitcoin.rpc import RawProxy as BitcoinProxy
from btcproxy import BitcoinRpcProxy
from collections import OrderedDict
from decimal import Decimal
from ephemeral_port_reserve import reserve
from lightning import LightningRpc
import json
import logging
import lzma
import os
import random
import re
import shutil
impo... |
HARS_Server.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# HTTP ASYNCHRONE REVERSE SHELL
# Version : 0.1 POC
# Git : https://github.com/onSec-fr
import BaseHTTPServer, SimpleHTTPServer
import ssl
import os
import base64
import threading
import sys
import random
# Config
PORT = 443
CERT_FILE = '../server.pem'
class MyHandler(BaseH... |
text_client.py | # Copyright 2017 Mycroft AI 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 writin... |
open_redirection.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import ninja
import argparse
import timeit
import multiprocessing as mp
from urlparse import urlparse
import sys
# save_data의 경우는 함수마다 공격의 결과값을 판단하는 패턴이 다르므로 개별로 정의
class open_redirection(ninja.web):
def __init__(self, collection_saving_urls):
# connect the coll... |
utilsTest.py | #:copyright: Copyright 2009-2010 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
"""
utils unit tests
"""
import unittest
from vesper import utils
from vesper.utils import *
class utilsTestCase(unittest.TestCase):
def testSingleton(self):
cl... |
CIP.py | from threading import Thread
#from multiprocessing import Process as Thread
from enum import IntEnum
from PyCIP.CIPModule.connection_manager_class import ConnectionManager
from PyCIP.DataTypesModule import *
from collections import OrderedDict
from PyCIP.Tools.signaling import Signaler, SignalerM2M
import struct
clas... |
zlib_server.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""
"""
#__version__ = "$Id$"
#end_pymotw_header
import zlib
import logging
import SocketServer
import binascii
BLOCK_SIZE = 64
class ZlibRequestHandler(SocketServer.BaseRequestHandler):
logger = logging.getLogge... |
TestServerHandler.py | from datetime import datetime, timezone
from wsgiref.handlers import format_date_time
from time import mktime
import http.client as hc
from socket import *
import threading
import config.config as cfg
# assign connection info
DEFAULT_IP = cfg.primary['ip']
DEFAULT_PORT = cfg.primary['port']
SECOND_IP = cfg.secondary['... |
main.py | # -*- coding: utf-8 -*-
import copy
import datetime
import imp
from importlib import import_module
import inspect
import logging
from multiprocessing import Process, Queue
import operator
import os
from os.path import abspath, dirname
import re
import signal
import sys
import threading
import time
import traceback
try... |
train.py | #!/usr/bin/env python
"""Train models."""
import os
import signal
import torch
import onmt.opts as opts
import onmt.utils.distributed
from onmt.utils.misc import set_random_seed
from onmt.utils.logging import init_logger, logger
from onmt.train_single import main as single_main
from onmt.utils.parse import ArgumentPa... |
crawl.py | import simplejson
import requests
import os
import threading
import config
# projects
projects = ['eclipse', 'libreoffice', 'openstack', 'qt']
# code review state
statuses = ['merged', 'abandoned']
# download dir
download_dir = config.download_dir
# RestAPI Url
urls = config.urls
# number of code reviews downloaded i... |
test_views.py | import queue
import time
from threading import Thread
from django import forms
from django.http import HttpRequest, QueryDict
from django.test import TestCase, override_settings
from django.urls import reverse
from test_haystack.core.models import AnotherMockModel, MockModel
from haystack import connections, indexes
... |
action.py | from __future__ import absolute_import, unicode_literals
import os
import pipes
import signal
import subprocess
import sys
import time
from contextlib import contextmanager
from threading import Thread
import py
from tox import reporter
from tox.constants import INFO
from tox.exception import InvocationError
from to... |
test_jobs.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
dns_test.py | from DnsServer import dns_server
from multiprocessing import Process
p_dns = Process(target=dns_server, args=())
p_dns.start()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.