gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import isodate
import json
import re
import roax.schema as s
import unittest
from base64 import b64encode
from io import BytesIO
from datetime import date, datetime
from uuid import UUID
_UTC = isodate.tzinfo.Utc()
class TestSchema(unittest.TestCase):
def _equal(self, fn, val):
self.assertEqual(val, fn... | |
# http://inamidst.com/saxo/
# Created by Sean B. Palmer
import codecs
import multiprocessing
import os
import re
import socket
import socketserver
import sys
import time
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
scripts = os.path.dirname(sys.modules["__main__"].__file__)
scripts = os.path.abspath(s... | |
import os
import asyncio
import hashlib
from urllib import parse
import xmltodict
from boto.s3.connection import S3Connection
from boto.s3.connection import OrdinaryCallingFormat
from boto.s3.connection import SubdomainCallingFormat
from waterbutler.core import streams
from waterbutler.core import provider
from wate... | |
import inspect
import sys
from dateutil.parser import parse
import formencode
import formencode.validators as fev
import formencode.national
import sqlalchemy as sa
from savalidation._internal import is_iterable
_ELV = '_sav_entity_linkers'
# map a SA field type to a formencode validator for use in _ValidatesConstr... | |
# This file is part of ZS
# Copyright (C) 2013-2014 Nathaniel Smith <njs@pobox.com>
# See file LICENSE.txt for license information.
import json
import hashlib
import os
import os.path
import multiprocessing
import struct
import sys
import getpass
import socket
import traceback
from contextlib import contextmanager
fro... | |
# Copyright 2017 Battelle Energy Alliance, 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 t... | |
import base64
import json
import msgpack
import operator
import zlib
from collections import defaultdict
from copy import copy
from datetime import datetime
from dateutil import tz
from enum import IntEnum
from functools import reduce
from itertools import chain
from . import model
from .model import EmbedLike, Prope... | |
#!/usr/bin/env python
import math
import ctypes
from contextlib import contextmanager
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.arrays import vbo
from PIL import Image
import pygame
class ImageTexture(object):
def __init__(self, image):
self.width = image.size[0]
self.height =... | |
"""
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from time import time
import os
import shutil
import traceback
import glob
import sys
from StringIO import StringIO
import matplotli... | |
# coding: utf-8
"""
flask_oauthlib.provider.oauth2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implemnts OAuth2 provider support for Flask.
:copyright: (c) 2013 - 2014 by Hsiaoming Yang.
"""
import os
import logging
import datetime
from functools import wraps
from flask import request, url_for
from flask import r... | |
import datetime as dt
from functools import wraps
import requests
import time
import pandas as pd
import numpy as np
import numpy.random as nr
from sklearn.preprocessing import StandardScaler
from torch.autograd import Variable
import torch as T
import toolz.curried as z
toyear, tomonth = dt.date.today().year, dt.da... | |
# 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 may ... | |
# Copyright (c) 2016 636F57@GitHub
# This software is released under an MIT license.
# See LICENSE for full details.
import discord
from discord.ext import commands
import random
import glob
from os.path import basename
import time
import aiohttp
from bs4 import BeautifulSoup
import asyncio
import html
import calendar... | |
# Copyright 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 requ... | |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
COHORTE Node Composer HTTP Service Proxy
:authors: Bassem Debbabi
:copyright: Copyright 2015, isandlaTech
:license: Apache Software License 2.0
"""
# iPOPO decorators
from pelix.ipopo.decorators import ComponentFactory, Provides, Property, Instantiate, \
Vali... | |
"""
Form classes
"""
from django.core.exceptions import ValidationError
from django.utils.copycompat import deepcopy
from django.utils.datastructures import SortedDict
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
from django.utils.safest... | |
#!/usr/bin/python2
from fabric.api import *
from fabric.tasks import execute
import sys
import os
import argparse
import ntpath
import fnmatch
"""
Author: mtask@github.com
"""
class multissh(object):
def manage_servers(self, add=False, delete=False, param=None):
if add:
self.server = param.... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
import pytest
import responses
import re
from flask import json
from copy import deepcopy
from json.decoder import JSONDecodeError
from requests import ConnectionError
from backend.util.request.store.search_request import SearchRequest
from backend.util.response.store.search_results import SearchResultsSchema
from bac... | |
# -*- coding: utf-8 -*-
#
# (C) Rob W.W. Hooft, 2003
# (C) Pywikipedia bot team, 2003-2012
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os, re
import sys as __sys
import platform
# IMPORTANT:
# Do not change any of the variables in this file. Instead, make
# a file user-config.py,... | |
from js_process_ast import traverse, traverse_i, null_node, \
find_node, flatten_statementlists, \
kill_bad_globals
from js_ast import *
from js_cc import js_parse, unpack_for_c_loops, combine_if_else_nodes
import sys, os, time, math, struct, io, imp
typespace = No... | |
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.exceptions imp... | |
import base64
import boto
from boto.ec2.instance import Reservation, InstanceAttribute
from boto.exception import EC2ResponseError
import sure # noqa
from moto import mock_ec2
################ Test Readme ###############
def add_servers(ami_id, count):
conn = boto.connect_ec2()
for index in range(count):
... | |
#
# Copyright 2013 Quantopian, 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 wr... | |
'''Pulsar HTTP test application::
python manage.py
Implementation
======================
.. autoclass:: HttpBin
:members:
:member-order: bysource
Server Hooks
===================
This example shows how to use
:ref:`server hooks <setting-section-application-hooks>` to log each request
.. automodule:: exa... | |
# Copyright 2014 Cloudera 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, so... | |
#
# 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
# ... | |
# coding=utf-8
''''''
import os
import ast
import sys
import time
import signal
import argparse
import asyncio
from datetime import datetime, timedelta
from collections import defaultdict
from functools import reduce, partial
from slacker import Slacker
from tornado.ioloop import IOLoop
from apscheduler.job import Job... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... | |
# 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 may ... | |
#!/usr/bin/env python3
""" Converts owl or ttl or raw rdflib graph into a pandas DataFrame. Saved in .pickle format.
Usage:
allen_cell_types [options]
Options:
-h --help Display this help message
-v --version Current version of file
-r --refresh Update l... | |
"""
Work with indexes in the database.
"""
import asyncio
import asyncio.tasks
from typing import Any, Dict, List, Optional, Tuple
import pymongo
from sqlalchemy.ext.asyncio import AsyncEngine
import virtool.history.db
import virtool.pg.utils
import virtool.references.db
import virtool.utils
from virtool.api.utils i... | |
# Copyright 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.
import sys
from measurements import smoothness
from metrics import power
from telemetry import decorators
from telemetry.core import exceptions
from telemetr... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | |
import sys
import getopt
import re
import string
#
# Originally written by Einar Lielmanis et al.,
# Conversion to python by Einar Lielmanis, einar@jsbeautifier.org,
# MIT licence, enjoy.
#
# Python is not my native language, feel free to push things around.
#
# Use either from command line (script displays its usage ... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
import datetime
try:
import json
except ImportError:
from django.utils import simplejson as json
from djutils.dashboard.models import Panel, PanelData, PanelDataSet
from djutils.dashboard.provider import PanelProvider
from djutils.dashboard.registry import registry
from djutils.dashboard.views import dashboar... | |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | |
#!/usr/bin/env python
__version__="0.1.0"
# make the other metrics work
# generate the txt files, then work on the pdf otuput
import pandas as pd
import sys
import os
import re
import shelve
import numpy as np
import pprint as pp
import argparse, traceback
import core.graph_sampler as gs
import core.probabilistic_cfg ... | |
#!/usr/bin/env python
"""
Builds a Windows Resource Control Script
"""
import datetime
import getpass
import os
__version__ = '0.0.0'
#=============================================================================
default_template = """
/***************************************************************************... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Force-Directed Graph Layout
===========================
This module contains implementations for a force-directed layout, where the
graph is modelled like a collection of ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pprint
from bs4 import BeautifulSoup
from six.moves.urllib import parse as urlparse
import six
from astropy import units as u
from . import conf
from ..query import BaseQuery
from ..utils import prepend_docstr_nosections, commons, async_to_sync
_... | |
#!/usr/bin/env python
# Full license can be found in License.md
# Full author list can be found in .zenodo.json file
# DOI:10.5281/zenodo.1199703
# ----------------------------------------------------------------------------
"""Date and time handling utilities."""
import datetime as dt
import numpy as np
import pandas... | |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Get the GitHub repos from PNE course students
#
# Copyright (C) Alvaro del Castillo
#
# 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 versio... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from rdmo.conditions.models import Condition
from rdmo.core.models import TranslationMixin
from rdmo.core.plugins import get_plugin
from rdmo.core.utils import copy_model, join_url
class OptionSet(mod... | |
from ipykernel.kernelbase import Kernel
from IPython.utils.path import locate_profile
from jupyter_client import MultiKernelManager
from pexpect import replwrap,EOF,spawn
import signal
import re
import os
from distutils.spawn import find_executable
import sys
from IPython.display import Image
from glob import glob
imp... | |
<<<<<<< HEAD
<<<<<<< HEAD
"""TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _call_if_exists(parent, attr):
func = getattr(parent, attr, lambda: None)
func()
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ExperimentRelatedLink.created'
db.add_column(u'calc_exper... | |
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import mysql.connector
import math
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib import dates
from mpl_toolkits.basemap import Basemap
import calendar
from scipy.opti... | |
#
# BitBake Graphical GTK based Dependency Explorer
#
# Copyright (C) 2007 Ross Burton
# Copyright (C) 2007 - 2008 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundatio... | |
#!/usr/bin/env python
#-
# Copyright (c) 2006 Verdens Gang AS
# Copyright (c) 2006-2015 Varnish Software AS
# All rights reserved.
#
# Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... | |
#
# Copyright (c) SAS Institute 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 w... | |
#! /usr/bin/env python
# Copyright (c) 2013, Rob Ward
# 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 ... | |
#! /usr/bin/env python
from datetime import datetime, date
import os
import re
import time
import logging
import json
import requests
import sys
import config
import slackbot
import utils
# An arbitrary past date, as a default value for the earliest archive date
PAST_DATE_STRING = '2000-01-01'
class Destalinator(... | |
# Copyright (c) 2013 Mirantis 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 writi... | |
#!/usr/bin/env python
"""
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");... | |
from collections import namedtuple
from games import (Game)
class GameState:
def __init__(self, to_move, board, label=None):
self.to_move = to_move
self.board = board
self.label = label
def __str__(self):
if self.label == None:
return super(GameState, self).__str__... | |
# Thanks to Zhao Yu for converting the .ipynb notebook to
# this simplified Python script that I edited a little.
# Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
import tensorflow as tf
import numpy as np
import matplotlib
import mat... | |
"""Extends the environment by adding observation and action history.
The implementation is a bit dirty import of the implementation in
the experimental branch.
"""
from gym import spaces
import numpy as np
from pybullet_envs.minitaur.envs.minitaur_reactive_env import MinitaurReactiveEnv
class MinitaurExtendedEnv(... | |
"""Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import make_dataset
from .sag_fast import sag
from ..exceptions import ConvergenceWarning
from ..utils import check_arra... | |
# pylint: disable=missing-docstring
import io
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, Group
from django.core.management import call_command
from django.test import override_settings
from guardian... | |
# -*- coding: utf-8 -*-
import copy
import re
import tempfile
from typing import Any, Dict, List, Optional, Union
from pytest import mark, param, raises
from omegaconf import (
MISSING,
AnyNode,
DictConfig,
DictKeyType,
ListConfig,
MissingMandatoryValue,
OmegaConf,
UnsupportedValueType... | |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy._lib.six import callable, xrange
from collections import namedtuple
__all__ = ['binned_statistic',
'binned_statistic_2d',
'binned_statistic_dd']
BinnedStatisticResult = namedtuple('B... | |
import os
import uuid
from osipkd.tools import row2dict, xls_reader
from datetime import datetime
from sqlalchemy import not_, func
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
import colander
from deform import (
Form,
widget,
ValidationFailure... | |
"""
These are experiments to compare the Betweenness results
from the python networkX library to some handwritten
notes and check if our expectations were correct.
Especially, we want to figure out how undirected edges
are handled in comparison to directed ones, how
end-point consideration changes the results, and if
... | |
# Copyright (c) 2017 Cloudbase Solutions Srl
#
# 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... | |
Uproc : Unix Processes
Prezentarea proiectului
Five examples of using Unix processes are presented.
The examples are implementation in the C language.
At the finish of each example, the equivqlent Python
source is presented.
The first example illustrates the link between a parent process and
and a son's created by... | |
import unittest
import mock
import numpy
import chainer
from chainer import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check
if cuda.available:
cuda.init()
class TestFunction(unittest.TestCas... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 pytest
import mock
from api.base.settings.defaults import API_BASE
from api.preprint_providers.permissions import GroupHelper
from osf_tests.factories import (
PreprintFactory,
AuthUserFactory,
PreprintProviderFactory,
)
from osf.utils import permissions as osf_permissions
from api_tests.reviews.mi... | |
# Copyright 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# white_signals.py
"""Contains class factories for white noise signals. White noise signals are
defined as the class of signals that only modifies the white noise matrix `N`.
"""
import numpy as np
import scipy.sparse
from enterprise.signals import parameter, selections, signal_base, utils
from enterprise.signals.pa... | |
""" Cisco_IOS_XR_ipv4_telnet_mgmt_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ipv4\-telnet\-mgmt package configuration.
This module contains definitions
for the following management objects\:
telnet\: Global Telnet configuration commands
Copyright (c) 2013\-2016 by Cisco Systems, I... | |
import json
import re
from ctypes import c_void_p, c_wchar_p
from decimal import Decimal
from logging import DEBUG, NullHandler, getLogger
from subprocess import CalledProcessError, check_output
from pymediainfo import MediaInfo
from pymediainfo import __version__ as pymediainfo_version
from knowit import VIDEO_EXTE... | |
class IntersectionError(Exception):
def __init__(self):
Exception.__init__(self)
class SetPartitionPartStructureError(Exception):
def __init__(self, arg):
Exception.__init__(self, arg)
class SetPartitionPart(tuple):
def __new__(_cls, arg):
seen = []
if len(arg) == 0:
... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
from collections import defaultdict, namedtuple
import re
import inspect
BOOLEAN_FIELDS = (
"search.regex", "searchable", "orderable", "regex"
)
DataColumn = namedtuple("DataColumn", ("name", "model_name", "filter"))
class DataTablesError(ValueError):
pass
class DataTable(object):
def __init__(self,... | |
# 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 a... | |
# -*- coding: utf-8 -*-
"""
These tests all run against an actual Google Music account.
Destructive modifications are not made, but if things go terrible wrong,
an extra test playlist or song may result.
"""
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import * # n... | |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | |
#!/usr/bin/env python2
###############################################################################
# ------------------------- Description ---------------------------------------
###############################################################################
# This script is designed to create a mask of stagnation... | |
# 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 __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import ... | |
"""Utilities to deal with sympy.Matrix, numpy and scipy.sparse."""
from sympy import Matrix, I, Expr, Integer
from sympy.matrices import matrices
__all__ = [
'numpy_ndarray',
'scipy_sparse_matrix',
'sympy_to_numpy',
'sympy_to_scipy_sparse',
'numpy_to_sympy',
'scipy_sparse_to_sympy',
'flat... | |
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2013 Ivo Tzvetkov
#
# 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 ri... | |
# encoding: utf8
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version... | |
'''
====================================================================
Copyright (c) 2003-2010 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
======================================================... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 os
import sys
from SteamworksParser import steamworksparser
g_TypeConversionDict = {
"uint8": "byte",
"uint16": "ushort",
"uint32": "uint",
"uint64": "ulong",
"char": "string",
"int32": "int",
"int64": "long",
"uint8 *": "IntPtr",
"const char *": "string",
"const char *... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains classes to wrap Python VTK to make nice molecular plots.
"""
import itertools
import math
import os
import subprocess
import time
import numpy as np
try:
import vtk
from vtk... | |
"""
Item Exporters are used to export/serialize items into different formats.
"""
import csv
import io
import sys
import pprint
import marshal
import six
from six.moves import cPickle as pickle
from xml.sax.saxutils import XMLGenerator
from scrapy.utils.serialize import ScrapyJSONEncoder
from scrapy.utils.python impo... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test Network Discovery
----------------------
The TD is on network 1 with sniffer1, network 2 has sniffer2, network 3 has
sniffer3. All three networks are connected to one IUT router.
"""
import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogg... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
# -*- coding: utf-8 -*-
"""
sleekxmpp.jid
~~~~~~~~~~~~~~~~~~~~~~~
This module allows for working with Jabber IDs (JIDs).
Part of SleekXMPP: The Sleek XMPP Library
:copyright: (c) 2011 Nathanael C. Fritz
:license: MIT, see LICENSE for more details
"""
from __future__ import unicode_literals
... | |
import rules
from django.db import models
from django.utils import timezone
from django.urls import reverse
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django_extensions.db.models import TimeStampedModel
from communities.models import CommunitySubscription
from m... | |
"""Cinder Database Manipulation."""
# Copyright (c) 2014 Mirantis 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 applic... | |
import tensorflow as tf
import tensorflow.contrib.slim as slim
import tensorflow.contrib.framework as framework
import numpy as np
import configargparse
import os
import sys
import datetime
from fnst import vgg, losses, image_transform_net
# This file implements operations necessary to train the feedforward CNN for ... | |
# Copyright 2011 Department of Defence
# 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... | |
#!/usr/bin/env python3.5
#
# tools.py
#
# (C) The James Hutton Institute 2016
# Author: Leighton Pritchard
"""
tools.py
This module provides helper functions used in the supplementary information
notebooks and scripts for the Holmes et al. (2017) paper.
"""
from matplotlib import pyplot as plt
import numpy as np
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.