gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- # Copyright (C) 2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. """Read a...
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'chris' __version__ = '05.15' import xml.etree.ElementTree as ET from collections import OrderedDict as OD from copy import deepcopy from re import findall from json import loads bib = {} retr = [28, 8, 18, 20, 43, 97] def sanitize(texs, istex=None): """ ...
# # This file is part of pysnmp software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pysnmp/license.html # import sys from pyasn1.codec.ber import decoder from pyasn1.codec.ber import eoo from pyasn1.type import constraint from pyasn1.type import namedtype from pyasn1....
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2012-2018 RIKEN R-CCS ## \file kmrrungenscript.in.py KMRRUN Job-Script Generator. import sys import os import re from optparse import OptionParser kmrhome = '@KMRHOME@' ## Checks file existence. # If file does not exist, it prints an error message and exit...
from uuid import uuid4 from corehq.dbaccessors.couchapps.all_docs import get_doc_count_by_type from corehq.util.couch_helpers import MultiKeyViewArgsProvider, MultiKwargViewArgsProvider from corehq.util.doc_processor.interface import DocumentProvider, ProcessorProgressLogger from corehq.util.pagination import Resumabl...
# Copyright (c) 2012 NetApp, Inc. # Copyright (c) 2014 Red Hat, 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...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from algorithms.graph import Tarjan from algorithms.graph import check_bipartite from algorithms.graph.dijkstra import Dijkstra from algorithms.graph import ford_fulkerson from algorithms.graph import edmonds_karp from algorithms.graph import dinic from algorithms.graph import maximum_flow_bfs from algorithms.graph imp...
"""Module for querying SymPy objects about assumptions.""" from __future__ import print_function, division from sympy.core import sympify from sympy.core.cache import cacheit from sympy.logic.boolalg import (to_cnf, And, Not, Or, Implies, Equivalent, BooleanFunction, BooleanAtom) from sympy.logic.inference import ...
#!/usr/bin/env python3 # Copyright (C) 2020 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-2013 IBM Corp. # 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/li...
import tensorflow as tf import numpy as np import time import h5py # import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import itertools from copy import deepcopy import os import os.path from collections import OrderedDict import pickle # import cPickle as pickle # from tensorflow.examples...
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
"""Numpy pickle compatibility functions.""" import pickle import os import zlib import inspect from io import BytesIO from .numpy_pickle_utils import _ZFILE_PREFIX from .numpy_pickle_utils import Unpickler from .numpy_pickle_utils import _ensure_native_byte_order def hex_str(an_int): """Convert an int to an hex...
from sqlalchemy.testing import assert_raises_message, eq_, \ AssertsCompiledSQL, is_ from sqlalchemy.testing import fixtures from sqlalchemy.orm import relationships, foreign, remote from sqlalchemy import MetaData, Table, Column, ForeignKey, Integer, \ select, ForeignKeyConstraint, exc, func, and_, String from...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import copy from django import forms from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.utils.translation import gettext_lazy as _ from django.contrib.gis.db.models.fields import GeometryField from crispy_forms.helper import FormHelper from crispy_forms.layout import Lay...
# coding: utf-8 import functools import re from flask.ext import login from google.appengine.api import mail from flask.ext.oauthlib import client as oauth from google.appengine.api import users from google.appengine.ext import ndb import flask import unidecode import config import model import task import util fro...
# $Id: ShowFeats.py 537 2007-08-20 14:54:35Z landrgr1 $ # # Created by Greg Landrum Aug 2006 # # from __future__ import print_function _version = "0.3.2" _usage=""" ShowFeats [optional args] <filenames> if "-" is provided as a filename, data will be read from stdin (the console) """ _welcomeMessage="This is S...
import datetime import Queue from threading import Thread import time from django.test import TestCase from haystack import connections, connection_router from haystack.exceptions import SearchFieldError from haystack import indexes from haystack.utils.loading import UnifiedIndex from core.models import MockModel, AThi...
""" This file is the declaration of benchmarks for HTTPie. It is also used to run them with the current environment. Each instance of BaseRunner class will be an individual benchmark. And if run without any arguments, this file will execute every benchmark instance and report the timings. The benchmarks are run throu...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
from django.contrib.postgres.fields import ArrayField from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.encoding import python_2_unicode_compatible from simple_history.models import HistoricalRe...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
"""Description of YANG & YIN syntax.""" import re ### Regular expressions - constraints on arguments # keywords and identifiers identifier = r"[_A-Za-z][._\-A-Za-z0-9]*" prefix = identifier keyword = '((' + prefix + '):)?(' + identifier + ')' comment = '(/\*([^*]|[\r\n\s]|(\*+([^*/]|[\r\n\s])))*\*+/)|(//.*)|(/\*.*)'...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2019, ARM Limited and contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
__source__ = 'https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/#/description' # https://github.com/kamyu104/LeetCode/blob/master/Python/best-time-to-buy-and-sell-stock-iii.py # Time: O(n) # Space: O(1) # Dynamic Programming # # Description: Leetcode # 123. Best Time to Buy and Sell Stock III # # Say y...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'CreditLine.product_rate' db.delete_column(u'accounting_creditline', 'product_rate_id') ...
# -*- coding: utf-8 -*- ''' Management of MySQL grants (user permissions) ============================================= :depends: - MySQLdb Python module :configuration: See :py:mod:`salt.modules.mysql` for setup instructions. The mysql_grants module is used to grant and revoke MySQL permissions. The ``name`` you ...
########################################################################## # # Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), # its affiliates and/or its licensors. # # Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary ...
#!/usr/bin/env python #Python Serial Port Extension for Win32, Linux, BSD, Jython #module for serial IO for POSIX compatible systems, like Linux # #(C) 2001-2003 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, the CNRI Python License # see http://www.opensource.org/licenses/pythonp...
import cattle import os import pytest import random import time from datetime import datetime, timedelta NOT_NONE = object() DEFAULT_TIMEOUT = 90 DEFAULT_AGENT_URI = 'ssh://root@localhost:22' DEFAULT_AGENT_UUID = 'test-agent' SLEEP_DELAY = 0.5 @pytest.fixture(scope='session') def cattle_url(): default_url = 'ht...
# Copyright (c) 2020 PaddlePaddle 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 app...
# Copyright 2008-2009 ITA Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# License: EPL import os import sys import traceback try: xrange except: xrange = range #=============================================================================== # Things that are dependent on having the pydevd debugger #=============================================================================== de...
""" PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net) Copyright (C) 2004-2020 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved, Brett G. Olivier (bgoli@users.sourceforge.net) Triple-J Group for Molecular Cell Physiology Stellenbosch University, South Africa. Permission to us...
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # """ Set of Classes for executing unix commands. """ import os import platform import socket import sys import signal import psi.process from gppylib.gplog import * from gppylib.commands.base import * logger = gplog.get_default_logg...
''' preprocess data 1. read lines of JSON 2. sort by timestamp 3. filter by cmd and user 4. save as csv ''' import argparse, json, csv, types, re, codecs, cStringIO class UnicodeWriter: """ A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. """ def __ini...
#!/usr/bin/env python ## category DNA-seq ## desc Base/variant caller """ Base/variant caller Given a BAM file and a genomic reference, for each position covered in the BAM file, show the reference base, and the number of A/T/C/G's and InDels. This can also be used to call variants. You can also optionally filter out...
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals import uuid from datetime import date, datetime, time import dat...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from luigi import Task, Parameter, IntParameter, ListParameter from tasks.base_tasks import TempTableTask from tasks.meta import current_session from tasks.targets import ConstraintExistsTarget from tasks.targets import PostgresTarget, PostgresFunctionTarget from lib.logger import get_logger LOGGER = get_logger(__name...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Grid Dynamics # 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/l...
""" .. _tut_erp: EEG processing and Event Related Potentials (ERPs) ================================================== For a generic introduction to the computation of ERP and ERF see :ref:`tut_epoching_and_averaging`. .. contents:: Here we cover the specifics of EEG, namely: :local: :depth: 1 """ import mne...
from __future__ import unicode_literals from decimal import Decimal as D import logging from django.views.generic import RedirectView, View from django.conf import settings from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.contrib import messages from django.contrib.auth.m...
# -*- coding: utf-8 -*- # extractDict4UI.py ''' Created on 2011-3-15 @author: qqgit ''' import os # import re import codecs from subprocess import call class ExtractDict(object): ''' classdocs ''' pass def __init__(self, enFile = None, zhFile = None, extractedFile = None, native2ascii_exe = None)...
# Copyright 2016 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
import pygame from events import * from GameModel import TILE_WIDTH, \ TILE_HEIGHT, \ NUM_TILES_WIDE, \ NUM_TILES_TALL SCREEN_WIDTH = TILE_WIDTH * NUM_TILES_WIDE SCREEN_HEIGHT = TILE_HEIGHT * NUM_TILES_TALL #------------------------------------------...
import unittest import numpy import chainer from chainer import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr def _sigmoid(x): xp = cuda.get_array_module(x) half = x.dtype.type(0.5) return xp.tanh(x * half) * half + half ...
import os import os.path import shutil import subprocess import time import unittest import tempfile def my_check_output(*popenargs, **kwargs): """ If we had python 2.7, we should simply use subprocess.check_output. This is a stop-gap solution for python 2.6 """ if 'stdout' in kwargs: raise...
import binascii import hashlib import math import random import re _fmt_num_trials = 50 _mrpt_num_trials = 5 # number of bases to test # RFC 3110 # hex 30 21 30 09 06 05 2B 0E 03 02 1A 05 00 04 14 ASN1_sha1_prefix = '\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14' def _tohex(int_value): encoded = for...
# Copyright 2013, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import argparse import json import logging import os import re from collections import OrderedDict from typing import Optional, Dict, List import gitlab import requests import sys import xmltodict from circleci.api import Api as circle_api from slack import WebClient as SlackClient from Tests.Marketplace.marketplace_...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright (c) 2014 OpenStack Foundation # Copyright (c) 2011 OpenStack Foundation # 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.apac...
#!/usr/bin/env python # encoding: utf-8 import os import numpy as np from flask_classful import route from flask import jsonify, request, Response import json from marvin import config from marvin.api.base import BaseView, arg_validate as av from marvin.core.exceptions import MarvinError from marvin.utils.general i...
# -*- test-case-name: wokkel.test.test_pubsub -*- # # Copyright (c) 2003-2009 Ralph Meijer # See LICENSE for details. """ XMPP publish-subscribe protocol. This protocol is specified in U{XEP-0060<http://www.xmpp.org/extensions/xep-0060.html>}. """ from zope.interface import implements from twisted.internet import d...
# -*- coding: utf-8 -*- """ Written by Daniel M. Aukes and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. """ import qt.QtCore as qc import qt.QtGui as qg import numpy from popupcad.graphics2d.graphicsitems import Common import popupcad import shapely.geometry as sg import qt.qt_hacks a...
# # 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...
""" miscellaneous sorting / groupby utilities """ from collections import defaultdict from typing import ( TYPE_CHECKING, Callable, DefaultDict, Dict, Iterable, List, Optional, Tuple, Union, ) import numpy as np from pandas._libs import algos, hashtable, lib from pandas._libs.hasht...
<<<<<<< HEAD <<<<<<< HEAD from test import support import types import unittest def global_function(): def inner_function(): class LocalClass: pass global inner_global_function def inner_global_function(): def inner_function2(): pass retu...
""" Test for "region" module. """ # Author: Ph. Gervais # License: simplified BSD import numpy as np from nose.tools import assert_raises, assert_true import nibabel from .. import region from .._utils.testing import generate_timeseries, generate_regions_ts from .._utils.testing import generate_labeled_regions, gene...
# Copyright 2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You # may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Note that files generated by lex/yacc not always fully py 2/3 compatible. # Hence, the ``clean_parse_tables.py`` tool in the astropy-tools # (https://github.com/astropy/astropy-tools) repository should be used to fix # this when/if lextab/parsetab file...
from ._compat import PY2, filename_to_ui, get_text_stderr from .utils import echo class ClickException(Exception): """An exception that Click can handle and show to the user.""" #: The exit code for this exception exit_code = 1 def __init__(self, message): if PY2: if message is n...
# 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. """Parses options for the instrumentation tests.""" #TODO(craigdh): pylib/utils/ should not depend on pylib/. from pylib import constants import optpar...
import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit from pylons import response from ckan.lib.base import BaseController from ckan.config.environment import config as ckan_config from mappers import * from builders import Catalog, Dataset, ThemeTaxonomy logger = logging.getLogger('jsoncatalog.control...
# Copyright (c) 2011 Intel Corporation # 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/l...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" The MIT License (MIT) Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com> 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 th...
"""Exposes a set of layout and utility functions to be invoked from 164. These These functions have access to the global browser instance. """ import json from urllib import urlencode, urlopen from urlparse import urlparse, urlunparse, parse_qsl from warnings import warn import sys from PyQt4.QtNetwork import QNetwork...
import random import time import datetime import Queue import collections import itertools import os import os.path # import array import numpy as np class Timer(object): def __init__(self, name=None): self.name = name def __enter__(self): self.tstart = time.time() def __exit__(self, ty...
from __future__ import division, absolute_import, print_function import types from copy import copy from distutils import ccompiler from distutils.ccompiler import * from distutils.errors import DistutilsExecError, DistutilsModuleError, \ DistutilsPlatformError from distutils.sysconfig import customize_compiler fr...
import tensorflow as tf from tensorflow.contrib.framework import arg_scope from layers import * class Model(object): def __init__(self, config, inputs, labels, enc_seq_length, dec_seq_length, mask, reuse=False, is_critic=False): self.task = config.task self.debug = config.debu...
import os import sys import tempfile import operator import functools import itertools import re import contextlib import pickle import textwrap import builtins import pkg_resources from distutils.errors import DistutilsError from pkg_resources import working_set if sys.platform.startswith('java'): import org.pyt...
import json from django.db.models import Q from corehq import Domain, toggles from corehq.apps.accounting.models import Feature, SoftwareProduct, BillingAccount, SoftwarePlanVersion, \ Subscription, Subscriber, BillingContactInfo, SoftwarePlan from corehq.apps.accounting.utils import fmt_feature_rate_dict, fmt_prod...
"""Allows the creation of a sensor that filters state property.""" import logging import statistics from collections import deque, Counter from numbers import Number from functools import partial from copy import copy from datetime import timedelta import voluptuous as vol from homeassistant.core import callback from...
# -*- coding: utf-8 -*- # This software is distributed under the two-clause BSD license. # Copyright (c) The django-ldapdb project import collections import re import ldap from django.db.models import aggregates from django.db.models.sql import compiler from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SI...
import json from django.contrib.postgres import lookups from django.contrib.postgres.forms import SimpleArrayField from django.contrib.postgres.validators import ArrayMaxLengthValidator from django.core import checks, exceptions from django.db.models import Field, IntegerField, Transform from django.db.models.lookups ...
import abc from functools import partial import numpy from numpy.testing import (assert_array_equal, assert_array_almost_equal) from .utils import ( create_data_container, compare_data_containers, compare_lattice_nodes) from ..cuds.lattice import make_triclinic_lattice from ..cuds.lattice_items import LatticeNode...
import functools from importlib import import_module from django.utils.html import conditional_escape from django.utils.inspect import getargspec from django.utils.itercompat import is_iterable from .base import Node, Template, token_kwargs from .exceptions import TemplateSyntaxError class InvalidTemplateLibrary(Ex...
# Copyright 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 required ...
from .models import Incident, Crisis, ResponseUnit, PokemonDB, Pokemon, Trainer, Shelter # noqa from .serializers import IncidentSerializer, CrisisSerializer, \ ResponseUnitSerializer, PokemonSerializer, PokemonDBSerializer, \ TrainerSerializer, UserSerializer, ShelterSerializer, LoginSerializer # noqa from r...
import unittest import merge_active_shadow from tools.api_proto_plugin import type_context as api_type_context from google.protobuf import descriptor_pb2 from google.protobuf import text_format class MergeActiveShadowTest(unittest.TestCase): # Dummy type context for tests that don't care about this. def fakeTy...
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import re, os, cStringIO, time, cgi, string, urlparse from twisted import copyright from twisted.python import htmlizer, text from twisted.web import microdom, domhelpers import process, latex, indexer, numberer, htmlbook from twisted.p...
#!/usr/bin/env python # encoding: utf-8 """Pyvona : an IVONA python library Author: Zachary Bears Contact Email: bears.zachary@gmail.com Note: Full operation of this library requires the requests and pygame libraries """ import datetime import hashlib import hmac import json import tempfile import contextlib class ...
# Copyright 2013 Josh Durgin # 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 a...
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
import datetime import random import re from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db import transaction from django.template.loader import render_to_string from django.utils.hashcompat import sha_constructor from django.utils.translation impor...
from math import ceil from dash.orgs.models import Org from django.contrib.auth.models import User from django.db import connection, models from django.db.models import Index, Q, Sum from django.utils.functional import SimpleLazyObject from django.utils.translation import gettext_lazy as _ from casepro.cases.models ...
import logging import os import re from tempfile import mkdtemp from os import getcwd from simgen.utils import searchpath GITHUB_URL_PATTERN = r'https://(?P<domain>.+?)/(?P<owner>.+?)/(?P<repo>.+?)(.git)?(?P<path>/.+)?$' _PATTERN = re.compile(GITHUB_URL_PATTERN) log = logging.getLogger(__file__) class Error(Exce...
from twisted.internet.error import ReactorAlreadyInstalledError from zmq.eventloop import ioloop ioloop.install() from tornado.ioloop import IOLoop import tornado.platform.twisted try: tornado.platform.twisted.install() except ReactorAlreadyInstalledError: pass #from jupyter_client.blocking.client import Block...
from copy import deepcopy from typing import Dict from keras.layers import Input from overrides import overrides from ...common.models import get_submodel from ...common.params import Params from ...data.instances.reading_comprehension import McQuestionPassageInstance from ...layers.attention import Attention from .....
from datetime import date, datetime, time, tzinfo from django.test import SimpleTestCase, override_settings from django.test.utils import TZ_SUPPORT, requires_tz_support from django.utils import dateformat, translation from django.utils.dateformat import format from django.utils.timezone import ( get_default_timez...
"""Utilities for input validation""" # Authors: Olivier Grisel and Gael Varoquaux and others (please update me) # License: BSD 3 import warnings import numbers import numpy as np from scipy import sparse from .fixes import safe_copy def _assert_all_finite(X): """Like assert_all_finite, but only for ndarray."""...
# swift_build_support/cmake.py - Detect host machine's CMake -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt f...
# Copyright 2012, VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...