source
stringlengths
3
86
python
stringlengths
75
1.04M
server.py
# # Copyright (C) 2010-2017 Samuel Abels # The MIT License (MIT) # # 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,...
infra_agent.py
''' Created on Jan 6, 2020 @author: jayasankarr ''' import socket import logging from logging.config import fileConfig import sys, os import threading import time from mangleinfraagent import infraagent_helper import psutil import shutil from pathlib import Path import glob import subprocess server_...
heartbeat.py
import multiprocessing import os import time import swf.exceptions from simpleflow import logger from simpleflow._decorators import deprecated from simpleflow.utils import retry __all__ = ["Heartbeater", "HeartbeatProcess"] @deprecated class HeartbeatProcess(object): # Are people using it? def __init__(self, h...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
potterServer.py
#!/bin/python """ This server handles the casting of "spells" that are identified by a separate, more powerful server used to identify said spells. It also handles turning on and off the IR emitters which can get hot if they're left on all the time. """ from flask import Flask import threading from spells import lum...
test_capture.py
from __future__ import absolute_import, division, print_function # note: py.io capture tests where copied from # pylib 1.4.20.dev2 (rev 13d9af95547e) from __future__ import with_statement import pickle import os import sys from io import UnsupportedOperation import _pytest._code import py import pytest import context...
proc_wav_pqmf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2021 Patrick Lumban Tobing (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division from __future__ import print_function import argparse from distutils.util import strtobool import multiprocessing as mp ...
libmilter.py
#!/usr/bin/env python3 # This file is part of python-libmilter. # # python-libmilter is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
sdmain.py
import sublime import sublime_plugin import subprocess import threading import traceback import os import sys import re import signal import uuid from GoDebug.sdconst import DlvConst from GoDebug.sdlogger import DlvLogger from GoDebug.sdworker import DlvWorker from GoDebug.sdview import DlvView from GoDebug.sdobject...
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...
test_sys.py
zaimportuj unittest, test.support z test.support.script_helper zaimportuj assert_python_ok, assert_python_failure zaimportuj sys, io, os zaimportuj struct zaimportuj subprocess zaimportuj textwrap zaimportuj warnings zaimportuj operator zaimportuj codecs zaimportuj gc zaimportuj sysconfig zaimportuj platform # count t...
manytopics_subscriber.py
""" This is the subscriber for the 'many topics' messages example. For code with more explanations, see the regular 'weather' message example code. """ import os import time import threading from operator import itemgetter from Pyro5.api import expose, Daemon from messagebus.messagebus import Subscriber @expose class...
bitcoin_three.py
""" Bitcoin Part 3 * Difficulty adjustment * Introduce notion of "difficulty periods" * Block.bits, Block.timestamp, Block.target Usage: bitcoin.py serve bitcoin.py ping [--node <node>] bitcoin.py tx <from> <to> <amount> [--node <node>] bitcoin.py balance <name> [--node <node>] Options: -h --help Show ...
test_util.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...
football_env_test.py
# coding=utf-8 # Copyright 2019 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
base.py
# vim:ts=4:sts=4:sw=4:expandtab from copy import deepcopy import datetime import grp import io import json import logging import os import pathlib import pwd import shutil import sys import tempfile import threading import time from kolejka.judge import config from kolejka.judge.exceptions import * from kolejka.jud...
elections.py
import datetime import json import logging import os import threading import time from typing import List, Optional, Tuple from exceptions.depool import LowDePoolBalanceException from routines.models.elections import Election from secrets.interfaces.secretmanager import SecretManagerAbstract from settings.elections im...
_utilities.py
import os import time from datetime import datetime from multiprocessing import Process def timer(start=None, to_var=False): if not start: print(datetime.now().ctime()) return time.time() stop = time.time() m, s = divmod(stop - start, 60) h, m = divmod(m, 60) if to_var: re...
bot.py
import telepot import urllib.request import json import threading TOKEN = '538084148:AAFT90I8FHMZ0df3ZYtZIF5vspbGR5Ar3mA' kick = False priv = False boolean = False settings = { 'antibot':True, 'messages_per_second':3 } antiflood = {} def newgroup(msg): if msg['chat']['type'] == "supergroup": cha...
test_dota_base_sota.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process from utils import...
CalculateSMA.py
# Copyright (C) 2021 LYNX B.V. All rights reserved. # Import ibapi deps from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import * import threading import time import pandas class App(EWrapper, EClient): def __init__(self, ipaddress, portid, clientid): EClient.__init...
KoalaController.py
import ArchingKoala import MQTTClient import threading class KoalaController: def __init__(self, host, serial): self.new_message_flag = threading.Event() self.stop_flag = threading.Event() self.stop_flag.set() self.koala = ArchingKoala.ArchingKoala(serial, self.new_message_flag, s...
import_logs.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Piwik - Open source web analytics # # @link http://piwik.org # @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later # @version $Id$ # # For more info see: http://piwik.org/log-analytics/ import base64 import bz2 import ConfigParser import datetime import fnmat...
test_cursor.py
# Copyright 2009-present MongoDB, 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 wri...
test_capture.py
from __future__ import absolute_import, division, print_function # note: py.io capture tests where copied from # pylib 1.4.20.dev2 (rev 13d9af95547e) import pickle import os import sys from io import UnsupportedOperation import _pytest._code import py import pytest import contextlib from six import binary_type, text_...
sftp_file.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
mp.py
import os import pickle import struct import sys from functools import partial from multiprocessing import Process, Lock, Event as ProcessEvent from multiprocessing.pool import ThreadPool from threading import Thread, Event as TrEvent from time import sleep, time from typing import List, Dict import psutil from six.mo...
core.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
server.py
import socket import pickle import time import threading def handle_client(conn, addr): currentTime = time.ctime((time.time())) print("Estabelecendo uma conexão com %s às %s." % (str(addr), currentTime)) data = pickle.loads(conn.recv(1024)) if data['operator'] == "1": w = float(data['weight'])...
resnets.py
import sys,os sys.path.append('D:\\chenchuyang\\learning\\lc-model-compression\\') from lc.models.torch.resnetcif import resnetcif20, resnetcif32, resnetcif56, resnetcif110 from examples.cvpr2020.utils import AverageMeter, Recorder, format_time, data_loader, compute_acc_loss import torch import time from lc.torch impor...
bsnl.py
import tkinter from tkinter import TOP, BOTTOM, HORIZONTAL, END, S, W, E, N from tkinter import messagebox, ttk, PhotoImage, simpledialog from requests import post, get, packages, Session, exceptions from urllib3.exceptions import InsecureRequestWarning from time import sleep, time, ctime from re import findall from fu...
test_mp_plugin.py
import sys from nose2 import session from nose2.plugins.mp import MultiProcess, procserver from nose2.plugins import buffer from nose2.plugins.loader import discovery, testcases from nose2.tests._common import FunctionalTestCase, support_file, Conn from six.moves import queue import multiprocessing import threading im...
class_CameraMntr.py
import threading import json import Queue import random import math import time import Tkinter import tkMessageBox import tkFont import cv2 import numpy as np from PIL import Image from PIL import ImageTk import class_MyThread class CameraLink: def __init__(self, arg_camera_id): self.__camera_idMatrix= [0,...
resource_sharer.py
# # We use a background thread for sharing fds on Unix, and for sharing # sockets on Windows. # # A client which wants to pickle a resource registers it with the resource # sharer and gets an identifier in return. The unpickling process will connect # to the resource sharer, sends the identifier and its pid, and then ...
update_repository_manager.py
""" Determine if installed tool shed repositories have updates available in their respective tool sheds. """ import logging import threading from sqlalchemy import false import tool_shed.util.shed_util_common as suc from tool_shed.util import common_util from tool_shed.util import encoding_util log = logging.getLogg...
DeviceControlKeyword.py
''' /****************************************************************** * * Copyright 2018 Samsung Electronics 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...
ToontownRPCConnection.py
from direct.directnotify.DirectNotifyGlobal import directNotify from direct.stdpy import threading from direct.stdpy import threading2 import httplib import json import socket import time from toontown.rpc.ToontownRPCDispatcher import ToontownRPCDispatcher class ToontownRPCConnection: notify = directNotify.newCa...
test_errcodes.py
#!/usr/bin/env python # test_errcodes.py - unit test for psycopg2.errcodes module # # Copyright (C) 2015 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software ...
main.py
import argparse import github3 import toml import json import re import functools from enum import IntEnum from . import utils from .utils import lazy_debug from . import action import logging from threading import Thread, Lock, Timer import time import traceback import sqlite3 import requests from contextlib import co...
mqtt_ws_example_test.py
from __future__ import print_function from __future__ import unicode_literals from builtins import str import re import os import sys import paho.mqtt.client as mqtt from threading import Thread, Event from tiny_test_fw import DUT import ttfw_idf event_client_connected = Event() event_stop_client = Event() event_clie...
sandbox.py
#!/usr/bin/python from __future__ import print_function import os import shlex import signal import subprocess import sys import time import random import string import stat from optparse import OptionParser from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Q...
eventlistener.py
# # Copyright 2021, NTT Communications Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
server.py
import os import io import logging import json import time import grpc import subprocess import tempfile import traceback import contextlib import concurrent.futures import threading from typing import List, Tuple import hexlite_pb2 as pb import hexlite_pb2_grpc as pb_grpc logger = logging.getLogger() logger.setLeve...
advanced_keylogger.pyw
import pyHook import pythoncom from datetime import * import time import os import threading import pyscreenshot root_dir=os.path.split(os.path.realpath(__file__))[0] log_file = os.path.join("C:\\Users\\Solid\\Desktop\\PRACTICE","log_file.txt") caps_dir = os.path.join(root_dir,"screencaps") name="keylog" buffer="" p...
__init__.py
import os from os import truncate import signal import threading import traceback from datetime import datetime, timedelta from functools import lru_cache from typing import Any, Callable, Dict from pathlib import Path import zmq import zmq.auth from zmq.backend.cython.constants import NOBLOCK from zmq.auth.thread imp...
client.py
import copy import json import os import queue import random import re import sys import threading import time import tkinter as tk import types from thonny import get_workbench from thonny.tktextext import EnhancedText import thonnycontrib.codelive.patched_callbacks as pc import thonnycontrib.codelive.mqtt_connectio...
main.py
import time import asyncio import threading import click import sys import os # Python imports will be the end of us all sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) from raccoon_src.utils.coloring import COLOR, COLORED_COMBOS from raccoon_src.utils.exceptions import RaccoonExc...
test_smtplib.py
import asyncore 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 smtpd import smtplib import io import re import sys import time import select import errno import textw...
__init__.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Logging utils """ import os import warnings from threading import Thread import pkg_resources as pkg import torch from torch.utils.tensorboard import SummaryWriter from utils.general import colorstr, emojis from utils.loggers.wandb.wandb_utils import WandbLogger from u...
portscan.py
#!/usr/bin/python # encoding=utf-8 # Filename: test.py # author = 0c0c0f import threading,sys,socket,re import time,Queue import optparse #定义扫描端口 PortList = [21,22,23,25,53,80,443,445,873,1433,1521,1723,3306,3389,4848,4899,5800,5900,7001,8080,8443,8500,9080,9200,27017] #存放IP数组 result =[] #定义连接超时时间 Timeout = 2 # 创建锁 mu...
ev_loop.py
from __future__ import absolute_import, print_function, unicode_literals from threading import Thread import zmq from wolframclient.language import wl from wolframclient.serializers import export from wolframclient.utils.externalevaluate import EXPORT_KWARGS, start_zmq_loop from wolframclient.utils.tests import Test...
gtest_parallel.py
# Copyright 2013 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
ntp.py
#!/usr/bin/env python3 # MIT License # # Copyright (C) 2019-2020, Entynetproject. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including withou...
registrar_common.py
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import ipaddress import threading import sys import signal import os import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn from sqlalchemy.exc ...
bitcoin_lottery.py
''' Created on Dec 5, 2020 @author: Edoz ''' from bit import Key, base58, crypto from datetime import datetime from multiprocessing import Process from threading import Thread import os, copy, sys def load_addresses(filepath='./addresses.txt'): print('Loading target addresses') with open(filepath) as f: ...
barrier_ops_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...
test_websocket_integration.py
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
multiprocessing_env.py
# This code is from openai baseline # https://github.com/openai/baselines/tree/master/baselines/common/vec_env import numpy as np import gym from multiprocessing import Process, Pipe def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while True: cmd, ...
test_enum.py
import copy import enum import doctest import inspect import os import pydoc import sys import unittest import threading import typing import builtins as bltns from collections import OrderedDict from datetime import date from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto from enum import ST...
main.py
from multiprocessing import Process from multiprocessing import Queue import os import threading import argparse import time import logging import mimetypes import json import requests import urllib.request import urllib.error import cv2 from project.config import ProductionConfig as prod from project.classifier imp...
java_gateway.py
# -*- coding: UTF-8 -*- """Module to interact with objects in a Java Virtual Machine from a Python Virtual Machine. Variables that might clash with the JVM start with an underscore (Java Naming Convention do not recommend to start with an underscore so clashes become unlikely). Created on Dec 3, 2009 :author: Barthe...
kicost_gui.py
# -*- coding: utf-8 -*- # MIT license # # Copyright (C) 2018 by XESS Corporation / Hildo Guillardi Júnior # # 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 wi...
daemon.py
from kubemon.pod import Pod from kubemon.utils import get_container_pid, receive, send_to from kubemon.monitors.base_monitor import BaseMonitor, MonitorFlag from typing import Any, List, Tuple from ..config import ( DEFAULT_CLI_PORT, DEFAULT_MONITOR_INTERVAL, DEFAULT_MONITOR_PORT, DEFAULT_DAEMON_PORT, MO...
test_advanced.py
# coding: utf-8 from concurrent.futures import ThreadPoolExecutor import json import logging import random import sys import threading import time import os import numpy as np import pytest import ray.cluster_utils import ray._private.profiling as profiling from ray._private.test_utils import (client_test_enabled, ...
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...
imaplib2.py
#!/usr/bin/env python """Threaded IMAP4 client for Python 3. Based on RFC 3501 and original imaplib module. Public classes: IMAP4 IMAP4_SSL IMAP4_stream Public functions: Internaldate2Time ParseFlags Time2Internaldate """ __all__ = ("IMAP4"...
build_environment.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """ This module contains all routines related to setting up the package build environment. All of this is set up by packa...
onecheat.py
print('OneCheat') from tkinter import Tk, StringVar, Frame, N, W, E, S, Button, Label, Entry from tkinter.ttk import Combobox from requests import get import os.path import os from zipfile import ZipFile from threading import Thread # AR Codes ''' Revision List: Rev1.0: - First Release - New Super Mario Bros. 2 Added ...
base_test.py
# -*- coding: utf-8 -*- import contextlib import copy import datetime import json import threading import elasticsearch import mock import pytest from elasticsearch.exceptions import ElasticsearchException from elastalert.enhancements import BaseEnhancement from elastalert.enhancements import DropMatchException from ...
test_full_system.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest import time import uuid import os from unittest import mock from parlai.mturk.core.socket_manager import...
admin.py
# Standard Library import threading # Third-Party Imports from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.core.management import call_command # App Imports from core import models from .forms import UserRegistrationForm, UserSyncForm admin.site.register(...
sqlite.py
from google_speech import Speech from threading import Thread import subprocess, sys from random import choice import sqlite3 from duendecat.dir import LOG_FILE, database_path class Data(): def __init__(self, **param): self.setParam(**param) self.conn = sqlite3.connect(database_path(self.filenam...
test_autograd.py
import contextlib import gc import sys import io import math import random import tempfile import time import threading import unittest import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, partial...
execution_summary_test.py
# -*- coding: utf-8 -*- # # Copyright 2015-2015 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...
Spec.py
# -*- coding: utf-8 -*- import glob import io import sys import os from collections import defaultdict, OrderedDict from datetime import datetime from . import biblio from . import boilerplate from . import caniuse from . import dfns from . import mdnspeclinks from . import config from . import constants from . impo...
_cli.py
import logging import threading from ._config import load as config_loader from .filter import create_filters from .monitor import Monitor from .notifiers import NotifierFactory from ._utils import _notify_boot class CLI(object): def __init__(self, logger): self._logger = logger self._notifier_fac...
server.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...
iotcc.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------# # Copyright © 2015-2016 VMware, Inc. All Rights Reserved. # # # # Licensed under the BSD 2-Clause License (the “License...
trainer_controller.py
# # Unity ML-Agents Toolkit # ## ML-Agent Learning """Launches trainers for each External Brains in a Unity Environment.""" import os import threading from typing import Dict, Set, List from collections import defaultdict import numpy as np from mlagents.tf_utils import tf from mlagents import tf_utils from mlagents...
ideasbot.py
import os import yaml import discord import requests import asyncio import data import json from bs4 import BeautifulSoup from discord.ext import commands, tasks import threading URL = 'https://ideasai.net/' MAX_THREADS = 3 initialized = False current_threads = 0 loop = asyncio.new_event_loop() asyncio.set_event_loop...
filtering.py
import matplotlib.pylab as plt import scipy.ndimage from skimage.filters import gabor_kernel import math import numpy as np def gabor_filtering_block(img, dir_map, fre_map, mask=None, patch_size=64, block_size=16): img = img.astype(np.float) ovp_size = (patch_size - block_size) // 2 h0, w0 = img.shape ...
solution_3.py
import threading from exercises.utils import fuzzy rabbits_colony_size: int = 0 counter_lock = threading.Lock() printer_lock = threading.Lock() def rabbit_counter(number_of_rabbits: int): global rabbits_colony_size fuzzy() with counter_lock: fuzzy() rabbits_colony_size += number_of_rabb...
common.py
# Copyright (C) 2008 The Android Open Source Project # # 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 ...
acs_client.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
memory_leak_test.py
# -*- coding: UTF-8 -*- from __future__ import absolute_import # <AK> added from contextlib import contextmanager import gc from multiprocessing import Process import subprocess import unittest from jt.py4j.java_gateway import ( JavaGateway, GatewayParameters, CallbackServerParameters, DEFAULT_PORT, DEFAULT_...
rt605_arm_control_api.py
#!/usr/bin/python # -*- coding: UTF-8 -*- import rospy import sys import time import numpy as np import os import datetime from ctypes import * import rospy from enum import Enum import threading from control_node.msg import robot_info # Init the path to the Hiwin Robot's SDK .dll file CURRENT_FILE_DIRECTORY = os.path...
app.py
#!/usr/bin/env python from importlib import import_module import os from flask import Flask, render_template, Response, send_from_directory from flask_cors import * import base64 import time # import camera driver # from camera_opencv import Camera import threading # Raspberry Pi camera module (requires picamera pack...
server.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ ParlAI Server file. """ from __future__ import absolute_import from __future__ import division from __future__ impor...
test_suite.py
#!/usr/bin/env python # Copyright 1996-2021 Cyberbotics 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 applica...
blockimgdiff.py
# Copyright (C) 2014 The Android Open Source Project # # 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 ...
__init__.py
__author__ = "Johannes Köster" __copyright__ = "Copyright 2015-2019, Johannes Köster" __email__ = "koester@jimmy.harvard.edu" __license__ = "MIT" import os import sys import contextlib import time import datetime import json import textwrap import stat import shutil import shlex import threading import concurrent.futu...
demo_open.py
#!/usr/bin/env python # coding=utf-8 import tensorflow as tf import bottle from bottle import route, run, static_file import threading import json import numpy as np import os from soqal import SOQAL from time import sleep import sys import pickle import json sys.path.append(os.path.abspath("retriever")) from retrieve...
load_dataset.py
import threading import numpy as np import tensorflow as tf import pickle def read_training_data(file_path): f = open(file_path, 'rb') data = pickle.load(f) f.close() return data def get_pair(imgs): for uid in range(len(imgs)): n_img = np.arange(len(imgs[uid])) sur, tar = np.meshgr...
server.py
#!/usr/bin/env python # # Author: Jack Baker (https://github.com/qwokka/smbcommander) # # This product includes software developed by # SecureAuth Corporation (https://www.secureauth.com/)." # import ConfigParser import logging import os import sys import time from binascii import hexlify, unhexlify from Queue import...
app.py
#!/usr/bin/env python # # Copyright 2018 IBM Corp. 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...
webserver.py
# ---------------------------------------- IMPORT HERE ---------------------------------------- from flask import render_template, Flask, json, jsonify, make_response, request, send_from_directory from google.cloud import storage from google.oauth2 import service_account from werkzeug.utils import secure_filename impo...
mqtt_ws_example_test.py
from __future__ import print_function from __future__ import unicode_literals from builtins import str import re import os import sys import paho.mqtt.client as mqtt from threading import Thread, Event from tiny_test_fw import DUT import ttfw_idf event_client_connected = Event() event_stop_client = Event() event_clie...
server.py
from threading import Thread from queue import Queue import os, time, sys, logging, socket, signal def lazyprop(fn): attr_name = '_lazy_' + fn.__name__ @property def _lazyprop(self): if not hasattr(self, attr_name): setattr(self, attr_name, fn(self)) return getattr(self, attr_...
eval.py
""" @author: Wendong Xu @contact: kirai.wendong@gmail.com @file: eval.py @time: 2019-11-02 20:11 @desc: """ # Use CUDA by default. import argparse import os import torch import time import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import cv2 import torch.multiprocessing as mp impor...
main.py
#!/usr/bin/env python # Meshal Alenezi aka Bodresha # ClubHouse Username Checker # -*- coding: UTF-8 -*- import os import argparse import time import random import threading import requests from fake_useragent import UserAgent from colorama import Fore # in seconds wait_between_request = 1 output_file = "available.tx...