text
stringlengths
17
737k
# -*- coding: utf-8 -*- # Copyright (c) 2011-2016 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud 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 v...
#!/usr/bin/env python3 """Create trendbargraphs for various periods of data.""" import argparse import configparser import os import sqlite3 import warnings from datetime import datetime as dt import graphlib as glib import matplotlib.pyplot as plt import numpy as np import pandas as pd warnings.filterwarnings('ig...
""" This script is the server-side of the XML-RPC defined for gef for BinaryNinja. It will spawn a threaded XMLRPC server from your current BN session making it possible for gef to interact with Binary Ninja. To install this script as a plugin: $ ln -sf /path/to/gef/binja_gef.py ~/.binaryninja/plugins/binaryninja_gef....
#!/usr/bin/python #License# #bitHopper by Colin Rice is licensed under a Creative Commons # Attribution-NonCommercial-ShareAlike 3.0 Unported License. #Based on a work at github.com. import warnings warnings.filterwarnings('ignore','' , UserWarning) try: import eventlet except Exception, e: print "You need to...
#!/usr/bin/env python #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:Creative Commons GNU GPL v2 # (http://creativecommons.org/licenses/GPL/2.0/) """Unittests for tvdb_api """ import sys import unittest sys.path.append("..") import tvdb_api from tvdb_exceptions...
# Copyright (c) 2006-2012 gocept gmbh & co. kg # See also LICENSE.txt from zeit.cms.i18n import MessageFactory as _ from zope.i18nmessageid import ZopeMessageFactory as _zope import datetime import gocept.form.grouped import pytz import zeit.cms.browser.view import zeit.cms.checkout.interfaces import zope.app.containe...
from .utils import ViewTestCase from dataviews.ndmapping import Dimension, NdIndexableMapping from collections import OrderedDict class DimensionTest(ViewTestCase): def test_dimension_init(self): Dimension('Test dimension') Dimension('Test dimension', cyclic=True) Dimension('Test dimensio...
from urls import url from requesting import request_from #Defining a client class class Bolt(): def __init__(self, api_key, device_id): """ Creating a class construcor. :param str api_key: api key to authenticate user :param str device_id: password to :returns: None ...
# Copyright (c) 2014 Scopely, Inc. # Copyright (c) 2015 Mitch Garnaat # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanyin...
import inspect import json import os import random import subprocess import time import requests import ast import paramiko import rancher from rancher import ApiError from lib.aws import AmazonWebServices DEFAULT_TIMEOUT = 120 CATTLE_TEST_URL = os.environ.get('CATTLE_TEST_URL', "http://localhost:80") ADMIN_TOKEN = o...
from django.conf import settings from dateutil.parser import parse # TODO consider migration to /tet/ # Generates user friendly metadata description fo the dataset: creation, categories etc. def metadata_to_text(dataset): ''' :param dataset: CKAN API response - JSON representation of dataset :return: stri...
# -*- coding: utf-8 -*- import pytz from pytz import timezone from openerp import models, fields, api from datetime import datetime, date, timedelta from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DTF from openerp.exceptions import ValidationError def format_tz(datetime_str, tz, dtf): datetime_obj = d...
# This class represents a Demo to be executed in SimDem. import datetime import difflib from itertools import tee, islice, zip_longest import json import os import re import sys import urllib.request from environment import Environment from cli import Ui import config def get_next(some_iterable, window=1): items...
"""numerical differentiation function, gradient, Jacobian, and Hessian Author : josef-pkt License : BSD """ #These are simple forward differentiation, so that we have them available #without dependencies. # #* Jacobian should be faster than numdifftools because it doesn't use loop over observations. #* numerical prec...
"""PyDoIt file for automating tasks.""" import glob import itertools import os from os.path import dirname from doit import get_var #from doit.tools import Interactive from doit.tools import check_timestamp_unchanged from doit.tools import create_folder #from doit.tools import result_dep import dwi.util """ Backend...
# Draw result of evaluation import helpers import config import subprocess import shlex import logging class Output(): color_map = [ "red", "green", "blue", "orange" ] height_per_core = 5 obj = [] scale_x = .05 last_node = None "Wrapper to enable visualization output to file" def __init_...
#!/usr/bin/python from datetime import datetime import argparse import configparser import logging import os import os.path import re import requests import subprocess logging.basicConfig(format='%(message)s', level='WARNING') logger = logging.getLogger("dyfi") logger.setLevel('INFO') configname = os.path.expanduser...
# Copyright (C) 2006, Red Hat, Inc. # # This library 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 # version 2 of the License, or (at your option) any later version. # # This library is distrib...
from . import hook from . import utils s = str(hook) s += str(utils)
from __future__ import print_function, division from sympy import (degree_list, Poly, igcd, divisors, sign, symbols, S, Integer, Wild, Symbol, factorint, Add, Mul, solve, ceiling, floor, sqrt, sympify, simplify, Subs, ilcm, Matrix, factor_list, perfect_power, isprime, nextprime, integer_nthroot) from sympy.si...
# -*- coding: utf-8 -*- # Copyright 2014 - 2016 OpenMarket Ltd # # 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 applic...
# Copyright 2020 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, ...
# -*- coding: utf-8 -*- from __future__ import print_function import unittest import os import tempfile import copy from tables import * from tables.index import Index, default_auto_index, default_index_filters from tables.idxutils import calc_chunksize from tables.tests.common import verbose, allequal, heavy, cleanu...
# -*- coding: utf-8 -*- # Copyright (C) 2007-2010 Samalyse SARL # Copyright (C) 2010-2012 Parisson SARL # This software is a computer program whose purpose is to backup, analyse, # transcode and stream any audio content with its metadata over a web frontend. # This software is governed by the CeCILL license under Fr...
#!/usr/bin/python2.5 from __future__ import print_function from blist import blist import pprint, random, sys if len(sys.argv) > 0: random.seed(int(sys.argv[1])) else: random.seed(3) type1 = list type2 = blist iterations = 100000 lobs = [type1(), type1()] blobs = [type2(), type2()] def get_method(self, nam...
from gosubl import about from gosubl import gs from gosubl import gsshell from gosubl import mg9 import datetime import json import os import re import shlex import string import sublime import sublime_plugin import uuid import webbrowser DOMAIN = "9o" AC_OPTS = sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLI...
import tempfile, sys, os, time from os import path from greenlet import GreenletExit import eventlet from eventlet.green import socket from eventlet.green import subprocess murder_client = eventlet.import_patched('murder_client') bttrack = eventlet.import_patched('BitTornado.BT1.track') makemetafile = eventlet.import_p...
import numexpr as ne import numpy as np from timeit import repeat from numba import autojit, __version__ import meta import ast print "using numba", __version__ size = (1000, 1000) def timefunc(correct, func, *args, **kwargs): print func.__name__.ljust(20), # Warming up res = func(*args, **kwargs) fa...
from tkinter import * from random import * from sys import * program = Tk() def fultonFunc(): print("Fulton") def algorFunc(): print("Algor") def kurseddaneFunc(): print("Kurseddane") def maunderFunc(): print("Maunder") def card(): card1 = Button(program, text="card", command=maunderFunc) ...
#!/usr/bin/env python # -*- coding:utf-8 -*- import logging import cgi import re import common from oauthclient import TwitterClient, escape from google.appengine.api import app_identity, memcache, urlfetch from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app # Twitter O...
#!/usr/bin/env python Maxfret = 2 # 12 Tuning = ['g', 'c', 'e', 'a'] Pitches = ['c', 'c#', 'd', 'd#', 'e', 'f', 'f#', 'g', 'g#', 'a', 'a#', 'b'] from itertools import * def fing2notes(fing): notes=[None]*len(fing) for i in range(len(fing)): notes[i] = Pitches[ (Pitches.index(Tuning[i]) + fing[i]) % 12 ...
#!/usr/bin/env python import gobject import gtk import socket, errno, sys, os.path import dbus, dbus.mainloop.glib import appindicator import pynotify from mpd import MPDClient # Looks for album art def get_coverart(songdata): # we look in the song folder first song_dirname = "/var/lib/mpd/music/" + os.path.dirname...
from rest_framework.serializers import Serializer from rest_framework_expander.context import ExpanderContext from rest_framework_expander.exceptions import ExpanderFieldMissing, ExpanderDepthBreached from rest_framework_expander.settings import expander_settings class ExpanderParser(object): """ Parses the ...
"""Module to maintain PLM state information and network interface.""" import asyncio import logging import time import binascii # 40.95.e6 is my computer room wall switch __all__ = ('PLM') # 62 needs definition STATIC_COMMAND_LENGTHS = { b'\x50': 11, b'\x51': 25, b'\x52': 4, b'\x53': 10, b'\x54'...
import smbus import time import pygame import const from os import sys import RPi.GPIO as GPIO from threading import Thread print("Raspberry Pi Master") # for RPI version 1, use "bus = smbus.SMBus(0)" bus = smbus.SMBus(1) # This is the address we setup in the Arduino Program address = 0x04 stopped = False currentSp...
#!/usr/bin/env python import os import re import subprocess import sys db_admin_user = 'postgres' original_db = 'original' def quiet_check_call(*args, **kwargs): try: with open('/tmp/subprocess.out', 'w') as out: subprocess.check_call(*args, stderr=subproces...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
#!/usr/bin/env python # $Id$ """ A FTP server banning clients in case of commands flood. If client sends more than 300 requests per-second it will be disconnected and won't be able to re-connect for 1 hour. """ from pyftpdlib.ftpserver import FTPHandler, FTPServer, DummyAuthorizer, CallEvery class AntiFloodHandler...
#!/usr/bin/env python import sys import os import subprocess import datetime from collections import OrderedDict import yaml import ordered_yaml myname = sys.argv[0] CONFIG_FILENAME = "config.yml" DEFAULT_TARGET_DIR = "/data/dump" ## Worker Functions def mongodump(config, db): """ Drive the mongodump com...
import CoolProp.CoolProp as CP # Check reference state setting def test_IIR(): CP.set_reference_state('Propane','IIR') h_target = 200 s_target = 1 h_EOS = CP.Props('H','T',273.15,'Q',0,'Propane') s_EOS = CP.Props('S','T',273.15,'Q',0,'Propane') if abs(h_EOS-h_target) > 1e-10: raise Asser...
#! /usr/local/bin/python """ Created on Wed Nov 12 09:28:51 2014 @author: kmratliff """ # from pylab import * import os import numpy as np import steep_desc import avulse import diffuse import prof import SLR import FP import downcut import flux from avulsion_utils import read_params_from_file _SECONDS_PER_YEAR = 31...
from __future__ import division, print_function, absolute_import import os import warnings import numpy as np from numpy.testing import (assert_equal, run_module_suite, assert_raises, assert_) import scipy.ndimage as ndi import skimage from skimage import io, draw, data_dir #from skimage ...
import datetime import praw import praw.exceptions from snoohelper.database.models import UnflairedSubmissionModel import time from peewee import DoesNotExist class FlairEnforcer: """ Automatically removes unflaired submissions, keeps track of them, and approves them if they have been flaired Posts a fla...
import os import subprocess from audio_length import escape_characters import argparse filetypes_to_convert=[".mp3",".m4a", "webm"] def convert(filename): filename_extensionless, extension = os.path.splitext(filename) new_filename = "".join([filename_extensionless, ".wav"]) if not os.path.exists(new_filename): ...
# Copyright (C) University of Tennessee Health Science Center, Memphis, TN. # # 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 la...
import json import datetime from celery.task import task from mapping.models import Report, Location from namelist.models import Player, Category from namelist.scrape import scrape_profile import redis @task() def process_data(data, ip): """Processes a data set from the UD plugin for a given IP address.""" ...
"""This script must be run each time the database is updated. It runs queries against the SQL database, indexes the results and builds a xapian index. This xapian index is later used in providing search through the web interface. """ from functools import partial import json import xapian from utility.monads import ...
from oyoyo.parse import parse_nick import var import botconfig import decorators from datetime import datetime, timedelta import threading import random import copy from time import sleep from time import time as timetime import re import logging import sys import os COMMANDS = {} PM_COMMANDS = {} HOO...
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # For more information, please refer to the terms.txt file. #ThreatExpert Converter Script #Updated 02/24/2014 for MAEC v4.1 and CybOX v2.1 #ThreatExpert main parser class #For use in extracting data from XML ThreatExpert output from maec.bundle.bundle...
""" Schedule-related services """ from MaKaC.services.implementation.base import ParameterManager import MaKaC.conference as conference import MaKaC.schedule as schedule from MaKaC.common.PickleJar import DictPickler from MaKaC.services.interface.rpc.common import ServiceError from MaKaC.services.implementation im...
# -*- coding: utf-8 -*- """Model definitions for MDN migration app.""" from __future__ import unicode_literals from collections import OrderedDict from json import dumps, loads from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.utils.encoding i...
def merge(*dicts): """ Merge a collection of dictionaries >>> merge({1: 'one'}, {2: 'two'}) {1: 'one', 2: 'two'} Later dictionaries have precedence >>> merge({1: 2, 3: 4}, {3: 3, 4: 4}) {1: 2, 3: 3, 4: 4} See Also: merge_with """ if len(dicts) == 1 and not isinstance(dict...
# -*- coding: utf-8 -*- # # The internetarchive module is a Python/CLI interface to Archive.org. # # Copyright (C) 2012-2019 Internet Archive # # 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 Foundat...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ PURPOSE: Tools to access the Meetup.com API AUTHOR: dylangregersen DATE: Mon Sep 15 00:12:21 2014 """ # ########################################################################### # from __future__ import print_function, division, unicode_literals import os import req...
from __future__ import absolute_import from rpython.rlib import rsignal from topaz.module import ModuleDef from topaz.system import IS_WINDOWS RUBY_SIGNALS = set([ "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGIOT", "SIGABRT", "SIGEMT", "SIGFPE", "SIGKILL", "SIGBUS", "SIGSEGV", "SIGSYS", "SIGPIPE"...
""" Test lldb ability to unwind a stack with a function containing a call to the '__builtin_trap' intrinsic, which GCC (4.6) encodes to an illegal opcode. """ import os import unittest2 import lldb from lldbtest import * import lldbutil class BuiltinTrapTestCase(TestBase): mydir = TestBase.compute_mydir(__file__...
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com> # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER import collections class TransformVisitor(object): """A visitor for handling transforms...
#!/usr/bin/env python """ refguide_check.py [OPTIONS] [-- ARGS] Check for a Scipy submodule whether the objects in its __all__ dict correspond to the objects included in the reference guide. Example of usage:: $ python refguide_check.py optimize Note that this is a helper script to be able to check if things ar...
import textwrap import copy from collections import OrderedDict from ..extern import six from ..utils.data_info import MixinInfo __all__ = ['get_header_from_yaml', 'get_yaml_from_header', 'get_yaml_from_table'] class ColumnOrderList(list): """ List of tuples that sorts in a specific order that makes sense fo...
# encoding: utf-8 from __future__ import print_function __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2008 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file CO...
#!/usr/bin/env python import os import subprocess def run(*a, **kw): ret = subprocess.call(*a, **kw) if ret != 0: print("Error runnning: %r" % a) raise SystemExit(1) def main(): run(['virtualenv', 'env']) print("\n\n" + "-"*79) print("Downloading and installing requirements") p...
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, e...
# -*- coding: utf-8 -*- """Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, 2017, 2018, 2019, 2020 Caleb Bell <Caleb.Andrew.Bell@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
#! /usr/bin/env python import sys import os import getopt import optparse import traceback import toydist from toydist.core.utils import \ subst_vars, pprint from toydist.core.platforms import \ get_scheme from toydist.core.parser.api import \ ParseError from toydist.commands.core import \ ...
""" Path manipulation utilities """ from pathlib import ( Path, PurePath, ) from typing import ( Dict, Iterable, List, Sequence, ) def absglob(directory: Path, pattern: str)-> List[Path]: """Like normal glob except absolute paths are returned""" ...
from __future__ import absolute_import, unicode_literals import cgi import datetime from decimal import Decimal from itertools import groupby import json import numpy from operator import itemgetter from dash.utils import datetime_to_ms from django.db.models import Count, F from django.core.urlresolvers import rever...
import time import urlparse import datetime import pytz from django.db import models from django.db.models.loading import get_model from django.db.models.signals import post_save from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.timezone import make...
# Django settings for test_project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
#!/usr/bin/python2 # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2015,2017 # [+] International Business Machines 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 Li...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from models import * from apps.reporters.models import * class FormsLogic: ''' This class holds method stubs and some utilities for dealing with custom forms logic. Others should inherit from this class and inject themselves into the forms app ...
# TmServer - TissueMAPS server application. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # 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...
from django.contrib import admin from wp.models import Post, PostMeta, WpUser, UserMeta, Term, TermTaxonomy, TermRelationship from wp.models import Comment, CommentMeta, Link, Option admin.site.register(Post) admin.site.register(PostMeta) admin.site.register(WpUser) admin.site.register(UserMeta) admin.site.register(T...
from __future__ import absolute_import # Interface to the Salesforce BULK API import os from collections import namedtuple from httplib2 import Http import requests import urllib2 import urlparse import requests import xml.etree.ElementTree as ET from tempfile import TemporaryFile, NamedTemporaryFile import StringIO i...
from collections import OrderedDict import datetime import re from lxml import etree class Foxpath(object): def load_tests(self, tests, codelists=None): whitespace = re.compile(r'\s+') def strip_and_parse(expression): trimmed_expr = whitespace.sub(' ', expression).strip() ...
import numpy as np import pytest import xarray as xr from xskillscore.core.deterministic import ( pearson_r_p_value, pearson_r_eff_p_value, spearman_r_p_value, spearman_r_eff_p_value, effective_sample_size, ) DIM = "time" @pytest.fixture def a(): times = xr.cftime_range("2000-01-01", "2000-0...
# pylint: skip-file # -*- coding: utf-8 -*- import datetime import json import ddt import mock import six from django.test import RequestFactory, TestCase from django.urls import reverse from edx_django_utils.cache import RequestCache from mock import Mock, patch from pytz import UTC from six import text_type impor...
#!/usr/bin/env python3 from tkinter import * from tkinter.scrolledtext import ScrolledText from PassSys import PassSys class gui(Tk): def __init__(self, master): self.ps = PassSys('u.txt') #color config self.gui_background = 'gray24' #background color self.gui_foreground = 'white' #foreground in the co...
import plotly.graph_objs as go import plotly.io as pio from collections import namedtuple, OrderedDict from _plotly_utils.basevalidators import ColorscaleValidator from .colors import qualitative, sequential import math import pandas as pd import numpy as np from plotly.subplots import ( make_subplots, _set_t...
# encoding: utf-8 from django.db import models import logging.config log = logging.getLogger('xbaydnsweb.web.tests') logging.basicConfig(level=logging.DEBUG) class Acl(models.Model): """Acl Model""" aclName = models.CharField(maxlength=100) class Admin: list_display = ('aclName',) sea...
# -*- coding: utf-8 -*- import os import re import sys from paver.easy import * from paver.setuputils import setup, find_packages ROOT = path.getcwd() sys.path.insert(0, ROOT) # use firepython from current folder from firepython._setup_common import SETUP_ARGS BUILD_DIR = ROOT/'build' DIST_DIR = ROOT/'dist' FPY = R...
import sublime, sublime_plugin, os PDBRC_FILE = '~/.pdbrc' _managers = {} def _get_line(view, region): return view.rowcol(region.begin())[0] + 1 class Breakpoint(object): def __init__(self, manager, region): self.manager = manager self.initial_region = self.manager.view.line(region) de...
# Copyright (c) 2014, Yuta Okamoto <okapies@gmail.com> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer, mutually_exclusive class Source(AWSProperty): props = { 'Password': (basestring, False), 'Revis...
''' Created on Nov 10, 2014 @author: fechnert ''' import copy import re import time from models import ClientAction class Feature(object): ''' Represents a abstract Feature ''' def __init__(self, config, base_rules, queue, clients, channels): ''' Initialize the Object, set rules, apply rules ''' ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from nose import with_setup from nose.tools import * from cancergen import database class test_database(object): @classmethod def setup_class(cls): cls.db_cnx = database.MysqlConnection(host="localhost", user="admin", password="Perl$nPython", ...
""" Simple Twitter streaming API access """ __version__ = "0.3.5" __author__ = "Rune Halvorsen <runefh@gmail.com>" __homepage__ = "http://bitbucket.org/runeh/tweetstream/" __docformat__ = "restructuredtext" import urllib import urllib2 import socket import time import anyjson import logging logger = logging.getLogger...
""" Base implementation of Frappy framework. """ from frappy.core.auth import NoAuth import requests try: import json except ImportError: import simplejson as json class DefaultVersion(object): """Default version class""" pass class APIError(Exception): """ Base Exception thrown by the AP...
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
""" A general-purpose Simulation class for discrete events. The Simulation object is the central object of a simulation. It handles the simulation clock time and maintains communication between the components of the simulation. A simulation is structured as a directed graph of event-processing nodes called EventPr...
#!/usr/bin/env python2 # Copyright (c) 2017 Public Library of Science # # 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,...
# -*- coding: utf-8 -*- from configurations import Configuration, importer, values importer.install(check_options=True) import os import sys import re rec = re.compile gettext = lambda s: s # Django settings for froide project. class Base(Configuration): DEBUG = values.BooleanValue(True) TEMPLATE_DEBUG = ...
# Copyright (C) 2015 Twitter, Inc. VERSION = (0, 1, 0, 'rc2') from twitter_ads.utils import get_version __version__ = get_version()
from django.db import models from django.utils.safestring import mark_safe from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.auth.models import User from django.contrib.sites.models import Site from django_extensions.db.fields import Creation...
# Copyright 2015 Cedraro Andrea <a.cedraro@gmail.com> # 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...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from __future__ import unicode_literals import logging import os import re import sqlite3 import warnings import dataproperty from mbstrdecoder import MultiByteStrDecoder import pathvalid...
# List CRITs Indicator Types # For use with mcrits # Author: Brian Warehime @nulltr0n # 11/14/2014 # Importing various modules from MaltegoTransform import * import requests import json import pprint import sys import ConfigParser import os # Configuration Parser to grab necessary options. def getLocalConfPath(): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Version info """ from __future__ import division from __future__ import print_function from __future__ import absolute_import __version__ = "0.11.0" version = __version__ # backwards compatibility name
""" Spherical Voronoi Code .. versionadded:: 0.17.0 """ # # Copyright (C) Tyler Reddy, Ross Hemsley, Edd Edmondson, Nikolai Nowaczyk, Joe Pitt-Francis, 2015. # # Distributed under the same BSD license as Scipy. # import numpy as np import math __all__ = ['SphericalVoronoi'] def calculate_and_sum_up_inner_sphere_s...
has_qt = True try: from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets except ImportError: try: from matplotlib.backends.qt4_compat import QtGui, QtCore QtWidgets = QtGui except ImportError: # Mock objects class QtGui(object): QMainWindow = object ...
from __future__ import absolute_import, division, print_function import logging import math import timeit import pytest import torch from torch.autograd import grad from torch.distributions import constraints, kl_divergence import pyro import pyro.distributions as dist import pyro.ops.einsum.shared import pyro.optim...