src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# python_photo_resolution_comparison documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration value... |
#!/usr/bin/env python
import curses , traceback , os
class textBox:
def __init__(self,text,row,col,maxC):
self.dispText=text
self.dispRow=row
self.dispCol=col
self.maxChars=maxC
self.strPos=0
class CursesDriver:
def __init__(self,variables,numVars,sT):
try: ... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... |
from copy import copy
from notification.models import TaskHistory
from util import get_worker_name
from workflow.workflow import steps_for_instances, rollback_for_instances_full
__all__ = ('BaseJob',)
class BaseJob(object):
step_manger_class = None
get_steps_method = None
success_msg = ''
error_msg... |
# Copyright (c) 2010-2011 Edmund Tse
#
# 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, modify, merge, publish, dis... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import time
from urllib import quote
from lxml.html import fromstring, tostring
from calibre.ebooks.metadata.sources.base import Source
from calibre import brows... |
import pdb
"""
Each sensor that uses this will follow these rules:
calling sensor.startup() function will initialize and calibrate the sensor. It will return 'Green' on success, 'Red' on failure
calling sensor.read() will return a float for that tick
calling sensor.reset() will attempt to reset the sensor, returning 0... |
import pytest
from pyramid.httpexceptions import HTTPBadRequest
from rest_toolkit.abc import EditableResource
from rest_toolkit.ext.colander import ColanderSchemaValidationMixin
import colander
class AccountSchema(colander.Schema):
email = colander.SchemaNode(colander.String())
password = colander.SchemaNode(... |
import re
import os
import commands
import logging
from autotest.client.shared import error
from virttest import virsh, utils_misc, xml_utils, libvirt_xml
from virttest.libvirt_xml import vm_xml, xcepts
def xml_recover(vmxml):
"""
Recover older xml config with backup vmxml.
:params: vmxml: VMXML object
... |
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application 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, or (at your option)
# any later version.
#
# This application is di... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addon by CLEARCORP S.A. <http://clearcorp.co.cr> and AURIUM TECHNOLOGIES <http://auriumtechnologies.com>
#
#
# This program is free software: you can redistr... |
#!/usr/bin/env python
#
# Copyright (C) 2013 AcoMo Technology.
# All rights reserved.
#
# Authored by Jyun-Yu Huang <yillkid@acomotech.com>
#
# This is a bluetooth forwarder.
#
# AcoMo forwarder bridge sensor and server, the protocol of client (sensor) is bluetooth RFCOMM,
# and the protocol of server is XML-RPC.
#
# ... |
import os
import json
import shutil
import tempfile
import mock
import pytest
from opencivicdata.models import Person
from pupa.scrape import Person as ScrapePerson
from pupa.scrape import Organization as ScrapeOrganization
from pupa.importers.base import omnihash, BaseImporter
from pupa.importers import PersonImporter... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
"""
message_boxes
KPyLibs
Copyright (c) Karol Będkowski, 2004, 2005, 2006
This file is part of KPyLibs
"""
__author__ = "Karol Będkowski"
__copyright__ = "Copyright (c) Karol Będkowski, 2004-2010"
__version__ = "2010-05-24"
__all__ = ['message_box_error', 'message_box_inf... |
# -*- encoding: utf-8 -*-
import six
from datetime import datetime, date, time
from decimal import Decimal
if six.PY3:
long = int
class StorageTestsMixin(object):
def test_store(self):
# read defaults
import constance
config = constance.load_config_class()()
self.assertEqual(... |
class Piece:
def __init__(self, color,name):
self.color = color
self.name = name
def is_move_valid(self, origine,destination):
print("This piece has no move, please report")
def is_ennemy(self,destination):
if Game.at(destination) != self.color:
return True
... |
""" Utility module for command line script select_images
"""
# Author: Ilya Patrushev ilya.patrushev@gmail.com
# License: GPL v2.0
import os
import numpy as np
import scipy.linalg as la
from cPickle import load
import cv2
def image_colour_distribution(img):
"""
Extract colour distribution parameters.
... |
# Copyright(c) 2017, Dimitar Venkov
# @5devene, dimitar.ven@gmail.com
# www.badmonkeys.net
#inspired by Troy Gates https://forums.autodesk.com/t5/revit-api/revit-api-selected-element-set-order/td-p/5597203
import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
clr.AddReference("RevitAPI")
from Au... |
from datetime import datetime, timezone
from logging import getLogger
import threading
from .task import Tasks, Batch, Schedulable
from .utils import run_forever, handle_sigterm
from .job import Job, JobStatus, advance_job_status
from .brokers.base import Broker
from .const import DEFAULT_QUEUE, DEFAULT_NAMESPACE, DEF... |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.internet import reactor, protocol, error, abstract, defer
from twisted.internet import interfaces, base
from twisted.test.time_helpers import Clock
try:
from twisted.internet import ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale.tests.test_sale_common import TestCommonSaleNoChart
from odoo.tests import Form
class TestReInvoice(TestCommonSaleNoChart):
@classmethod
def setUpClass(cls):
super(TestReInvoice, ... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... |
"""Flask and other extensions instantiated here.
To avoid circular imports with views and create_app(), extensions are instantiated here. They will be initialized
(calling init_app()) in application.py.
"""
from logging import getLogger
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
fr... |
def highest(start, stop):
begin = start
dict_max = {}
while begin <= stop:
current = set()
number = begin
if begin == 1:
number = 2
while number >= 1:
if number == 1:
max_num = int(max(current))
break
elif n... |
"""
OLD GLORY
By David Jonathan Ross <http://www.djr.com>
This drawbot script will draw the American Flag.
It's also responsive! I made this to experiment with Drawbot Variables.
For the most part, it follows the rules here:
http://en.wikipedia.org/wiki/Flag_of_the_United_States#Specifications
It does... |
import urllib.request, urllib.parse, urllib.error
import twurl
import json
import sqlite3
TWITTER_URL = 'https://api.twitter.com/1.1/friends/list.json'
conn = sqlite3.connect('friends.sqlite')
cur = conn.cursor()
cur.execute('''CREATE TABLE IF NOT EXISTS People
(id INTEGER PRIMARY KEY, name TEXT UNIQUE, retriev... |
#!/usr/bin/env python3
# Copyright (c) 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 segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_fram... |
import numpy as np
try:
import netCDF4 as netCDF
except:
import netCDF3 as netCDF
import pyroms
def remap(src_array, remap_file, src_grad1=None, src_grad2=None, \
src_grad3=None, spval=1e37, verbose=False):
'''
remap based on addresses and weights computed in a setup phase
'''
# ... |
# Copyright (C) 2016 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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 later version.
#
# ycmd... |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import image_transform
import layers
import preprocess
import postprocess
import objectives
import theano_printer
import update... |
# -*- coding: utf-8 -*-
#
# Change Point documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... |
#!/usr/bin/env python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
import sys
import argparse
import math
import os
import struct
from elf_helper import ElfHelper, kobject_to_enum
# Keys in this dictionary are structs which should be recognized as kernel
# objects. Values should e... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-18 05:57
from __future__ import unicode_literals
import django.db.models.deletion
import mptt.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolibriauth', '0001_initial'),
]
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# file2db documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('realtime', '0049_auto_20180320_0406'),
]
operations = [
migrations.CreateModel(
name='ReportTemplate',
... |
import yaml
import click
from panoptes_cli.scripts.panoptes import cli
from panoptes_client import Workflow
@cli.group()
def workflow():
"""Contains commands for managing workflows."""
pass
@workflow.command()
@click.argument('workflow-id', required=False, type=int)
@click.option(
'--project-id',
... |
import unittest
import numpy as np
import matplotlib.pyplot as plt
x=0.0
xrange=2000
#f = open('/home/travis/build/xinbian/langevin_dynamics/langevin_dynamics/potential.d','w')
#write the potential file
f = open('potential.d','w')
for i in range(1, xrange+1, 1):
f.write("%s %10s %10s %10s\n" % (i, x, (2.0-2.0*(x-1... |
# ICE Revision: $Id$
"""Writes Logfiles"""
from PyFoam.ThirdParty.six import print_
try:
import logging
hasLogging=True
except ImportError:
# For Python-versions < 2.3
print_("Warning: old python-version. No logging-support")
hasLogging=False
from PyFoam.Infrastructure.Hardcoded import assertDir... |
# Copyright 2017 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 writing, s... |
#
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
'''This code manages the name mangling (and reversal of such) that needs to
happen in the temp... |
"""
Imported calendars from the exchange_calendars project
GitHub: https://github.com/gerrymanoim/exchange_calendars
"""
from datetime import time
from .market_calendar import MarketCalendar
import exchange_calendars
class TradingCalendar(MarketCalendar):
def __init__(self, open_time=None, close_time=None):
... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... |
# TestDefiningOverloadedFunctions.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://sw... |
import libvirt
import maglica.config
from xml.etree.ElementTree import *
import subprocess
class Virt:
def __init__(self, hosts=[{"name": "test", "weight": 1}]):
self.hosts = []
self.conf = {}
for host in hosts:
if host["name"] == "test":
uri = "test:///default... |
import sys
from urllib.parse import urlparse
from linemode.base import Printer
def _compile_command(command):
if isinstance(command, str):
command_name, args = command, []
else:
command_name, *args = command
if len(args):
return (
command_name + ": " +
", ... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.admin import forms
from cms.admin.forms import PageUserForm
from cms.api import create_page, create_page_user
from cms.forms.fields import PageSelectFormField, SuperLazyIterator
from cms.forms.utils import (get_site_choices, get_page_choices,
u... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
Fetch build artifacts from a Firefox tree.
This provides an (at-the-moment special purpose) interface to download A... |
# -----------------------------------------------------------------------------
# Copyright (c) 2015 Ralph Hempel <rhempel@hempeldesigngroup.com>
# Copyright (c) 2015 Anton Vanhoucke <antonvh@gmail.com>
# Copyright (c) 2015 Denis Demidov <dennis.demidov@gmail.com>
# Copyright (c) 2015 Eric Pascual <eric@pobot.org>
#
# ... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... |
import os.path
import nose.tools
import angr
import ailment
from angr.analyses.decompiler.optimization_passes.base_ptr_save_simplifier import BasePointerSaveSimplifier
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
def _get_block(clinic, addr):
for ... |
# Copyright 2014-2016 Open Source Robotics Foundation, 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 applicabl... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
# -*- coding: utf-8 -*-
from pandasqt.compat import QtCore, QtGui, Qt, Slot, Signal
from pandasqt.models.DataFrameModel import DataFrameModel
from pandasqt.views.EditDialogs import AddAttributesDialog, RemoveAttributesDialog
from pandasqt.views.CustomDelegates import createDelegate
from pandasqt.models.mime import Pan... |
# -*- coding: utf-8 -*-
"""Basic Security Module Parser."""
import binascii
import construct
import logging
import os
import socket
from plaso.lib import errors
from plaso.lib import event
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.unix import bsmtoken
from plaso.parsers import interface... |
import functools
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
from selection.tests.instance import gaussian_instance
from selection.learning.utils import full_model_inference, pivot_plot
from selection.learning.core import normal_sampler, logit_fit
def simulate(n=200, p=100, s=1... |
# Copyright (c) 2014. Mount Sinai School of Medicine
#
# 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... |
# coding: utf-8
import os
from os.path import basename
from PIL import Image as PILImage
from py2docx.document import DOCUMENT_PATH
from py2docx.util import Unit
class Image(object):
def __init__(self, image_path, document, align=None,
width='100%', height='100%'):
self.image = open(imag... |
#!/usr/bin/python
import textwrap
import config
import random
class AbstractTest:
def name(self): return self.__class__.__name__
def description(self): return 'Here should be a description but someone was too lazy!'
def info(self, *messages):
print_with_indent(self.__class__.__name__, messages... |
def obtener_certificado(usuario, perfil):
"""devuelvo certificado, si no existe lo creo en seguinf"""
env.user = myconf.take('datos.seguinf_user')
env.warn_only = True
seguinf = FabricSupport()
comando='sudo ls -la /root/Clientes_ssl/'+str(usuario)+'-'+str(perfil)+'.p12'
seguinf.run(myconf.take('datos.seguinf_srv... |
import gzip
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connections
def _newfile(counter):
"""Generate a new sitemap filename based on count."""
name = '%s/sitemap-%s.xml.gz' % (settings.SITEMAPS_DIR,
counter)
fp = gzip.open... |
from t3f.tensor_train_base import TensorTrainBase
from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
from t3f.variables import assign
from t3f.variables import get_variable
from t3f.ops import add
from t3f.ops import cast
from t3f.ops import flat_inner
from t3f.ops import fro... |
import os
from django.core.management.base import BaseCommand
from website.settings import BASE_DIR
class Command(BaseCommand):
def handle(self, *args, **options):
migrations_folder = os.path.join(BASE_DIR, "website", "migrations")
admin_account_migration_text = self.get_admin_account_migration_... |
#!/usr/bin/env python -S
# -*- coding: utf-8 -*-
r"""
frameworkify
~~~~~~~~~~~~
A small command line tool that can rewrite the paths to dynamic
loaded libraries in .dylib files so that they reference other
paths. By default it will rewrite the path so that it points to
the bundle's Frameworks ... |
# create timestep counter N and network
# create environments and learner agents
# main loop:
# for t in range(0, max_episode_size):
# get a_t[], v_t[] from network for the state of each agent:
# convert a_t to a single action index
#
# parallel for i in range(0, num_agents)
# new_state, reward = perform a_t[... |
#!/usr/bin/env python3
from arrowhead import Flow, step, arrow, main
def ask(prompt):
answer = None
while answer not in ('yes', 'no'):
answer = input(prompt + ' ')
return answer
class XKCD518(Flow):
"""
https://xkcd.com/518/
"""
@step(initial=True, level=1)
@arrow('do_you_un... |
from tg import expose, flash, require, url, request, redirect, validate, response
from sqlalchemy import asc, desc
from tw.forms.datagrid import Column
import genshi
class SortableColumn(Column):
def __init__(self, title, name):
super(SortableColumn, self).__init__(name)
self._title_ = title
d... |
#! -*- coding: utf-8 -*-
from __future__ import print_function
import pprint
from decimal import Decimal
from botocore.exceptions import ClientError
from botocore.vendored.requests.exceptions import ConnectionError
from .connection import db
from .helpers import get_attribute_type
from .errors import ClientException... |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 optio... |
# Copyright (c) 2015-2016 Cisco Systems
#
# 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, modify, merge, publ... |
from django.test import TestCase
from sensor_net.models import Node, Reading, Sensor
from agent import utils
from agent.models import *
class AlertLogTestCase(TestCase):
# When a reading is created, the value is checked against
def setUp(self):
# This test case supposes a humidity monitor for a guit... |
# Copyright 2015 Jacob Welsh
#
# This file is part of Bitnomon; see the README for license information.
"""Text/number formatting"""
class ByteCountFormatter(object):
#pylint: disable=too-few-public-methods
"""Human-readable display of byte counts in various formats.
By default, the formatter uses SI an... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
PARSER:
-------
This parser will intake dataverse dataset classes and
generate an HDX-like dictionary. It was designed to
register datasets in HDX in a posterior process.
'''
import os
import sys
import json
import requests
from copy import copy
from slugify import slugif... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('iss', '__first__'),
]
operations = [
migrations.CreateModel(
name='AcademicDiscipline',
fields=[
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rotanimate.py
#
# Copyright 2016 Cosmo <cosmo@CosmoSpectre>
#
# 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 L... |
from cinderclient import exceptions as cinder_exceptions
from novaclient import exceptions as nova_exceptions
from waldur_core.structure.executors import ProjectCleanupExecutor
from waldur_core.structure.models import Project
from waldur_openstack.openstack.tests.unittests import test_backend
from waldur_openstack.ope... |
import argparse, subprocess, platform, os, shutil, webbrowser
def clean():
files = []
folders = ['_build', 'doxygen/html', 'doxygen/latex', 'doxygen/xml']
for f in files:
if os.path.isfile(f):
os.remove(f)
for f in folders:
if os.path.isdir(f):
shutil.rmtree(f)
... |
#!/usr/bin/env python
# portable serial port access with python
# this is a wrapper module for different platform implementations of the
# port enumeration feature
#
# (C) 2011 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
"""\
This module will provide a functio... |
#!/usr/bin/env python2
'''
Author: xswxm
Blog: xswxm.com
This script will measure the successful pings per seconds.
e.g.: sudo python ping.py -l -a 61:8E:9C:CD:03 -f 74 -t 0 -r 0
'''
import sys, time, threading
from lib import common
common.init_args('./ping.py')
common.parser.add_argument('-a', '--address', type=str... |
# ##### 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 distributed ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
# -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QMenu, QTableWidget
from hamcrest import contains, has_items, equal_to
from cute import gestures
from cute.matchers import named
from cute.widgets import MenuDriver, TableViewDriver
from tgit.ui.pages.track_list_tab import TrackListTab
from ._screen_driver import Scr... |
from django.conf.urls import include, url
from django.views.generic import DetailView, ListView, TemplateView
from . import models
kingdoms_patterns = [
url(r'^(?P<pk>[0-9]+)/$', DetailView.as_view(model=models.Kingdom), name='detail'),
url(r'^$', ListView.as_view(model=models.Kingdom), name='list'),
]
terri... |
"""
CurrentClockSource - file ``/sys/devices/system/clocksource/clocksource0/current_clocksource``
==============================================================================================
This is a relatively simple parser that reads the
``/sys/devices/system/clocksource/clocksource0/current_clocksource`` file.
... |
# -*- coding: utf-8 -*-
import os
import io
import json
from boussole.conf.model import Settings
def test_source_map_path_001(compiler, temp_builds_dir):
"""
Check about source map path from 'sourceMappingURL' with a simple path
"""
basic_settings = Settings(initial={
"SOURCES_PATH": ".",
... |
# Copyright 2016-2021 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from hamcrest import (
assert_that,
calling,
contains,
contains_inanyorder,
empty,
equal_to,
has_entries,
has_key,
has_properties,
)
from xivo_test_helpers.mock import ANY_UUID... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
# -*- coding: utf-8 -*-
"""
Enumerazione delle flag di entità.
"""
# (TD) queste convertirle in variabili di descrizione caratteriale -100 / 100
#COURAGEOUS = FlagElement("Coraggioso", "L'entità non si farà abbattere dalle situazioni che incutono timore")
#COWARD = FlagElement("Fifone", "L'entit... |
import inspect
import subprocess
import os
import commandify as cmdify
def parse_doc_for_commands(doc):
if not doc:
return []
cmds = []
lines = doc.split('\n')
usage_found = False
for line in lines:
if line[:10] == ' usage:':
usage_found = True
if usage_foun... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import shutil
import sys
try:
import pelican
except:
err('Cannot import pelican.\nYou must install Pelican in order to run this script.', -1)
global _THEMES_PATH
_THEMES_PATH = os.path.join(
os.path.dirname(
os.path.abspath(... |
#!/usr/bin/env python
#
# Copyright 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 o... |
#
# This file is part of do-mpc
#
# do-mpc: An environment for the easy, modular and efficient implementation of
# robust nonlinear model predictive control
#
# Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean
# TU Dortmund. All rights reserved
#
# do-mpc is free sof... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 25 08:48:28 2014
@author: david
"""
#*************** IMPORT DEPENDANCIES*******************************************
import numpy as np
#import spec_gdal4 as spg
from osgeo import gdal
import os
import csv
#import h5py
import datetime
import numpy.ma as ma
#from StringIO ... |
"""
Django settings for MES project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... |
# -*- coding: utf-8 -*-
from .chord import as_chord, Chord
class ChordProgression(object):
""" Class to handle chord progressions.
:param list[pychord.Chord] _chords: component chords of chord progression.
"""
def __init__(self, initial_chords=None):
""" Constructor of ChordProgression inst... |
import numpy as np
def activation(z, deriv=False):
if deriv == True:
return z * (1-z)
return 1 / (1 + np.exp(-z))
def forwardpropagation(X, theta0, theta1):
layer0 = X
layer1 = activation(np.dot(layer0, theta0))
layer2 = activation(np.dot(layer1, theta1))
return layer0, layer1, layer... |
import io
import re
import serial
import time
import glob
from pocs.focuser.focuser import AbstractFocuser
# Birger adaptor serial numbers should be 5 digits
serial_number_pattern = re.compile('^\d{5}$')
# Error codes should be 'ERR' followed by 1-2 digits
error_pattern = re.compile('(?<=ERR)\d{1,2}')
error_message... |
# setup.py : dproxify setup
# Written by Francesco Palumbo aka phranz
#
# 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 option) any later version.
... |
import json as json
import numpy as np
import tensorflow as tf
with open('data.json') as data_file:
data = json.load(data_file)
x = tf.placeholder(tf.float32, [None, 3])
W = tf.Variable(tf.zeros([3, 1]))
b = tf.Variable(tf.zeros([1]))
y = tf.nn.softmax(tf.matmul(x, W) + b)
y_ = tf.placeholder("float", [None, 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.