gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import time import numba import numpy as np import pandas as pd from joblib import Memory import matplotlib.pyplot as plt from scipy.signal import fftconvolve from scipy.stats.mstats import gmean memory = Memory(location='', verbose=0) def scipy_fftconvolve(ztz, D): """ ztz.shape = n_atoms, n_atoms, 2 * n_t...
from functools import partial from itertools import product import numpy as np from scipy.optimize import OptimizeResult import pytest from numpy.testing import assert_almost_equal from numpy.testing import assert_array_less from numpy.testing import assert_array_equal from numpy.testing import assert_array_almost_e...
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ''' Operations on property. ''' #------------------------------------------------------------------------------ ...
"""Valve IPv4/IPv6 routing implementation.""" # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed und...
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.template.defaultfilters import slugify from django.conf import settings from django...
#!/usr/bin/env python3 from collections import namedtuple from plumbum import local import os import redis import random import shutil import signal import yaml from dyno_node import DynoNode from utils import * # TODO: Make this path absolute based on param instead of relative. CLUSTER_DESC_FILEPATH='../running_clus...
# Microsoft Azure Linux Agent # # Copyright (c) Microsoft 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 copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
# 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...
from .._compat import string_types from .._internal import _get_environ from ..datastructures import ContentRange from ..datastructures import RequestCacheControl from ..datastructures import ResponseCacheControl from ..http import generate_etag from ..http import http_date from ..http import is_resource_modified from ...
from collections import defaultdict from datetime import datetime from django.shortcuts import ( redirect, render_to_response, ) from django.template import RequestContext from collections import namedtuple from mathquizweb.models import ( Question, QuestionState, QuestionType, ) from mathqu...
""" Unified interfaces to minimization algorithms. Functions --------- - minimize : minimization of a function of several variables. - minimize_scalar : minimization of a function of one variable. """ from __future__ import division, print_function, absolute_import __all__ = ['minimize', 'minimize_scalar'] from wa...
# 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 ...
import pymongo from django.conf import settings from django.core.exceptions import ImproperlyConfigured from .connection import store, search class FieldMetadata(object): """ This class contains field metadata. """ # Field descriptors fields = None db_fields = None def __init__(self): """ Clas...
import datetime import logging from .base import LitecordObject from ..utils import dt_to_json log = logging.getLogger(__name__) class EmbedFooter(LitecordObject): """Embed footer. Attributes ---------- url: str Footer URL. text: str Footer text. """ def __init__(self...
from sklearn.utils import shuffle from itertools import product import numpy as np import os from sklearn.decomposition import IncrementalPCA from scipy.linalg import sqrtm from scipy.spatial.distance import pdist, squareform, cdist from sklearn.preprocessing import normalize import time def g_r(q_i, q_j, A_r, u_r, b...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Pyfibot START Knowledge Parser @author Ville 'tuhoojabotti' Lahdenvuo <tuhoojabotti@gmail.com> (http://www.tuhoojabotti.com/) @copyright Copyright (c) 2011 Ville Lahdenvuo @licence BSD """ import urllib import re import htmlentitydefs import sys import os import logg...
# coding: utf-8 """ Copyright 2015 SmartBear Software 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 2012 Nebula, Inc. # 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...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
import Entityclass as ent class equation: """ Represents an equation has to inputs=2 expressions leftexp=rightext has solvingmethods, which are called when the solver runs into that class """ def __init__(self,leftexp,rightexp): #leftexp=rightexp """ Declares the variables """ self.leftexp=leftexp self...
""" Form Widget classes specific to the Django admin site. """ from __future__ import absolute_import from itertools import chain from django import forms try: from django.forms.widgets import ChoiceWidget as RadioChoiceInput except: from django.forms.widgets import RadioFieldRenderer, RadioChoiceInput from dja...
# # 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...
import math import operator from .fpbench import fpcparser from .arithmetic import mpmf, ieee754, evalctx, analysis from .arithmetic.mpmf import Interpreter from .sweep import search sqrt_core = '''(FPCore sqrt_bfloat_limit (a residual_bound) :precision {overall_prec} (while* (and (! :titanic-analysis skip (< st...
# Copyright 2013-present Barefoot Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
""" Generate Fluorite lattice @author: Chris Scott """ from __future__ import absolute_import from __future__ import unicode_literals import logging import numpy as np from ..system.lattice import Lattice from . import lattice_gen_utils from six.moves import range ################################################...
# Copyright (C) 2020 NTT DATA # 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 ...
#from django.db.models import Model, TextField #from djangotoolbox.fields import ListField, EmbeddedModelField, DictField from django.contrib.auth.models import User from django.db import connections from bson.objectid import ObjectId from pymongo.errors import InvalidId import csv, re, json, datetime, random from col...
from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import String from sqlalchemy import testing from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy.orm import create_session from sqlalchemy.orm import mapper from sqlalchemy.orm import relat...
""" Computational utility functions. This module defines a number of low-level, numerical, high-performance utility functions like L{rmsd} for example. """ import numpy import numpy.random import csb.numeric def fit(X, Y): """ Return the translation vector and the rotation matrix minimizing the RMSD be...
#!/usr/bin/env python """ # Software License Agreement (BSD License) # # Copyright (c) 2012, University of California, Berkeley # All rights reserved. # Authors: Cameron Lee (cameronlee@berkeley.edu) and Dmitry Berenson ( berenson@eecs.berkeley.edu) # # Redistribution and use in source and binary forms, with or without...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import copy import logging from math import ceil from flask import jsonify, request from sqlalchemy.orm.exc import NoResultFound import flexget.plugins.list.entry_list as el f...
import json from spacel.model.json.app import SpaceAppJsonModelFactory from spacel.model.json.base import NAME, REGIONS, ALL from test import BaseSpaceAppTest, ORBIT_REGION, APP_NAME CONTAINER = 'pebbletech/spacel-laika' SERVICE_NAME = 'laika.service' SERVICE_NAME_NO_EXT = 'laika' FILE_NAME = 'test-file' SIMPLE_UNIT ...
"""The tests for the InfluxDB component.""" import datetime import unittest from unittest import mock import homeassistant.components.influxdb as influxdb from homeassistant.const import EVENT_STATE_CHANGED, STATE_OFF, STATE_ON, STATE_STANDBY from homeassistant.setup import setup_component from tests.common import ge...
import json import re import requests from six.moves.urllib.parse import quote, quote_plus from blackbelt.config import config from blackbelt.errors import ConfigurationError class Trello(object): """ I represent a authenticated connection to Trello API. Dispatch all requests to it through my methods. ...
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # (converting to a object-oriented, more modular design) # Licence: BSD 3 clause """ The built-in correlation mod...
# Webhooks for external integrations. from __future__ import absolute_import from django.conf import settings from zerver.models import UserProfile, get_client, get_user_profile_by_email from zerver.lib.actions import check_send_message from zerver.lib.notifications import convert_html_to_markdown from zerver.lib.re...
############################################################################## # 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...
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ """ import urllib import urllib2 import socket import zlib from urllib2 import HTTPError from urlparse import urlparse, urlunparse, urljoin from datetime import datetime from .config import settings from .monkeys import Request as _Request, HTTPBasicAuthH...
""" homeassistant.components.light ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functionality to interact with lights. It offers the following services: TURN_OFF - Turns one or multiple lights off. Supports following parameters: - transition Integer that represents the time the light should take to transition to th...
"""Collection of function implementations. Functions are either implemented as :class:`~chainer.Function`\\ s or :class:`~chainer.FunctionNode`\\ s. """ from chainer.functions.activation.clipped_relu import clipped_relu # NOQA from chainer.functions.activation.crelu import crelu # NOQA from chainer.functions.activa...
""" Support for interface with an Samsung TV. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.samsungtv/ """ import asyncio from datetime import timedelta import logging import socket import subprocess import sys import voluptuous as vol fr...
#!/usr/bin/python """ " @section DESCRIPTION " Rate based model simulator which can generate data representative of: " - traditional LN models, " - multi-filter LN models, " - context models, " - position invariant RF models (shifted filters). """ import numpy as np from scipy.stats import multivariate_normal ...
# coding=utf-8 """ Collect metrics from postgresql #### Dependencies * psycopg2 """ import diamond.collector from diamond.collector import str_to_bool try: import psycopg2 import psycopg2.extras except ImportError: psycopg2 = None class PostgresqlCollector(diamond.collector.Collector): """ ...
# -*- coding: utf-8 -*- import requests import json from converters.exceptions import ConversionError currency = { "name": "Currency", "general_method": lambda money, from_unit, to_unit: cur_to_cur(money, from_unit, to_unit), "units": [ { "name": "Australian dollars", "si": ...
import logging import numpy as np import os import sys from typing import Any, Optional from ray.rllib.utils.deprecation import Deprecated from ray.rllib.utils.typing import TensorShape, TensorType logger = logging.getLogger(__name__) def try_import_jax(error: bool = False): """Tries importing JAX and FLAX and ...
# -*- coding: utf-8 -*- import sys # import io from collections import OrderedDict from tabulate import tabulate import numpy as np from scipy import stats import pandas as pd import seaborn as sns import matplotlib as mpl import matplotlib.pyplot as plt ##############################################################...
import threading import numpy as np import tensorflow as tf import pylab import time import gym from keras.layers import Dense, Input from keras.models import Model from keras.optimizers import Adam from keras import backend as K # global variables for threading episode = 0 scores = [] EPISODES = 2000 # This is A3C...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- 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 'Tank.com_pass' db.add_column(u'machine_tank', 'com_pass',...
import sys import time sys.path.append("../config/common/tests") from test_utils import * import fixtures import testtools import test_common import test_case import discoveryclient.client as client def info_callback(info, client_id): # print 'In subscribe callback handler' print 'client-id %s info %s' % (cli...
import re from functools import partial from os.path import (join as pjoin, basename, normpath, sep) from subprocess import CalledProcessError from gtest.util import ( prepare_working_directory, prepare_compiled_grammar, debug, info, warning, error, red, green, yellow, check_exist, make_keypath, dir_is_pr...
import copy import os import sys from ansible.errors import AnsibleError from nose.tools import raises, assert_equal sys.path = [os.path.abspath(os.path.dirname(__file__) + "/../lookup_plugins/")] + sys.path from openshift_master_facts_default_priorities import LookupModule # noqa: E402 DEFAULT_PRIORITIES_1_1 = [ ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-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....
# -*- coding: utf-8 -*- # Copyright 2022 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...
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # from functools import reduce import unittest import numpy from pyscf import lib from pyscf import gto from pyscf import scf from pyscf import mcscf from pyscf import ao2mo from pyscf import fci from pyscf.tools import molden from pyscf.grad import ...
# -*- coding: 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 'Group.is_public' db.add_column('sentry_groupedmessage', 'is_public', s...
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import os import io import re import json import math import tarfile import zipfile from collections import OrderedDict from datetime import timedelta import flask import werkzeug.exceptions import digits from digits import utils from digits.webap...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 7 21:04:15 2017 @author: Aretas """ #numerate the scaffolds #find molecules with chiral centres #connect smiles and chirality information to a dictionary #bind the chiral C atom number to variable #replace C with [C@] and C[@@] #bind both version ...
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this f...
""" This module supports embedded TeX expressions in matplotlib via dvipng and dvips for the raster and postscript backends. The tex and dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between sessions Requirements: * latex * \*Agg backends: dvipng * PS backend: latex w/ psfrag, dvips, and Gh...
# Copyright (c) 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, unittest, re asanadir = os.path.dirname(os.path.realpath(__file__))+"/../" sys.path.insert(0, asanadir) asana = __import__('asana') from asana import * from mocks import ApiMock class BaseTest(unittest.TestCase): def setUp(self): self.api = ApiMock(...
import pandas as pd from pandas.compat import PY2 import pandas.util.testing as tm import pandas.util._test_decorators as td from pandas.errors import EmptyDataError import os import io import numpy as np import pytest # https://github.com/cython/cython/issues/1720 @pytest.mark.filterwarnings("ignore:can't resolve pa...
import json import logging import os import re import requests import sys import time import uuid from cattle import Config from cattle import type_manager from cattle import utils from cattle.agent import Agent from cattle.lock import FailedToLock from cattle.plugins.core.publisher import Publisher from cattle.concur...
# -*- coding: iso-8859-15 -*- # *------------------------------------------------------------------ # * cspaxl_TransPattern.py # * # * Cisco AXL Python # * # * Copyright (C) 2015 Carlos Sanz <carlos.sanzpenas@gmail.com> # * # * This program is free software; you can redistribute it and/or # * modify it under the term...
''' Defines a manager and helper classes for maintaining associations between live objects and sounds representing their identities. @author: Peter Parente <parente@cs.unc.edu> @copyright: Copyright (c) 2008 Peter Parente @license: BSD License All rights reserved. This program and the accompanying materials are made ...
""" Decorators ~~~~~~~~~~ A collection of decorators for identifying the various types of route. """ from __future__ import absolute_import import odin from odin.exceptions import ValidationError from odin.utils import force_tuple, lazy_property, getmeta from .constants import HTTPStatus, Method, Type from .data_s...
#===- perf-helper.py - Clang Python Bindings -----------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
import csv import math from operator import itemgetter from tabulate import tabulate import sports DRAW = 0 WIN = 1 LOSS = 2 output = [] teams = {} class Ladder: def __init__(self, rounds, teams, points={WIN: 2, DRAW: 1, LOSS: 0}): self.rounds = rounds self.points = points self.init_la...
""" Lazy Evaluation for Python - main package with primary exports Copyright (c) 2004, Georg Bauer <gb@murphy.bofh.ms>, Copyright (c) 2011, Alexander Marshalov <alone.amper@gmail.com>, except where the file explicitly names other copyright holders and licenses. Permission is hereby granted, free of charge, to any p...
from ctypes import windll, wintypes import ctypes import time import re import datetime import struct import locale wininet = windll.wininet try: # Python 3 from urllib.parse import urlparse except (ImportError): # Python 2 from urlparse import urlparse from ..console_write import console_write from ...
#!/usr/bin/env /usr/bin/python3 # -*- coding: utf-8 -*- from pymisp import PyMISP from key import * import json import time import os from urllib.parse import urljoin import sys import traceback from shutil import copyfile import logging.handlers from urllib.parse import quote import argparse logger = logging.getLog...
# -*- 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...
# Copyright (C) 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 or agreed to in writ...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
# Copyright (c) 2001, 2002, 2003 Python Software Foundation # Copyright (c) 2004 Paramjit Oberoi <param.cs.wisc.edu> # All Rights Reserved. See LICENSE-PSF & LICENSE for details. """Access and/or modify INI files * Compatiable with ConfigParser * Preserves order of sections & options * Preserves comments/blank lines...
# # 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 # ...
# The MIT License (MIT) # Copyright (c) 2016 finebyte # AppMsgTools for Pebble App Message # Allows AppMessages to be sent to the Pebble emu (and other ws endpoints) # from Android (needs Android side of bridge to be installed) # from File / Stdin # from Simple Web Interface # # Pre Reqs # pebble tool and libpebble2 # ...
# -*- coding: utf-8 -*- # # kvclient.py # # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
#!/usr/bin/env python import optparse from sys import * import os,sys,re from optparse import OptionParser import glob import subprocess from os import system import linecache #========================= def setupParserOptions(): parser = optparse.OptionParser() parser.set_usage("%prog -u <untilted sta...
import string import types from module_info import * from module_triggers import * from module_dialogs import * from process_common import * from process_operations import * speaker_pos = 0 ipt_token_pos = 1 sentence_conditions_pos = 2 text_pos = 3 opt_token_pos = 4 sentence_consequences_pos = 5 sentence_voice_over...
#!/usr/bin/env python from functools import wraps import numbers import re import subprocess import sys import traceback from mpi4py import MPI import numpy as np try: from subprocess import DEVNULL except ImportError: import os DEVNULL = open(os.devnull, 'wb') def get_open_files(*pids): """ Fin...
import argparse import sys import subprocess import multiprocessing import re from Bio import SeqIO from Bio.SeqRecord import SeqRecord from mypyli import samparser import os class King(object): def __str__(self): string = "King: {}\n\n ".format(self.name) string += "\n\n ".join([str(contig) for...
""" Django settings for hiren project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os i...
"""Test zha light.""" import asyncio from unittest.mock import MagicMock, call, patch, sentinel import zigpy.profiles.zha import zigpy.types import zigpy.zcl.clusters.general as general import zigpy.zcl.foundation as zcl_f from homeassistant.components.light import DOMAIN from homeassistant.const import STATE_OFF, ST...
#!/usr/bin/env python2 import os import os.path import stat import sys import subprocess import pygtk pygtk.require('2.0') import gtk import gobject import gconf import pynotify import pyinotify import appindicator import SshMuxClient GCONF_APP = '/apps/sshmuxmon' GCONF_APP_PATH = os.path.join(GCONF_APP, 'path') GC...
#! /usr/bin/python import sys from model import * def load_file(path): return scipy.sparse.csr_matrix(cPickle.load(open(path)), dtype=theano.config.floatX) def convert2idx(spmat): rows, cols = spmat.nonzero() return rows[np.argsort(cols)] def RankingEval(datapath='../data/', dataset='WN-te...
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
"""Tests for x86-32 CPU""" def tests_processor_nocpu(): """Tests Processor methods that don't need a real x86_32 CPU""" from compilertools.processors.x86_32 import Processor from compilertools.processors import x86_32 # Initialise dummy CPUID string = "Test" encoded = 0x74736554 flags = 0...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
"""Parser for STAR-Fusion output""" # (c) 2015-2021 Wibowo Arindrarto <contact@arindrarto.dev> from os import PathLike from typing import Any, Dict, List, TextIO, Tuple, Union import click from .utils import get_handle __all__ = ["parse"] # Expected column names # Abridged column names _ABR_COLS = [ "fusion_na...
import unittest import sys # so we import local api before any globally installed one sys.path.insert(0,"../pyopentree") # we might also be calling this from root, so sys.path.insert(0,"pyopentree") import opentreeservice from opentreeservice import OpenTreeService import json from urllib2 import urlopen from urllib2 i...
import plotly.express as px import numpy as np import pandas as pd import pytest from datetime import datetime @pytest.mark.parametrize( "mode,options", [ ("ols", None), ("lowess", None), ("lowess", dict(frac=0.3)), ("rolling", dict(window=2)), ("expanding", None), ...
#! /usr/bin/python # # File: SMJobBlessUtil.py # # Contains: Tool for checking and correcting apps that use SMJobBless. # # Written by: DTS # # Copyright: Copyright (c) 2012 Apple Inc. All Rights Reserved. # # Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. # ...
# 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 req...