src
stringlengths
721
1.04M
#!/usr/bin/python ############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holdin...
# Copyright 2021 The Kubeflow 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 ...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from functools import partial from PyQt4.Qt import (QComboBox, QLabel, QSpinBox, QDoubleSpinBox, QDateTimeEdit, QD...
#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and tha...
#------------------------------------------------------------------------------- # Name: location v1.0 # Purpose: get location input from user and find relevant weather # # Author: Bodhi Connolly # # Created: 24/05/2014 # Copyright: (c) Bodhi Connolly 2014 # Licence: GNU General Public License...
#!/usr/bin/python2.7 # -*- coding: UTF-8 -*- from bs4 import BeautifulSoup from datetime import * # gestion des dates import sys utf = sys.argv[1] gr = sys.argv[2] #------ Definition des variables ------# MIN_activity = 2 ical_date_start = "DTSTART:" ical_date_end = "DTEND:" ical_title = "SUMMARY:" ical...
"""Constants used by Mutagen.""" GENRES = [ u"Blues", u"Classic Rock", u"Country", u"Dance", u"Disco", u"Funk", u"Grunge", u"Hip-Hop", u"Jazz", u"Metal", u"New Age", u"Oldies", u"Other", u"Pop", u"R&B", u"Rap", u"Reggae", u"Rock", u"Techno", ...
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
#!/usr/bin/env python """ Copyright 2015 ARC Centre of Excellence for Climate Systems Science author: Scott Wales <scott.wales@unimelb.edu.au> 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 h...
import json import random from operator import itemgetter # absolutePath = '/home/noidea91/flask_app/' absolutePath = '' def randomize(inArray, randomSeed = None, count = None): tempList = inArray[:] result = [] if count == None: count = len(tempList) + 1 for i in range(1, count): if randomSeed == None: ra...
#!/usr/bin/env python3 """ crackfortran --- read fortran (77,90) code and extract declaration information. Copyright 1999-2004 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESS...
# -*- coding:utf-8 -*- import re import guion_videos from curso_toxml.xmlcreator import CursoSeatXmlMinidom #CursoSeatXmlMinidom = #TODO: ARREGLAR MÉTODOS!!!!! ParserError = guion_videos.ParserError class LectorGuionChapisteria(guion_videos.LectorGuionVideos): def __init__(self, path, nombre_xml="curso"): ...
import os import sys sys.path.append("../../../../") import swhlab import matplotlib.pyplot as plt import matplotlib.mlab as mlab import numpy as np class ABF2(swhlab.ABF): def phasicTonic(self,m1=None,m2=None,chunkMs=50,quietPercentile=10, histResolution=.5,plotToo=False): """ ...
from __future__ import print_function import os import time import json import argparse import densenet import numpy as np import keras.backend as K from keras.datasets import cifar10 from keras.optimizers import Adam from keras.utils import np_utils def run_cifar10(batch_size, nb_epoch, ...
# Copyright 2010 http://www.collabq.com # Copyright 2009 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 ...
import random import torch import torch.nn as nn from torch.autograd import Variable from torch import optim import torch.nn.functional as F import pickle as pk use_cuda = torch.cuda.is_available() SOS_token = 0 EOS_token = 1 MAX_LENGTH = 80 class Dataset: def __init__(self, name): self.name = name ...
#!/usr/bin/python # This file is part of QtContacts tracker storage plugin # # Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). # # Contact: Nokia Corporation (info@qt.nokia.com) # # GNU Lesser General Public License Usage # This file may be used under the terms of the GNU Lesser General Public Licen...
# coding: utf-8 ''' Created on 2014年12月31日 @author: amaozhao ''' from blog.models import Entry from rest_framework import serializers from api.serializers.tag import BaseTagSerializer from rest_auth.serializers import UserDetailsSerializer class EntrySerializer(serializers.ModelSerializer): author = UserDetails...
# -*- coding: utf-8 -*- """ Loss functions for multi-class classification """ from __future__ import absolute_import, print_function, division import numpy as np import tensorflow as tf from niftynet.engine.application_factory import LossClassificationFactory from niftynet.layer.base_layer import Layer class LossFu...
# Copyright 2017 Starbot Discord Project # # 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...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
# 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 Li...
from decimal import Decimal from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField from django.contrib.gis.db.models.sql import AreaField, DistanceField from django.contrib.gis.geos import GEOSGeometry from django.core.exceptions import FieldError from django.db.models import ( BooleanFiel...
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # pylint: disable=no-member r""" Measures based on noise measurements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. _iqms_cjv: - :py:func:`~mriqc.qc.anatomical.cj...
import faker import unittest from scrubadub.filth import SkypeFilth from base import BaseTestCase import scrubadub class SkypeTestCase(unittest.TestCase, BaseTestCase): def setUp(self): from scrubadub.detectors.skype import SkypeDetector scrubadub.detectors.register_detector(SkypeDetector, autol...
import asyncio import datetime import json import asyncpg ### # fully working for DICT of row along with auto json decode/encode ### async def main(): conn = await asyncpg.connect(user='postgres', password='metaman', database='postgres', ...
cipher = [79, 59, 12, 2, 79, 35, 8, 28, 20, 2, 3, 68, 8, 9, 68, 45, 0, 12, 9, 67, 68, 4, 7, 5, 23, 27, 1, 21, 79, 85, 78, 79, 85, 71, 38, 10, 71, 27, 12, 2, 79, 6, 2, 8, 13, 9, 1, 13, 9, 8, 68, 19, 7, 1, 71, 56, 11, 21, 11, 68, 6, 3, 22, 2, 14, 0, 30, 79, 1, 31, 6, 23, 19, 10, 0, 73, 79, ...
from lxml import objectify import re try: # make it python2.4/2.5 compatible! from urlparse import urlparse, parse_qs except ImportError: # pragma: no cover from urlparse import urlparse from cgi import parse_qs def convert_camel_case(operation): """ Converts ``CamelCaseOperationName`` into ``pyt...
""" This module provides a way to import data from the Habit List iPhone application (http://habitlist.com/) into Day One Journal (http://dayoneapp.com/) entries. To use this module you must first do a manual export of your data from Habit list. This can be done by the following: - Open Habit List iPhone app ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Keybinding management.""" from __future__ import print_function, unicode_literals, absolute_import import os, shutil from . import helpers, paths, log def read_keybinds(): """Returns a list of keybinding files.""" return tuple([ os.path.basename(o) for ...
#-*- coding : utf-8 -*- ''' Create on 2011-08-23 @version: 0.0.1 @change: \n - 2011-01-25\n - copy from Simple_atom. ''' import string import re class unit_atom(): ''' It's a simple atom class. ''' def __init__(self,atom_name="",atom_serial=1, atom_id =1, \ residue_name="", residu...
# 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...
from kapteyn import maputils from matplotlib import pylab as plt header = {'NAXIS': 2 ,'NAXIS1':100 , 'NAXIS2': 100 , 'CDELT1': -7.165998823000E-03, 'CRPIX1': 5.100000000000E+01 , 'CRVAL1': -5.128208479590E+01, 'CTYPE1': 'RA---NCP', 'CUNIT1': 'DEGREE ', 'CDELT2': 7.165998823000E-03 , 'CRPIX2': 5.100000000000E+01, 'CRV...
from __future__ import absolute_import, division, print_function, unicode_literals import os import logging log = logging.getLogger(__name__) from hydroffice.base import helper def hyo_ssp_installation_folder(): """ Return the HydrOffice SSP folder """ return os.path.dirname(os.path.realpath(__...
from collections import namedtuple import os SearchResult = namedtuple('SearchResult', 'file, line, text') def main(): print_header() folder = get_folder_from_user() if not folder: print("Sorry we can't search that location.") return text = get_search_text_...
#!/usr/bin/env python """ __author__ = 'Gautam Shine' __email__ = 'gshine@stanford.edu' Document classifier for the "Toxic Docs" repository from Columbia University and the Center for Public Integrity. Data set consists of PDF files of emails, memos, advertisements, news articles, scientific articles cited in legal c...
""" WSGI config for example project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp> # # 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 # # h...
# Copyright (C) 2017 by Clearcode <http://clearcode.cc> # and associates (see AUTHORS). # This file is part of pytest-redis. # pytest-redis is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either versi...
"""Error codes.""" #: No layers in this project (loading error?) EMPTY_PROJECT = 'EMPTY_PROJECT' #: No converter for this Qgis class. CLASS_NOT_IMPLEMENTED = 'CLASS_NOT_IMPLEMENTED' #: No converter for this Qgis property PROP_NOT_IMPLEMENTED = 'PROP_NOT_IMPLEMENTED' #: No converter for this Qgis data provider DATA_...
import os import logging from far2l.plugin import PluginVFS log = logging.getLogger(__name__) class Screen: def __init__(self, parent): self.parent = parent self.hScreen = None def __enter__(self): self.hScreen = self.parent.info.SaveScreen(0,0,-1,-1) def __exit__(self, *args):...
# import the basic python packages we need import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API pytan_loc = "~/gh/pytan" pytan_static_path =...
#!/usr/bin/python """ Plot best-fit """ import numpy as np import pylab as P import scipy.interpolate import scipy.integrate import scipy.optimize # Peak wavelengths (ugriz) in Angstrom l = [3543., 4770., 6231., 7625., 9134.] BANDS = ['u', 'g', 'r', 'i', 'z'] colours = ['#DA49DA', '#00a5ff', '#ff8200', '#F34334', '#9...
import unittest import datetime from imap_tools import utils from imap_tools.errors import ImapToolsError, UnexpectedCommandStatusError, MailboxCopyError from imap_tools.consts import MailMessageFlags class UtilsTest(unittest.TestCase): def test_clean_uids(self): # *clean_uids tested enough in test_quer...
from os.path import exists, abspath, dirname, join import misc THIS_DIR = dirname(abspath(__file__)) # this is a personal access token used by chaosbot to perform merges and other # api requests. it is a secret, and lives on the server, but since chaosbot has # access to this secret file, it can be manipulated into...
import socket from struct import pack, unpack_from from cryptography.exceptions import InvalidTag from ...messaging.anonymization.tunnel import (CIRCUIT_TYPE_RP_DOWNLOADER, CIRCUIT_TYPE_RP_SEEDER, EXIT_NODE, EXIT_NODE_SALT, ORIGINATOR, ORIGINATOR_SALT) from ...messaging....
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 ...
import collections """ source: http://adventofcode.com/2016/day/1 DESCRIPTION Santa's sleigh uses a very high-precision clock to guide its movements, and the clock's oscillator is regulated by stars. Unfortunately, the stars have been stolen... by the Easter Bunny. To save Christmas, Santa needs you to retrieve all...
import argparse import collections import re import subprocess NOTES_REF = 'refs/notes/votes' Vote = collections.namedtuple('Vote', ['commit', 'user']) def vote(args): assert args.user, 'TODO: determine user automatically' vote = 'vote:%s' % args.user subprocess.check_call([ 'git', 'notes', '--ref', NOTES_R...
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
"""Module to help with parsing and generating configuration files.""" import asyncio import logging import os import shutil from types import MappingProxyType # pylint: disable=unused-import from typing import Any, Tuple # NOQA import voluptuous as vol from homeassistant.const import ( CONF_LATITUDE, CONF_LONGI...
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
import re import logging from datetime import datetime from urllib.parse import urlparse from apod.items import APODItem logger = logging.getLogger(__name__) def parse_apod(response, apod): date = response.css('center:first-child>p:last-child::text').extract_first().strip() try: apod['date'] = date...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict from prototxt import * from darknet import MaxPoolStride1 class FCView(nn.Module): def __init__(self): super(FCView, self).__init__() def forward(self, x): nB = x.data.size...
import os import sys from gooey.gui.windows import layouts from gooey.python_bindings import argparse_to_json from gooey.gui.util.quoting import quote def create_from_parser(parser, source_path, cmd_args, **kwargs): auto_start = kwargs.get('auto_start', False) if hasattr(sys, 'frozen'): run_cmd = ...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho...
from construct import * from distorm3 import Decode, Decode16Bits import hexdump import os class Mbr: def __init__(self, path): self.mbrHexa = "" self.mbrStruct = "" self.bootloaderCode = "" self.offset = 0 self.partition = {"name": []} self.signature = "" s...
import os # import networkx as nx import numpy from numpy.random import RandomState from clique_tree import * from nx_converters import * from randomizer import * from subtrees import * from datetime import datetime from Runners import * from report_generator import * from enum import Enum import yaml from yaml import...
"""Calendar printing functions Note when comparing these calendars to the ones printed by cal(1): By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week (0=Monday, 6=Sunday).""" import sys i...
import re from unidecode import unidecode from ..utils import squeeze, check_empty, check_str from .phonetic_algorithm import PhoneticAlgorithm class MatchingRatingApproach(PhoneticAlgorithm): """ Functions related to the computation of the Match Rating Approach codex. [Reference]: https://en.wikipedia....
"""Test functions in module.""" import json import os import time import pytest from mutagen.id3 import COMM, ID3 from flash_air_music.convert import discover, id3_flac_tags from tests import HERE @pytest.mark.parametrize('mode', ['no target', 'no prev metadata', 'st', 'ss', 'tt', 'ts', 'up to date']) def test_son...
import json from django.contrib.auth import get_user_model from django.utils import encoding from django.core.urlresolvers import reverse from django.conf import settings from example.tests import TestBase from example.tests.utils import dump_json, redump_json from example.factories import CommentFactory class Mode...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # tvspot - XBMC Add-on by Juarrox (juarrox@gmail.com) # Version 0.2.9 (18.07.2014) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Gracias a la librería plugint...
import os import caffe import numpy as np import plyvel import skimage from caffe_pb2 import Datum import constants def predict(image_path): """ Takes a single image, and makes a prediction whether it has a cloud or not. """ print "Generating prediction for %s..." % image_path net, transformer ...
import json import os from symbtrdataextractor.dataextractor import DataExtractor from symbtrdataextractor.reader.mu2 import Mu2Reader _curr_folder = os.path.dirname(os.path.abspath(__file__)) def _basic_txt_extractor(score_name, use_name=True): txt_filename = os.path.join(_curr_folder, 'data', score_name + '.t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ## # PyTest.py # This file is part of PyTest. # # PyTest # Python编写的OI评测器后端 # Copyright (C) 2011 CUI Hao # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Fo...
""" xml based logging constructs and helpers functions """ import xml.dom.minidom as _xml def add_child(head, name): """ Create a node with name. And append it to the node list of the supplied node. (This function allows duplicate head names as specified by xml) return the create node. ...
import numpy as np from scipy.sparse.linalg import LinearOperator from ..opt.cg import basic_CG # want to form operators dealing with the dictionary frames, # and the augmented frames for sparse repr and error # # The linear operators in this module deal with factorizations of # the matrix B = [A A_e], where A_e is a...
# 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...
from util import Events class Plugin(object): def __init__(self, pm): self.pm = pm self.name = "Help" @staticmethod def register_events(): return [Events.Command("help", desc="Usage: help [module]|all, shows help text for a plugin, or a list of " ...
from geopy.compat import quote, urlencode from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder from geopy.location import Location from geopy.util import logger __all__ = ("TomTom", ) class TomTom(Geocoder): """TomTom geocoder. Documentation at: https://developer.tomtom.com/search-api/search-...
#!/url/bin/env python # -*- coding: UTF-8 -*- import urllib2 import urllib import sys import argparse import threading #headers = {"Content-Type":"application/x-www-form-urlencoded", # "Connection":"Keep-Alive", # "Referer":"http://www.baidu.com/"}; def BurpShell(host, password): global h...
''' Scratch Project Comments Parser v1.0.0 Created for use with SCV Server v2.0.0 Created by Scratch user, Gaza101. Licensed under GNU General Public License v3. www.garethpw.net ''' from HTMLParser import HTMLParser from htmlentitydefs import name2codepoint from urllib2 import urlopen class Comm...
from .base import NameMixin, guarded from .error import ImfsError, NotFoundError from .utils import thumbnail from pprint import pformat from .. import img from datetime import datetime BASE = '/apps/aip/cache/' class PCSError(ImfsError): pass class BadResponse(PCSError): def __init__(self, r): s...
# -*- encoding: utf-8 -*- """Script for analyzing data from the simulated primary and follow-up experiments.""" # Allow importing modules from parent directory. import sys sys.path.append('..') from fdr import lsu, tst, qvalue from fwer import bonferroni, sidak, hochberg, holm_bonferroni from permutation import tfr_p...
from multisigcore.providers.insight import InsightBatchService from multisigcore.hierarchy import MasterKey from .branch import Branch, AccountPubkeys from .recovery import CachedRecovery from .batch import Batch import json from pycoin.encoding import EncodingError try: from termcolor import colored except ImportErro...
# coding: utf-8 """ Paasta API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 impor...
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
# -*- coding: utf-8 -*- # # Copyright 2014-2020 BigML # # 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 ...
#!/usr/bin/env python # Database imports from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from models import Bot # Dbus imports import dbus import dbus.service import dbus.mainloop.glib as glib import gobject # Import bots from bots import GoogleSearchBot DATABASE = '../website/database...
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme.services.catalogs.orchestration_template import OrchestrationTemplate from utils import testgen, error from utils.update import update from cfme.web_ui import mixins from cfme.fixtures import pytest_selenium as sel from cfme import test_requirements p...
from __future__ import absolute_import, division, print_function import json import os import idaapi from idaskins import THEMES_DIR, UI_DIR from idaskins.objectinspector import ObjectInspector from idaskins.thememanifest import ManifestError, ThemeManifest from PyQt5 import uic from PyQt5.QtCore import Qt from PyQt5...
# -*- coding: utf-8 -*- import urllib.parse import urllib.request import posixpath import datetime import os import logging import filecmp import difflib import json import sqlite3 import hashlib import yaml import matplotlib.pyplot as plt import pandas as pd import numpy as np #from bokeh.io import output_notebook # ...
import numpy as np import tables from scipy.optimize import curve_fit from scipy.stats import scoreatpercentile from artist import GraphArtist from pylab import * import matplotlib.pyplot as plt import utils USE_TEX = False # For matplotlib plots if USE_TEX: rcParams['font.serif'] = 'Computer Modern' rcPar...
import logging import uuid from decimal import Decimal import six from boto.dynamodb2.fields import HashKey, RangeKey from boto.dynamodb2.table import Table from boto.exception import JSONResponseError from confidant.backends import BaseBackend, cache_manager, BackendNotInitializedError __author__ = 'gautam' def _...
# -*- coding: utf-8 -*- # Resource object code # # Created: Di Jun 24 12:09:14 2008 # by: The Resource Compiler for PyQt (Qt v4.4.0) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x03\x90\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x4...
import numpy as np def get_metric_matrix(a, b, c, alpha, beta, gamma): ''' Create metric matrix as numpy array from unit cell parameters. Return metric matrix. ''' return np.array([[a**2, a*b*np.cos(gamma), a*c*np.cos(beta)], [b*a*np.cos(gamma), b**2, b*c*np.cos(alpha)], ...
import json from django.contrib.auth.decorators import login_required from django.core import serializers from django.db.models import Count, Avg, Sum from django.http import HttpResponse, Http404 from django.views.generic import TemplateView, DetailView from actions.models import AccLocal, Dispersion, AnalisisDescuent...
# # Notification Originator # # Send SNMP TRAP notification using the following options: # # * SNMPv2c # * with community name 'public' # * over IPv4/UDP # * send TRAP notification # * to a Manager at 127.0.0.1:162 # * with TRAP ID IF-MIB::ifLink as MIB symbol # # The IF-MIB::ifLink NOTIFICATION-TYPE implies including ...
#! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import os.path import sys path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/sed3/")) # from ..extern.sed3 import sed3 # import featurevector from loguru import logger # logge...
# nc_diag_attr from netCDF4 import Dataset, getlibversion import netCDF4 import argparse import sys import traceback import numpy try: import ujson as json except: import json # Version information __version__ = "0.9b" VERSION_STR = 'nc_diag_attr v' + __version__ + "\n\n" + \ "Using the following librar...
#! /usr/bin/python2 from __future__ import division import numpy as np from sys import exit from collections import OrderedDict # ------Training data------------- # Politics xP = [ [1, 0, 1, 1, 1, 0, 1, 1], [0, 0, 0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 1, 0], [0, 1, 0, 0, 1, 1, 0, 1], [0, 0,...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView urlpatterns = [ url(r'^$', TemplateView.as_view(templ...
# Functions to implement several important functions for # various Continous and Discrete Probability Distributions # # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # import math import warnings from copy import copy from scipy.misc import comb, derivative from s...
""" Tests against manifest for CodeMirror configurations """ import pytest from djangocodemirror.exceptions import NotRegisteredError def test_raw_config_empty(manifesto): """Empty config""" manifesto.autoregister() config = manifesto.get_codemirror_parameters('empty') assert config == {} def tes...
from pytest import fixture, raises from datetime import datetime from boto3.dynamodb.conditions import Key from hieratic.collection import CollectionResource from hieratic.index import SimpleIndex @fixture def UsersResource(UserResource, ddb): @CollectionResource.define( item_class=UserResource, ...