source
stringlengths
3
86
python
stringlengths
75
1.04M
tweets.py
# -*- coding: utf-8 -*- import html import threading import time import irc3 import json import requests from irc3.plugins.command import command from irc3.utils import as_list from twitter.stream import Timeout, HeartbeatTimeout, Hangup __doc__ = ''' ========================================== :mod:`tweets` Feeds plu...
lldb_batchmode.py
# This script allows to use LLDB in a way similar to GDB's batch mode. That is, given a text file # containing LLDB commands (one command per line), this script will execute the commands one after # the other. # LLDB also has the -s and -S commandline options which also execute a list of commands from a text # file. Ho...
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...
road_speed_limiter.py
import json import select import threading import time import socket import fcntl import struct from threading import Thread from cereal import messaging from common.params import Params from common.numpy_fast import interp from common.realtime import sec_since_boot from selfdrive.kegman_kans_conf import kegman_kans_co...
test_framework.py
from __future__ import print_function class AssertException(Exception): pass def format_message(message): return message.replace("\n", "<:LF:>") def display(type, message, label="", mode=""): print("\n<{0}:{1}:{2}>{3}".format( type.upper(), mode.upper(), label, format_message(message))) def ...
operations.py
''' Date: 2018-03-22 Because here we want to get the data from openweatherapi and bike stations, I use multiprocessing to get data. The frequency of getting weather is one time per hour and getting bike sations is one time 5 miniutes. ''' from multiprocessing import Process import requests import json import time impo...
tensorflow_serving_client_workload.py
# Lint as: python2, python3 """Tensorflow Serving client workload. Performs image classification requests against a Tensorflow Model Server. Inspired by https://github.com/tensorflow/serving/blob/master/tensorflow_serving/example/resnet_client_grpc.py This client-side load generator does the following: * launches a...
soup.py
#!/usr/bin/env python import threading from urlparse import urlparse from urllib import urlopen from bs4 import BeautifulSoup from time import time import sys import logging logger = logging.getLogger(__name__) def worker(img, url): """ thread worker function """ src = img.get('src') logger.debu...
testharness.py
#!/usr/bin/env python import sys import os import os.path import glob import time try: #python2 world from StringIO import StringIO except ImportError: #python3 world from io import StringIO try: import fluidity.regressiontest as regressiontest except ImportError: # try again by adding the path "../python" ...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development team # 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 ...
prompt.py
""" Line editing functionality. --------------------------- This provides a UI for a line input, similar to GNU Readline, libedit and linenoise. Either call the `prompt` function for every line input. Or create an instance of the :class:`.PromptSession` class and call the `prompt` method from that class. In the secon...
run_A3C.py
import threading import multiprocessing import numpy as np import os import random #import matplotlib.pyplot as plt import tensorflow as tf import tensorflow.contrib.slim as slim import scipy.signal from scipy.misc import imresize import gym from gym import wrappers from atari_wrappers import * from dqn_utils import *...
main.py
""" The same instance of FooBar will be passed to two different threads. Thread A will call foo() while thread B will call bar(). Modify the given program to output "foobar" n times. Example 1: Input: n = 1 Output: "foobar" Explanation: There are two threads being fired asynchronously. One of them calls foo(...
schedule.py
import time import threading class Schedule: def __init__(self): self.loop = True def start(self, interval, func, wait=True): base_time = time.time() next_time = 0 while self.loop: t = threading.Thread(target=func) t.start() if wait: ...
pop3proxy_service.py
# Run the sb_server as a WinNT service. Should work on Windows 2000 # and Windows XP. # # * Install as a service using "pop3proxy_service.py install" # * Start the service (Use Control Panel etc, or # "pop3proxy_service.py start". Check the event # log should anything go wrong. # * To debug the service: "pop3prox...
cifar10_to_mr.py
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
fulltest.py
from quickpi import * import time import RPi.GPIO as GPIO import threading import random import os def checkTest(value, name): if value: print("Test " + name + " passed") displayTextOled("Test " + name + " passed") else: print("Test " + name + " failed") displayTextOled("Test " + name + " failed") return [v...
camera.py
# -*- coding: utf-8 -*- ''' @Time : 2020/04/26 15:48 @Author : Tianxiaomo @File : camera.py @Noice : @Modificattion : @Author : @Time : @Detail : ''' from __future__ import division import cv2 from models import * #from tool.darknet2pytorch import Darknet import ...
sensor.py
#!/usr/bin/env python """ Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from __future__ import print_function # Requires: Python >= 2.6 import sys sys.dont_write_bytecode = True import cProfile import inspect import math impor...
parallel_preproc.py
import atexit import itertools from options import logger import os import queue import threading import more_itertools import numpy as np import tensorflow as tf import my_itertools import tfu import util def parallel_map_as_tf_dataset( fun, iterable, *, shuffle_before_each_epoch=False, extra_args=...
tensor_models.py
""" KG Sparse embedding """ import os import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as functional import torch.nn.init as INIT import torch.multiprocessing as mp from torch.multiprocessing import Queue from _thread import start_new_thread import traceback from functools import...
updatable_bar.py
from bento import bars import threading import time class UpdatableBar(bars.BasicBar): def __init__(self, *args, update_interval: float=1, **kwargs): super().__init__(*args, **kwargs) self.update_thread = None self.update_interval = update_interval self.running = threading.Event()...
app.py
""" A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app .. note:: This module is Experimental on Windows platforms and supports limited configurations: - doesn't support PAM authentication (i.e. external_auth: auto) - doesn't support SSL (i.e. disable_ssl: Tru...
_background_server.py
# Note: the code in this file is adapted from source at # https://github.com/googlecolab/colabtools/blob/master/google/colab/html/_background_server.py # The following is its original license: # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file ex...
thermal_save_csv.py
import pygame import os import math import datetime from datetime import datetime, date import time import numpy as np from scipy.interpolate import griddata from scipy import stats import cv2 from colour import Color from CentroidTracker import CentroidTracker from multiprocessing import Process, active_children impor...
lishogi-bot.py
import argparse import shogi import engine_wrapper import model import json import lishogi import logging import multiprocessing import traceback import logging_pool import signal import sys import time import backoff import threading from config import load_config from conversation import Conversation, ChatLine from f...
Utils.py
# # Cython -- Things that don't belong # anywhere else in particular # import os import sys import re import io import codecs from contextlib import contextmanager modification_time = os.path.getmtime def cached_function(f): cache = {} uncomputed = object() def wrapper(*args): res =...
client.py
import threading #ofc we need a separate class for client, but that's just a skeleton for now def startClient(): print("started") def startClicked(): threading.Thread(target = startClient).start() def main(): start() if __name__ == "__main__": main()
test_buffer_client.py
# TODO (ahcorde): Fix test in CI # # Copyright 2019 Open Source Robotics Foundation, Inc. # # All rights reserved. # # # # Redistribution and use in source and binary forms, with or without # # modification, are permitted provided that the following conditions # # are met: # # # # * Redistributions of source code must...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import logging import os import random import re import shutil import signal import string import subprocess import sys import tempfile import threading import time import nose.config import nose.core import nose.loader import nose.plugins.manager import yaml from...
_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 writing...
sender.py
import time import threading from frameHelper import Frame import logger # define maximum window size MAX_WINDOW_SIZE = 7 # define time-out time in seconds timeout=2 # store all the round-trip times rttList = [] class Sender: def __init__(self, connection, name:str, senderAddress:int, receiverName:str, receiver...
Python advanced keylogger.py
#//python keylogging program ## You will need to comment out the prints and exception prints on code if you were to use this for real, as its testing ## i have prints on here that will tell you and let you know what part of the program is going at the time and that it is ## working # Surport me and subscribe to my ...
eSSP.py
# !/usr/bin/env python3 import threading from ctypes import * from time import sleep from six.moves import queue from .constants import Status, FailureStatus, Actions class Ssp6ChannelData(Structure): _fields_ = [("security", c_ubyte), ("value", c_uint), ("cc", c_char * 4)] cla...
misc.py
import subprocess import unittest from fnmatch import fnmatch import multiprocessing from time import sleep, time import itertools from pathlib import Path import numpy as np import sys import errno import os from vmaf import run_process from vmaf.tools.scanf import sscanf, IncompleteCaptureError, FormatError __cop...
measure.py
import pymongo import time import threading import argparse MYDB = "mydatabase" TABLENAME = "zookeeper" STRONG = "[STRONG]" WEAK = "[WEAK]" strongDict = {"node": "/1", "value": "strong"} weakDict = {"node": "/2", "value": "weak"} CLINUM = 6 hostname = "mongodb://localhost:27017/" stop_event = threading.Event() def pr...
snmp.py
# (C) Datadog, Inc. 2010-2019 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import fnmatch import ipaddress import json import os import threading import time from collections import defaultdict import pysnmp.proto.rfc1902 as snmp_type import yaml from pyasn1.codec.ber import decoder from...
dbhandler.py
import time import logging import threading from CredentialDatabase.db.connector import DBConnector from CredentialDatabase.db.creator import DBCreator from CredentialDatabase.db.fetcher import DBFetcher from CredentialDatabase.db.inserter import DBInserter from CredentialDatabase.utils.password import Password from Cr...
experiment.py
# -*- coding: utf-8 -*- """ lantz.simulators.experiment ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An experiment connecting an actuator and a sensor. :copyright: 2012 by The Lantz Authors :license: BSD, see LICENSE for more details. """ from threading import Thread, activeCount from time import sleep import log...
test_generator_runner.py
# Copyright 2021 Zilliz. 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...
sideinputs.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...
inception_v1_mt.py
""" (c) Copyright 2019 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any --...
predict.py
# # Copyright (c) 2018, Salesforce, Inc. # The Board of Trustees of the Leland Stanford Junior University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions ...
benchmark_utils.py
""" Utilities for working with the local dataset cache. This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp Copyright by the AllenNLP authors. """ import copy import csv import linecache import os import platform import sys from abc import ABC, abstractmethod from collect...
wxGeoMachines.py
#!/usr/bin/env pythonw # -*- coding: utf-8 -*- """ MIT License Copyright (c) 2019 maxvelasques 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 th...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Versions 3.2.{2,3,4} are strongly recommended due to a known `SSL error <https://bitbucket.org/cherrypy/cherrypy/issue/1298/...
controller.py
# Copyright 2014-2021 The aiosmtpd Developers # SPDX-License-Identifier: Apache-2.0 import asyncio import errno import os import ssl import sys import threading import time from abc import ABCMeta, abstractmethod from contextlib import ExitStack from pathlib import Path from socket import AF_INET6, SOCK_STREAM, create...
main.py
# # Copyright 2020, Fernando Lemes da Silva # # 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 ag...
autoqwopper.py
import ImageGrab import Image import os import time from random import * import win32api, win32con import threading from pytesser import * from deap import base from deap import creator from deap import tools import numpy import math import pickle import sys # Globals LB_FILE = open('../logbook.pickle', 'w+') # DEAP ...
TWCManager.py
#! /usr/bin/python3 ################################################################################ # Code and TWC protocol reverse engineering by Chris Dragon. # # Additional logs and hints provided by Teslamotorsclub.com users: # TheNoOne, IanAmber, and twc. # Thank you! # # For support and information, please re...
SessionView.py
import time import threading from tkinter import * import socket import errno import OnitamaMessages class SessionView: def __init__(self): self._quitStatus = 200 self._username = "" self._sessionname = "" self._allIncomingTcpData = "" self._isClosing = False def Read...
test_channel_lsp.py
#!/usr/bin/env python # # Server that will accept connections from a Vim channel. # Used by test_channel.vim to test LSP functionality. # # This requires Python 2.6 or later. from __future__ import print_function import json import socket import sys import time import threading try: # Python 3 import socketse...
test_dataloader.py
# Owner(s): ["module: dataloader"] import math import sys import errno import multiprocessing import os import ctypes import faulthandler import torch import gc import time import signal import unittest import itertools import warnings import tempfile from torch import multiprocessing as mp from torch.utils.data impor...
handlers.py
# Copyright 2001-2016 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') port=8080 @app.route('/') def home(): return "Server is currently running" def run(): app.run(host='0.0.0.0',port=port) def keep_alive(): t = Thread(target=run) t.start()
io.py
from io import IOBase, TextIOBase from multiprocessing import Process import os import sys import re import time import json import subprocess import random import logging logger = logging.getLogger(__name__) from paragen.utils.runtime import Environment SPACE_NORMALIZER = re.compile("\s+") TEMP_IO_SAVE_PATH = "" ...
common.py
import inspect import json import os import random import subprocess import ssl import time import requests import ast import paramiko import rancher import pytest from urllib.parse import urlparse from rancher import ApiError from lib.aws import AmazonWebServices from copy import deepcopy from threading import Lock fr...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import codecs import unittest import subprocess import textwrap import linecache from contextlib import ExitStack from io import StringIO from test.support import os_helper # This little helper cl...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import copy import os import re import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
paint.py
from tkinter import * from tkinter import messagebox from tkinter.colorchooser import askcolor import threading import time from PIL import Image import os class Paint(object): DEFAULT_PEN_SIZE = 5.0 DEFAULT_COLOR = 'black' DEFAULT_DELAY = 5 * pow(10,8) def __init__(self,w,h,q): self.root = T...
02_aq_meter_alarm.py
import threading import time from guizero import App, Text, Slider from aq import AQ aq = AQ() app = App(title="Air Quality", width=550, height=400, layout="grid") def update_readings(): # update fields with new temp and eCO2 readings while True: temp_c_field.value = str(aq.get_temp()) eco2 = aq....
bokeh_gui.py
#!/usr/bin/env python3 import sys import queue from datetime import datetime import itertools import threading from functools import partial import asyncio import socket from bokeh.server.server import Server from bokeh.application import Application from bokeh.application.handlers.function import Function...
tracking_utils.py
import threading import time import numpy as np class Box: def __init__(self, x_y_w_h): self.x, self.y, self.w, self.h = [int(v) for v in x_y_w_h] self.is_discarded: bool = False self.is_being_discarded: bool = False def update(self, x_y_w_h): self.x, self.y, self.w, self.h = ...
dev.py
# Dindo Bot # Copyright (c) 2018 - 2019 AXeL import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GdkPixbuf from lib import tools, data, convert from .custom import CustomTreeView, CustomComboBox, MenuButton, SpinButton, ButtonBox from .dialog import CopyTextDialog from threading import Threa...
example.py
#!/usr/bin/python # -*- coding: utf-8 -*- 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 import argparse import getpass import thre...
axirunner.py
from os import kill import time import signal import atexit import logging from queue import Queue from typing import NoReturn from multiprocessing import Process, Event from multiprocessing import Queue as pQueue from multiprocessing.connection import Connection from AxiFresco.axifresco import Axifresco, Point, json...
word2vec_optimized.py
"""Multi-threaded word2vec unbatched skip-gram model. Trains the model described in: (Mikolov, et. al.) Efficient Estimation of Word Representations in Vector Space ICLR 2013. http://arxiv.org/abs/1301.3781 This model does true SGD (i.e. no minibatching). To do this efficiently, custom ops are used to sequentially pro...
engine.py
import sys from pyhap.accessory_driver import AccessoryDriver import json import logging import random import signal import time import toml from forms import convert from paho.mqtt import client as mqtt_client from pyhap.accessory import Accessory, Bridge from pyhap.const import CATEGORY_SENSOR from domoticz import fr...
solution_3_no_fuzzy.py
import threading rabbits_colony_size: int = 0 counter_lock = threading.Lock() printer_lock = threading.Lock() def rabbit_counter(number_of_rabbits: int): global rabbits_colony_size with counter_lock: rabbits_colony_size += number_of_rabbits with printer_lock: print(f'Now we have ...
pesax.py
# This file is part of NEORL. # Copyright (c) 2021 Exelon Corporation and MIT Nuclear Science and Engineering # NEORL is free software: you can redistribute it and/or modify # it under the terms of the MIT LICENSE # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # ...
sample_nn.py
import os from operator import itemgetter # Comment next line to run on GPU. With this configuration, it looks to run faster on CPU i7-8650U os.environ['CUDA_VISIBLE_D5EVICES'] = '-1' import random import warnings import gym from keras.layers import Dense, Flatten from keras.models import Sequential from keras.optim...
FTPListener.py
import logging import os import sys import threading import SocketServer import ssl import socket from . import * from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler, TLS_FTPHandler from pyftpdlib.filesystems import AbstractedFS from pyftpdlib.servers import ThreadedFTPServe...
stockmarket.py
from __future__ import print_function import random import threading import time import Pyro4 class StockMarket(object): def __init__(self, marketname, symbols): self.name=marketname self.symbolmeans={} for symbol in symbols: self.symbolmeans[symbol]=random.uniform(...
viz.py
# -*- coding: utf-8 -*- import threading from functools import partial from time import sleep, strftime, gmtime from bokeh.io import curdoc from bokeh.layouts import row, column from bokeh.models import (Button, TextInput, ColumnDataSource, PanTool, HoverTool, PreText, WheelZoomTool) from bokeh.palettes import plasma, ...
interface.py
#!python # builtin import os import threading # external import PySimpleGUI as sg import click # local from ion_networks import ms_run_files from ion_networks import ms_database from ion_networks import ms_utils from ion_networks import browser def convert_data_formats_to_csvs( input_path, data_type, out...
pebble.py
# Copyright 2021 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
dataframe_data_source.py
from skmultiflow.data.source.data_source import DataSource import threading class DataframeDataSource(DataSource): """ DataframeDataSource class. Provides a DataSource implementation, reading from a dataframe. Parameters ---------- dataframe: pd.DataFrame (Default=None) The features' colu...
AltAnalyze.py
###AltAnalyze #Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California #Author Nathan Salomonis - nsalomonis@gmail.com #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 Softwar...
run.py
import settings import sys try: sys.path.extend(settings.libs) except AttributeError: pass from multiprocessing import Process if __name__ == '__main__': from worker import ImgprocWorker for i in xrange(settings.workers - 1): p = Process(target=ImgprocWorker) p.start() ImgprocWork...
keepalive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Hello. I am alive!" def run(): app.run(host='0.0.0.0',port=8080) def keepalive(): t = Thread(target=run) t.start()
masstris.py
import pygame import threading import multiprocessing import time import sys import random import os import glob from collections import deque import graphics import player_game import display_game import networking import ai class Screen: """ Base class for game screens """ def ...
__main__.py
from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3 import os import labscript_utils.excepthook try: from labscript_utils import check_version except ImportError: raise ImportError('Require labscript_utils > 2.1.0') check_version('la...
manager.py
import multiprocessing def task(ns): print(ns.x) # print 1 ns.x = 2 def main(): manager = multiprocessing.Manager() ns = manager.Namespace() ns.x = 1 print(ns) # Namespace(x=1) process = multiprocessing.Process(target=task, args=(ns, )) process.start() process.join() # print...
GridFileSequence.py
# This file contain GridFileSquence class which create grid for squence of frame import numpy as np import struct import threading import time import multiprocessing import os from stats import StatRecord from Grid import * from RasterGrid import RasterGrid from primitives import Vector2 from ThreadRasterization impo...
reaper.py
# Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
fuzzer.py
# Copyright (C) 2016-present the asyncpg authors and contributors # <see AUTHORS file> # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import socket import threading import typing from asyncpg import cluster class StopServ...
datasets.py
# python peripherals import os import numpy import random import queue from multiprocessing import Process, Queue, cpu_count # torch import torch from torch.utils.data import Dataset # deep_signature from deep_signature.data_generation import curve_generation from deep_signature.data_generation import dataset_generat...
command.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
kubeless.py
#!/usr/bin/env python import sys import traceback import os import imp import json from multiprocessing import Process, Queue from kafka import KafkaConsumer import prometheus_client as prom mod_name = os.getenv('MOD_NAME') func_handler = os.getenv('FUNC_HANDLER') topic_name = os.getenv('TOPIC_NAME') timeout = float...
inflation.py
from flask_restful import abort, reqparse, Resource from marshmallow import Schema, fields, ValidationError, pre_load from flask import Flask, Blueprint, request, jsonify from flask_cors import CORS, cross_origin import psycopg2 import os from os.path import join, dirname import threading from time import sleep import ...
index.wsgi
# -*- coding: UTF-8 -*- import sae,sys reload(sys) sys.setdefaultencoding('utf8') import urllib,urllib2,cookielib import HTMLParser,json #from multiprocessing.pool import Pool import threading,time from greenlet import greenlet import getSearchResult as gsr import publicParams as P import reHTMLTags as rH def app(en...
source.py
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Tommy Winther # http://tommy.winther.nu # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # This Program is free software; you can redistribute it and/or modify # it under the terms of the G...
two_word_index.py
import os from _queue import Empty from multiprocessing import Queue, Event, Process, Pool from threading import Thread from sortedcontainers import SortedDict from common.constants import PATH_TO_DICT, PATH_TO_RESULT_DIR, \ PATH_TO_LIST_OF_FILES, BYTE, PATH_TO_DATA_DIR from common.exceptions import NotSupportedE...
callbacks_test.py
import os import multiprocessing import numpy as np import pytest from numpy.testing import assert_allclose from csv import reader from csv import Sniffer import shutil from collections import defaultdict from keras import optimizers from keras import initializers from keras import callbacks from keras.models import S...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD Li...
__init__.py
""" Yay! It's NOT IDA!!!1!!1!one! """ import os import re import sys import time import queue import string import hashlib import logging import binascii import itertools import traceback import threading import collections import envi import envi.exc as e_exc import envi.bits as e_bits import envi.common as e_co...
run_fuzz_multiprocess_main.py
# Lint as: python3 # # Copyright 2020 The XLS 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...
trex_tui.py
from __future__ import print_function import termios import sys import os import time import threading from collections import OrderedDict, deque from texttable import ansi_len import datetime import readline if sys.version_info > (3,0): from io import StringIO else: from cStringIO import StringIO from ....
run_daemon.py
# Copyright (c) 2014 Mirantis 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 require...