text
stringlengths
12
6.59M
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2009-2011 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This module contains helper functions to unpack archives or file systems. Most of the commands are pretty self explaining. The result o...
import os import math import glob import numpy import vtktools from fluidity_tools import stat_parser from sympy import * from numpy import array,max,abs meshtemplate=''' Point (1) = {0.0, 0.0, 0, 1.0}; Point (2) = {0.0, 1.0, 0, 1.0}; Line (1) = {1, 2}; Extrude {1,0,0} { Line{1}; } // Volume number for whole domai...
# encoding: utf-8 from __future__ import unicode_literals from codecs import register from pkg_resources import iter_entry_points from ...package.loader import load from ..compat import py2, str from ..exc import TranslationError from .context import Context log = __import__('logging').getLogger(__name__) class ...
#!/usr/bin/env python # Copyright (c) 2011, Johan Haals <johan.haals@gmail.com> # All rights reserved. import hashlib import os import sys import ConfigParser as configparser import requests from os.path import join from datetime import datetime from optparse import OptionParser from poster.encode import multipart_enc...
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2009-2016 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This module contains helper functions to unpack archives or file systems. Most of the commands are pretty self explaining. The result o...
import os import stat import inspect import paramiko from confiture.schema.containers import Value from confiture.schema.types import String from marty.remotemethods import DefaultRemoteMethodSchema, RemoteMethod from marty.datastructures import Tree, Blob # Monkey-patch Paramiko in order to provide a listdir funct...
############################################################################### # PowerSphericalPotential.py: General class for potentials derived from # densities with two power-laws # # amp # rho(r)= --------- # ...
# # # # import my stuff from myscripts import write_batchfile from myscripts import commit_batchfiles from myscripts import show_jobs # path to PASC_inference library library_path = "~/soft/PASC_inference"; # nmbfilesmax filename_solution = "data/signal1D/signal1D_solution.bin"; problem_name = "test_signal1D"; # no...
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2009-2016 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This module contains helper functions to unpack archives or file systems. Most of the commands are pretty self explaining. The result o...
import sublime import os import shutil def update_resources(binname): # from https://github.com/weslly/ColorPicker/blob/master/sublimecp.py targetdir = os.path.join(sublime.packages_path(), 'User', 'SendText+', 'bin') targetpath = os.path.join(targetdir, binname) respath = 'Packages/SendText+/bin/' + ...
import time import collections import sys import traceback from functools import partial # TODO add in requirements.txt from enum import Enum # Remove when switching to py3 from multiprocessing import Process, Queue from unittest import skipIf from cassandra import ConsistencyLevel from cassandra.cluster import Clus...
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2009-2016 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This module contains helper functions to unpack archives or file systems. Most of the commands are pretty self explaining. The result o...
"""VCD tracker debug.""" from argparse import ArgumentParser from hdltools.vcd.tracker import VCDValueTracker from hdltools.patterns import Pattern if __name__ == "__main__": parser = ArgumentParser() parser.add_argument("vcd") args = parser.parse_args() with open(args.vcd, "r") as data: v...
from __future__ import absolute_import import numpy as np import operator from ._search import parse_query __all__ = [ 'NumericMetadata', 'BooleanMetadata', 'LookupMetadata', 'TagMetadata', 'DateMetadata', 'CompositionMetadata', 'PrimaryKeyMetadata', 'is_metadata' ] class _BaseMetadata(object): '''Abstrac...
from __future__ import unicode_literals from builtins import str from copy import deepcopy import mock import jmespath import json from collections import defaultdict from django.test import TestCase from elasticsearch.exceptions import ConnectionTimeout from sys import maxsize from seqr.models import Family, Sample,...
import re import logging import sqlalchemy as sa import sqlalchemy.exc as sqla_exc from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import class_mapper, exc as orm_exc from sqlalchemy.orm.properties import ColumnProperty from sqlalchemy_utils import get_columns, get_hybrid_properties, get_mappe...
import nmap import sys import netifaces from time import sleep import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # scapy, psst! from scapy.all import * import subprocess import os import printings RED = "\033[1;31m" NORMAL = "\033[0;0m" GREEN = "\033[1;32m" YELLOW = "\033[1;93m" conf.verb = ...
import uuid from django.shortcuts import render from django.http import HttpResponseRedirect from .models import Survey, Question, Answers from .forms import SurveyForm # Create your views here. def survey_list( request, *args, **kwargs ): survey_list = Survey.objects.filter( published = True ) template_name = "s...
import numpy as np import sys import code import scipy.io as sio import re import os import time import warnings from operator import itemgetter def reparent(swc_path, data, id): cur_id = id newparent = -1 while cur_id != -1: line = data[cur_id - 1] oldparent = line['parent'] line['parent'] = newparent newp...
# Copyright 2018 The Bazel 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 applicable la...
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-08-18 13:20 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import shop.models.fields from shop.models.notification import Notify def forwards(apps, schema_e...
from sympy.mpmath.libmp import bitcount from sympy.core.compatibility import combinations_with_replacement def binomial_coefficients(n): """Return a dictionary containing pairs {(k1,k2) : C_kn} where C_kn are binomial coefficients and n=k1+k2.""" d = {(0, n):1, (n, 0):1} a = 1 for k in xrange(1, n/...
import os from lib.which import which import subprocess import lib.logger import logging log = logging.getLogger(__name__) class VirtualenvError(Exception): """Generic Virtualenv error""" class Virtualenv(object): """Virtualenv class, creates a virtualenv""" def __init__(self, configuration): s...
""" Second quantization operators and states for bosons. This follow the formulation of Fetter and Welecka, "Quantum Theory of Many-Particle Systems." """ from sympy import ( Basic, Function, var, Mul, sympify, Integer, Add, sqrt, Number, Matrix, zeros, Pow, I, S,Symbol, latex, cache ) from sympy.utilities.d...
# Copyright 2013-2016 Aerospike, 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 writi...
from sympy.functions import sqrt, sign, root from sympy.core import S, Wild, sympify, Mul, Add, Expr from sympy.core.function import expand_multinomial, expand_mul from sympy.core.symbol import Dummy from sympy.polys import Poly, PolynomialError def _mexpand(expr): return expand_mul(expand_multinomial(expr)) def ...
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, Pow) from sympy.simplify.simplify import rad_rationalize from sympy.ntheor...
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from datetime import datetime, timedelta from tempfile import mkdtemp from shutil import rmtree from os.path ...
import errno import os import socket import stat import sys import time from contextlib import contextmanager from datetime import datetime, timezone, timedelta from functools import partial from getpass import getuser from io import BytesIO from itertools import groupby from shutil import get_terminal_size import msg...
from traits.api import DelegatesTo, Property from enable.tools.viewport_zoom_tool import ViewportZoomTool class MappingZoomTool(ViewportZoomTool): zoom_level = DelegatesTo('component') min_level = Property(lambda self: self.component.min_level) max_level = Property(lambda self: self.component.max_level) ...
""" The new Finite State Machine module. This replaces the modules previously called FSM.py (now called ClassicFSM.py). """ from direct.showbase import DirectObject from direct.directnotify import DirectNotifyGlobal from direct.showbase import PythonUtil import types import string class FSMException(Exception): ...
#!/bin/python from collections import namedtuple import json import os import sys from subprocess import check_output, CalledProcessError import requests import sh # Append to existing env, to avoid losing PATH etc. # TODO-PAT: This shouldn't be hardcoded env = os.environ.copy() env['ETCD_AUTHORITY'] = 'kubernetes-mas...
import os import matplotlib.pyplot as plt import numpy as np import warnings from uncertainties import ufloat, umath, unumpy import src.constants as constants from src.helpers import sum_dict_values constants.init() def get_bpt_fluxes(rp, plot_type='NII'): fluxes = {} if 'H-Alpha' in rp.emProfiles: i...
# Utils.py # Some tools. from django.http import HttpResponse from django.conf import settings from django import http from webengine.utils.exceptions import * class _CheckRenderMode(object): """ Callable object that will act like a decorator. Wraps calls to view methods. Determine which ...
#!/usr/bin/python import sys if len(sys.argv) < 2: print 'Usage:',sys.argv[0],'nohup.out' sys.exit(0) avgFit, champFit, stdErr, stdDev = [],[],[],[] f = open(sys.argv[1],'r') for line in f: if str.startswith(line,'Champion fitness'): champFit.append(int(line.split()[2])) elif 'overall_average...
# fMBT, free Model Based Testing tool # Copyright (c) 2012, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distribut...
# -*- coding: utf-8 -*- from __future__ import absolute_import __version__ = '0.8.0-dev' __author__ = 'Steven Loria' __license__ = "MIT" from marshmallow.serializer import Serializer from marshmallow.utils import pprint __all__ = [ 'Serializer', 'pprint' ]
# Copyright 2019, 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 agreed to in writing...
""" The external interface for the v1pysdk package. Right now there is only one class, "V1Meta", which exposes the types and operations found in a specified VersionOne server (defaulting to localhost/VersionOne.Web). """ from v1meta import V1Meta from v1poll import V1Poll
#!/usr/bin/env python """ Usage: thingpin -h thingpin [options] run thingpin create-config thingpin install-service Monitor GPIO pins and update AWS IoT via MQTT. Arguments: run run the thingpin monitor create-config generate sample YAML thingpin-config.yml and exit i...
import sys import os import h5py import cv2 import numpy as np import logging import json import yaml import ruamel.yaml import traceback from abc import ABCMeta from abc import abstractmethod from gi.repository import Vips logger = logging.getLogger(__name__) ''' Writer Classes. All writers make use of the `with ...
import numpy as np from scipy.optimize import minimize from ase.lattice.cubic import BodyCenteredCubic from ase.constraints import FixAtoms, StrainFilter from ase.optimize import FIRE from ase.build import bulk from ase.calculators.lammpslib import LAMMPSlib from ase.units import GPa # unit conversion from ase.latti...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
import numpy as np import sys from theano import function from theano import tensor as T _, model_path, sigma = sys.argv from pylearn2.utils import serial model = serial.load(model_path) from pylearn2.config import yaml_parse dataset = yaml_parse.load(model.dataset_yaml_src) dataset = dataset.get_test_set() from pyle...
""" # lint-amnesty, pylint: disable=django-not-configured URLs for LMS """ from config_models.views import ConfigurationModelCurrentAPIView from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib.admin import autodiscover as django_auto...
# Copyright 2012 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...
import os import re import csv import glob from datetime import datetime from taca.utils.filesystem import chdir, control_fastq_filename from taca.illumina.Runs import Run from taca.utils import misc from flowcell_parser.classes import RunParametersParser, SampleSheetParser, RunParser, DemuxSummaryParser import loggi...
import os import re import csv import glob import shutil import copy import json from datetime import datetime from taca.utils.filesystem import chdir, control_fastq_filename from taca.illumina.Runs import Run from taca.utils import misc from flowcell_parser.classes import RunParametersParser, SampleSheetParser, RunPar...
from ckan.plugins.core import SingletonPlugin, implements from ckanext.harvest.interfaces import IHarvester from ckanext.harvest.harvesters import HarvesterBase from ckanext.harvest.model import HarvestJob, HarvestObject, HarvestGatherError from sqlalchemy import text import ckan.plugins as p from ckan.lib.munge import...
import numpy as np from cs231n.layers import * from cs231n.layer_utils import * class TwoLayerNet(object): """ A two-layer fully-connected neural network with ReLU nonlinearity and softmax loss that uses a modular layer design. We assume an input dimension of D, a hidden dimension of H, and perform classific...
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # 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 ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import argparse import datetime import dateutil.parser import json import logging as log import os import subprocess import sys import urlparse import webbrowser import pytz import requests from requests_futures.sessions import FuturesSession from gi.repository import Gt...
""" Wrappers for aggregating CHIANTI data and doing fundamental atomic physics calculations. This should eventually be deprecated in favor of using ChiantiPy. """ import os import logging import copy import itertools import datetime import pickle import numpy as np import h5py from scipy.interpolate import interp1d, ...
from tasks.meta import OBSColumn, DENOMINATOR from tasks.util import ColumnsTask from tasks.tags import SectionTags, SubsectionTags, UnitTags from collections import OrderedDict class NHSColumns(ColumnsTask): def requires(self): return { 'sections': SectionTags(), 'subsections': S...
# @(#) $Id: Container.py,v 1.59 2012/06/21 15:24:08 acaproni Exp $ # # Copyright (C) 2001 # Associated Universities, Inc. Washington DC, USA. # # Produced for the ALMA project # # This library is free software; you can redistribute it and/or modify it under # the terms of the GNU Library General Public License as publi...
#!/usr/bin/env python """ SlipStream Client ===== Copyright (C) 2013 SixSq Sarl (sixsq.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-...
#!/usr/local/bin/python """All functions to handle various updates for GhostBSD.""" from subprocess import Popen, PIPE, call ustation_db = '/var/db/update-station' pkg_lock_file = f'{ustation_db}/lock-pkgs' def get_pkg_upgrade(option): pkg_upgrade = Popen( f'pkg upgrade -n{option}', shell=True, ...
# -*- coding: UTF-8 -*- ## Copyright 2013 Luc Saffre ## This file is part of the Lino project. ## Lino is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option)...
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
# -*- coding: utf-8 -*- # urls.py used as base for developing wirecloud. from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns import wirecloud.platform.urls admin.autodiscover() urlpatterns = patterns('', # Show...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ @author: R. Patrick Xian """ from __future__ import print_function, division import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.figure import figaspect from matplotlib.font_manager import FontProperties import mat...
import pika_amqp import pika_aync class AMQPDriver(object): def __init__(self, config): if not config.async_engine: self._amqp = pika_amqp else: self._amqp = pika_aync self._config = config self._reader = None def get_reader(self, queue, preprocessor=N...
import MySQLdb import urlparse import os urlparse.uses_netloc.append('mysql') try: if 'DATABASES' not in locals(): DATABASES = {} if 'DATABASE_URL' in os.environ: url = urlparse.urlparse(os.environ['DATABASE_URL']) # Ensure default database exists. DATABASES['default'] = DATA...
# -*- coding: utf-8 -*- import sys import time import asyncio import uvloop asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) import traceback import logging import readline import discord import josecommon as jcommon import ext.jose as jose_bot import jcoin.josecoin as josecoin import joseconfig as jconfig impo...
""" This module performs schematic drawing using circuitikz from a netlist. >>> from lcapy import Schematic >>> sch = Schematic() >>> sch.add('P1 1 0.1; down') >>> sch.add('R1 3 1; right') >>> sch.add('L1 2 3; right') >>> sch.add('C1 3 0; down') >>> sch.add('P2 2 0.2; down') >>> sch.add('W 0 0.1; right') >>> sch.add('...
import datetime from scrape import fix_url vxvault_config = [('http://vxvault.net/ViriList.php', "//div[@id='page']/table/tr[td]", {"date": lambda row: datetime.datetime.strptime( str(datetime.datetime.now().year) + "-" + row[0][0].text, "%Y...
import logging import os from geoalchemy2 import Geometry import pandas as pd from sqlalchemy import func from sqlalchemy.ext.declarative import DeclarativeMeta from sqlalchemy.orm import aliased, Query from .database import database as db, CreateTableAs from .utils import DataLoader # Set up logging system. loggin...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import time import tensorflow as tf from six.moves import range import numpy as np import zhusuan as zs from examples import conf from examples.utils im...
import subprocess import os import sys while True: if os.path.isfile('quit.txt'): kill = open('quit.txt').read() os.remove('quit.txt') if kill == 'update': exit(15) break params = [sys.executable, 'appuselfbot.py'] for arg in sys.argv[1:]: params.append(a...
__version__ = '2.7.0'
from abc import ABCMeta, abstractmethod import numpy as np import scipy.optimize from scipy.stats import multivariate_normal import random from apsis.utilities.logging_utils import get_logger class AcquisitionFunction(object): """ An acquisition function is used to decide which point to evaluate next. For...
''' WORK IN PROGRESS - BROKEN RIGHT NOW ''' import subprocess import sys import os import pdb from glob import glob import hashlib import base64 import csv filename = sys.argv[1] filename_without_path = os.path.basename(filename) csvfile = os.path.expanduser("~/Desktop/%s.csv") % filename_without_path print csvfile ...
#!/usr/bin/env python from __future__ import print_function import urllib import shutil import codecs import json import os from peyotl import (assure_dir_exists, download_large_file, get_logger, gunzip, gunzip_and_untar, unzip) from taxalotl.newick import no...
""" This module defines and draws the schematic components using circuitikz. The components are defined at the bottom of this file. Copyright 2015--2019 Michael Hayes, UCECE """ from __future__ import print_function from .latex import format_label from .schemmisc import Pos, Opts import numpy as np import sys mod...
from docx import Document from docx.shared import Mm __author__ = 'daniel' def jpg2docx(doc_name, img, w): document = Document() sections = document.sections section = sections[0] section.page_width = Mm(80) section.page_height = Mm(297) section.top_margin = Mm(0) section.bottom_margin = ...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
#! /usr/bin/env python # -*- coding:utf-8 #Recurrent Neural network with LSTM in Tensorflow # Special thanks: Harisson@pythonprogramming.net ''' File name:lstm_rnn.py Author: chimney37 Date created: 12/09/2017 Python Version: 3.62 ''' ''' We will use the MNIST data, using 60000 training samples and 100...
#!/usr/bin/python3 # This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. from threading import Timer import pytest from gosa.common.event import EventMaker...
# -*- coding: utf-8 -*- """ Created on Tue Jun 14 16:14:43 2016 @author: mschleck """ import os from astropy.table import Table, vstack from lcps_io import open_fits from astropy import log import slidingWindow def lcps_output(logtable, logfile, winSize, stepSize, Nneighb, minDur, maxDur,\ detectionThresh): ...
""" Acceptance tests for Home Page (My Courses / My Libraries). """ import datetime from uuid import uuid4 from opaque_keys.edx.locator import LibraryLocator from base_studio_test import StudioCourseTest from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.acceptance.pages.lms.accou...
import time import os import schedule from slackclient import SlackClient token = os.environ["SLACK_TOKEN"] lunch_room = "C1JF7S0BB" test_room = "C1K95FJ12" where_to_eat = "somewhere" orders = {} commands = { "help":"I understand the following:\n`help`\n`where <location>`\n`orders`\n`reset`", "where":"Looks ...
from urllib import parse import logging import requests from lxml import html # TODO: Detect redirect statuses class Vamp(object): def __init__(self, url, log_level=None): """ Args: string: url of the main site string: log_level of how much information you need ...
# -*- coding: utf-8 -*- """ Acceptance tests for Video. """ import os from unittest import skipIf from ddt import data, ddt, unpack from mock import patch from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from co...
#!/usr/bin/env python """Learn to reverse the words in a text.""" import logging import argparse class StoreIfNotUnderscore(argparse.Action): def __call__(self, parser, namespace, values, option_string): if values != '_': setattr(namespace, self.dest, values) if __name__ == "__main__": r...
from datetime import datetime from changes.config import db, queue from changes.models import Repository def sync_repo(repo_id): repo = Repository.query.get(repo_id) if not repo: return vcs = repo.get_vcs() if vcs is None: return repo.last_update_attempt = datetime.utcnow() ...
# # Copyright (c) 2012 FadingRed LLC # # 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, merge, publish, dis...
# -*- coding: utf-8 -*- # dictionary generating script # # Copyright 2008 (C) Changwoo Ryu # # 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.1 of the License, or (at yo...
#!/Users/takashi/.pyenv/shims/python import numpy as np import gausskernel from functools import partial def make_kmx(x_vec, ker): kmx = np.array([[ker(x_i, x_j) for x_j in x_vec] for x_i in x_vec]) return kmx def test_make_kmx(): x_vec = [[1. for i in range(3)] for j in range(5)] sol = make_kmx(x_...
# -*- encoding: UTF-8 -*- from cvn.parsers.read import parse_cvnitem from django.db import models import datetime class CvnItemManager(models.Manager): def create(self, item, user_profile): item = parse_cvnitem(item) reg = self.model(**item) reg.save() reg.user_profile.add(user_...
# -*- coding: utf-8 -*- """ legit.bootstrap ~~~~~~~~~~~~~~~ This module boostraps the Legit runtime. """ from clint import resources from clint.textui import colored import crayons from six.moves import configparser from .settings import legit_settings resources.init('kennethreitz', 'legit') try: config_file...
""" Module for skill model evaluation @author Siddharth Reddy <sgr45@cornell.edu> """ from __future__ import division import logging import random import time import math import copy from matplotlib import pyplot as plt from sklearn import cross_validation, metrics from scipy import stats import numpy as np from ....
# coding=utf-8 # 2020.3.28, create by David Yi; """ ``fish_object`` 包含的是一些和面向对象相关的函数和类。 """ from operator import attrgetter # common data type commonDataType = tuple([int, float, bool, complex, str, set, list, tuple, dict]) # 申明一个单例类 # 2018.2.13 create by David Yi, #11015 # 2018.4.20 5.19 edit, #19019,增加 docstrin...
# -*- coding: utf-8 -*- """ Script to "grep" the log files for mean/max brightness of all the images for each set of components. And to display these values. """ from __future__ import division import glob import os import platform import time import matplotlib.pyplot as plt import numpy if platform.node() == 'ano...
# flake8: noqa from django.forms import (BaseModelForm, model_to_dict, fields_for_model, save_instance, ValidationError, Media, MediaDefiningClass) from django.conf import settings DEFAULT_DATE_INPUT_FORMATS = settings.DATE_INPUT_FORMATS DEFAULT_DATETIME_INPUT_FORMAT...
""" mfuzf1 module. Contains the ModflowUzf1 class. Note that the user can access the ModflowUzf1 class as `flopy.modflow.ModflowUzf1`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <https://water.usgs.gov/nrp/gwsoftware/modflow2000/MFDOC/index.html?uzf_unsaturated_zo...
"""Let's Encrypt command line argument & config processing.""" from __future__ import print_function import argparse import glob import logging import logging.handlers import os import sys import traceback import configargparse import OpenSSL import six import letsencrypt from letsencrypt import constants from letse...
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """This module extends the TensorFlowOnSpark API to support Spark ML Pipelines. It provides a TFEstimator class to fit a TFModel using TensorFlow. The TFEstimator will actually sp...
import inspect import matplotlib import matplotlib.pyplot as plt import numpy as np import matplotlib.colors as colors import matplotlib.pyplot as mpl_plt import matplotlib.colors as mpl_colors import matplotlib.cm as cmx import time import pandas as pd def plot_bar(ax, tick_labels, bar_values, color=None, title='...
import numpy as np import logging def interpolate2height_old(var,height,level): """ Interpolate 3d variable to a given height :param var: the 3d array to be interpolated, 1st axis is vertical :param height: the 3d array of heights of the nodes on which v is defined :param level: the targe...
# pylint: disable=W0231,E1101 import collections import warnings import operator import weakref import gc import numpy as np import pandas.lib as lib import pandas as pd from pandas.types.common import (_coerce_to_dtype, _ensure_int64, needs_i8_conve...