gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2017 The TensorFlow Authors. 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 applica... | |
#!/usr/bin/env python
# Copyright 2011 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 ... | |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Virtua... | |
#!/usr/bin/env python2.7
import functools
import pydot
import tac
from symbol_table import *
node_counter = 0
def make_node(name, graph):
global node_counter
node = pydot.Node("{}".format(node_counter), label='"{}"'.format(name))
graph.add_node(node)
node_counter += 1
return node
def add_edge(grap... | |
"""
Numdifftools.nd_statsmodels
===========================
This module provides an easy to use interface to derivatives calculated with
statsmodels.numdiff.
"""
from __future__ import division, print_function
from functools import partial
from statsmodels.tools.numdiff import ( # approx_fprime,
# approx_fprime_c... | |
"""Functions to construct sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag']
import numpy as np
from sc... | |
# parser.py - Module for parsing whois response data
# Copyright (c) 2008 Andrey Petrov
#
# This module is part of pywhois and is released under
# the MIT license: http://www.opensource.org/licenses/mit-license.php
import re
import time
class PywhoisError(Exception):
pass
def cast_date(date_str):
"""Con... | |
# Copyright 2012 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... | |
# Copyright 2011 Isaku Yamahata
# 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 b... | |
# 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 agreed to in... | |
'''
The aim of a transcription algorithm is to produce a symbolic representation of
a recorded piece of music in the form of a set of discrete notes. There are
different ways to represent notes symbolically. Here we use the piano-roll
convention, meaning each note has a start time, a duration (or end time), and
a singl... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""Wrapper for netCDF readers."""
import os.path
import warnings
import numpy as np
from collections import OrderedDict
from monty.dev import requires
from monty.collections import AttrDict
from monty.functool... | |
from __future__ import print_function
import sys, json
from twisted.trial import unittest
from twisted.internet.defer import gatherResults, succeed
from ..twisted.transcribe import Wormhole, UsageError, ChannelManager
from ..twisted.eventsource_twisted import EventSourceParser
from .common import ServerBase
APPID = u"... | |
from sqlalchemy.testing import eq_, assert_raises, \
assert_raises_message
from sqlalchemy.testing.util import gc_collect
from sqlalchemy.testing import pickleable
from sqlalchemy.util import pickle
import inspect
from sqlalchemy.orm import create_session, sessionmaker, attributes, \
make_transient, make_transi... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import buildbot_common
import optparse
import os
import sys
from buildbot_common import ErrorExit
import easy_template
from genera... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Class for running instrumentation tests on a single device."""
import logging
import os
import re
import shutil
import sys
import time
from pylib im... | |
import morepath
from webtest import TestApp as Client
def test_json_obj_dump():
class app(morepath.App):
pass
@app.path(path='/models/{x}')
class Model(object):
def __init__(self, x):
self.x = x
@app.json(model=Model)
def default(self, request):
return self
... | |
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
import json
import os
import sys
import webbrowser
import code
import yaml
import time
try:
import anydbm as dbm
except ImportError:
import dbm.ndbm... | |
#!/usr/bin/env python
# encoding: utf-8
"""
@author: BoscoTsang
@date: 16-11-14
"""
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
import matplotlib.pyplot as plt
import theano
import keras.backend as K
from keras.models import Model
from keras.layers import ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2011 - 2012, Red Hat, 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
#
# ... | |
# 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... | |
import os
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# Required for Django 1.5.
# If horizon is running in production (DEBUG is False), set this
# with the list of host/domain names that the application can serve.
# For mor... | |
# Copyright 2007 Matt Chaput. 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 the... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | |
#! /usr/bin/local/python
import sys
import re
import logging
import os
import olc
from collections import OrderedDict
from utils import *
#-----------------------------------------------------------
def setup_contigs(mer, fq_recs, kmer_len, akmers, buff) :
logger = logging.getLogger('root')
ct = None
mer_reads ... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import scipy.signal
import random
import time
import sys
import logging
import six.moves.queue as queue
from collections import namedtuple
fro... | |
import math
import sys
import os
from rpython.rlib import rfloat, jit
from rpython.rlib.rarithmetic import r_uint, intmask, ovfcheck
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.objectmodel import we_are_translated
from hippy.objects.base import W_Root
from hippy.objects.boolobject import W_BoolObj... | |
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 License, or (at your option) any later version.
#
# This libra... | |
import re
import datetime
try:
from itertools import zip_longest
except:
from itertools import izip_longest as zip_longest
from .numbers import NumberService
class DateService(object):
"""Initialize a DateService for extracting dates from text.
Args:
tz: An optional Pytz timezone. All dateti... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'MonsterAttackModifier.xpModifier'
db.alter_column('mai... | |
from suds import MethodNotFound, WebFault
from suds.transport import TransportError
from suds.client import Client
from lxml import etree
from django.http import Http404
from .models import RefTimeSeries
from xml.sax._exceptions import SAXParseException
from datetime import datetime
import requests
def get_version(ro... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
import re
import random
import time
import json
import web
import urllib2
import reddit
from gui_client import new_rpc
import encoding
USE_API = False
def tag_get(tag, html):
return re.findall('<%s(?: (.*?))?>(.*?)</%s>' % (tag, tag), html)
def all_tags_get(html):
return re.findall('<(?P<tag>.*?)(?: (.*?)... | |
import json
import os
import time
from abc import ABC
import numpy as np
from tqdm import tqdm
from tensorflow import keras as tfk
from astroNN.config import MULTIPROCESS_FLAG
from astroNN.config import _astroNN_MODEL_NAME
from astroNN.models.base_master_nn import NeuralNetMaster
from astroNN.nn.callbacks import Virut... | |
# Copyright 2012 OpenStack Foundation
#
# 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... | |
# -*- coding: utf-8 -*-
"""
Plugins related to structure
"""
from hyde.ext.plugins.meta import Metadata
from hyde.plugin import Plugin
from hyde.site import Resource
from hyde.util import pairwalk
from fswrap import File, Folder
import os
from fnmatch import fnmatch
import operator
#
# Folder Flattening
#
class F... | |
#!/usr/bin/env python
# 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
#
# Authors:
# - Wen Guan, wen.guan@cern.ch, 2018
# - Alexey Anisenkov, anisyo... | |
# Copyright 2022 The T5 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 law or agreed to in writi... | |
# Copyright 2015 The TensorFlow Authors. 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 applica... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | |
#
# Module which deals with pickling of objects.
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from abc import ABCMeta, abstractmethod
import copyreg
import functools
import io
import os
import pickle
import socket
import sys
from . import c... | |
"""Create a new family report from an new genome trio. This requires putting all
three family genomes in a folder along with a descriptor file titled 'family_manifest.csv,'
which should have the following format:
filename,label,external_id,sex,format
NA19238.vcf.gz,CG Yoruban Mother,1,female,vcf.gz
NA19239.vcf.gz,CG Y... | |
#!/usr/bin/env python
import sys, os, subprocess
import shutil
import glob
VERBOSE = True
make_opt_parallel='-j4'
#export PATH=$PREFIX/bin:$PATH
#export LDFLAGS_FOR_TARGET="-L$PREFIX/sys_root/lib/arm-linux-gnueabihf -L$PREFIX/sys_root/usr/lib/arm-linux-gnueabihf"
#CFLAGS_FOR_TARGET="-I$PREFIX/sys-root/usr/include/a... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the component requirements behavior
:author: Thomas Calmant
"""
# Tests
from tests import log_on, log_off
from tests.interfaces import IEchoService
from tests.ipopo import install_bundle, install_ipopo
# Pelix
from pelix.framework import FrameworkFactor... | |
#!/usr/bin/env python
from pyon.core.exception import BadRequest, NotFound
from pyon.util.int_test import IonIntegrationTestCase
from pyon.util.context import LocalContextMixin
from pyon.event.event import EventSubscriber
from interface.services.coi.iresource_registry_service import ResourceRegistryServiceProcessClien... | |
# Copyright 2015 Patrick Ogenstad <patrick@ogenstad.com>
#
# 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... | |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# Allow to scan book pages every N seconds
# TODO:
# * after exchange cam1 and cam2, some keys seem incorrect
# * suppress error messages from libwebcam
from SimpleCV import *
import cv # using cv for windows display
import cv2 # now using cv2 for capture
from subprocess ... | |
# -*- coding: utf-8 -*-
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_... | |
# Copyright (C) 2004-2013 by Barry A. Warsaw
#
# This file is part of flufl.enum
#
# flufl.enum is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# flufl.enum is distributed in... | |
# mininode.py - Etp P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.com/j... | |
import numpy as np
from numpy.testing import (assert_array_almost_equal as assert_close,
assert_equal)
import scipy.ndimage
from skimage.feature import peak
np.random.seed(21)
def test_trivial_case():
trivial = np.zeros((25, 25))
peak_indices = peak.peak_local_max(trivial, min_dis... | |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | |
# Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
# quoc_trinh
import tensorflow as tf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import metrics
import os
import sys
import datetime
# get current... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.textfmts
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various text formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups
from pygments.to... | |
"""
Feed Exports extension
See documentation in docs/topics/feed-exports.rst
"""
import os
import sys
import logging
from tempfile import NamedTemporaryFile
from datetime import datetime
from urllib.parse import urlparse, unquote
from zope.interface import Interface, implementer
from twisted.internet import defer, t... | |
import math
import numpy as np
# DCG
def dcg(r, k=None):
"""The Burges et al. (2005) version of DCG.
This is what everyone uses (except trec_eval)
:param r: results
:param k: cut-off
:return: sum (2^ y_i - 1) / log (i +2)
"""
result = sum([(pow(2, rel) - 1) / math.log(rank + 2, 2) for ran... | |
from __future__ import annotations
from typing import (
Callable,
Hashable,
)
import warnings
import numpy as np
from pandas._libs import (
index as libindex,
lib,
)
from pandas._typing import (
Dtype,
npt,
)
from pandas.util._decorators import (
cache_readonly,
doc,
)
from pandas.uti... | |
#!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | |
"""Abstract Transport class."""
import sys
from .compat import flatten_bytes
_PY34 = sys.version_info >= (3, 4)
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport(object):
"""Base class for transpor... | |
"""The tests the History component."""
# pylint: disable=protected-access,invalid-name
from datetime import timedelta
import unittest
from unittest.mock import patch, sentinel
from homeassistant.setup import setup_component, async_setup_component
import homeassistant.core as ha
import homeassistant.util.dt as dt_util
... | |
import os
import numpy as np
import pandas as pd
import yaml
from typing import Collection
from larch.util import Dict
from pathlib import Path
from .general import (
remove_apostrophes,
construct_nesting_tree,
linear_utility_from_spec,
explicit_value_parameters,
apply_coefficients,
cv_to_ca,
... | |
import sqlite3, time, os, signal, argparse, cqUtils, cqStatus, ConfigParser, sys, md5
from multiprocessing import Process
from urlparse import parse_qs
from cqDB import cqDB
from cqPlugin import cqPlugin
from subprocess import Popen
from tempfile import gettempdir
class cmdQueue:
def __init__(self, args):
... | |
"""
These are the DTD-aware classes of xmlproc. They provide both the
DTD event consumers for the DTD parser as well as the objects that
store DTD information for retrieval by clients (including the
validating parser).
$Id: xmldtd.py,v 1.11 2000/09/26 14:43:10 loewis Exp $
"""
import types
from xmlutils import *
fro... | |
import inspect
import os.path
import sys
from _pydev_bundle._pydev_tipper_common import do_find
from _pydevd_bundle.pydevd_constants import IS_PY2
from _pydevd_bundle.pydevd_resolver import suppress_warnings
if IS_PY2:
from inspect import getargspec as _originalgetargspec
def getargspec(*args, **kwargs):
... | |
"""Support for Telldus Live."""
import asyncio
from functools import partial
import logging
from tellduslive import DIM, TURNON, UP, Session
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_SCAN_INTERVAL
import homeassistant.helpers.config_validation as cv
from ho... | |
import curses
import curses.textpad
import sys
sys.setrecursionlimit(300)
from hearthbreaker.agents import registry
from hearthbreaker.cards.heroes import hero_for_class
from hearthbreaker.constants import CHARACTER_CLASS
from hearthbreaker.engine import Game, Deck, card_lookup
from hearthbreaker.ui.game_printer impor... | |
# -*- coding: utf-8 -*-
import ast
import re
from collections import defaultdict
from .utils import GenericStack
from .utils import LeveledStack
from .utils import ScopeStack
from .utils import to_camel_case
from .utils import normalize
from . import ast as ecma_ast
class TranslateVisitor(ast.NodeVisitor):
def... | |
import os
import numpy as np
import pytest
import mbuild as mb
from mbuild.exceptions import MBuildError
from mbuild.utils.io import get_fn, has_intermol
from mbuild.tests.base_test import BaseTest
class TestCompound(BaseTest):
def test_load_and_create(self):
mb.load(get_fn('methyl.pdb'))
def test... | |
#!/usr/local/env python
# 2015-05-01 -- cwaigl@alaska.edu (Chris Waigl)
# Fire detection: GINA download and sync script
from __future__ import print_function, unicode_literals, division
import os
import sys
import argparse
import datetime as dt
import glob
import seaborn as sns
from pygaarst import raster
from pygaar... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
__source__ = 'https://leetcode.com/problems/maximum-gap/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/maximum-gap.py
# Time: O(n)
# Space: O(n)
# sort
#
# Description: Leetcode # 164. Maximum Gap
#
# Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
... | |
'''
TUIO Input Provider
===================
TUIO is the de facto standard network protocol for the transmission of
touch and fiducial information between a server and a client. To learn
more about TUIO (which is itself based on the OSC protocol), please
refer to http://tuio.org -- The specification should be of specia... | |
import inspect
import json
import re
from typing import Any, Dict, List, Optional, Pattern, Tuple
import markdown
from django.conf import settings
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
import zerver.openapi.python_examples
from zerver.openapi.openapi import get_open... | |
#!/usr/bin/python
# Import the login_required decorator which can be applied to views
# to enforce that the user should be logged in to access the view
from django.contrib.auth.decorators import login_required
# Import csrf_exempt to bypass csrf protections for ajax requests
# TODO: Don't bypass csrf protections
fro... | |
#!/usr/bin/env python2
import functools
import logging
import time
import unittest
from ThriftTest import ThriftTest
from ThriftTest.ttypes import Xception, Xtruct
from thrift.server.TTrolliusServer import (
ThriftClientProtocolFactory,
ThriftAsyncServerFactory,
)
from thrift.transport.THeaderTransport import... | |
"""
Scrapy engine tests
This starts a testing web server (using twisted.server.Site) and then crawls it
with the Scrapy crawler.
To view the testing web server in a browser you can start it by running this
module with the ``runserver`` argument::
python test_engine.py runserver
"""
from __future__ import print_... | |
import os
import numpy
try:
from PIL import Image
available = True
except ImportError as e:
available = False
_import_error = e
import bisect
import io
import six
import threading
import zipfile
import chainer
from chainer.dataset import dataset_mixin
def _read_image_as_array(path, dtype):
f = I... | |
# Copyright (c) 2010, 2011, 2012 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
# Copyright 2013 Cloudbase Solutions SRL
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Formatters for the exception data that comes from ExceptionCollector.
"""
# @@: TODO:
# Use this: http://www.zope.org/Members/tino/VisualTraceback... | |
#-------------------------------------------------------------------------------
# Script Tools - Argument and Config File Parser
#-------------------------------------------------------------------------------
import os
import ConfigParser
import argparse
import platform
import logging
LOGLEVELS = {'debug': logging.D... | |
import os
from flask import Flask, url_for, redirect, render_template, request
from flask_sqlalchemy import SQLAlchemy
from wtforms import form, fields, validators
import flask_admin as admin
import flask_login as login
from flask_admin.contrib import sqla
from flask_admin import helpers, expose
from werkzeug.security ... | |
#! /usr/bin/env python3
'''
tool for removing duplicate files
'''
import argparse
import functools
import hashlib
import logging
import os
import re
import sys
import textwrap
from collections import defaultdict, namedtuple
__author__ = 'Paul Schwendenman'
__email__ = 'schwendenman.paul+twintrim@gmail.com'
__license__... | |
import asyncio
import functools
import ssl
import sys
import traceback
import warnings
from collections import defaultdict
from hashlib import md5, sha1, sha256
from itertools import chain
from types import MappingProxyType
from yarl import URL
import aiohttp
from . import hdrs, helpers
from .client import ClientReq... | |
import logging
import os
import warnings
import six
from .. import auth, errors, utils
from ..constants import INSECURE_REGISTRY_DEPRECATION_WARNING
log = logging.getLogger(__name__)
class ImageApiMixin(object):
@utils.check_resource('image')
def get_image(self, image):
"""
Get a tarball o... | |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | |
#!/usr/bin/env python2.7
import random
from multiprocessing import Pool
import sys
import numpy as np
from deap import creator, base, tools
from seizure_prediction.classifiers import make_svm
from seizure_prediction.cross_validation.legacy_strategy import LegacyStrategy
from seizure_prediction.feature_selection impo... | |
import os
import uuid
from ...tools import row2dict, xls_reader
from datetime import datetime
from sqlalchemy import not_, func, and_
from sqlalchemy.sql.expression import literal_column
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
import colander
from defo... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
from botocore.exceptions import ClientError
from concurrent.futures import as_completed
from c7n.manager import resources, ResourceManager
from c7n.query import QueryResourceManager, TypeInfo
from c7n.utils import local_session, ... | |
import io
import random
import string
import textwrap
import pytest
import numpy as np
import pandas as pd
import validate_docstrings
validate_one = validate_docstrings.validate_one
class GoodDocStrings:
"""
Collection of good doc strings.
This class contains a lot of docstrings that should pass the val... | |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | |
from __future__ import unicode_literals
import os
from collections import OrderedDict
from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import FileSystemStorage
from django.core.management.base import BaseComman... | |
#!/usr/bin/python
"""
Returns a bed-like translation of a CDS in which each record corresponds to
a single site in the CDS and includes additional fields for site degenaracy,
position ind CDS, and amino acid encoded.
usage: %prog nibdir genefile [options]
-o, --outfile=o: output file
-f, --format=f: ... | |
import sys
import time
class Graph(object):
"""
Defines an undirected graph with dictionary structure {}
"""
def __init__(self):
self._edges = dict()
self._nodes = list()
def _add_node(self, node):
"""
Adds a node to the list of nodes in a Graph.
:type n... | |
# -*- coding: utf-8 -*-
"""Redis store.
Only supports task storage at the moment.
"""
import uuid
import redis
from plaso.containers import events
from plaso.lib import definitions
from plaso.storage import identifiers
from plaso.storage import interface
from plaso.storage import logger
class RedisStore(interface... | |
'''Imports'''
import sys
'''Parse'''
def parse_rail_file(filename):
nodes = []
edges = []
node_counter = 0
edge_counter = 0
flow = 0
parsing_nodes = False
parsing_edges = False
total_nodes = 0
total_edges = 0
with open(filename) as f:
lines = f.readlines()
... | |
#!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.