text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
# coding=utf-8
class FighterModifier(object):
"""
Базовый класс для разнообразных модификаторов.
К примеру: даров владычицы, снаряжения рыцарей, заклинаний и.т.д.
"""
def __init__(self, attack=('base', (0, 0)), protection=('base', (0, 0))):
self.attack = attack
... |
"""This module has a generic FileDialog class that is used to open
or save files."""
from builtins import object
from gi.repository import Gtk
class FileDialog(object):
"""This is a file dialog that is used to open or save a file."""
def __init__(
self,
title,
filename=None,
... |
# Copyright (C) 2005 by Async Open Source
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is d... |
import time
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_generator
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.urlresolvers imp... |
# -------------------------------------------------------------------------------- #
# ~~~> [Generate Completions] <~~~
# @author Chris Brough
# @date 2014
# @license MIT
# -------------------------------------------------------------------------------- #
import sublime
import sublime_plugin
import codecs
import glob
... |
#!/usr/bin/env python
#
# @file query.py
# @brief general functions for querying objects
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2018 by the California Institute of Technology
# (California, USA), the... |
# -*- coding: utf-8 -*-
'''
.. module:: genomics.db
:synopsis: Database for distributed write-once mapreduce ops
:noindex:
:copyright: Copyright 2014 by Tiago Antao
:license: GNU Affero, see LICENSE for details
.. moduleauthor:: Tiago Antao <tra@popgen.net>
'''
import abc
import os
class DBException(Exc... |
# see tastypie documentation at http://django-tastypie.readthedocs.org/en
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.urlresolvers import resolve, get_script_prefix
from tastypie import fields
from tastypie.fields import RelatedField
from tastypie.authentication import ApiK... |
# -*- coding: utf-8 -*-
import re
import sys
import weakref
from xml.parsers.expat import ExpatError
if sys.version_info[0] == 3:
from xmlrpc.client import ServerProxy, Binary, Fault
from urllib.parse import urlencode
else:
from xmlrpclib import ServerProxy, Binary, Fault
from urllib import urlencode
... |
# coding=utf-8
import Tkinter as tk
import ttk
import tkFileDialog
import threading
import Queue
import os
import urllib2
import time
import ClipUNL
# 4k ought to be enough for anybody
BLOCK_SIZE=4*1024
DEF_CLIP_DIR="CLIP"
def yield_thread():
time.sleep(0)
def do_download(parent, tree):
def_dir = os.path.ex... |
#!/usr/bin/env python
########################################################################
#
# Project: Metalink Checker
# URL: http://www.nabber.org/projects/
# E-mail: webmaster@nabber.org
#
# Copyright: (C) 2007-2008, Neil McNab
# License: GNU General Public License Version 2
# (http://www.gnu.org/cop... |
import Tkinter as tk
from Tkinter import *
import tkFileDialog
import numpy as np
width_end = 22 # pixel width of each rectangle in drawup
width_pick = 20 # pixel height of each rectange in drawup
class VerticalScrolledFrame(Frame):
"""A pure Tkinter scrollable frame that actually works!
* Use the 'in... |
"""Unofficial API for duolingo.com"""
import re
import json
import random
import requests
from werkzeug.datastructures import MultiDict
__version__ = "0.3"
__author__ = "Kartik Talwar"
__email__ = "hi@kartikt.com"
__url__ = "http://github.com/KartikTalwar/duolingo"
class Struct:
def __init__(self, **entries):
... |
"""Support for HDF5 files."""
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
import numpy as np
import h5py
import dwi.util
DEFAULT_DSETNAME = 'default'
class Dataset(h5py.Dataset):
"""Add some missing ndarray API to dataset."""
@property
def ndim... |
"""Utility functionality."""
from __future__ import absolute_import, division, print_function
import glob
from collections import defaultdict, OrderedDict
from itertools import ifilter, islice
import os
import random
import re
import numpy as np
import scipy as sp
import scipy.stats
def all_equal(a):
"""Tell wh... |
from ctypes import cdll
from ctypes import Structure
from ctypes import POINTER, pointer
from ctypes import c_int, c_uint, c_uint8, c_uint16, c_uint32, c_int32
from ctypes import c_char_p
from ctypes import c_size_t
from ctypes import c_bool
from ctypes import create_string_buffer
#LEB128
class Leb128(Structure):
... |
import os
import mmap
import io
import pdb
from cStringIO import StringIO
from baseutils import string_to_unsigned
from baseutils import string_to_signed
import dwarf
elf = None
#options
ELF_HEADER = 1 << 2
ELF_SYMBOL = 1 << 3
ELF_DYNAMIC = 1 << 4
ELF_RELA = 1 << 5
ELF_PSECTION = 1 << 6
ELF_VERNEED = 1 << 7
DWAR... |
"""
Author: Justin Cappos
Start Date: 27 June 2008
Description:
This is a collection of communications routines that provide a programmer
with a reasonable environment. This is used by repy.py to provide a
highly restricted (but usable) environment.
"""
import restrictions
import socket
# Arm... |
#!/usr/bin/python
#
# entrymgr.py: Main entrymgr code base.
#
# Copyright (C) 2013, Jonathan Davies <jpdavs@gmail.com>
#
# 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... |
import numpy as np
def func_zc_d1(del1):
d1 = (1 + del1 ** 2) / (1 + del1)
y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
Zc = y / (3 * y + d1 - 1.0)
return Zc
def get_del_1(Zcin, del1):
# del1 = del_1_init
# d1 = (1 + del1 ** 2) / (1 + del1)
# y = 1 + (2 * (1 +... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Handles RFC fetching.
'''
import os
import re
import requests
RFC_URL = 'http://tools.ietf.org/rfc/rfc'
RFC_FORMAT = 'txt'
def parse_rfc_numbers(numbers):
'''
Parses RFC numbers, given in arguments, to a list of ints.
:numbers: Valid integers or ran... |
from distutils import spawn
import json
import os
import re
import subprocess as sp
import sys
import yaml
import click
from .. import utils
@click.group()
@click.pass_context
@click.option('--ask-sudo-pass', default=False, is_flag=True)
def cli(ctx, ask_sudo_pass):
if ctx.invoked_subcommand not in ('init', 'ls... |
from __future__ import division
import warnings
from six import string_types
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy import ndimage, signal
import nibabel as nib
class Mosaic(object):
def __init__(self, anat, stat=None, mask=None, n_col=9, step=... |
from decimal import *
def get_percent(numer,denom):
thiscontext = Context(rounding=ROUND_HALF_UP)
setcontext(thiscontext)
return Decimal(str(float(numer)/denom*100)).quantize(Decimal('1.01'))
def clean_num(value):
value = value.strip()
try:
if value=='':
value=None
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 7 mars 2016
@author: Gaetan Hadjeres
"""
import pickle
from music21.analysis.floatingKey import FloatingKeyException
from tqdm import tqdm
import numpy as np
from music21 import corpus, converter, stream, note, duration, analysis, interval
NUM_VOICES = 4
... |
import bmorph
import pandas as pd
def apply_annual_bmorph(raw_ts, train_ts, obs_ts,
training_window, bmorph_window, reference_window,
window_size, n_smooth_long=None, n_smooth_short=5, train_on_year=False):
training_window = slice(*training_window)
bmorph_window = slice(*bmorph_window)
refe... |
# Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... |
#MAEC Behavior Class
#Copyright (c) 2014, The MITRE Corporation
#All rights reserved
#Compatible with MAEC v4.1
#Last updated 04/15/2014
import maec
import maec.bindings.maec_bundle as bundle_binding
from cybox.core.action_reference import ActionReference
from cybox.common.measuresource import MeasureSource
from cyb... |
# -*- coding: utf-8 -*-
from data import *
from datetime import *
from google.appengine.ext import ndb
from google.appengine.ext.ndb import metadata
import time
import scoutnet
import StringIO
import ucsv as ucsv
import urllib2
def RunScoutnetImport(groupid, api_key, user, semester, result):
commit = True
data = No... |
'''
a wrapper to google cloud sql.
the MySQLdb module is thread safe but the connections to the database are not. so the
recommendation is that each thread have an independent connection. currently, each
database access will use its own connection and at the end of the method, close it.
if this becomes expensive, ti... |
from boids import Boids
from nose.tools import assert_equals, assert_raises
import os
import yaml
import numpy as np
from mock import patch
def test_Boids():
boidobject = Boids()
assert_equals(boidobject.boids_x.size, 50)
assert_equals(boidobject.boids_y.size, 50)
assert_equals(boidobject.boid_x_veloci... |
from database.dict_converters.converter_base import ConverterBase
class TeamConverter(ConverterBase):
SUBVERSIONS = { # Increment every time a change to the dict is made
3: 4,
}
@classmethod
def _convert(cls, teams, dict_version):
CONVERTERS = {
3: cls.teamsConverter_v3,
... |
## This Python file uses the following encoding: utf-8
##
## (C) 2007, 2008, 2013, 2015, 2016-2020 Muthiah Annamalai <ezhillang@gmail.com>
## (C) 2013 msathia <msathia@gmail.com>
##
## This file is dual licensed - originally GPL v3 from Ezhil, and
## then as part of open-tamil package in MIT license.
##
## Licensed und... |
# -*- coding=utf-8 -*-
import json
import re
import datetime
import os
import sys
import requests
import pytz
import psycopg2
import sqlalchemy as sa
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from dateutil import parser as date_parser
from django.core.management.base import BaseComman... |
from keras.datasets import mnist
from keras.initializers import RandomUniform
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import SGD
from keras.utils import to_categorical
batch_size = 128
epochs = 30
learning_rate = 0.5
(x_train, y_train), (x_test, y_test) = mn... |
# -*- coding: utf-8 -*-
from great_expectations import rtd_url_ge_version
PROJECT_HELP_COMMENT = """
# Welcome to Great Expectations! Always know what to expect from your data.
#
# This project configuration file allows you to define datasources, generators,
# integrations, and other things to help you crush pipeline... |
import json
from sure import expect, scenario
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.test.client import Client
from restroom.tests.utils import prepare_real_model, prepare_real_modelb, prepare_real_model_authed
from restroom.constants import OK, CREATED, DE... |
#!/usr/bin/python3
import ssl, json, time, re, importlib.util, signal
#from signal import signal, alarm, SIGALRM
from os.path import isfile, getctime, isdir, join
from os import sep, getcwd
from sys import exit, path, argv, version_info, stdout, stderr
from urllib.p... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
# Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved.
# Ge... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
# Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved.
# Ge... |
from django.test import TestCase
from tastypie.test import ResourceTestCase
from tastypie.models import ApiKey
from django.contrib.auth.models import User
from rhizome.models import CacheJob, Office, Indicator, Location,\
LocationType, DataPoint, CampaignType, Campaign, IndicatorTag,\
LocationPermission, Docum... |
#!/usr/bin/env python
import git_visitor_base
import git_repo_query
import git_pull
import sys
def visitor_pull(repos, options):
ORIGINAL_COLOR = "\033[0m" # mvtodo: would be better to try to detect the terminal's current standard color
report = []
for rp in repos:
remotes = git_repo_query.get_... |
class Reservations:
def __init__(self, client):
self.client = client
def list(self, params={}):
return self.client.request('GET', self._url(params), params)
def create(self, params={}):
return self.client.request('POST', self._url(params), params)
def _url(self, params={}):
... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import os
import re
import requests
import socket
import urllib2
from collections import defaultdict, Counter, deque
from math import ceil
# project
from checks import AgentCheck
from config import _is_a... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
import os
from collections import namedtuple
from dataclasses import dataclass, field
from typing import List, Optional
import log
from .. import common, exceptions, git, shell
Identity = namedtuple("Identity", ["path", "url", "rev"])
@dataclass
class Link:
source: str = ""
target: str = ""
@dataclass
cl... |
#!/usr/bin/python
# pylint: disable=too-many-lines
# -*- coding: utf-8 -*-
# Reason: Disable pylint too-many-lines because we don't want to split up this file.
# Status: Permanently disabled to keep this module as self-contained as possible.
"""Ansible module for retrieving and setting openshift related facts"""
# py... |
# Copyright 2011 OpenStack Foundation
# 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 requ... |
#How to run this:
#Python libraries needed to run this file: Flask, Git Python, SQLAlchemy
#You will need to have Git installed, and it will need to be in your path.
#For example, on Windows you should be able to run a command like 'git pull' from the
#ordinary Windows command prompt and not just from Git Bash.
#You... |
"""
Create a template app from ODM-formatted OpenClinica study metadata
"""
from lxml import etree
from django.core.management.base import BaseCommand
from corehq.apps.app_manager.const import APP_V2
from corehq.apps.app_manager.models import Application, Module, OpenCaseAction, UpdateCaseAction, PreloadAction
from cor... |
from .backends import Backend
from .query import Query
class Taxon(object):
"""
A wrapper for Redis objects that allows data to be organized and queried
by tag.
"""
def __init__(self, backend):
if not isinstance(backend, Backend):
raise ValueError("%s is not a valid backend" %... |
#!/usr/bin/env python
############################################################################
#
# Copyright (C) 2014-2016 PX4 Development Team. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met... |
from __future__ import division
import numpy as np
import numpy.linalg
import scipy as sp
import scipy.stats
from numpy import all as npall
from numpy import sum as npsum
from numpy import (asarray, clip, dot, empty, errstate, full, inf, isfinite,
log, nan_to_num, zeros, pi)
from numpy.linalg import... |
import neovim
import os
import subprocess
import json
import threading
from functools import partial
from typing import List, Dict, Union, Any # noqa: F401
from . util import (
getRootPath, pathToURI, uriToPath, escape,
getGotoFileCommand)
from . logger import logger
from . RPC import RPC
from . TextD... |
import ROOT
import time
import os
import sys
import multiprocessing
from multiprocessing import Process
from operator import add, itemgetter
import uuid
from ..tree.filtering import *
from atlastools import datasets
from .. import routines
from .. import multilogging
import logging
import traceback
import shutil
import... |
# -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
"""
Variables are entry points in the shader that ... |
"""Tests for managing HTTP issues (malformed requests, etc)."""
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
import errno
import socket
from six.moves import urllib, http_client
import pytest
import six
from cheroot.test import helper
HTTP_BAD_REQUEST = 400
HTTP_LENGTH_REQUIRED = 411
HTTP_NOT_FOUND = 4... |
# Copyright 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import ROOT
from pkg_resources import resource_filename
from rootpy.io import open as ropen
from rootpy.rootcint import generate
from rootpy import stl
from rootpy.stl import CPPType
from nose.plugins.attrib import attr
@attr('slow')
def test_rootcint():
generate('map<int,vector<float> >', '<vector>;<map>')
... |
#
# ovirt-hosted-engine-ha -- ovirt hosted engine high availability
# Copyright (C) 2013 Red Hat, Inc.
#
# This library 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 2.1 of the Licens... |
from datetime import datetime
from councilmatic_core.haystack_indexes import BillIndex
from django.conf import settings
from haystack import indexes
import pytz
from chicago.models import ChicagoBill
app_timezone = pytz.timezone(settings.TIME_ZONE)
class ChicagoBillIndex(BillIndex, indexes.Indexable):
topics... |
#FLM: Input TrueType Hints
# coding: utf-8
__copyright__ = __license__ = """
Copyright (c) 2015 Adobe Systems Incorporated. All rights reserved.
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... |
from __future__ import print_function
from __future__ import absolute_import
# System modules
import sys
# Third-party modules
import six
# LLDB Modules
import lldb
from .lldbtest import *
from . import lldbutil
if sys.platform.startswith('win32'):
# llvm.org/pr22274: need a pexpect replacement for windows
... |
from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
index = MultiIndex.from_arrays([np.arange(100).repeat(100),
np.roll(np.tile(np.arange(100), 100), 25)])
df = DataFrame(np.random.randn(10000, 4), index=index)
"""
reshape_unst... |
# -*- coding: utf-8 -*-
"""
vcs.backends.git
~~~~~~~~~~~~~~~~
Git backend implementation.
:created_on: Apr 8, 2010
:copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
"""
import os
import re
import time
import datetime
import posixpath
from dulwich import objects
from dulwich.repo im... |
import os
from vcs.cli import make_option
from vcs.cli import SingleChangesetCommand
class CatCommand(SingleChangesetCommand):
option_list = SingleChangesetCommand.option_list + (
make_option('--blame', action='store_true', dest='blame',
default=False,
help='Annotate output with '... |
#!/usr/bin/python3
import config_oldbw
import config_newbw
import email.header
import imaplib
import os
import pprint
import re
import shelve
import ssl
import pickle
class Gmail(imaplib.IMAP4_SSL):
def __init__(self, cfg):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
ctx.verify_mode = ssl.CERT_REQUIR... |
import sys
from enum import Enum
from copy import copy,deepcopy
import pickle
import itertools as it
import colorsys
import math as m
import tkinter as tk
from tkinter import filedialog
import CanvasX as CX
from PIL import ImageTk, Image, ImageFilter
import numpy as np
import linalg as la
from fs... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2014-2015 eNovance
#
# 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 applica... |
""" Represents a MyPages session """
import json
# this import is depending on python version
try:
import HTMLParser
UNESCAPE = HTMLParser.HTMLParser().unescape
except ImportError:
import html
UNESCAPE = html.unescape
from bs4 import BeautifulSoup
import requests
DOMAIN = 'https://mypages.verisure... |
from datetime import datetime
from django.views.generic import TemplateView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.... |
from subprocess import check_output, CalledProcessError
import tempfile
import numpy
import os
def runModShift(time,flux,model,plotname,objectname,period,epoch):
"""Run the Model-Shift test
Inputs:
-------------
time
The array of time values days.
flux
The array of observed fluxes... |
import json
import math
import os
import cherrypy
import azureutil
import util
class Image:
@util.expose
@util.protect
@util.db
@util.auth
def get(self, cursor=None, user_id=None, entity=None, entity_id=None,
**kwargs):
if not entity or not entity_id:
raise c... |
import random
import sys
import os
import multiprocessing
import subprocess
import time
import signal
import pickle
import logging
import threading
import cmdserver
from cmdclient import CmdClient
from config import ClusterConfig
import globalvars
import localip
logger = logging.getLogger(__name__)
max_tries = 3
#... |
"""
.. module:: mail_templated.utils
:synopsis: Additional utils of django-mail-templated package.
.. moduleauthor:: Artem Rizhov <artem.rizhov@gmail.com>
"""
from django.core import mail
from .message import EmailMessage
def send_mail(template_name, context, from_email, recipient_list,
fail_silen... |
import json
import math
import os
import cherrypy
import azureutil
import util
class Image:
@util.expose
@util.protect
@util.db
@util.auth
def get(self, cursor=None, user_id=None, entity=None, entity_id=None,
**kwargs):
if not entity or not entity_id:
raise c... |
#
# Copyright (c) 2010 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from bs4 import BeautifulSoup as bs
from sasila.system_normal.spider.spider_core import SpiderCore
from sasila.system_normal.pipeline.console_pipeline import ConsolePipeline
from sasila.system_normal.pipeline.text_pipeline import TextPipelineFang
from sasila.sy... |
import time
import socket
import urllib.request
import json
import re
from goprocam import constants
import datetime
import struct
import subprocess
from socket import timeout
from urllib.error import HTTPError
from urllib.error import URLError
import http
import math
import base64
import sys
import ssl
class GoPro:
... |
from django.db.models import signals
from .abstract_models import to_ascii, to_search
from .settings import *
from .signals import *
from .exceptions import *
def set_name_ascii(sender, instance=None, **kwargs):
"""
Signal reciever that sets instance.name_ascii from instance.name.
Ascii versions of names... |
import datetime
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import get_storage_class
from django.core.files.images import get_image_dimens... |
"""Extension which accounts for the core RPM metadata fields."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from confpy.api import Configuration
from confpy.api import IntegerOption
from confpy.api import Namespa... |
"""Defines the command that performs the pre-job steps"""
from __future__ import unicode_literals
import json
import logging
import os
import sys
from django.core.management.base import BaseCommand
from django.utils.text import get_valid_filename
from django.utils.timezone import now
from error.exceptions import Sca... |
#!/usr/bin/env python
# DungeonMap - the Model for our dungeon generator
#
# Represented as a collection of Regions and Connections.
# Each Region owns a single polygon that does not overlap any other Regions.
# Each Connection straddles the border between two Regions.
# The DungeonMap handles collision detection betwe... |
#!/usr/bin/env python
"""Copies data from RAPID netCDF output to a CF-compliant netCDF file.
Remarks:
A new netCDF file is created with data from RAPID [1] simulation model
output. The result follows CF conventions [2] with additional metadata
prescribed by the NODC timeSeries Orthogonal template [3]... |
# File with data, fits format
filename = 'kplr008366239_d21_v1.dat'
#filename = None
listfile = 'list.dat'
# Keywords for the fits file data
fits_options = {}
fits_options['time'] = 'TIME'
fits_options['flux'] = 'PDCSAP_FLUX'
fits_options['error'] = 'SAP_FLUX_ERR'
# Settings for defining the priors for all parameter... |
#encoding=utf-8
import os
import logging
import codecs
import subprocess
import rouge
import json
import click
import tempfile
from collections import OrderedDict
def get_bleu_info(ref_path, pred_path):
print("######cal belu######")
metrics_dir = os.path.dirname(os.path.realpath(__file__))
bin_dir = os.path.ab... |
#!/usr/bin/python
#
# aamporter.py
# Tim Sutton
#
# Utility to download AAM 2.0 and higher (read: CS5 and up) updates from Adobe's updater feed.
# Optionally import them into a Munki repo, assuming munkiimport is already configured.
#
# See README.md for more information.
import logging
import optparse
import os
impor... |
import logging
import urlparse
import urllib
from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import fromstring
from django.conf import settings
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from mama_cas.models import... |
import os
from re import compile as re, M
from datetime import datetime
import json
import logging
import psycopg2
from tornado import ioloop, log, web
from .alerts import BaseAlert
from .utils import parse_interval
from .handlers import registry
LOGGER = log.gen_log
COMMENT_RE = re('//\s+.*$', M)
class Reactor... |
#!/usr/bin/env python
import re
import sys
from EPPs.common import GenerateHamiltonInputEPP, InvalidStepError
class GenerateHamiltonInputQPCRDilution(GenerateHamiltonInputEPP):
# define the column headers that will be used in the Hamilton input file and add to the csv_array to be
# used to write the file
... |
import datetime
import time
import redis
import requests
import requests.exceptions
from graphitepager import __version__
from graphitepager.config import get_config
from graphitepager.description import get_description
from graphitepager.description import missing_target_description
from graphitepager.graphite_data_... |
import sys
from collections import namedtuple
import numpy as np
import pandas as pd
from scipy import signal, interpolate
Filter = namedtuple('Filter', ['name', 'parameters'])
Parameter = namedtuple('Parameter', ['description', 'request'])
class TF(object):
def __init__(self, num, den, name=''):
self.n... |
"""Module containing the game manager class"""
from model.player import Player
from model.ship import Ship
from model.card import Card, Deck
from controller.human import Human_PC
import random, logging, copy
class State:
"""The game state class. Beyond counters relating to the point in play, it
also contains t... |
"""Internal processing classes and functions."""
from collections import namedtuple
from contextlib import ExitStack
from itertools import chain
import logging
import multiprocessing
import os
from shapely.geometry import mapping
from tilematrix._funcs import Bounds
from traceback import format_exc
from typing import ... |
"""
Model construction utilities based on keras
"""
import warnings
from tensorflow import keras
from .model import Model, NoSuchLayerError
# Assignment rather than import because direct import from within Keras
# doesn't work in tf 1.8
Sequential = keras.models.Sequential
Conv2D = keras.layers.Conv2D
Dense = keras.l... |
#!/usr/bin/env python
"""Base class for all FAUCET unit tests."""
# pylint: disable=missing-docstring
# pylint: disable=too-many-arguments
from functools import partial
import collections
import copy
import glob
import ipaddress
import json
import os
import random
import re
import shutil
import subprocess
import tem... |
#
# note: in order to use these macros we must add some mine_functions:
# network.default_route, network.interfaces
#
from __future__ import absolute_import
DEFAULT_INTERFACE = 'eth0'
NODENAME_GRAIN = 'nodename'
def __virtual__():
return "caasp_net"
def get_hosts():
"""Wrapper around hosts.list_ho... |
# -*- coding: utf-8 -*-
'''
The core bahaviuors ued by minion and master
'''
# pylint: disable=W0232
# Import python libs
import multiprocessing
# Import salt libs
import salt.daemons.masterapi
from salt.transport.road.raet import stacking
from salt.transport.road.raet import yarding
from salt.transport.road.raet imp... |
# -*- coding: utf-8 -*-
'''
A dead simple module wrapping calls to the Chocolatey package manager
(http://chocolatey.org)
.. versionadded:: 2014.1.0
'''
from __future__ import absolute_import
# Import python libs
import logging
import os.path
import re
import tempfile
from distutils.version import LooseVersion as _Lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.