text stringlengths 12 6.59M |
|---|
version = "1.0.10.dev0"
|
"""
Copyright 2011 Ryan Fobel
This file is part of dmf_control_board.
dmf_control_board is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dm... |
# -*- coding: utf-8 -*-
import click
from urls import IMAGES
from base_request import DigitalOcean, print_table, CONTEXT_SETTINGS
@click.group()
def images_group():
"""
images command group
"""
pass
def validate(dic):
return True
def invoke_list(token, proxy, url):
method = 'GET'
url = url
result = Digit... |
from django.http import HttpResponse
import json, re
def xstr( s, none='' ):
return str(s) if s is not None else none
def xint( s, none=0, undefined=None ):
try:
if s == "undefined":
return undefined
return int(s) if s is not None and s != 'NaN' else none
except ValueError:
#Floating points ... |
from labeledarray.labeledarray import LabeledArray |
from binaryninja.architecture import Architecture
from binaryninja.lowlevelil import LowLevelILLabel, LLIL_TEMP, LowLevelILInstruction
from binaryninja.function import RegisterInfo, InstructionInfo, InstructionTextToken
from binaryninja.binaryview import BinaryView
from binaryninja.types import Symbol
from binaryninja.... |
# copyright Chad Dombrova chadd@luma-pictures.com
# created at luma pictures www.luma-pictures.com
"""
*******************************
PyMEL
*******************************
PyMEL makes python scripting in Maya work the way it should. Maya's command module is a direct
translation of MEL commands into ... |
import types
import xml.etree.cElementTree as ElementTree
import numpy as np
import Bio.SeqIO
import seqtools
# import refseq
# import sequtils
# import alignment
# import clustering
# import LSF
# import params
# import analysis
# ===================
# = DATA STRUCTURES =
# ===================
class ImmuneChain... |
from . import ann
from . import glideid
from . import utils
from . import visuals
from .analysis import Analysis
def create_project(path_project):
"""Generate project based on values in *d*."""
from collections import OrderedDict
import datetime
import importlib
import os
import shutil
impo... |
import numpy as np
import cv2
import os
try:
IMREAD_UNCHANGED = cv2.CV_LOAD_IMAGE_UNCHANGED
except AttributeError:
IMREAD_UNCHANGED = cv2.IMREAD_UNCHANGED
def init_cityscapes(cityscapes_root):
'''
Append the right paths to the sys paths in order to use the provided cityscapes scripts.
- `cityscap... |
#!/usr/local/bin/python -t -O
# $Id$
# A more complicated gnuplot interface.
# Written by Michael Haggerty <mhagger@blizzard.harvard.edu>
# Derived from earlier version by Konrad Hinsen <hinsen@ibs.ibs.fr>
# New features:
# + A gnuplot session is an instance of class `gnuplot', so multiple
# sessions can be op... |
#
# Copyright (c) 2004 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... |
bl_info = {
"name": "Sprytile Painter",
"author": "Jeiel Aranal",
"version": (0, 3, 8),
"blender": (2, 7, 7),
"description": "A utility for creating tile based low spec scenes with paint/map editor tools",
"location": "View3D > UI panel > Sprytile",
"wiki_url": "https://chemikhazi.github.io/... |
from flask import Flask
from flask import render_template, request
import passwd_gen
import github_verify
import code_deploy
app = Flask(__name__)
#This is a test
@app.context_processor
def utility_processor():
def get_pass():
return passwd_gen.generate_password()
return dict(get_pass=get_pass)
@a... |
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... |
'''
Dragon Radar -- create MKVs from R2 video and R1 audio/subs
'''
import os
import sys
import argparse
import configparser
import tempfile
import logging
import atexit
import colorama
import time
from constants import Constants
from episode import Episode
from utils import (get_op_offset,
pad_zeroe... |
#!/usr/bin/env python
import configparser
import os
import argparse
from studious import answer, question, user, version
if __name__ == "__main__":
# Config File for username, password? and settings
config = configparser.ConfigParser()
if not os.path.isfile('.studiousrc'):
config['USER'] = {'na... |
INSTALLED_APPS=(
'django.contrib.sessions',
'django.contrib.contenttypes',
'django.contrib.auth',
'django_autocomplete',
'django_autocomplete.tests',
)
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
}
SITE_ID = 303
DEBUG = True
TEMPLATE_DEBUG = DEBUG
SE... |
# Class Client shamelessly copied from
# http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars/2
import pycurl
import os,sys
#import simplejson as json
from optparse import OptionParser
import time
from datetime import datetime
import os
import gzip
import threa... |
# coding: utf-8
""" Code for helping to select stars from the nearby Sgr wraps. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import gc
# Third-party
import h5py
import numpy as np
import numexpr
import astropy.units as u
from as... |
# coding: utf-8
""" Code for helping to select stars from the nearby Sgr wraps. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import numpy as np
import numexpr
import astropy.units as u
from astropy.io import ascii
... |
import web
from config import setting
from datetime import datetime
import json
render = setting.render
db = setting.db
class add:
def POST(self):
""" add one """
ret = {}
data = web.input(_method="post")
id = db.insert("piece",content=data["content"],addtime=datetime.now(),link=No... |
from sfa.util.xrn import get_authority, urn_to_hrn
from sfa.util.sfalogging import logger
MAXINT = 2L**31-1
class SlabSlices:
rspec_to_slice_tag = {'max_rate':'net_max_rate'}
def __init__(self, driver):
self.driver = driver
def get_peer(self, xrn):
hrn, hrn_type ... |
"""
Public interface for the submissions app.
"""
import copy
import logging
import json
from collections import namedtuple
from django.conf import settings
from django.core.cache import cache
from django.db import IntegrityError, DatabaseError
from dogapi import dog_stats_api
from submissions.serializers import (
... |
"""
Isogeometric analysis utilities.
Notes
-----
The functions :func:`compute_bezier_extraction_1d()` and
:func:`eval_nurbs_basis_tp()` implement the algorithms described in [1].
[1] Michael J. Borden, Michael A. Scott, John A. Evans, Thomas J. R. Hughes:
Isogeometric finite element data structures based on Bezie... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import logging
import cymysql
import time
import sys
import socket
import config
import json
import collections
import sets
class DbTransfer(object):
instance = None
def __init__(self):
self.last_get_transfer = {}
self.traffic_logs = collections.defa... |
import os
import paramiko
import scp
from dcos import http
import shakedown
def get_transport(host, username, key):
""" Create a transport object
:param host: the hostname to connect to
:type host: str
:param username: SSH username
:type username: str
:param key: key obj... |
"""
Copyright (c) 2015-2019 Raj Patel(raj454raj@gmail.com), StopStalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
... |
debug_mode = False
from ballot import ballot2form, form2ballot, blank_ballot, \
sign, uuid, regex_email, unpack_results, rsakeys
def index():
return dict()
@auth.requires_login()
def elections():
response.subtitle = T('My Elections')
elections = db(db.election.created_by==auth.user.id).select(
... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from math import sin
from math import cos
from math import sqrt
from math import pi
from compas.geometry.basic import length_vector
from compas.geometry.basic import cross_vectors
from compas.geometry.basic im... |
# ------------------------------------------------------------
# MC911 - Compiler construction laboratory.
# IC - UNICAMP
#
# RA094139 - Marcelo Mingatos de Toledo
# RA093175 - Victor Fernando Pompeo Barbosa
#
# lyaparser.py
# Parser and AST builder for the Lya scripting language.
#
# ----------------------------------... |
#!/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: anag/lib.py
# Author: Fabio Cassini <fabio.cassini@gmail.com>
# Copyright: (C) 2011 Astra S.r.l. C.so Cavallotti, 122 18038 Sanremo (IM)
# ---------------------------... |
"""
Python code for calculating non-parametric morphological diagnostics
of galaxy images.
"""
# Author: Vicente Rodriguez-Gomez <vrg@jhu.edu>
# Licensed under a 3-Clause BSD License.
from __future__ import absolute_import, division, print_function
import warnings
import time
import numpy as np
import scipy.optimize a... |
import textwrap
import functools
import six
from lymph.core.decorators import rpc, RPCBase
from lymph.exceptions import RemoteError, EventHandlerTimeout, Timeout, Nack
from lymph.core.components import Component, Componentized, ComponentizedBase
from lymph.core.monitoring import metrics
import gevent
from gevent.eve... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csvkit
import os
import sys
import sqlite3
import datetime
import urllib, json
import time
import requests
import sqlite3
import yaml
# Load the config file.
config = yaml.safe_load(open('config.yml'))
if os.path.isfile(config['data_file']) is False:
print confi... |
from itertools import permutations, islice
import threading
import time
from math import factorial
def calcEvenPermutations(s,word_list,matches):
n = factorial(len(s))
for x in islice(permutations(s),0,n,2):
p = ''.join(x)
if(p in word_list and p != s):
matches.add(p)
return
def calcOddPermutation... |
import os
from . import reporting
from . import printer
from .dims import *
def create_section(title, desc, props, subsects, figures_list):
assert isinstance(title, str)
assert isinstance(desc, str)
assert isinstance(props, list)
assert isinstance(figures_list, list)
section = reporting.Section(t... |
"""
This is a naive implementation done without regard for time complexity.
Avoids use of libraries etc.
Directed acyclic word graph forthcoming
"""
import sys
import operator
import sets
import re
anagrams = []
def try_open(filename):
results = []
with open(filename) as fp:
wordlist = fp.readlines()
for word i... |
"""
The aim of this script is to visualize the data stored in the SQLite db from sims
The questions that this script should answer are:
1- list existing fields in the DB
2- list unique values in each field
3- count how many trials exist per triplet (duration, h, SNR)
4- for fixed triplet, compute the average differenc... |
#!/usr/bin/env python
#
# Test python-to-i2c bridge with STM32F407
#
import serial
import string
import sys
import re
class stm32f4bridge:
pinModes = {
'input': 'in',
'output': 'outpp',
'output-od': 'outod'
}
pullModes = {
'up': 'pullup',
'down': 'pulldown',
'none': 'nopull'
}
def __init__(self, se... |
# Copyright 2014
# The Cloudscaling Group, 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 ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import sys, syslog
# TODO: set this path via configure or something similar.
sys.path.append('/usr/local/lib/python2.3/site-packages/libavg')
sys.path.append('/usr/local/lib/python2.4/site-packages/libavg')
import avg
import time
import anim
class LoggerTestCa... |
# Utils.py
# Some tools.
from django.http import HttpResponse
from django.conf import settings
from django import http
from webengine.utils.exceptions import *
class _CheckRenderMode(object):
"""
Callable object that will act like a decorator.
Wraps calls to view methods.
Determine which ... |
import logging
logger = logging.getLogger(__name__)
def includeme(config):
logger.info('Adding login ...')
# Add all the rest api routes
config.add_route('session', '/session')
config.add_route('signin', '/signin')
config.add_route('signout', '/signout')
config.add_route('providers', '/provide... |
import asyncio
import fractions
import logging
import threading
import time
import av
from av import AudioFrame, VideoFrame
from ..mediastreams import (AUDIO_PTIME, VIDEO_TIME_BASE, MediaStreamError,
MediaStreamTrack)
logger = logging.getLogger('media')
async def blackhole_consume(track... |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
import logging
import sys
import os
import io
import math
import weakref
from array import array
from struct import Struct
import struct
from collections import deque
from .utils import (
read_u8, read_u16... |
#!/usr/bin/env python3
import pickle
import sys
import os
import zipfile
from optparse import OptionParser
import testcommon
import time
#Prevent user settings or plugins from impacting unit tests
os.environ["BN_DISABLE_USER_PLUGINS"] = "True"
os.environ["BN_DISABLE_USER_SETTINGS"] = "True"
os.environ["BN_DISABLE_REPO... |
#!/usr/bin/env python
import tweepy
import time
import sys
import os
import random
import gspread
import logging
from configobj import ConfigObj
from subprocess import call
def find_col_or_none(name, wks):
"""A short function which returns None or the column cell. """
logger = logging.getLogger(__name__)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Arne Neumann <discoursekernels.programming@arne.cl>
import numpy
from repoze.lru import lru_cache
"""Naive implementations of subsequence kernels"""
@lru_cache(500)
def all_subsequences_kernel(s, t):
"""
Shawe-Taylor and Cristianini (2004, p. 353f)
... |
#!/usr/bin/env python
#
# This file is part of libfreespace.
#
# Copyright (c) 2009-2010 Hillcrest Laboratories, Inc.
#
# libfreespace is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Automated Certificate Manager using ACME
# Copyright (c) Markus Hauschild, 2016.
import acme_tiny
import datetime
import dateutil.parser
import dateutil.relativedelta
import os
import re
import shutil
import subprocess
import tempfile
import yaml
ACME_DIR="/etc/acme/... |
#!/usr/bin/env python
################################################################################
# DATE: 2017/03/09
#
# SCRIPT: summarize_flags.py
#
# AUTHOR: Miguel A. Ibarra-Arellano (miguelib@ufl.edu)
#
# DESCRIPTION: This script takes a f;ag format file (wide), a flag file and a
# unique ID for that file. ... |
import urllib2
import sys
import numpy as np
from datetime import datetime
class BufkitFile(object):
def __init__(self, filename):
self.filename = filename
self.dates = []
self.__readFile()
self.num_profiles = 0
def __readFile(self):
# Try to open the file. Th... |
#!/usr/bin/env python3.6
#CONFIGURATION
#If these paths are empty, storage will be at default location
##############################################################
#STORAGE CONFIG
configpath = ""
scanstorage = ""
#SAFETY GUARD CONFIG
safetyguard = True
#Input min value for cloning file override safety guard.
#Bac... |
# -*- coding: utf-8 -*-
import argparse
import logging
import os
import subprocess
from string import Template
from utils.artifact import Artifact
import sqlite3
from feature_selection.feature_selection import slugify
LOG = logging.getLogger(__name__)
SPATIAL_SQL = '''
UPDATE 'points' SET geom=GeomFromGPB(geom);
UP... |
# -*- coding: utf-8 -*-
import getpass
import json
import netrc
import os
import time
import stat
import shutil
import tarfile
import urlparse
import subprocess
import git
import requests
from .git_sync import GitSyncHandler
from .sync_helpers import (
extra_git_kwargs, git_update_gitignore, git_pull_develop_bund... |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import os
i... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
#!/usr/bin/python
# (C) Copyright 2016-2017 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
"""Functions to analyze features."""
import numpy as np
import nitime.timeseries as ts
import nitime.analysis as nta
from copy import deepcopy
from scipy.stats import spearmanr, pearsonr
from sklearn.preprocessing import MinMaxScaler
from fmrilearn.info import print_X_info
from fmrilearn.info import print_label_cou... |
from .base import *
ADMINS = [
('Alex', 'avyushko@nd.edu'),
]
ALLOWED_HOSTS = [
'om-qa.vecnet.org',
]
SECRET_KEY = get_env_variable("SECRET_KEY")
DATABASES = {
'default': {
'ENGINE': "django.db.backends.postgresql_psycopg2",
'NAME': get_env_variable("DATABASE_NAME"),
'USER': get... |
import logging
import fingerprints
from pprint import pprint # noqa
from banal import ensure_list
from followthemoney import model
from followthemoney.types import registry
from elasticsearch.helpers import scan
from aleph.core import es, cache
from aleph.model import Entity
from aleph.index.indexes import entities_w... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^$', 'lists.views.home_page', name='home'),
# url(r'^blog/', include('blog.urls')),
# url(r'^admin/', include(admin.site.urls)),
)
|
r"""
Module for defining function spaces in the Legendre family.
A function is approximated in the Legendre basis as
.. math::
u(x) = \sum_{i=0}^{N-1} \hat{u}_i L_i(x)
where :math:`L_i(x)` is the i'th Legendre polynomial of the first kind.
The Legendre polynomials are orthogonal with weight :math:`\omega=1`
.... |
import matplotlib.pyplot as plt
import numpy as np
import itertools
import math
from skimage.io import *
from skimage.draw import polygon
from skimage.feature import greycomatrix, greycoprops
from skimage.color import rgb2gray
from skimage.measure import label, regionprops
from PIL import Image, ImageDraw
fileNum = ... |
import time
import threading
import Queue
from alerta.common import config
from alerta.common import log as logging
from alerta.common.daemon import Daemon
from alerta.alert import Alert, Heartbeat, severity, status
from alerta.common.mq import Messaging, MessageHandler
from alerta.server.database import Mongo
Versi... |
# -*- encoding: utf-8
"""
Editor class for extending viewer with text editing features.
"""
import re
from . import helpers
from .line import Line
from .cursor import Cursor
from .viewer import Viewer
class State:
"""Store editor state for undo/redo."""
def __init__(self, editor=None):
self.cursors... |
#!/usr/bin/env python
import irc.bot
import json
import random
def genRandomString(length):
alpha = "abcdefghijklmnopqrstuvwxyz"
return "".join(random.choice(alpha) for _ in range(length))
class Pugbot(irc.bot.SingleServerIRCBot):
def __init__(self, config):
super(Pugbot, self).__init__([(config[... |
import datetime
from .base import BaseUser, UserDb
from ..core.exceptions import UserDoesNotExist
class User(BaseUser):
"""User Model"""
def __init__(self):
super(User, self).__init__()
self.users = []
def create_user(self, username, password, email):
self.users.append(self._crea... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cPickle as pickle
import argparse
import time
import glob,sys
import os,csv
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import chainer
from chainer import cuda
import chainer.links as L
import chainer.functions as F
from chainer import o... |
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
if SOCIALACCOUNT_ENABLED:
print 'Social account enabled'
if 'allauth.socialaccount.context_processors.socialaccount' \
not in settings... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import click
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETTINGS = {
'help_option_names': ['-h', '--help'],
}
@click.group(context_settings=CONTEXT_SETTINGS)
def cli():
pass
from . import (
makebins,
... |
#!/usr/bin/env python
import base64
import ccd
import hashlib
import msgpack
import numpy as np
import requests
import json
import xarray as xr
import pandas as pd
import sys
from . import messaging
from datetime import datetime
import pw
def get_request(url, params=None):
return requests.get(url, params=params).... |
'''
Created on Feb 10, 2015
@author: David Zwicker <dzwicker@seas.harvard.edu>
This module contains math functions
'''
from __future__ import division
from collections import Counter
import fractions
import math
import numpy as np
from scipy import interpolate
from scipy.stats import itemfreq
from ..misc import e... |
#!/usr/bin/env python
#_MIT License
#_
#_Copyright (c) 2017 Dan Persons (dpersonsdev@gmail.com)
#_
#_Permission is hereby granted, free of charge, to any person obtaining a copy
#_of this software and associated documentation files (the "Software"), to deal
#_in the Software without restriction, including without limi... |
#! /usr/bin/env python
import json
import os
import re
import subprocess
from time import localtime, strftime
def main():
# Path to repository folder and output json file
path = '/home/flod/git/webstatus'
json_filename = '/home/flod/public_html/webstatus/webstatus.json'
# path = '/home/flodolo/mozill... |
import numpy as np
import scipy
import scipy.stats
import pandas as pd
from .lib import numutils
import bioframe
def _phase_eigs(eigvals, eigvecs, phasing_track, sort_metric=None):
"""
Flip `eigvecs` to achieve a positive correlation with `phasing_track`.
Parameters
----------
sort_metric : str... |
"""
Django-AlphaFilter provides an admin widget for alphabetical filtering that
works like date_hierarchy and an template tag for use elsewhere.
"""
__version_info__ = {
'major': 0,
'minor': 8,
'micro': 0,
'releaselevel': 'final',
'serial': 0
}
def get_version():
"""
Return the formatted ... |
import tkinter
# tkinter constants that are easier to ref in the base namespace
from tkinter import N,E,S,W, VERTICAL, HORIZONTAL, END, CURRENT, DISABLED, NORMAL
from tkinter.filedialog import askopenfilename, asksaveasfilename
from tkinter.ttk import Treeview
from tkinter import ttk
import radialstructs
class PWWidg... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import json
from enum import Enum
import requests
import config
__author__ = 'enginebai'
# send message fields
RECIPIENT_FIELD = 'recipient'
MESSAGE_FIELD = 'message'
ATTACHMENT_FIELD = 'attachment'
TYPE_FIELD = 'type'
TEMPLATE_TYPE_FIELD = 'template_type'
TEXT_FIELD = 'text'... |
#!/usr/bin/env python3.6
import sys
import os
import platform
import re
import hashlib
import base64
import collections
import subprocess
import numbers
import stat
from pathlib import Path, PurePath
from timeit import default_timer
from decimal import Decimal
import logging
from functools import reduce, wraps, lru_c... |
# Copyright (c) 2022, Djaodjin Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
from twisted.protocols.amp import AMP
from twisted.internet.protocol import Factory
from coordinator_commands import *
from pymongo import MongoClient
class CoordinatorProtocol(AMP):
@FetchData.responder
def fetchData(self, msg):
#TODO: msg contains the
pass
@GetMaster.responder
def ... |
# coding=utf-8
import sys
import copy
import time
import errno
import signal
import select
import logging
import unicodedata
import os
from . import px_load
from . import px_pager
from . import px_process
from . import px_terminal
from . import px_load_bar
from . import px_cpuinfo
from . import px_processinfo
from . ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import obfsproxy.common.log as logging
import obfsproxy.common.serialize as serialize
import struct
import mycrypto
import const
log = logging.get_obfslogger()
def createDataMessages( data ):
messages = []
log.debug("Creating protocol messages.")
while len(data) ... |
import psycopg2
import sys
from connect import connect_to_db
# add new date, temp, cycle day, LH test from arguments in command line
# filename counts as first arg
args = sys.argv
date = args[1]
temp = args[2]
cd = args[3]
lh = args[4]
# adding items to data
data = (date, temp, cd, lh)
# connect to database
conn = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
pyPostcode by Stefan Jansen
pyPostcode is an api wrapper for http://postcodeapi.nu
'''
import urllib2
import json
import logging
__version__ = '0.3'
class pyPostcodeException(Exception):
def __init__(self, id, message):
self.id = id
self.message... |
import argparse, base64, sys
MODULUS = 256
def get_involutary_keys(pRelativePrimes: list, pModulus: int) -> list:
lInvolutaryKeys = []
for lRelativePrime in lRelativePrimes:
# if a**2 = 1 (mod m) and either b = 0 or a = -1 (mod m), then key is involutary
if ((lRelativePrime ** 2) % M... |
# -*- coding: utf-8 -*-
"""
@summary: RDFa parser (distiller)
@requires: Python version 2.5 or up
@requires: U{RDFLib<http://rdflib.net>}; version 3.X is preferred, it has a more readable output serialization.
@requires: U{html5lib<http://code.google.com/p/html5lib/>} for the HTML5 parsing.
@requires: U{httpheader<http... |
"""
===============================================
message - Message handling for the Pushover API
===============================================
This module defines functions and classes used for handling messages sent to the Pushover servers. Messages can be sent
using either the MessageManager class or calling t... |
# -*- coding: utf-8 -*-
# (c) The James Hutton Institute 2016-2019
# (c) University of Strathclyde 2019
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@strath.ac.uk
#
# Leighton Pritchard,
# Strathclyde Institute for Pharmacy and Biomedical Sciences,
# Cathedral Street,
# Glasgow,
# G1 1XQ
# Scotland,
# ... |
import logging
import time
import os
import itertools
import string
import struct
import smtplib
from socket import gethostname
from functools import wraps
from threading import Event, Thread, current_thread, Lock, RLock
from Queue import Queue
from collections import namedtuple, Mapping
from contextlib import contextm... |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
"""
Provides several classes that define the selection function in different ways.
All selection function classes are derived from the :class:`~Selection` abstract base class.
This should not be instantiated directly, but provides the structure for its subclasses. Namely,
each subclass should provide a single method, ... |
# -*- coding: utf-8 -*-
#
# Copyright 2013 Ghent University
#
# This file is part of vsc-base,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercule... |
# -*- coding: utf-8 -*-
VERSION = (1, 3, 2)
__author__ = 'rbas'
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
|
#!/usr/bin/env python
import itertools
from itertools import izip
import numpy as np
import pandas as pd
from pydigree.recombination import recombine
from pydigree.paths import *
from pydigree.common import *
from pydigree.genotypes import Alleles, LabelledAlleles
from pydigree.exceptions import IterationError
miss... |
import eventlet.hubs.hub
import greenlet
import logging
import signal
import sys
socket = eventlet.patcher.original('socket')
threading = eventlet.patcher.original('threading')
logger = logging.getLogger('aiogreen')
try:
import asyncio
if sys.platform == 'win32':
from asyncio.windows_utils import soc... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
"""
This function udpate the employee_id of the user accounts in DB
"""
import logging
import traceback
from sis_provisioner.dao.pws import get_person
from sis_provisioner.dao.uw_account import get_all_uw_accounts
logger = loggin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.