src stringlengths 721 1.04M |
|---|
import shelve
import networkx as nx
import pandas as pd
import numpy as np
import math
import os
import sys
import re
import argparse
import traceback
import net_metrics as metrics
from glob import glob
__version__ = "0.1.0"
__author__ = ['Salvador Aguinaga']
# alchemee analyze the BTER generated graphs
def get_bas... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------------------------------
# OpenSeaMap API - Web API for OpenSeaMap services.
#
# Written in 2012 by Dominik Fässler dfa@bezono.org
#
# To the extent possible under law, the author(s) have dedicated... |
import attr
from navmazing import NavigateToAttribute
from widgetastic.widget import Text
from . import AddTabView
from . import TabForm
from .dialog_box import BoxCollection
from cfme.modeling.base import BaseCollection
from cfme.modeling.base import BaseEntity
from cfme.modeling.base import parent_of_type
from cfme.... |
# coding=utf8
# Copyright (c) 2016 CineUse
import os
import shutil
import logging
import cgtk_log
log = cgtk_log.cgtk_log(level=logging.INFO)
def delete_folder(src):
"""
Deletes all files from inside a folder
.. warning::
This will delete all files in the folder specified
Args:
sr... |
#!/usr/bin/python3
# coding: utf-8
import os
import string
import sys
import time
try:
import serial
except ImportError:
print("Error importing pyserial. Please check if it is installed.")
sys.exit(1)
class Uploader(object):
"""Uploads a XSVF file to the arduino board.
"""
# Create a transl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2019 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU ... |
# Brachyprint -- 3D printing brachytherapy moulds
# Copyright (C) 2013-14 James Cranch, Martin Green and Oliver Madge
#
# 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 ve... |
# -*- coding: utf-8 -*-
# dcf
# ---
# A Python library for generating discounted cashflows.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.4, copyright Saturday, 10 October 2020
# Website: https://github.com/sonntagsgesicht/dcf
# License: Apache License 2.0 (see LICENSE f... |
# rlSimpleGameFeatures.py - Feature-based Reinforcement Learner
# AIFCA Python3 code Version 0.7.1 Documentation at http://aipython.org
# Artificial Intelligence: Foundations of Computational Agents
# http://artint.info
# Copyright David L Poole and Alan K Mackworth 2017.
# This work is licensed under a Creative Commo... |
from django.utils.timezone import utc
from django_db_utils import pg_bulk_update
from example.models import Sample, SampleStatus
def now():
from datetime import datetime
return datetime.utcnow().replace(tzinfo=utc)
def make_fake_data(samples_to_make=100000, batch_threshold=100000, delete_existing=True, ma... |
from ..core import AtomicExpr, Integer, Pow
from ..matrices import ImmutableMatrix
from .basisdependent import (BasisDependent, BasisDependentAdd,
BasisDependentMul, BasisDependentZero)
class Dyadic(BasisDependent):
"""
Super class for all Dyadic-classes.
References
=====... |
# Django settings for mailshare project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'... |
# -*- coding: utf-8 -*-
import unittest
from django.test.client import Client
class PlanTests(unittest.TestCase):
def setUp(self):
self.c = Client()
self.plan_id = 2256
self.status_codes = [301, 302]
def test_plans(self):
response = self.c.get('/plans/')
try:
... |
import os
import sys
from re import search
from gitconfig.config import (
ConfigDict,
ConfigFile,
)
if sys.version_info < (2, 7):
from ordereddict import OrderedDict
from collections import MutableMapping
else:
from collections import (
OrderedDict,
MutableMapping,
)
c... |
# -*- 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 unique constraint on 'Repo', fields ['full_name']
db.create_unique('base_repo', ['full_name'])
... |
from math import sin
from random import randint, random
from cycgkit.cgtypes import vec3
from _base._BaseDemo import _Demo_Base, runDemo, tubeMODEL, logLevelsEnum
class Demo(_Demo_Base):
def __init__(self):
super(Demo, self).__init__()
self.texturesToLoad = [['e3dlogo.png', 'logo'], ['./textures... |
"""Unit tests for FrameSetNodeNameRequest."""
import unittest
from pyvlx.api.frame_creation import frame_from_raw
from pyvlx.api.frames import FrameSetNodeNameRequest
class TestFrameSetNodeNameRequest(unittest.TestCase):
"""Test class FrameSetNodeNameRequest."""
# pylint: disable=too-many-public-methods,inv... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-09-24 11:49
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import taiga.projects.settings.choices
class Migration(migrations.Mi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: ogr_csv.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test OGR CSV driver functionality.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
######... |
"""Support for Gogogate2 garage Doors."""
from typing import Callable, List, Optional
from gogogate2_api.common import get_configured_doors
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import DEVICE_CLASS_BATTERY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.... |
"""
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
from __future__ import absolute_import
import numpy
def get_random_random(random = numpy.random):
"""
Get a randomly-initialized PRNG.
"""
from numpy.random import RandomState
return RandomState(random.randint(numpy.iinfo(int).max))
def r... |
"""Support for Apple TV media player."""
import logging
from pyatv.const import DeviceState, FeatureName, FeatureState, MediaType
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
MEDIA_TYPE_TVSHOW,
MEDIA_TYPE_VI... |
from rest_framework import serializers
from projects.models import Project, Category
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields = [
'id', 'name', 'organization'
]
def create(self, validated_data):
return Project.objects... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ComputeResourceConfigInfo(vim, *args, **kwargs):
'''Configuration of the compute reso... |
"""This module tests GET requests to the Cloud Sumamry Record endpoint."""
import logging
import MySQLdb
from api.utils.TokenChecker import TokenChecker
from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from mock import patch
QPATH_TEST = '/tmp/django-test/'
class CloudRecordSum... |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os, random
random.seed(0)
from... |
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import itertools
import json
import os
import re
import shutil
import tempfile
import time
import unittest
import urllib
# Find the best implementation available
try:
from cStringIO import StringIO
except I... |
# coding=utf-8
# Copyright 2021 The init2winit 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 la... |
# -*- coding: utf-8 -*-
# Copyright(C) 2016 Julien Veyssier
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... |
# (c) 2015, Yannig Perre <yannig.perre(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... |
# Copyright (c) 2012 Gursev Singh Kalra McAfee, Foundstone
#
# This class contains information for all CAPTCHA providers that this tool targets
# 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; e... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ParametersPanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
(C) 2013 by CS Systemes d'information (CS SI)
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2013, Cameron White
#
# PyGithub 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
# S... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
LAStoolsUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... |
# -*- coding: utf-8 -*-
#
# Intern Checklist 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 valu... |
"""
Provides an APIView class that is the base of all views in REST framework.
"""
from __future__ import unicode_literals
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.utils.datastructures import SortedDict
from django.views.decorators.csrf import csrf_exempt
from res... |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from .models import Question, Choice
# Create your views here.
class IndexView(generic.ListView):
template_name = 'polls/inde... |
# downscale the prepped cmip5 data used in running the TEM model (IEM)
# author: Michael Lindgren
if __name__ == '__main__':
import glob, os, rasterio, itertools
from functools import partial
import downscale
from downscale import preprocess
import numpy as np
import argparse
# # parse the commandline argument... |
# -*- encoding: utf-8 -*-
__author__ = 'kotaimen'
__date__ = '5/29/14'
"""
georest.geo
~~~~~~~~~~~
This package provides GeoJson a-like Feature data model.
Various python geo packages:
- Geometry Engine:
- shapely
- geos
- osgeo.ogr
- django.contrib.gis.geos
... |
#!/usr/bin/env python
import re
import os
import pdb
configs_dir = 'config'
id_files = {}
idre = re.compile(r'(?P<id>\d+)', re.I|re.DOTALL)
# item_line_re = re.compile(r'I:(?P<itemname>.+?)=(?P<itemid>\d+)')
# add hack for advancedmachine block for config\AdvancedMachines.cfg
# add hack to search for config\EnderSt... |
def nextClosestTime(input_time):
def get_digits(time):
return (
int(time[0]),
int(time[1]),
int(time[3]),
int(time[4]))
def is_valid_time(time):
hour = time[0] * 10 + time[1]
if hour > 23:
return False
minute = time[2] ... |
from scipy import interpolate
from ParallelTempering import ParallelTemperingSampler
class AdaptiveParallelTemperingSampler(ParallelTemperingSampler):
"""
Adaptive setting of the temperatures via
Katzgraber, H. G., Trebst, S., Huse, D. A., & Troyer, M. (2006). Feedback-optimized parallel tempering monte... |
# --------------------------------------------------------
# Fully Convolutional Instance-aware Semantic Segmentation
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Haozhi Qi, Guodong Zhang
# --------------------------------------------------------
# Based on:
# ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright 2017 Esrille 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 requir... |
"""
Configuration reader and defaults.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011)
"""
import os
import configparser
from opennsa import constants as cnt
# defaults
DEFAULT_CONFIG_FILE = '/etc/opennsa.conf'
DEFAULT_LOG_FILE = '/var/log/opennsa.log'
DEFAULT_TLS ... |
import unittest
from conans.test.utils.tools import TestClient
class ConanfileErrorsTest(unittest.TestCase):
def copy_error_test(self):
client = TestClient()
conanfile = '''
from conans import ConanFile
class HelloConan(ConanFile):
name = "Hello"
version = "0.1"
exports = "*"
de... |
# ---------------------------
# py_suzanne 1.0
# Arnaud Juracek
# github.com/arnaudjuracek
import RPi.GPIO as GPIO
import glob, pygame, time, os, random
# --------------------------
# startup notification
print 'py_suzanne started'
os.system('omxplayer data/hello_world.aiff')
# --------------------------
# GPIO sett... |
# -*- coding: utf-8 -*-
__all__ = ('add', 'get', 'remove', )
from django.contrib.auth.decorators import user_passes_test
from django.views.decorators.http import require_GET, require_POST
from django.utils import simplejson as json
from forms import AddLinkReferenceForm, BasicValidationForm
from models import create... |
#!/usr/bin/env python
#
# Generate tables for GroupVarint32
# Copyright 2011 Facebook
#
# @author Tudor Bosman (tudorb@fb.com)
#
# Reference: http://www.stepanovpapers.com/CIKM_2011.pdf
#
# From 17 encoded bytes, we may use between 5 and 17 bytes to encode 4
# integers. The first byte is a key that indicates how many ... |
import string
TRANSACTION_CODES = ('13', ) + tuple((str(i) for i in range(50, 58)))
def record_type(all_lines, line_num):
# character 0
line = all_lines[line_num]
if line[0] != '1':
return "The zeroth character in a detail record must be '1', was '{}'".format(line[0])
return None
def bsb_nu... |
# @OpService ops
# @Dataset data
# @UIService ui
# @OUTPUT ImgPlus c0
# @OUTPUT ImgPlus z12
# @OUTPUT ImgPlus c0z12
# @OUTPUT ImgPlus roiC0z12
# to run this tutorial run 'file->Open Samples->Confocal Series' and make sure that
# confocal-series.tif is the active image
from net.imglib2.util import Intervals
from net.i... |
import os
import inspect
import sys
import shutil
import glob
from tempfile import mkdtemp
# First clear away any configurations and temp files which may not be present on first launch
homeDir = os.path.expanduser("~")
if os.path.exists(os.path.join(homeDir, '.gangarc')):
os.unlink(os.path.join(homeDir, '.gangarc... |
"""Test code for iiif.generators.check."""
import unittest
from iiif.generators.check import PixelGen
class TestAll(unittest.TestCase):
"""Tests."""
def test01_size(self):
"""Test size."""
gen = PixelGen()
self.assertEqual(len(gen.size), 2)
self.assertEqual(int(gen.size[0]), ... |
from nose.tools import *
from django.http import QueryDict
from qualitio.core.tests.utils import BaseTestCase
from qualitio.store.models import TestCase as StoreTestCase
from qualitio import filter as filterapp
# params construction:
# group_id - form_class_id - form_id - field_name
class BuildingFormsFromParamsT... |
from rest_framework.relations import HyperlinkedRelatedField
from drf_queryfields import QueryFieldsMixin
from api.models import *
from rest_framework import serializers
from api.utils.custom_serializers import TimeStampField
class AgencySerializer(QueryFieldsMixin, serializers.HyperlinkedModelSerializer):
typ... |
#!/usr/bin/env python3
from gi.repository import Gtk
from gi.repository import Pango
from datetime import datetime
from datetime import timedelta
DATE_FORMAT = '%d %B %Y'
DATE_FORMAT_ORDER = '%Y %m %d'
MAX_LABEL_SIZE = 30
class ShowLatestWindow(Gtk.Window):
def __init__(self, interface):
self.interface =... |
# ubuntuone.status.messaging - Messages to the user
#
# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
#
# Copyright 2011 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: envoy/config/filter/http/authn/v2alpha1/config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goog... |
"""
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... |
from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.template.backends.jinja2 import Jinja2
from django.template.loader import render_to_string
from django.test import RequestFactory
from django.utils import translation
fro... |
# -*- coding: utf-8 -*-
import random
adjectives = [
"admiring",
"adoring",
"agitated",
"angry",
"backstabbing",
"berserk",
"boring",
"clever",
"cocky",
"compassionate",
"condescending",
"cranky",
"desperate",
"determined",
"distracted",
"dreamy",
"dr... |
from __future__ import absolute_import
__all__ = [
"IntegrationInstallation",
"IntegrationFeatures",
"IntegrationProvider",
"IntegrationMetadata",
"FeatureDescription",
]
import logging
import six
import sys
from collections import namedtuple
from enum import Enum
from sentry.exceptions import I... |
"""
sentry.models.user
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
import warnings
from bitfield import BitField
from django.contrib.auth.models import AbstractBas... |
#!/usr/bin/env python
#
# Copyright 2005,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 opt... |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... |
import csv
import matplotlib.pyplot as plt
import cv2
import numpy as np
from sklearn.utils import shuffle
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda, Convolution2D, Cropping2D, Dropout, SpatialDropout2D
IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNELS = 160, 320, 3
INPUT_SHAPE = (IMA... |
# encoding: utf-8
"""
configuration.py
Created by Thomas Mangin on 2011-11-29.
Copyright (c) 2011-2013 Exa Networks. All rights reserved.
"""
# NOTE: reloading mid-program not possible
import os
import sys
import logging
import pwd
_application = None
_config = None
_defaults = None
class ConfigurationError (Exce... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-03-22 19:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0006_auto_20180320_1607'),
]
operations = [
migrations.AlterField... |
from django.conf.urls import url, include
from django.contrib import admin
from game.views import *
from rest_framework.routers import DefaultRouter
from django.contrib.auth.views import login, logout
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^register/', CreateUserView.as_view()),
... |
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pylab
########################################################################
# 2017 - Manny Grewal
# Purpose of this class is to visualise a list of images from the CIFAR dataset
# How many columns to show... |
##########################################################################
# Ganga Project. https://github.com/ganga-devs/ganga
#
##########################################################################
from GangaCore.GPIDev.Schema import Schema, Version, SimpleItem
from GangaCore.Utility.Config import getConfig
from... |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... |
import sys
import os
from spec import eq_, skip, Spec, raises, ok_, trap
from invoke.runner import Runner, run
from invoke.exceptions import Failure
from _utils import support, reset_cwd
def _run(returns=None, **kwargs):
"""
Create a Runner w/ retval reflecting ``returns`` & call ``run(**kwargs)``.
"""... |
def create_boot_properties_file(directory_path, file_name, username, password):
server_dir = File(directory_path)
server_dir.mkdirs()
full_file_name = directory_path + '/' + file_name
file_new = open(full_file_name, 'w')
file_new.write('username=%s\n' % username)
file_new.write('password=%s\n'... |
import GenerateurEntrees
import Intersection
import SimulationManager
import Troncon
import Coordonnees
import Vehicule
def charger_simulateur():
longueur_troncon = 5000
sm = SimulationManager.SimulationManager(5)
gen_sud = GenerateurEntrees.GenerateurEntrees([[1 , 20]])
sm.add_listener(gen_sud)
... |
from collections import namedtuple
import struct
PUBLICKEYSTRUC = namedtuple('PUBLICKEYSTRUC', 'bType bVersion aiKeyAlg') # reserved is skipped when unpacking
PUBLICKEYSTRUC_s = struct.Struct('<bb2xI')
PRIVATEKEYBLOB = namedtuple('PRIVATEKEYBLOB', 'modulus prime1 prime2 exponent1 exponent2 coefficient privateExponent... |
import os
from configurations import Configuration
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
class Common(Configuration):
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Jon Payne', 'paynejd@gmail.com'),
('PK Shiu', 'pk@pkshiu.com'),
)
MANAGERS = ADMINS
DEFAULT... |
import dataclasses
from typing import Any, Dict, Optional
import torch
class Trainer:
@dataclasses.dataclass
class Config:
epochs: int = 1
max_steps: Optional[int] = None
eval_interval: Optional[int] = None
max_grad_norm: Optional[float] = None
def __init__(self, model, o... |
# ----------------------------------------------------------------------------
# Copyright (c) 2015--, ghost-tree development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this software.
# ------------------------------------------------... |
"""
Preprocessing for resting-state anaylsis
See the docstring for get_preproc_workflow() for more information.
"""
import nipype.interfaces.io as io
import nipype.interfaces.fsl as fsl
import nipype.interfaces.freesurfer as fs
import nipype.interfaces.utility as util
import nipype.pipeline.engine as pe ... |
import textwrap
import re
import subprocess
import os
import errno
class LatexDocument:
def __init__(self, filename):
self.filename = filename
self.ext = "tex"
self.preambleTemplate = self.prepareLatex(r"""
\documentclass[12pt, a4paper]{article}
% Font ... |
from distill import PY3
class Response(object):
def __init__(self, status="200 OK", headers=None):
"""Initializes an empty response"""
self.status = status
if headers is None:
headers = {}
self.headers = headers
self.body = None
self.file = None
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Story',
fields=[
('id', models.AutoField(verbos... |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from taggit.managers import TaggableManager
from opps.core.models import Publishable, BaseBox, BaseConfig
class Infograph... |
"""
The "engine room" of django mailer.
Methods here actually handle the sending of queued messages.
"""
from django.utils.encoding import smart_str
from django_mailer import constants, models, settings
from lockfile import FileLock, AlreadyLocked, LockTimeout
from socket import error as SocketError
import logging
im... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under... |
# 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... |
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from heufybot.config import Config
from heufybot.factory import HeufyBotFactory
from heufybot.modulehandler import ModuleHandler
from heufybot.utils.timeutils import now
import os, shelve, sys
# Try to enable SSL support
try:
from t... |
"""
Computational Neurodynamics
Exercise 1
Simulates Izhikevich's neuron model using the Runge-Kutta 4 method.
Parameters for regular spiking, fast spiking and bursting
neurons extracted from:
http://www.izhikevich.org/publications/spikes.htm
(C) Murray Shanahan et al, 2016
"""
import numpy as np
import matplotlib.... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... |
# encoding: utf-8
from __future__ import unicode_literals
from functools import wraps
import requests
import xmltodict
class PagseguroApiError(Exception):
pass
class PagseguroClient(object):
HTTP_METHODS = ['get', 'post']
API = 'https://ws.pagseguro.uol.com.br'
API_SANDBOX = 'https://ws.sandbox.p... |
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple... |
from random import sample
from discoutils.thesaurus_loader import Thesaurus
class DummyThesaurus(Thesaurus):
"""
A thesaurus-like object which return "b/N" as the only neighbour of every possible entry
"""
name = 'Constant'
def __init__(self):
pass
def get_nearest_neighbours(self, fe... |
# Uses acf method to measure rotation periods for downloaded everest light
# curves.
import numpy as np
import matplotlib.pyplot as plt
import pyfits
from Kepler_ACF import corr_run
import os
from simple_acf import simple_acf
import sys
from multiprocessing import Pool
import pandas as pd
import glob
import astropy.st... |
""" Cisco_IOS_XR_infra_syslog_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR infra\-syslog package operational data.
This module contains definitions
for the following management objects\:
logging\: Logging History data
syslog\: syslog
Copyright (c) 2013\-2015 by Cisco Systems, Inc... |
#!/usr/bin/env python3
"""
Delete old deployments and services with test-prefixed names. This is used to
clean up the Telepresence test cluster, as Telepresence tests currently leak.
"""
import argparse
import json
from datetime import datetime, timedelta, timezone
from subprocess import check_output, run
from typing ... |
# Generated by Django 2.2.1 on 2019-05-23 03:36
from django.db import migrations, models
import django.db.models.deletion
import django_tenants.postgresql_backend.base
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#from __future__ import unicode_literals
import hashlib
import hmac
import os
import json
import utils as u
import widget as W
import logging
from base64 import urlsafe_b64encode\
, urlsafe_b64decode
class Base64Error (Exception):
'''invalid Base64 chara... |
#!/usr/bin/env python
import sys
import logging
import argparse
from cpt_gffParser import gffParse, gffWrite
from gff3 import feature_lambda, feature_test_qual_value
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
def gff_filter(gff3, id_list=None, id="", attribute_field="ID", subfeatures=T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.