src stringlengths 721 1.04M |
|---|
from sfepy.base.base import *
##
# 21.07.2006, c
class Materials( Container ):
##
# 24.07.2006, c
def from_conf( conf, wanted = None ):
if wanted is None:
wanted = conf.keys()
objs = OneTypeList( Material )
for key, val in conf.iteritems():
if key in wanted... |
# THIS IS THE PYTHON CODE FOR PiFACE OUTPUT ON
#
# Copyright (C) 2014 Tim Massey
#
# 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... |
'''
Copyright 2015 Paul Sidnell
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
dis... |
from math import sin, floor
import numpy as np
import pytest
from devito import (Grid, Operator, Dimension, SparseFunction, SparseTimeFunction,
Function, TimeFunction,
PrecomputedSparseFunction, PrecomputedSparseTimeFunction,
MatrixSparseTimeFunction)
from d... |
from setuptools import setup, find_packages
from pip import get_installed_distributions
from sys import exit
PACKAGE = 'software'
NAME = 'P3DA'
DESCRIPTION = 'P3DA - RGB controller based on Arduino board'
AUTHOR = 'Bogdan Kalinin'
AUTHOR_EMAIL = 'bogdan.kalinin@gmail.com'
URL = 'https://github.com/elektro-NIK/P3DA'
VE... |
import os
import sys
import os.path
import ConfigParser
import collections
import traceback
import ast
from pyramid.httpexceptions import HTTPBadRequest
import logging
log = logging.getLogger(__name__)
class ConfigBase:
def __init__(self):
pass
def get(self, section, param, aslist=False):
... |
# Copyright 2012 Locaweb.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#
# (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AccountRequest'
db.create_table('lug_people_accountrequest', (
('id', self.gf('d... |
import py
import os, time, sys
from rpython.tool.udir import udir
from rpython.rlib.rarithmetic import r_longlong
from rpython.annotator import model as annmodel
from rpython.translator.c.test.test_genc import compile
from rpython.translator.c.test.test_standalone import StandaloneTests
posix = __import__(os.name)
def... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-03 15:18
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... |
# encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
def main():
colors = vtk.vtkNamedColors()
colors.SetColor("BkgColor", [26, 51, 102, 255])
parametricObjects = list()
parametricObjects.append(vtk.vtkParametricBoy())
parametricObjects.append(vtk.vtkParametricConicSpiral())
parametric... |
# -*- coding: utf-8 -*-
'''
Colony k-means clustering system logic.
'''
# This file is part of colony.
__author__ = 'Team Machine'
__doc__ = '''
#k-means algorithm
k-means clustering is a method of vector quantization,
popular for cluster analysis in data mining.
k-means clustering aims to par... |
from os import listdir
from os.path import isfile, join
import cv2
import numpy as np
import math
import time
from consine_simi import consine_similarity
from classify import classify
from MotionDetector import directionCalculate
cap = cv2.VideoCapture(0)
def setbg():
retval, im = cap.read()
avg1 = np.float... |
# -*- coding: utf-8 -*-
# Copyright 2016 Virantha Ekanayake 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 r... |
from __future__ import division
import numpy as np
from networkx import Graph, floyd_warshall_numpy
from ._base import Descriptor
from ._atomic_property import AtomicProperty, get_properties
from ._matrix_attributes import methods, get_method
__all__ = ("BaryszMatrix",)
class BaryszMatrixBase(Descriptor):
expl... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 7 18:09:24 2016
@author: nu
"""
from astropy.coordinates import SkyCoord
from astroquery.vizier import Vizier
from astropy import units as u
from astropy.table import Table
import numpy as np
import os, time
def reoffset(d2d, matches, Cdata, Ccata):
n = 0
while ... |
""" The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether relative imports work or don't, the script can autodetect
how this file was run. With pure Pyth... |
from swift.ipvl.inspect_custom import whoami, whosdaddy
pass # (WIS) print __name__
required_filters = [
{'name': 'catch_errors'},
{'name': 'gatekeeper',
'after_fn': lambda pipe: (['catch_errors']
if pipe.startswith('catch_errors')
else [])... |
#!/usr/bin/env python
# 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/.
# Copyright (c) 2017 Mozilla Corporation
#
# Contributors:
# Brandon Myers bmyers@mozilla.com
imp... |
# Thanks to http://www.acooke.org/cute/PurePython0.html for
# this part.
#!/usr/bin/python3
import binascii
from array import array
from struct import pack, unpack
def _pad(msg, fakeLen):
n = len(msg) if fakeLen is None else fakeLen
bit_len = n * 8
index = (bit_len >> 3) & 0x3f
pad_len = 120 - index
if index <... |
# Inspired by https://github.com/r0wb0t/markdown-urlize/blob/master/urlize.py
from __future__ import unicode_literals
from zmarkdown.inlinepatterns import Pattern as InlinePattern, sanitize_url, MAIL_RE
from zmarkdown import Extension, util
try: # pragma: no cover
from urllib.parse import urlparse
except I... |
import types
class Logger:
def __init__(self, filepath=None, is_stdout=True):
self._filepath = filepath
self._logfile = None
self._callbacks = {}
self._is_stdout = is_stdout
def start(self, text=''):
if self._filepath != None:
self._logfile = open(self._fi... |
#!/usr/bin/env python
import unittest
import socket
from framework import VppTestCase, VppTestRunner
from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsRoute, \
VppMplsIpBind, VppIpMRoute, VppMRoutePath, \
MRouteItfFlags, MRouteEntryFlags
from vpp_mpls_tunnel_interface import VppMPLSTunnelInterface
fr... |
from datetime import datetime
from open_weather_forecast.info_extractor.get_info import GetInfo
from open_weather_forecast.info_extractor.forecast.forecast_weather_info import Base, ForecastWeather, Temperature
from open_weather_forecast.conf.constants import WEATHER_DATE_FORMAT
class GetForecast(GetInfo):
def ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-27 08:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('account', '0014_auto_20171014_1523'),
... |
# Copyright (c) 2015 Universidade Federal Fluminense (UFF)
# Copyright (c) 2015 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
from __future__ import (absolute_import, print_function,
division, unicode_li... |
# -*- coding: utf-8 -*-
# Copyright (c) 2006 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Printer configuration page.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot
from .ConfigurationPageBase import ConfigurationPageBase
from .Ui_GraphicsPage impo... |
# ##### 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... |
#!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program 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; version 2.1 only.
#
# This program is distributed in the hope that it will be u... |
# python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
#!/usr/bin/python
import threading
import os
import hashlib
import time
MAX_THREADS = 5
thread_count = 0
tc_lock = threading.Lock()
def inc_count():
global thread_count
tc_lock.acquire()
thread_count += 1
tc_lock.release()
def dec_count():
global thread_count
tc_lock.acquire()
thread_cou... |
from operator import itemgetter,mul
import numpy as np
from netcdf import netcdf_file
import sys
from Scientific.IO import NetCDF
from ncdfextract import ncgettypecode
from ncdfproc import nccopydimension,nccopyattrvar
class SomeError(Exception):
def __init__(self, value):
self.value = value
def _... |
import os
import logging
import shlex
import re
import sys
import traceback
log = logging.getLogger("emk.c")
utils = emk.module("utils")
fix_path_regex = re.compile(r'[\W]+')
class _GccCompiler(object):
"""
Compiler class for using gcc/g++ to compile C/C++ respectively.
In order for the emk c modul... |
# -*- coding: utf-8 -*-
#
# 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 -*-
import time
from django.db.models import Q
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponseNotFound
from django.contrib.auth.hashers import make_password
from django.contrib.auth.hashers import check_password
from django.views.... |
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.module_loading import module_has_submodule
from importlib import import_module
class LegislatorsConfig(AppConfig):
name = 'legislators'
are_projects_editable = False
custom_feed_item_template = None
external_l... |
from __future__ import print_function # 2.X compatibility
class Set(list):
def __init__(self, value = []): # Constructor
list.__init__([]) # Customizes list
self.concat(value) # Copies mutable defaults
def intersect(self, other): # other is ... |
import os
import os.path
import subprocess
import argparse
import collections
import itertools
import time
import sys
GRAPHEMATIZER_PATH = os.path.normpath('../graphematizer')
TERMINAL_WIDTH = 80
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('test_set', help='Test set to run.')
arg_parser.add_argumen... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import time
import os
import filecmp
from webdriver_testing.webdriver_base import WebdriverTestCase
from webdriver_testing.pages.site_pages.teams import videos_tab
from webdriver_testing.pages.site_pages.teams.tasks_tab import TasksTab
from webdriver_testing.pages.s... |
import django
from django import forms, template
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext, ungettext, ugettext_lazy as _
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
from django.forms.formsets import all_valid
from django... |
"""Sample Wiki syntax extension plugin."""
from genshi.builder import tag
from trac.core import *
from trac.util.text import shorten_line
from trac.versioncontrol.api import NoSuchChangeset, RepositoryManager
from trac.versioncontrol.web_ui import ChangesetModule
from trac.wiki.api import IWikiSyntaxProvider
revisio... |
#!/usr/bin/python3
#
# Copyright (C) 2011 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list o... |
# ==================================================================================================
# Copyright 2015 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 09:29:01 2017
@author: Punyajoy Saha
"""
#!/usr/bin/env python
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
#
#import speech2
#
## say() speaks out loud.
#speech2.say("I am speaking out loud.")
#
## in... |
import os
from io import StringIO
# noinspection PyUnresolvedReferences
from instal.clingo import parse_term
from instal.instaljsonhelpers import dict_funs_to_list, trace_dicts_from_file
from instal.instalexceptions import InstalCompileError
class FactParser(object):
"""
FactParser
See __init__.p... |
"""
Class for handling configuration files for controller nodes
(c) 2015 Massachusetts Institute of Technology
"""
# Native
import socket
import logging
logger = logging.getLogger(__name__)
from time import sleep
# LO-PHI
import lophi.globals as G
# LO-PHI Automation
import lophi_automation.protobuf.helper a... |
'''
Created on 30/mag/2015
@author: koala
'''
import pygtk
pygtk.require('2.0')
import gtk
from gtk import gdk
import pango
from NoteModel import NoteModel
import noteBrowserWidget
import os
PROGRAM_NAME = "PGap"
class PGapMain:
columnInfo = ('Note title', 'ID', 'Creation Time', 'Last Modify')
def... |
import click
from sqlalchemy import create_engine
from kamcli.ioutils import ioutils_dbres_print
from kamcli.cli import pass_context
from kamcli.iorpc import command_ctl
@click.group(
"uacreg",
help="Manage uac remote registrations",
short_help="Manage uac registrations",
)
@pass_context
def cli(ctx):
... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, ButtonHolder, Submit
from crispy_forms.bootstrap import Field, InlineRadios, TabHolder, Tab
from django import forms
from . import models
from... |
import os, time
from datetime import datetime
from project import app
from pymongo import MongoClient
import pymongo
client = MongoClient(app.config['MONGO_URI'])
db = client[app.config['MONGO_DBNAME']]
collection = db.images_collection
def save_file_in_db(filename, created_at, uid=-1, caption=''):
count = coll... |
##############################################################################
#
# Copyright (c) 2002, 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... |
# -*- coding: utf-8 -*-
"""
Map
------
Classes for drawing maps.
"""
from __future__ import unicode_literals
import json
from collections import OrderedDict
from jinja2 import Environment, PackageLoader, Template
from branca.six import text_type, binary_type
from branca.utilities import _parse_size
from branca.e... |
from sqlalchemy import Column, Integer, String, LargeBinary, \
Float
from sqlalchemy.orm import relationship, backref
from snailmail.database import Base
from snailmail.models import secure_pass
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key = True,nullable=False,
... |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
""" smashlib.plugins.env_command
"""
import os
from smashlib import get_smash
from smashlib.plugins import Plugin
from smashlib.patches.base import PatchMagic
from smashlib.completion import smash_env_complete
env_completer = lambda himself, event: smash_env_complete(event.symbol)
env_regex = r'env [A-Za-z0-9_]+$'
cl... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... |
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.core.mysql import EEMysql
from ee.core.logging import Log
from ee.core.variables import EEVariables
from ee.core.aptget import EEAptGet
from ee.core.shellexec import EEShellExec
from ee.core.apt_repo import EER... |
####################################################################################################
import PySpice.Logging.Logging as Logging
logger = Logging.setup_logging()
####################################################################################################
from PySpice.Spice.NgSpice.Shared import... |
"""
SynologyChat platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.synology_chat/
"""
import json
import logging
import requests
import voluptuous as vol
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL
... |
from decimal import Decimal
from pxp.exception import OperatorError
from pxp.function import FunctionArg, FunctionList, InjectedFunction
from pxp.stdlib.types import number_t, string_t, boolean_t
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Number Operators
def op_number_add(reso... |
from pylab import *
import re
import inspect
from pp_utils import *
formatter = matplotlib.ticker.EngFormatter(places=3)
formatter.ENG_PREFIXES[-6] = 'u'
def scatterplot_RplRootMultiTransparentBridge_400x(results):
print "scatterplot_RplRootMultiTransparentBridge_400x"
data = {}
ncol = 4
nrow = 3
... |
# Copyright (c) 2011, HIT Information-Control GmbH
# 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,... |
""" Set of classes and methods specific to Siemens scanning environments
"""
from __future__ import print_function
from __future__ import division
import os
from os.path import join
import sys
import time
import re
import json
import glob
import logging
from threading import Thread
from queue import Queue
import num... |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import os
# project
from tests.checks.common import AgentCheckTest, Fixtures
DEPLOYMENT_METRICS_CONFIG = {
'init_config': {
'default_timeout': 5
},
'instances': [
{
... |
"""ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class inetutils(ShutItModule):
def is_installed(self, shutit):
return shutit.file_exists('/root/shutit_build/module_record/' + self.module_id + '/built')
def build(self, shutit):
shutit.send('mkdir -p /tmp/build/inetutils')
... |
# -*- coding: utf-8 -*-
"""
mcmc_difussion.py: Provides facilities for Markov-Chain Monte Carlo
integration to convolute an arbitrary function with an isotropic gaussian
kernel of varying width (σ), to implement a technique called coarse to
fine smoothing[1].
[1]: J. Mobahi and J. W. Fished: On the Link Between Gauss... |
# Django settings for gestionale project.
from local_settings import *
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django ... |
import numpy
import os
import time
from collections import defaultdict
import sasmol.sasmol as sasmol
try:
dummy = os.environ["DISPLAY"]
except:
# allows for creating plots without an xserver
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def com_clustering(pdb_file_name, dcd... |
from __future__ import division, print_function
import random
__author__ = 'panzer'
def has_duplicates(lst):
"""
Computes if a list has duplicate elements
:param lst: List to check in
:return: True if it contains duplicate, else false
"""
if lst is None or not len(lst):
return False
... |
from billy.utils.fulltext import text_after_line_numbers
import lxml.html
from .bills import ILBillScraper
from .legislators import ILLegislatorScraper
from .committees import ILCommitteeScraper
from .events import ILEventScraper
metadata = {
'abbreviation': 'il',
'name': 'Illinois',
'legislature_name': 'I... |
import os
import zlib
from collections import MutableSequence, Iterable, Sequence, Sized
from itertools import chain
from numbers import Real
import operator
from functools import reduce
from warnings import warn
import numpy as np
import bottlechest as bn
from scipy import sparse as sp
from .instance import *
from O... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# mycodoPID.py - Discrete PID Controller for Mycodo
#
# Copyright (c) 2010 cnr437@gmail.com
#
# Licensed under the MIT License <http://opensource.org/licenses/MIT>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associat... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
from google.appengine.api import users
class GoogleAccountBackend(ModelBackend):
"""
backend for authentication via Google Accounts on Google
App Engine
A Django auth.co... |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from babel.dates import format_date... |
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of pydc1394.
#
# pydc1394 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 version 3 of the
# License, or (at your option) any later v... |
"""Test functions for simbad.db"""
__author__ = "Adam Simpkin"
__date__ = "19 Jan 2018"
import os
import unittest
import simbad
import simbad.db
try:
ROOT_DIR = SHARE_DIR = os.environ['SIMBAD_ROOT']
EXAMPLE_DIR = os.path.join(ROOT_DIR, "test_data")
except KeyError:
from simbad.command_line import CCP4Roo... |
#! /usr/bin/python
########################################################################
# SpeakThis speaks the currently highlighted text using espeak.
# Copyright (C) 2013 Carl J Smith
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... |
ARCTIC_SITE_NAME = 'Arctic Example'
# Menu format:
# (('menu label', 'named url', 'optional icon class', (optional submenu)))
ARCTIC_MENU = (
('Dashboard', 'index', 'fa-dashboard'),
('Articles', 'articles:list', 'fa-file-text-o', (
('List', 'articles:list'),
('Create', 'articles:create'),
)... |
##################################################
# Solution for prob 6b, President's office
# finished, on test 20
#
# This problem counts the number of desks that share a side with the president's desk(known as his associates).
##################################################
layout = []
prezDeskY = []
prezDeskX ... |
""" Helper for /Registry section
"""
from DIRAC import S_OK, S_ERROR
from DIRAC.ConfigurationSystem.Client.Config import gConfig
from DIRAC.ConfigurationSystem.Client.Helpers.CSGlobals import getVO
__RCSID__ = "$Id$"
# pylint: disable=missing-docstring
gBaseRegistrySection = "/Registry"
def getUsernameForDN( dn, u... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 19 17:36:35 2017
@author: asadm2
"""
### DESCRIPTION
#This script carries out an exposure time check and an "at least 2 filters"
#check
import pandas as pd
import numpy as np
def expfil2(objname,revtxt):
"""
This function carries out an exposure time check an... |
"""
pytelemeter config file handler
"""
import os
import sys
import ConfigParser
from parser import Account
# exceptions
class ConfigError(Exception): pass
class MissingConfigFile(ConfigError): pass
class MalformedConfigFile(ConfigError): pass
class StockCredentials(ConfigError): pass
class NoSuchAccount(ConfigEr... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import argparse
import netCDF4 as nc
import numpy as np
from lib_mean import create_output_file, calc_overall_mean
"""
What this script does:
Calculate overall means.
How to run this script:
./overall_mean.py 01/ocean.nc 02/ocean.nc ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012, The Honeynet Project. All rights reserved.
# Author: Kun Yang <kelwya@gmail.com>
#
# APKIL is free software: you can redistribute it and/or modify it under
# the terms of version 3 of the GNU Lesser General Public License as
# published by the Free Soft... |
import mraa
import time
from multiprocessing import Queue,Process
import move_avge
NUM_INCOME_BYTE = 8
CHAR_PRELIM = 0x40
NUM_DATA_BYTE = 7
CHECK_BYTE = 7
PM1_BYTE = -1
PM25_BYTE = 3
PM10_BYTE = 5
class sensor(Process):
def __init__(self, q):
Process.__init__(self)
self.q = q
s... |
"""
Test the 'register' command.
"""
from __future__ import print_function
import os
import sys
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class RegisterCommandsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
N... |
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.conf import settings
from django import forms
from MySQLdb import IntegrityError
from commons.utils im... |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... |
import logging
import os
from flask import Flask
from flask_login import LoginManager
from config import config
from kconfig import settings
__author__ = 'Manuel Escriche'
login_manager = LoginManager()
# login_manager.session_protection = 'strong'
login_manager.login_view = 'auth.login'
login_manager.login_message =... |
from faker import Faker
import click
from app.database import db
from app.user.models import User
@click.option('--num_users', default=5, help='Number of users.')
def populate_db(num_users):
"""Populates the database with seed data."""
fake = Faker()
users = []
for _ in range(num_users):
user... |
#!/usr/bin/env python
#
# pKa - various programs and scripts for pKa value analysis, calculation and redesign
# Copyright (C) 2010 Jens Erik Nielsen
#
# 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 Foundat... |
"""Base class for sparse matrix formats using compressed storage
"""
__all__ = []
from warnings import warn
import numpy as np
from base import spmatrix, isspmatrix, SparseEfficiencyWarning
from data import _data_matrix
import sparsetools
from sputils import upcast, upcast_char, to_native, isdense, isshape, \
... |
import asyncio
import bot
from bot import utils
from typing import List, Optional, Union # noqa: F401
from lib.data import Send
from lib.data.message import Message
from lib.database import DatabaseMain
async def come(channel: str,
send: Send) -> bool:
bannedWithReason: Optional[str]
priority... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Library with tools related to tesseract
"""
__author__ = 'Jiang Yunfei'
__version__ = '0.1'
__date__ = '2015.04'
import os
import sys
import ctypes
from ctypes.util import find_library
from itertools import count
LIBPATH = '/usr/local/lib/'
VERSION = ''
# Define Page It... |
import numpy as np
import scipy.ndimage as nd
from signal_id import RadioMask, Noise
from radio_beam import Beam
import astropy.units as u
from astropy.io import fits
from astropy.extern import six
import astropy
from skimage.morphology import reconstruction
'''
Routines for constructing a robust clean mask.
1) Pick... |
from polynomial import Poly
def LexPoly(*args):
"""Returns a polynomial with lexicographic order of terms. """
return Poly(*args, **{ 'order' : 'lex' })
from algorithms import poly_div, poly_pdiv, poly_groebner, poly_lcm, poly_gcd, \
poly_half_gcdex, poly_gcdex, poly_sqf, poly_resultant, poly_subresultan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.