text
stringlengths
12
6.59M
from __future__ import print_function import sys import re import datetime import os, hashlib, base64 import logzero from logzero import logger DEFAULT_FORMAT = '%(color)s[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)s' logfmt = logzero.LogFormatter(fmt=DEFAULT_FORMAT, datefmt="%Y-%m-%d ...
import os import sys import time import hmac import json import base64 import requests import exceptions import xml.dom.minidom from hashlib import sha1 from client import common from email.utils import formatdate import xml.sax ##=================================== ## Global vars ##==================================...
import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator import math from sys import maxsize linewidth = 1.5 xoffset = 0.5 color = "k" xgrid = False # class to encapsulate the fitness function, i.e., # how good is a level using the specified set of weights and # interval. class Classifier: # ...
#!/usr/bin/env python # # Tag To Header # Version 2.0.1 # By Joe Hiatt, Scott Kennedy(1), Brendan Kohrn and Mike Schmitt(1) # (1) Department of Pathology, University of Washington School of Medicine, Seattle, WA 98195 # March 24, 2014 # # Isolate duplex tags, move them from within the sequenced read to the header regio...
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.generic import GenericForeignKey from django.db import models, router, transaction, IntegrityError from django.db.models.query import QuerySet from django.template.defaultfilters import slugify as default_slugify from django.uti...
# -*- coding: utf-8 -*- import datetime import json from copy import deepcopy from marshmallow import Schema, fields, post_load from marshmallow.validate import OneOf from tahiti.models import * def partial_schema_factory(schema_cls): schema = schema_cls(partial=True) for field_name, field in list(schema.fiel...
import random import tca_ng.cells class Automaton: topology = None generation = 0 cycle = 40 def get_cycle_time(self): return self.generation % self.cycle def update(self): for cell in self.topology.endpoint_cells: rule = cell.endpoint_rule_class(cell) ...
# pool.py # # spread requests among connections to multiple nodes in a Cassandra cluster """ Quick start: >>> my_seed_nodes = ['192.168.2.14', '192.168.2.15', '192.168.2.16'] >>> mypool = CassandraClusterPool( ... my_seed_nodes, keyspace='MyKeyspace', pool_size=10) >>> mypool.startService() >>> mypool.get('Key12345...
# pool.py # # spread requests among connections to multiple nodes in a Cassandra cluster """ Quick start: >>> my_seed_nodes = ['192.168.2.14', '192.168.2.15', '192.168.2.16'] >>> mypool = CassandraClusterPool(my_seed_nodes, keyspace='MyKeyspace', pool_size=10) >>> mypool.startService() >>> mypool.get('Key12345', 'Som...
"""Main PAC class.""" import numpy as np from scipy.signal import hilbert from .utils import pac_vec from .pacstr import pacstr from .spectral import spectral from .methods import compute_pac, _kl_hr from .surrogates import compute_surrogates from .normalize import normalize from .visu import PacPlot from .stats impor...
from PySide import QtCore from model import * from time import sleep from threading import Thread import serial import serial.tools.list_ports import pickle class Controller(Thread): def __init__(self, exp=[], incubator=None): Thread.__init__(self) self.experiment = exp self.pastLigh...
from django.views import generic from django.conf import settings from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied from django.contrib.auth.forms import UserCreationForm from django.contrib import messages from .forms import FullUserCreationForm class GetPublishedObjec...
# Copyright (c) 2008 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
#!/usr/bin/env python # # Copyright 2012 Dominic May # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import os import re from log import log class UnsupportedFileException(Exception): def __init__(self, filename, mimetype): super().__init__() self.filename = filename self.mimetype = mimetype class FileLoaderBase: class Sheet: def __init__(self, name): self.name = name def getColumn...
# Copyright 2015 Metaswitch Networks # # 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 w...
"""IPython terminal interface using prompt_toolkit""" import asyncio import os import sys import warnings from warnings import warn from IPython.core.async_helpers import get_asyncio_loop from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC from IPython.utils import io from IPython.utils.py...
# -*- coding: utf-8 -*- import hashlib from stock.serializers import StockItemSerializer, LocationSerializer from part.serializers import PartSerializer import plugins.plugin as plugin class BarcodePlugin(plugin.InvenTreePlugin): """ The BarcodePlugin class is the base class for any barcode plugin. """...
import os from fontbakery.status import PASS, FAIL, WARN, INFO, SKIP from fontbakery.section import Section from fontbakery.callable import check, disable from fontbakery.message import Message from fontbakery.fonts_profile import profile_factory from fontbakery.profiles.opentype import OPENTYPE_PROFILE_CHECKS from fo...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import json import logging import re import socket import time import traceback from telemetry.core import exceptions from telemetry import de...
# Copyright 2013 Huawei Technologies Co.,LTD. # 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 # # Unl...
# Copyright 2016 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...
#!/usr/bin/env python3 # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
from keras.layers.core import Lambda from keras.models import Sequential from tensorflow.python.framework import ops import keras.backend as K import tensorflow as tf import numpy as np import keras import cv2 from utils.utils import preprocess_input from keras.models import load_model import pickle import h5py def re...
import os import re import csv import sys import json import pickle import pprint import urllib import hashlib import logging import optparse import requests import subprocess import webbrowser import oauthlib.oauth1 from money import Money from pprint import pprint from datetime import datetime LOGGING_DISABELED = 10...
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize(*testing.product({ 'shape': [(3, 4), ()], 'dtype': [n...
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from pants.backend.jvm.subsystems.zinc import Zinc from pants.backend.jvm.targ...
#! /usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 Grzegorz Sobański # 2012 Juan Fernando Jaramillo # # Version: 2.2 # # - adds the commits to trac # based on post-receive-email from git-contrib # import re import os import sys from subprocess import Popen, PIPE, call # config TRAC_ENV = ...
import datetime import factory from django.template.defaultfilters import slugify from . import models class BaseFactory(factory.django.DjangoModelFactory): FACTORY_FOR = models.Base FACTORY_DJANGO_GET_OR_CREATE = ('romanized_name',) ABSTRACT_FACTORY = True class AlbumFactory(BaseFactory): FACTORY...
import tempfile import requests import os import signal import json import time from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.b...
import requests import sys from .models import Message class Telegram: # TODO ? : Convert this into a simple array # and get value by doing "on_"+"value" handlerTypeCallback = { "update": "on_update", "forward_from": "on_forward", "reply_to_message": "on_reply", "text": "on...
# -*- coding: utf-8 -*- """ Created on Tue Oct 18 09:11:38 2016 @author: Admin """ from __future__ import division import numpy as np import matplotlib.pyplot as plt N = 2 t = 3.1556e7; dt = t/360 n = int(t/dt) G = 6.67e-11 Ms = 1.989e30 Me = 5.972e24 M = np.array([Ms,Me]) AU = 149597871000 e = 0.05*AU ip = np.a...
#!/usr/bin/python # -*- coding: utf-8 -*- from HK1980 import * import sys import os import csv import codecs import csv, codecs, cStringIO from optparse import make_option, OptionParser class UTF8Recoder: """ Iterator that reads an encoded stream and reencodes the input to UTF-8 """ def __init__(self, f, encodi...
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. from __future__ import absolute_import from . import db import logging logger = logging.getLogger(__name__) applications = {} # name -> dict of info prioriti...
from __future__ import print_function import functools import os import pkg_resources import random import traceback import unittest import numpy import cupy from cupy import internal from cupy.testing import array from cupy.testing import parameterized def _call_func(self, impl, args, kw): try: result...
''' Convienence methods on VTK routines only ''' import ddapp.vtkAll as vtk from ddapp.shallowCopy import shallowCopy import numpy as np def thresholdPoints(polyData, arrayName, thresholdRange): assert(polyData.GetPointData().GetArray(arrayName)) f = vtk.vtkThresholdPoints() f.SetInput(polyData) f.Th...
#!/usr/bin/env python import psycopg2 from psycopg2 import pool import os from datetime import datetime import threading def read_some_lines(file_object, chunk_size=1024): while True: data = file_object.readlines(chunk_size) if not data: break yield data class threadedPopulate(threading.Thr...
""" Code written by Jacob Lange. """ from __future__ import division, print_function import numpy as np from matplotlib import pyplot as plt from sklearn.svm import LinearSVC from sklearn import grid_search from astroML.utils import completeness_contamination from os import path import classifier def jakes_code(m_...
"""Production settings and globals.""" from os import environ from base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """ Get the envi...
import contextlib import functools import inspect import os import random import traceback import unittest from unittest import mock import warnings import numpy import cupy from cupy.core import internal from cupy.testing import array from cupy.testing import parameterized import cupyx import cupyx.scipy.sparse try...
#!/usr/bin/env python #===- cindex-dump.py - cindex/Python Source Dump -------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===---------------------------------------...
# coding=utf-8 from proposition import * # ----- Final patches ----- def patch_ott(ott): # troublemakers. we don't use them print '| Flushing %s viruses' % ott.taxon('Viruses').count() ott.taxon('Viruses').prune() print '-- more patches --' # Romina 2014-04-09: Hypocrea = Trichoderma. # I...
from .location_schema import Location from marshmallow import Schema, fields, post_dump from .location_api_url import LocationUrl class LocationByPointQueryString(Schema): point = fields.Str() includeEntityTypes = fields.Str() includeNeighborhood = fields.Int( default=0 ) include = fields....
# coding: utf-8 """ jinja2schema ============ Type inference for Jinja2 templates. See http://jinja2schema.rtfd.org/ for documentation. :copyright: (c) 2014 Anton Romanovich :license: BSD """ __title__ = 'jinja2schema' __author__ = 'Anton Romanovich' __license__ = 'BSD' __copyright__ = 'Copyright 2014 Anton Roman...
""" The main client class. This contains a definition for :class:`.Client` which is used to interface primarily with Discord. .. currentmodule:: curious.core.client """ import collections import enum import importlib import inspect import logging import re import sys import traceback import typing from types import ...
# ***** BEGIN GPL LICENSE BLOCK ***** # # # This program 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 2 # of the License, or (at your option) any later version. # # This program is distribute...
#!/usr/bin/env python """ This module implements the main Custodian class, which manages a list of jobs given a set of error handlers, and the abstract base classes for the ErrorHandlers and Jobs. """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project...
# coding: utf-8 from __future__ import unicode_literals, division """ This module implements the main Custodian class, which manages a list of jobs given a set of error handlers, the abstract base classes for the ErrorHandlers and Jobs. """ import six from six.moves import filter __author__ = "Shyue Ping Ong, Willi...
# Copyright 2010-2012 RethinkDB, all rights reserved. from setuptools import setup, Extension from distutils.command.build_ext import build_ext from distutils.errors import DistutilsPlatformError, CCompilerError, DistutilsExecError import sys class build_ext_nofail(build_ext): # This class can replace the build_e...
import copy import os import re import shutil import subprocess import threading import time import yaml from contextlib import suppress from abc import ABCMeta, abstractmethod from astropy.io import fits from astropy.time import Time import astropy.units as u from pocs.base import PanBase from pocs.utils import curr...
import networkx as nx import pandas as pd def load_seventh_grader_network(): # Read the edge list df = pd.read_csv('datasets/moreno_seventh/out.moreno_seventh_seventh', skiprows=2, header=None, sep=' ') df.columns = ['student1', 'student2', 'count'] # Read the node metadata m...
# -*- coding: utf-8 -*- import hashlib import os import stat from os.path import dirname, exists, join def test_dropbox_is_created_if_it_does_not_exist(): from shutil import rmtree # assemble a 'safe' directory location inside our package # and make sure it does not exist dropbox_root = join(dirname(_...
import utils import logging import re import json from lxml import etree import time import datetime from lxml.html import fromstring, HtmlElement # can be run on its own, just require a bill_id def run(options): bill_id = options.get('bill_id', None) if bill_id: result = fetch_bill(bill_id, options...
#!/usr/bin/env python from osdf import OSDF import logging import importlib from Util import * class iHMPSession(object): check_python_version(name="Cutlass") """ The iHMP Session class. This class allows you to connect with an OSDF instance and begin analysis of iHMP data. It produces skeletons of a...
import copy import logging import os import random import time from . import errors from . import cloudbase try: from pyvsphere.vim25 import Vim, ManagedObject pyvsphere_available = True except ImportError: pyvsphere_available = False class VSphereProvider(cloudbase.Provider): def __init__(self, cloud...
"""The admin.""" from flask import redirect, request, url_for from flask.ext.admin import Admin from flask.ext.admin.base import MenuLink, expose from flask.ext.admin.contrib.sqla import ModelView from flask.ext.login import current_user from xmas.core import db from xmas.models import Event, Role, User __all__ = 'i...
import base64 import configparser import codecs import commonware import datetime import fnmatch import json import os import polib import requests import silme.core import silme.format.properties import StringIO import traceback import urllib import zipfile import hashlib from django.conf import settings from django...
import copy import math import pytz from datetime import datetime from fnmatch import fnmatch from mock import patch, call, MagicMock from .base import TestCase from django.conf import settings from graphite.render.datalib import TimeSeries from graphite.render import functions from graphite.render.functions import ...
# 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/. """gameobjects.py: game objects""" import util class GameObject: """Superclass of all game objects, has id and bb...
from sympy.core.add import Add from sympy.core.basic import C, sympify, cacheit from sympy.core.singleton import S from sympy.core.numbers import igcdex from sympy.core.function import Function, ArgumentIndexError from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.elementary.exponential impo...
import os,re from waflib import Task,Errors,Node,TaskGen,Configure,Node,Logs,Context from brick_general import ChattyBrickTask def configure(conf): conf.load('brick_general') """This function gets called by waf upon loading of this module in a configure method""" if not conf.env.BRICK_LOGFILES: conf.env.BRICK_LO...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals # Django settings for dbaas project. import os.path import sys # If is running on CI: if CI=1 or running inside jenkins CI = os.getenv('CI', '0') == '1' # Include base path in system path for Python old. syspath = os.path.abspath(os.pat...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import simple_audit import logging import datetime from datetime import date, timedelta from django.db import models, transaction, Error from django.db.models.signals import pre_save, post_save, pre_delete from django.contrib.auth.models i...
""" .. module:: star :platform: Unix, OSX :synopsis: A module of methods for working with the STAR RNA alignment program into additional formats. .. moduleauthor:: Daniel Gaston <daniel.gaston@dal.ca> """ from ddb_ngsflow import pipeline def star_paired_uncompressed_basic(job, config, name, samples): ...
''' Created on 2014-9-3 @author: songwensheng ''' import WeixinIF from lxml import etree import sys import os import web import time class WxTextPlugin(WeixinIF.TextPlugin): def __init__(self,xml,ctx,usr): WeixinIF.TextPlugin.__init__(self, xml, ctx) self.FromUser = usr self.ToUser = ctx.op...
# Copyright (c) 2012-2013 Paul Tagliamonte <paultag@debian.org> # Copyright (c) 2013 Leo Cavaille <leo@cavaille.net> # Copyright (c) 2014 Jon Severinsson <jon@severinsson.net> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files...
import datetime from dateutil.relativedelta import relativedelta from doctor_schedule.models import ScheduleResource from laboratory.utils import current_time from doctor_schedule.sql_func import get_resource_by_research_hospital, get_slot_plan_by_hosp_resource, get_hospital_resource_by_research, get_slot_fact from do...
# -*- coding: utf-8 -*- """ Expanders: Transform object tree into desired format """ __version__ = 0.1 ### #Czechtile: WikiHezkyCesky #Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/ # #This library is free software; you can redistribute it and/or #modify it under the terms of the GNU Lesser General P...
#!/usr/bin/env python # # Copyright (C) 2009 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...
from functools import partial from typing import List import e3nn_jax as e3nn import haiku as hk import jax import jax.numpy as jnp class Convolution(hk.Module): r"""Equivariant Point Convolution Args: irreps_node_output : `e3nn_jax.Irreps` representation of the output node features ...
# -*- coding: utf-8 -*- """ Defines contact related storage (the so called k-buckets). """ # Copyright (C) 2012-2013 Nicholas H.Tollervey. # # 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 Foundatio...
# -*- coding: utf-8 -*- import itertools import iso8601 import simplejson as json import ocdsmerge import jsonpatch as jpatch from datetime import datetime from collections import Counter from uuid import uuid4 from copy import deepcopy def tender_converter(tender): """ converts raw openprocurement data into acce...
from os import walk from io import BytesIO from pickle import load from pkgutil import get_data # Third party imports from nltk.tokenize.punkt import PunktSentenceTokenizer from lxml.html import fromstring import requests class Parser(object): _PT_BR_CORPUS = "tokenizers/punkt/portuguese.pickle" _CONVER...
# -*- coding: utf-8 -*- import unittest import bst class TestInit(unittest.TestCase): """Tests creation of a new binary search tree.""" def test_empty_by_default(self): """By default, a new binary search tree should be created empty.""" tree = bst.BinarySearchTree() with self.assertRaises(ValueErr...
from __future__ import print_function __doc__ = """DryDock specification construction functions.""" from os.path import join import os from .templates import base_commands, SUPERVISOR_BASE, SUPERVISOR_GROUP from .report import Report def master(http="80", https="443", ssh="2222", name="drydock"): report = Report(...
from __future__ import print_function import os import sys # import uuid import time import math import types import signal import shutil import timeit import inspect import tarfile import numbers import tempfile import platform import argparse import subprocess import contextlib from multiprocessing import cpu_count, ...
# coding: utf8 from __future__ import unicode_literals from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS from .stop_words import STOP_WORDS from .lex_attrs import LEX_ATTRS from .morph_rules import MORPH_RULES from ..tag_map import TAG_MAP from ..tokenizer_exceptions import BASE_EXCEPTIONS from ..norm_exceptions...
# Disable fatoptimizer on this module __fatoptimizer__ = {'enabled': False} import builtins import fat import os.path import sys import textwrap import unittest class BaseTestCase(unittest.TestCase): def setUp(self): transformers = sys.get_code_transformers() self.addCleanup(sys.set_code_transfor...
#! /usr/bin/env python # This file is part of the dune-pymor project: # https://github.com/pymor/dune-pymor # Copyright Holders: Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from collections import OrderedDict import pybindgen from pybindgen import retv...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" A collection of utilities to see if new ReST files need to be automatically generated from certain files in the project (examples, datasets). """ import os import pickle file_path = os.path.dirname(__file__) def get_hash(f): """ Gets hexadmecimal md5 hash of a string """ import hashlib m = has...
# -*- coding: utf-8 -*- """ Created on Wed Sep 23 15:23:58 2015 @author: jensv """ import skin_core_scanner_simple as scss reload(scss) import equil_solver as es reload(es) import newcomb_simple as new reload(new) (lambda_a_mesh, k_a_mesh, stability_maps) = scss.scan_lambda_k_space([0.01, 3.0, 25.], [0.01, 1.5, 25]...
from aqt import mw from aqt.utils import showInfo, getText, askUser from aqt.qt import * from anki.lang import _ from anki.utils import splitFields, ids2str from lib import duolingo def get_duolingo_model(): m = mw.col.models.byName("Duolingo Sync") if not m: if askUser("Duolingo Sync note type no...
""" Lot of what you see here has been stolen from Django's ``{% url %}`` tag. """ from django.core.urlresolvers import NoReverseMatch from django.template import Node, TemplateSyntaxError, Library, Variable from django.utils.encoding import smart_str from ella.core import custom_urls register = Library() class Custo...
#!/usr/bin/python """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 l...
''' Bigmetadata tasks tasks to download and create metadata ''' import os import requests from collections import OrderedDict from datetime import datetime from luigi import (Task, IntParameter, LocalTarget, BooleanParameter, Parameter, WrapperTask) from tasks.util import (TableTarget, shell, clas...
from passlib.hash import pbkdf2_sha256 import importlib import yaml import os from file_tools import metadatatools as mdt from file_tools import h5merge from db import db import h5py from xkcdpass import xkcd_password as xp import sys import requests import json import uuid import shutil DATADIR = os.environ['DATADIR'...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from ipywidgets import * from SimPEG import Mesh, Maps, EM, Utils # from pymatsolver import PardisoSolver import matplotlib.pyplot as plt import numpy as np from PIL import Image from scipy.constants im...
# # Copyright 2017-2018 B-Open Solutions srl. # Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF). # # 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://ww...
# MIT License # # Copyright (c) 2017 Matt Boyer # # 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, p...
from datetime import datetime, timedelta from django.core.management.base import BaseCommand from .models import State from stories.models import Story, UserType, Questiongroup, Answer class Command(BaseCommand): args = "" help = """Analyzes the GKA IVRS states and saves stories. ./manage.py fetchgkaivr...
#! /usr/bin/env python """An abstract base class for all Dakota experiments.""" from abc import ABCMeta, abstractmethod import types import yaml class DakotaBase(object): """Describe features common to all Dakota experiments.""" __metaclass__ = ABCMeta @abstractmethod def __init__(self, ...
# -*- coding: utf-8 -*- """ Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy. """ __author__ = "Marcel Rieger" __copyright__ = "Copyright 2016, Marcel Rieger" __credits__ = ["Marcel Rieger"] __contact__ = "https://github.com/riga/tfdeploy" __license__ ...
from __future__ import unicode_literals import datetime from dateutil.parser import parse import decimal from decimal import Decimal import importlib from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import models try: from django.db.models.fields.related import\ ...
import optparse from rq import Worker from rq import Queue from rq import Connection from rq.job import JobStatus from app import redis_rq_conn # from http://stackoverflow.com/questions/12774085/dealing-with-exception-handling-and-re-queueing-in-rq-on-heroku/16326962#16326962 def retry_handler(job, exc_type, exc_valu...
import csv import json import logging import os from ece2cmor3 import components from ece2cmor3 import ece2cmorlib, cmor_source, cmor_target, cmor_task from ece2cmor3.cmor_source import create_cmor_source from ece2cmor3.resources import prefs log = logging.getLogger(__name__) json_source_key = "source" json_target_k...
from __future__ import print_function, division import copy import logging import math import requests import six from onecodex.exceptions import OneCodexException, raise_connectivity_error, raise_api_error from onecodex.utils import atexit_register, atexit_unregister, snake_case from onecodex.lib.files import FilePa...
# 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. # libcloud.org licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not...
from datetime import datetime, timedelta from django.db import transaction from django.core.management.base import BaseCommand from ivrs.models import State from schools.models import School from ivrs.utils import get_question from common.utils import post_to_slack from stories.models import Story, UserType, Question...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext import json from frappe import _, throw from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate, add_days, add_...