gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import numpy as np
from dolfin import tic, toc
import HiptmairSetup
import PETScIO as IO
import scipy.sparse as sp
import matplotlib.pylab as plt
import MatrixOperations as MO
import HiptmairSetup
class BaseMyPC(object):
def setup(self, ... | |
import decimal
import json
import unittest
import uuid
from django import forms
from django.core import exceptions, serializers, validators
from django.core.management import call_command
from django.db import IntegrityError, connection, models
from django.test import TransactionTestCase, override_settings
from django... | |
import time
import argparse
import numpy as np
import tensorflow as tf
import reader
import model
import pickle
import os
def parsing_args():
parser = argparse.ArgumentParser()
parser.add_argument('--mode', type=str, default='train',
help='train or test')
parser.add_argument('--i... | |
# 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... | |
# nuke imports
import nuke
import nukescripts
# python imports
import os
# used in tandem with floating windows in the node graph.
# Assigns a 'Close all' method to the alt+` hotkey combo so
# you don't need to click close on all of them.
def closeAllNodes():
"""
Closes all open nodes.
"""
for node ... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2022 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function # Requires: Python >= 2.6
import sys
sys.dont_write_bytecode = True
import cProfile
import inspect
import math
impor... | |
#!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2018 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import prin... | |
#!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# 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 applicabl... | |
import unittest
import os
from jira.client import JIRA
from jira.exceptions import JIRAError
from jira.resources import Resource, cls_for_resource, Issue, Project, Role
TEST_ROOT = os.path.dirname(__file__)
TEST_ICON_PATH = os.path.join(TEST_ROOT, 'icon.png')
TEST_ATTACH_PATH = os.path.join(TEST_ROOT, '__init__.py')
... | |
# -*- coding: utf-8 -*-
"""
tests.cache
~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import random
from werkzeug.contrib import cache
try:
import redis
except ImportError:
redis = None
... | |
from __future__ import print_function
import os
import sys
import argparse
import requests
import random
import json
from typtop.dbaccess import (
UserTypoDB,
call_check, is_user,
get_time, get_machine_id
)
from typtop.config import (
NUMBER_OF_ENTRIES_TO_ALLOW_TYPO_LOGIN,
WARM_UP_CACHE, VERSION, DI... | |
# Copyright (c) 2014 Hortonworks, 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 ... | |
import pandas as pd
import json
import io
from ..core import mac_address_to_id
def _id_to_member_mapping_fill_gaps(idmap, time_bins_size='1min'):
""" Fill gaps in a idmap
Parameters
----------
idmap : id mapping object
time_bins_size : str
The size of the time bins used for resampling. De... | |
##
# Copyright (c) 2005-2014 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/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
#!/usr/bin/env python
# coding=utf-8
import unittest
from mock import Mock
from src.gene import Gene
from src.sequence import Sequence
from src.filters import *
class TestFilters(unittest.TestCase):
def test_min_cds_length_filter(self):
cds_length = MinCDSLengthFilter(30)
# Create a mock sequenc... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for the artifact stages."""
from __future__ import print_function
import json
import os
import sys
import mock... | |
import json
from rest_framework import status
from django.test import TestCase, Client
from django.urls import reverse
from ..models import Temperature, HeartBeats, Breathing, BabyCrib, Movement, Noise
from ..serializers import TemperatureSerializer, HeartBeatsSerializer, BreathingSerializer, BabyCribSerializer, Moveme... | |
chown_data = {
'imports' : [
(0x220fd80, 8, 9, '*.endgrent'),
(0x220fd88, 8, 9, '*.__uflow'),
(0x220fd90, 8, 9, '*.getenv'),
(0x220fd98, 8, 9, '*.abort'),
(0x220fda0, 8, 9, '*.__errno_location'),
(0x220fda8, 8, 9, '*.strncmp'),
(0x220fdb0, 8, 9, '*._exit'),
... | |
# 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 applicable ... | |
"""Configuration management setup
Some terminology:
- name
As written in config files.
- value
Value associated with a name
- key
Name combined with it's section (section.name)
- variant
A single word describing where the configuration key-value pair came from
"""
import configparser
import locale
import logg... | |
#!/usr/bin/env python3
from participantCollection import ParticipantCollection
import re
import datetime
import time
import pyperclip
# EDIT ME
currentMonthTotalDays = 31
year = 2020
currentMonthIndex = datetime.date.today().month
currentDayOfMonthIndex = datetime.date.today().day
currentDayOfYearIndex = time.localti... | |
from trading_ig.rest import IGService
import responses
import json
import pandas as pd
import datetime
import pytest
import re
"""
unit tests for historical prices methods
"""
class TestHistoricalPrices:
@responses.activate
def test_historical_prices_v3_defaults_happy(self):
# fetch_historical_pric... | |
# Copyright 2015 Google 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, ... | |
from __future__ import unicode_literals
from textx import metamodel_from_str
from pytest import raises
import textx.exceptions
import attr
@attr.s(frozen=True)
class Instance(object):
parent = attr.ib()
name = attr.ib()
type = attr.ib()
@attr.s(frozen=True)
class Reference(object):
parent = attr.ib(... | |
# Copyright 2017 Google 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, ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
# -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_deferred_polymorph.models import SubDeferredPolymorphBaseModel
from .mixins import Renderable
from .mixins import TemplateHintProvider
from .setting... | |
"""Helpers for config validation using voluptuous."""
from datetime import timedelta
import jinja2
import voluptuous as vol
from homeassistant.loader import get_platform
from homeassistant.const import (
CONF_PLATFORM, CONF_SCAN_INTERVAL, TEMP_CELSIUS, TEMP_FAHRENHEIT,
CONF_ALIAS, CONF_ENTITY_ID, CONF_VALUE_T... | |
import sys
import os
import time
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.phonon import Phonon
import mutagen
import mutagen.mp3
import mutagen.easyid3
import configobj
import validate
import configobj_gui
import configobj_qt
import mythread
import detect
CONFSPEC = """
silence_threshold =... | |
from datetime import datetime
from decimal import Decimal
from gnucash_reports.configuration.current_date import get_today
from gnucash_reports.configuration.expense_categories import get_accounts_for_category
from gnucash_reports.utilities import clean_account_name
import enum
import piecash
import re
@enum.unique
... | |
import unittest
import numpy as np
import scipy.sparse
from sklearn.utils.testing import assert_array_almost_equal
from autosklearn.pipeline.implementations.OneHotEncoder import OneHotEncoder
dense1 = np.array([[0, 1, 0],
[0, 0, 0],
[1, 1, 0]])
dense1_1h = np.array([[1, 0, 0, 1,... | |
"""Storm topologies specifications logic.
Note: this module is coupled with the pyleus_topology.yaml file format
and with the Spec classes in the Java code. Any change to this class should
be propagated to this two resources, too.
"""
from __future__ import absolute_import
import copy
from pyleus.exception import In... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple HTTP Server
"""
import os
import sys
import re
import cgi
import argparse
import functools
import warnings
import urllib
import httplib
import socket
import SocketServer
import BaseHTTPServer
from urllib import urlencode
from SimpleHTTPServer import SimpleHTTP... | |
#!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print... | |
"""This contains a set of tests for paratemp.sim_setup.para_temp_setup"""
########################################################################
# #
# This script was written by Thomas Heavey in 2018. #
# theavey@bu.edu ... | |
# Testing the line trace facility.
from test import support
import unittest
import sys
import difflib
import gc
# A very basic example. If this fails, we're in deep trouble.
def basic():
return 1
basic.events = [(0, 'call'),
(1, 'line'),
(1, 'return')]
# Many of the tests below ... | |
from functools import wraps
import inspect
from textwrap import dedent
from typing import Any, Callable, List, Mapping, Optional, Tuple, Type, Union, cast
import warnings
from pandas._libs.properties import cache_readonly # noqa
from pandas._typing import F
def deprecate(
name: str,
alternative: Callable[..... | |
"""
@file
@brief Some automation helpers about notebooks
"""
import os
import sys
import json
import warnings
from io import StringIO
from nbformat import versions
from nbformat.reader import reads, NotJSONError
from nbformat.v4 import upgrade
from ..filehelper import read_content_ufs
from ..loghelper import noLOG
from... | |
import json
from datetime import datetime
from itertools import groupby
import markdown2
from django.urls import reverse
from django.db import models, transaction
from django.utils import timezone
from django.utils.six.moves.urllib.parse import quote
from django.utils.six.moves.urllib.request import urlopen
from pynac... | |
# -*- coding: utf-8 -*-
"""
sphinx.ext.autosummary.generate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usable as a library or script to generate automatic RST source files for
items referred to in autosummary:: directives.
Each generated RST file contains a single auto*:: directive which
extracts the doc... | |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class LicenseManager(BaseEntit... | |
# -*- coding: utf-8 -*-
"""Prompt manager."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import re
#------------------------------------------------------------------------------
# Base Pr... | |
"""All constants related to the ZHA component."""
import enum
import logging
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR
from homeassistant.components.cover import DOMAIN as COVER
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER
from homeassistant.components.f... | |
#!/usr/bin/env python
# Phusion Passenger - https://www.phusionpassenger.com/
# Copyright (c) 2010-2014 Phusion Holding B.V.
#
# "Passenger", "Phusion Passenger" and "Union Station" are registered
# trademarks of Phusion Holding B.V.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
... | |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | |
#!/usr/bin/env python
import sys
import os
import re
import time
from xml.dom.minidom import Document
try:
import xml.etree.ElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree # NOQA
except ImportError:
try:
import elementtree.ElementTree as ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# XCode Project Creator
#
import os, sys, re, shutil, codecs
from shutil import copyfile
from os.path import join, splitext, split, exists
from datetime import date
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
fileTargets = ['.c... | |
import math
import random
import time
from pandac.PandaModules import TextNode, BitMask32, Point3, Vec3, Vec4, deg2Rad, Mat3, NodePath, VBase4, OdeTriMeshData, OdeTriMeshGeom, OdeRayGeom, CollisionTraverser, CollisionSegment, CollisionNode, CollisionHandlerQueue
from direct.distributed import DistributedObject
from dir... | |
from __future__ import absolute_import
from __future__ import print_function
import theano
import theano.tensor as T
import numpy as np
import warnings, time, copy, pprint
from six.moves import range
import six
from . import optimizers
from . import objectives
from . import regularizers
from . import constraints
from ... | |
# -*- coding:utf-8 -*-
import tkinter
from tkinter import *
from tkinter import ttk
import tkinter.messagebox
from PIL import Image, ImageTk
from digraph import draw
class GUI:
def __init__(self, automaton, word):
self.automaton = automaton
self.header_position = 1
self.word = word
... | |
# Copyright 2014: Mirantis 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 b... | |
# -*- coding: utf-8 -*-
"""
Tests that the file header is properly handled or inferred
during parsing for all of the parsers defined in parsers.py
"""
from collections import namedtuple
import pytest
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Index, MultiIndex
from pandas.com... | |
from __future__ import unicode_literals
from time import gmtime
from calendar import timegm
from datetime import datetime
import pytz
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from elasticsearch import Elasticsearch
from website import settings
from website.search.elastic_s... | |
"""Visualization of TAFs"""
import datetime
# third party
import requests
import pandas as pd
import numpy as np
import matplotlib.patheffects as PathEffects
from matplotlib.patches import Rectangle
from metpy.units import units
from metpy.calc import wind_components
from pyiem.plot import figure
from pyiem.util impor... | |
# -*- encoding: utf-8 -*-
from . import FixtureTest
class IndianShieldTest(FixtureTest):
def test_547e_innh(self):
import dsl
z, x, y = (16, 47127, 28829)
self.generate_fixtures(
dsl.is_in('IN', z, x, y),
# https://www.openstreetmap.org/way/28465477
ds... | |
import numpy as np
from shapely.geometry.polygon import Polygon
import datetime
import netCDF4 as nc
import itertools
import geojson
from shapely.ops import cascaded_union
from openclimategis.util.helpers import get_temp_path
from openclimategis.util.toshp import OpenClimateShp
from shapely.geometry.multipolygon import... | |
""" Class to organize QA for a full DESI production run
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
import glob, os
from desispec.io import get_exposures
from desispec.io import get_files
from desispec.io import read_frame
from desispec.log import get_lo... | |
"""
**run_eval.py**
Least squares anomaly evaluation on static data. After running experiments,
use `generate_latex.py` to create a table of results.
This is a refactored and updated version of
the script in `evaluate_lsanomaly.zip`
(see https://cit.mak.ac.ug/staff/jquinn/software/lsanomaly.html).
**usage**: run_eva... | |
# qlearningAgents.py
# ------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.be... | |
from __future__ import with_statement
from cms.api import create_page
from cms.cms_toolbar import CMSToolbar
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.context_managers import SettingsOverride
from cms.toolbar.items import (Anchor, TemplateHTML, Switcher, List, ListItem,
... | |
import inspect
import os
import re
import sys
import nbformat
import numpy as np
from hyperopt import fmin
from nbconvert import PythonExporter
from .ensemble import VotingModel
from .utils import (
remove_imports, remove_all_comments, extract_imports, temp_string,
write_temp_files, determine_indent, with_lin... | |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | |
#!/usr/bin/env python
#
# $Id: _windows.py 1453 2012-07-13 19:55:11Z g.rodola $
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Windows specific tests. These are implicitly run by test_p... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest
import os
import json
import numpy as np
from pymatgen import Lattice, Structure, Specie
from pymatgen.transformations.standard_transformation... | |
# vim:fileencoding=utf-8:noet
from __future__ import unicode_literals, absolute_import
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import sys
import errno
from time import sleep
from threading import RLock
from powerline.lib.monotonic import monotonic... | |
import abc
import string
import bitstring
import logging
from .lifter_helper import ParseError
from .syntax_wrapper import VexValue
from ...expr import IRExpr, RdTmp
from .vex_helper import JumpKind, vex_int_class
l = logging.getLogger("instr")
class Instruction(metaclass=abc.ABCMeta):
"""
Base class for an... | |
"""
Custom Authenticator to use GitHub OAuth with JupyterHub
Most of the code c/o Kyle Kelley (@rgbkrk)
"""
import json
import os
import urllib
from tornado.auth import OAuth2Mixin
from tornado.escape import url_escape
from tornado import gen, web
from tornado.httputil import url_concat
from tornado.httpclient imp... | |
#!/usr/bin/env python3
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
Extra supported commands are:
* gen, to generate the classes required for Telethon to run or docs
* pypi, to generate sdist, bdist_wheel, and push to PyPi
"""
... | |
'''Test runner and result class for the regression test suite.
'''
import functools
import io
import sys
import time
import traceback
import unittest
# Brython: xml is not available
# import xml.etree.ElementTree as ET
from datetime import datetime
class RegressionTestResult(unittest.TextTestResult):
separator... | |
#
# 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 us... | |
# -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.excep... | |
# -*- 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 "L... | |
#!/usr/bin/python
import argparse, csv, os, sys, re #std python imports
import numpy as np
from sklearn.ensemble import RandomForestClassifier #RF classifier from SKlearn
from sklearn.cross_validation import cross_val_score #validation stats from SKlearn
import itertools
import multiprocessing as mp #allows for paralle... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
# Copyright 2019 The Magenta 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 ... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | |
#!/usr/bin/python2.1
import sys
from xml.dom.ext import SplitQName
from xml.sax.handler import ContentHandler
from xml.sax.saxutils import escape
_ROOT, _STRING, _COMMENT, _NAME, _KEYWORD, _TEXT, _HEAD =0,1,2,3,4,5,6
DOCBOOK = {
_ROOT: ('<programlisting>','</programlisting>'),
_STRING: ('<emphasis>', '</e... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# THIRD PARTY
import pytest
# LOCAL
from astropy.cosmology import Cosmology, Planck18
from astropy.cosmology.core import _COSMOLOGY_CLASSES
from astropy.cosmology.io.table import from_table, to_table
from astropy.table import QTable, Table, vstack
from ... | |
# Copyright (c) 2012 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.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
#
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2007-2008, R Oudkerk --- see COPYING.txt
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing import Process, cpu_count, Ti... | |
from __future__ import unicode_literals
from __future__ import print_function
from ..compat import text_type, number_types, iteritems
from ..context.missing import MoyaAttributeError
import re
import time
def obj_index(obj, key):
"""Get a key from an object"""
return (getattr(obj, "__getitem__", None) or ge... | |
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import u
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.functions.elementary.miscellaneous import sqrt
from sympy... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira, 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/li... | |
#!/usr/bin/env python
import base64
import sys, re
from pyparsing import (Regex, Suppress, Combine, Optional, CaselessKeyword,
ZeroOrMore, OneOrMore, removeQuotes, quotedString,
Empty, Literal, NoMatch, Group, oneOf, Forward,
Keyword, ParseExpression... | |
# Django settings for InitiativeWASH project.
import os
# import djcelery
# djcelery.setup_loader()
# BROKEN_URL = 'django://'
#DATABASE ROUTER
# RAPIDSMS_ROUTER = "rapidsms.router.db.DatabaseRouter"
##############
# The top directory for this project. Contains requirements/, manage.py,
# and README.rst, a Initiativ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# 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
#
# Unle... | |
"""
Various bayesian regression
"""
# Authors: V. Michel, F. Pedregosa, A. Gramfort
# License: BSD 3 clause
from math import log
import numpy as np
from scipy import linalg
from ._base import LinearModel, _rescale_data
from ..base import RegressorMixin
from ._base import _deprecate_normalize
from ..utils.extmath imp... | |
import re
import socket
import subprocess
import time
from os import mkdir
from shutil import rmtree
import mechanicalsoup
import requests
import unittest2 as unittest
from bs4 import BeautifulSoup
from django_docker_engine.docker_utils import (DockerClientRunWrapper,
Do... | |
# -*- coding: utf-8 -*-
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-instance-attributes
"""The classes in this module represent objects sent and received from
the XMS REST API.
"""
from __future__ import absolute_import, division, print_function
class ReportType(object):
"""A collection ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 6 10:24:07 2020
@author: TeSolva
"""
import numpy as np
import pandas as pd
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import os
import re
#%%
def my_int(my_string):
try:
out = int(my_string)
excep... | |
from __future__ import print_function
from numpy import dot, sum
import numpy.testing as npt
from proteus.EGeometry import (X,Y,Z)
from proteus.Quadrature import (SimplexGaussQuadrature,
SimplexLobattoQuadrature,
CubeGaussQuadrature,
... | |
import numpy as np
class Node(object):
'''
A base class for a node object.
Each node has:
- a name and description
- properties
- incoming and outgoing data
'''
def __init__(self, name):
self._name = name
self._props = {}
self._data = self._props
... | |
# -*- coding: utf-8 -*-
""" PolymorphicModel Meta Class
Please see README.rst or DOCS.rst or
http://chrisglass.github.com/django_polymorphic/
"""
from __future__ import absolute_import
import sys
import inspect
import django
from django.db import models
from django.db.models.base import ModelBase
from django.... | |
# coding: utf-8
import pytest # noqa: 401
from mock import mock, patch
from sitebackup import main
from backup.utils.mail import Sender, Recipient
def testHelp():
with pytest.raises(SystemExit) as exceptioninfo:
main(["-h", ])
assert exceptioninfo.value.code == 0
def setupWP(mock):
m = mock()... | |
# Copyright (c) 2013 Yubico AB
# 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, this list of conditi... | |
r"""
Arithmatex.
pymdownx.arithmatex
Extension that preserves the following for MathJax use:
~~~.tex
$Equation$, \(Equation\)
$$
Display Equations
$$
\[
Display Equations
\]
\begin{align}
Display Equations
\end{align}
~~~
and `$Inline MathJax Equations$`
Inline and display equations are converted to script... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | |
"""
Copyright 2016 ElasticBox 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 agreed to in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.