text
stringlengths
12
6.59M
################################################################################ # Copyright 2020 Advanced Micro Devices, Inc. All rights reserved. # # 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 So...
#!/usr/bin/env python3 from MoodleDestroyer import MoodleDestroyer md = MoodleDestroyer() wsFunc = md.rest('core_webservice_get_site_info') functions = [func['name'] for func in wsFunc['functions']] for function in sorted(functions): print(function)
""" byceps.config_defaults ~~~~~~~~~~~~~~~~~~~~~~ Default configuration values :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import timedelta from pathlib import Path # database connection SQLALCHEMY_ECHO = False # Avoid connection errors after...
from __future__ import absolute_import, division, print_function from time import time as _time from sys import stdout as _stdout import warnings import numpy as np try: import pyfftw pyfftw.interfaces.cache.enable() pyfftw.interfaces.cache.set_keepalive_time(10) rfftn = pyfftw.interfaces.numpy_fft.rff...
""" Software OpenFlow Switch @author: Colin Scott (cs@cs.berkeley.edu) Based heavily on pylibopenflow: Copyright(C) 2009, Stanford University Date November 2009 Created by ykk """ # TODO: Don't have SoftwareSwitch take a socket object... Should really have a # OF_01 like task that listens for socket connections, cr...
import os, sys, json, codecs sys.path.append(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) from etk.etk import ETK from etk.extractors.html_content_extractor import HTMLContentExtractor, Strategy from etk.extractors.html_metadata_extractor import HTMLMe...
# Copyright 2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
""" Aggregating results into DataPoints Copyright 2015 BlazeMeter 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' A POX module implementation of the CastFlow clean slate multicast proposal. Implementation adapted from NOX-Classic CastFlow implementation provided by caioviel. Depends on openflow.discovery Created on July 16, 2013 @author: alexcraig ''' from collections import defau...
from pprof.settings import config from plumbum import local from os import path def lt_clang(cflags, ldflags): """Return a clang that hides :cflags: and :ldflags: from reordering of libtool. This will generate a wrapper script in :p:'s builddir and return a path to it. :flags_to_hide: the flags ...
from __future__ import unicode_literals import re import ttfw_idf import os @ttfw_idf.idf_example_test(env_tag='Example_WIFI') def test_examples_icmp_echo(env, extra_data): dut = env.get_dut('icmp_echo', 'examples/protocols/icmp_echo') dut.start_app() dut.expect('example_connect: Connected to') dut....
""" The ``ui.Frame`` class is used to embed a separate HTML page within your application. If you pass a URL when the Frame is created, that URL will be used immediately. Alternatively, you can call the ``Frame.setUrl()`` method to change the URL at any time. You can also call ``Frame.getUrl()`` to retrieve the curren...
load("@io_kythe_llvmbzlgen//rules:configure_file.bzl", "configure_file") load("@io_kythe_llvmbzlgen//rules:llvmbuild.bzl", "llvmbuild") load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:collections.bzl", "collections") # CMake paths are all rooted at the fake "/root" path. _ROOT_PREFIX = "/root" ...
load("@io_bazel_rules_go//go:def.bzl", "go_context") load("@io_bazel_rules_go//go/private:providers.bzl", "GoArchive") go_filetype = ["*.go"] def _compute_genrule_variables(resolved_srcs, resolved_outs): variables = {"SRCS": cmd_helper.join_paths(" ", resolved_srcs), "OUTS": cmd_helper.join_paths(" "...
# Copyright 2016 The Kubernetes 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 ...
# -*- mode: python -*- # # Copyright (c) 2004-2005 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at htt...
# Example Mnemosyne configuration # =============================== # # This file is a Python script. The configuration defined here will generate a # very simple blog, somewhat like PyBlosxom's defaults. import mnemosyne import mnemosyne.utils # File locations # -------------- # # * ``entry_dir``: a Maildir contai...
import inspect from heapqueue import * class Message: def __init__(self, func: str, key: str, value: Union[Generic, Callable[Generic, bool]], accessor: Union[Callable[Generic, bool], None], mutator: Union[Callable[Generic, bool],...
''' Utility functions for fetching data from REST APIs ''' import requests, goslate import os, pytz, datetime, time from PIL import Image, ImageFont, ImageDraw def get_command(t): ''' return the command to be used based on the current time ''' if t < 43200 and t > 18000: command = 'mor...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
#!/usr/bin/python3 import tkinter import turtle from functools import partial from pdb import set_trace as debug class CalculatorTurtle(turtle.RawTurtle): def __init__(self, canvas): turtle.RawTurtle.__init__(self, canvas) self.penup() self.width = 48 self.height = 80 ...
#!/usr/bin/python """ Twython is a library for Python that wraps the Twitter API. It aims to abstract away all the API endpoints, so that additions to the library and/or the Twitter API won't cause any overall problems. Questions, comments? ryan@venodesigns.net """ __author__ = "Ryan McGrath <ryan@ve...
# -*- test-case-name: txdav.who.test.test_augment -*- ## # Copyright (c) 2013 Apple 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/license...
#!/usr/bin/python # # Copyright 2014 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...
# coding=utf-8 # Copyright 2019 The Mesh TensorFlow 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 applicab...
import dbus.glib import gobject import sys import time import random import pprint from dbus.service import method, signal, Object from dbus import Interface from telepathy.client import ( Connection, Channel) from telepathy.interfaces import ( CONN_INTERFACE, CHANNEL_INTERFACE_GROUP, CHANNEL_TYPE_TUB...
###################################################################### ## ## Copyright (C) 2006, Simon Kagstrom ## ## Filename: register.py ## Author: Simon Kagstrom <ska@bth.se> ## Description: Cibyl register handling ## ## $Id: register.py 13453 2007-02-05 16:28:37Z ska $ ## ###########################...
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import en...
import argparse import cv2 import os import numpy as np class InfiniteCounter(object): """ InfiniteCounter is a class that represents a counter that will return the next number indefinitely. When the user calls count() return the current number. Then it will increment the current number by the spe...
"""Prometheus exporter for Apache Traffic Server's stats_over_http plugin.""" import argparse import logging import sys from os import path from prometheus_client import REGISTRY, ProcessCollector from .collector import StatsPluginCollector from .http import start_http_server PKG_METRICS_FILE = path.join( path....
# Copyright 2013 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 applicable law or agreed to in wr...
# -*- coding: utf-8 -*- # import sys, os sys.path.append(os.path.abspath('../_exts')) # adding PhpLexer from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx vers...
# -*- coding: utf-8 -*- """ Copyright (C) 2013-2017 Danilo Bargen 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,...
#!/usr/bin/env python2.5 # # Copyright 2009 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...
""" Model class that unites theory with data. """ import logging logger = logging.getLogger('Model_mod') import copy import sets import scipy import SloppyCell import SloppyCell.Residuals as Residuals import SloppyCell.Collections as Collections import SloppyCell.Utility as Utility import KeyedList_mod as KeyedList...
# Copyright 2016 Tesora, 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 ...
#!/usr/bin/env python import glob import os import platform import shutil import stat import sys from distutils import log from distutils import dir_util from distutils.command.build_clib import build_clib from distutils.command.sdist import sdist from distutils.core import setup from distutils.sysconfig import get_py...
#!/bin/env python # -*- coding: utf-8 -*- """ This setup is loosely following the instructions adapted from https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/ """ import os import re from setuptools import setup def read(fname): """ Utility function to read the README file. Used f...
'''Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new preprocessing methods, etc... ''' from __future__ import absolute_import from __future__ import print_function import numpy as np import random import glob import re import scipy from ...
from vasppy import atom, cell, rdf import numpy as np class Configuration: """ A Configuration object stores a single structure. """ def __init__( self, cell, atoms ): self.cell = cell self.atoms = atoms def dr( self, atom1, atom2 ): """ Calculate the distance be...
from subprocess import Popen, PIPE from vcfkit.utils import * from vcfkit.utils.blastn import blast from Bio.Seq import Seq from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA as DNA_SET from Bio.Restriction import AllEnzymes, CommOnly, RestrictionBatch from clint.textui import colored, puts_err import sys import signal s...
#!/usr/bin/env python3 # Copyright 2020 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...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval as eval import openerp.addons.decimal_precision as dp from openerp.tools.float_utils import float_ro...
import random import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import numpy as np #don't ask how I came up with these numbers SIZE_H1 = 50 SIZE_H2 = 100 SIZE_H3 = 60 class model(torch.nn.Module): """Defines custom model Inherits from torch.nn.Module """ d...
# -*- coding: utf-8 -*- from addons.base.models import BaseCitationsNodeSettings, BaseOAuthUserSettings from django.db import models from framework.exceptions import HTTPError from pyzotero import zotero, zotero_errors from addons.zotero import \ settings # TODO: Move `settings` to `apps.py` when deleting from ad...
""" byceps.blueprints.admin.core.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ....services.brand import service as brand_service from ....services.party import service as party_service from ....services.site import servic...
# -*- coding: utf-8 -*- # # Copyright (c) 2011 -- Lars Heuer <heuer[at]semagia.com> # 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...
import flask import flask_sqlalchemy import flask_bootstrap import flask_login import flask_script import flask_migrate import flask_babel import os import docker from apscheduler.schedulers import background # Create application app = flask.Flask(__name__, static_url_path='/admin/app_static') default_config = { ...
# 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...
from django.contrib import admin from advertisements.models import Advertisement, Provider class AdvertisementAdmin(admin.ModelAdmin): list_display = ('provider', 'ad_type', 'image', 'created') date_hierarchy = 'created' list_filter = ('ad_type', 'created') admin.site.register(Provider) admin.site.regis...
from django.test import TestCase from django.contrib.auth.models import User from advertisements.models import User, Provider, Advertisement from django.core.urlresolvers import reverse from model_mommy import mommy class ProviderViewTests(TestCase): def setUp(self): self.user = User.objects.create_user('...
import sys import argparse import config import csv import logging import input import datetime import connector import os from lockfile import create_lock from umapi import UMAPI from umapi.auth import Auth, JWT, AccessRequest from umapi.helper import paginate def error_hook(exctype, value, tb): """Set up the Er...
# -*- coding: utf-8 -*- # Copyright 2015 Cyan, Inc. # Copyright 2017, 2018 Ciena Corporation. import struct import unittest import afkak.common from afkak import _util as util from afkak.common import BufferUnderflowError class TestUtil(unittest.TestCase): def test_write_int_string(self): self.assertEqu...
import json import requests import requests.auth import socket import sys from .exceptions import * from .log_util import * class RwhoUploader(): def __init__(self, url, host_name=None, host_fqdn=None, auth_method=None, au...
from django.forms.widgets import Textarea, DateTimeBaseInput from django.forms import BooleanField, forms from django.utils import formats from django.utils.translation import ugettext_lazy as _ from webpack_loader import utils as webpack_loader_utils class DateTimePickerWidget(DateTimeBaseInput): template_name ...
# -*- coding: utf-8 -*- # # 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 #...
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. import re from django.contrib.auth.mo...
from django.views.generic.edit import FormView, ModelFormMixin from django.views.generic.detail import SingleObjectTemplateResponseMixin from extra_views.formsets import BaseInlineFormSetMixin from django.http import HttpResponseRedirect from django.forms.formsets import all_valid class InlineFormSet(BaseInlineFormS...
"""Get dependencies from packages on the Python Package Index (PyPI) Adapted from Olivier Girardot's notebook: https://github.com/ogirardot/meta-deps/blob/master/PyPi%20Metadata.ipynb licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of that license, visit http://creativecommons.o...
""" inputs: 3 SPI ADCs reading drawbars 1 SPI ADC reading analog knobs output topics: voice_1_db_harmonic voice_1_db_fine voice_1_db_h1_harmonic voice_1_db_h1_fine voice_1_db_h1_vol voice_1_db_h2_harmonic voice_1_db_h2_fine voice_1_db_h2_vol voice_1_db_filter_a voic...
"""\ Augment the "bgen" package with definitions that are useful on the Apple Macintosh. Intended usage is "from macsupport import *" -- this implies all bgen's goodies. """ # Import everything from bgen (for ourselves as well as for re-export) from bgen import * # Simple types Boolean = Type("Boolean", "b") Signe...
import geopy import os from constants import US_STATE_NAME_DICT, CA_PROVINCE_NAME_DICT GOOGLE_SERVICE = 'GoogleV3' SMARTYSTREETS_SERVICE = 'LiveAddress' SMARTYSTEETS_ZIPCODE_SERVICE = 'SmartyStreetsUSZipcode' NOMINATIM_SERVICE = 'Nominatim' LOCAL_USDATA_SERVICE = 'LocalUSDataProvider' class Location(geopy.Location):...
from casepro.contacts.models import Contact, Field, Group from casepro.msgs.models import Label, Message from casepro.test import BaseCasesTest from django.conf import settings from django.http import HttpResponse from django.test import override_settings, RequestFactory import json import responses from ..junebug imp...
from __future__ import (absolute_import, print_function) # From system import os import re import sys import time import json import shutil import logging from distutils.util import strtobool from boto.s3.connection import S3Connection from boto.s3.key import Key from boto.exception import S3ResponseError from datetim...
""" Google for stuff. """ from .util.decorators import command from .util.data import get_doc import requests import re from html.parser import HTMLParser from urllib.request import unquote def unescape(x): return HTMLParser.unescape(None, x) @command("google", category="internet") def google(bot, nick, chan, arg...
import io import lxml.html import requests import unittest class Plugin: def on_command(self, bot, msg, stdin, stdout, reply): url = "https://www.humblebundle.com/" if "weekly" in msg["args"] or "weekly" in stdin.read().strip(): url = "https://www.humblebundle.com/weekly" page...
import numpy as np import tensorflow as tf import h5py import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import sys # usage: python exp7i.py 64 4 0 0 0 # system arg nhidden = 64 nlayer = 1 SMALL_FLAG = 1 FAST_FLAG = 1 SYS_FLAG = 0 # 0 for bridges, 1 for supermic try: nhidden = int(s...
# -*- coding: utf-8 -*- # # Copyright (c) 2013 João Faria # This file is part of OPEN which is licensed under the MIT license. # You should have received a copy of the license along with OPEN. See LICENSE. # # standard library imports import warnings import datetime, time import subprocess import sys, os, shutil, glob...
import logging import multiprocessing from abc import abstractmethod, ABCMeta from itertools import repeat import pymongo from mapreduce.driver import MapReduceDriver from processor.data_source import MongoDataSource class AbstractDAO(metaclass=ABCMeta): @abstractmethod def load_songci_list(self): p...
#!/usr/bin/python ''' diagnose -- single python script for fast linux diagnostics diagnose is a single python (2 or 3) script that checks a wide range of linux (and possibly windows in the future) utilities to determine system health. It's intended purpose is to be able to scp or curl it onto a computer and quic...
""" Module providing easy API for working with remote files and folders. """ from __future__ import with_statement import hashlib import re import os from StringIO import StringIO from functools import partial from fabric.api import run, sudo, hide, settings, env, put, abort from fabric.utils import apply_lcwd def...
''' Codes for creating a basic scientific statck on a linux VM. To see the commands that will be issued, use the flag print_only=T ''' from contextlib import contextmanager from fabric_solo import (apt_get, chmod, chown, cp, exists, lcd, ln, mkdir, mv, rm, runall, sed, wget) # Shared constants REPO_PATH = "...
"""View decorators to integrate with checkmate's API.""" from checkmatelib import CheckmateClient, CheckmateException from h_vialib.exceptions import TokenException from h_vialib.secure.url import ViaSecureURL from pyramid.httpexceptions import HTTPTemporaryRedirect, HTTPUnauthorized def checkmate_block(view, url_par...
import logging import os import pathlib import re import time from typing import Dict, Tuple, Optional, List, Iterator import numpy as np from PyQt5 import QtCore from sastool.io.credo_cct import Exposure, Header from scipy.io import loadmat from .component import Component logger = logging.getLogger(__name__) logge...
""" Evaluation function of an individual """ from __future__ import division import os import numpy as np import pandas as pd from cea.constants import HOURS_IN_YEAR from cea.optimization import slave_data from cea.optimization.constants import * from cea.optimization.master import cost_model from cea.optimization....
# -*- coding: utf-8 -*- """ =========================== Dynamic demand graphs algorithm =========================== J. Fonseca script development 25.08.15 """ from __future__ import division import pandas as pd from plotly.offline import plot import plotly.graph_objs as go from plotly import tools __auth...
from chainer.backends import cuda from chainer.function_node import FunctionNode from chainer.utils import type_check import numpy as np from six.moves import range from functools import reduce index_dtype = {t().itemsize: t for t in np.sctypes['int']} def _byte2step(iterable, itemsize): for i in iterable: ...
#!/usr/bin/env python # Copyright 2017 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. """Splits a branch into smaller branches and uploads CLs.""" import collections import os import re import subprocess2 import sys impo...
from firedrake import * from matplotlib.pyplot import figure, show, title res = 1 nx = 2 ** res ny = 2 ** res nz = 2 ** res quads = False broken = False base = UnitSquareMesh(nx, ny, quadrilateral=quads) mesh = ExtrudedMesh(base, layers=nz, layer_height=1.0/nz) degree = 0 if quads: RT = FiniteElement("RTCF", q...
import arrow import asyncio import inotify.adapters import logging import multiprocessing import os import pymongo import queue import setproctitle import shutil import time import virtool.file import virtool.utils #: A dict for mapping inotify type names of interest to simple file operation verbs used in Virtool. TY...
import time from flask import Flask, render_template app = Flask(__name__) @app.route("/") def splitter(): return render_template("splitter.html") @app.route("/delay/<int:ms>") def delay(ms): time.sleep(0.001*ms) return "This page loaded in {}ms".format(ms) if __name__ == "__main__": app.run(debug=T...
# # Copyright (c) 2012-2016 Daniele Bartolini and individual contributors. # License: https://github.com/taylor001/crown/blob/master/LICENSE # bl_info = { "name" : "Crown Engine .mesh format", "author" : "Daniele Bartolini", "blender" : (2, 58, 0), "location" : "File > Import-Export", "descript...
''' Created on 2016/8/25 :author: hubo ''' from namedstruct import * from namedstruct.namedstruct import BadFormatError, BadLenError, Parser, _create_struct def _tobytes(s, encoding = 'utf-8'): if s is None: return None elif isinstance(s, bytes): return s else: return s.encode(enc...
"""Directly addressing @leelou, you can ask her to do a trick.""" import re from random import choice import logging # U03J911F1 TRIGGER = re.compile(r'<@(.+)>\s+(.+)',re.IGNORECASE) def on_message(msg, context): """Context has keys: 'client', 'config', 'hooks'""" text = msg.get("text", "") match = TRIGGE...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
import os import itertools import urlparse from .classutil import itersubclasses class SelectableStorage(object): """ A mix-in for storage classes which will construct a suitable subclass based on the URI. """ @classmethod def from_URI(cls, URI): candidates = itersubclasses(cls) if hasattr(cls...
from __future__ import absolute_import from __future__ import unicode_literals from contextlib import contextmanager from celery import states from celery.exceptions import Ignore from django.test import TestCase from django.utils.dateparse import parse_datetime from mock import patch from casexml.apps.case.mock imp...
import itertools from django.apps import apps from testil import eq from corehq.apps.domain.deletion import DOMAIN_DELETE_OPERATIONS from corehq.apps.dump_reload.util import get_model_label IGNORE_APPS = { 'aaa', 'accounting', 'admin', 'captcha', 'contenttypes', 'django_celery_results', '...
from StringIO import StringIO from mock import patch, MagicMock from compressor.offline.django import DjangoParser from django.conf import settings from django.template.loader_tags import ExtendsNode from django.core.management import call_command from django.test import SimpleTestCase from nose.plugins.attrib import ...
import datetime from copy import deepcopy from django.contrib.admin.models import LogEntry from django.test import SimpleTestCase, TestCase from unittest.mock import patch from corehq import toggles from corehq.apps.accounting.tests.utils import DomainSubscriptionMixin from corehq.apps.commtrack.tests.util import ma...
from collections import namedtuple, OrderedDict from itertools import chain import json import uuid from django import forms from django.forms import Widget from django.forms.utils import flatatt from django.template.loader import render_to_string from django.utils.html import format_html from django.utils.safestring i...
#!/usr/bin/python import sys import getopt import re from parsimonious.grammar import Grammar class IMeta(object): def meta(self): pass class IReference(IMeta): def alterMeta(self, alterFn, args): pass; def resetMeta(self, m): pass class AReference(IReference): def __init_...
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
# Copyright (c) 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. """Top-level presubmit script for Blink. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
# -*- coding: utf-8 -*- # 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 applicab...
import random import pystache from twilio.twiml.voice_response import VoiceResponse, Gather, Dial from sqlalchemy_utils.types.phone_number import PhoneNumber, phonenumbers from flask import abort, Blueprint, request, url_for, current_app from flask_jsonpify import jsonify from twilio.base.exceptions import TwilioRestE...
import json import datetime import time import sys PROJECT = sys.argv[1] f = open("../metadata/field_descriptions.json", "r") fields = json.loads(f.read()) f.close() fields_to_derive = [] f = open("metadataParsers/" + PROJECT + '/' + PROJECT + ".json", "w") output = [] for field in fields: if field["dataty...
#!/usr/bin/env python from __future__ import print_function import sys import numpy import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") import pmagpy.pmag as pmag import pmagpy.pmagplotlib as pmagplotlib def main(): """ NAME quick_hyst.py DESCRIPTION mak...
import os, base64 from suds.client import Client defaultUploadOptions = {"title":"Default Title", "desc":"Default Description", "view_state":2, "tags":"model,auto-upload", "has_color":0, "scale":1, "markup":0} class Shapeways(object): def __init__(self, username...
# Copyright (c) 2017, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from ...models.tree_ensemble import TreeEnsembleRegressor as _TreeEnsembleRegressor, TreeEnsembleClassif...