gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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 applicable ... | |
# -*- coding: utf-8 -*-
'''
Return salt data via slack
This version of the returner is designed to be used with hubblestack pulsar, as
it expects the limited data which pulsar provides.
The following fields can be set in the minion conf file::
.. code-block:: yaml
slack_pulsar.channel (required)
slack_pulsa... | |
#!/usr/bin/python
"""Script to implement a BTU meter that uses a pulse output flow meter
and two thermistors to measure hydronic heat flow. Results are posted
to the mini-monitor MQTT broker.
This script should be started by a supervisor capable of restarting
the script if an error occurs.
This script must be run wi... | |
# coding: utf-8
"""
CMS-related job helpers.
"""
__all__ = ["CMSJobDashboard"]
import time
import socket
import threading
import six
import law
from law.job.base import BaseJobManager
from law.job.dashboard import BaseJobDashboard
class CMSJobDashboard(BaseJobDashboard):
"""
This CMS job dashboard inter... | |
from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
float_or_none,
unified_strdate,
)
class ComedyCentralIE(MTVServicesInfoExtractor):
_VALID_URL = r'''(?x)... | |
#!/usr/bin/env python
# Copyright 2013 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import time
import unittest
THIS_DIR = os.path... | |
# -*- 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):
# Deleting field 'FileBlob.storage_options'
db.delete_column(u'sentry_file... | |
# 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
# d... | |
import collections
import logging
import os
import subprocess
import tempfile
class TrackCompositor(object):
def __init__(self, dataHub, title=None):
# def __init__(self, width, title=None):
self.dataHub = dataHub
self.sections = collections.OrderedDict()
self.width = 1200
sel... | |
import six
from locust.core import HttpLocust, Locust, TaskSet, task, events
from locust import ResponseError, InterruptTaskSet
from locust.exception import CatchResponseError, RescheduleTask, RescheduleTaskImmediately, LocustError
from .testcases import LocustTestCase, WebserverTestCase
class TestTaskSet(LocustTest... | |
"""
Common narrative logging functions.
To log an event with proper metadata and formatting use 'log_event':
You can also do free-form logs, but these will be ignored by
most upstream consumers.
"""
__author__ = 'Dan Gunter <dkgunter@lbl.gov>'
__date__ = '2014-07-31'
import collections
import logging
from logging ... | |
# Copyright 2011 VMware, 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 a... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import functools
imp... | |
import unittest
from mongoengine import *
from mongoengine.queryset import Q, transform
__all__ = ("TransformTest",)
class TransformTest(unittest.TestCase):
def setUp(self):
connect(db='mongoenginetest')
def test_transform_query(self):
"""Ensure that the _transform_query function operates ... | |
from __future__ import division, unicode_literals
from future.builtins import str, super
from future.utils import with_metaclass
from decimal import Decimal
from functools import reduce
from operator import iand, ior
from django.core.urlresolvers import reverse
from django.db import models, connection
from django.db... | |
"""The tests for the utility_meter sensor platform."""
from contextlib import contextmanager
from datetime import timedelta
from unittest.mock import patch
from homeassistant.components.sensor import (
ATTR_STATE_CLASS,
STATE_CLASS_TOTAL,
STATE_CLASS_TOTAL_INCREASING,
)
from homeassistant.components.utilit... | |
"""Base class for Checks.
If you are writing your own checks you should subclass the AgentCheck class.
The Check class is being deprecated so don't write new checks with it.
"""
# stdlib
from collections import defaultdict
import copy
import logging
import numbers
import os
import re
import time
import timeit
import t... | |
# Copyright (c) 2012 Citrix 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 ... | |
# -*- test-case-name: vumi_message_store.tests.test_batch_info_cache -*-
# -*- coding: utf-8 -*-
from calendar import timegm
from datetime import datetime
from twisted.internet.defer import returnValue
from vumi.persist.redis_base import Manager
from vumi.message import TransportEvent, VUMI_DATE_FORMAT
from vumi.err... | |
# pylint: disable-msg=C0111,C0103
import unittest
from openmdao.main.api import Assembly, Component, Driver, set_as_top
from openmdao.main.datatypes.api import Float, Array
from openmdao.main.hasconstraints import HasConstraints, HasEqConstraints, HasIneqConstraints, Constraint
from openmdao.units.units import Physic... | |
# -*- coding: utf-8 -*-
"""Landlab component for overland flow using the linearized diffusion-wave approximation.
Created on Fri May 27 14:26:13 2016
@author: gtucker
"""
import numpy as np
from landlab import Component
_FOUR_THIRDS = 4.0 / 3.0
_SEVEN_THIRDS = 7.0 / 3.0
_MICRO_DEPTH = 1.0e-6 # tiny water depth t... | |
from test.support import run_unittest
from test.support.import_helper import unload, CleanImport
from test.support.warnings_helper import check_warnings
import unittest
import sys
import importlib
from importlib.util import spec_from_file_location
import pkgutil
import os
import os.path
import tempfile
import shutil
im... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from __future__ import absolute_import
import os.path
import pytest
from . import util
from .errors import UnsupportedCommandError
from .info import TestInfo, TestPath, ParentInfo
def add_cli_subparser(cmd, name, parent)... | |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.a... | |
# copyright 2004-2005 Samuele Pedroni
import sys
import os
import re
scriptdir = os.path.dirname(__file__)
import directives
import java_parser
import java_templating
from java_templating import JavaTemplate,jast_make,jast, make_id, make_literal
# Some examples for modif_re
# (one)two -> group 1 = "one"
# ... | |
# -*- coding: utf-8 -*-
# Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | |
"""Tests for certbot.le_util."""
import argparse
import errno
import os
import shutil
import stat
import tempfile
import unittest
import mock
import six
from certbot import errors
class RunScriptTest(unittest.TestCase):
"""Tests for certbot.le_util.run_script."""
@classmethod
def _call(cls, params):
... | |
# Authors: Dirko Coetsee
# License: 3-clause BSD
""" Implements a Hidden Alignment Conditional Random Field (HACRF). """
import numpy as np
import lbfgs
from .algorithms import forward, backward
from .algorithms import forward_predict, forward_max_predict
from .algorithms import gradient, gradient_sparse, populate_sp... | |
from __future__ import unicode_literals
import json
import re
from unidecode import unidecode
from django.db import models
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from django.utils.text import slugify
from django.utils.encoding import python_2_unicode_compatible
fr... | |
# Copyright 2014 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... | |
# Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
#!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... | |
"""
Sysconfig - files in ``/etc/sysconfig/``
========================================
This is a collection of parsers that all deal with the system's configuration
files under the ``/etc/sysconfig/`` folder. Parsers included in this module
are:
CorosyncSysconfig - file ``/etc/sysconfig/corosync``
-------------------... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.... | |
#
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#!/usr/bin/env python
usage = '''
Write buildbot spec to outfile based on the bot name:
$ python buildbot_spec.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug
Or run self-tests:... | |
# Copyright 2013 Mirantis Inc.
# Copyright 2013 Rackspace Hosting.
#
# 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
#
# Unles... | |
# autotracker-bottomup - the quite a few times more ultimate audio experience
# by Ben "GreaseMonkey" Russell, 2011. Public domain.
#
#
#
# BUGS:
# - sometimes gets stuck in an infinite loop. attempted to alleviate it but it doesn't work.
# - i think it sometimes jumps further than an octave in some situations
# oh and... | |
"""Support for the Philips Hue sensors as a platform."""
import asyncio
from datetime import timedelta
import logging
from time import monotonic
import async_timeout
from homeassistant.components import hue
from homeassistant.exceptions import NoEntitySpecifiedError
from homeassistant.helpers.event import async_track... | |
try:
set
except NameError:
from sets import Set as set
from django import template
from django.core.paginator import Paginator, InvalidPage
from django.conf import settings
register = template.Library()
DEFAULT_PAGINATION = getattr(settings, 'PAGINATION_DEFAULT_PAGINATION', 20)
DEFAULT_WINDOW = getattr(settin... | |
#!/usr/bin/env python2.7
import logging
import sys
import math
import numpy as np
import scipy
from sklearn.cluster import MiniBatchKMeans, KMeans
from sklearn.metrics import euclidean_distances
import datetime
#import good_data
# 40'000: Submission 2952, score: 740.608811745 => 12 minutes
# 55'000: Submission: 2953,... | |
from itertools import chain
import inspect
from brushfire.core.query import BrushfireQuerySet
from brushfire.core.exceptions import *
from django.apps import apps
from django.db import models
from django.db.models.base import subclass_exception
from django.db.models.options import Options
from django.core.exceptions im... | |
#
# 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... | |
"""This package provides DockerImage for examining docker_build outputs."""
import abc
import cStringIO
import gzip
import httplib
import json
import os
import string
import subprocess
import sys
import tarfile
import tempfile
from containerregistry.client import docker_creds
from containerregistry.client import do... | |
import logging
from logging import Logger
from typing import Optional
import sqlalchemy
from sqlalchemy import (
Table,
Column,
Integer,
String,
DateTime,
Index,
and_,
desc,
MetaData,
)
from sqlalchemy.engine import Engine
from sqlalchemy.sql.sqltypes import Boolean
from slack_sdk.... | |
# 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... | |
import math
import operator
from .titanic import ndarray
from .fpbench import fpcparser
from .arithmetic import mpmf, ieee754, evalctx, analysis
from .arithmetic.mpmf import Interpreter
from .sweep import search
eqn_core = '''(FPCore lorenz-3d ((xyz 3))
:precision {fn_prec}
(let ([sigma 10]
[beta 8/3]
... | |
""" Class average finetuning functions. Before using any of these finetuning
functions, ensure that the model is set up with nb_classes=2.
"""
from __future__ import print_function
import sys
import uuid
import numpy as np
from os.path import dirname
from time import sleep
from keras.optimizers import Adam
from g... | |
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import errno
import os
import re
import sys
from collections import namedtuple
import msgfy
from docker import APIClient
from docker.errors import APIError, NotFound
from path import Path
from simplesqlite import OperationalError, connect_memdb
... | |
from __future__ import print_function
from lazy import lazy
from operator import itemgetter
from ploy.common import BaseMaster, StartupScriptMixin
from ploy.plain import Instance as BaseInstance
from ploy.config import BaseMassager, BooleanMassager, IntegerMassager
from ploy.config import HooksMassager, PathMassager
fr... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import os
import re
import subprocess
import sys
def wait_for_output(proc):
"""This is a convenience method to parse a process's stdout and stderr.
Args:
pr... | |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import os
import shutil
import ssl
import sys
import tempfile
import threading
import zipfile
from contextlib import contextmanager
from ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Nicira Networks, 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.apac... | |
# 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 json
from extensions_paths import CHROME_EXTENSIONS
from test_file_system import MoveAllTo
from test_util import ReadFile
FAKE_TABS_IDL = '\n'.join(... | |
from collections import defaultdict
from django.conf import settings
from django.contrib import auth
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail
from django.db import IntegrityError
from canvas.exceptions import ServiceError, ValidationError
from canvas.models import Use... | |
# Author: Fred L. Drake, Jr.
# fdrake@cnri.reston.va.us, fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# t... | |
import shapely.geometry as geom
import matplotlib.pyplot as plt
from copy import copy
from numpy import inf, dot
import math
import munkres
import scipy.spatial as spatial
import numpy as np
class PolygonInterpolator:
def __init__(self, p1 = None, p2 = None):
if p1 is not None and p2 is not None:
self.p1 =... | |
# Copyright 2021 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
"""
Test module for surface tension
"""
from builtins import range
from builtins import object
from proteus.iproteus import *
from proteus import Comm
comm = Comm.get()
Profiling.logLevel=1
Profiling.verbose=True
import os
import numpy as np
import tables
import pytest
from proteus import default_... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
log = logging.getLogger(__name__)
from language_tags import tags
from sqlalchemy import (
Column,
Integer,
Text,
String,
ForeignKey,
UniqueConstraint,
Table,
event
)
from sqlalchemy.ext.declarative impor... | |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | |
from datetime import datetime
import time
from BeautifulSoup import BeautifulSoup
from lxml import etree, html
import pytz
import requests
import utils
def get_weather(body_of_water):
if body_of_water == 'lake washington':
return king_county_buoy(body_of_water)
elif body_of_water == 'lake sammamish'... | |
# 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... | |
import paramiko
import os
from stat import S_ISDIR, S_ISREG
class SSH(object):
def __init__(self, usr='root', ip='127.0.0.1', port=22, pwd='', connect=True, logfile='/tmp/dedupe-ssh-log.txt'):
self.usr = usr
self.pwd = pwd
self.ip = ip
self.port = port
self.logfile = logfil... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
from collections.abc import Iterable, MutableSequence, Mapping
from enum import Enum
from pathlib import Path
from numbers import Real, Integral
from xml.etree import ElementTree as ET
from math import ceil
import openmc.checkvalue as cv
from . import VolumeCalculation, Source, RegularMesh
from ._xml import clean_inde... | |
# encoding: utf-8
"""
Test suite for pptx.parts.image module.
"""
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from pptx.compat import BytesIO
from pptx.package import Package
from pptx.parts.image import Image, ImagePart
from pptx.util import Px
from ..unitutil.file impor... | |
import numpy as np
llf = np.array([-240.29558272688])
nobs = np.array([ 202])
k = np.array([ 5])
k_exog = np.array([ 1])
sigma = np.array([ .79494581155191])
chi2 = np.array([ 1213.6019521322])
df_model = np.array([ 3])
k_ar = np.array([ 2])
k... | |
#from django.contrib.auth import authenticate, login, logout
#import urllib.request
import requests, json, urllib, array
import urllib.request
from Crypto.Cipher import ARC4
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
from Crypto import Random
def list_reports(user, password):
r2 = requests.get... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Lic... | |
# Copyright 2015 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... | |
"""Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | |
from blocks.extensions import SimpleExtension
from matplotlib import pylab as plt
from copy import deepcopy
import numpy as np
class VariableModifier(SimpleExtension):
def __init__(self, parameter):
self.parameter = parameter
kwargs = dict()
kwargs.setdefault("after_batch", True)
s... | |
from copy import deepcopy
from time import sleep
from property_caching import (
cached_property, clear_property_cache, set_property_cache)
from six import iteritems, itervalues
from pycloudflare.exceptions import SSLUnavailable
from pycloudflare.services import (
CloudFlareHostService, CloudFlareService, clou... | |
# Copyright 2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | |
# Copyright (c) 2009-2021 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | |
from Child import Child
from Node import Node # noqa: I201
STMT_NODES = [
# continue-stmt -> 'continue' label? ';'?
Node('ContinueStmt', kind='Stmt',
children=[
Child('ContinueKeyword', kind='ContinueToken'),
Child('Label', kind='IdentifierToken',
is_optio... | |
import os, glob
import numpy as np
import scipy.linalg as spl
import matplotlib.pylab as plt
import cv2
import time
def load_files(path,extension,colour=False):
""" This function loads all the image files with part of their filenames as
'extension' in the directory 'path' in an array. If colour is 'True', then... | |
from nose.tools import assert_raises
from rx import Observer
from rx.notification import OnNext, OnError, OnCompleted
from rx.internal.exceptions import CompletedException
class MyObserver(Observer):
def on_next(self, value):
self.has_on_next = value
def on_error(self, err):
self.has_on_e... | |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from subprocess import check_output
import io
import bson # this is installed with the pymongo package
import matplotlib.pyplot as plt
from skimage.data import imread # or, whatever image ... | |
import numpy as np
import matplotlib.pyplot as plt
import re
class tight_binding():
"""Returns solutions for a periodic lattice
"""
def __init__(self):
"""initialize all variables:
"""
self.E_s0 = 0
self.E_s1 = 0
self.E_p0 = 7.4
self.E_p1 = 7.4
sel... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# 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... | |
"""
Tests for Spout class
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import unittest
from io import BytesIO
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from pystorm import ReliableSpout, Spout, Tuple
class SpoutTests(unit... | |
#! /usr/bin/python
HOME_PATH = './'
CACHE_PATH = '/var/cache/obmc/'
FLASH_DOWNLOAD_PATH = "/tmp"
GPIO_BASE = 320
SYSTEM_NAME = "Palmetto"
## System states
## state can change to next state in 2 ways:
## - a process emits a GotoSystemState signal with state name to goto
## - objects specified in EXIT_STATE_DEPE... | |
# Based on the python URDF implementation by Antonio El Khoury
# Available at https://github.com/laas/robot_model_py
import string
from naoqi_tools.gazeboUrdf import *
from xml.dom.minidom import Document
from xml.dom import minidom
import sys
from numpy import array,pi
import re, copy
HUBO_JOINT_SUFFIX_MASK=r'([HKAS... | |
# -*- coding: utf-8 -*-
import os
from collections import deque
import uuid
from lockfile import LockFile, AlreadyLocked, NotLocked, NotMyLock
from django.core.cache import get_cache
from django.core.cache.backends.memcached import MemcachedCache
from django.core.cache.backends.dummy import DummyCache
from django.core.... | |
# Copyright [2015] Hewlett-Packard Development Company, L.P.
# Copyright 2016 Tesora 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
#
# Unle... | |
"""A collection of functions to summarize object information.
This module provides several function which will help you to analyze object
information which was gathered. Often it is sufficient to work with aggregated
data instead of handling the entire set of existing objects. For example can a
memory leak identified ... | |
# ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserInfo.enable_timeline_posts'
db.add_column('canvas_userinfo', 'enable_timeline_posts', ... | |
# 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 th... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 OpenStack LLC
# Copyright 2012 Canonical 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/lic... | |
# Copyright 2022 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 ... | |
# Copyright (C) 2015-2021 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
import os
import pytest
from datetime import datetime, timedelta, time
from ogn_lib import exceptions, parser, constants
def get_messages(n_messages=float('inf')):
test_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(test_dir, 'messages.txt'), 'r') as f:
lines = f.readlines()... | |
import base64
import json
import logging
from . import credentials
from . import errors
from .utils import config
INDEX_NAME = 'docker.io'
INDEX_URL = f'https://index.{INDEX_NAME}/v1/'
TOKEN_USERNAME = '<token>'
log = logging.getLogger(__name__)
def resolve_repository_name(repo_name):
if '://' in repo_name:
... | |
#!/usr/bin/env python3
"""Edit test cases to use PSA dependencies instead of classic dependencies.
"""
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# Yo... | |
#!/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.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.