gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
__author__ = 'James'
from monopyly import *
from .property_probs_calcs import PropertyProbCalcs
from .property_sim import *
from .board_utils import *
class DecisionUtils():
def __init__(self, property_probs):
self.property_probs = property_probs
self.board_utils = BoardUtils(self.property_probs)
... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2014-2016, 'prx' developers (see AUTHORS file)
# All rights reserved.
#
# Distributed under the terms of the MIT license.
#
# The full license is in the LICENSE file, distributed with this software.
# ------------------------... | |
# 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 applicable law or agreed to in writ... | |
import os.path
from django.core.management import call_command
from django_nose.tools import (
assert_equal,
assert_false,
assert_is_none,
assert_raises,
assert_true,
)
from django.db.models import Q
from django.test.utils import override_settings
from mock import call, Mock, patch
from pontoon.b... | |
#!/usr/bin/env dls-python2.7
"""Selection of Qt plots that show information about the I10 chicane.
Plots are available for use in eithier the beamline or accelerator GUIs.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.backends.backend_qt4agg import (
... | |
# -*- coding: utf-8 -*-
import traceback
# turbogears imports
from tg import expose, redirect, validate, flash, request, response, override_template,config
from tg.decorators import paginate
# third party imports
from repoze.what import predicates,authorize
from repoze.what.predicates import not_anonymous,in_group,h... | |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _
from olympia import amo
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url, page_name
from olympia.addons.models import Addon, Category... | |
import _dk_core as core
from collections import namedtuple
from . import resource
from .. import blendstate
from math import floor
DEFAULT_FILENAME = 'BitstreamVeraSans.ttf'
DEFAULT_OUTLINE = 1.0
DEFAULT_DPI = (72, 72)
UniformScaleAttr = namedtuple('UniformScaleAttr', 'file, point, embolden, outline, dpi, kerning, b... | |
#
# 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
# ... | |
# csaudio.py
# import csaudio ; reload(csaudio) ; from csaudio import *
import wave
wave.big_endian = 0
def printParams(params):
print 'Parameters:'
print ' nchannels:', params[0]
print ' sampwidth:', params[1]
print ' framerate:', params[2]
print ' nframes :', params[3]
print ' com... | |
# 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/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from __future__ import print_function
import random
import unicodeda... | |
from .utils import lzip, copy_func, find_in_bases
from .constants import *
from .exception import *
import functools
import inspect
__all__ = ["mediator_meta", "TemplateFunctionMeta"]
def mediator_meta(*metaclasses):
"""
Return a metaclass that acts as a mediator for multiple metaclasses.
EXAMPLE
=======
----
... | |
# 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... | |
# -*- coding: utf-8 -*-
import datetime
import functools
import operator
import re
from dateutil import parser
from modularodm import Q
from nose.tools import * # flake8: noqa
from rest_framework import serializers as ser
from unittest import TestCase
from tests.base import ApiTestCase
from api.base.filters imp... | |
__author__ = 'wenjusun'
from datetime import date
import calendar
import web
from cms.cms_model import Image, Preorder
from cms import cms_service
from cms import service_config
from wshelper import ServiceHelper
from wshelper import ListWrapper
urls = (
"/home", "HomePage",
"/test", "TestPage",
... | |
#!/usr/bin/env python
# CREATED BY CHRISTOPHER LAVENDER
# BASED ON WORK BY ADAM BURKHOLDER
# INTEGRATIVE BIOINFORMATICS, NIEHS
# WORKING OBJECT ORIENTED VERSION
import os
import argparse
import csv
from operator import itemgetter
from TSScall import readInReferenceAnnotation
from collections import defaultdict
def ... | |
# coding:utf-8
'''
Created on 2017/11/11.
@author: chk01
'''
import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
from PIL import Image
from scipy import ndimage
import tensorflow as tf
from tensorflow.python.framework import ops
from class_four.week_one.cnn_utils import *
np.random... | |
# Copyright (c) 2014-2020 Cloudify Platform Ltd. 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... | |
"""Module responsible for loading trained models and guessing virus names.
Overall, the idea is to guess a name for a virus from the names that Antiviruses
give it.
When using the Guesser class, all Exceptions are wrapped in a
NameGeneratorException.
Usage:
In [1]: from name_generator import Guesser
In [2]: g = Gues... | |
# Copyright 2016 gRPC 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 writing... | |
# 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 __future__ import absolute_import,unicode_literals
import re
import sqlite3
import synapse.compat as s_compat
import synapse.cores.common as s_cores_common
from synapse.compat import queue
from synapse.common import now,genpath
stashre = re.compile('{{([A-Z]+)}}')
int_t = s_compat.typeof(0)
str_t = s_compat.t... | |
# Copyright (c) 2014 Rackspace Hosting
# 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 req... | |
from device import Device
from packet import RoutingPacket
from event import Event
from blackwidow.network.rate_graph import Rate_Graph
ROUTING_PKT_ID = 'Routing Packet'
class Router(Device):
"""Class for routers.
Routers are responsible for initializing and updating their
routing table, and sending pac... | |
"""
Manage Dell DRAC from the Master
The login credentials need to be configured in the Salt master
configuration file.
.. code-block:: yaml
drac:
username: admin
password: secret
"""
import logging
try:
import paramiko
HAS_PARAMIKO = True
except ImportError:
HAS_PARAMIKO = False
lo... | |
import pytest
pytest.importorskip("numpy")
import numpy as np
import dask
import dask.array as da
from dask.array.core import getter, getter_nofancy
from dask.array.optimization import (
fuse_slice,
getitem,
optimize,
optimize_blockwise,
optimize_slices,
)
from dask.array.utils import assert_eq
f... | |
"""SPSSbench module for timing command sets
Note that it requires the Pywin32 extensions, which can be found here
http://sourceforge.net/projects/pywin32/"""
#Licensed Materials - Property of IBM
#IBM SPSS Products: Statistics General
#(c) Copyright IBM Corp. 2011, 2020
#US Government Users Restricted Rights - Use, du... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 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 applicab... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import importlib
import os
import shutil
import sys
import sphinx_rtd_theme
# -- Mock necessary classes -----------------------------------------------
from unittest.mock import MagicMock
sys.path.insert(0, os.path.abspath(".")) # noqa: F402
sys.path.insert(0, os.pa... | |
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
class AcronymsCdAdmin(BaseAdmin):
list_display = ("acronym", "stands_for", "effect_dt", "a_desc")
date_hierarchy = 'effect_dt'
search_fields = ("acronym", "a_desc")
class AddressCdAdmin(BaseAdmin):
pass
c... | |
#!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | |
# Copyright (c) 2012 Rackspace Hosting
# 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 req... | |
# 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
# encoding: utf-8
#
# This file is part of ckanext-doi
# Created by the Natural History Museum in London, UK
import xml.etree.ElementTree as ET
import pytest
from datacite.errors import DataCiteError, DataCiteNotFoundError
from unittest.mock import patch, MagicMock
from . import constants
from... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 wi... | |
# 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... | |
#!/usr/bin/env python
# Copyright 2014 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 unittest
from pylib.base import base_test_result
from pylib.results import json_results
class JsonResultsTest(unittest.TestCa... | |
# 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 ... | |
"""
Unit tests for REST Client
"""
import json
import mock
import requests
from purestorage import FlashArray, PureError, PureHTTPError
CLIENT_PATH = "purestorage.purestorage"
ARRAY_OBJ = CLIENT_PATH + ".FlashArray"
class TestBase(object):
def setup_method(self, __):
self.api_token = "12345678-abcd-123... | |
# simple types for "assembler" instructions
import string
from fracttypes import Bool, Int, Float, Complex, Hyper, Color, Gradient, Image
from fracttypes import TranslationError, typeObjectList
class ComplexArg:
' a pair of args'
def __init__(self,re,im):
self.re = re
self.im = im
def for... | |
import unittest
from unittest import mock
from unittest.mock import patch
from canvas_sdk.client import RequestContext
from canvas_sdk.methods import sections
class TestSections(unittest.TestCase):
def setUp(self):
self.section_id = 1234
self.course_id = 9999 # set a fake course id for the tests... | |
#!/usr/bin/env python
# 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.
'''Unit tests for grit.gather.chrome_html'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.... | |
# 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
# distributed under the... | |
# 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.
"""Presubmit script for Chromium WebUI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | |
import json
import string
import uuid
from collections import defaultdict
from copy import copy
from datetime import datetime
from django.apps import apps
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.functional import cached_property
from django.uti... | |
import tensorflow as tf
import numpy as np
import datetime
import threading
import random
import time
import sys
import gym
env = gym.make('Breakout-v0')
CPU_ONLY = False
TRAIN = True
BENCHMARK = False
if 'eval' in sys.argv:
TRAIN = False
if 'cpu' in sys.argv:
CPU_ONLY = True
if 'benchmark' in sys.argv:
BENCHMARK ... | |
#!/usr/bin/env python3
"""
Copyright 2017 Andris Zbitkovskis
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... | |
import numpy as np
import scipy.optimize
import matplotlib.pyplot as plt
import psycopg2
from dataprocessing import *
from bicycle import WheelAssemblyGyrostat
# Error tolerance used for curve_fit
ftol = 1e-12
xtol = 1e-12
# Establish database connection
conn = psycopg2.connect(database="robot_bicycle_parameters", us... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import itertools as it, operator as op, functools as ft
from collections import deque, OrderedDict
import ConfigParser as configparser
import os, sys, io, logging, re, time, types, string, unicodedata, random
import json, subprocess, ... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "heatmap.hoverlabel"
_path_str = "heatmap.hoverlabel.font"
_valid_props = {"color", "colorsrc",... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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
#
# ... | |
#!/usr/bin/env python3
"""Create an archive in Simple Archive Format for batch import into DSpace."""
import collections
import csv
import os
import os.path
import shutil
import tkinter
import tkinter.messagebox
import xml.etree.ElementTree as ET
class CreateArchive():
"""Class for creating archive."""
def... | |
#!/usr/bin/env python3
# Copyright (c) 2007-8, Playful Invention Company
# Copyright (c) 2008-14, Walter Bender
# Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "So... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import abspath, exists
import tornado
from concurrent.fu... | |
#
# Copyright 2013 Radware LTD.
#
# 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... | |
"""Support for MQTT message handling."""
import asyncio
from functools import partial, wraps
import inspect
from itertools import groupby
import json
import logging
from operator import attrgetter
import os
import ssl
import time
from typing import Any, Callable, List, Optional, Union
import attr
import certifi
import... | |
#!/usr/bin/env python
# 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, Versio... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
import csv
import glob
import json
import os
from collections import namedtuple
import unittest
import tempfile
import shutil
import numpy as np
from ray.cloudpickle import cloudpickle
from ray.tune.logger import (
CSVLoggerCallback,
JsonLoggerCallback,
JsonLogger,
CSVLogger,
TBXLoggerCallback,
... | |
#
# 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... | |
from .exceptions import QueryParameterError
from .utils import ESRange, EqualityComparableUsingAttributeDictionary
from .es import json
class Filter(EqualityComparableUsingAttributeDictionary):
_extra_properties = ("_cache", "cache_key", "_name")
def __init__(self, **kwargs):
self._extra_values = {k... | |
"""FDTD Postprocessing.
"""
from __future__ import print_function
from builtins import str
from builtins import range
from builtins import object
import os
import numpy
import EMpy.utils
import pylab
__author__ = "Lorenzo Bolla"
class Input(object):
"""Data structure to handle input files."""
def __init__... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import json
import unittest
from magnet.topology import Topology
from magnet.test.utils import create_cmdexecutor
def load_json_file(json_filepath):
obj = {}
with open(json_filepath, 'r') as f:
obj = json.loads(f.read())
return obj
def ... | |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from functools import partialmethod
from pathlib import Path, PurePath
from textwrap import dedent
from typing import List, Optional
from pants.backend.python.rules import (
download_... | |
# Copyright (c) 2013 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 re... | |
# Lint as: python2, python3
# 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
#
... | |
import numpy as np
import scipy as sp
import logging as logger
import time
import pylab as pl
from collections import defaultdict
from sklearn.metrics import confusion_matrix
class PassiveAggressiveII(object):
"""
Passive Aggressive-II algorithm: squared hinge loss PA.
References:
- http://jmlr.o... | |
import subprocess
import shlex
from time import sleep
import datetime
import shutil
import re
from django.conf import settings
from django.core.files import File
from django.utils import timezone
import thread
import traceback
import tempfile
import pytz
import requests
import os
import zipfile
from cidonkey.models im... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
orm['avocado.DataField'].objects.filter(translator='SNPS Only').update(translator='... | |
#*******************************************************************
# Copyright 2002-2008 LSI Corporation
#
# 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... | |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
#!/usr/bin/env python
"""
Copyright (c) Steinwurf ApS 2016.
All Rights Reserved
Distributed under the "BSD License". See the accompanying LICENSE.rst file.
run ratemon.py with <wlan device> as interface
"""
from __future__ import print_function
import sys
import os
import time
import datetime
import argparse
impo... | |
"""
<Program Name>
missing_seattle_install.py
<Started>
June 2009
<Author>
n2k8000@u.washington.edu
Konstantin Pik
<Purpose>
This file will read in a list file passed into it, and from that list it
will install seattle on all of those nodes. The list file is to be in the
file format specified for .LIS... | |
from __future__ import unicode_literals
import json
from django.conf import settings
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import QuerySet, Q
from django.utils.encoding import python_... | |
##############################################################################
# Copyright 2016-2018 Rigetti Computing
#
# 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... | |
"""
Connecting to a set of solr servers.
To get a :class:`~solrcloudpy.SolrCollection` instance from a :class:`SolrConnection` use either dictionary-style or attribute-style access:
>>> from solrcloudpy.connection import SolrConnection
>>> conn = SolrConnection()
>>> conn.list()
[u'collection1']
... | |
import h2o_cmd, h2o, h2o_util, h2o_gbm
import re, random, math
def pickRandGlmParams(paramDict, params):
colX = 0
randomGroupSize = random.randint(1,len(paramDict))
for i in range(randomGroupSize):
randomKey = random.choice(paramDict.keys())
randomV = paramDict[randomKey]
randomValu... | |
# Copyright 2013 IBM Corp.
#
# 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 importlib
import json
from datetime import timedelta, datetime
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
from django.core.mail import mail_managers
from django.core.urlresolvers import revers... | |
# mako/_ast_util.py
# Copyright 2006-2021 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
ast
~~~
This is a stripped down version of Armin Ronacher's ast module.
:copyr... | |
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import logging
import os.path
import re
from pipenv.patched.notpip._vendor.packaging.version import parse as parse_version
from pipenv.patched.notpip._vendor.six.moves.url... | |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
from os import environ
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConf... | |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, Inc.
# Copyright 2011 Citrix Systems
#
# 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... | |
# -*- coding: utf-8 -*-
"""
This file is part of the PROPheT tool.
Copyright (C) 2016: MKLab <pmitzias@iti.gr; mriga@iti.gr; skontopo@iti.gr>
http://mklab.iti.gr/project/prophet-ontology-populator
https://github.com/MKLab-ITI/prophet
Licensed under the Apache License, Version 2.0 (the "License").
You may use this f... | |
# Copyright 2016 Cisco Systems, 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 requir... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# A simple python script to get active IPs on LAN managed
# with a CBN CG6640E router model. This script has been
# optimizated to firmware CG6640-3.5.1.10a-SH therefore
# using a different firmware version can cause errors.
#
# gNrg(at)tuta.io
#
import os
from contextl... | |
import os
import shutil
from pyquery import PyQuery
from StringIO import StringIO
from textwrap import wrap
import django.test
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import ma... | |
"""
@file
@brief Compute metrics in for a competition
"""
import os
import sys
if sys.version_info[0] == 2:
FileNotFoundError = Exception
def main_codalab_wrapper_binary_classification(fct, metric_name, argv, truth_file="truth.txt",
submission_file="answer.txt", ou... | |
#!/usr/bin/env python
import argparse
import cv2
from numpy import empty, nan
import os
import sys
import time
import CMT
import numpy as np
import util
CMT = CMT.CMT()
parser = argparse.ArgumentParser(description='Track an object.')
parser.add_argument('inputpath', nargs='?', help='The input path.')
parser.add_a... | |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of netconf interface for QFX physical router
configuration manager
"""
from db import *
from dm_utils import DMUtils
from juniper_conf import JuniperConf
from juniper_conf import JunosInterface
from device_api.j... | |
# Copyright 2015 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... | |
# Copyright 2013 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/LICENSE-2... | |
# Copyright (C) 2009, Pauli Virtanen <pav@iki.fi>
# Distributed under the same license as SciPy.
import warnings
import numpy as np
from numpy.linalg import LinAlgError
from scipy.linalg import get_blas_funcs
from .utils import make_system
from ._gcrotmk import _fgmres
__all__ = ['lgmres']
def lgmres(A, b, x0=None... | |
#!/usr/bin/env python
"""
@package ion.agents.platform.platform_driver
@file ion/agents/platform/platform_driver.py
@author Carlos Rueda
@brief Base classes supporting platform drivers.
"""
__author__ = 'Carlos Rueda'
import logging
from copy import deepcopy
from pyon.public import log
from pyon.agent.common... | |
# Copyright (c) 2016-2020, The Bifrost Authors. 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 conditi... | |
import numpy as np
from stingray.events import EventList
from stingray.varenergyspectrum import VarEnergySpectrum, RmsEnergySpectrum
from stingray.varenergyspectrum import LagEnergySpectrum
from stingray.varenergyspectrum import ExcessVarianceSpectrum
from stingray.lightcurve import Lightcurve
from astropy.tests.helpe... | |
from django.conf import settings
config = settings.CSV2_CONFIG
from django.views.decorators.csrf import requires_csrf_token
from cloudscheduler.lib.select_ec2 import \
select_ec2_images, \
select_ec2_instance_types
from cloudscheduler.lib.view_utils import \
lno, \
qt, \
qt_filter_get, \
rend... | |
from __future__ import unicode_literals
import re
from datetime import date, datetime, timedelta
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_unicode
from django.utils.formats import number_format
from django.utils.trans... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.