text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
'''
Generates SIPS by calling various microservices and functions.
'''
import os
import argparse
import ififuncs
import sys
import shutil
import subprocess
import time
from masscopy import analyze_log
def make_folder_path(path):
'''
Generates objects/logs/metadata/UUID folder structure i... |
##
# See the file COPYRIGHT for copyright information.
#
# 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... |
# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2008,2009,2010,2011,2012 Contributor
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the EU DataGrid Software License. You should
# have received a copy... |
import datetime
from flask import json
from nose.tools import assert_equal, assert_in
from dateutil.parser import parse as parse_time
from freezegun import freeze_time
from ..helpers import BaseApplicationTest, JSONUpdateTestMixin
from app.models import db, Framework, SupplierFramework, DraftService, User, FrameworkL... |
package_info = "Python systemd wrapper"
version_info = (0, 10, 0)
author_info = (
('Dmitry Orlov', 'me@mosquito.su'),
)
author_email = ", ".join("{}".format(info[1]) for info in author_info)
license = "Apache"
__version__ = ".".join(str(x) for x in version_info)
__author__ = ", ".join("{} <{}>".format(*info) f... |
VERSION = (0, 1, 0, 'planning', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%... |
# -*- coding: utf-8 -*-
import autograd.numpy as np
from autograd.numpy import exp, log
from scipy.special import gammainccinv, gammaincinv
from autograd_gamma import gammaincc, gammainc, gammaln, gammainccln, gammaincln
from lifelines.fitters import KnownModelParametricUnivariateFitter
from lifelines.utils import Cens... |
# -*- coding: utf-8 -*-
from datetime import date
from decimal import Decimal
from requests import Response
YAHOO_RESPONSE = b"""
{
"spark":{
"result":[
{
"symbol":"NOK=X",
"response":[
{
"meta":{
"currency":"NOK",
... |
from datetime import datetime, timedelta
from conftest import read_files
from fs.base import FS
from organize import core
from organize.filters import LastModified
def test_min():
now = datetime.now()
lm = LastModified(days=10, hours=12, mode="older")
assert not lm.matches_datetime(now - timedelta(days=... |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
__version__ = "0.2.4"
|
#!/usr/bin/env python3
"""Mininet tests for FAUCET."""
# pylint: disable=too-many-lines
# pylint: disable=missing-docstring
# pylint: disable=too-many-arguments
# pylint: disable=unbalanced-tuple-unpacking
import binascii
import collections
import copy
import itertools
import ipaddress
import json
import os
import r... |
import json
from prettytable import PrettyTable
from .board import TarraschBoard, TarraschNoBoardException
from .config import MESSAGE_PREFIX as MP
from .database import singleton as db
# Used to get a game going, since we require multiple user
# inputs to do this we need to save some state in memory
# between those... |
#!/usr/bin/python
# extracts information about the external displays from system profiler
import sys
import os
import subprocess
import plistlib
import datetime
import time
# Skip manual check
if len(sys.argv) > 1:
if sys.argv[1] == 'manualcheck':
print 'Manual check: skipping'
exit(0)
# Create cache dir i... |
# Copyright 2016 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 ag... |
# -*- coding: utf-8 -*-
# Import python libs
import os
import shutil
# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
import salt.utils
from salt.modules.virtualenv_mod import KNOWN_BINARY_NAM... |
"""
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import asyncio
import queue
import sched
import threading
import time
from .singleton import Singleton
clas... |
### Creates Hansen-style tiles for aboveground mangrove biomass (Mg/ha) from Lola Fatoyinbo's country
### mangrove data.
### Output tiles conform to the dimensions, resolution, and other properties of Hansen loss tiles.
import multiprocessing
import utilities
import mangrove_processing
import subprocess
import os
# #... |
# coding: utf-8
# Copyright (C) 2012 Mantas Zimnickas <sirexas@gmail.com>
#
# This file is part of manoseimas.lt project.
#
# manoseimas.lt 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 versi... |
from tests.base import BaseTopazTest
from topaz.objects.classobject import W_ClassObject
from topaz.modules.ffi.function import W_FunctionObject
from rpython.rlib import clibffi
libm = clibffi.CDLL('libm.so')
class TestFunction(BaseTopazTest):
def test_type_unwrap(self, space):
w_type_object = space.exec... |
#!/usr/bin/python3
from hub import HubBot
import traceback
import itertools
import sys
import os
import select
import threading
import subprocess
import tempfile
import logging
import calendar
import abc
import smtplib
from datetime import datetime, timedelta
import email.message
import email.mime.text
import email.m... |
#! /usr/bin/env python
#
# ===============================================================
# Description: Reachability benchmark
#
# Created: 2014-03-21 13:39:06
#
# Author: Ayush Dubey, dubey@cs.cornell.edu
#
# Copyright (C) 2013-2014, Cornell University, see the LICENSE
# ... |
import getpass
import json
import os
import re
import shutil
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory
import pytest
import yaml
from jsonschema import validate
import Pegasus
from Pegasus.api.errors import DuplicateError, NotFoundError, PegasusError
from Pegasus.api.mixins ... |
import unittest
from prometheus_es_exporter.indices_stats_parser import parse_response
from tests.utils import convert_result
# Sample responses generated by querying the endpoint on a Elasticsearch
# server populated with the following data (http command = Httpie utility):
# > http -v POST localhost:9200/foo/bar/1 ... |
from __future__ import absolute_import, unicode_literals
import json
import plivo
import pycountry
import regex
from collections import OrderedDict
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth... |
from overrides import overrides, EnforceOverrides
class A(EnforceOverrides):
def methoda(self, x=0):
print(x)
def test_should_pass():
class B(A):
@overrides
def methoda(self, y=1, **kwargs):
print(y)
super().methoda(**kwargs)
def test_can_not_override_with_po... |
import os, re, time, sys, subprocess, html, json, tempfile, traceback
from copy import deepcopy
from lxml import etree
from bl.dict import Dict
from bl.id import random_id
from bl.string import String
from bl.file import File
from .schema import Schema
class XML(File):
ROOT_TAG = None
NS = {}
... |
import ptypes
from ptypes import *
ptypes.setbyteorder(ptypes.config.byteorder.littleendian)
## Atomic types
class BYTE(pint.uint8_t): pass
class DWORD(pint.uint32_t): pass
class LONG(pint.int32_t): pass
class WORD(pint.uint16_t): pass
## Core bitmap types
class bfType(pint.enum, WORD):
_values_ = [
('BM... |
from TwitterSearch import TwitterSearch
from TwitterSearch import TwitterSearchOrder
from st2reactor.sensor.base import PollingSensor
__all__ = [
'TwitterSearchSensor'
]
BASE_URL = 'https://twitter.com'
class TwitterSearchSensor(PollingSensor):
def __init__(self, sensor_service, config=None, poll_interval=... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
tests.unit.modules.archive_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import Salt Testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MO... |
'''
setup dataset for ATLAS
'''
import re
import sys
import time
import uuid
import datetime
import traceback
from pandaserver.dataservice import ErrorCode
from pandaserver.dataservice.DDM import rucioAPI
from pandaserver.taskbuffer.DatasetSpec import DatasetSpec
from pandaserver.taskbuffer import EventServiceUtils
f... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
import socket
import os.path
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
mock_open,
MagicMock,
... |
# Copyright 2016-2017 Capital One Services, 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 agreed ... |
'''
setup dataset for ATLAS
'''
import re
import sys
import time
import types
import urllib
import datetime
import commands
import threading
import traceback
import ErrorCode
import TaskAssigner
from DDM import ddm
from DDM import toa
from dataservice.DDM import dq2Common
from taskbuffer.JobSpec import JobSpec
from t... |
# -*- coding: utf-8 -*-
'''
Unit tests for the dockerng state
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salt.exceptions import SaltInvocationError
from salttesting.helpers import ensure_in_syspath
from salttesting.mock impo... |
# -*- coding: utf-8 -*-
# Tkinter canvas to SVG exporter
#
# license: BSD
#
# author: Wojciech Muła
# e-mail: wojciech_mula@poczta.onet.pl
# WWW : http://0x80.pl/
from __future__ import division
__author__ = "Wojciech Muła <wojciech_mula@poczta.onet.pl>"
__all__ = ["convert", "SVGdocument", "saveall", "PYTHON", "... |
#!/usr/bin/env python2
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
import json
from klein import Klein
from twisted.internet import reactor
from twisted.internet.defer import DeferredList, inlineCallbacks, returnValue
from paradrop.base import nexus, settings
from paradrop.base.output import out
from paradrop.base.pdutils import timeint, str2json
from paradrop.core.config import host... |
# -*- coding: utf-8 -*-
# Import Salt Testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, Mock, MagicMock, patch
ensure_in_syspath('../../')
# Import salt libs
from salt.modules import postgres as postgresmod
... |
# Capstone project for Jose Portilla's Complete Python Bootcamp course at udemy.com
# Project Idea: Inverted index - An Inverted Index is a data structure used to create full text search.
# Given a set of text files, implement a program to create an inverted index. Also create a
# user interface to do a search using t... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.core.agents im... |
#!/usr/bin/env python
import argparse
import zmq
# import uuid
import os
import sys
import platform
import random
import time
import pickle
import logging
import queue
import threading
import json
from parsl.version import VERSION as PARSL_VERSION
from ipyparallel.serialize import serialize_object
LOOP_SLOWDOWN = 0.0... |
import os
import copy
import mock
from pdcupdater.tests.handler_tests import (
BaseHandlerTest, mock_pdc
)
HANDLER_PATH = 'pdcupdater.handlers.modules.ModuleStateChangeHandler'
ARCHES = ['aarch64', 'armv7hl', 'i686', 'ppc64', 'ppc64le', 's390x', 'x86_64']
def mocked_koji_from_tag(url, tag):
rpm_id = 1258442... |
# Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... |
import csv
from datetime import datetime
import glob
import json
import os
import re
import urllib
import shutil
from jinja2 import Environment, PackageLoader
def topic2path(tag):
t = tag.lower()
t = re.sub(r'í', 'i', t)
t = re.sub(r'ó', 'o', t)
t = re.sub(r'ã', 'a', t)
t = re.sub(r'[\W_]+', '-', t... |
import os
import pyfits
import numpy as np
import glob
import shutil
import re
import time
import matplotlib.pyplot as plt
USE_PLOT_GUI=False
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from pyraf import iraf
from iraf import iraf
import threedhst
import threedh... |
#! /usr/bin/python2.7
"""
Module cdifflib -- c implementation of difflib.
Class CSequenceMatcher:
A faster version of difflib.SequenceMatcher. Reimplements a single
bottleneck function - find_longest_match - in native C. The rest of the
implementation is inherited.
"""
__all__ = ['CSequenceMatcher', '_... |
'''MLP example'''
import os
import sys
import time
import numpy as np
import tensorflow as tf
import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
# Metaparameters
learning_rate = 0.00001
training_epochs = 150
batch_size = 50
display_step = 1
# Architectural Hyperparameters
n_in = 784
n_... |
"""
Validate ODC dataset documents
"""
import collections
import enum
import math
import sys
from datetime import datetime
from pathlib import Path
from typing import (
List,
Counter,
Dict,
Generator,
Optional,
Union,
Tuple,
Sequence,
Iterable,
)
import attr
import click
import nump... |
"""Utilities to import data into M/EEG preprocessing pipelines."""
# Authors: Annalisa Pascarella <a.pascarella@iac.cnr.it>
# Mainak Jas <mainakjas@gmail.com>
#
# License: BSD (3-clause)
import nipype.pipeline.engine as pe
from nipype.interfaces.utility import IdentityInterface, Function
import nipype.interf... |
#!/usr/bin/env python
import sys
import argparse
import getpass
import os
import centinel
import centinel.config
# Constants
DEFAULT_CONFIG_FILE = os.path.expanduser('~' + getpass.getuser() +
"/.centinel/config.ini")
def parse_args():
parser = argparse.ArgumentParser()
... |
import time
import simplejson
from channel import BaseChannel, ChannelException,ChannelMetaClass, STATUS_BAD, STATUS_GOOD, STATUS_UGLY
from utils import *
#############
## Arirang ##
#############
class Arirang(BaseChannel):
playable = True
short_name = 'arirang_world'
long_name = 'Arirang TV World'
d... |
"""
Chapter 2 : Recursion
@author: Alvin Wan
@site: alvinwan.com
"""
def stairs(n):
"""Give the number of ways to take n steps, given that at each step, you
can choose to take 1, 2, or 3 steps.
>>> stairs(3)
4
>>> stairs(5)
13
>>> stairs(10)
274
"""
if n <= 2:
return n... |
#!/usr/bin/env python3
"""
Charcoal's main module.
Contains definitions for the Charcoal canvas object, \
the CLI, and various classes used by the Charcoal class.
"""
from direction import Direction, DirectionToString, Pivot
from charcoaltoken import CharcoalToken as CT, CharcoalTokenNames as CTNames
from charactert... |
"""
An extractor that checks that the user extracted by the
wrapped extractor exists in the user store.
"""
import logging
import simplejson
from tiddlyweb.model.tiddler import Tiddler
from tiddlyweb.model.user import User
from tiddlyweb.store import StoreError
from tiddlyweb.web.extractors import ExtractorInterface
... |
#!/usr/bin/python
# coding=utf-8
"""
This code reads the battery voltage via Adafruits ADS1015 AD converter and shows
the values on an OLED via SSD1306.
It also checks a pushbotton state, connected to #23 (pin 16 on Raspberry Pi 3)
via 10k pull-down resistor. If pushed, it calls the "shutdown now" command.
"""
# for... |
# Copyright (C) 2005-2006 Jelmer Vernooij <jelmer@samba.org>
# 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 pr... |
# Copyright (C) 2005-2006 Jelmer Vernooij <jelmer@samba.org>
# 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 pr... |
from utils.serializers import ObjectTypeModelSerializer
from rest_framework import serializers
from . models import ChatMessage
from . utils import get_user_details
class ChatMessageSerializer(ObjectTypeModelSerializer):
# NOTE: This time format really only includes milliseconds. See the
# `to_representation`... |
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from django.views.generic.base import RedirectView
from django.views.generic.detail import DetailView
from musician.models import Song as MusicianSong
from songs.models import Song
class SongStateView(RedirectView):
def g... |
#!/usr/bin/env python
#
# Copyright 2016 the original author or 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 require... |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... |
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
"""Settings abstraction of hexchat's pluginpref in form of a MutableMapping.
Exported classes:
- PluginPref
- SerializablePluginPref
- JSONPluginPref
"""
from abc import ABCMeta, abstractmethod
from collections.abc import MutableMapping
import json
import hexchat
__version__ = "0.3.1"
versioninfo = tuple(map(int,... |
#!/usr/bin/env python
###
# Copyright (c) 2002, Jeremiah Fincher
# 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,
# ... |
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008, James Vega
# 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 copyri... |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 co... |
# -*- coding: utf-8 -*-
"""TODO 2"""
from datetime import datetime
class Episode(object):
class PlayingStatus(object):
Playing = 0
# haven't seen 1 yet
Unplayed = 2
Played = 3
def __init__(self, uuid, podcast, **kwargs):
self._podcast = podcast
self._api = podc... |
# Copyright (c) 2014, Vienna University of Technology (TU Wien), Department
# of Geodesy and Geoinformation (GEO).
# 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 co... |
"""
Starting point for minimal Flask API.
"""
# Import package dependencies.
from flask import Flask
from flask_restful import Resource, Api
from flask_restful.reqparse import RequestParser
# Cra=eate a new Flask App.
app = Flask(__name__)
# Wrap the App in an API.
api = Api(app, prefix="/api/v1")
# Define dummy... |
"""Stuff related to filetypes.toml."""
# TODO: replace all this with editorconfig
import fnmatch
import logging
import pathlib
import re
from typing import Any, Dict, List, Optional, Tuple, Union
import pygments.lexer # type: ignore
import pygments.lexers # type: ignore
import pygments.token # type: ignore
from ... |
import sys
import os
import glob
import tarfile
import shutil
import h5py
from watchdog.events import RegexMatchingEventHandler
#logging
import logging
logger = logging.getLogger('poretools')
# poretools imports
import formats
from Event import Event
fastq_paths = {
'closed' : {},
'metrichor1.16' : { 'template'... |
# -*- coding: utf-8 -*-
class BaseTopology(object):
def deploy_instances(self):
""" This method returns deploy instances to an infra. It must be
implemented for every new type added to Instance Model, even subclasses
of the existent ones."""
raise NotImplementedError
def deploy... |
from datetime import datetime
from requests import post, delete, get
from backup.models import Snapshot
from dbaas_credentials.models import CredentialType
from util import get_credentials_for, exec_remote_command_host
from physical.models import Volume
from base import BaseInstanceStep
class VolumeProviderException(... |
import typing
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from math import atan2, copysign, cos, degrees, hypot, isclose, radians, sin, sqrt
__all__ = ('Vector',)
# Anything convertable to a Vector, including lists, tuples, and dicts
VectorLike = typing.Union[
'Vector', # Or ... |
#!/usr/bin/env python
# This file is part of PRAW.
#
# PRAW 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.
#
# PRAW is distributed in... |
import threading
try:
import cStringIO as StringIO
except ImportError:
import StringIO
import cgi
import codecs
import gzip
import operator
import os
import re
import urllib2
import urlparse
import sys
import cssutils
from lxml import etree
from lxml.cssselect import CSSSelector
__all__ = ['PremailerError'... |
from __future__ import absolute_import, unicode_literals, print_function
import sys
import threading
if sys.version_info >= (3, ): # As in, Python 3
from io import StringIO
from urllib.request import urlopen
from urllib.parse import urljoin
STR_TYPE = str
else: # Python 2
try:
import cStri... |
import base64
import logging
import asyncio
from typing import List, Dict, AnyStr, Set, Optional
import ujson as json
import aiohttp
import websockets
from .mhtml import MHTML
logger = logging.getLogger(__name__)
class TemporaryBrowserFailure(Exception):
pass
class ChromeRemoteDebugger:
def __init__(sel... |
# Django settings for omm project.
from madrona.common.default_settings import *
APP_NAME = "COGS-Priorities"
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'wp',
'USER': 'postgres', }
}
GEOMETRY... |
import os
import numpy as np
from nistats.design_matrix import compute_regressor
from nistats import experimental_paradigm
from nipype.interfaces import spm
from nipype.interfaces.base import (BaseInterface,
BaseInterfaceInputSpec, traits, File, TraitedSpec, Directory, isdefined)
from nipype.interfaces.spm.base imp... |
# Third-Party
from django_filters.rest_framework import FilterSet
# Local
from .models import (
Award,
Catalog,
Contestant,
Convention,
Entity,
Officer,
Performer,
Person,
Session,
Submission,
Venue,
)
class AwardFilter(FilterSet):
class Meta:
model = Award
... |
from django.conf.urls import patterns, url
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'proso_feedback.views',
url(r'^... |
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from proso.models.environment import CommonEnvironment, InMemoryEnvironment
from datetime import datetime
from contextlib import closing
from django.db i... |
import time
import string
import threading
from pylinkirc import utils, conf
from pylinkirc.log import log
from pylinkirc.classes import Protocol, IrcUser, IrcServer
COMMON_PREFIXMODES = [('h', 'halfop'), ('a', 'admin'), ('q', 'owner'), ('y', 'owner')]
class ClientbotWrapperProtocol(Protocol):
def __init__(self,... |
"""
nefarious.py: Nefarious IRCu protocol module for PyLink.
"""
import sys
import os
import base64
from ipaddress import ip_address
# Import hacks to access utils and classes...
curdir = os.path.dirname(__file__)
sys.path += [curdir, os.path.dirname(curdir)]
import utils
from log import log
from classes import *
d... |
"""
nefarious.py: Nefarious IRCu protocol module for PyLink.
"""
import re
import sys
import os
import base64
from ipaddress import ip_address
# Import hacks to access utils and classes...
curdir = os.path.dirname(__file__)
sys.path += [curdir, os.path.dirname(curdir)]
import utils
from log import log
from classes i... |
'''Python implemetation of the W3C Provenance Data Model (PROV-DM)
Support for PROV-JSON import/export
References:
PROV-DM: http://www.w3.org/TR/prov-dm/
@author: Trung Dong Huynh <trungdong@donggiang.com>
@copyright: University of Southampton 2012
'''
import logging
import datetime
import json
import re
import co... |
"""Base backend interface."""
import os
import stat
import sys
class JobSourceFile(object):
"""Describes a source code file for a job.
Parameters
----------
path : str
Path to write the source file to.
task : Task
Task the source file corresponds to.
job_code : str
Jo... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys
import os
import re
import json
import shlex
import urllib.request
import codecs
import subprocess
import time
import statistics
from datetime import datetime
reader = codecs.getreader("utf-8")
# ################################################################... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys
import os
import re
import json
import shlex
import urllib.request
import codecs
import subprocess
import time
import statistics
from datetime import datetime
reader = codecs.getreader("utf-8")
# ################################################################... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys
import os
import re
import json
import shlex
import urllib.request
import codecs
reader = codecs.getreader("utf-8")
return_code = 0
# ############################################################################
# Utilities
# ################################... |
# Copyright (c) 2021, Djaodjin 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 of conditions and t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Thibaut Lapierre <root@epheo.eu>. 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
#
# ... |
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from builtins import input
from builtins import range
from past.utils import old_div
import sys
import numpy as np
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pandas as pd
from m... |
from bespin.errors import NoSuchStack
from bespin.layers import Layers
from bespin import helpers as hp
from bespin import aws_helpers as aws
import logging
log = logging.getLogger("bespin.actions.builder")
class Builder(object):
def deploy_stack(self, stack, stacks, made=None, ignore_deps=False):
"""Mak... |
import json
import random
import re
# load a json file into a dictionary
def load_json(filename):
f = json.load(open(filename))
return f
# generate an entity from a json profile
def generate(data):
# generate a blank entity
entity = {}
# for each key in the data profile
for key, value in dat... |
#!/usr/local/bin/python
# coding=utf-8
from __future__ import print_function
import shutil, os, re
import sqlite3
import json
from cache import fetch
from cgi import escape
from templates import indexTemplate, pkgTemplate, moduleTemplate, toHtml
from upgrade_json import upgrade_json
import string
opj = os.path... |
#!/usr/bin/python3
"""
This script generates spec, unit and init files for CentOS build_files.
"""
import argparse
import logging
import os
from pprint import pprint
import jinja2
import yaml
def renderTemplateFromFile(templates_dir, template_file, context):
return (
jinja2.Environment(loader=jinja2.Fi... |
# -*- Mode: Python -*-
def elem (name, props, close=False, empty=False):
r = []
if close:
r.append ('</%s' % (name,))
else:
r.append ('\n<%s' % (name,))
for kw, kv in props.iteritems():
if kw == 'klass':
kw = 'class'
kv = kv.replace ('"', """)
r.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.