source
stringlengths
3
86
python
stringlengths
75
1.04M
test_pocketfft.py
import numpy as np import pytest from numpy.random import random from numpy.testing import ( assert_array_equal, assert_raises, assert_allclose ) import threading import sys if sys.version_info[0] >= 3: import queue else: import Queue as queue def fft1(x): L = len(x) phase = -2j*np.pi*...
nest_to_tvb.py
# Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université # "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. " from mpi4py import MPI import os import json import time import numpy as np from nest_el...
plugin.py
import base64 import re import threading from binascii import hexlify, unhexlify from functools import partial from electrum_desire.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey, public_key_to_p2pkh, EncodeBase58Check, TYPE_ADDRESS, TYPE_SCRIPT, ...
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...
utils.py
from __future__ import annotations import asyncio import contextvars import functools import importlib import inspect import json import logging import multiprocessing import os import pkgutil import re import socket import sys import tempfile import threading import warnings import weakref import xml.etree.ElementTre...
event_based_scheduler_job.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
app.py
import versionCheck #^This fixes a really common problem I'm getting messages about. It checks for python 2.x from flask import Flask, render_template, request, url_for, redirect, Markup, jsonify, make_response, send_from_directory, session import requests import sys import bs4 import RandomHeaders import re import u...
TranscriptClean.py
# TranscriptClean # Author: Dana Wyman # 3/1/2018 # ----------------------------------------------------------------------------- # Mismatches and microindels in long reads are corrected in a variant-aware # fashion using the reference genome and a VCF file of whitelisted variants. # Noncanonical splice junctions can...
main.py
#!/usr/bin/env python3 import argparse from pathlib import Path from time import monotonic from uuid import uuid4 from multiprocessing import Process, Queue import cv2 import depthai as dai def check_range(min_val, max_val): def check_fn(value): ivalue = int(value) if min_val <= ivalue <= max_val:...
mask_rcnn_server.py
import sys import logging import io import grpc import argparse import os.path import time import concurrent.futures import multiprocessing as mp import skimage.io from services import registry import services.common import services.service_spec.segmentation_pb2 as ss_pb import services.service_spec.segmentation_pb2_...
myplex.py
# -*- coding: utf-8 -*- import copy import threading import time from xml.etree import ElementTree import requests from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER, log, logfilter, utils) from plexapi.base import PlexObject from plexapi.client impor...
connection.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright SAS Institute # # 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 b...
crawler.py
# -*- coding: utf-8 -*- """ Created on Sat Feb 6 12:49:02 2016 @author: daniel """ import logging import threading # For main processing thread import urllib # For downloading websites import urllib.error import urllib.request from concurrent.futures import ThreadPoolExecutor # each downloads a website from http....
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import subprocess import struct import operator import p...
reaction.py
"""Core Flask app routes.""" from flask import Flask, render_template, url_for, redirect, flash from flask import current_app as app from flask_wtf import FlaskForm from wtforms import StringField,SubmitField from wtforms.validators import DataRequired from application.maindriver import ytload,twload from application ...
webpagetest.py
# Copyright 2017 Google Inc. All rights reserved. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Main entry point for interfacing with WebPageTest server""" from datetime import datetime import gzip import logging import os import platform import Queue import...
expect.py
from subprocess import Popen, PIPE, STDOUT from threading import Thread from queue import Queue from untwisted.dispatcher import Dispatcher from untwisted import core from untwisted.event import LOAD, CLOSE from untwisted.waker import waker class ChildError(Exception): pass class ChildThread(Dispatcher): SIZE...
test_dag_processing.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...
test_from_thread.py
import sys import threading import time from concurrent.futures import CancelledError from contextlib import suppress from typing import Any, Dict, List, NoReturn, Optional import pytest from anyio import ( Event, from_thread, get_cancelled_exc_class, get_current_task, run, sleep, to_thread, wait_all_tasks_bl...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest from pathlib import Path from unittest import mock, skipIf from django.conf impo...
test_poplib.py
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import errno import threading import unittest from unittest import TestCase, skipUnless from test import support as te...
session.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
socket_client.py
import selectors import socket import pkgutil import inspect import threading from chaslib.socket_lib import CHASocket class SocketClient: def __init__(self, chas, host, port): self.chas = chas # CHAS Instance self.running = False # Value determining if the Socket Client is running se...
coap.py
import logging.config import random import socket import threading import time from coapthon import defines from coapthon.layers.blocklayer import BlockLayer from coapthon.layers.messagelayer import MessageLayer from coapthon.layers.observelayer import ObserveLayer from coapthon.layers.requestlayer import Re...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import queue as pyqueue import contextlib import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import struct import operator import weakref import test.su...
cli.py
import ast import inspect import os import platform import re import sys import traceback import warnings from functools import update_wrapper from operator import attrgetter from threading import Lock from threading import Thread import click from werkzeug.utils import import_string from .globals import current_app ...
_flowsheet.py
# -*- coding: utf-8 -*- """ As BioSTEAM objects are created, they are automatically registered. The `find` object allows the user to find any Unit, Stream or System instance. When `find` is called, it simply looks up the item and returns it. """ from graphviz import Digraph from IPython import display from .utils im...
main.py
# Sheen Patel # u/SbubbyBot for the the mods of r/Sbubby import threading # to be able to run in threads import praw # all the reddit i/o import os # to get enviroment variables containing secrets import psycopg2 # used for postgresql database stuff from datetime import timedelta # timedeltas for comparison impor...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from fuckutils.general import xyxy2xywh, xywh2xyxy, torc...
websockets.py
import threading import random import asyncio import sys import aiohttp from wsutils.clientwebsocket import ClientWebSocket from wsutils import wsutils from rpcutils import constants as rpcConstants from .constants import * from .connector import WS_ENDPOINT from . import utils from logger import logger @wsutils.webS...
__init__.py
import kthread try: import thread except ImportError: import _thread as thread import time name = "bombfuse" class TimeoutError(KeyboardInterrupt): def __init__(self, func = None): self.func = func super(TimeoutError, self).__init__() def __str__(self): if...
UdpComms.py
class UdpComms(): def __init__(self,udpIP,portTX,portRX,enableRX=False,suppressWarnings=True): """ Constructor :param udpIP: Must be string e.g. "127.0.0.1" :param portTX: integer number e.g. 8000. Port to transmit from i.e From Python to other application :param portRX: inte...
collective_ops_test.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
ArnoldRenderTest.py
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
main.py
import pdb import time import os import subprocess import re import random import json import numpy as np import glob from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import socket import argparse import threading import _thread import signal from datetime import datetime parser = ar...
server.py
####### # https://gist.github.com/seglberg/0b4487b57b4fd425c56ad72aba9971be ####### import asyncio from concurrent import futures import functools import threading import os import sys import inspect import grpc import time from grpc import _server import logging logger = logging.getLogger(__name__) logging.basicC...
dhcp_client.py
""" Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES O...
getproxy.py
# -*- coding: utf-8 -*- # @Author: gunjianpan # @Date: 2019-06-06 17:15:37 # @Last Modified by: gunjianpan # @Last Modified time: 2019-07-26 21:56:43 import argparse import codecs import functools import http.cookiejar as cj import os import random import re import threading import time import requests import sys...
http_server.py
# -*- coding: utf-8 -*- """ Copyright (c) 2018 Keijack Wu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge...
test_agent.py
import logging import socket import time from unittest.mock import MagicMock import pytest from prefect.agent import Agent from prefect.engine.state import Scheduled from prefect.utilities.configuration import set_temporary_config from prefect.utilities.exceptions import AuthorizationError from prefect.utilities.grap...
chat.py
#!/usr/bin/env python3 # Import libraries we need import time import serial import threading import sys # Sets up the serial port for our RF Modules ser = serial.Serial( port = '/dev/ttyS0', baudrate = 9600, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, bytesize = serial.EIGHTBITS, timeout ...
loader.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ############################################################################## """Detectron data loader. The design is gene...
__init__.py
from __future__ import print_function import argparse import itertools import os import random import re import shlex import string import sys import traceback import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline from threading import Thread import pl...
job.py
# Copyright 2017 Spotify AB # # 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, softw...
gui.py
import os import re import sys import tkinter as tk import tkinter.ttk as ttk import modules.list_repository import modules.build_definition from threading import Thread class BuildFrameObject: build_frame = None list_frame_object = None operational_frame_object = None class OperationalFrameObject: ...
Client.py
import socket import threading from PyQt5.QtWidgets import QMainWindow,QApplication import client_ui import sys class Client: def __init__(self, host, port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock = sock self.sock.connect((host, port)) self.s...
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 - ...
predictor.py
from sklearn.linear_model import LinearRegression from .score_filter import ScoreFilter import time from threading import Thread from collections import defaultdict class Predictor: def __init__(self, db_collection): self.collection = db_collection self.score_filter = ScoreFilter(10000) self.sub_weigh...
dependency_manager.py
from contextlib import closing from collections import namedtuple import logging import os import threading import traceback import time import shutil from codalab.lib.formatting import size_str from codalab.worker.file_util import remove_path, un_tar_directory from codalab.worker.fsm import BaseDependencyManager, Dep...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import multiprocessing from random imp...
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 ...
stress_copo_upload.py
from unittest import TestCase from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import threading import os def _up...
sync_replicas_optimizer_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...
views.py
from django.conf import settings from django.http import HttpResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt import dns.resolver import json import requests import threading # Create your views here. def send_message(chat_id, text): url = 'https://api.telegram.or...
doa.py
import base64 import hashlib import hmac try: import cPickle as pickle except ImportError: import pickle import marshal import os import socket import subprocess import sys import tempfile import threading def _compat_compare_digest(a, b): """Implementation of hmac.compare_digest for python < 2.7.7. ...
network.py
import threading import json import time from .socket_handler import SocketHandler from ..codes import MSG_FIELD socket_handler = SocketHandler() def update_node(message, socket): """Update a node in the socket handler. Args: message (dict): The message containing the ID of the node to be updated. ...
main.py
""" This script provides a consistent environment for services to run in. The basic architecture is: - parent process (python, ipython, etc.) - this process, referred to as the "current" process (service/main.py) - child process (the service) - (optional): any child processes that the service c...
utils.py
import datetime import errno import json import os import sys import time from binascii import hexlify from threading import Event, Thread from typing import List from unittest import TestCase from unittest.mock import patch import jupyter_core.paths import requests from ipython_genutils.tempdir import TemporaryDirect...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import functools import os import sys import copy import time import types import signal import random import logging import threading import tracebac...
battle_launcher.py
import threading from datetime import timedelta from erepublik import Citizen, utils CONFIG = { 'email': 'player@email.com', 'password': 'Pa$5w0rd!', 'interactive': True, 'fight': True, 'debug': True, 'start_battles': { 121672: {"auto_attack": False, "regions": [661]}, 125530: ...
AnonymousV9.py
#import module import os,sys try: import socks, requests, wget, cfscrape, urllib3 except: if sys.platform.startswith("linux"): os.system("pip3 install pysocks requests wget cfscrape urllib3 scapy") elif sys.platform.startswith("freebsd"): os.system("pip3 install pysocks requests wget cfscra...
Backend.py
# Copyright (c) 2018 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from enum import IntEnum import struct import subprocess import sys import threading from time import sleep from typing import Any, Dict, Optional from UM.Backend.SignalSocket import SignalSocket from UM.Logger import L...
homeassistant.py
import http.client import json import time from typing import Any, Dict, Optional, Tuple from threading import Thread from bitwarden import BitwardenPassword from i3pystatus import IntervalModule import color def request(path: str, token: str, data: Optional[Dict[str, Any]] = None) -> Dict[st...
cfworker.py
#!/usr/bin/python import flask import multiprocessing, os class cfworker(multiprocessing.Process, flask.Flask): def __init__(self, port=None): self.app = flask.Flask(__name__) self.port = port if not self.port: self.port = int( os.getenv...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil import cereal.messaging as messaging from cereal import log from common.dict_helpers import strip_d...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import tempfile import urllib.request import traceback import asyncore import weakref import platform import functools ssl =...
cache_grab.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # grab cache file to user path # used for game factory, grab cached files # winxos 2014-02-22 import os,sys import fnmatch import getpass #get user name import shutil #copy from time import sleep rootdir = os.path.join('C:/Users',getpass.getuser(),'AppData\Local\Microsof...
plotting.py
"""PyVista plotting module.""" import collections.abc import ctypes from functools import wraps import io import logging import os import pathlib import platform import textwrap from threading import Thread import time from typing import Dict import warnings import weakref import numpy as np import scooby import pyvi...
server.py
import root.settings as settings import root.api.rest.rest_routes as rest from root.api.rest.rest_routes import app import root.api.mqtt.mqtt_routes as mqtt from werkzeug.serving import run_simple import threading def start_server(): thread = threading.Thread(target = start_thread) thread.start() mqtt.con...
client.py
import socket import select import errno import sys from pynput.keyboard import Key, Listener, KeyCode from pynput import mouse, keyboard from random import randint import subprocess import threading import time import os class RHBotClientConnection(): def __init__(self, ip, delay=0) -> None: self.delay ...
grpc_debug_test_server.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...
test_smtplib.py
import base64 import email.mime.text from email.message import EmailMessage from email.base64mime import body_encode as encode_base64 import email.utils import hashlib import hmac import socket import smtplib import io import re import sys import time import select import errno import textwrap import threading import ...
main.py
from goniometer import biometrics_library, axis, OLI import ctypes import tkinter as tk from tkinter import Frame import tkinter.font as font from tkinter.constants import LEFT import matplotlib from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from matplotlib.anim...
SquidWorm.py
from optparse import OptionParser import os, sys class OptionParse: def __init__(self): if len(sys.argv) < 2: self.usage() else: self.get_args() def genscript(self): script = """ import paramiko, os, socket, threading, sys, time print(''' _____ ...
clusterScalerTest.py
# Copyright (C) 2015-2018 Regents of the University of California # # 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...
gui_camera_feed.py
from constants import * from PyQt5 import QtCore, QtGui, QtWidgets import qdarkstyle from threading import Thread from collections import deque from datetime import datetime import time import sys import cv2 import imutils from aieAPI.aieAPI import AIE, call_aie class CameraWidget(QtWidgets.QWidget): """Indepen...
plugin.py
import threading from binascii import hexlify, unhexlify from electroncash.util import bfh, bh2u, UserCancelled from electroncash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT) from electroncash.i18n import _ from electroncash.networks import Network...
conftest.py
from . import server import pytest from threading import Thread @pytest.fixture(scope='module', autouse=True) def server_setup(): instance = server.create_server() process = Thread(target=instance.serve_forever) process.setDaemon(True) process.start()
test.py
# -*- coding: utf-8 -*- import redis import unittest from hotels import hotels import random import time from RLTest import Env def testAdd(env): if env.is_cluster(): raise unittest.SkipTest() r = env env.assertOk(r.execute_command( 'ft.create', 'idx', 'schema', 'title', 'text', 'body', ...
Crunchyroll_Tracker.py
import cloudscraper from bs4 import BeautifulSoup import json import copy import time from colorama import Fore, Style import threading # GENERAL verif_sair = False # if anime.json does not exist: try: with open('anime.json', 'r') as anime_json: pass except FileNotFoundError: print('...
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...
filter_dagger_data_var.py
""" Script for policy-based sampling using uncertainty estimate. Uncertainty is measured by computing the variance in the predicted controls of 100 runs of model with test time dropout Requires: var_file: computed variance in the controls with test time dropout preload: npy preload file for the entire on-policy data...
autoSubmitter.py
from __future__ import print_function import configparser as ConfigParser import argparse import shelve import sys import os import subprocess import threading import shutil import time import re from helpers import * shelve_name = "dump.shelve" # contains all the measurement objects history_file = "history.log" clock...
backup.py
import tkinter as tk from tkinter import filedialog import shutil import os.path import time import datetime from subprocess import Popen, PIPE from threading import Thread from PIL import Image from PIL.ExifTags import TAGS def mv(src, dest): num = 1 if os.path.exists(dest): parts = list(os.path.spli...
variable_cell.py
from ..interfaces.cell import Cell from ..utils.stats import find_x_range from ..utils.constants import BORDER_COLORS from bokeh.models import Toggle, Div import numpy as np import threading from abc import abstractmethod class VariableCell(Cell): def __init__(self, name, control): """ Param...
pproc.py
# borrowed from python 2.5.2c1 # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # Licensed to PSF under a Contributor Agreement. import sys mswindows = (sys.platform == "win32") import os import types import traceback import gc class CalledProcessError(Exception): def __init__(self, returncode...
update_api.py
# coding=utf-8 import sys #sys.path.append("/home/pi/oprint/lib/python2.7/site-packages/tornado-3.0.2-py2.7.egg/") from tornado.httpclient import AsyncHTTPClient from tornado.httpclient import HTTPClient from tornado.httpclient import HTTPRequest from tornado.escape import json_decode from tornado.escape impor...
test_runner.py
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into ind...
separate.py
import argparse import os import pathlib import time from typing import NoReturn import threading import numpy as np import soundfile import torch from bytesep.models.lightning_modules import get_model_class from bytesep.separator import Separator from bytesep.utils import load_audio, read_yaml def init_abn() -> NoR...
nude.py
from aip import AipImageCensor from queue import Queue import os from threading import Thread """ 你的 APPID AK SK """ APP_ID = '16417834' API_KEY = 'Mrr6fjs7vg95aslKyMKpfa2k' SECRET_KEY = 'EsMycqjPXC4mnauARQyGlESFSgxfOexa' client = AipImageCensor(APP_ID, API_KEY, SECRET_KEY) def check_file_content(file_path, q): ...
network.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import socket import SocketServer import multiprocessing import SimpleHTTPServer import atexit import logging socketProc...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
process_task.py
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: process_task for a task(ProcessMode) Created: 2016/12/12 """ import unittest import time import multiprocessing import threading from multiprocessing import Pipe from pprint import pprint import exceptions def sleep_(num): #pprint("~~~")...
main.py
#!/usr/bin/python # -*- coding: utf-8 -*- import time import json import telegram.ext import telegram import sys import datetime import os import logging import threading reload(sys) sys.setdefaultencoding('utf8') Version_Code = 'v1.0.0' logging.basicConfig(level=logging.INFO, format='%(asctime)...
extract_feat2.py
import torch.multiprocessing as mp import pickle import os import sys import re import json import subprocess import numpy as np import torch from time import time, sleep from torch import nn import argparse from model import generate_model from mean import get_mean from classify2 import classify_video from torch.mult...
cli.py
# encoding: utf-8 import collections import csv import multiprocessing as mp import os import datetime import sys from pprint import pprint import re import itertools import json import logging import urlparse from optparse import OptionConflictError import sqlalchemy as sa import routes import paste.script from past...
simple_http_server.py
''' Simple HTTP Server Copyright 2018 Jacques Gasselin 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 Unles...
utils.py
import glob import hashlib import logging import os import shutil import subprocess from functools import wraps from tempfile import gettempdir from threading import Thread import requests from timeout_decorator import timeout from utils.constants import Constant from utils.format import Format logger = logging.getL...
App.py
# TO-DO:- # 1. Doesn't predict after refreshing of the dataset. # 2. train data on go: collect at least 5-6 data and then train # 3. improve performance # 4. More features. # 5. test it from tkinter import * from tkinter import ttk from tkinter import messagebox from tkinter.font import Font from...
testcalls.py
import tensorflow as tf from deepac.predict import predict_fasta, filter_fasta from deepac.nn_train import RCConfig, RCNet from deepac.eval.eval import evaluate_reads from deepac.eval.eval_ens import evaluate_ensemble from deepac.convert import convert_cudnn from deepac import preproc from deepac.tests import datagen f...