source
stringlengths
3
86
python
stringlengths
75
1.04M
slowloris.py
import random import time import socket from threading import Thread # Import modules for SLOWLORIS flood import tools.randomData as randomData def SLOWLORIS_ATTACK(threads, attack_time, target): # Finish global FINISH FINISH = False target_ip = target.split(":")[0] target_port = int(target.split(":...
camera.py
#!/usr/bin/python2 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'camara_ui.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets import sys import cv2 import numpy as np import threading im...
test_load_collection.py
import pdb import pytest from utils import * from constants import * uid = "load_collection" field_name = default_float_vec_field_name default_single_query = { "bool": { "must": [ {"vector": {field_name: {"topk": default_top_k, "query": gen_vectors(1, default_dim), "metric_type": "L2", ...
test_util.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
main.py
import asyncio import sys import threading from monkey_patched.game import Game # Init components game = Game() def start_server(loop): from backend.server import main threading.Thread(target=main, args=(loop,)).start() def test_server(loop, rand_sleep=True): from api_tester import ApiTester thre...
airflow_scheduler_utils.py
# Copyright 2022 The AI Flow 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 wri...
conftest.py
from pytest import fixture @fixture def http_port(): return 8080 @fixture def mock_app(tmpdir): def _mock_app(environ, start_response): """ self verify mock app """ import wsgiref import json request_uri = wsgiref.util.request_uri(environ) assert environ['REQUEST_METH...
arg.py
import sys import configparser import torch import threading import time import os __author__ = 'namju.kim@kakaobrain.com' _config_time_stamp = 0 class _Opt(object): def __len__(self): return len(self.__dict__) def __setitem__(self, key, value): self.__dict__[key] = value def __geti...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import fcntl import logging import os import random import re import shutil import signal import socket import string import struct import subprocess import sys import tempfile import threading import time import nose.config import nose.core import nose.loader imp...
ghscanner.py
# # Copyright (c) 2021, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause # import concurrent.futures import time import json import os import multiprocessing from github3 imp...
views.py
from django.shortcuts import render, redirect from StudentManager.functions import viewStudents from StudentManager.models import Students, Allowed, CurrentSeason, Seasons, CheckIn, Pointers import concurrent.futures import threading from django.utils import timezone import datetime from Manager.functions import increm...
control_with_labview.py
#!/usr/bin/env python from __future__ import print_function import threading import time import roslib; roslib.load_manifest('teleop_twist_keyboard') import rospy from geometry_msgs.msg import Twist global task task ="stop" import sys, select, termios, tty from vision_2 import get_obj2w import socket import random PO...
mhe_localization_node.py
#!/usr/bin/env python """ Moving Horizon Estimation Localization Copyright © 2020 Mostafa Osman 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, ...
exec.py
import sys, os, time, json, queue import datetime import board, busio import serial import paho.mqtt.client as mqtt import RPi.GPIO as GPIO import adafruit_character_lcd.character_lcd_i2c as character_lcd import MAX6675 from hx711 import HX711 import random import threading global g_print_lcd_output_door_topic g_print...
nanny.py
from __future__ import annotations import asyncio import errno import logging import os import shutil import threading import uuid import warnings import weakref from contextlib import suppress from inspect import isawaitable from queue import Empty from time import sleep as sync_sleep from typing import ClassVar imp...
weixin.py
#!/usr/bin/env python # coding: utf-8 import qrcode import urllib import urllib2 import cookielib import requests import xml.dom.minidom import json import time import re import sys import os import random import multiprocessing import platform import logging from collections import defaultdict from urlparse import url...
udp_testing.py
import threading import time from multiprocessing import Pool, Process, Queue from socketserver import DatagramRequestHandler, ThreadingUDPServer import numpy as np import object_detector import ujson from object_detector import PARTITION_NAME from preprocessor import Preprocessor from utils.network_utils import (Req...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make (or idf.py) flash" (Ctrl-T Ctrl-F) # - Run "make (or idf.py) app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is...
mtsleepC.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: NetworkRanger # Date: 2019/8/10 3:39 PM import threading from time import sleep, ctime loops = [4,2] def loop(nloop, nsec): print 'start loop', nloop, 'at:', ctime() sleep(nsec) print 'loop', nloop, 'done at:', ctime() def main(): print 'starti...
base_exporter.py
import datetime import traceback from collections import OrderedDict from contextlib import closing from exporters.default_retries import disable_retries from exporters.exporter_config import ExporterConfig from exporters.logger.base_logger import ExportManagerLogger from exporters.meta import ExportMeta from exporters...
test_feed.py
"""Test feed generator.""" import time from queue import Queue from threading import Thread from typing import Optional from unittest.case import TestCase from rethinkmodel import config from rethinkmodel.db import connect from rethinkmodel.manage import manage from rethinkmodel.model import Model from tests.utils i...
win32gui_dialog.py
# A demo of a fairly complex dialog. # # Features: # * Uses a "dynamic dialog resource" to build the dialog. # * Uses a ListView control. # * Dynamically resizes content. # * Uses a second worker thread to fill the list. # * Demostrates support for windows XP themes. # If you are on Windows XP, and specify a '--noxp' ...
dbmol.py
#****************** # MODULE DOCSTRING #****************** """ LOMAP ===== Alchemical free energy calculations hold increasing promise as an aid to drug discovery efforts. However, applications of these techniques in discovery projects have been relatively few, partly because of the difficulty of planning and set...
main.py
import argparse import multiprocessing as mp import os import random import numpy as np import torch import torch.optim as optim import wandb from ogb.graphproppred import Evaluator # noinspection PyUnresolvedReferences from data import SubgraphData from utils import get_data, get_model, SimpleEvaluator, NonBinaryEva...
explanation_dashboard.py
from flask import Flask, request from flask_cors import CORS from jinja2 import Environment, PackageLoader from IPython.display import display, HTML from interpret.utils.environment import EnvironmentDetector, is_cloud_env import threading import socket import requests import re import os import json import atexit from...
base_socketsM.py
import tornado.websocket import json import definitions from multiprocessing import Process SERVER = definitions.SERVER class SuperBaseSocket(tornado.websocket.WebSocketHandler): def open(self, id_sessions, Session): _id = self.get_argument("id", None, True) if not _id: se...
distributors.py
import os.path import h5py import numpy as np import multiprocessing import threading import queue import warnings from . import utils class Distributor: """Base class for Distributors. A `Distributor` is an object that should receive the input data from a Device, e.g. a plotter or a file writer. Refer ...
cluster_master.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.py
import sys sys.path.insert(0, '..') import elbus import threading import time import random from tqdm import tqdm iters = 100_000 workers = 1 cnt = 0 def on_frame(frame): global cnt cnt += 1 def test(w, iters): try: global cnt payload = b'\x01' * 1024 name = f'test{random.ran...
configs.py
from multiprocessing import Process import unittest import requests import uvicorn import time # local import from ..IO import BASE_URL, URLs, INPUTS_CONFIGS, OUTPUTS_CONFIGS from ..settings import create_users, create_configs from app.main import app class IntegrationTests_Configs(unittest.TestCase): """ In...
kodi2plex.py
""" Kodi2Plex Simple server to access a Kodi instance from Plex clients """ import os import sys import json import time import struct import socket import pprint import random import logging import asyncio import argparse import threading import traceback import collections import http.server import socketserver imp...
shake_strategy_trigger.py
#!/usr/bin/env python3 # license removed for brevity #encoding:utf-8 # smart-shaking strategy trigger for hiwin manipulator RA605 (need connection) # ======================================================================= # =15/07/2019:add step select, write out position adjust result = # =13/07/2019:add simula...
build.py
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
test_builder.py
# The piwheels project # Copyright (c) 2017 Ben Nuttall <https://github.com/bennuttall> # Copyright (c) 2017 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistribution...
ui_tests.py
# -*- coding: utf-8 -*- """ Tests for the page module. """ # # (C) Pywikipedia bot team, 2008 # # Distributed under the terms of the MIT license. # __version__ = '$Id: dba6bc16d605e3529dedc9c8e946a74e2c9ee99c $' import unittest import cStringIO import StringIO import logging import os import sys if os.name == "nt": ...
coap.py
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """CoAP handler for sensor readings""" import asyncio import copy import logging from threading import Thread import aiocoap.resource import aiocoap.error import cbor2 from foglamp.common import logger from foglamp.plugins....
test_instance_starter.py
# Copyright 2014 varnishapi authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import threading import time import unittest import mock from feaas import storage from feaas.runners import instance_starter class InstanceStarterTestCase...
linkcheck.py
# -*- coding: utf-8 -*- """ sphinx.builders.linkcheck ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import socket import codecs import threading from os import p...
execute.py
import os import sys from flask import Flask import requests as r import time import json from signal import signal, SIGINT import threading from datetime import datetime import numpy as np import math ##globals## threads = 8 threadL = [] orderAddr = [] order = [] startTimes = [] mainThread = None totalAddr = None t...
slack_bot.py
import slack import json import json5 from collections import OrderedDict import string from airflow_api import get_variable, run_segmentation, \ update_slack_connection, check_running, dag_state, set_variable, \ sanity_check, chunkflow_set_env, run_inference, run_contact_surface, \ mark_dags_success, run_d...
sdk_worker.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...
extech_ea15.py
#!/usr/bin/env python # Copyright 2020 Kent A. Vander Velden <kent.vandervelden@gmail.com> # # If you use this software, please consider contacting me. I'd like to hear # about your work. # # This file is part of Extech-EA15, a decoder for the Extech EA15 thermocouple # datalogging thermometer. # # Please see LICENSE ...
scheduler.py
#!/usr/bin/env python # -*- encoding: 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...
SQLInjectionScanner.py
import requests import re import difflib import threading import queue import lib.spider.Spider import time def info(): info = { 'name': 'sql', 'path': 'SQLInjectionScanner', 'fullname': 'SWEP SQL INJECTION SCANNER', 'description': 'A simple SQL Injection scanner.', 'parame...
job_cleaner_daemon.py
import time import threading from broker.utils.accumulated_sum_linked_list import AccumulatedSumLinkedList class JobCleanerDaemon(): def __init__(self, submissions): self.submissions = submissions self.queue = AccumulatedSumLinkedList() self.thread = None self.active = False ...
local_vrdl.py
""" Copyright © 2020, University of Texas Southwestern Medical Center. All rights reserved. Contributors: Kevin VanHorn, Meyer Zinn, Murat Can Cobanoglu Department: Lyda Hill Department of Bioinformatics. This software and any related documentation constitutes published and/or unpublished works and may contain valuab...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.pool.base import _AsyncConnDialect from sqlal...
PlayAsOne.py
#! usr/bin/env python2 from flask import Flask, request, flash, url_for, redirect, render_template, abort, send_from_directory, jsonify from flask.ext.socketio import SocketIO, emit from json import loads, dumps import Tkinter as tk import pyautogui import threading import ttk import time import sys if sys.platform =...
web.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...
server.py
from flask import Flask, render_template import subprocess import threading app = Flask(__name__, template_folder=".", static_folder="assets") # url_for('static', filename='assets') def test_worker(): ## Starting of the test is_running = open('is_test_running','w') is_running.write('True') is_running...
brain.py
from random import randint import random from Levenshtein import distance from os import listdir import json from threading import Thread from time import sleep import time from datetime import datetime import re # Import interface for basic convo file from .utils import convo_reader from .utils import story_reader fro...
routes.py
from . import users_blueprint from flask import render_template, flash, abort, request, current_app, redirect, url_for from .forms import RegistrationForm, LoginForm from project.models import User from project import database, mail from sqlalchemy.exc import IntegrityError from flask import escape from flask_lo...
framework_test.py
# 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/LICENSE-2.0 # # Unless required by applica...
restricted_zone_notifier.py
"""Restricted Zone Notifier.""" """ Copyright (c) 2018 Intel Corporation. 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,...
websocket_client.py
# cbpro/WebsocketClient.py # original author: Daniel Paquin # mongo "support" added by Drew Rice # # # Template object to receive messages from the Coinbase Websocket Feed from __future__ import print_function import json import base64 import hmac import hashlib import time from threading import Thread from websocket ...
emtbg.py
import pickle import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable import torch.utils.data import torch.multiprocessing as mp import os.path import os import sys import time from operator import itemgetter imp...
Set.py
import logging import threading import time log = logging.getLogger(__name__) class Interval: """A class that loops every interval.""" def __init__(self, interval, action, id=None) -> None: """Initialize the interval loop. Args: interval (float): The interval in seconds. ...
mbtiles_reader.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim: ts=2 sw=2 et ai ############################################################################### # Copyright (c) 2012,2020 Andreas Vogel andreas@wellenvogel.net # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and...
chatbot.py
# -*- coding: utf-8 -*- ## V 3.0 """ ChangeLog - V3.0 - Rewrote chatbot.py using classes Cleaned the code Using pycryptodome instead of simplecrypt Using websockets to listen top new events """ ## Description """ A framework to set up a chat bot on StackExchange's chat rooms """ # Imports and initialization import req...
test_restful.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. NOTE: This unittest is being used as a procedural test. The tests must be run in-order and CANNOT be parallelized! Tests all but two RESTful interfaces: * agent's POST /v2/keys/vkey - Done by C...
upgrade_through_versions_test.py
import operator import os import pprint import random import signal import time import uuid from collections import defaultdict, namedtuple from multiprocessing import Process, Queue from Queue import Empty, Full from unittest import skipUnless import psutil from cassandra import ConsistencyLevel, WriteTimeout from ca...
test_shell_util.py
# -*- coding: utf-8 -*- # Copyright 2018 Microsoft 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 applic...
matrix.py
from colours import BLUE, RED, GREEN, WHITE, BLACK, WHITE, YELLOW, Colour from btcomm import BluetoothServer from threading import Event from threads import WrapThread import json from time import sleep class BlueMatrix(object): """ """ def __init__(self, cols = 5, rows = 3, ...
gsflow.py
# -*- coding: utf-8 -*- import os, sys import logging from .control import Control from .prms import Prms from .supports import _get_file_abs from .prms_help import Helper import flopy import subprocess as sp if sys.version_info > (3, 0): import queue as Queue else: import Queue from datetime import datetime i...
test_shell_interactive.py
#!/usr/bin/env impala-python # -*- 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 Apach...
test_bulk_insert.py
import pytest from tests.utils import * from tests.constants import * ADD_TIMEOUT = 600 uid = "test_insert" field_name = default_float_vec_field_name binary_field_name = default_binary_vec_field_name default_single_query = { "bool": { "must": [ {"vector": {field_name: {"topk": 10, "query": gen_...
threadHistResForces.py
from bokeh.io import curdoc from bokeh.models import ColumnDataSource from bokeh.plotting import figure from bokeh.layouts import gridplot, row, layout, column import numpy as np import time import cProfile import random import zmq import pickle import pdb import time from bokeh.models import LinearAxis, Range1d from...
websocket_client.py
# cbpro/WebsocketClient.py # original author: Daniel Paquin # mongo "support" added by Drew Rice # # # Template object to receive messages from the Coinbase Websocket Feed from __future__ import print_function import json import base64 import hmac import hashlib import time from threading import Thread from websocket ...
2.py
from multiprocessing import Pool,Process import time import os def info(): print 'module name:', __name__ if hasattr(os, 'getppid'): # only available on Unix print 'parent process:', os.getppid() print 'process id:', os.getpid() def run(x): info() time.sleep(1) print x**x return x...
CleanupWorkers.py
import json import structlog import pika import config from multiprocessing import Process from ServiceManager import ServiceInfo, cleanupService logger = structlog.get_logger() def cleanupCallback(ch, method, properties, body): """Take service off of queue and delete its corresponding container""" logger.i...
tasks.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python from collections import OrderedDict, namedtuple, deque import errno import functools import importlib import json import logging import os import shutil import stat import tempfile import time import traceback from distutils.di...
presenter_agent.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...
ClientSide.py
# EXECUTAR COM PYCHARM PARA VER OS NOMES COLORIDOS import socket import threading from time import sleep from random import randint from cryptography.fernet import Fernet # CMD Command: pip install cryptography # Linux Terminal/MACOS: pip3 install cryptography def crypto_tolls(): key = b'n05rzNJNF-tU4H-oCneuEdDxR...
test_sys.py
from test import support from test.support.script_helper import assert_python_ok, assert_python_failure import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support import textwrap import unittest import warnings # coun...
main.py
import pygame import time import threading import rethinkdb as r # 1 ... 6 TIME = 0.2 LENGTH_OF_MUSIC_LINE = 10 content = [[] for i in range(LENGTH_OF_MUSIC_LINE)] #music = {"content": [[0], [0, 1], [0], [0, 1], [0], [0, 1], [1], [0, 2]]} music = {"content": content} pygame.mixer.pre_init(44100, -16, 2, 2048)...
test_gc.py
import unittest from test.support import verbose, run_unittest from test import support import sys import gc import weakref import time try: import threading except ImportError: threading = None ### Support code ############################################################################### # Bug 1055820 has...
utils.py
from __future__ import print_function import sys import time import threading import platform import subprocess import os import numpy as np import matplotlib.pyplot as plt from fibre.utils import Event import odrive.enums from odrive.enums import * try: if platform.system() == 'Windows': import win32cons...
utils.py
import pathlib import subprocess import threading import psutil def git_version(): """ Return current version of this github-repository :return: str """ version_file = pathlib.Path(pathlib.Path(__file__).absolute().parent.parent, '.git', 'FETCH_HEAD') if version_file.exists(): f = open...
mtszmq.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2021 the original author or 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...
scheduler.py
import sys import traceback if sys.version_info[0] < 3: import queue as queue else: import queue import threading from yaku.task_manager \ import \ run_task, order_tasks, TaskManager from yaku.utils \ import \ get_exception import yaku.errors def run_tasks(ctx, tasks=None): if task...
allChannels.py
### Script to get all channels from tata sky import threading API_BASE_URL = "https://kong-tatasky.videoready.tv/" import requests import json as json channel_list = [] def getChannelInfo(channelId): url = API_BASE_URL + "content-detail/pub/api/v1/channels/" + channelId x = requests.get(url) channel_meta...
watcher.py
import sys import time import json import elemental import threading import requests from seleniumwire import webdriver from subprocess import check_output from dataclasses import dataclass from datetime import datetime import argparse import gc from . import get_logger logger = get_logger() _watcher_lock = threading...
dataPre.py
import sqlite3 import os import datetime import threading, queue import math import time class DataPre(): def __init__(self, filepath, setpath): self.filepath = filepath self.setpath = setpath setName = os.path.basename(filepath) self.setName = setName.split('.')[0] self.tableName = 'DataPre' self.con...
client.py
from base64 import b64encode from json import JSONDecodeError import logging try: import queue except ImportError: # pragma: no cover import Queue as queue import signal import ssl import threading import time import six from six.moves import urllib try: import requests except ImportError: # pragma: no c...
main.py
# database => http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz # pip install pygeoip => this repo deprecated yet still works # pip install dpkt => packet creation / parsing, with definitions for the basic TCP/IP protocols # pip install scapy => packet creation / parsing # pip install IPy =...
tether_task_runner.py
""" * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
functional_tests.py
#!/usr/bin/env python import os import sys import shutil import tempfile import re from ConfigParser import SafeConfigParser # Assume we are run from the galaxy root directory, add lib to the python path cwd = os.getcwd() new_path = [ os.path.join( cwd, "lib" ), os.path.join( cwd, "test" ) ] new_path.extend( sys.path...
network.py
# Electrum - Lightweight Bitcoin Client # Copyright (c) 2011-2016 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 ri...
pi.py
# Version of the Python Pi example using multiprocessing. # Dr Owain Kenway import time import sys from multiprocessing import Process, Queue, cpu_count # We define a function to calculate the area in a chunk so that we can assign # it to each process. # n - the _TOTAL_ number of slices. # lower - the lowest number ...
main.py
from bs4 import BeautifulSoup import requests import itertools import threading import json import datetime import apple_scraper import spotify_scraper import mysql.connector import os import json from mysql.connector import errorcode sem = threading.Semaphore() total = 0 counter = 0 try: mydb = mysql.connector.c...
IsaacGym_OLD.py
import multiprocessing as mp import sys import isaacgym import numpy as np import torch # import torch after import IsaacGym modules from elegantrl.envs.utils_OLD.config import set_seed, get_args, parse_sim_params, load_cfg from elegantrl.envs.utils_OLD.parse_task import parse_task from typing import Tuple dir((isa...
sublist3r.py
#!/usr/bin/env python # coding: utf-8 # Sublist3r v1.0 # By Ahmed Aboul-Ela - twitter.com/aboul3la import argparse import hashlib import json import multiprocessing import os import random # modules in standard library import re import socket import sys import threading import time from collections import Counter im...
GameLoop.py
import pygame import threading import time from utility.globalStuff import Direction, Tile from Snake import SnakeObject from Food import FoodGenerator from NNObjects.NNEvol import EvNeuralTrainer, EvNeuralNet import utility.constants as CONSTANTS class Game(object): def __init__(self, tilesX, tilesY, ScreenWidth,...
adsbclient.py
#!/usr/bin/env python3 # # Copyright (c) 2015 Johan Kanflo (github.com/kanflo) # # 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...
navigation.py
import rospy import glob import json import math import os import px4tools import sys import time import actionlib import roslaunch import numpy as np from mavros import mavlink from mavros import action_server from mavros_msgs.msg import Mavlink, Waypoint, WaypointReached, GlobalPositionTarget, State, TakeoffAction, T...
compare_num_layer_ghz_multiprocessing_adam.py
import qiskit import numpy as np import sys import multiprocessing sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding import importlib importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.onequbit) importlib.reload(qtm.nqubit) # Init parameters ...
lecturer.py
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.core.paginator import Paginator from django.conf import settings from django.core.mail import EmailMessage from ...
server.py
import asyncio import logging import os import uvloop from functools import partial from inspect import isawaitable from multiprocessing import Process from ssl import create_default_context, Purpose from signal import ( SIGTERM, SIGINT, signal as signal_func, Signals ) from socket import ( socket, ...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import argparse ...
arp.py
from scapy.all import * import sys import os import time import sniff as capture import threading interface = sys.argv[1] os.system("python nmap_ping.py " + interface) with open('result_ping.txt', 'r') as myfile: victimsLines = myfile.readlines() for victimLine in victimsLines: victim_ip = victimLi...