text
stringlengths
17
737k
# coding=utf-8 import logging import json import os import re import requests logger = logging.getLogger(__name__) CHANGECOIN_API = os.getenv("CHANGECOIN_API", "https://api.changetip.com/v1") class DuplicateTipException(Exception): pass class BaseBot(object): # Override this with the name of the channel...
# file findingaids/fa/views.py # # Copyright 2012 Emory University Library # # 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 # # U...
# Copyright 2013,2014 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Dunya # # Dunya is free software: you can redistribute it and/or modify it under the # terms of the GNU Affero General Public License as published by the Free Software # Foundation (FSF), either version 3 of the License, or...
from aula5.fila import Fila class ErroLexico(Exception): pass class ErroSintatico(Exception): pass def analise_lexica(expressao): """ Executa análise lexica transformando a expressao em fila de objetos: Transforma inteiros em ints Flutuantes em floats e verificar se demais caracteres s...
import functools import hashlib from importlib import import_module from django.conf import settings def linearize(func): """ Makes sure the contained consumer does not run at the same time other consumers are running on messages with the same reply_channel. Required if you don't want weird things l...
# Copyright 2016-2017 Lenovo # # 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, ...
"""Undocumented Module""" __all__ = ['ShowBase', 'WindowControls'] # This module redefines the builtin import function with one # that prints out every import it does in a hierarchical form # Annoying and very noisy, but sometimes useful #import VerboseImport from pandac.PandaModules import * # This needs to be ava...
"""Undocumented Module""" __all__ = ['ShowBase', 'WindowControls'] # This module redefines the builtin import function with one # that prints out every import it does in a hierarchical form # Annoying and very noisy, but sometimes useful #import VerboseImport from pandac.PandaModules import * # This needs to be ava...
import cybox.bindings.cybox_common_types_1_0 as common_binding from cybox.common.baseobjectattribute import Base_Object_Attribute class Hash(object): def __init__(self): pass @classmethod def object_from_dict(cls, hash_dict): """Create the Hash object representation from an input dictionar...
# --------------------------------------------------------------------------- # ClassifiedImport.py # # Created by: Dori Dick # College of Earth, Ocean and Atmospheric Sciences # Oregon State Univeristy # # Created on: 3 March 2012 # Last modified: 9 September 2012 # # Description: T...
from __future__ import unicode_literals from copy import deepcopy from decimal import Decimal import io import itertools import logging import re import socket import time from xml.etree.ElementTree import Element, fromstring, ParseError from future.moves.urllib.parse import urlparse from future.moves._thread import ...
"""Module with main classes related to Interfaces.""" import json import logging from enum import IntEnum from pyof.v0x01.common.phy_port import Port as PortNo01 from pyof.v0x01.common.phy_port import PortFeatures as PortFeatures01 from pyof.v0x04.common.port import PortFeatures as PortFeatures04 from pyof.v0x04.commo...
''' Created on Jun 26, 2010 @author: jbrukh Craigslist Mailer Copyright (c) 2010 Jake Brukhman LICENSE: Public domain. Periodically checks a Craigslist RSS feed for new listings and e-mails them to a recipient. Set all configuration in conf.py. ''' import sys import random import time import os.path import pickle ...
#! /usr/bin/env python import os import logging import json import datetime import psycopg2 import time import threading from pyramid.config import Configurator from pyramid.session import SignedCookieSessionFactory from pyramid.view import view_config from pyramid.events import NewRequest, subscriber from waitress im...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The user interface for our app""" import os,sys,tempfile,re,functools,time,types,glob,codecs from pprint import pprint from copy import copy from multiprocessing import Process, Queue from Queue import Empty from hashlib import md5 from StringIO import StringIO from rs...
import logging as logger import os import requests from iceqube.common.classes import State from iceqube.exceptions import UserCancelledError from django.apps.registry import AppRegistryNotReady from django.core.management import CommandError, call_command from django.http import Http404 from django.utils.translation ...
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
#!/usr/bin/env python # Copyright (c) 2012 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. """ Launch multiple buildbot slave instances on a single machine. This script is intended to be run at boot time. """ import er...
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
# Copyright 2015 Cloudbase Solutions Srl # 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 r...
# 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 (t...
import logging from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.core.validators import validate_ipv46_address from django.core.exceptions import ValidationError from .connection impo...
import discord from discord.ext import commands from .utils import checks from __main__ import send_cmd_help from discord.ext.commands.cooldowns import BucketType from cogs.utils.dataIO import dataIO, fileIO from datetime import datetime import json import os import sys import asyncio from subprocess import PIPE, Pope...
import discord from discord.ext import commands from .utils import checks from __main__ import send_cmd_help from cogs.utils.dataIO import dataIO, fileIO import json import os import asyncio import subprocess #def out(command): #"""This function runs a shell script and collects the terminal response""" # result = run...
from addressbase.models import UprnToCouncil from data_importers.management.commands import BaseHalaroseCsvImporter class Command(BaseHalaroseCsvImporter): council_id = "ABD" addresses_name = "2022-05-05/2022-04-12T10:11:25.128402/polling_station_export-2022-04-07.edited.csv" stations_name = "2022-05-05/2...
""" Output capability module Basic output capability, creates simple connection between an object and an observing node. "decoded_output" for Ensembles. """ import nengo from capability import Capability class OutputCap(Capability): """Output capability class. """ @property def name(self): ...
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # Copyright (C) 2012 Raphaël Valyi - Akretion ...
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# Python Tools for Visual Studio # Copyright(c) Microsoft 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 # # THI...
#TODO(robnagler) fix up old data(?) probably just remove #TODO(robnagler) fix up other simulations to use template_common(?) # -*- coding: utf-8 -*- u"""SRW execution template. :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __futu...
from __future__ import ( print_function, division, absolute_import, unicode_literals, ) from fontTools.misc.py23 import SimpleNamespace from fontTools import unicodedata import collections import re import logging from ufo2ft.featureWriters import ast class BaseFeatureWriter(object): """Abstract ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from fontbakery.testrunner import ( DEBUG , INFO , WARN , ERROR , SKIP , PASS , FAIL , distribute_generator , Se...
#! /usr/bin/env python import os from subprocess import call def check_dir_exist(os_dir): if not os.path.exists(os_dir): exit(1) def backup(): check_dir_exist('/root/rethink_backup/') os.chdir('/root/rethink_backup/') call(["rethinkdb-dump", "-a", "taskwetu_db**//"]) if __name__ == '__main...
from __future__ import print_function import json from collections import defaultdict import ntpath from pprint import pprint import re import sys from blessings import Terminal import click from progressbar import ProgressBar import fix_binary class Writer(object): def __init__(self, location): self.lo...
""" Cook, John D. "Notes on the negative binomial distribution." Unknown, October 28 (2009): 2009. Following http://www.johndcook.com/negative_binomial.pdf The negative binomial (NB) gives the probability of seeing x failures before the rth success given a success probability p: p(x | p, r) \propto p ^ r * (1 - p)...
""" Geckoboard decorators. """ import base64 from types import ListType, TupleType from xml.dom.minidom import Document try: from Crypto.Cipher import AES from Crypto import Random from hashlib import md5 encryption_enabled = True except ImportError: encryption_enabled = False try: from funct...
#!/usr/bin/python # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License ...
from datetime import timedelta import functools import inspect import os import shutil import sys import tempfile import re from errno import ENOENT from collections.abc import Iterator from contextlib import contextmanager from importlib import import_module from numbers import Integral, Number from threading import L...
import string from nltk.stem.snowball import RussianStemmer from nltk.corpus import stopwords import re from sklearn.feature_extraction.text import CountVectorizer # стемминг и знаки пунктуации stemmer = RussianStemmer() # стеммер слов, объект exclude = string.punctuation + string.digits # буквы, знаки пунктуации дл...
# coding: utf8 import requests import time import sys import os import getopt from selenium import webdriver from selenium.common.exceptions import ( WebDriverException, NoSuchElementException, TimeoutException) from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.expected_conditi...
# This file was created automatically by SWIG. # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _cspace def _swig_setattr(self,class_type,name,value): if (name == "this"): if isinstance(value, class_type): se...
#!/usr/bin/env dls-python2.7 ''' Buttons to move I10 fast chicane magnet offsets and scales. Provides a gui to control magnet scaling and offsets in order to allow independant steering of photon and electron beams to maintain a closed bump. ''' from pkg_resources import require require('cothread==2.10') require('s...
import tornado.ioloop import tornado.web import tornado.websocket import rethinkdb as r from tornado.options import define, options, parse_command_line define("port", default=8888, type=int) class IndexHandler(tornado.web.RequestHandler): def get(self): print 'rendering' self.render("ws_index.htm...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division import os import sys import time import select import urllib2 from fcntl import fcntl, F_GETFL, F_SETFL from subprocess import Popen, PIPE os.chdir(os.path.dirname(__file__)) PYTHON = os.environ.get('P...
class BaseMixin(object): def get_context_data(self, **kwargs): context = super(BaseMixin, self).get_context_data(**kwargs) path = self.request.path if path == '/': path = 'home' context.update(dict( path=path, )) return context
#!/usr/bin/env python2.7 import numpy as np from sklearn.cluster import MiniBatchKMeans from sklearn.metrics import euclidean_distances import logging FORMAT = '[%(asctime)s] %%(levelname)s - (funcName)s:%(lineno)d: %(message)s' logging.basicConfig(format=FORMAT, level=logging.INFO) class XMeans(object): def __...
import pytest class Score(): love=0 fifteen=15 thirty=30 forty=40 deuce="Deuce" advantage="Advantage" won="Won" lost="Lost" def toString(self): return "" class Zero(Score): def toString(self): return "Zero" class Fifteen(Score): def toString(self): return "Fifteen" class Thirty(Score): def toStrin...
""" Sublime Yardoc by Revath S Kumar https://github.com/revathskumar/sublime-yardoc """ import sublime_plugin import re class YardocCommand(sublime_plugin.TextCommand): def counter(self): count = 0 while True: count += 1 yield(count) def setTabIndex(self, doc): ...
from .wfs import get_table_name from .wfs import get_data from .wfs import get_features from .wfs import get_count from .wfs import list_tables from .wfs import validate_name from .wfs import define_request from .wfs import get_type from .wcs import get_dem __version__ = "0.5.0" BCDC_API_URL = "https://catalogue.dat...
#!/usr/bin/env python # Copyright (c) 2012 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. """A tool to build chrome, executed by buildbot. When this is run, the current directory (cwd) should be the outer build direc...
#!/usr/bin/env python # Copyright (c) 2012 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. """A tool to build chrome, executed by buildbot. When this is run, the current directory (cwd) should be the outer build direc...
#!/usr/bin/env python # Copyright (c) 2012 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. """A tool to build chrome, executed by buildbot. When this is run, the current directory (cwd) should be the outer build direc...
#!/usr/bin/env python # Copyright (c) 2012 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. """A tool to run a chrome test executable, used by the buildbot slaves. When this is run, the current directory (cwd) should be ...
#!/usr/bin/env python # Copyright (c) 2012 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. """A tool used to run a Chrome test executable and process the output. This script is used by the buildbot slaves. It must be run ...
# encoding=utf-8 from django.contrib.auth import authenticate from datetime import datetime from lepus import models from rest_framework import serializers, status, exceptions, fields class ValidationErrorDetail(object): def __init__(self, error="", message=""): self.error = error self.message ...
# encoding: utf-8 from __future__ import print_function, unicode_literals import os import json import datetime import hashlib import tornado.ioloop import tornado.options import tornado.httpserver import tornado.web import tornado.template from tornado.options import options, define from icalendar import Calendar, Eve...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2013, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. # # Generated Tue Apr 09 11:14:05 2013 by generateDS.py version 2.9a. # import sys import getopt import re as re_ import win_file_object import cybox_common import ba...
"""Sample Cloud Function code to extract and return DFCX Confidence Score.""" # 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 # # https://www.apache.org/licen...
#!/usr/bin/env python3 """ Script to train the experts. """ import argparse import time import subprocess # Parse arguments parser = argparse.ArgumentParser() parser.add_argument("--tags", default="all", help="comma-separated tags for selecting the environments to train the experts on") parser.a...
''' Channels is where we store information for mapping virtual (qubit) channel to real channels. Created on Jan 19, 2012 Original Author: Colm Ryan Copyright 2013 Raytheon BBN Technologies Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License...
from functools import lru_cache import json import re import typing import warnings from django import template from django.conf import settings from django.utils.encoding import force_str from django.utils.html import format_html from django.utils.safestring import mark_safe import pubcode from ..models import UITex...
# !/usr/bin/env python # encoding: utf-8 # # This file is part of ckanext-nhm # Created by the Natural History Museum in London, UK import os from collections import OrderedDict from lxml import etree # even though we use simple DwC terms, we use this XSD as it allows us to group terms into events # etc., on record ...
# -*- coding: utf-8 -*- from datetime import datetime import functools from flask import (Flask, request, render_template, send_file, redirect, flash, url_for, g, abort, session) from flask_wtf.csrf import CSRFProtect from flask_assets import Environment from sqlalchemy.orm.exc import NoResultFound...
import datetime import re import os import requests import json import uuid import random import calendar import time import libs.SerializableDict as SerializableDict import libs.StorageObjects as StorageObjects import libs.Models as Models import libs.Loggiz as Loggiz from pytz import timezone import pytz import teleg...
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # use: python savvy.py -i samples/ANLJ01.1.fsa_nt # S:erotype # A:ntimicrobial Resistance # V:irulence Factors # -vy import logging # long function calls, cause datastruct_savvy is important import datastruct_savvy import pandas as pd import config import shutil from...
# -*- coding: utf-8 -*- # # SasView documentation build configuration file, created by # sphinx-quickstart on Wed Aug 28 14:59:44 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
import os import time from numpy import linalg, array, dot, sqrt, math from .models import OpenVectors stopwords = ["", "(", ")", "a", "about", "an", "and", "are", "around", "as", "at", "away", "be", "become", "became", "been", "being", "by", "did", "do", "does", "during", "each", "for", "from", "get", ...
""" Definition of views. """ from django.shortcuts import render from django.http import HttpRequest from django.template import RequestContext from datetime import datetime from app.models import * import hashlib import random import sys import smtplib def home(request): """Renders the home page.""" assert ...
from app import app, db, utils from utils import * from models import * from forms import * from flask import render_template, flash, redirect, session, url_for, request, \ g, jsonify, current_app, Response from flask.ext.login import login_user, logout_user, current_user, \ login_required from variables import * fro...
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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) any later version. # # Ansible is distribut...
import re import os import errno import shutil import logging import threading from tempfile import mkdtemp from collections import OrderedDict import xml.etree.cElementTree as etree import rasterio import requests from wordpad import pad from six import iteritems from pyproj import Proj, transform from rasterio.featu...
# This weechat plugin pipes the current weechat buffer through urlview # # Usage: # /urlview # # History: # 10-04-2015 # Version 1.0.1: Reverse text passed to urlview # Version 1.0.0: initial release import distutils.spawn import os import pipes import weechat def urlview(data, buf, args): infolist = weechat.inf...
import subprocess import sys import re import math volume_scale = 0.6 def set_volume(value): result = subprocess.run(["amixer", "-M", "set", "Master", "{}%".format(math.floor(value * volume_scale))], stdout=subprocess.PIPE) def get_volume(): result = subprocess.run(["amixer", "get", "Master"], stdout=sub...
""" Test suite for the {{ cookiecutter.role_name }} role. The script can be executed on its own or incorporated into a larger test suite. However the tests are run, be aware of which version of the package is actually being tested. If the package is installed in site-packages, that version takes precedence over the ve...
import numpy as N from numpy.linalg import pinv from scipy import stats from scipy.misc import factorial from scipy.special import gamma, gammaln, beta, hermitenorm def binomial(n, j): """ Binomial coefficient: n! --------- (n-j)! j! """ if n <= j or n == 0: return 0...
from ass2m.storage import Storage from ass2m.users import User from ass2m.server import Server from ass2m.template import build_url, build_root_url from ass2m.filters import quote_url from unittest import TestCase from webtest import TestApp from tempfile import mkdtemp import shutil import os class BuildURLTest(Te...
from __future__ import unicode_literals from datetime import datetime import os import sys from dateutil.relativedelta import relativedelta import requests bases = {'r\xf8sslyngen': 59, 'myrulla': 61} login_url = 'http://bukkesprangetnatur.barnehage.no/LogOn' ics_url = ('http://bukkesprangetnatur.barnehage...
import unittest from models.heliosat import main import numpy as np from netcdf import netcdf as nc from datetime import datetime import os import glob class TestHeliosat(unittest.TestCase): def setUp(self): os.system('cp -rf data mock_data') self.files = glob.glob('mock_data/goes13.*.BAND_01.nc'...
# Copyright (C) 2014 Carlos Jenkins <carlos@jenkins.co.cr> # # 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...
#!/usr/bin/python2.7 import unittest import kartlogic.rank as rank class RankTests(unittest.TestCase): def testInstantiateEmptyArray(self): # Arrange empty_array = [] # Act result = rank.instantiate_empty_array() # Assert self.assertEqual(result, empty_array) ...
# Copyright 2010-2015 RethinkDB, all rights reserved. import collections import errno import imp import numbers import os import socket import ssl import struct import time from . import ql2_pb2 as p __all__ = ['connect', 'set_loop_type', 'Connection', 'Cursor', 'DEFAULT_PORT'] DEFAULT_PORT = 28015 pErrorType = p....
from .. import Server class MongoArbiterNode(Server): log = logging.getLogger('Servers.MongoArbiterNode') log.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) formatter = logging.Formatter( '%(asctime)s [%(name)s] %(levelname)s: %(message)s', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import logging import ebstall.errors as errors import collections import re import ebstall.util as util import subprocess import types import ebstall.osutil as osutil import shutil import pkg_resources __author__ = 'dusankl...
import base64 import getpass import sys default_path = "conf/BJDBModule/database_password" args = sys.argv set_new_password = False new_password = None def parse_args(): global set_new_password global new_password for arg in args: if arg == '-n': set_new_password = True if arg...
""" byceps.services.ticketing.ticket_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from typing import Dict, Optional, Sequence, Set from flask_sqlalchemy import Pagination from ...database import db from ...typing imp...
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import re from ansible.module_utils._text import to_text from ans...
import pytest from thinglang import run from thinglang.execution.errors import ReturnInConstructorError, EmptyMethodBody, EmptyThingDefinition, \ ArgumentCountMismatch, UnresolvedReference, DuplicateDeclaration from thinglang.lexer.tokens.base import LexicalIdentifier from thinglang.parser.errors import ParseError...
import inspect import json import argparse import os import platform import re import subprocess import sys import tempfile from contextlib import contextmanager from itertools import chain from pathlib import Path from shutil import rmtree, copytree from stat import S_IWRITE as ANYONE_WRITE_PERMISSION from tempfile im...
""" hitl endpoints """ from fastapi import APIRouter, HTTPException, Response from typing import Optional from common.models import Document from common.utils.logging_handler import Logger from common.config import BUCKET_NAME,DB_KEYS,ENTITY_KEYS,\ APPLICATION_FORMS,SUPPORTING_DOCS from google.cloud import storage im...
from unittest import TestCase from xml.etree import ElementTree from sys import version_info from io import BytesIO from genologics.lims import Lims from genologics.entities import StringDescriptor, StringAttributeDescriptor, StringListDescriptor, \ StringDictionaryDescriptor, IntegerDescriptor, BooleanDescriptor,...
"""Miscellaneous shared tools for extractors.""" from collections import defaultdict, namedtuple import os import re import sys import ddlib FIX_DEP_PARENTS=True def rgx_comp(strings=[], rgxs=[]): r = r'|'.join(re.escape(w) for w in strings) if len(rgxs) > 0: if len(strings) > 0: r += r'|' r += r'('...
""" This WSGI application accepts market data uploads from various uploader clients. The various URLs below are structured to pass off the parsing based on what format the data is in. The order data is re-packaged, then sent off to the processor nodes, where the data is parsed, some light validation is performed, then...
# The objective of this simulation is to consider several scenarios for the management of multiple # recessive alleles in a simulated population of dairy cattle. The basic idea is simple: # + Each animal has parents, a sex code, a true breeding value for lifetime net merit, and a genotype # for the recessive alleles ...
import numpy as np import restrictedBoltzmannMachine as rbm from batchtrainer import * from activationfunctions import * from common import * from debug import * from trainingoptions import * import theano from theano import tensor as T from theano.tensor.shared_randomstreams import RandomStreams theanoFloat = thean...
import pytest import os import numpy as np from pymatgen.io.vasp.outputs import Vasprun from flare.struc import Structure, get_unique_species from flare.dft_interface.vasp_util import md_trajectory_from_vasprun from flare.utils.flare_io import md_trajectory_to_file, md_trajectory_from_file pytestmark = pytest.mark.fil...
""" Dummy process with non-pythonic identifiers. """ from pywps import Process, LiteralInput, LiteralOutput, ComplexInput, ComplexOutput, FORMATS import logging LOGGER = logging.getLogger("PYWPS") class NonPyID(Process): def __init__(self): inputs = [ LiteralInput('input 1', 'Input1 number',...
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.utils import timezone import logging import pprint from cityhallmonitor.models import Matter, MatterAttachment from documentcloud import DocumentCloud from smtplib import SMTPException logger = logging.getLo...
import bisect from datetime import datetime, date, timedelta from itertools import islice from StringIO import StringIO from enerdata.contracts.tariff import Tariff from enerdata.datetime.timezone import TIMEZONE from enerdata.datetime.station import get_station class Coefficients(object): def __init__(self, c...
# Copyright (c) 2011 Openstack, LLC. # 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...