source
stringlengths
3
86
python
stringlengths
75
1.04M
run.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016 Ahmed Almutawa import flask from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons import os import re import sys import struct import json import requests impor...
views.py
import json import socket from json import JSONDecodeError from django.shortcuts import render from django.http import JsonResponse from django.conf import settings import threading from util import AISDatabase database = AISDatabase.AISDatabase() from RealTimeAIS.db_connection import get_postgres def send_ais_shi...
client.py
import socket from select import select import threading import pygame import sys from utils import send from utils import Subject import json import config as cfg WINDOW_SIZE = (400, 800) class Client: def __init__(self, host: str, port: int, client_name: str): self._client_name = client_name #...
base.py
import logging import time import unittest from threading import Thread from hzrc.client import HzRemoteController import hazelcast from hazelcast.core import Address from tests.util import configure_logging class _Member(object): def __init__(self, rc, cluster, member): self.rc, self.cluster, self.member...
demo_loader.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import atexit import copy import queue import threading import time import cv2 import slowfast.utils.logging as logging from slowfast.visualization.utils import TaskInfo logger = logging.get_logger(__name__) class VideoM...
lungmap_pipeline.py
import tkinter as tk import ttkthemes as themed_tk from tkinter import filedialog, ttk import threading import PIL.Image import PIL.ImageTk import json import numpy as np import lungmap_utils from micap import utils as micap_utils, pipeline from gui import utils as gui_utils ontology = gui_utils.onto # weird import s...
server.py
# @license # Copyright 2017 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
VTMultiChecker.py
import json import requests import os import sys import time import datetime from threading import Thread res = [0]*100000 count = 0 directory = os.path.abspath(__file__)[:os.path.abspath(__file__).rfind('\\')] api_url = 'https://www.virustotal.com/vtapi/v2/file/scan' file_extensions = ['.exe', '.dll'] pa...
runner.py
import importlib import json import signal import socket import sys import threading import time import handler NEWLINE = '\r\n' RECEIVE_BYTES = 4096 config = None with open('config.json') as f: config = json.load(f) con = socket.socket() con.connect((config['twitch_endpoint_host'], config['twitch_endpoint_po...
sessions.py
from typing import Tuple, Type, TypeVar from .models import DeviceToken, REPLHistoryEntry, REPLSessionInfo from code import InteractiveInterpreter import threading from io import StringIO from contextlib import redirect_stderr, redirect_stdout from django.utils import timezone import inspect import ctypes T = TypeVar(...
client.py
import protobuf import socket, threading, select, struct ''' Chat client ''' class ChatClient: ''' Initiate client and start two threads, for receiving and sending messages Input: usr: string, username host: string, chat server address port: integer, port to listen too, must be same as server ''' d...
test_signal.py
import unittest from test import support from contextlib import closing import enum import gc import os import pickle import random import select import signal import socket import statistics import subprocess import traceback import sys, os, time, errno from test.support.script_helper import assert_python_ok, spawn_py...
Install.py
import sys import subprocess import threading import shlex try: from Queue import Queue, Empty except: from queue import Queue, Empty ON_POSIX = 'posix' in sys.builtin_module_names class Run: def __init__(self): return def _read_output(self, pipe, q): while True: try: ...
pool.py
# coding=utf-8 from . import connect, cursors import traceback import logging class ConnectionPool(object): def __init__(self, connect_conf, max_connection=1024, min_connection=5, keep_ratio=0.3, keep_threshold=10): self.connect_conf = connect_conf self.max_connection = max_connection se...
tunnel.py
"""Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections. """ # Copyright (C) 2010-2011 IPython Development Team # Copyright (C) 2011- PyZMQ Developers # # Redistributed from IPython under the terms of the BSD License. from __future__ import print_function import atexit import os i...
run.py
import threading import sys import os import signal sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "components/slack"))) from slackbot.bot import Bot from pydispatch import dispatcher from components.dispatcher.signals import Signals, Senders import components.devices.doorbell_monitor as dm ...
main.py
#!/usr/local/bin/python3.4 """ ## Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO [, ANY ADDITIONAL AFFILIATION] ## 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 ## ## ...
spider.py
#!/usr/local/bin/python3 # encoding:utf-8 import queue import threading import time import urllib from bs4 import BeautifulSoup from pip._vendor import requests def getHTML(url): # headers = { # "User-Agent": "User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, " # ...
test_bz2.py
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import pickle import glob import pathlib import random import shutil import subprocess import sys from test.support import unlink import _compression try: import threading except...
client.py
################################################################################## # client.py - Communicates with server via socketIO and AI via stdin/stdout # # Gets moves via stdin in the form of "# # # #" (block index, # rotations, x, y) # # Consists mainly of setup, helper funtions, and a loop that gets moves...
tk_raw_image_analy_ver1.0(bera2).py
## 영상 처리 및 데이터 분석 툴 from tkinter import *; import os.path; import math from tkinter.filedialog import * from tkinter.simpledialog import * ## 함수 선언부 def loadImage(fname): global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH fsize = os.path.getsize(fname) # 파일 크기 확인 inH = ...
housekeeper.py
#SPDX-License-Identifier: MIT """ Keeps data up to date """ import coloredlogs from copy import deepcopy import logging, os, time, requests import logging.config from multiprocessing import Process, get_start_method from sqlalchemy.ext.automap import automap_base import sqlalchemy as s import pandas as pd from sqlalche...
imceventhandler.py
# Copyright 2013 Cisco Systems, 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...
server.py
import socket,threading,time s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.bind(('127.0.0.1',9999)) s.listen(5) print('Waiting for connection...') def tcplink(sock,addr): print('Accept new connection from %s:%s' % addr) sock.send(b'Welcome!') while True: data = sock.recv(1024) time.sleep(1) if not dat...
uiautomation_in_thread.py
#!python3 # -*- coding: utf-8 -*- import os import sys import time import threading sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # not required after 'pip install uiautomation' import uiautomation as auto def threadFunc(uselessRoot): """ If you want to use UI Controls in a ne...
emails.py
# -*- coding: utf-8 -*- """ :author: TingTuShuo (听图说) :url: http://tingtushuo.com :copyright: © 2018 TingTuShuo <tingtushuo@hotmail.com> :license: MIT, see LICENSE for more details. """ from threading import Thread from flask import current_app, render_template from flask_mail import Message from ting...
data_utils.py
import threading import traceback from torch.multiprocessing import Process, Queue, Pool import numpy as np import os import torch def get_input(data, render): real_image = data['image'] input_semantics, rotated_mesh, orig_landmarks, rotate_landmarks, \ rendered_images_erode, original_angles, Rd_a, rende...
test_cli_worker.py
# -*- coding: utf-8 -*- from multiprocessing import Process import os import signal import time import pytest from .hello import redis_uri from tinyq.runner import main args = ['--uri', redis_uri, '--app', 'tests.hello.app'] def test_worker_import_error(): with pytest.raises(ImportError): main(args=[],...
GroupChat.py
#!/usr/bin/python3 from socket import AF_INET, SOCK_STREAM, socket from threading import Thread class GroupChat: def __init__(self, port, password): self.password = password self.client_list = [] self.server_socket = socket(AF_INET, SOCK_STREAM) self.server_socket.bind(('...
thorchain.py
import base64 import logging import threading import websocket import json from copy import deepcopy from utils.common import ( Transaction, Coin, Asset, get_share, HttpClient, Jsonable, get_rune_asset, ) from chains.aliases import get_alias, get_alias_address, get_aliases from chains.bitc...
utils.py
#!/usr/bin/env/python import numpy as np import tensorflow as tf import queue import threading import pickle from rdkit.Chem import AllChem from rdkit.Chem import Draw from rdkit import Chem from rdkit.Chem import rdmolops from rdkit.Chem import rdFMCS from collections import defaultdict, deque import os i...
download_entire_mintcast.py
#!/usr/bin/python3 from urllib.parse import urlparse import urllib.request as urllib from bs4 import BeautifulSoup from os.path import basename, isfile #from thread import start_new_thread from threading import Thread import sys main_page_url = "http://mintcast.org/" pages = [main_page_url, 'http://mintcast.org/page/...
test_search_vectors.py
import pdb import copy import pytest import threading import datetime import logging from time import sleep from multiprocessing import Process import numpy from milvus import Milvus, IndexType, MetricType from utils import * dim = 128 table_id = "test_search" add_interval_time = 2 vectors = gen_vectors(100, dim) # ve...
gui.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import threading from datetime import datetime from kivy.app import App from kivy.config import Config from kivy.uix.screenmanager import ScreenManager, Screen from kivy.properties import BoundedNumericProperty, NumericProperty, StringProperty from uaibus.cl...
test_dispatcher.py
from __future__ import print_function, division, absolute_import import errno import multiprocessing import os import shutil import subprocess import sys import threading import warnings import inspect import numpy as np from numba import unittest_support as unittest from numba import utils, jit, generated_jit, type...
site_list.py
"""Sherlock: Supported Site Listing This module generates the listing of supported sites. """ import json import sys import requests import threading from bs4 import BeautifulSoup as bs from datetime import datetime from argparse import ArgumentParser, RawDescriptionHelpFormatter pool = list() def get_rank(domain_to_...
Main.py
# ================================================================= # Copyright (C) 2020 Hochschule Karlsruhe - Technik und Wirtschaft # This program and the accompanying materials # are made available under the terms of the MIT license. # ================================================================= # Authors: Ann...
run.py
# import gi # from gi.repository import Notify # from gi.repository import AppIndicator3 # from gi.repository import Gtk # import os # import subprocess # import pickle # from pathlib import Path # class OpenVPN3ManagerApplet: # DIALOG_RETURN_CLOSE = -4 # DIALOG_RETURN_CANCEL = 0 # DIALOG_RETURN_SAVE = 1...
benchmark_image_sizes.py
from pymatting import load_image, show_images, trimap_split from pymatting import cf_laplacian, make_linear_system import scipy.sparse.linalg import numpy as np import threading import psutil import time import json import os def get_memory_usage(): process = psutil.Process(os.getpid()) return process.memory...
render.py
from Queue import Queue import argparse import os import subprocess import threading import traceback from farmsoup.range import Range from farmsoup.utils import shell_quote from sgfs import SGFS def get_command(args, start, end, gpu, shell=False): cmd = ['Render', '-r', 'redshift', # These are...
update.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update handling.""" from __future__ import print_function, unicode_literals, absolute_import import re, time, os, threading, zipfile, tarfile try: # Python 2 # pylint:disable=import-error, no-name-in-module from urllib import quote, unquote from urlparse i...
child_user.py
# -*- coding: utf-8 -*- from django.shortcuts import render # Create your views here. from django.contrib.auth.decorators import login_required from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.core.urlresolvers import reverse import json fro...
test_httplib.py
import errno from http import client, HTTPStatus import io import itertools import os import array import re import socket import threading import warnings import unittest TestCase = unittest.TestCase from test import support from test.support import os_helper from test.support import socket_helper from test.support ...
exported-sql-viewer.py
#!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0 # exported-sql-viewer.py: view data from sql database # Copyright (c) 2014-2018, Intel Corporation. # To use this script you will need to have exported data using either the # export-to-sqlite.py or the export-to-postgresql.py script. Refer to those # scripts f...
movie.py
# coding: utf-8 import os import sys import shutil import shlex from subprocess import call from threading import Thread from .recorderthread import RecorderThread sys.path.append(os.path.join(os.path.dirname(__file__), '../util')) from webcam import avail_cameras class Movie(RecorderThread): base_command = 'a...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return "Status Ready!" def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): server = Thread(target=run) server.start()
run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """fMRI preprocessing workflow.""" from .. import config def main(): """Entry point.""" from os import EX_SOFTWARE from pathlib import Path import sys import gc from multiprocessing import Process, Manager from .parser import parse_args fro...
codecs_socket_fail.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2010 Doug Hellmann. All rights reserved. # """Sending Unicode data over a socket. """ #end_pymotw_header import sys import SocketServer class Echo(SocketServer.BaseRequestHandler): def handle(self): # Get some bytes and echo them back to the cli...
__init__.py
#!/usr/bin/python3 # @todo logging # @todo extra options for url like , verify=False etc. # @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option? # @todo option for interval day/6 hour/etc # @todo on change detected, config for calling some API # @todo fetch title into json # https://di...
ws.py
#!/usr/bin/env python3 # coding=utf-8 # requires https://pypi.python.org/pypi/websocket-client/ from excepthook import uncaught_exception, install_thread_excepthook import sys sys.excepthook = uncaught_exception install_thread_excepthook() # !! Important! Be careful when adding code/imports before this point. # Our e...
test_searcher_clusters.py
import unittest import time import multiprocessing from pychemia.db import has_connection from pychemia import pcm_log from pychemia.searcher import HarmonySearch, FireFly, GeneticAlgorithm, ParticleSwarm from pychemia.population import LJCluster def evaluator(): from pychemia.evaluator import cluster_launcher ...
nar_trainer_cafebiz_full.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function #Disabling GPU for local execution #import os #os.environ["CUDA_VISIBLE_DEVICES"]="-1" from time import time import tensorflow as tf import json import os import numpy as np import tempfile import logging imp...
vehicle.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 25 10:44:24 2017 @author: wroscoe """ import time from threading import Thread from .memory import Memory from prettytable import PrettyTable class PartProfiler: def __init__(self): self.records = {} def profile_part(self, p): ...
newsend.py
# Import SDK packages import datetime import logging import os import sys import threading import time import uuid from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient from Adafruit_BME280 import * backlog = {} killlist = [] threadLock = threading.Lock() watchdogCounter = 0 # config here LOG_LEVEL = logging.INFO CRA...
test_pickle_core.py
"""Test for the Cachier python package.""" # This file is part of Cachier. # https://github.com/shaypal5/cachier # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT-license # Copyright (c) 2016, Shay Palachy <shaypal5@gmail.com> # from os.path import ( # realpath, # dirname # ) import ...
AVR_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official AVR Miner 2.7.3 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2021 """ from os import _exit, execl, mkdir from os import name as osname from os import path from os import system as ossystem from platform impo...
dblp.py
import bisect import logging import os import random import threading import Stemmer import numpy as np from nltk.corpus import stopwords as stop_words from scipy import sparse from utils import Indexer, create_sparse path = 'th' censoring_ratio = 0.5 # fraction of censored samples to all samples paper_threshold = ...
main.py
from tf2schema.schemafy import Schema import time import threading class TF2: """ :param {String} api_key: Api key for SteamWebApi https://steamcommunity.com/dev/apikey :param {Boolean} update: True if you want automatic updates in the background, False if not :param {Int} update_interval: How many s...
batch_ops_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
diff.py
#!/usr/bin/env python3 # PYTHON_ARGCOMPLETE_OK import argparse import sys from typing import ( Any, Callable, Dict, Iterator, List, Match, NoReturn, Optional, Pattern, Set, Tuple, Type, Union, ) def fail(msg: str) -> NoReturn: print(msg, file=sys.stderr) sys...
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...
test_zeromq.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Thomas Jackson <jacksontj.89@gmail.com>` ''' # Import python libs from __future__ import absolute_import import os import time import threading # linux_distribution deprecated in py3.7 try: from platform import linux_distribution except ImportError: from di...
bot.py
# coding=utf-8 # Copyright 2008, Sean B. Palmer, inamidst.com # Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> # Copyright 2012-2015, Elsie Powell, http://embolalia.com # # Licensed under the Eiffel Forum License 2. import collections import os import re import sys import threading import time from sopel i...
__init__.py
""" objectstore package, abstraction for storing blobs of data for use in Galaxy. all providers ensure that data can be accessed on the filesystem for running tools """ import logging import os import random import shutil import threading import time from xml.etree import ElementTree try: from sqlalchemy.orm imp...
rtsp-camera-to-pravega.py
#!/usr/bin/env -S python3 -u # # Copyright (c) Dell Inc., or its subsidiaries. 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/LIC...
dhcp.py
#!/usr/bin/python3 import time import threading import queue import collections import traceback import socket from .listener import * def get_host_ip_addresses(): return gethostbyname_ex(gethostname())[2] """ This class contains specified attributes which will be populated, these attributes are associated wit...
agent.py
# Copyright 2020 The Flax 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...
clientserver.py
# -*- coding: UTF-8 -*- """Module that implements a different threading model between a Java Virtual Machine a Python interpreter. In this model, Java and Python can exchange resquests and responses in the same thread. For example, if a request is started in a Java UI thread and the Python code calls some Java code, t...
slam_final.py
import threading from breezyslam.algorithms import RMHC_SLAM from breezyslam.sensors import RPLidarA1 as LaserModel from Lidar import Lidar, start_lidar import time import bluetooth import math import numpy as np import pyudev from pycreate2 import Create2 import sys, select import copy import struct # Basic params _DE...
bot.py
# coding=utf-8 from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import collections import os import re import sys import threading import time from sopel import tools from sopel import irc from sopel.db import SopelDB from sopel.tools import stderr,...
lambda_executors.py
import os import re import json import time import logging import threading import subprocess import six from multiprocessing import Process, Queue try: from shlex import quote as cmd_quote except ImportError: from pipes import quote as cmd_quote # for Python 2.7 from localstack import config from localstack.u...
test_concurrent_futures.py
from test import support from test.support import import_helper from test.support import threading_helper # Skip tests if _multiprocessing wasn't built. import_helper.import_module('_multiprocessing') from test.support import hashlib_helper from test.support.script_helper import assert_python_ok import contextlib im...
engine.py
import sys import threading import cmd import chess from chess import polyglot import tables import os import glob import platform # DGT from pydgt import DGTBoard from pydgt import FEN from pydgt import CLOCK_BUTTON_PRESSED from pydgt import CLOCK_LEVER from pydgt import CLOCK_ACK from pydgt import scan as dgt_port_...
nd2_utils.py
from nd2reader import ND2Reader import bioformats import javabridge import tifffile import numpy as np from pathlib import Path import multiprocessing as mp def get_editable_omexml(path): """ Parse OMEXML header data from a Bio-Formats-compatible file. Used to parse metadata from .nd2 file and pass on to...
scheduler.py
""" This module is the main part of the library. It houses the Scheduler class and related exceptions. """ from threading import Thread, Event, Lock from datetime import datetime, timedelta from logging import getLogger import os import sys from util import * from triggers import SimpleTrigger, IntervalTrigger, CronT...
test_backfill_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...
common.py
"""Test the helper method for writing tests.""" import asyncio from collections import OrderedDict from datetime import timedelta import functools as ft import json import os import sys from unittest.mock import patch, MagicMock, Mock from io import StringIO import logging import threading from contextlib import contex...
main.py
import socket import multiprocessing import atexit import os import datetime import subprocess clist = [] addrlist = [] plist = [] response_codes = { "200": "HTTP/1.0 200 OK\nServer:kral4 http server\nConnection: close\nContent-Type: text/html\n\n", "400": "HTTP/1.0 400 Bad request\nCache-Control: no-c...
test_xlink_windows_wrapper.py
import threading from time import sleep from unittest import TestCase from mock import patch, MagicMock, mock_open from ctypes import * from inbm_vision_lib.xlink.xlink_windows_wrapper import XlinkWindowsWrapper from inbm_vision_lib.xlink.ixlink_wrapper import XlinkWrapperException, receive_file_progress, check_platfor...
test_errno.py
import unittest, os, errno from ctypes import * from ctypes.util import find_library import threading class Test(unittest.TestCase): def test_open(self): libc_name = find_library("c") if libc_name is not None: libc = CDLL(libc_name, use_errno=True) if os.name == "n...
history_sample(1K).py
import time from tcoreapi_mq import * import tcoreapi_mq import threading g_QuoteZMQ = None g_QuoteSession = "" #實時行情回補 def OnRealTimeQuote(symbol): print("商品:", symbol["Symbol"], "成交價:",symbol["TradingPrice"], "開:", symbol["OpeningPrice"], "高:", symbol["HighPrice"], "低:", symbol["LowPrice"]) #行情消息接收 def quote_...
engine.py
"""""" import sys import importlib import traceback from typing import Sequence, Any from pathlib import Path from datetime import datetime from threading import Thread from pandas import DataFrame from vnpy.event import Event, EventEngine from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.consta...
check_certs_bot.py
#!/usr/bin/env python3 ''' Telegram Bot to check X509 certificates from sites. Checking command line is a URL-like string: [proto://]server[:port] Any protocols are allowed. If no proto specified, HTTPS is assumed. If no port specified it will be got from /etc/services file. For some protocols send extra commands like...
test_fusion.py
import mock import numpy import six import threading import unittest import cupy from cupy import testing def fusion_default_array_equal(): def deco(func): def wrapper(self_x, name, xp, **dtypes): @cupy.fuse() def f(*args): return getattr(xp, name)(*args) ...
test_failure.py
import json import logging import os import signal import sys import tempfile import threading import time import numpy as np import pytest import redis import ray from ray.experimental.internal_kv import _internal_kv_get from ray.autoscaler._private.util import DEBUG_AUTOSCALING_ERROR import ray.utils import ray.ray...
_server.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...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
untitled.py
import multiprocessing as mp import enlighten import sys import time from multiprocessing import Value from ctypes import c_bool from multiprocessing import Process, Manager from collections import defaultdict from multiprocessing.managers import BaseManager, DictProxy from collections import defaultdict import functo...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage from electrum.wallet import Wallet from electrum.paymentrequest import InvoiceStore from electrum.util import pro...
test1.py
import YunBi import CNBTC import HuoBi import json import OKCoin import poloniex import poloniex import time config = json.load(open("config.json","r")) fp_hb_eth = open("log/hb_eth_%s.txt"%(time.strftime('%Y-%m-%d_%H_%M_%S',time.localtime(time.time()))),'a') fp_okc_eth = open("log/okc_eth_%s.txt"%(time.strftime('%Y-%m...
train_low_level_runner.py
# Copyright 2018 Google. 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 agree...
main_gui.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import ctypes import inspect import os import re import sys import threading import traceback from utils.extendedcombobox import ExtendedComboBox import PyQt5 import keyboard import pinyin import yaml from PyQt5 import uic, QtCore, QtWidgets from PyQt5.QtCore import QStri...
SiTcp.py
# # ------------------------------------------------------------ # Copyright (c) All rights reserved # SiLab, Institute of Physics, University of Bonn # ------------------------------------------------------------ # # A transfer layer for SiTCP Ethernet. More information: http://sitcp.bbtech.co.jp # import logging imp...
exploit.py
import urllib import requests import uuid import threading import time import logging import argparse logging.basicConfig(filename='../payload/exploit.log', level=logging.DEBUG) logger = logging.getLogger() proxies = { # 'http': 'http://127.0.0.1:8085', # 'https': 'http://127.0.0.1:8090', } PREAMBLE = b'<...
websocket.py
# -*- encoding: utf-8 -*- ''' @File : websocket.py @License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2021/4/2 21:06 Li Qiwen 1.0 None ''' # encoding: UTF-8 import json import ssl im...
run_qtgui.py
import numpy as np import torch import sys from collections import Counter from sklearn.preprocessing import LabelEncoder from librosa.core import load from librosa.feature import melspectrogram from librosa import power_to_db from model import genreNet from config import MODELPATH from config import GENRES import ...
test_failure.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import sys import tempfile import threading import time import numpy as np import pytest import redis import ray import ray.ray_constants as ray_constants from ray.cluster...
CntlrWinMain.py
''' Created on Oct 3, 2010 This module is Arelle's controller in windowing interactive UI mode @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from arelle import PythonUtil # define 2.x or 3.x string types import os, sys, subprocess, pickle, time, locale, re, fnmatc...
test_enum.py
import enum import inspect import pydoc import sys import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test import support from test.suppor...
deccheck.py
# # Copyright (c) 2008-2012 Stefan Krah. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions ...