repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
neo4j/neo4j-python-driver
tests/unit/test_driver.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 #...
neo4j/neo4j-python-driver
tests/unit/test_addressing.py
<gh_stars>100-1000 #!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 ...
neo4j/neo4j-python-driver
tests/unit/work/test_transaction.py
<filename>tests/unit/work/test_transaction.py #!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
neo4j/neo4j-python-driver
neo4j/api.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 #...
neo4j/neo4j-python-driver
tests/unit/io/test_neo4j_pool.py
<gh_stars>100-1000 #!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 ...
Fethbita/flask-mongoengine
flask_mongoengine/sessions.py
"""MongoDB Session Interface""" import typing as t from datetime import datetime, timedelta import uuid from bson.tz_util import utc from flask.sessions import SessionInterface, SessionMixin from werkzeug.datastructures import CallbackDict # Type checking if t.TYPE_CHECKING: from flask.app import Flask from f...
vinnyotach7/RBAC-APP
constants.py
<gh_stars>0 from PyInquirer import prompt, Separator questions = [ { 'type': "input", "name": "userName", "message": "Enter a UserName", }, { 'type': 'checkbox', 'message': 'Select roles', 'name': 'roles', 'choices': [ Sepa...
vinnyotach7/RBAC-APP
entities/user.py
<reponame>vinnyotach7/RBAC-APP<filename>entities/user.py<gh_stars>0 class User(): def __init__(self,username,role): self.username = username self.role = role def get_username(self): return self.username def set_username(self,value): self.__username=value d...
vinnyotach7/RBAC-APP
entities/roles.py
<reponame>vinnyotach7/RBAC-APP<gh_stars>0 class Roles: def __init__(self,type,role): self.__validRole = ['User','Admin','Viewer'] @username.setter def username(self,type): if type not in self.__validRole: raise Exception('User type not allowed') #self.role=
vinnyotach7/RBAC-APP
main.py
<reponame>vinnyotach7/RBAC-APP from cmd import Cmd from BaseUser.createBaseUser import createBaseUser from entities.user import User from PyInquirer import prompt from examples import custom_style_2 from prompt_toolkit.validation import Validator, ValidationError from constants import questions,viewQuestions,del...
vinnyotach7/RBAC-APP
BaseUser/createBaseUser.py
<filename>BaseUser/createBaseUser.py from entities.user import User class createBaseUser: """def createBaseUser(self): user = {} user['User1']='Admin' return user""" superAdminActions = ['read','write','delete'] adminActions = ['read','write'] devActions = ['read'] u...
dominikheinisch/pybitbay
setup.py
<gh_stars>0 from setuptools import setup, find_packages setup( name="pybitbay", version="0.0.1", description="python api for bitbay cryptocurrency exchange", author="<NAME>", author_email="<EMAIL>", url="https://github.com/dominikheinisch/pybitbay", license='Apache 2.0', packages=find_p...
dominikheinisch/pybitbay
test/test_bitbay.py
<reponame>dominikheinisch/pybitbay import pytest import pandas as pd from pybitbay import BitBayAPI TICKER = 'btcpln' JSON_DATA = [ {"date": 1396094988, "price": 4500.0, "type": "buy", "amount": 0.0129, "tid": "0"}, {"date": 1396096603, "price": 4400.0, "type": "sell", "amount": 0.011364, "tid": "1"}, ] COLU...
dominikheinisch/pybitbay
pybitbay/bitbay.py
import pandas as pd from requests import Session from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from typing import Generator class BitBayAPI: BASE_URL = 'https://bitbay.net/API/Public/' TRADES_SUFFIX = '/trades.json' SINCE_SUFFIX = '?since=' def __ini...
dominikheinisch/pybitbay
pybitbay/__init__.py
<reponame>dominikheinisch/pybitbay<gh_stars>0 from pybitbay.bitbay import BitBayAPI __all__ = ['BitBayAPI']
Narasimha-sai/eth-provider-benchmark
config.py
import sys from multiprocessing import Lock ITERATIONS = 457 DELAY = 5 VERBOSE = False STDIN = sys.stdin.fileno() LOCK = Lock()
Narasimha-sai/eth-provider-benchmark
provider_benchmark.py
from multiprocessing import Process from web3 import Web3 import argparse import random import log_consistency import pending_transactions import sys import config def parseArgs(): parser = argparse.ArgumentParser() parser.add_argument('-i', action='store', dest='infura_api_key', help='test Infura with your u...
Narasimha-sai/eth-provider-benchmark
pending_transactions.py
import time import random import urllib, json from web3 import Web3 from multiprocessing import Process import provider_benchmark import eth_accountz import os import sys import config def transactionsTest(web3, company): transactionNotFound = 0 config.LOCK.acquire() sys.stdin = os.fdopen(config.STDIN) ...
Narasimha-sai/eth-provider-benchmark
log_consistency.py
<reponame>Narasimha-sai/eth-provider-benchmark<gh_stars>10-100 import time from web3 import Web3 import provider_benchmark import config def logTest(web3, company): methodInconsitency = 0 getLogByHashFailure = 0 latestBlockFailure = 0 logsDic = {} for i in range(config.ITERATIONS): lat...
Narasimha-sai/eth-provider-benchmark
eth_accountz.py
class Account: def __init__(self, address, privateKey): self.address = address self.privateKey = privateKey
TerrenceAm22/DS-Unit-3-Sprint-3-Productization-and-Cloud
Sprint Challenge 3 Unit 3/aq_dashboard.py
<gh_stars>0 """OpenAQ Air Quality Dashboard with Flask.""" from flask import Flask, jsonify from flask_sqlalchemy import SQLAlchemy import openaq import requests """Create and configure an instance of the Flask application.""" APP = Flask(__name__) APP.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3' DB = S...
FlorianSchwendinger/pdfminer.six
tests/test_read_all.py
<reponame>FlorianSchwendinger/pdfminer.six #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Mar 21 11:34:19 2020 @author: florian """ from pdfminer import pdf # Read the document doc = pdf.read_all("../samples/cars.pdf") doc # Get elements doc.list_elements() # By default all elments are returned a...
FlorianSchwendinger/pdfminer.six
tests/test_layout.py
<reponame>FlorianSchwendinger/pdfminer.six<filename>tests/test_layout.py import unittest from pdfminer.layout import LTLayoutContainer, LAParams, LTTextLineHorizontal class TestGroupTextLines(unittest.TestCase): def test_parent_with_wrong_bbox_returns_non_empty_neighbour_list(self): """ LTLayoutC...
FlorianSchwendinger/pdfminer.six
pdfminer/pdf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Mar 21 08:46:25 2020 @author: florian This is copied from pdfmole (<https://github.com/FlorianSchwendinger/pdfmole>) from the file "pdfmole/inst/python/pdf2list.py". """ import os import json from pdfminer.pdfinterp import PDFResourceManager, PDF...
SynBioHub/Plugin-Visual-ProteinStructure
app.py
<gh_stars>0 from flask import Flask, request, abort import os import subprocess import sys import traceback import xml.etree.ElementTree as ET from flask.wrappers import Response sys.path.append("/usr/lib/python3/dist-packages") import pymol import urllib from prody import * app = Flask(__name__, static_...
khoih-prog/transformers
src/transformers/models/glpn/feature_extraction_glpn.py
<reponame>khoih-prog/transformers # coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. 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...
khoih-prog/transformers
src/transformers/models/resnet/modeling_resnet.py
<filename>src/transformers/models/resnet/modeling_resnet.py # coding=utf-8 # Copyright 2022 Microsoft Research, Inc. and The HuggingFace Inc. team. 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...
khoih-prog/transformers
src/transformers/models/realm/modeling_realm.py
# coding=utf-8 # Copyright 2022 The REALM authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
soerenbnoergaard/impulseresponder
impulseresponder.py
import matplotlib matplotlib.use("TkAgg") import numpy as np import tkinter as tk import sounddevice as sd import matplotlib.pyplot as plt from scipy import signal from tkinter import filedialog from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg def main(): # imp = ImpulseResponderSimulation(48000) ...
KosukeKamiya/datadog-zabbix-check
checks.d/zabbix_metrics.py
try: from datadog_checks.base import AgentCheck import urllib.request import json except ImportError: from checks import AgentCheck __version__ = "1.0.0" class HelloCheck(AgentCheck): def request(self,zabbix_api,req_data): req_header = { 'Content-Type': 'application/json-rpc'...
thocoo/gamma-desk
gdesk/panels/imgview/spectrogram.py
<filename>gdesk/panels/imgview/spectrogram.py import sys import numpy as np from ... import gui def spectrogram(arr, vertical=False, plot=True): """ Calculates the fullnoise, whitenoise and whiteness. and plot a spectrogram. https://www.emva.org/wp-content/uploads/EMVA1288-3.1a.pdf :...
thocoo/gamma-desk
gdesk/panels/console/consoleproxy.py
<reponame>thocoo/gamma-desk import sys import threading from ...core.gui_proxy import GuiProxyBase, StaticGuiCall, gui from ...core.shellmod import Shell class ConsoleGuiProxy(GuiProxyBase): category = 'console' opens_with = ['.py'] def __init__(self): pass def attach(...
thocoo/gamma-desk
gdesk/graphics/grid.py
<filename>gdesk/graphics/grid.py from qtpy import QtCore, QtGui, QtWidgets class yAxisLabel(QtWidgets.QGraphicsLineItem): def __init__(self, ticksX, ticksY, direction, parent=None, scene=None): super().__init__(parent=parent, scene=scene) self.direction = direction def createGrid(...
thocoo/gamma-desk
gdesk/dicttree/node.py
# -*- coding: utf-8 -*- from PySide2 import QtGui, QtCore, QtXml class Node(object): def __init__(self, name, parent=None): self._name = name self._parent = parent self._children = [] self._value = None if parent is not None: parent.addChild(self) def type...
thocoo/gamma-desk
gdesk/utils/funccom.py
"""Function tools.""" from types import CodeType, FunctionType def find_nested_func(parent, child_name, globs, closure=None): """ Find nested funcion. Return the function named <child_name> that is defined inside a <parent> function Returns None if nonexistent """ consts = parent.__code__...
thocoo/gamma-desk
gdesk/utils/__init__.py
<reponame>thocoo/gamma-desk<gh_stars>0 """A collections of utils.""" import sys from functools import reduce import numpy as np def new_id_using_keys(keys): """Find the lowest new id starting from already exisiting ids.""" keys = np.array(keys) if len(keys) == 0: return 1 keys.sort() np...
thocoo/gamma-desk
gdesk/core/comm_nonduplex.py
<filename>gdesk/core/comm_nonduplex.py # My alternative for multiprocessing Queues # The original multiprocessing.Queues with locks can only be # initialized to a process by inheritance # The shared locks are the problem # Because there are no locks, to be save # only a single writer and reader can use this queue impo...
thocoo/gamma-desk
gdesk/external/channel.py
import os import sys import threading import pathlib import pprint from multiprocessing import Process, Queue from .. import config, configure, gui configure(matplotlib={'backend':'svg'}) from .. import console from ..core.shellmod import Shell from ..core.tasks import ZmqQueues from ..core.tasks import CommQueues f...
thocoo/gamma-desk
gdesk/panels/dialog/__init__.py
from .proxy import DialogGuiProxy
thocoo/gamma-desk
gdesk/core/gui_proxy.py
<reponame>thocoo/gamma-desk<filename>gdesk/core/gui_proxy.py<gh_stars>0 import sys import threading from multiprocessing import Queue import functools import importlib import types import pickle import logging import pathlib import time import numpy as np from ..utils.funccom import find_nested_func from ..utils.imco...
thocoo/gamma-desk
gdesk/gcore/qgc.py
<gh_stars>0 """The Garbage Collector timer in the Qt Event Loop.""" import gc import sys from qtpy.QtCore import QObject, QTimer class QGarbageCollector(QObject): """ Disable automatic garbage collection and instead collect manually. Timeout every INTERVAL milliseconds. This is done to ensure that g...
thocoo/gamma-desk
gdesk/panels/imgview/quantiles.py
import numpy as np from .fasthist import hist2d stdquant = np.ndarray(13) stdquant[0] = (0.0000316712418331200) #-4 sdev stdquant[1] = (0.0013498980316301000) #-3 sdev stdquant[2] = (0.0227501319481792000) #-2 sdev stdquant[3] = (0.05) stdquant[4] = (0.1586552539314570000) #-1 sdev or lsdev stdquant[5] = (0.25) ...
thocoo/gamma-desk
gdesk/core/comm.py
<reponame>thocoo/gamma-desk import os import sys import queue import threading import collections import socket import json import multiprocessing import _multiprocessing import zmq zmq_context = zmq.Context() from .conf import config if sys.platform == 'win32': from .comm_nonduplex import NonDuplexQueue sen...
thocoo/gamma-desk
gdesk/dialogs/base.py
import ctypes import ctypes.wintypes from pathlib import Path from qtpy import QtCore, QtGui, QtWidgets from qtpy import PYSIDE, PYSIDE2, PYQT4, PYQT5 def using_pyside(): return PYSIDE or PYSIDE2 def using_pyqt(): return PYQT4 or PYQT5 LASTMAP = None class LASTINPUTINFO(ctypes.Structure): ...
thocoo/gamma-desk
gdesk/panels/scriptwiz/proxy.py
from ...core.gui_proxy import GuiProxyBase, StaticGuiCall, gui class ScriptWizardProxy(GuiProxyBase): category = 'scriptwiz' def __init__(self): pass def attach(self, gui): gui.script = self @StaticGuiCall def open(templateFile): """ ...
thocoo/gamma-desk
gdesk/live/manage.py
# This module contains a script manager which implements Matlab like live scripting # Support call of scripts which can be automatic reloaded without leaving the Python interpreter # The user can modify code in a script file # These script files will be reloaded based on modify time stamps # New compiled code is direct...
thocoo/gamma-desk
gdesk/ezdock/overlay.py
import collections import importlib import pprint import logging import pathlib from qtpy.QtWidgets import * from qtpy.QtCore import * from qtpy.QtGui import * from qtpy import QtCore, QtGui, QtWidgets from .. import gui, config from .laystruct import LayoutStruct from .dockwidgets import DockContainer, DockTab, Dock...
thocoo/gamma-desk
gdesk/ezdock/ezdock.py
<reponame>thocoo/gamma-desk<gh_stars>0 import collections import importlib import pprint import logging import sys from qtpy.QtWidgets import * from qtpy.QtCore import * from qtpy.QtGui import * from qtpy import QtCore, QtGui from .. import gui from ..panels.base import BasePanel from .laystruct import LayoutStruct...
thocoo/gamma-desk
gdesk/utils/ticks.py
import numpy as np def getOptimalMinimumSpacing(minVal, maxVal, scale=1): dif = abs(maxVal - minVal) if dif == 0: return 0 size = dif * scale # decide optimal minor tick spacing in pixels (this is just aesthetics) pixelSpacing = np.log(size+10) * 5 #pixelSpacing = np.log(size+10) * 2 ...
thocoo/gamma-desk
gdesk/dialogs/editpaths.py
<filename>gdesk/dialogs/editpaths.py import re import fnmatch import pathlib from qtpy import QtCore, QtGui, QtWidgets from .base import getMap class PathList(QtWidgets.QListWidget): def __init__(self, parent, paths): super().__init__(parent=parent) for item in paths: list_i...
thocoo/gamma-desk
gdesk/widgets/thumbs.py
from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtCore import Qt class Thumbs(QtWidgets.QListWidget): def __init__(self, parent): super().__init__(parent=parent) #self.setViewMode(QtWidgets.QListWidget.IconMode) self.setViewMode(QtWidgets.QListWidget.ListMode) self.setIconSize(...
thocoo/gamma-desk
gdesk/live/__version__.py
from .. import __version__, __version_info__ VERSION_INFO = __version__ VERSION = __version_info__
thocoo/gamma-desk
gdesk/panels/imgview/roi.py
# -*- coding: latin-1 -*- #------------------------------------------------------------------------------- # Name: imageport.roi # Purpose: Region of Interest # # Author: <NAME> # # Created: 01/08/2014 # Copyright: (c) <NAME> 2014 # Licence: <your licence> #------------------------------------...
thocoo/gamma-desk
gdesk/core/shellmod.py
import sys import os import threading import multiprocessing import builtins import logging import traceback import queue import subprocess import pprint import shlex import json import psutil import inspect import shlex from pathlib import Path from . import stdinout from .interpreter import QueueInterpreter from .st...
thocoo/gamma-desk
gdesk/dialogs/filterlist.py
import re import fnmatch from qtpy import QtCore, QtGui, QtWidgets class SelectionList(QtWidgets.QListWidget): def __init__(self, parent): super().__init__(parent=parent) class FilterList(QtWidgets.QDialog): def __init__(self, items, multiple=True, filter='*'): super().__init__(None) ...
thocoo/gamma-desk
gdesk/rectable/__init__.py
from .base import RecordTable
thocoo/gamma-desk
gdesk/panels/imgview/demosaic.py
<gh_stars>0 import numpy as np from scipy.ndimage.filters import convolve #https://github.com/colour-science def as_float_array(array): return array.astype('double') def masks_CFA_Bayer(shape, pattern='RGGB'): """ Returns the *Bayer* CFA red, green and blue masks for given pattern. Parameters --...
thocoo/gamma-desk
gdesk/panels/levels/__init__.py
<reponame>thocoo/gamma-desk from ... import config if config['qapp']: from .panel import LevelsPanel
thocoo/gamma-desk
gdesk/utils/imconvert.py
<filename>gdesk/utils/imconvert.py import numpy as np from qtpy import PYSIDE, PYSIDE2, PYQT4, PYQT5 from qtpy import QtGui, QtCore from .shared import SharedArray try: from .numba_func import map_values_mono, map_values_rgbswap, map_values_rgb, nb_float_offset_gain_gamma_8bit has_numba = True except: ...
thocoo/gamma-desk
gdesk/graphics/view.py
<filename>gdesk/graphics/view.py from qtpy import QtCore, QtGui, QtWidgets QtSignal = QtCore.Signal from .point import Point #Point = QtCore.QPointF class SceneView(QtWidgets.QGraphicsView): scaled = QtSignal(bool, bool) scale_ended = QtSignal(bool, bool) translated = QtSignal(bool, bool) translate...
thocoo/gamma-desk
gdesk/panels/cmdhist/panel.py
from qtpy import QtCore, QtGui, QtWidgets from ...dialogs.formlayout import fedit from ...panels.base import BasePanel from ... import gui class CmdHistTableModel(QtCore.QAbstractTableModel): def __init__(self): super().__init__() def rowCount(self, index): for row in gui.qapp.history...
thocoo/gamma-desk
gdesk/core/stdinout.py
import io import sys import threading import time import logging from logging.handlers import RotatingFileHandler from logging import StreamHandler, Handler from queue import Queue from .conf import config from .gui_proxy import gui sentinel = object() logger = logging.getLogger(__name__) streamhandler = None ESC =...
thocoo/gamma-desk
gdesk/utils/keypress.py
<gh_stars>0 import ctypes from ctypes import wintypes import time user32 = ctypes.WinDLL('user32', use_last_error=True) INPUT_MOUSE = 0 INPUT_KEYBOARD = 1 INPUT_HARDWARE = 2 KEYEVENTF_EXTENDEDKEY = 0x0001 KEYEVENTF_KEYUP = 0x0002 KEYEVENTF_UNICODE = 0x0004 KEYEVENTF_SCANCODE = 0x0008 MAPVK_VK_TO_VSC...
thocoo/gamma-desk
gdesk/ezdock/boxes.py
<reponame>thocoo/gamma-desk from qtpy import QtWidgets, QtCore, QtGui from qtpy.QtCore import Qt from .docks import DockBase class AreaSplitterHandle(QtWidgets.QSplitterHandle): def mouseDoubleClickEvent(self, event): self.parent().distributeWidgets() class DockBox(QtWidgets.QSplitter, Do...
thocoo/gamma-desk
gdesk/gcore/guiapp.py
<filename>gdesk/gcore/guiapp.py<gh_stars>0 import threading import sys, os import ctypes import logging import textwrap import pathlib import mmap import struct import threading import psutil from multiprocessing.connection import Pipe from multiprocessing.reduction import duplicate from qtpy import QtGui, QtWidgets,...
thocoo/gamma-desk
gdesk/utils/numba_func.py
import numpy as np import numba @numba.njit(cache=True) def bincount2d(array, minlength=65536): hist = np.bincount(array.ravel(), minlength=minlength) return hist @numba.njit(parallel=True, cache=True) def map_values_mono(source, target, mapvector): length = len(source) for i in ...
thocoo/gamma-desk
gdesk/utils/z_order.py
import ctypes GW_HWNDNEXT = 2 def get_windows(): '''Returns windows in z-order (top first)''' user32 = ctypes.windll.user32 lst = [] top = user32.GetTopWindow(None) if not top: return lst lst.append(top) while True: next = user32.GetWindow(lst[-1], GW_HWNDNEXT) if no...
thocoo/gamma-desk
gdesk/panels/imgview/fasthist.py
import sys import math import logging import numpy as np try: from ...utils import numba_func has_numba = True except: has_numba = False logger = logging.getLogger(__name__) def is_integer_num(n): if isinstance(n, int): return True if isinstance(n, float): return n.is_int...
thocoo/gamma-desk
gdesk/graphics/functions.py
import struct import numpy as np from qtpy import QtCore, QtGui Colors = { 'b': (0,0,255,255), 'g': (0,255,0,255), 'r': (255,0,0,255), 'c': (0,255,255,255), 'm': (255,0,255,255), 'y': (255,255,0,255), 'k': (0,0,0,255), 'w': (255,255,255,255), } def intColor(index, hues=9, values=1, m...
thocoo/gamma-desk
gdesk/panels/scriptwiz/examples/example_01/template.py
# https://palletsprojects.com/p/jinja/ # Jinja2 is a full-featured template engine for Python # Using it here to template Python code def func1(): grabs = len(idminst.grabber.keys()) {% for row in tabulated_items -%} print('{{row.name}}', '{{row.value}}') {% endfor %} def main(caller_argument): p...
thocoo/gamma-desk
gdesk/dialogs/colormap.py
from qtpy import QtGui, QtWidgets, QtCore from ..widgets.thumbs import Thumbs from ..utils import imconvert class ColorMapDialog(QtWidgets.QDialog): def __init__(self): super().__init__() colormaps = imconvert.colormaps self.thumbs = Thumbs(self) for cm_name in colorma...
thocoo/gamma-desk
gdesk/utils/names.py
""" Provide OrderedStruct and DictStruct classes. Also, provide two utility functions: current_code_path() and force2bytes(). """ import os, sys import collections from pathlib import Path def current_code_path(): """ Return the path of the caller's source code file. If the caller is the shell (interac...
thocoo/gamma-desk
gdesk/rectable/utils.py
import numpy as np from .base import RecordTable def compare(table1, table2, value_column_name, index_column_name=None): if index_column_name is None: valcol1 = table1.sa[value_column_name] valcol2 = table2.sa[value_column_name] difflocs = np.where(valcol1 != valcol2) difftable =...
thocoo/gamma-desk
gdesk/gcore/utils.py
""" Small utils directly related to QT """ import collections from pathlib import Path from qtpy import QtWidgets from .. import config respath = Path(config['respath']) def relax_menu_text(text): """Remove any &, lower case, stop at first \\t""" tmp = text.replace('&', '').lower() tabind = tmp.find('\t'...
thocoo/gamma-desk
gdesk/panels/imgview/operation.py
import os import time import collections from pathlib import Path import types from collections.abc import Iterable import queue import logging import numpy as np logger = logging.getLogger(__name__) from ... import config, gui if config.get('qapp', False): #only import qt stuff if process is gui from ...pa...
thocoo/gamma-desk
gdesk/console.py
""" Gamma Desk interface to the DOS console """ import sys import os import logging import argparse from pathlib import Path from . import __release__, refer_shell_instance from . import configure, config, DOC_HTML, PROGNAME from .core import conf logger = logging.getLogger(__name__) boot_handler = logging.StreamHan...
thocoo/gamma-desk
gdesk/core/conf.py
import os import sys import time import collections from pathlib import Path import json import importlib import copy import re import logging logger = logging.getLogger(__name__) global config config = dict() config_objects = dict() configured = False here = Path(__file__).parent.absolute() FIRST_CONFIG_FILE = he...
thocoo/gamma-desk
gdesk/panels/console/consolepanel.py
import os import textwrap import psutil import time import logging from pathlib import Path from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtCore import Qt, QTimer, QSize from qtpy.QtGui import QFont, QFontMetrics, QTextCursor, QTextOption, QPainter, QTextCharFormat from qtpy.QtWidgets import (QAction, QMainWind...
thocoo/gamma-desk
gdesk/panels/html/__init__.py
<gh_stars>0 from .proxy import HtmlGuiProxy from ... import config if config['qapp']: from .panel import HtmlPanel
thocoo/gamma-desk
gdesk/ezdock/laystruct.py
import logging logger = logging.getLogger(__name__) class LayoutStruct(object): def __init__(self): self.root = dict() self.tabblock = True #Don't split inside tabs, go back one level def insert_panel(self, panel, relation='right', to_panel=None, size=100): category, panid = panel ...
thocoo/gamma-desk
gdesk/panels/matplot/plotproxy.py
import pickle import pylab from ...core.gui_proxy import GuiProxyBase, StaticGuiCall, gui class FigureBox(object): def __init__(self, figure): self.figure = figure def __getstate__(self): state = dict() mgr = self.figure.canvas.manager self.figure.canvas.manager = Non...
thocoo/gamma-desk
gdesk/panels/imgview/imgdata.py
import pathlib import collections import queue import threading import math from qtpy import QtGui, QtCore from qtpy.QtGui import QImage import numpy as np from ... import gui, config from ...utils.shared import SharedArray from ...utils import imconvert from .dimensions import DimRanges from . import fasthist he...
thocoo/gamma-desk
gdesk/live/__main__.py
<reponame>thocoo/gamma-desk from . import console if __name__ in ["__main__", "__mp_main__"]: ws = console.argexec()
thocoo/gamma-desk
gdesk/panels/html/proxy.py
<filename>gdesk/panels/html/proxy.py from ...core.gui_proxy import GuiProxyBase, StaticGuiCall, gui class HtmlGuiProxy(GuiProxyBase): category = 'html' def __init__(self): pass def attach(self, gui): gui.html = self @StaticGuiCall def show(html_content...
thocoo/gamma-desk
test/start_gdesk_as_child.py
<filename>test/start_gdesk_as_child.py import sys import pprint if __name__ == '__main__': pprint.pprint(sys.path) from gdesk.external import channel channel.start_gui_as_child()
thocoo/gamma-desk
gdesk/panels/cmdhist/proxy.py
from ...core.gui_proxy import GuiProxyBase, StaticGuiCall, gui class CmdHistGuiProxy(GuiProxyBase): category = 'cmdhist' def __init__(self): pass def attach(self, gui): gui.cmdhist = self
thocoo/gamma-desk
gdesk/panels/imgview/proxy.py
<filename>gdesk/panels/imgview/proxy.py import platform import numpy as np import logging from pathlib import Path logger = logging.getLogger(__name__) from ...core.gui_proxy import GuiProxyBase, StaticGuiCall from ... import gui, config from ...utils.shared import SharedArray class ImageGuiProxy(GuiProxyBas...
thocoo/gamma-desk
gdesk/dialogs/about.py
""" The About window of this GUI """ import pathlib from qtpy import QtGui, QtWidgets from qtpy.QtCore import Qt from .. import config, __version__, __release__, PROGNAME respath = pathlib.Path(config['respath']) class TextEditLinks(QtWidgets.QTextBrowser): """ QTextBrowser used to show clickable links ...
thocoo/gamma-desk
gdesk/panels/cmdhist/__init__.py
<reponame>thocoo/gamma-desk<gh_stars>0 from .proxy import CmdHistGuiProxy from ... import config if config['qapp']: from .panel import CmdHistPanel
thocoo/gamma-desk
gdesk/core/interpreter.py
<gh_stars>0 import sys import io import os import traceback import queue import ctypes import time import threading import multiprocessing import builtins import psutil import logging import inspect import cProfile import pstats from queue import Queue from codeop import CommandCompiler from datetime import timedelta f...
thocoo/gamma-desk
gdesk/panels/levels/panel.py
<gh_stars>0 import pathlib import numpy as np from qtpy import QtCore, QtGui, QtWidgets from ... import config, gui from ...graphics.view import SceneView from ...graphics.items import createCurve, Indicator from ...graphics.rulers import TickedRuler, Grid from ...graphics.point import Point from ..base import Base...
thocoo/gamma-desk
gdesk/core/tasks.py
import sys, io, os, builtins import json import signal import traceback import threading import multiprocessing import textwrap import types import pathlib import time import pickle import configparser import time import collections import platform import logging from multiprocessing import Process, Lock from queue imp...
thocoo/gamma-desk
gdesk/ezdock/docks.py
<reponame>thocoo/gamma-desk<gh_stars>0 class DockBase(object): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def get_container(self): candidate = self #TO DO, I can not import DockContainer here because it would cause circular imports #while not ...
thocoo/gamma-desk
gdesk/panels/imgview/profile.py
import math import numpy as np from qtpy import QtCore, QtGui, QtWidgets from ...graphics.plotview import PlotView from ...graphics.rulers import TickedRuler, Axis from ...graphics.functions import arrayToQPath from ...graphics.items import createCurve from ...utils.ticks import tickValues class ProfileGraphicView(...
thocoo/gamma-desk
test/setup/test_gdesk.py
<filename>test/setup/test_gdesk.py from gdesk import gui, config, __version__ gui.qapp.panels.ezm.set_perspective(config['layout']['image, levels & console']) panid = 1 panel = gui.qapp.panels['console'][panid] panel.stdio.stdOutputPanel.addText('This is the start-up banner, before thread is started\n') test_code_1 ...
thocoo/gamma-desk
gdesk/gcore/threadcom.py
import sys import threading import logging from queue import Queue from qtpy.QtCore import QObject, QMetaObject, Slot, Qt from qtpy.QtWidgets import QWidget class ReturnLock: """ Lock and return value object used to pass the return value on SignalCalls. """ def __init__(self): self.lock = th...
thocoo/gamma-desk
gdesk/panels/dialog/proxy.py
<gh_stars>0 import pathlib from functools import wraps from ... import config if config.get('qapp', False): #Do not import anything from Qt if not needed !!! #Causes crach in Canvas ! from qtpy import QtWidgets from ...dialogs import formlayout from ...dialogs import base as dialogs from ....
thocoo/gamma-desk
gdesk/dialogs/filedialog.py
from qtpy import QtCore, QtGui, QtWidgets class FileDialog(QtWidgets.QDialog): def __init__(self): super().__init__() self.initUI() def initUI(self): vbox = QtWidgets.QVBoxLayout() self.setLayout(vbox) hbox = QtWidgets.QHBoxLayout() vbox.addLayout(hbox...
thocoo/gamma-desk
gdesk/utils/ansi_code_processor.py
<gh_stars>0 """ Utilities for processing ANSI escape codes and special ASCII characters. """ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- import sys # Standard library imports from collections im...
thocoo/gamma-desk
gdesk/panels/matplot/__init__.py
from ... import config if config['qapp']: from .plotpanel import PlotPanel from .plotproxy import PlotGuiProxy