source
stringlengths
3
86
python
stringlengths
75
1.04M
MultiProcessManager.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 the License ...
eeg.py
""" Abstraction for the various supported EEG devices. 1. Determine which backend to use for the board. 2. """ import os, sys import time from time import sleep from multiprocessing import Process import numpy as np import pandas as pd from brainflow import BoardShim, BoardIds, BrainFlowInputParams from m...
__init__.py
import abc import os from multiprocessing import Process, Queue class AbcDataPipeline(metaclass=abc.ABCMeta): @abc.abstractmethod def execute(self): raise NotImplementedError class TaskPipelineBase(AbcDataPipeline): name = '单任务处理' def __init__(self, in_data_path, out_data_path, process_num...
keepalive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "" def run(): app.run(host ='0.0.0.0', port = 8080) def keepalive(): t = Thread(target = run) t.start()
mtserver.py
""" Multithreaded Hello World server Author: Guillaume Aubert (gaubert) <guillaume(dot)aubert(at)gmail(dot)com> """ import time import threading import zmq def worker_routine(worker_url, context=None): """Worker routine""" context = context or zmq.Context.instance() # Socket to talk to dispatcher...
test_buffered_producer.py
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
generate_breakpad_symbols.py
#!/usr/bin/env python # Copyright 2013 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. """A tool to generate symbols for a binary suitable for breakpad. Currently, the tool only supports Linux, Android, and Mac. Support f...
views.py
from django.http import HttpResponse from django.shortcuts import render from .models import * from .forms import * from datetime import datetime, timedelta, timezone from django.conf import settings import json, os, socket, uuid, threading from .result_name import * # Create your views here. def_limit=100 timestamp=0 ...
tpu_estimator.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...
node.py
#!/usr/bin/env python3 # # (C) Copyright 2020 Hewlett Packard Enterprise Development LP. # Licensed under the Apache v2.0 license. # import re import os import sys import json import glob import copy import time import shutil import select import socket import random import itertools from threading import Thread from...
generate_default_phases.py
#!/usr/bin/python # coding=UTF-8 # ex:ts=4:sw=4:et=on # Copyright (c) 2013, Mathijs Dumon # All rights reserved. # Complete license can be found in the LICENSE file. import os from pyxrd.data import settings from pyxrd.project.models import Project from pyxrd.phases.models import Component, Phase def generate_expan...
njrat.py
#!/usr/bin/env https://github.com/Tandelajr/mr.tandela # MIT License # # Copyright (C) 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 re...
test_session.py
from cherrypy.test import test test.prefer_parent_path() import os localDir = os.path.dirname(__file__) import sys import threading import time import cherrypy from cherrypy.lib import sessions def setup_server(): class Root: _cp_config = {'tools.sessions.on': True, 'tools...
pb_module.py
import logging from threading import Thread from time import sleep import struct from typing import List import isotp from can.interfaces.socketcan import SocketcanBus from module_manager import ModuleManager from pb_did import PlaybackDID from config.configuration import Configuration from exceptions import Failed...
test_proxy.py
import time import unittest from multiprocessing import Process from pipeproxy.lib.proxyListener.proxyListener import ProxyListener from pipeproxy import proxy from pipeproxy.lib.objectProxy.objectProxy import ObjectProxy from testObject import TestObject, UnpickleableTestObject def setParameterTest(testObje...
test_spark.py
import os import sys import time from typing import Iterator import threading from unittest import mock import numpy as np import pandas as pd import pytest import pyspark from pyspark.sql.types import ArrayType, DoubleType, LongType, StringType, FloatType, IntegerType from pyspark.sql.utils import AnalysisException ...
server.py
import socket import threading class Server: def __init__(self, ip, port): self.sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sck.bind((ip, port)) self.sck.listen() self.conCallback = None self.clientThrCallback = None self.disconCallback = None self.clients = { } self.nextClID = 0 def...
_refdaemon.py
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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....
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_dnotes import Wallet, WalletStorage from electrum_dnotes.util import UserCancelled, InvalidPassword from electrum_dnotes.base_wizard import BaseWizard, HWD_SETUP_DEC...
resize_particles.py
""" Script for resizing (upsizing) already reconstructed particles, the resizing can be selective so its allow to mix particles with different pixel sizes. Input: - STAR file with next columns: '_rlnMicrographName': tomogram that will be used for reconstruction '_rlnImageN...
scheduled_jobs_runner.py
# # Run all scheduled jobs # # Intended to run continously and will never exit. Will, however, # crash on database loss for example, so should be run from an init # handler that automaticaly restarts (after some delay) # from django.core.management.base import BaseCommand, CommandError from django.core.management impo...
funcs.py
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu" __license__ = "MIT" import os import stat import time import queue import threading as mt import subprocess import radical.utils as ru from ... import states as rps from ... import constants as rpc from .. import LaunchMethod from .base ...
testing.py
# from tkinter import * # from tkinter.ttk import Progressbar # import time # import threading # ws = Tk() # ws.title('PythonGuides') # ws.geometry('400x200') # ws.config(bg='#345') # def start_download(): # print("START") # time.sleep(5) # pb.start() # def stop_download(): # print("STOP") # ...
dist_allreduce.py
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import pydoop.hdfs import subprocess import os import stat import sys import threading import t...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import threading import time import random from test import support from test.support import script_helper, ALWAYS_EQ # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None #...
tuner.py
import threading import datetime from fHDHR.exceptions import TunerError class Tuner(): """ fHDHR Tuner Object. """ def __init__(self, fhdhr, inum, epg, origin_name): self.fhdhr = fhdhr self.number = inum self.origin_name = origin_name self.epg = epg self.tu...
repairmanager.py
#!/usr/bin/env python3 import argparse import collections import datetime import logging import os import prometheus_client import requests import threading import time import urllib.parse import yaml from flask import Flask, Response from flask_cors import CORS from logging import handlers from prometheus_client.cor...
main.py
import random import time import sys import signal import json import uuid import cloudpickle import base64 import socket from multiprocessing.connection import Listener from multiprocessing.connection import Client from threading import Thread class HiveMindBase(): #get a reply def reply(self, cmdid, *args): #re...
io.py
"""Data iterators for common data formats.""" from __future__ import absolute_import from collections import OrderedDict, namedtuple import sys import ctypes import logging import threading import numpy as np from .base import _LIB from .base import c_array, c_str, mx_uint, py_str from .base import DataIterHandle, NDA...
rlock.py
''' Date: 2021.06.01 11:10 Description : Omit LastEditors: Rustle Karl LastEditTime: 2021.06.01 11:10 ''' import threading import time class Box(object): lock = threading.RLock() def __init__(self): self.total_items = 0 def execute(self, n): Box.lock.acquire() s...
killer.py
#!/usr/bin/env python # coding: UTF-8 import socket import struct import subprocess import sys from telnetlib import Telnet from shellcraft import * class Remote(object): def __init__(self, ip_addr, port): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(2.0) ...
client.py
"""Instances of this class handle authorizing and talking to Google Healthcare API FHIR Service.""" import logging import threading from urllib.parse import urlparse from fhirclient import client from fhirclient.models.meta import Meta from fhirclient.models.bundle import Bundle from anvil.fhir.smart_auth import Goo...
update.py
import tkinter as tk import tkinter.ttk as ttk from tkinter.scrolledtext import ScrolledText from tkinter import messagebox as msgbox import gettext import os import queue as q import requests as req import zipfile as zf import sys import threading from time import sleep from packaging import version from ruamel.yaml i...
RestAPI.py
import eventlet from flask import Flask, request, jsonify, session from flask_sqlalchemy import SQLAlchemy from flask_socketio import SocketIO, emit from flask_httpauth import HTTPTokenAuth from flask_login import current_user, LoginManager import threading from functools import wraps from lxml import etree from FreeTA...
dnSense.py
#!/usr/bin/python3 import argparse import bisect import collections import datetime import dns.resolver as dr # From 'dnspython' import IPy import sys import threading import time parser = argparse.ArgumentParser(description='Preventative treatment for DNS Cache Snooping') parser.add_argument('-r', metavar='RESOLVE...
main.py
from ocr import OCR from image_preprocessing import img_preprocessing from analyse import get_personal_info, get_tumor_info import multiprocessing from parameters import pyteseract_path import pytesseract def do_ocr(ocr_type, pre_processed_image, return_dict): ocr = OCR() ocr_text = ocr_type(pre_pro...
downloadVideo.py
from pytube import YouTube import pathlib from . import downloadEssential from threading import Thread class DownloadVideo(): def __init__(self, link) -> None: self.video = YouTube(link) Thread(target=self.download).start() def download(self): print("Download iniciado!") self.s...
benchmark-env-multiprocess.py
# Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import time import os import multiprocessing as mp import argparse import numpy as np import random from House3D import objrender fr...
test_asyncore.py
import asyncore import unittest import select import os import socket import threading import sys import time import errno from test import test_support from test.test_support import TESTFN, run_unittest, unlink from StringIO import StringIO HOST = test_support.HOST class dummysocket: def __init...
train.py
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.misc import set_random_seed from onmt.utils.logging import init_logger, logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentPa...
bridge.py
#!/usr/bin/env python # # Copyright (c) 2018-2019 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # """ Rosbridge class: Class that handle communication between CARLA and ROS """ try: import queue except ImportError: impor...
client.py
''' Copyright (c) 2014, alumae All rights reserved. ''' __author__ = 'tanel' import argparse from ws4py.client.threadedclient import WebSocketClient import time import threading import sys import urllib import Queue import json import time import os def rate_limited(maxPerSecond): minInterval = 1.0 / float(maxPer...
chatServerApp.py
################################################ ################################################ ################################################ #########*******###*******####**********######## ########**#####**#**#####**###**######**######## ########**#####**#**#####**###**######**######## ########**#####**#**...
blastdbget.py
""" Downloads listed databases to the output folder, validates downloads using md5, and extracts .tar.gz files. """ from __future__ import print_function import argparse import fileinput import ftplib import hashlib import itertools import logging import os import re import shutil import socket import sys import tarf...
load_full_dataset.py
""" Module for loading datasets """ import os import sys import threading from collections import defaultdict, OrderedDict from functools import reduce from os.path import join import h5py import numpy as np import scipy as sp from PIL import Image from tensorflow.contrib.learn.python.learn.datasets.mnist import read...
server.py
import ctypes import threading from jsonrpc import JSONRPCResponseManager, dispatcher @ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_char_p) def recv_handler(handler, data): request = data.decode('utf-8').strip() response = JSONRPCResponseManager.handle(request, dispatcher) print('=' * 50) print('R...
Jefe.py
#!/usr/bin/python # -*- coding: utf-8 -*- from threading import Semaphore, Thread from core.Conexion import Conexion from core.Trabajador import Trabajador from time import time from datetime import datetime from random import randint from time import sleep class Jefe: def __init__(self,log,max_workers): se...
trt_ssd_async.py
"""trt_ssd_async.py Thread to read camera input Thread to drawing detection results / displaying video TODO Start working on dual camera input """ import time import argparse import threading import collections import cv2 import pycuda.driver as cuda from utils.ssd_classes import get_cls_dict from utils.ssd impor...
read_comm.py
#!/usr/bin/env python import sys import threading import time import select # for event-control the serial communication with the XBee # NOTE: NOT WORKING ON WINDOWS!! import XBee_API # authorship info __author__ = "Francesco Vallegra" __copyright__ = "Copyright 2017, MIT-SUTD" __license__ = "MIT"...
test_worker.py
from __future__ import unicode_literals import threading from channels import DEFAULT_CHANNEL_LAYER, Channel, route from channels.asgi import channel_layers from channels.exceptions import ConsumeLater from channels.signals import worker_ready from channels.tests import ChannelTestCase from channels.worker import Wor...
get_seccodes.py
# coding=utf-8 import urllib2 import threading from conf import DATA_RAW __author__ = 'zephor' url = 'http://weixin.sogou.com/antispider/util/seccode.php' N = 299 L = threading.Lock() def get_num(): global N L.acquire() try: N += 1 return N finally: L.release() def fetch(l...
netscan.py
#!/usr/bin/env python3 ############################################################################### # Name : netscan.py # # Author : Abel Gancsos # # Version : v. 1.0.0.0 ...
receiver.py
#!/usr/bin/env python3 import termios import sys import tty import rospy import socket import pickle import base64 import select import time from threading import Thread from udp_bridge.aes_helper import AESCipher class UdpReceiver: def __init__(self): port = rospy.get_param("udp_bridge/port") ros...
test_state.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import os import shutil import threading import time import logging # Import Salt Testing Libs from tests.support.runtests import RUNTIME_VARS from tests.support.case import SSHCase from tests.support...
ticker.py
"""PgQ ticker. It will also launch maintenance job. """ import sys, os, time, threading import skytools from maint import MaintenanceJob __all__ = ['SmartTicker'] def is_txid_sane(curs): curs.execute("select txid_current()") txid = curs.fetchone()[0] # on 8.2 theres no such table if not skytools.e...
wenku8toepub.py
import requests import bs4 from bs4 import BeautifulSoup as Soup from ebooklib import epub import os import sys import getopt from base_logger import getLogger import threading import io import copy import re class MLogger: def __init__(self): self.data = io.StringIO() def write(self, content: str): ...
irc.py
# Copyright 2010 Alon Zakai ('kripken'). All rights reserved. # This file is part of Syntensity/the Intensity Engine, an open source project. See COPYING.txt for licensing. import random, threading from intensity.base import * from intensity.logging import * from intensity.signals import text_message, shutdown, clie...
callbacks.py
import asyncio import functools import threading import weakref from _weakref import ReferenceType from concurrent.futures import Future from typing import Optional, Callable, Any, Tuple, List, Union, Dict from streamlit import StopException, experimental_rerun from streamlit.report_session import ReportSession, Repor...
botMultiProcess.py
''' 多线程瞄准-射击代码 ''' from __future__ import absolute_import #绝对引用 from __future__ import division from __future__ import print_function import numpy as np import mss import time import multiprocessing from multiprocessing import Pipe from win32dll_input import Mouse from input_controller import InputController, MouseBu...
road_runner.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os, sys, json from threading import Thread try: from urllib2 import urlopen from Queue import Queue except ImportError: from urllib.request import urlopen from queue import Queue ''' World road map generation script. It takes city points from omim intermediate ...
server.py
import urllib.request #check if connected to the internet def connect(host='http://google.com'): try: urllib.request.urlopen(host) #Python 3.x return True except: return False if connect() == False: print('Not connected to the internet!!!') print('Exiting application.....') ...
main.py
import json import time import torch as t import torch.utils.data.dataloader as DataLoader import multiprocessing from model import dataloader_v2 as dataloader from model import Resnet from model import VoxNet_try as VoxNet from model import densenet from model.func import save_model, eval_model_new_thread, eval_mode...
test_sync.py
# test_sync.py # # Different test scenarios designed to run under management of a kernel from collections import deque from curio import * import pytest import threading import time # ---- Synchronization primitives class TestEvent: def test_event_get_wait(self, kernel): results = [] async def ...
stream.py
import sys import json import yaml import queue import signal import argparse import requests import numpy as np from pprint import pprint from datetime import datetime from multiprocessing import Queue from multiprocessing import Process from .helper import * from .listener import APIListener class StreamListener(AP...
__init__.py
import inspect import time import json import queue import re import os import math import types from threading import Thread, RLock from . import defaults from .sender import Sender from .worker import Worker from .error import ( SenderAlreadyStarted, NotInDefaultType, SettingError, TaskUnstopError )...
analyse.py
#!/usr/bin/env python3 # BSD 3-Clause License # # Copyright (c) 2016, 2017, The University of Sydney. 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 retai...
bugreports_tests.py
# -*- coding: utf-8 -*- import unittest import threading from holmium.core.facets import cookie, title, defer import os from selenium.webdriver.support.ui import Select import mock from holmium.core import Element, ElementEnhancer, Page, Locators, Elements from holmium.core import reset_enhancers, register_enhancer fr...
daemon.py
# # pysmsd.py # # Copyright 2010 Helsinki Institute for Information Technology # and the authors. # # Authors: Jani Turunen <jani.turunen@hiit.fi> # Konrad Markus <konrad.markus@hiit.fi> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated document...
test_config.py
import asyncio import copy import pytest import random import yaml from chives.util.config import create_default_chives_config, initial_config_file, load_config, save_config from chives.util.path import mkdir from multiprocessing import Pool from pathlib import Path from threading import Thread from time import sleep ...
ui.py
# -*- coding: utf-8 -*- from binascii import hexlify from math import sqrt from multiprocessing import Process, Queue from pkg_resources import resource_filename from PyQt4.QtCore import * from PyQt4.QtGui import * from .algorithm import * class Window(QWidget): def __init__(self, *args, **kwargs): sup...
client.py
import frame as fm import socket from settings import TYPE from threading import Thread, Timer, Event import time from frame import Frame # TODO: multi message sender should be implemented (now single) class Client(Frame): def __init__(self, addr, ID = ""): super(Client, self).__init__() self.sock...
__init__.py
import threading import os import pty def create_dummy_port(responses): def listener(port): # continuously listen to commands on the master device while 1: res = b'' while not res.endswith(b"\r"): # keep reading one byte at a time until we have a full line res += os.read(port, 1) print("command:...
test_units.py
#!/usr/bin/env python ''' test_units.py - some unit tests for parts of brozzler amenable to that Copyright (C) 2016-2017 Internet Archive 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:/...
mtime_file_watcher.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...
intervalrun.py
"""Killable interval function runner module Shares IntervalRunner which can be used to manage asynchronous activity. Uses files in flag directory to share state between processes. """ from multiprocessing import Process import time import json import os flag_file = '_timer_flag.json' flag_directory = 'timerflags' #...
sender.py
from asyncio import run_coroutine_threadsafe, sleep from codecs import encode from io import BytesIO from threading import Thread from discord import Client from config import CLOCK_CHANNEL, DATA_CHANNELS, SENDER_TOKEN buffer = BytesIO() buffer.seek(0) class WHGSender(Client): def __init__(self, buffer): ...
process_replay.py
#!/usr/bin/env python3 import importlib import os import sys import threading import time import signal from collections import namedtuple import capnp from tqdm import tqdm import cereal.messaging as messaging from cereal import car, log from cereal.services import service_list from common.params import Params from ...
editor.py
import wx import prefs import threading, tempfile, subprocess, os, re class Editor(wx.EvtHandler): def __init__(self, opts): wx.EvtHandler.__init__(self) self._id = wx.NewId() self.filetype = opts['filetype'] self.content = opts['content'] self.callback = opts...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import copy import errno import signal import socket import hashlib import logging import weakref import threading from random import randint # Im...
build_imagenet_data.py
# Copyright 2016 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...
report.py
import json import logging import threading import time import requests from datetime import datetime import random __author__ = 'Sumit_Nagal@intuit.com' logger = logging.getLogger(__name__) class Report(object): #################################### # Function definitions # ################...
loading.py
from typing import Dict, List, Callable, Tuple from enum import Enum import math import random import time from threading import Thread import pygame from pygame.locals import Rect from pygame.sprite import Sprite from stage import Stage from screen import Screen, BaseScreen from sprites import SimpleSprite, TextSpri...
SpikeSortProcessor.py
import logging import pickle import random import threading import time from multiprocessing import Event import numpy as np from pyneurode.processor_node.BatchProcessor import * from pyneurode.processor_node.FileReaderSource import FileReaderSource from pyneurode.processor_node.Processor import * from pyneurode.proce...
pinger.py
"""Pinging hosts""" import platform import subprocess import logging import threading import src.config as config from src.host import hosts ping_all_event = threading.Event() # Threading event for pinging all hosts def ping(host, count): """Ping IP address 'count' times""" ip_addr = str(host.ip) ver...
httpserver.py
### # Copyright (c) 2011, Valentin Lorentz # 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 retain the above copyright notice, # this list of conditi...
client.py
''' Function: 联机对战客户端 Author: Charles 微信公众号: Charles的皮卡丘 ''' import socket import pygame import random import threading from ..misc import * from PyQt5 import QtCore from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from itertools import product '''客户端''' class gobangClien...
dataset.py
# Copyright 2020 - 2021 MONAI Consortium # 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...
__main__.py
# coding: utf-8 import os import sys import time import socket import traceback import threading import subprocess from urllib.parse import unquote import getip import udpsend from lockfile import LockWait sys.PY3 = sys.version_info[0] > 2 __appname__ = "ean13" __version__ = '18.207.0950' #добавлена библиотека опред...
test_ffi.py
import sys, py from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC class Test__ffi(BaseTestPyPyC): def test__ffi_call(self): from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: from _rawffi.alt import CDLL, types ...
action.py
#!/usr/bin/env python # # License: BSD # https://raw.githubusercontent.com/splintered-reality/py_trees/devel/LICENSE # ############################################################################## # Documentation ############################################################################## """ Demonstrates the cha...
client.py
# -*- coding: utf-8 -*- import datetime import logging import socket from threading import Thread from time import sleep from urllib.parse import quote from mahjong.constants import DISPLAY_WINDS from mahjong.stat import Statistics from utils.settings_handler import settings from mahjong.client import Client from mahj...
server.py
import asyncio try: import ujson as json except ImportError: import json import os import threading import traceback import rethinkdb as r from flask import Flask, render_template, request, g, jsonify, make_response from dashboard import dash from utils.db import get_db, get_redis from utils.ratelimits impo...
fbchat-threading.py
# -*- coding: UTF-8 -*- from fbchat import Client from fbchat.models import * import threading # Subclass fbchat.Client and override required methods class PrintMessage(Client): def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs): self.markAsDelivered(thread_id, message_objec...
sf_infer.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...
char_test.py
# encodeing=utf8 str_test = '\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95' str_testu = u'\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95' print '{}'.format(str_test) print '{}'.format(str_testu.encode('raw_unicode_escape')) import urllib content = '&lt;msg&gt;<br/>&lt;op id=\'2\'&gt;<br/>&lt;username&gt;filehel...
server.py
from sixth import data_maker as asa import threading """change the port var if arduino is connected to another port""" port="COM3" a=asa(port) t1=threading.Thread(target=a.make) def get_data(): import requests url = "https://7676hssfl5.execute-api.us-east-2.amazonaws.com/beta/arduino-id" headers = { ...
backup.py
import os from shlex import quote from colorama import Fore import multiprocessing as mp from pathlib import Path from shutil import copyfile from .utils import * from .printing import * from .compatibility import * from .config import get_config def backup_dotfiles(backup_dest_path, dry_run=False, home_path=os.path....
sqliteq.py
import logging import weakref from threading import local as thread_local from threading import Event from threading import Thread try: from Queue import Queue except ImportError: from queue import Queue try: import gevent from gevent import Greenlet as GThread from gevent.event import Event as GEv...
facebook-scraping.py
from secrets import username, password from time import sleep from langdetect import detect from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options import requests import csv import json import multiprocessing class Faceb...
base.py
import base64 import hashlib import io import json import os import threading import traceback import socket import sys from abc import ABCMeta, abstractmethod from http.client import HTTPConnection from urllib.parse import urljoin, urlsplit, urlunsplit from .actions import actions from .protocol import Protocol, Base...