text
stringlengths
12
6.59M
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Mar 30, 2015 08:25:33 EDT$" import collections import itertools import json import os import os.path import shutil import tempfile import numpy import h5py import vigra import vigra.impex import nanshe.util.iters import nanshe.util.xnumpy import...
""" mbed SDK Copyright (c) 2011-2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
__author__ = 'kevin' class Stack(): """ Simple Stack (FILO collection) implementation based on python's list. """ def __init__(self): """ Stack constructor. Returns: A new instance of Stack. """ self._collection = list() def __...
from django.contrib.gis.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from caminae.authent.models import StructureRelated from caminae.maintenance.models import Intervention # GeoDjango note: # Django automatically creates indexes on geometry fields but it ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio 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) a...
import os import itertools from django.conf import settings def perform_multiple_transformations(instances, field_names_to_transform=None): ''' Transforms a list of models using :py:func:`~.utils.perform_transformation`. :param instances: model instances to perform transformations on. :type inst...
''' An orchestrating control flow that invokes replayer several times to find the minimal causal set (MCS) of a failure. ''' from sts.util.console import msg, color from sts.util.convenience import timestamp_string from sts.util.precompute_cache import PrecomputeCache, PrecomputePowerSetCache from sts.replay_event imp...
from openerp import fields from openerp.osv import osv class stock_picking(osv.Model): _inherit = "stock.picking" order_reference = fields.Char(copy=False) def _get_invoice_vals(self, cr, uid, key, inv_type, journal_id, move, context=None): inv_vals = super(stock_picking, self)._get_invoice_vals(...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
""" Cuthill-McKee ordering of graph nodes to produce sparse matrices """ # Copyright (C) 2011-2014 by # Aric Hagberg <aric.hagberg@gmail.com> # All rights reserved. # BSD license. from collections import deque from operator import itemgetter import networkx as nx __author__ = """\n""".join(['Aric Hagberg <a...
#!/usr/bin/env python3 # vim: set fenc=utf8 ts=4 sw=4 et : import time import sys import json import argparse import xml.sax import socket import os import functools import pprint import datetime import pytz DATA_MAXLEN = 200 DATA_TOO_LONG = 'Data too long' FLOW_BUFFER_TIME = 0 STANDALONE = False DEBUG = False HOSTNA...
# -*- coding: utf-8 -*- import os import urllib import hashlib import unittest import simplejson os.environ['DIRECTOR_TESTING'] = "true" import cpsdirector TEST_USER_DATA = { 'username': 'testuser', 'fname': 'TestName', 'lname': 'TestSurname', 'email': 'test@example.org', 'affiliation': 'Te...
# # Extend environment extend the environment variables # so that the program runs on any linux machine. # # # import os def set_environment(environment_variables): for environ, value in environment_variables.items(): environ = environ.upper() if(environ in os.environ): os.environ[envir...
import logging import sys import traceback import dateutil import pandas as pd import pymzml from celery import shared_task from celery.schedules import crontab from celery.task import periodic_task from models import Adduct, FragmentationSpectrum, Xic, LcInfo, MsInfo, InstrumentInfo from models import Molecule, Stand...
# -*- encoding: utf-8 -*- ################################################################################ ## TexPack layout engine ## ## Implements selected versions of the Shelf, MaxRects, and Skyline algorithms ## detailed in the paper "A Thousand Ways to Pack the Bin" by Jukka Jylänki[1], ## as well as a transpose ...
from os.path import join, dirname, exists import numpy as np import h5py import healpy from cosmoutils import hputil, nputil import foregroundsck import maps import skysim _datadir = join(dirname(__file__), "data") class FullSkySynchrotron(foregroundsck.Synchrotron): """Match up Synchrotron amplitudes to tho...
''' An orchestrating control flow that invokes replayer several times to find the minimal causal set (MCS) of a failure. ''' from sts.util.console import msg from sts.util.convenience import timestamp_string from sts.replay_event import * from sts.event_dag import EventDag, split_list import sts.log_processing.superlo...
#!/usr/bin/env python """ Utility functions for the neukrill-net classifier """ import glob import hashlib import io import json import os import sys import skimage.io import skimage.transform def parse_settings(settings_file): """ Parse json file or stringIO formatted settings file This function will like...
import pytest import copy from tibanna import awsem from tibanna.exceptions import MalFormattedRunJsonException @pytest.fixture def run_json_inputfile(): return { "class": "File", "dir": "somebucket", "path": "somefilepath", "profile": "", "unzip": "", ...
from .base import NPModuleBase class ChatRedisTransactions(object): def __init__(self, redis): "docstring" self.redis = redis def add_chat(self, chat_id, chat_title, chat_username): self.redis.hmset(chat_id, {"id": chat_id, "title": chat_title, ...
import collections import claripy class SimVariable(object): def __init__(self, name=None): self.name = name class SimConstantVariable(SimVariable): def __init__(self, value=None): super(SimConstantVariable, self).__init__() self.value = value def __repr__(self): s = "<con...
""" Custom menu for fluent_dashboard apps. """ from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from admin_tools.menu import items, Menu from admin_tools.utils import get_admin_site_name from fluent_dashboard.items import CmsModelList, ReturnToSiteItem from fluent_das...
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
from tkinter import Tk, StringVar from types import MethodType, FunctionType from revolver.ui.autocomplete_entry import AutoCompleteEntry import unittest class AutoCompleteEntryTest(unittest.TestCase): def setUp(self): list_of_names = [str(x) for x in range(60000)] tk_root = Tk() sv = St...
# -*- coding: utf-8 -*- VERSION = (0, 1, 14) def get_version(): """Returns the version as a human-format string.""" return '.'.join([str(i) for i in VERSION]) __author__ = 'dlancer' __docformat__ = 'restructuredtext en' __copyright__ = 'Copyright 2014-2015, dlancer' __license__ = 'BSD' __version__ = get_ver...
#!/usr/bin/python -tt from utils import object_to_dict from sqlalchemy.orm import class_mapper __all__ = ['Model'] def autoflush(func): def decorator(self, *args, **kwargs): self.db.rollback() retval = func(self, *args, **kwargs) self.db.commit() self.db.flush() return retv...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from pathlib import Path import scripts.convert_setup_files_to_json as converter class Configuration: """ Reads all the simulation configuration constants to be read by other classes """ def __init__(self, config_path, model_path, output_pa...
from metashare.repository.editor.inlines import ReverseInlineFormSet, \ ReverseInlineModelAdmin from django.core.exceptions import ValidationError, PermissionDenied from metashare.repository.models import resourceComponentTypeType_model, \ corpusInfoType_model, languageDescriptionInfoType_model, \ lexicalCo...
""" Akshay Tambe Pachter and Doudna groups Split reads for dropseq data 1. Index kmers Produce a dict kmer_index kmer_index[kmer] -> list of read line numbers that contain this kmer 2. Find cyclic paths pick a popular kmer get all reads that contain the kmer make subgraph from that subset of reads get be...
# # Copyright (c) 2017 Intel Corporation # SPDX-License-Identifier: BSD-2-Clause # import numpy import types as pytypes import collections import operator import warnings from llvmlite import ir as lir import numba from numba.core.extending import _Intrinsic from numba.core import types, utils, typing, ir, analysis...
# -*- coding: utf-8 -*- """ :codeauthor: `Anthony Shaw <anthonyshaw@apache.org>` tests.unit.cloud.clouds.gce_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import collections # Import Salt Libs from salt.cloud.cl...
""" Sile object for reading/writing OUT files """ from __future__ import print_function, division import os.path as osp import numpy as np import warnings as warn # Import sile objects from .sile import SileSiesta from ..sile import * from sisl.io._help import * # Import the geometry object from sisl import Geometr...
import types as pytypes import numba from numba import types from numba.typing.templates import infer_global, AbstractTemplate from numba.typing import signature from numba import ir_utils, ir, utils, array_analysis from numba.ir_utils import get_call_table, find_topo_order, mk_unique_var from operator import add def ...
# -*- coding: utf-8 -*- ''' :codeauthor: Erik Johnson <erik@saltstack.com> ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import copy import errno import os import shutil import tempfile import textwrap import tornado.ioloop import logging import stat try: imp...
#!/usr/bin/env python # coding: utf-8 """ Postfix log parser. This scripts parses a log file produced by postfix (or using the same format). It looks for predefined events and build statistics about their occurence rate. At the, somes default graphics are generated using the grapher module. (see grapher.py) Predefin...
import random class Location(object): def __init__(self, name): self.successors = [ ] self.days_of_week = [ ] self.name = name self.times_allowed_one = 0 self.times_allowed_two = 0 self.count = 0 self.count_down = 0 self.parents_to_probs = { } d...
# -*- coding: utf-8 -*- ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio 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...
""" Assorted utilities for use in tests. """ import cmath import contextlib import errno import math import os import sys import tempfile import numpy as np from numba import config, errors, typing, utils, numpy_support from numba.compiler import compile_extra, compile_isolated, Flags, DEFAULT_FLAGS from numba.targe...
'''Arsenal nodes DB Model''' # Copyright 2015 CityGrid Media, 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 ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -*- coding: utf-8 -*- ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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 ...
################################################################### # Numexpr - Fast numerical array expression evaluator for NumPy. # # License: MIT # Author: See AUTHORS.txt # # See LICENSE.txt and LICENSES/*.txt for details about copyright and # rights to use. ##########################################...
from __future__ import unicode_literals from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User import httpretty import re import json badge_list = { 'badges': [ { 'slug': 'one', 'name': 'One' } ] } class Issue...
"""Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr...
# -*- coding: utf-8 -*- from django.contrib import admin from components.accounts.admin import ContributorMixin from .models import Clip, Videodisc, VideodiscFormat class ClipInline(admin.StackedInline): extra = 1 fieldsets = ( (None, {'fields': (('disc', 'position'), 'track', ('romanized_name', 'nam...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2004-2013 Edgewall Software # Copyright (C) 2004 Dmitry Yusupov <dmitry_yus@yahoo.com> # Copyright (C) 2004 Mark Rowe <mrowe@bluewire.net.nz> # Copyright (C) 2005 Bill Soudan <bill@soudan.net> # Copyright (C) 2005 Florent Guillaume <fg@nuxeo.com> # Copyrig...
import numpy as np from openbabel import OBAtomAtomIter from scipy.spatial.distance import cdist as distance import pybel # define cutoffs hbond_cutoff = 3.5 hbond_tolerance = 30 salt_bridge_cutoff = 4 hydrophobe_cutoff = 4 pi_cutoff = 5 pi_cation_cutoff = 4 pi_tolerance = 30 halogenbond_cutoff = 4 halogenbond_toleran...
import unittest from django.contrib.auth.models import User from django.http import QueryDict from kgb import SpyAgency from reviewboard.hostingsvcs.models import HostingServiceAccount from reviewboard.hostingsvcs.github import GitHub from reviewboard.hostingsvcs.service import (get_hosting_service, ...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Sharoon Thomas, Raphael Valyi # # This program is free software: you can redistr...
#!/usr/bin/env python import bottom import asyncio import zmq import zmqclient import re from threading import Thread import os bottom.unpack._2812_synonyms['TOPIC'] = 'RPL_MYINFO' NICK = 'club_mate' CHANNEL = '#oslohackerspace' bot = bottom.Client('irc.freenode.net', 6697) pub = zmqclient.pub() topic = "" @bot.o...
#!/usr/bin/env python # -*- coding: utf-8 -*- #This file is part of CanFestival, a library implementing CanOpen Stack. # #Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD # #See COPYING file for copyrights details. # #This library is free software; you can redistribute it and/or #modify it under th...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Sharoon Thomas, Raphaël Valyi # Copyright (C) 2011-2012 Camptocamp Guewen Baconn...
# !/usr/bin/env python # Module : SysTrayIcon.py # Synopsis : Windows System tray icon. # Programmer : Simon Brunning - simon@brunningonline.net # Date : 11 April 2005 # Notes : Based on (i.e. ripped off from) Mark Hammond's # win32gui_taskbar.py and win32gui_menu.py demos from PyWin32 ''...
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
from wine_env import wine_rc import argparse import os import re import sys def main() -> None: parser = argparse.ArgumentParser() parser.add_argument('bottle', help='The name of the Wine bottle, e.g. PvZ', type=is_valid_bottle) parser.add_argument('--wine', help='The path to the Wine executable to use')...
# coding=utf-8 """Latent Dirichlet allocation using collapsed Gibbs sampling""" from __future__ import absolute_import, division, unicode_literals # noqa import logging import sys import numpy as np import lda._lda import lda.utils logger = logging.getLogger('lda') PY2 = sys.version_info[0] == 2 if PY2: range...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests for snapshot model.""" from ggrc.app import app from ggrc.models import all_models from integration.ggrc.converters import TestCase from integration.ggrc.models import factories TEST_MODELS = [ ...
# -*- coding: utf-8 -*- # Copyright (C) 2013-2015 MUJIN 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...
# -*- coding: utf-8 -*- import urllib import urllib2 import hashlib class WoopraUnknownIdentifierException(Exception): """ This exception is thrown when trying to identify() with an unsupported value. """ pass class WoopraUserProperties(object): """ This class represents a Woopra user's inf...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (C) 1998-2010 by authors (see AUTHORS.txt ) # # # # This file is part of LuxRays. ...
# Python import StringIO from collections import Counter, OrderedDict import logging import datetime # Django from django.db import connection from django.db.models import Count, FieldDoesNotExist from django.conf import settings # 3rd Party import xlsxwriter # Project from forms.models import ( NewspaperPerson,...
from rest_framework import serializers from repository.models import * from django.contrib.auth.models import User from guardian.models import UserObjectPermission class PermissionSerializer(serializers.ModelSerializer): model = serializers.CharField(source='content_type.model') username = serializers.CharFi...
# util.py # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import inspect, itertools, new, operator, sets, sys, warnings, weakref import __builtin__ types = __i...
from rest_framework import serializers from repository.models import * class ProjectSerializer(serializers.ModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='project-detail') class Meta: model = Project fields = ('id', 'url', 'project_name', 'project_desc') class Visit...
import pyglet from pyglet.gl import * glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) from pyglet.window import key import numpy as np import numpy.random as nprand from itertools import zip_longest import copy import math import random import glob import functools import itertools import subproces...
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
# coding: utf-8 from __future__ import unicode_literals import datetime import json import logging import re import unicodedata from appconf import AppConf from django.core import urlresolvers from django.db import models, transaction from django.template.defaultfilters import slugify from django.utils.encoding impor...
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import math import tempfile from thumbor.point import FocalPoint c...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import socket import struct import select import os import hashlib import re import time from sys import exit as exit from collections import OrderedDict from shutil import copy2, move # we import PollingObserver instead of Observer because the deleted event ...
""" An overcast "API". Overcast doesn't really offer an official API, so this just sorta apes it. """ import requests import lxml.html import urlparse import utilities import logging import threading log = logging.getLogger('overcast-sonos') class Overcast(object): def __init__(self, email, password): ...
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
import logging import httplib from flask import g from flask_restful import abort from drift.auth.jwtchecker import query_current_user from driftbase.db.models import Client log = logging.getLogger(__name__) def _update_analytics(): client_id = None current_user = query_current_user() if current_user...
from thumborize.crypto import url
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import socket import struct import select import os import hashlib import re import time from sys import exit as exit from collections import OrderedDict from shutil import copy2 # we import PollingObserver instead of Observer because the deleted event # is ...
# Copyright (c) 2012, Eucalyptus Systems, Inc. # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS...
__author__ = 'Samuel Gratzl' import caleydo_server.config c = caleydo_server.config.view('targid2') from pymongo import MongoClient from flask import Flask, request, abort from caleydo_server.util import jsonify import caleydo_server.security as security import caleydo_server.range as ranges import logging _log = lo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('recipe', '0012_auto_20160330_1659'), ] def populate_recipe_job(apps, schema_editor): # Go through all of the old recipe_job ...
import re import string from api import FancyValidator from validators import Regex, Invalid, PostalCode, _ try: import pycountry has_pycountry = True except: has_pycountry = False try: from turbogears.i18n import format as tgformat has_turbogears = True except: has_turbogears = False ########...
from bottle import run, route import bottle.ext.sqlite, sqlite3 db = sqlite3.connect('models/offers.db') c = db.cursor() c.execute("SELECT id, department, course_number, price, description, email FROM offers") data = c.fetchall() c.close() print(data[0][4]) @route('/') def show_picnic(): print("hello") ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from oauthlib.common import extract_params from oauthlib.oauth1 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER) CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded' CONTENT_TYPE_MULTI_PART = 'multipart/form-data' import sys if s...
# coding: utf-8 import datetime import random import string import factory from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.db import transaction from django.db.models import signals from django.utils import timezone from registration.models import Registrati...
## FormEncode, a Form processor ## Copyright (C) 2003, Ian Bicking <ianb@colorstudy.com> ## ## 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 ...
"""Created on 24 June 2017. @author: Alex Kost @description: Main python code file for Applying CNN as a TPMS. Attributes: DEFAULT_FORMAT (str): Logging format LOGFILE_NAME (str): Logging file name SIM_DATA_PATH (str): Local simulation data output folder path SIM_LENGTH_FIX (int): bias to datapoint len...
import unicodecsv as csv import json import requests import datetime import io from flask import request, url_for, render_template, redirect, \ jsonify, flash, make_response, Response, g from flask.ext.login import current_user, login_required from flask.ext.cors import cross_origin from urlparse imp...
import datetime, re; from sqlalchemy.orm import validates; from server import DB, FlaskServer; class Phones(DB.Model): id = DB.Column(DB.Integer, primary_key=True, autoincrement=True); phone = DB.Column(DB.String(20)); created_by = DB.relationship(DB.Integer, DB.ForeignKey('users.id')); created_at = DB.C...
#conding:utf-8 import collections import functools import threading import time import pickle from local_mutex import LocalMutex, LockError class ControlSpeed(object): def __init__(self,multi=None, max_calls=0, period=1.0, callback=None): if period <= 0: raise ValueError('Speed limiting perio...
from django import forms from django.contrib.auth.models import User from django.db.models import Q from django.forms.extras.widgets import SelectDateWidget from django.utils.translation import ugettext_lazy as _, ugettext from l10n.models import Country from livesettings import config_value, config_get_group, SettingN...
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.template.loader import get_template from django.template import Context from coop_cms.models import Link, Fragment from coop_cms.settings import get_article_class, get_navtree_class from d...
from collections import namedtuple from cStringIO import StringIO from ModestMaps.Core import Coordinate from multiprocessing.pool import ThreadPool from tilequeue.command import parse_layer_data from tilequeue.format import extension_to_format from tilequeue.format import json_format from tilequeue.process import proc...
from django.views.generic.edit import FormView from C4CApplication.views.FeedsMixingView import FeedsMixingView from C4CApplication.views.forms.LoginForm import LoginForm from C4CApplication import models from django.core.urlresolvers import reverse_lazy from C4CApplication.meta.user import User from C4CApplication.vi...
# -*- encoding: utf-8 -*- # # Copyright © 2013 Rackspace Hosting # # Author: Thomas Maddox <thomas.maddox@rackspace.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.ap...
from django.contrib.admin import site, ModelAdmin, StackedInline from site_content.settings import ENABLE_BUILTIN_MEDIA from site_content.models import SitePage, SiteMenu, SiteMenuItem, SiteBlock, SitePageAlias, SitePageRedirect, SitePosition class SitePageAliasInline(StackedInline): model = SitePageAlias cla...
import math, numpy, logging, serial, socket, threading from cops_and_robots.MapObj import MapObj from cops_and_robots.Map import Map class Robot(MapObj): """Class for controlling iRobot Create. Will generate a 'base' thread to maintain serial communication with the iRobot base.""" #Constants DIAMETER ...
""" Signals and Systems Function Module Copyright (c) March 2017, Mark Wickert All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
""" Bring-Your-Own-Attention Network A flexible network w/ dataclass based config for stacking NN blocks including self-attention (or similar) layers. Currently used to implement experimental variants of: * Bottleneck Transformers * Lambda ResNets * HaloNets Consider all of the models definitions here as exper...
#!/usr/bin/env python from datetime import date, timedelta import time import xmltodict import requests from xml.parsers import expat from scrapi_tools import lint from scrapi_tools.document import RawDocument, NormalizedDocument TODAY = date.today() NAME = "ClinicalTrials" def consume(days_back=1): """ First, ge...
# 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...
"""Export tldextract's public interface.""" import os try: import pkg_resources except ImportError: class pkg_resources(object): # pylint: disable=invalid-name """Fake pkg_resources interface which falls back to getting resources inside `tldextract`'s directory. """ @classmet...
#!/usr/bin/env python ''' Consumer and Normalizer for the eScholarship Repo at the University of California ''' from lxml import etree from xml.etree import ElementTree from datetime import date, timedelta import requests from scrapi_tools import lint from scrapi_tools.document import RawDocument, NormalizedDocument...