src
stringlengths
721
1.04M
#!/usr/bin/env python #coding:utf-8 # Author: mozman # Purpose: examples for dxfwrite usage, see also tests for examples # Created: 09.02.2010 # Copyright (C) 2010, Manfred Moitzi # License: MIT License import sys import os try: import dxfwrite except ImportError: # if dxfwrite is not 'installed' append pare...
#!/usr/bin/env python # -*- coding: utf-8 -*- #This module contains the arguments class used to handle regression arguments import numpy as np import functions as fu import stat_functions as stat class arguments: """Sets initial arguments and stores static properties of the arguments""" def __init__(self,panel, a...
''' This module consists of the main functions that handle code translation from the front-end (openrobot) to an internal representation. ''' import re from constants import * from helper import * def translate(FILENAME): ''' Translate function ''' # Standard storage containers functions = ...
#! /usr/bin/env python # -*- coding: utf-8 -*- #///////////////////////////////////////////////////////////////////////////////////////// #///////////////////////////////////////////////////////////////////////////////////////// # TiVo Network Remote Control by RogueProeliator <rp@rogueproeliator.com> # Indigo plugin ...
from .. import query_processor from nose.tools import assert_true, assert_equal from numpy import random import ast # Ten tracts traversing random labels another_set = True while (another_set): tracts_labels = dict([(i, set(random.randint(100, size=2))) for i in range(100)]) labels_tracts = query_processor.la...
# -*- coding: utf8 -*- import json import urllib from functools import wraps from mock import patch, MagicMock, PropertyMock from flask import Response, session, url_for, redirect from default import flask_app, with_context from helper import web from pybossa_github_builder.view import _populate_form from pybossa_gith...
# encoding: utf-8 """ mprnlri.py Created by Thomas Mangin on 2009-11-05. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ from struct import unpack from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.protocol.ip.address import Address from exabgp.bgp.message impo...
# tests.test_pipeline # Tests to ensure that the visual pipeline works as expected. # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Fri Oct 07 22:10:50 2016 -0400 # # Copyright (C) 2016 District Data Labs # For license information, see LICENSE.txt # # ID: test_pipeline.py [1efae1f] benjamin...
# -*- coding: utf-8 -*- import PyMca5 from PyMca5.PyMcaPhysics.xrf import McaAdvancedFitBatch from PyMca5.PyMcaPhysics.xrf import FastXRFLinearFit from PyMca5.PyMcaPhysics.xrf import ClassMcaTheory from PyMca5.PyMca import EDFStack from PyMca5.PyMcaIO import ConfigDict try: from PyMca5.PyMcaPhysics.xrf.McaAdvance...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the RPC HTTP basics.""" from test_framework.test_framework import StatusquoTestFramework from tes...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# 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 t...
import argparse from sphinxarg.parser import parse_parser, parser_navigate import six def test_parse_options(): parser = argparse.ArgumentParser() parser.add_argument('--foo', action='store_true', default=False, help='foo help') parser.add_argument('--bar', action='store_true', default=False) data = ...
# generated from catkin/cmake/template/cfg-extras.context.py.in DEVELSPACE = 'FALSE' == 'TRUE' INSTALLSPACE = 'TRUE' == 'TRUE' CATKIN_DEVEL_PREFIX = '/home/pi/Documents/desenvolvimentoRos/devel' CATKIN_GLOBAL_BIN_DESTINATION = 'bin' CATKIN_GLOBAL_ETC_DESTINATION = 'etc' CATKIN_GLOBAL_INCLUDE_DESTINATION = 'include' C...
# -*- coding: utf-8 -*- """ tmdbsimple.tv ~~~~~~~~~~~~~ This module implements the TV, TV Seasons, TV Episodes, and Networks functionality of tmdbsimple. Created by Celia Oakley on 2013-10-31. :copyright: (c) 2013-2018 by Celia Oakley :license: GPLv3, see LICENSE for more details """ from .base import TMDB class T...
# # co_co_init_vars_with_odes_provided.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
# View imports from django.http import JsonResponse, HttpResponse from django.shortcuts import render from gl_site.custom_auth import login_required # Forms from gl_site.statistics.statistics_form import statistics_request_form, statistics_download_form # Data from .data_generation import format_graph_data, format_f...
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.db import models from django.db.models import Q from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404 from django.shortcuts import render_to_response, ge...
# # This is copied from CVXOPT examples and modified to be used as test reference # for corresponding Go program. # from cvxopt import matrix, solvers import helpers def testsocp(opts): c = matrix([-2., 1., 5.]) G = [matrix( [[12., 13., 12.], [ 6., -3., -12.], [-5.,...
#!/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...
# -*- coding: utf-8 -*- from pymisp import MISPEvent, MISPObject from pymisp import __path__ as pymisp_path import csv import io import json import os import base64 misperrors = {'error': 'Error'} moduleinfo = {'version': '0.2', 'author': 'Christian Studer', 'description': 'Import Attributes from a csv f...
#This script copyright 2017 Indianapolis Metropolitan Planning Organization from __future__ import division import arcpy import os import pandas as pd import numpy as np from subprocess import Popen import sys def clear_temp(): ''' Clears the temporary directory that is created when running this tool ''' ...
# ##### 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...
# -*- coding: utf-8 -*- # # # Auto reset sequence by year,month,day # Copyright 2013 wangbuke <wangbuke@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either ...
#!/usr/bin/env python2.7 # edo.py - This Module is for the most used classes and methods # URL: https://github.com/engdan77/edoautohome # Author: Daniel Engvall (daniel@engvalls.eu) __version__ = "$Revision: 20160725.1240 $" import sys import threading import SocketServer def edoGetDateTime(): import time ...
# -*- coding: utf-8 -*- import re import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __version__ = "0.37" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fasts...
# -*- coding: utf-8 -*- # a template for making config.json files for functions #import pprint #pp = pprint.PrettyPrinter(indent=4) config = {} # human and machine readable names for the model config['id'] = {} config['id']['DOI'] = '10.1016/j.jacc.2013.11.013' config['id']['papertitle'] = 'Factors Associated With M...
########################################################### # # Copyright (c) 2005-2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written ...
import requests import warnings from zope.component import getSiteManager from zope.component.factory import Factory from zope.interface import implementer from zope.interface import implements from zope.schema.fieldproperty import FieldProperty from interfaces import IRequest from sparc.entity.entity import BaseSchema...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Backend Authentication Module to allow connect to AD (and LDAP) in the future """ _author__ = "Roch Auburtin" __copyright__ = "Copyright 2013, TODO" __credits__ = ["Christian Hammond from the The Review Board Project"] import os import sys import logging import unittes...
# -*- coding: utf-8 -*- """ flask.testing ~~~~~~~~~~~~~ Implements test support helpers. This module is lazily imported and usually not used in production environments. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import werkzeug from contextlib im...
from geontology import GeoOntology ont = GeoOntology("tests/geo_ontology.ttl", frmt='n3') ont.add_geo_column("http://linkedgeodata.org/ontology/OilPlatform", name="OilPlatformLocation", field1="lat", field2="lon", type='PointFeature', desc="Oil platforms") ont.add_info_column("http://linkedgeodata...
player_search = 'http://worldofwarships.com/en/community/accounts/search/?search=%s' player_search_key_search_page = 'js-search-results' player_search_key_player_page = 'og:url' player_search_key_error_page = 'Error' player_search_id_pattern_search_page = '(?<=accounts/).*(?=-)' player_search_id_pattern_player_page = '...
# Copyright (c) 2017, John Skinner import unittest import numpy as np import bson import database.tests.test_entity import util.dict_utils as du import batch_analysis.task import batch_analysis.tasks.compare_trials_task as task class TestCompareTrialTask(database.tests.test_entity.EntityContract, unittest.TestCase): ...
import unittest import numpy as np from gtrackcore.metadata import GenomeInfo from gtrackcore.track.core.GenomeRegion import GenomeRegion from gtrackcore.track_operations.operations.Filter import Filter from gtrackcore.test.track_operations.TestUtils import \ createSimpleTestTrackContent class FilterTest(unitte...
import sys try: from django.conf import settings settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="emailmessagetemplates.urls", INSTALLED_APPS=...
import re import pytest from pupa.scrape import (VoteEvent as ScrapeVoteEvent, Bill as ScrapeBill, Organization as ScrapeOrganization, Person as ScrapePerson) from pupa.importers import (VoteEventImporter, BillImporter, MembershipImporter, OrganizationImporter, Perso...
# -*- coding: utf-8 -*- from logging import getLogger _LOG = getLogger(__name__) class IterableWrapper(): """ Wrap iterator to catch the StopIteration exception and mark the current call as done (makes it possible to calculate the total time of a request). """ def __init__(self, iterable, end_cb): ...
from JumpScale import j from Confluence2HTML import Confluence2HTML from Confluence2RST import Confluence2RST class DocgeneratorFactory: def __init__(self): pass def getConfluenceClient(self, url, login, passwd, spacename, erasespace=False, erasepages=False): """ @param url e.g. htt...
# -*- coding:utf-8 -*- import wx,time,threading,os import urllib2,re from urlparse import urlparse from tbsearch import TbSearch import sys reload(sys) sys.setdefaultencoding('utf-8') class Create(): def __init__(self,panel): self.topframe=panel.GetGrandParent() self.draw_Boxsizer(panel) def Run(self,evt): val...
from email.utils import parseaddr from sqlalchemy import not_ from pyramid.view import ( view_config, ) from pyramid.httpexceptions import ( HTTPFound, ) import colander from deform import ( Form, widget, ValidationFailure, ) from ..models import ( DBSession, User, ) from ..m...
# Copyright (C) 2019 Philipp Hörist <philipp AT hoerist.com> # # This file is part of nbxmpp. # # 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 3 # of the License, or (at your opt...
"""WebChat URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
from wepay.calls.base import Call class SubscriptionPlan(Call): """The /subscription_plan API calls""" call_name = 'subscription_plan' def __call__(self, subscription_plan_id, **kwargs): """Call documentation: `/subscription_plan <https://www.wepay.com/developer/reference/subscription_pla...
#coding:utf8 import functools import logging from django.conf import settings from django.core.cache.backends.base import BaseCache from .utils import load_class from .exceptions import ConnectionInterrupted # 错误异常配置 DJANGO_REDIS_CLUSTER_IGNORE_EXCEPTIONS = getattr(settings, 'DJANGO_REDIS_CLUSTER_IGNORE_EXCEPTIONS'...
## Copyright 2007-2008 Luc Saffre ## This file is part of the Lino project. ## Lino 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 versio...
"""Concatenate and resample SAAF data""" import sys import os sys.path.append("../") from utils.utils import * folder = config.features_folder if not os.path.exists(folder): os.makedirs(folder) def parse_saaf(filename, dropna=True): df = pd.read_csv(config.data_folder + '/' + filename) df = convert_t...
#!/usr/bin/env python """convert_test.py Test state space and transfer function conversion. Currently, this unit test script is not complete. It converts several random state spaces back and forth between state space and transfer function representations. Ideally, it should be able to assert that the conversion ou...
from .. import Availability, Class, Constant, Define, Method, Parameter, Type gx_class = Class('MESHUTIL', doc="Mesh utility methods.") gx_defines = [ Define('SURFACE_CLIP_MODE', doc="Surface Clip Mode", constants=[ Constant('SURFACE_CLIP_ABOVE', value='0', ty...
""" Modulestore backed by Mongodb. Stores individual XModules as single documents with the following structure: { '_id': <location.as_dict>, 'metadata': <dict containing all Scope.settings fields> 'definition': <dict containing all Scope.content fields> 'definition.children': <list of all child locati...
from collections import defaultdict import urllib import chardet import jinja2 from jingo import register from jingo.helpers import datetime from tower import ugettext as _, ungettext as ngettext import amo from amo.urlresolvers import reverse from amo.helpers import breadcrumbs, page_title from access import acl fro...
# -*- coding: utf-8 -*- import os import codecs from itertools import chain from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.template import Template from django.template.loader import get_template from django.test import RequestFactory from staticsite.vie...
#!/usr/bin/env python3 # # This is the main GUI function for Coliform Project # # This file is part of Coliform. https://github.com/Regendor/coliform-project # (C) 2016 # Author: Osvaldo E Duran # Licensed under the GNU General Public License version 3.0 (GPL-3.0) import os import time import sys try: import matplo...
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404, render_to_response from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.template.loader import get_template from django.template import Context, RequestCont...
from model.new_user_data import N_u_d import random import string import os.path import json import getopt import sys import jsonpickle try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"]) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f = "data/contac...
""" Django settings for django_boilerplate project. Generated by 'django-admin startproject' using Django 1.10.5. 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/ """...
#!/usr/bin/python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson 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 ...
from django.contrib import admin from models import Location, Story from people.models import Author class LocationAdmin(admin.ModelAdmin): list_display = ('zipcode', 'city_fmt', 'county_fmt', 'state_fmt', 'story_count') list_filter = ('state',) search_fields = ('zipcode', 'city', 'county') admin.site.re...
# 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import socket import json try: import pystats_config except ImportError: import pystatsd.pystats_config as pystats_config class UDPClient(object): def __init__(self, server_ip, server_port): """Initalize client""" self.server_ip = server_ip ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# creatGraspICRA09.py - script for creating a hand poses database # # Copyright (c) 2009 Javier Romero # # Author: Javier Romero <jrgn@kth.se> # # 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 Found...
import numpy as np import random import math class Flag(): """ A flag is target that agents use to score in capture the flag. Once captured, it is marked as taken and stores the scoring team. """ def __init__(self, pos, scoring_radius): assert scoring_radius >= 0 self....
#!/usr/bin/env py.test """Unit tests for the function library""" # Copyright (C) 2007 Anders Logg # # This file is part of DOLFIN. # # DOLFIN 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 ver...
# Andrew Miller <amiller@cs.ucf.edu> 2011 # # BlockPlayer - 3D model reconstruction using the Lattice-First algorithm # See: # "Interactive 3D Model Acquisition and Tracking of Building Block Structures" # Andrew Miller, Brandyn White, Emiko Charbonneau, Zach Kanzler, and Joseph J. LaViola Jr. # IEEE VR 2012,...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Base test case class for coverage.py testing.""" import contextlib import datetime import difflib import glob import io import os import os.path import random i...
from datetime import datetime, timedelta from django.contrib.auth import get_user_model from django.core.paginator import Paginator from django.core.urlresolvers import reverse from django.http import HttpResponse from django.template.defaultfilters import filesizeformat from django.test import TestCase import json fro...
#!/Users/adewinter/venv/rmac/bin/python from kivy.app import App from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.textinput import TextInput from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView from send import send_message as send from pony.orm import *...
""" Copyright 2020 Google LLC Copyright 2020 PerfectVIPs 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 t...
from datetime import datetime try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict import six import sqlalchemy as sa from sqlalchemy.ext.compiler import compiles from .dialects.postgresql import ( CreateTemporaryTransactionTableSQL, InsertTemporaryTransacti...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2016, Jan Bot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, ...
import media import fresh_tomatoes # Instances from the base class 'Movie' __init__ function # Google URL shortner was used to make the URLs more manageable # and follow PEP8 Style Guide iron_giant = media.Movie("The Iron Giant", "Boy befriends a giant robot during the Cold War", ...
import numpy as np ############################################################################### ## Surface Area ## --------------------------------- ## Planar polygon ############################################################################### # Theorem of Green #------------------------------------------------...
import types class FieldNameError(Exception): def __init__(self, value): self.value = value def __str__(self): return `"""Field name '%s' does not exist""" % self.value` class fRow(tuple): # class for each row def __getattr__(self,i): return tuple.__getitem__(self,self.__Field2Index__(i)) d...
import urllib2 import re from bs4 import BeautifulSoup from wheel.util import utf8 from crawler import response import sys reload(sys) sys.setdefaultencoding('utf-8') response = urllib2.urlopen("http://www.flyertalk.com/forum/credit-card-programs-599") html1=response.read() soup=BeautifulSoup(html1,"lxml") ##use...
version = 1.1 path = u'/Applications/FileMaker/FileMaker Pro 11 Advanced/FileMaker Pro Advanced.app' classes = \ [('application', 'capp'), ('window', 'cwin'), ('document', 'docu'), ('database', 'cDB '), ('table', 'cTBL'), ('FileMaker_script', 'cSCP'), ('layout', 'ctbl'), ('field', 'ccol'), ('record', 'crow'), ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Aug 17 13:51:26 2017 @author: login """ import pandas as pd from otu_ts_support import parseBiosample import numpy as np from scipy.spatial.distance import pdist from scipy.spatial.distance import squareform original_bins = ["Bin_52", "Bin_46", "Bin_23...
# ----------------- # User Instructions # # This homework deals with anagrams. An anagram is a rearrangement # of the letters in a word to form one or more new words. # # Your job is to write a function anagrams(), which takes as input # a phrase and an optional argument, shortest, which is an integer # that speci...
import Event from Global import Global import copy # Common utilities def MarkCurrentWorkingUnitEnded(thread_id): threads = Global.ActiveThreads() if thread_id in threads: del threads[thread_id] def AddConnector(event, connector_key_func, key): if key is None: return ctors = Global.Connectors() ct...
# -*- coding: utf-8 -*- import os.path import unittest from _parse import Template import codecs class TestBasic(unittest.TestCase): def setUp(self): self.t = { 'basic_ending_colon': None, 'basic_html': None, 'basic_indent': None, 'basic_inline': None, ...
# encoding: utf-8 """Python 3 function annotation and AnnotationExtension example.""" from json import dumps class Root: def __init__(self, context): self._ctx = context def tmpl(self) -> 'mako:./template.html': return dict() def mul(self, a: int = None, b: int = None) -> 'json': """Multiply two values...
from qgis.PyQt import QtCore from qgis.core import QgsProject, QgsCoordinateReferenceSystem, QgsMapLayer, QgsRasterLayer, QgsVectorLayer from qgis.core import QgsField, QgsFeature, QgsDistanceArea, QgsPoint from qgis import utils from os import path import sys from mole3.qgisinteraction.layer_interaction import find_l...
# This file is part of beets. # Copyright 2015,2016, Malte Ried # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
# Transformer/IO/_VASP.py # ------- # Imports # ------- import warnings; from Transformer import Constants; from Transformer import Structure; from Transformer.Utilities import StructureTools; # --------- # Functions # --------- def ReadPOSCARFile(inputReader, atomicSymbolLookupTable = None): # Variables to ...
""" test calculations """ from nose.tools import ok_, eq_ from simkit.core.calculations import Calc, CalcParameter from simkit.core.calculators import Calculator from simkit.tests import PROJ_PATH, sandia_performance_model import os import uncertainties from pvlib.solarposition import get_solarposition as solpos impor...
import re import time lowest_cost = 9999999999999 best_spells = [] # MUCH faster than deepcopy def spell_copy(spells): return {'recharge' : [x for x in spells['recharge']], 'poison' : [x for x in spells['poison']], 'shield' : [x for x in spells['shield']], 'magic missile' : [x for x in spells['magic missile...
# Copyright 2020 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. from __future__ import print_function from v8_utilities import capitalize from google.protobuf.text_format import MessageToString import web_idl import blin...
#!/usr/bin/env python import datetime import logging import re import pytz from .row import Row logger = logging.getLogger(__name__) __all__ = ['get_parser'] DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ' class Parser(): def __init__(self, f): self._fobj = f def get(self): return generate_rows...
#!/usr/bin/env python # coding:utf-8 import os import sys import glob import binascii import time import random import base64 import hashlib import threading import subprocess current_path = os.path.dirname(os.path.abspath(__file__)) python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, 'pyt...
# Copyright 2012 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 ...
# Copyright (C) 2017-2018 Jan Wollschläger <janmwoll@gmail.com> # This file is part of goccs. # # goccs 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) a...
# Copyright (C) 2012-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
import unittest import torch import torch.nn as nn from metal.end_model.loss import SoftCrossEntropyLoss from metal.utils import pred_to_prob class LossTest(unittest.TestCase): @classmethod def setUpClass(cls): torch.manual_seed(1) def test_sce_equals_ce(self): # All correct predictions...
import logging import sys from uic.exceptions import UnsupportedPropertyError from uic.icon_cache import IconCache if sys.hexversion >= 0x03000000: from uic.port_v3.ascii_upper import ascii_upper else: from uic.port_v2.ascii_upper import ascii_upper logger = logging.getLogger(__name__) DEBUG = logger.debug ...
#!/afs/bx.psu.edu/project/pythons/linux-x86_64-ucs4/bin/python2.7 # $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $ # Author: Dave Kuhlman <dkuhlman@rexx.com> # Copyright: This module has been placed in the public domain. """ Fix a word-processor-generated styles.odt for odtwriter use: Drop page size ...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, David Wulliamoz # 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 ...
# Copyright (C) 2016 Artem Kozlov. All rights reserved. Contacts: <artemix-dev@yandex.ru> # Multilayer perceptron module for Python 3 from copy import deepcopy as new import numpy as np import json class Neuron: inputs = [] weights = [] output = 0.0 # The 'weights' variable must be a list of neuron ...
import lxml.etree as et import re # Creative Commons links xlink_href = '{http://www.w3.org/1999/xlink}href' cc_by_4_link = 'https://creativecommons.org/licenses/by/4.0/' cc_by_3_link = 'https://creativecommons.org/licenses/by/3.0/' cc0_link = 'https://creativecommons.org/publicdomain/zero/1.0/' cc_by_3_igo_link = 'ht...
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...