gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import pandas as pd import numpy as np import datetime import math import configuration import rews import binning import warnings warnings.simplefilter('ignore', np.RankWarning) def getSeparatorValue(separator): #separator = separator.upper() if separator == "TAB": return "\t" ...
from test.test_support import run_unittest, check_warnings import cgi import os import sys import tempfile import unittest from collections import namedtuple class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi module argv = []...
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterf...
"""All constants related to the ZHA component.""" import enum import logging from typing import List import bellows.zigbee.application from zigpy.config import CONF_DEVICE_PATH # noqa: F401 # pylint: disable=unused-import import zigpy_cc.zigbee.application import zigpy_deconz.zigbee.application import zigpy_xbee.zigb...
''' Base connection class for netmiko Handles SSH connection and methods that are generically applicable to different platforms (Cisco and non-Cisco). Also defines methods that should generally be supported by child classes ''' from __future__ import print_function from __future__ import unicode_literals import par...
import curses import curses.textpad import curses.ascii import os from interactive import * import log import random from datetime import datetime log = log.logger NUMBERS = [ ord("0"), ord("1"), ord("2"), ord("3"), ord("4"), ord("5"), ord("6"), ord("7"), ord("8"), ord("9") ] VIM_DIRECTIONS = [ ord("j"), ord("k"), or...
# -*- coding: UTF8 ''' Created on 21.07.2015 @author: mEDI ''' import re from datetime import datetime, timedelta import gzip import io import sys try: from _version import __buildid__, __version__, __builddate__, __toolname__, __useragent__ except ImportError: __buildid__ = "UNKNOWN" __version__ = "UNKNO...
# Copyright 2012 OpenStack Foundation # 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 requ...
from sympy import ( symbols, log, Float, nan, oo, zoo, I, pi, E, exp, Symbol, LambertW, sqrt, Rational, expand_log, S, sign, conjugate, sin, cos, sinh, cosh, tanh, exp_polar, re, Function, simplify) def test_exp_values(): x, y = symbols('x,y') k = Symbol('k', integer=True) assert exp(nan) =...
from flask import request,jsonify import ec_forum.error as error import ec_forum.expr as expr from ec_forum.sql import sqlQ from ec_forum.salt import encrypt, decrypt from ec_forum.id_dealer import pack_id, unpack_id from ec_forum.public import default_tags from ec_forum.reputation import event, rule from config import...
# Copyright 2014 NEC Corporation. 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 l...
"""Base geometry class and utilities Note: a third, z, coordinate value may be used when constructing geometry objects, but has no effect on geometric analysis. All operations are performed in the x-y plane. Thus, geometries with different z values may intersect or be equal. """ from binascii import a2b_hex from ctyp...
# Copyright (c) 2014, Telecom Italia SpA """ Service Orchestrator for OpenEPC. MCN 2014 """ __author__ = 'sruffino' import json import os import requests import logging from interfaces.ServiceAdapter import ServiceAdapter as ABCServiceAdapter ''' def config_logger(log_level=logging.DEBUG): """ Creates a lo...
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:17174") else: access = Se...
""" The MIT License (MIT) Copyright (c) 2016 Stratos Goudelis 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, copy, modify, me...
import bf2 import host import time import new # for kickstick import re from dc_debug import decho def sayNextMap(unused=None): #It works. We'll just leave it at that. decho( 'The next map is %s' % (host.rcon_invoke('maplist.list').splitlines()[int(host.rcon_invoke('admin.nextLevel').strip())].split()[1].strip('"...
# ------------------------------------------------------------------------------ import logging import datetime import sqlite3 import os import data import config # ------------------------------------------------------------------------------ database = config.DB_DATABASE # JOB STATE JOB_CREATED = 0 # Just Create...
# -*- coding: utf-8 -*- """ Created on Fri Feb 28 17:25:21 2014 @author: sb238920 """ # -*- coding: utf-8 -*- """ Created on Tue Jan 21 09:19:13 2014 @author: sb238920 To improve with inheritance To add Shapiro-Wilk and equal variance testing To remove the axes attributes """ import copy import sys import numpy as n...
#!/usr/bin/env python # # Copyright (C) 2008 The Android Open Source 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/LICENSE-2.0 # # Unless req...
"""Test the Shark IQ vacuum entity.""" from copy import deepcopy import enum from typing import Any, Iterable, List, Optional import pytest from sharkiqpy import AylaApi, SharkIqAuthError, SharkIqNotAuthedError, SharkIqVacuum from homeassistant.components.homeassistant import SERVICE_UPDATE_ENTITY from homeassistant....
# coding=utf-8 # # Copyright (c) 2014-2015 First Flamingo Enterprise B.V. # # 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 requi...
"""Provides functionality to interact with fans.""" from datetime import timedelta import functools as ft import logging from typing import Optional import voluptuous as vol from homeassistant.components import group from homeassistant.const import SERVICE_TURN_ON, SERVICE_TOGGLE, SERVICE_TURN_OFF from homeassistant....
# Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de> # License: BSD 3 clause (C) 2014 # This is the standard t-SNE implementation. There are faster modifications of # the algorithm: # * Barnes-Hut-SNE: reduces the complexity of the gradient computation from # N^2 to N log N (http://arxiv.org/abs/1301....
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # 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...
""" A consent module for the satosa proxy """ import hashlib import json import logging from base64 import urlsafe_b64encode import requests from jwkest.jwk import RSAKey from jwkest.jwk import rsa_load from jwkest.jws import JWS from requests.exceptions import ConnectionError from ..internal_data import InternalResp...
from django.db import connection # Getting the SpatialBackend container and the geographic quoting method. from django.contrib.gis.db.backend import SpatialBackend, gqn # GeometryProxy, GEOS, Distance, and oldforms imports. from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.measure imp...
"""This module makes it easier to use other programs to process data. The Process class provides the low-level interface, which you can extend by subclassing. Processes run in the background, so users can still work with your application while they are running. If you don't care about that, you might like to look at P...
# -*- coding: UTF-8 -*- from unittest import TestCase class TestReadTetra(TestCase): import os from ...conf import env testfn = [env.datadir] + ['cubic_t200mm.g'] testfn = os.path.join(*testfn) def test_dim(self): from ..genesis import Genesis gn = Genesis(self.testfn) se...
""" Code generator script to make the Cython BLAS and LAPACK wrappers from the files "cython_blas_signatures.txt" and "cython_lapack_signatures.txt" which contain the signatures for all the BLAS/LAPACK routines that should be included in the wrappers. """ from collections import defaultdict from operator import itemge...
""" This class should be called in TournamentData once a new match has been created. It should exist for the players to keep track of round information as it is updated each round in TournamentData. """ __author__ = "Paul Council, Anand Patel" __version__ = "sprint3" class MatchData: """ Class to track the ma...
# Copyright (c) 2014 Baidu.com, 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 ...
# Copyright 2015 DataStax, 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 to in writing, s...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2008,2010-2011 Zuza Software Foundation # # This file is part of translate. # # translate 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...
# Copyright 2016 Chr. Hansen A/S and The Novo Nordisk Foundation Center for Biosustainability, DTU. # 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....
#!/usr/bin/env python # coding=utf-8 # Contributor: # Phus Lu <phus.lu@gmail.com> __version__ = '2.0.2' __password__ = '' import sys, os, re, time, struct, zlib, binascii, logging, httplib, urlparse, base64, wsgiref.headers try: from google.appengine.api import urlfetch from google.appengine.runti...
#!/usr/bin/env python2 ################################################## # GNU Radio Python Flow Graph # Title: Top Block # Generated: Wed Feb 24 15:07:57 2016 ################################################## if __name__ == '__main__': import ctypes import sys if sys.platform.startswith('linux'): ...
import io import os import unittest import universal_hooks from universal_hooks import _regex_from_dir, _make_dir_matchers, FileSystem, _run_dir, _run_pkg_dirs, \ TransactionInfo, UniversalHooksPlugin HOOK_NAMES = 'pre_config config resolved sack pre_transaction transaction'.split() class TestHooks(unittest.Tes...
"""" fileextn.py File Extensions Database and order of extension groups """ import os import sys import re import string import collections import peekextn compilerFileXtens = { ####### # Compiler and IR file extensions ########## "lds" : { 'desc' : "Linker Descriptor script"}, "ld" ...
# -*- coding: utf-8 -*- """Configure fixtures for unit and functional tests.""" import os import sys import pytest # from webob import multidict from sqlalchemy import create_engine from pyramid import testing from mars_street_view.models import ( DBSession, Base, Photo, CAMERAS ) try: TEST_DATABA...
"""The tests for the Legacy Mqtt vacuum platform.""" from copy import deepcopy import json from unittest.mock import patch import pytest from homeassistant.components import vacuum from homeassistant.components.mqtt import CONF_COMMAND_TOPIC from homeassistant.components.mqtt.vacuum import schema_legacy as mqttvacuum...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.conf import settings class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Path' db.create_table('...
import functools import shutil import tempfile import boto from dart.engine.emr.mappings import dynamodb_column_type from dart.engine.emr.step_runner import run_steps from dart.engine.emr.steps import prepare_step_paths, python_fix_partition_folder_names, hive_copy_to_table, \ impala_copy_to_table, hive_run_scrip...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.urlresolvers import reverse from reversion.revisions import default_revision_manager try: from reversion import create_revision except ImportError: # django-reversion >=1.9 from reversion.revisions import create_revision imp...
# coding: utf-8 # # Copyright 2015 The Oppia 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 requi...
from django.shortcuts import render from django.http import HttpResponse, Http404, JsonResponse from urllib import urlopen import json # Create your views here. typeFormURL = "https://api.typeform.com/v0/form/Zh7TEH?key=1b508a88a1331cf2c182cb136f6da1ebd880a299&completed=true" typeFormRSVP_URL = "https://api.typeform.c...
# Copyright 2011 OpenStack Foundation # 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 requ...
""" Generalized Linear Models with Exponential Dispersion Family """ # Author: Christian Lorentzen <lorentzen.ch@googlemail.com> # some parts and tricks stolen from other sklearn files. # License: BSD 3 clause import numbers import numpy as np import scipy.optimize from ...base import BaseEstimator, RegressorMixin ...
#!/usr/bin/python # Copyright 2008-2010 WebDriver committers # Copyright 2008-2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
""" Classificator flask API serving as UI backend and standalone API for the classify python module """ from classificator.classify import Classificator, load_sklearn_dataset from classificator import models from flask import Flask, abort, render_template, request, jsonify, redirect, url_for from flask.ext.navigation ...
from __future__ import print_function, division from sympy.core.core import C from sympy.core.sympify import _sympify, sympify from sympy.core.basic import Basic, _aresame from sympy.core.cache import cacheit from sympy.core.compatibility import ordered, xrange from sympy.core.logic import fuzzy_and class AssocOp(Ba...
import types import numpy as np import h5py from pyspawn.fmsobj import fmsobj from pyspawn.traj import traj import general as gen import os import shutil import complexgaussian as cg import datetime import time class simulation(fmsobj): """Simulation object contains the current state of the simulation. It is ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
''' Copyright (C) 2012 STFC 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 writi...
""" This module provides convenient functions to transform sympy expressions to lambda functions which can be used to calculate numerical values very fast. """ from __future__ import print_function, division import inspect import textwrap from sympy.core.compatibility import (exec_, is_sequence, iterable, NotIte...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Australian Government, Department of the Environment # # 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...
"""Transformers for missing value imputation""" # Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com> # Sergey Feldman <sergeyfeldman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings from time import time import numpy as np import numpy.ma as ma from scipy import spars...
""" For a given block visit, calculate the slew time, acquisition time, and science time based on data in the SDB """ import sys import time import datetime import string import numpy as np import mysql def getnightinfo(sdb, obsdate): return sdb.select('NightInfo_Id', 'NightInfo', 'Date=%s' % obsdate)[0][0] ...
# !/usr/bin/python import os import sys import foodblock import random import motko import pygame import logging from common import timing_function import argparse @timing_function def loadmotkos(path, amount, trainingloops, size, hiddenlayers, loadfromfile, test): loadedmotkos = [] motkoslist = os.listdir(os...
''' MFEM Example 18 - Serial/Parallel Shared Code This is a python translation of ex18.hpp note: following variabls are set from ex18 or ex18p problem num_equation max_char_speed specific_heat_ratio; gas_constant; ''' import numpy as np from mfem import mfem_m...
# Copyright 2015-2016 F5 Networks 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 to in ...
from rest_framework import serializers as ser from modularodm.exceptions import ValidationValueError from api.base.exceptions import InvalidModelValueError, JSONAPIException, Conflict from api.base.serializers import AllowMissing, JSONAPIRelationshipSerializer, HideIfDisabled from website.models import User from api...
''' old version of script to move from mysql to neo4j. migratedb.py should be used instead. ''' from py2neo import Graph, Node, Relationship import pymysql conn = pymysql.connect(host='localhost', user='root', db='cogat') cursor = conn.cursor() graph = Graph("http://graphdb:7474/db/data/") # import tasks sql = "sel...
from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponseBadRequest, HttpResponse from bootcamp.inventories.models import Inventory from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from bootcamp.inventories.forms import InventoryForm from django.contri...
import os import shutil import asyncio import logging import functools import contextlib from typing import List, Dict, Any, Callable, Tuple, Optional, AsyncIterator import synapse.exc as s_exc import synapse.common as s_common import synapse.telepath as s_telepath import synapse.lib.base as s_base logger = logging...
import datetime from django.db import models from django.conf import settings from django.db.models import F from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.dispatch import Signal AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User...
""" Parsers are used to parse the content of incoming HTTP requests. They give us a generic way of being able to handle various media types on the request, such as form content or json encoded data. """ import codecs from urllib import parse from django.conf import settings from django.core.files.uploadhandler import...
"""DXR's concept of version control systems The main entry points are `tree_to_repos`, which produces a mapping of roots to VCS objects for each version control root discovered under the provided tree, and `path_to_vcs`, which returns a VCS object for the version control system that tracks the given path. Currently su...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import hashlib impor...
# Copyright 2017 Google LLC. # # 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 the following disclaimer. # #...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo as model_zoo __all__ = ['Inception3', 'inception_v3'] model_urls = { # Inception v3 ported from TensorFlow 'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14.pth', } def in...
# -*- coding: utf-8 -*- # Copyright 2022 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Copyright 2015 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...
"""HTTP Client for asyncio.""" import asyncio import base64 import hashlib import os import sys import traceback import warnings import http.cookies import urllib.parse import aiohttp from .client_reqrep import ClientRequest, ClientResponse from .errors import WSServerHandshakeError from .multidict import MultiDictPr...
""" Statistical tools for time series analysis """ from statsmodels.compat.python import (iteritems, range, lrange, string_types, lzip, zip, map) import numpy as np from numpy.linalg import LinAlgError from scipy import stats from statsmodels.regression.linear_model import OLS, yule_walk...
import copy import json import mock import unittest import uuid from cfgm_common.vnc_db import DBBase from svc_monitor import config_db from svc_monitor import instance_manager from svc_monitor import snat_agent from vnc_api.vnc_api import * ROUTER_1 = { 'fq_name': ['default-domain', 'demo', 'router1'], 'par...
import csv from datetime import datetime from django.contrib.auth.decorators import login_required from django.views.decorators.cache import never_cache from django.contrib.auth import login as auth_login, authenticate from django.contrib.auth.views import login from django.core.urlresolvers import reverse from django....
"""The tests for the Rfxtrx light platform.""" import unittest import pytest from homeassistant.setup import setup_component from homeassistant.components import rfxtrx as rfxtrx_core from tests.common import get_test_home_assistant, mock_component @pytest.mark.skipif("os.environ.get('RFXTRX') != 'RUN'") class Tes...
"""Provide functionality to stream video source.""" import logging import secrets import threading from types import MappingProxyType import voluptuous as vol from homeassistant.const import CONF_FILENAME, EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from homeassistant.exceptions import HomeAssist...
# Copyright (c) 2013 OpenStack Foundation # # 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 ...
#!/usr/bin/env python # Created on: July 10, 2013 __author__ = "Sven Kreiss, Kyle Cranmer" __version__ = "0.1" import optparse parser = optparse.OptionParser(version=__version__) parser.add_option("-q", "--quiet", dest="verbose", action="store_false", default=True, help="Quiet output.") options,args = parser.parse...
import re from lib import BaseTest class CreateMirror1Test(BaseTest): """ create mirror: all architectures + all components """ runCmd = "aptly mirror create --ignore-signatures mirror1 http://mirror.yandex.ru/debian/ wheezy" def check(self): self.check_output() self.check_cmd_ou...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# # Copyright (c) 2011-2014 Exxeleron GmbH # # 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 agre...
# -*- coding: utf-8 -*- """ Comparison of solvers for the evaluation of g-functions using uniform and equal borehole wall temperatures. The g-function of a field of 6x4 boreholes is calculated for a boundary condition of uniform borehole wall temperature along the boreholes, equal for all boreholes. Th...
from textwrap import dedent import attr import pytest import xsimlab as xs from xsimlab.process import get_process_obj @xs.process class SomeProcess: """Just used for foreign variables in ExampleProcess.""" some_var = xs.variable( groups="some_group", intent="out", global_name="some_global_var" ...
import os from zope.interface import implements from twisted.python import usage, reflect from twisted.application import internet, service, strports from twisted.scripts.mktap import IServiceMaker from twisted.plugin import IPlugin from twisted.web2 import static, iweb, log, server, channel, vhost from twisted.web2....
""" IR Construction Tests """ from __future__ import print_function, absolute_import import copy import itertools import re import textwrap import unittest from array import array from . import TestCase from llvmlite import ir from llvmlite import binding as llvm from llvmlite import six int1 = ir.IntType(1) int8 ...
#!/usr/bin/env python """ A fast minimal static website builder. Minimalsite generates web pages from a source file hierarchy. It supports markdown and textile syntax, but plain txt and html can be evenly used. Template files are python modules, providing huge flexibility and keeping the codebase tiny and simple. """...
#!/usr/bin/env python #-*- coding: utf-8 -*- # # # #import wxversion #wxversion.select('2.8') #import sqlite3 import handy_utils as HUD import datetime import pout from db_related import TableAware, SQConnect # ################## Customer Related Tables ########################## # Customer Codes sql_file = '../...
from contextlib import closing, contextmanager import StringIO as s import unittest as t from lambdak import * # A helper class to test attribute access. class A: pass # Helper functions for the tests. def inc(x): return x + 1 def double(x): return x * 2 class test_lambdak(t.TestCase): def test_init_k_x(self): ...
"""Collection of Keras models for hierarchical GANs.""" # Imports from keras.layers.core import Dense, Reshape, RepeatVector, Lambda, Dropout from keras.layers import Input, merge from keras.models import Model from keras.layers.wrappers import TimeDistributed from keras.layers.recurrent import LSTM from keras.layers....
import abc import contextlib as cl import itertools as it import lmfit as lf import numpy as np import chemex.containers.plot as ccp import chemex.experiments as ce import chemex.helper as ch import chemex.nmr.rates as cnr import chemex.parameters.helper as cph class Experiments: def __init__(self): sel...
#!/usr/bin/python # Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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 n...
#!/usr/bin/env python """cythonize Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'scipy'. The number of parallel Cython processes is controlled by the environment variable SCIPY_NUM_CYTHONIZE_JOBS. If not set, determined from the number of CPUs. Checks pyx files to s...
#!/usr/bin/env python import random from random import randrange import sys from time import time from datetime import datetime #import string #from string import * import os from os import system from os import unlink from subprocess import * ##### Path Setting ##### is_win32 = (sys.platform == 'win32') if not is_w...
import asyncio import cmd import functools import json import logging import os import sys # TODO use readline for history ? # import readline import contextlib import websockets from aiohttp import web from io import StringIO from jsonrpcserver.aio import methods from jsonrpcclient.websockets_client import WebSock...
# -*- coding: utf-8 -*- import unittest from objectchecker import ObjectChecker # Config options = { 'messageTemplate': { 'invalid' : "Value of Field `{{fieldName}}` is not valid. Got `{{fieldValue}}`, but require {{checkerName}} = {{checkerOption}}", 'missing' : "Missing {{fieldName}}", ...
# coding: utf-8 # In[1]: import numpy as np import numpy.random as npr import matplotlib.pyplot as plt get_ipython().magic(u'matplotlib inline') # In[34]: from sklearn.datasets import load_digits data = load_digits() X_tot,Y_tot = load_digits().data,load_digits().target # In[8]: len(X_tot) # In[9]: split = ...
import numpy as np def binned_statistic(x, values, statistic='mean', bins=10, range=None): """ Compute a binned statistic for a set of data. This is a generalization of a histogram function. A histogram divides the space into bins, and returns the count of the number of points i...