source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
simulation.py | """
@file simulation.py
@brief quick test sim to try out the agent/arena and rendering
@author Graham Riches
@details
"""
import threading
from core.render_engine import Renderer
from core.command_line import CommandLine
from routing.a_star import AStar
from routing.managers.sequential import Sequen... |
master.py | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import logging
import hashlib
imp... |
server.py | # coding: utf-8
import os
import sys
import socket
import threading
import buffer
from time import sleep
from scheduler import scheduler
class Receiver :
def __init__(self, host='0.0.0.0', port=6666):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.... |
base_repository_test.py | # Copyright 2017 The Forseti Security 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 ap... |
rohon_gateway.py | """
"""
import sys
import json
import traceback
from datetime import datetime, timedelta
from copy import copy,deepcopy
from functools import lru_cache
from typing import List
import pandas as pd
from .vnctpmd import MdApi
from .vnctptd import TdApi
from .ctp_constant import (
THOST_FTDC_OAS_Submitted,
THOST_F... |
NatNetClient.py | """
This file was taken from the NatNet SDK and modified.
NatNet Version 2.10.0 (06/15/2016)
"""
import socket
import struct
from threading import Thread
def trace(*args):
pass # print("".join(map(str, args)))
# Create structs for reading various object types to speed up parsing.
Vector3 = struct.Struct('<fff... |
test_failure_2.py | import logging
import os
import signal
import sys
import threading
import time
import numpy as np
import pytest
import ray
from ray.experimental.internal_kv import _internal_kv_get
from ray.autoscaler._private.util import DEBUG_AUTOSCALING_ERROR
import ray._private.utils
from ray.util.placement_group import placement... |
source.py | # pylint: disable=exec-used
"""Parsing of metadata that comes from setup.py"""
from __future__ import print_function
import functools
import imp # pylint: disable=deprecated-module
import io
import logging
import os
import os.path
import re
import shutil
import subprocess
import sys
import tempfile
import threading
i... |
external_program.py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2016 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... |
serwerTCP.py | #!/usr/bin/python
#coding=utf-8
print "Content-type:text/html\r\n\r\n"
print '<html>'
print '<head>'
print '<title>Socket kurcze !</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '</body>'
print '</html>'
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServ... |
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... |
discover.py | #!/usr/bin/env python
from processing import Process, Queue, Pool
import time
import subprocess
from IPy import IP
import sys
from snmp import Snmp
q = Queue()
oq = Queue()
#ips = IP("10.0.1.0/24")
ips = ["192.19.101.250", "192.19.101.251", "192.19.101.252","192.19.101.253",
"192.168.1.1"]
num_workers = 10
class Host... |
udp.py | from socket import *
import threading, time, json
from .data import add_data_keys
# Define valid data types to document API and so calling application can be aware if needed
VALID_DATA_TYPES = ('evt_precip', 'evt_strike', 'rapid_wind', 'obs_air', 'obs_sky', 'obs_st', 'device_status',
'hub_status')
... |
disco.py | from __future__ import absolute_import
import json
import os
from StringIO import StringIO
from urlparse import urlparse, parse_qs
import threading
import re
from functools import partial
import hashlib
from datetime import datetime
import time
import disco
from disco.core import Disco
from .io import puts
from . ... |
iostream.py | """Wrappers for forwarding stdout/stderr over zmq"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import atexit
import io
import os
import sys
import threading
import traceback
import warnings
from binascii import b2a_hex
from collections import deque
from io im... |
make_video_frames.py | #!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
import sys
import subprocess, shlex
import os
import os.path
import string
import logging
import argparse
import threading
from glob import glob
# Parameters to transform fits to png
bin = 'fits2png.x'
def run_cmd(cmd):
logging.debug("About to execute: %s", ' '.j... |
test_local_task_job.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
#... |
test_schedule.py | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
dev_mp.py | import multiprocess as mp
import time
def foo_one(eve1, eve2):
print("Foo one is boosting")
time.sleep(5)
eve1.set() # Alarm foo_two()
eve2.wait() # Need to wait foo_two() finishing boosting
print("Foo one is running")
return None
def foo_two(eve1, eve2):
print("Foo two is boosting")
t... |
client.py | # -*- coding: utf-8 -*-
import itertools
import socket
import threading
import time
from collections import deque
from logging import getLogger
from urllib.parse import urlparse
from grpc import StatusCode
from h2.errors import ErrorCodes
from nameko_grpc.compression import SUPPORTED_ENCODINGS, UnsupportedEncoding
fr... |
paralel_test.py | #!/usr/bin/python
#-*- coding: utf-8 -*-
import paho.mqtt.publish as publish
from multiprocessing import Process
import time
import os
import logging
import random
# create logger
logger = logging.getLogger('PSENSv0.1')
logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
ch = logging.Stream... |
ChipDeviceCtrl.py | #
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2019-2020 Google, LLC.
# Copyright (c) 2013-2018 Nest Labs, 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... |
remoteSensors.py | from threading import Thread
from time import sleep
class AngleSensor:
"""
Angle sensor has two main roles. It listens on the specified
port for udp angle packets and parses them to obtain the most
recent value for the angle to target. It also acts as a data
source for a PIDController.
If t... |
panorama.py | import numpy as np
import algos
import utils
import viz
import threading
def cornerDetectionAndSuppression(I, Imask, anms, cmax, out):
if not anms:
_, Ixy = algos.harris(I, maxPeaks=cmax)
out.append(Ixy)
Id = algos.makeDescriptors(I, Ixy)
out.append(Id)
else:
Ih, Ixy = ... |
marathon_lb.py | #!/usr/bin/env python3
"""# marathon-lb
### Overview
The marathon-lb is a service discovery and load balancing tool
for Marathon based on HAProxy. It reads the Marathon task information
and dynamically generates HAProxy configuration details.
To gather the task information, marathon-lb needs to know where
to find Mar... |
draw_song.py | # -*- coding: utf-8 -*-
from Scripts.elements import *
from Scripts.song_manage import SongManage
from Scripts.music_storage import MusicStorage
class DrawSong(SongManage):
def __init__(self, canvas, y, song_num, info, lib):
self.canvas = canvas
self.y = y
self.lib = lib
... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
conftest.py | import os
import json
import importlib
from multiprocessing import Process
from indexd import default_settings, get_app as get_indexd_app
from indexclient.client import IndexClient
import pytest
import requests
import requests_mock
from mock import patch
from psqlgraph import PsqlGraphDriver
from dictionaryutils impor... |
ancestry_extract.py | #!/usr/bin/env python3
"""
##############################################################################
# Copyright 2019-2020 Christopher Horn
#
# 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 a... |
run_so2sat_byol_experiments.py | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Runs the train script with a grid of hyperparameters."""
import itertools
import os
import subprocess
from multiprocessing import Process, Queue
from typing import List
# list of GPU IDs that we wan... |
test_unix_events.py | """Tests for unix_events.py."""
import collections
import contextlib
import errno
import io
import os
import pathlib
import signal
import socket
import stat
import sys
import tempfile
import threading
import unittest
from unittest import mock
from test import support
if sys.platform == 'win32':
raise unittest.Ski... |
image_generator.py | import os
import json
from PIL import Image
from colorama import Fore, Back, Style
import colorama
import command
import gentle
from bar import print_bar
import copy
import threading
threads = []
class LockingCounter():
def __init__(self):
self.lock = threading.Lock()
self.... |
pool.py | """Simple Pool object"""
from queue import Queue
class Proxy:
"""Wraps original object with context manager that return the object to the
pool."""
def __init__(self, obj, pool):
self._obj = obj
self._pool = pool
def __enter__(self):
return self._obj
def __exit__(self, ty... |
web_service.py | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
multi_manager_debug.py | import argparse
import random
import json
import numpy as np
import json
import time
from onmt.Utils import use_gpu
import logging
from cocoa.core.util import read_json
from cocoa.core.schema import Schema
from cocoa.core.scenario_db import ScenarioDB
from cocoa.neural.loss import ReinforceLossCompute
import cocoa.o... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_bynd.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_bynd.bip32 import BIP32Node
from electrum_bynd import constants
from elect... |
converter.py | # -*- coding:utf-8 -*-
# Copyright 2019 The DeepRec 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... |
dispatcher.py | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
main.py | from threading import Thread
import subprocess
import os
if __name__ == '__main__':
dirname = os.path.dirname(__file__)
t1 = Thread(target=subprocess.run, args=([os.path.join(dirname,"env/Scripts/python"), os.path.join(dirname,"src/python/ardui.py")],))
t2 = Thread(target=subprocess.run, args=([os.path.jo... |
newtuq_tests.py | import logging
import threading
from .tuq import QueryTests
class QueryNewTuqTests(QueryTests):
def setUp(self):
super(QueryNewTuqTests, self).setUp()
self.log.info("============== QueryNewTuqTests setup has started ==============")
self.log.info("============== QueryNewTuqTests setup ha... |
auth.py | import socket
import threading
import uuid
from pathlib import Path
from wsgiref.simple_server import make_server
import hug
from cachecontrol import CacheControlAdapter
from cachecontrol.caches.file_cache import FileCache
from oauthlib.oauth2 import BackendApplicationClient
from pony.orm import get
from requests_oaut... |
webserver.py | from __future__ import annotations
from contextlib import contextmanager
from copy import deepcopy
from functools import partial
from threading import Lock, Thread
from time import sleep
from typing import Awaitable, Callable, ContextManager, Iterable, Iterator, List, Optional, Tuple, Union, overload
from requests im... |
GUI_copy_files_limit.py | '''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import Spinbox
from time import sleep
import Ch04_Code... |
gceProvisioner.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
test.py | from simple import *
from PyQt5.QtWidgets import QApplication, QMainWindow
from multiprocessing import Process
import socket
import threading
lock = threading.RLock()
HOST = "192.168.2.5"
PORT = 65432
content = 'hello'
class ReadFromConnThread(threading.Thread):
def __init__(self, conn):... |
Dota2Env.py | import sys
from threading import Thread
from time import sleep
import numpy as np
from dota2comm import Dota2Comm
import queue
ActionMap = {
"laning": np.asarray([1, 0, 0]),
"attack": np.asarray([0, 1, 0]),
"retreat": np.asarray([0, 0, 1]),
}
#Helper function
def ParseLine(ll):
ll = ll.split(" ")
... |
search_by_db.py | from fake_useragent import UserAgent
import requests
from time import sleep
import datetime
from .model import WeiboInfo, WeiboTask, engine
from sqlalchemy.orm import sessionmaker
from pyquery import PyQuery as pq
import random
Session = sessionmaker(bind=engine)
session = Session()
ua = UserAgent(verify_ssl=False)
... |
test_metadata.py | import multiprocessing
import threading
from queue import Queue
from localstack.utils.analytics.metadata import get_client_metadata, get_session_id
def test_get_client_metadata_cache():
c1 = get_client_metadata()
c2 = get_client_metadata()
assert c1 is not None
assert c2 is not None
assert c1 is... |
test_transport.py | #
# 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, software
# distributed under ... |
main.py | import os.path
import time
import threading
import json
import click
from PIL import Image, ImageFont
from luma.core.interface.serial import i2c
from luma.oled.device import ssd1306
from luma.core.virtual import viewport
from luma.core.render import canvas
import requests
URL_BASE = 'http://10.73.224.41:5000'
URL_MIS... |
service.py | """
Main service module
"""
# pylint: disable=C0103,C0301,R0902
import threading
import datetime as dt
from videocapture import VideoCapture
from objdetector import ObjectDetector
import entities as e
class Service:
"""
Main app class with control loop
"""
def __init__(self, config, logger):
... |
test_gluon_model_zoo.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
PC_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.5)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import Co... |
results_2_16_code.py | import tensorflow as tf
from tensorflow.keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, Flatten, BatchNormalization
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import Callback
from os.path import join
from os ... |
batch.py | """ThreatConnect Batch Import Module."""
# standard library
import gzip
import hashlib
import json
import math
import os
import re
import shelve
import sys
import threading
import time
import traceback
import uuid
from collections import deque
from typing import Any, Callable, Optional, Tuple, Union
from .group import... |
wait_for_tests.py | #pylint: disable=import-error
from six.moves import queue
import os, time, threading, socket, signal, shutil, glob
#pylint: disable=import-error
from distutils.spawn import find_executable
import logging
import xml.etree.ElementTree as xmlet
import CIME.utils
from CIME.utils import expect, Timeout, run_cmd_no_fail, sa... |
okex_websocket.py | from exchange_sockets.exchange_websocket import ExchangeWebSocket
from singletones.custom_logger import MyLogger
import websocket
import threading
from time import sleep
from time import time
import json
import zlib
logger = MyLogger()
class OkexWebsocket(ExchangeWebSocket):
def __init__(self, stream_n_pairs):
... |
test_util_modules.py | import asyncio
import concurrent.futures
import multiprocessing as mp
import random
import time
import numpy as np
import pytest
import torch
import hivemind
from hivemind.proto.dht_pb2_grpc import DHTStub
from hivemind.proto.runtime_pb2 import CompressionType
from hivemind.proto.runtime_pb2_grpc import ConnectionHan... |
graphite_monitor.py | # Copyright 2014 Scalyr 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 writing, so... |
snapshot.py | import io
import multiprocessing
import pathlib
import os
import typing
import libzfs
import zonys
import zonys.core
import zonys.core.zfs
import zonys.core.zfs.dataset
import zonys.core.zfs.file_system
class AlreadyExistsError(RuntimeError):
def __init__(self, file_system, name):
handle = Handle(file_s... |
monitor.py | """MAGI action monitor."""
from Queue import Queue
import threading
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pylab
def get_action_name(action):
"""
Get action name.
@param action: Action
@return action's string name
"""
action_name = action.get_name()
... |
generator.py | import logging
import threading
from queue import Queue
from typing import Any, Iterable
import threading
logger = logging.getLogger(__name__)
class ThreadSafeGen:
"""
Wraps generators to make them thread safe
"""
def __init__(self, iterable: Iterable[Any]):
"""
"""
self.ite... |
Video copy.py |
from PyQt5 import QtGui
from PyQt5.QtCore import QDir, QEvent, QObject, QSize, QUrl, Qt, QThread, pyqtSignal, QMutex
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer
from PyQt5.QtMultimediaWidgets import QVideoWidget
from PyQt5.QtWidgets import QDockWidget, QFileDialog, QHBoxLayout, QLabel, QPushButton, QSli... |
ca_util.py | #!/usr/bin/env python
'''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclu... |
analysis.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from classes.zeekengine import ZeekEngine
from classes.suricataengine import SuricataEngine
from multiprocessing import Process, Manager
import sys
import re
import json
import os
"""
This file is called by the frontend but the analysis
can be done i... |
client_audio_multi_2.py | #!/usr/bin/env python
import pyaudio
import socket
import sys
import time
from array import array
from struct import pack
from multiprocessing import Process
# Pyaudio Initialization
chunk = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 10240
backlog = 5
THRESHOLD = 5
def is_silent(snd_data):
#return True of... |
NNDE.py | import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation
from sklearn.model_selection import StratifiedKFold
def gen_rand(n_size=1):
'''
This function return a n_size-dimensional random vector.
'''
return np.random.random(n_size)
class NN_DE(object):
d... |
train.py | #!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser(description='Macro-DESPOT (MAGIC) Training Args')
parser.add_argument('--task', required=True,
help='Task')
parser.add_argument('--macro-length', type=int, required=True,
help='Macro-action length')
parser.a... |
main.py | # -*- coding: utf-8 -*-
# @Author: LogicJake
# @Date: 2019-01-16 11:25:12
# @Last Modified time: 2019-01-22 19:21:05
from config import logger
from lib.database import db_object
import argparse
from get_proxy import GetProxy
from validate import ValidateOrigin
from test import TestAvailable
import threading
def in... |
solver.py | #!/usr/bin/env python3
import os
import sys
import json
import math
import string
import socket
import subprocess
from threading import Thread
IP = sys.argv[1] if len(sys.argv) > 1 else '0.0.0.0'
PORT = 17171
def generate_payload():
operation = 'Ry ' + str(-math.pi / 2)
operations = []
for i in range... |
watchdog.py | # -*- coding: utf-8 -*-
from kazoo.client import KazooClient
import os
import sys
import logging
import time
import signal
from multiprocessing import Process
main_dir = "/root/V3/project/"
signal_dir = '/signal/sinablog'
task_type = "sinablog"
def run_proc():
os.chdir(main_dir +"sinablog/sinablog/spiders")
#a... |
http2_connection.py |
import Queue
import threading
import socket
import errno
import struct
from http_common import *
from hyper.common.bufsocket import BufferedSocket
from hyper.packages.hyperframe.frame import (
FRAMES, DataFrame, HeadersFrame, PushPromiseFrame, RstStreamFrame,
SettingsFrame, Frame, WindowUpdateFrame, GoAway... |
git_common.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
# Derived from https://gist.github.com/aljungberg/626518
from __future__ import prin... |
bioasq_utils.py | import os
from os.path import join
import tempfile
import shutil
import pickle
import gc
import json
import tarfile
import codecs
import sys
from mmnrm.evaluation import f_map, f_recall
from datetime import datetime as dt
from nir.utils import change_bm25_parameters
import copy
from trectools import fusion, TrecRun
fr... |
newlocky.py | from base64 import b64encode
from base64 import b64decode
from threading import Thread
from Crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5
from Crypto.PublicKey import RSA
from ctypes import windll
from os import walk
from os import rename
from os import path
from os import urandom
def npass(length):
... |
scraper.py | # -*- coding: utf-8 -*-
import zmq
from lxml import etree
from zmq.eventloop import ioloop
import time
import os
import functools
import urllib2
from StringIO import StringIO
import re
import sqlite3
# PyPI page related constants
PYPI_BASE_URL = "http://pypi.python.org%s"
pkg_list_url = PYPI_BASE_URL % r"/pypi?%3Aac... |
split.py | #!/usr/bin/env python3
import random
from popper.utils import Settings, Stats
from popper.aspsolver import Clingo
from popper.tester import Tester
from popper.constrain import Constrain, Outcome, Con
from popper.generate import generate_program
from popper.core import Clause, Literal, Grounding, Program
from datetime ... |
local_timer_example.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import multiprocessing as mp
import signal
import time
import unittest
imp... |
installwizard.py |
import sys
import os
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import PyQt5.QtCore as QtCore
import electrum_zeny
from electrum_zeny import Wallet, WalletStorage
from electrum_zeny.util import UserCancelled, InvalidPassword
from electrum_zeny.base_wizard import BaseWizard
from electrum_zeny.i18n import _
... |
global_key_listener.py | #!/usr/bin/env python
from evdev import InputDevice, list_devices, categorize, ecodes
import threading
def listen_for_events(dev):
for event in dev.read_loop():
if event.type == ecodes.EV_KEY:
print dev.name+" - "+dev.fn+": "+str(categorize(event))
print "This script grabs all the devices and... |
microphone.py | ###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: microphone.py
# Authors: Chris Lovett
#
# Requires: Python 3.x
#
############################################################################################... |
lang_handler.py | from simple_term_menu import TerminalMenu
import pyperclip
languages = {
"python": ["python", "py", "py3"],
"netcat": ["nc", "netcat"],
"bash": ["sh", "bash"],
"php": ["php"],
"ruby": ["ruby"],
}
def lang_handler(lang, option):
for key, values in languages.items():
for value in values... |
ssserver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
# Copyright (c) 2014 v3aqb
#
# 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... |
amqp_invoker.py | """Summary."""
import datetime
import logging
import signal
import socket
import threading
from contextlib import contextmanager
from typing import Callable, Dict
from urllib.parse import urlparse
import kombu
import kombu.exceptions
import kombu.message
from kombu.pools import producers
from ergo.function_invocable ... |
messagehandler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from HTTPWebSocketsHandler import HTTPWebSocketsHandler
'''
credits:
combined http(s) and websocket server copied from
https://github.com/PyOCL/httpwebsockethandler
The MIT License (MIT)
Copyright (c) 2015 Seven Watt
'''
import sys
import os
import queue
import copy
... |
controller.py | #!/usr/bin/env python
import rospy
import geometry_msgs.msg
import mavros_msgs.srv
import mavros_msgs.msg
import ursa.srv
import tf2_ros
import tf2_geometry_msgs
import threading
import nav_msgs.msg
setpoint = geometry_msgs.msg.TransformStamped()
takeOff=False
tf_buffer = tf2_ros.Buffer(rospy.Duration(10.0)) #tf buffe... |
raft.py | import json
import logging
import os
import threading
import time
from pysyncobj import SyncObj, SyncObjConf, replicated, FAIL_REASON
from pysyncobj.transport import TCPTransport, CONNECTION_STATE
from pysyncobj.utility import TcpUtility, UtilityException
from . import AbstractDCS, ClusterConfig, Cluster, Failover, L... |
edit.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
import simplejson as json
except ImportError:
import json
from threading import Thread
from django.db import models
from django.http import JsonResponse
from django.contrib import messages
from django.forms.models import model_to_dict, cons... |
main.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import threading
import time
from queue import Queue
import mlperf_loadgen as l... |
PlexConnect.py | #!/usr/bin/env python
"""
PlexConnect
Sources:
inter-process-communication (queue): http://pymotw.com/2/multiprocessing/communication.html
"""
import sys, time
from os import sep
import socket
from multiprocessing import Process, Pipe
from multiprocessing.managers import BaseManager
import signal, errno
import argp... |
main.py | import tkinter as tk
import threading
import sys
from tkinter import ttk
from tkinter import simpledialog
from page import Page
from homepage import Homepage
class Layout(tk.Frame):
def __init__(self, *args, **kwargs):
"""
This is initiation of Layout class which is main class of applicaction. It ... |
sapre280.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from os import system, name
import itertools
import threading
import time
import sys
import datetime
from base64 import b64decode,b64encode
from datetime import date
expirydate = datetime.date(2022, 1, 13 )
#expirydate = datetime.date(2021, 12, 30)
today=date.today()
def her... |
python_ls.py | # Original work Copyright 2017 Palantir Technologies, Inc. (MIT)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file exc... |
models.py | # -*- coding: utf-8 -*-
"""
Data models for the Deis API.
"""
from __future__ import unicode_literals
import base64
from datetime import datetime
import etcd
import importlib
import logging
import re
import time
from threading import Thread
from django.conf import settings
from django.contrib.auth import get_user_mo... |
xla_client_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 applica... |
test_system.py | import json
import operator
import os
import subprocess
import tempfile
import threading
import time
from typing import Dict, Set
import botocore.exceptions
import numpy as np
import pytest
import yaml
from determined.common import check, storage
from determined.experimental import Determined, ModelSortBy
from tests ... |
gpu_sampler.py | import ctypes
import multiprocessing as mp
import psutil
import torch
from rlpyt.agents.base import AgentInputs
from rlpyt.samplers.async_.action_server import AsyncActionServer
from rlpyt.samplers.async_.base import AsyncParallelSamplerMixin
from rlpyt.samplers.async_.collectors import DbGpuResetCollector
from rlpyt... |
discovery.py | '''
discovery.py
ancilla
Created by Kevin Musselman (kevin@frenzylabs.com) on 01/14/20
Copyright 2019 FrenzyLabs, LLC.
'''
import time
import uuid
from threading import Thread
import threading
import zmq
# from zmq.eventloop.ioloop import PeriodicCallback
from zmq.eventloop.zmqstream import ZMQStream
from tor... |
base_tcp.py | import socket, threading
import numpy as np
import time
from ..import_basic_utils import *
from .base import BasObj
def recvall(sock, count):
buf = b''
while count:
newbuf = sock.recv(count)
if not newbuf: return None
buf += newbuf
count -= len(newbuf)
return buf
def send_r... |
exported-sql-viewer.py | #!/usr/bin/env python2
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.