text
stringlengths
17
737k
# pylint: disable=too-many-lines import re import logging import time import uuid import os import tempfile import json import base64 from textwrap import dedent from threading import Thread from datetime import datetime from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error impo...
#!/usr/bin/env python from kvirt.config import Kconfig from kvirt.config import __version__ from kvirt.defaults import TEMPLATES from prettytable import PrettyTable from shutil import copyfile import argparse from kvirt import common from kvirt import nameutils from kvirt import dockerutils import os import yaml def...
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import os import re import sys from urllib.request import urlretrieve from pathlib import Pat...
import networkx as nx from enum import Enum from collections import OrderedDict, deque, namedtuple import inspect import decorator import dill import six import sys import pandas as pd import traceback import graphviz import logging LOG = logging.getLogger('loman.computeengine') class States(Enum): """Possible ...
#MAEC Namespace Parser #Copyright (c) 2015, The MITRE Corporation #All rights reserved #Compatible with MAEC v4.1 #Last updated 02/18/2014 from cybox.utils import Namespace import itertools class Metadata(object): """Metadata about MAEC namespaces.""" def __init__(self, namespace_list): self._ns_d...
#!/usr/bin/python2.6 # Copyright 2010, 2011 Mark Longair # Copyright 2011 Dominic Evans # # This program 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 (a...
#!/usr/bin/python ######################################################################## # # Caution: there are two separate, independent build systems: # 'makepanda', and 'ppremake'. Use one or the other, do not attempt # to use both. This file is part of the 'makepanda' system. # # To build panda using this scrip...
#!/usr/bin/python ######################################################################## # # Caution: there are two separate, independent build systems: # 'makepanda', and 'ppremake'. Use one or the other, do not attempt # to use both. This file is part of the 'makepanda' system. # # To build panda using this scrip...
#!/usr/bin/python ######################################################################## # # Caution: there are two separate, independent build systems: # 'makepanda', and 'ppremake'. Use one or the other, do not attempt # to use both. This file is part of the 'makepanda' system. # # To build panda using this scrip...
# -*- encoding: utf-8 -*- from __future__ import print_function import collections import importlib import os import re from abjad.tools import durationtools from abjad.tools import indicatortools from abjad.tools import lilypondfiletools from abjad.tools import markuptools from abjad.tools import scoretools from abjad...
# manticom_ios_models # Copyright (C) 2014, Collin Schupman at Yeti LLC # This is a script to create the models needed iOS side from a given JSON file # Assumes JSON is in format : TODO->Write format # TODO: Clean this shit up, get input from user where to put files import datetime MODEL_DATA_TYPES = { "date"...
from __future__ import (absolute_import, print_function, division) import sys import argparse import os from . import proxyswitch from . import version from libmproxy.main import mitmdump import signal def handler(signum, frame): print("Signal handler called with signal", signum) def main(): parser = argp...
import discord import re import csv import random import os import datetime from .utils import chat_formatting as chat from discord.ext import commands class MCOCTools: '''Tools for Marvel Contest of Champions''' lookup_links = { 'event': ( '<http://simians.tk/MCOC-Sched>', ...
class Form(object): def __init__(self, form): self.form = form def input(self, data): for (name, value) in data.items(): self.form.find("input", {"name": name})["value"] = value attach = input def check(self, data): for (name, value) in data.items(): i...
import abc import os from glob import glob from pathlib import Path import hdf5able from ..utils import _norm_path from menpo import menpo_src_dir_path from menpo.visualize import progress_bar_str, print_dynamic def load(path): r""" Load a given HDF5 file of serialized Menpo objects or base types. Para...
# coding=utf-8 # Copyright 2019 The Mesh TensorFlow Authors. # # 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 applicab...
import config import cv2 import cv2.cv as cv import numpy as np class Frame: def __init__(self, original): self.original = original self.processed = None self.printed = False def process(self): # Frame can be processed only once... if self.processed is not None: return ...
#!/usr/bin/env python # Metarunlog, experiment management tool. # Author: Tom Sercu # Date: 2015-01-23 import metarunlog.cfg as cfg import os import sys from os import listdir from os.path import isdir, isfile, join, relpath, expanduser import argparse import subprocess import json import pdb import datetime from coll...
"""Extremely simple pure-Python implementation of coroutine-style asynchronous socket I/O. Inspired by, but inferior to, Eventlet. Bluelet can also be thought of as a less-terrible replacement for asyncore. Bluelet: easy concurrency without all the messy parallelism. """ import socket import select import sys import t...
"""Icons that are used by Gaphor. """ import logging import os.path from xml.sax import handler import gtk import pkg_resources from gaphor import UML from gaphor.storage.parser import ParserException XMLNS='http://gaphor.sourceforge.net/gaphor/stock-icons' _icon_factory = gtk.IconFactory() _icon_factory.add_defaul...
# Copyright 2014 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...
# Copyright (c) 2016. Mount Sinai School of Medicine # # 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...
''' module to handle merging (importing) of (azqdata.db from azq .azm files) sqlite3 dump lines into a PostgreSQL and Microsoft SQL Server db. Copyright: Copyright (C) 2016 Freewill FX Co., Ltd. All rights reserved. ''' from debug_helpers import dprint import azm_db_constants from subprocess import call import os im...
import os import re import json import warnings from io import open from .validation import BIDSValidator from grabbit import Layout, File from grabbit.external import six, inflect from grabbit.utils import listify import nibabel as nb from collections import defaultdict from functools import reduce, partial from itert...
# -*- coding: utf-8 -*- # Copyright (C) 2014 The Songbook Team # # This program 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 your option) any ...
# alloc library import os import sys import simplejson import re import urllib import urllib2 import datetime import ConfigParser import subprocess from netrc import netrc from urlparse import urlparse from collections import defaultdict from alloc_output_handler import alloc_output_handler from alloc_cli_arg_handler i...
#!/usr/bin/env python # See https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-of-Life-APIs-v3#synthetic-tree try: import configparser # pylint: disable=F0401 except ImportError: import ConfigParser as configparser import json import datetime import os import codecs def num_studies(): with open('ph...
# -*- coding: utf-8 -*- # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) import json from django.contrib.auth.decorators import login_required from django.contri...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
"""Tools for working with epoched data""" # Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # Denis Engemann <d.engemann@fz-juelich.de> # Mainak Jas <mainak@neuro.hut.fi> # ...
# -*- coding: utf-8 -*- """ override task """ import pprint import logging from dateutil import parser import re from datetime import datetime, date, timedelta from dateutil.relativedelta import relativedelta from openerp.tools.translate import _ from openerp import models, fields, api, exceptions, tools _logger = lo...
import auth import api import sql from tools import date_index, time_series, seconds from pandas import DataFrame from pandas import read_sql_query from sqlalchemy import create_engine, MetaData from sqlalchemy.sql import select #|Connect to SQL database and create SQLAlchemy engine and MetaData def dbconnect(): e...
from abc import ABCMeta, abstractmethod from datetime import datetime from ..tools.lxml_tools import clean_html from ..tools.text import find_number, drop_space from .decorator import default, empty, cached, bind_item from .const import NULL from .error import ChoiceFieldError metaclass_ABCMeta = ABCMeta('metaclass_A...
""" Django settings for seleniumRobotServer project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ /...
import os import json import time from random import randint from leap.auth import SRPAuth from leap.exceptions import SRPAuthenticationError from locust import HttpLocust, TaskSet, task from pixelated.resources.login_resource import LoginResource LEAP_PROVIDER = os.environ.get('LEAP_PROVIDER', 'dev.pixelated-project...
from django.contrib import admin from .models import SimpleQuestion, MultipleChoiceQuestion admin.site.register([SimpleQuestion, MultipleChoiceQuestion])
from __future__ import absolute_import from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response...
import collections import json import datetime def dict_from(json_string): return JSONUtil(json_string).to_odict() class JSONUtil(object): def __init__(self, json_input): self.json_input = json_input def to_odict(self, raise_exception=False): if raise_exception: if not ...
from generate_inputs.src.generate_inputs import * import numpy as np from fractions import Fraction from itertools import product import platform # Using the input_template.cfg, make num_copies new files enumerated as 0....num_copies, # while replacing the fields stated in find_replace. template_filename = 'input_tem...
from common import AppException from time import sleep from urllib import quote import datetime import json import logging import urllib2 import urllib from cookielib import CookieJar logger = logging.getLogger(__name__) class InvalidLogin(AppException): pass class Wiki(object): def __init__(self, url, delay): ...
# 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 t...
import logging import os import unittest from nose.plugins import Plugin from jstestnetlib.control import Connection log = logging.getLogger('nose.plugins.jstests') class JSTests(Plugin): """Run JavaScript tests using a JS TestNet server.""" name = 'jstests' def options(self, parser, env=os.environ): ...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" .. module: inventory.py """ import numpy as np from pathlib import Path from inspect import currentframe, getframeinfo import csv import xarray as xr from . import DATA_DIR from .background_systems import BackgroundSystemModel from .export import ExportInventory from scipy import sparse import itertools class In...
# The MIT License (MIT) # Copyright (c) 2021 by the ESA CCI Toolbox development team and contributors # # 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 ...
#!/usr/bin/env python """ Control Module for Roy the Robot Arm Author: Tusli Software LLC (info@tuslisoftware.com) Written: May 1, 2016 Updated: May 1, 2016 This module allows a user to control the arm of Roy the Robot, built by Roemotion. Visit <www.roemotion.com> for more information about Roy the Robot. The seria...
# -*- coding: utf-8 -*- import collections from mfit import app from mfit import resources class Root(resources._Base): def get(self): links = { 'self': app.api.url_for(Root, _external=True) } relationships = { 'users_uri': app.api.url_for(resources.UsersCollect...
## Changemonger: An OpenStreetMap change analyzer ## Copyright (C) 2012 Serge Wroclawki ## ## This program 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 ...
import os.path import re import random import time from kvmagent import kvmagent from kvmagent.plugins.imagestore import ImageStoreClient from zstacklib.utils import jsonobject from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import shell from zstacklib.utils import linux from zsta...
#! /usr/bin/env python # -*- coding: UTF-8 -*- vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # The MIT License (MIT) # # Copyright (c) 2015-2016 Nicolas Pillot # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the 'Software'), ...
#!/usr/bin/python import json import subprocess if __name__ == '__main__': output = subprocess.check_output("cat /proc/diskstats | awk '{print $3}' | grep -v 'ram\|loop\|sr'", shell=True) data = list() for line in output.split("\n"): if line: data.append({"{#DEVICE}": line, "{#DEVICENAME}...
""" Meta messages for MIDI files. Todo: - what if an unknown meta message is implemented and someone depends on the 'data' attribute? - is 'type_byte' a good name? - 'values' is not a good name for a dictionary. - type and value safety? - copy(). - expose _key_signature_encode/deco...
""" The dummy is meant to sit in when an object with a run method is called but not needed. """ from tottest.baseclass import BaseClass LOG_STRING = "{0}.run() called with parameters '{1}'" class NoOpDummy(BaseClass): """ The NoOpDummy does nothing when asked to do something. """ def __init__(self, ...
# -*- coding: utf-8 -*- # # This file is part of django-powerdns-manager. # # django-powerdns-manager is a web based PowerDNS administration panel. # # Development Web Site: # - http://www.codetrax.org/projects/django-powerdns-manager # Public Source Code Repository: # - https://source.codetrax.org/hgroot/dja...
#!/usr/bin/env python from dtest import debug import inspect import os import pickle import platform import re import sys import tempfile import time import uuid import pprint import threading try: import cStringIO as StringIO except ImportError: import StringIO class LoadMaker(object): """ Allows y...
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
__docformat__ = 'plaintext' import math from bisect import bisect from random import randrange def giant_steps(start, target): L = [target] while L[-1] > start*2: L = L + [L[-1]//2 + 1] return L[::-1] def rshift_quick(x, n): """For an integer x, calculate x >> n with the fastest ...
# Tai Sakuma <tai.sakuma@cern.ch> import argparse import sys import os, errno import itertools from HeppyResult.HeppyResultReader import HeppyResultReader from HeppyResult.HeppyResult import HeppyResult from EventReader.EventReaderBundle import EventReaderBundle from EventReader.EventReaderPackage import EventReaderPa...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
#! /bin/env python # coding: utf8 from ftplib import FTP FTP_ADDRESS = '192.168.2.1' FTP_USER = 'ftp' FTP_PASSWORD = 'ftp' FTP_UPLOAD_DIR = 'ftp' def upload(name, f): ftp = FTP(host=FTP_ADDRESS, user=FTP_USER, passwd=FTP_PASSWORD) ftp.cwd(FTP_UPLOAD_DIR) ftp.storbinary('STOR {}'.format(name), f) ftp....
import argparse import os from os import path import subprocess import sys import socket import time import warnings # garbage collector import gc import numpy as np from scipy import signal from matplotlib import pyplot as plt import GPy import classes as cls import utilities as util from utilities import bcolors ...
from os import listdir, makedirs from os.path import exists, join import shutil from flask import current_app from flask.cli import with_appcontext import click import iatikit from ..core import models from . import utils @click.group('iati') def iati_cli(): """Automated test commands.""" pass @iati_cli.c...
# Build this to reduce over the final generator, compose to get generator. from functools import partial def compose(*fns): """Inverted from transducers due to generator semantics.""" return reduce(lambda f,g: lambda x: g(f(x)), fns) def append(l, item): l.append(item) return l def mapgen(f): """...
"""Gaussian processes classification.""" # Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings from operator import itemgetter import numpy as np from scipy.linalg import cholesky, cho_solve, solve from scipy.optimize import fmin_l_bfgs_b from scipy.special import erf...
from flask import Blueprint, abort, render_template, request from viaduct import application from viaduct.api.mollie import MollieAPI from viaduct.api.group import GroupPermissionAPI from viaduct.api.custom_form import CustomFormAPI blueprint = Blueprint('mollie', __name__, url_prefix='/mollie') @blueprint.route('/c...
''' .. module:: skrf.calibration.calibration ================================================================ calibration (:mod:`skrf.calibration.calibration`) ================================================================ This module provides objects for VNA calibration. Specific algorithms inheret from the comm...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, unittest from erpnext.accounts.party import get_due_date from erpnext.exceptions import PartyDisabled from frappe.test_runner import mak...
import path from survey.objects import * import numpy as np import matplotlib.pyplot as ppl import matplotlib.cm as cm def bootstrap(samples, statistic=np.mean, B=100, alpha=0.05, sampler=lambda x : np.random.choice(x, size=len(x))): n = len(samples) bootstrap_samples = np.sort([statistic(bss) for bss in [sa...
from slackminion.plugin import cmd from slackminion.plugin.base import BasePlugin class AuthManager(BasePlugin): """Basic Authorization Plugin""" def on_load(self): # Hook into the dispatcher to receive acl checks setattr(self._bot.dispatcher, 'auth_manager', self) # Setup default AC...
# -*- coding: utf-8 -*- # noinspection PyCompatibility import sys import math import regex from difflib import SequenceMatcher from urllib.parse import urlparse, unquote_plus from itertools import chain from collections import Counter from datetime import datetime import time import os import os.path as path # noinsp...
# -*- coding: utf-8 -*- # noinspection PyCompatibility import math import regex from difflib import SequenceMatcher from urllib.parse import urlparse, unquote_plus from itertools import chain from collections import Counter from datetime import datetime import os.path as path # noinspection PyPackageRequirements impo...
from cffi import FFI from . import flags ffi = FFI() ffi.cdef(""" typedef ... magic_set; typedef struct magic_set *magic_t; magic_t magic_open(int); void magic_close(magic_t); const char *magic_getpath(const char *, int); const char *magic_file(magic_t, const char *); const char *magic_descriptor(magic_...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
# -*- coding: utf-8 -*- # noinspection PyCompatibility import sys import math import regex from difflib import SequenceMatcher from urllib.parse import urlparse, unquote_plus from itertools import chain from collections import Counter from datetime import datetime import time import os import os.path as path # noinsp...
#!/usr/bin/python3 import os from re import compile import time import logging import lib.db as DB import lib.ts as TS from lib.audio import stream_info import lib.audio as audio #from sets import Set from glob import glob from datetime import datetime, timedelta from threading import Thread class Service: def __in...
#!/usr/bin/python -O import os import re import time import logging import misc import lib.db as DB import lib.ts as TS import audio from sets import Set from glob import glob from datetime import datetime, timedelta, date from multiprocessing import Process, Queue def size(basedir): total = 0 for basename in o...
# coding: utf-8 from __future__ import unicode_literals, print_function import os import re import threadpool import requests import time from bs4 import BeautifulSoup from tabulate import tabulate import nhentai.constant as constant from nhentai.logger import logger def request(method, url, **kwargs): if not h...
""" Preprocessing functions for time series. All functions in this module should take X matrices with samples x features """ # Authors: Alexandre Abraham, Gael Varoquaux, Philippe Gervais # License: simplified BSD import distutils.version import numpy as np from scipy import signal, stats, linalg from sklearn.utils....
import pandas as pd from collections import ChainMap from rstl import STL import numpy as np import statsmodels.api as sm from statsmodels.tsa.stattools import acf from statsmodels.tsa.stattools import pacf from entropy import spectral_entropy from statsmodels.tsa.holtwinters import ExponentialSmoothing import multipro...
# Copyright 2015 icasdri # # This file is part of tuhi-flask. # # tuhi-flask 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 your option) any later version. # #...
#!/usr/bin/env python import os import re import subprocess as sp import sys import multiprocessing as mp def get_missing_programs(required_programs): """Gets a list of required programs that can't be found on the system.""" # try to launch the programs, and add them to a list if they're not found missin...
"""FlatDict is a dict object that allows for single level, delimited key/value pair mapping of nested dictionaries. """ __version__ = '1.2.0' class FlatDict(dict): """:py:class:`~flatdict.FlatDict` is a dictionary object that allows for single level, delimited key/value pair mapping of nested dictionaries. ...
import base64 import datetime import json import logging import re import os import urllib from twilio import TwilioException from twilio import TwilioRestException from urllib import urlencode from urlparse import urlparse # import json try: import simplejson as json except ImportError: try: import j...
"""A raucous ripoff of Flood-It! 2, a game I liked to play on my iphone. """ import os import pprint import random import sys BOARD_WIDTH = 12 BOARD_HEIGHT = 12 N_TURNS = 22 class Color(str): COLORS = [ "purple", "pink", "orange", "yellow", "green", "blue" ] d...
#!/usr/bin/env python ''' Prepare stages for USB fuzzing Usage: umap2makestages -P=PHY_INFO -C=DEVICE_CLASS -s=FILE [-q] [-v ...] Options: -P --phy PHY_INFO physical layer info, see list below -C --class DEVICE_CLASS class of the device or path to python file with device class -s --stage-file FI...
import os import multiprocessing import logging logger = logging.getLogger(__name__) HARTREE_TO_EV = 27.211383858491185 SYMBOLS = { '1': 'H', '2': 'He', '3': 'Li', '4': 'Be', '5': 'B', '6': 'C', '7': 'N', '8': 'O', '9': 'F', '10': 'Ne', '11': 'Na', '12': 'Mg', '13':...
import connection from dht import DHT from protocol import hello_request from protocol import hello_response from protocol import goodbye from protocol import proto_response_pubkey from urlparse import urlparse from zmq.eventloop import ioloop, zmqstream from zmq.eventloop.ioloop import PeriodicCallback from collection...
from __future__ import division import rstbx.viewer.display import wx from rstbx.slip_viewer.frame import XrayFrame from rstbx.viewer.frame import SettingsFrame, SettingsPanel from scitbx import matrix from dials.array_family import flex myEVT_LOADIMG = wx.NewEventType() EVT_LOADIMG = wx.PyEventBinder(myEVT_LOADIMG, 1...
#!/usr/bin/env python import serial import struct import sys import getopt import time import glob import re import pprint from mtdef import MID, OutputMode, OutputSettings, MTException, Baudrates, \ XDIGroup, getMIDName, DeviceState, DeprecatedMID, MTErrorMessage ################################################...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import numpy as np import warnings import math def rowwise_chebyshev(x, y): return np.max(np.abs(x - y), axis=1) def rowwise_euclidean(x, y): return np.sqrt...
__version__ = "7.0.2"
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import socket import struct import select import os import hashlib import re from sys import exit as exit # we import PollingObserver instead of Observer because the deleted event # is not capturing https://github.com/gorakhargosh/watchdog/issues/46 from watch...
#!/usr/bin/env python # # gen-make.py -- generate makefiles for building Subversion # # USAGE: # gen-make.py [-s] BUILD-CONFIG # import sys import os import ConfigParser import string import glob import fileinput import re def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defa...
#!/usr/bin/python import os, sys, string, pdb import re, fileinput import ctypes import struct import json #Helper functions def hash_djb2(string): """hash a string using djb2 with seed 5381 Args: string (str): string to hash Returns: (int): hashval of string masked to force positive by ma...
#!/usr/bin/python -u import gobject import dbus import dbus.service import dbus.mainloop.glib import os import os.path as path import sys from obmc.dbuslib.bindings import DbusProperties, get_dbus from IPy import IP settings_file_path = os.path.join( sys.prefix, 'share', 'phosphor-settings') sys.path.inse...
#!/usr/bin/env python from __future__ import absolute_import, print_function, unicode_literals import argparse import env from fnmatch import fnmatch import io import os import re import shutil from string import Template import subprocess import sys try: raw_input except NameError: raw_input = input def r...
#! /usr/bin/python # Code generator for python ctypes bindings for VLC # # Copyright (C) 2009-2012 the VideoLAN team # $Id: $ # # Authors: Olivier Aubert <olivier.aubert at liris.cnrs.fr> # Jean Brouwers <MrJean1 at gmail.com> # Geoff Salmon <geoff.salmon at gmail.com> # # This program is free softwa...
#!/usr/bin/env python """ This is the getter script to extract building energy data from Lucid's website. The script uses Selenium to automate the manual process of selecting desired meters, date range, file export base name, and resolution. The user will be prompted to select meters by entering numbers corresponding ...
# diff.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import re from git.cmd import handle_process_output from git.compat import defenc from git.util import ...