gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
################################################################################
# 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... | |
"""Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from ..utils import check_random_state
from ..utils.arpack import eigsh
from ..utils.validation import check_is_fitted, check_array
from ..exceptions import ... | |
"""Python implementation of a Bayesian probabilistic learner.
This model was originally described in Behrens et al. Nat Neuro 2007.
The code here was adapted from the original C++ code provided by
Tim Behrens.
"""
from __future__ import division
import numpy as np
from numpy import log, exp, power, pi
from scipy.spe... | |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | |
# -*- test-case-name: depixel.tests.test_bspline -*-
"""
This is a limited quadratic B-spline library.
The mathematics mostly comes from some excellent course notes on the web:
http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/
More specifically, De Boor's Algorithm is at:
http://www.cs.mtu.edu/~shene/COURSES/cs36... | |
import numpy as np
import pandas as pd
from statsmodels.imputation import mice
import statsmodels.api as sm
from numpy.testing import assert_equal, assert_allclose, dec
try:
import matplotlib.pyplot as plt #makes plt available for test functions
have_matplotlib = True
except:
have_matplotlib = False
pdf_... | |
# TNC Python interface
# @(#) $Jeannot: tnc.py,v 1.11 2005/01/28 18:27:31 js Exp $
# Copyright (c) 2004-2005, Jean-Sebastien Roy (js@jeannot.org)
# 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 Soft... | |
"""
Tools for reading, writing, parsing, and otherwise working with files.
Author: Jerrad Michael Genson
Email: auteur@jerradgenson.33mail.com
License: BSD 3-Clause
Copyright 2016 Jerrad Michael Genson
"""
# Python built-in modules
import json
import re
from collections import namedtuple
from pathlib import Path
fro... | |
#!/usr/bin/python
"""
Based on the work of Dave Pallot
https://github.com/dpallot/simple-websocket-server
The MIT License (MIT)
Copyright (c) 2013 Dave P.
"""
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
import multiprocessing
import logging
from message import WebsocketMsg
import... | |
# !/usr/bin/env/python3
# Copyright (c) Facebook, Inc. and its affiliates.
# 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 ... | |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2013 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import thinkbayes
import thinkplot
"""This file contains a solution to an exer... | |
from unittest import TestCase
from mock import Mock, patch
from opensrs import opensrsapi, xcp, errors
from opensrs.constants import OrderProcessingMethods
from opensrs.opensrsapi import OpenSRS, is_auto_renewed
from test_settings import CONNECTION_OPTIONS
def disabletest(func):
func.__test__ = False
return... | |
###################################################################################################
# Module: network_prep.py
# Description: Preparing raw data into Python objects that are ready to be simulated
# Authors: Bramka Arga Jafino, Philipp Schwarz
# Web: https://github.com/bramkaarga/transcrit
###############... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
'''
<<<<<<< HEAD
This module specifies a dynamic model of fashion selection in a world with only
two styles: jock and punk. Forward-looking agents receive utility from the style
they choose based on the proportion of the population with the same style (as
well as direct preferences each style), and pay switching costs ... | |
import calendar
from corehq.apps.accounting.models import *
from corehq.apps.reports.filters.base import (
BaseReportFilter, BaseSingleOptionFilter
)
from corehq.apps.reports.filters.search import SearchFilter
from dimagi.utils.dates import DateSpan
from django.utils.translation import ugettext_noop as _
class Ac... | |
import tensorflow as tf
from utils import get_topk_index
from model_utils import sharded_variable, LSTMCell
from common import assign_to_gpu, average_grads, find_trainable_variables
from hparams import HParams
class inference_graph(object):
def __init__(self, hps):
self.x = tf.placeholder(tf.int32,[1])
... | |
#!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import prod... | |
# 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... | |
"""Module for SymPy containers
(SymPy objects that store other SymPy objects)
The containers implemented in this module are subclassed to Basic.
They are supposed to work seamlessly within the SymPy framework.
"""
from __future__ import print_function, division
from sympy.core.basic import Basic
from sy... | |
#!/usr/bin/env python
# basic_rl.py (v0.0.5)
#
# New in v0.0.5
# - implemented a simple eligibility trace (Q-lambda and SARSA-lambda).
# - Set the minimum value of epsilon.
#
# New in v0.0.4
# - This version uses `gym.wrapper` to store results of the simulaiton.
# - A random seed can be set through command line argumen... | |
from configparser import ConfigParser, ExtendedInterpolation
import sys
from external.amazon_scraper import AmazonScraper
import time
import datetime
import logging.config
import os.path
from utilities import getSentencesFromReview, Sentence, Review, Product, loadScraperDataFromDB
import nltk
from srs import settings
f... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from csacompendium.indicators.models import ResearchOutcomeIndicator
from csacompendium.csa_practice.models import ResearchCsaPractice
from csacompendium.utils.abstractmodels import (
AuthUserDetail,
CreateUpdateTime,
)
from csacompendium.utils.cr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010-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
#
# ... | |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | |
from collections import OrderedDict
expected = [
OrderedDict(
[
("mediaType", "application/zip"),
("uri", u"elife-04493-supp-v1.zip"),
("filename", u"elife-04493-supp-v1.zip"),
("id", "SD1-data"),
("label", "Supplementary file 1."),
]
... | |
# Copyright 2015 Mirantis, 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 a... | |
# Copyright (c) 2012 - 2014 EMC Corporation.
# 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
#
# Unle... | |
import logging
from collections import namedtuple
from .kepler import Kepler
from .keplernum import KeplerNum
__all__ = ["SoIAnalytical", "SoINumerical"]
log = logging.getLogger(__name__)
SOI = namedtuple("SOI", "radius frame")
class _SoI:
SOIS = {
"Mercury": SOI(112408000, "Mercury"),
"Venus... | |
# Lint as: python3
# Copyright 2019 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 ... | |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | |
import json, csv
def fixBeschrijvingen(inputFile, output):
lines = open(inputFile).read().split('\n')
outputFile = open(output, "w")
for i,line in enumerate(lines):
if i+1 < len(lines) and lines[i+1][:2] == "- " and lines[i+2][:3] != "..." and lines[i+2][:2] != "- ":
line = line+lines... | |
# This file contains a series of functions were reading and working with raster
# data.
#
# last modified: 11/01/2012
#
# David Lampert
import gdal, osr, ogr, gdalnumeric, time
from gdalconst import GA_ReadOnly
from itertools import chain
from numpy import empty, array, where
from PIL ... | |
# -*- coding: utf-8 -*-
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if django.VERSION < (2, 0):
from django.core.urlresolvers import (
NoReverseMatch,
resolve,
Resolver404,
reverse,
)
else:
from django.urls import (... | |
################################################################################
# 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... | |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (c) 2001-2002, MetaSlash Inc. All rights reserved.
"""
Module to hold manipulation of elements on the stack.
"""
import types
from pychecker import utils
DATA_UNKNOWN = "-unknown-"
LOCALS = 'locals'
# These should really be defined by subclasses
TYPE_U... | |
from __future__ import annotations
import logging
from datetime import datetime
from functools import lru_cache
from pathlib import Path
from typing import Any, Iterable, NamedTuple, Optional
from PyQt5.QtCore import QRect, QRectF, Qt
from PyQt5.QtGui import (QColor, QFont, QFontMetrics, QImage, QPainter, QPen,
... | |
import unittest
import itertools
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import conv
from chainer.util... | |
import gevent
from gevent import monkey, GreenletExit
import six
from six.moves import xrange
monkey.patch_all(thread=False)
from time import time
import sys
import random
import warnings
import traceback
import logging
from .clients import HttpSession
from . import events
from .exception import LocustError, Interr... | |
"""Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... | |
"""Test the Netatmo config flow."""
from unittest.mock import patch
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.netatmo import config_flow
from homeassistant.components.netatmo.const import (
CONF_NEW_AREA,
CONF_WEATHER_AREAS,
DOMAIN,
OAUTH2_AUTHORIZE,... | |
#!/usr/bin/env python2
from math import*
import re
import logging
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.decomposition import PCA, TruncatedSVD
import seaborn as sns
import nltk as nl
from nltk.stem.snowball import SnowballStemmer... | |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
import cgi
import time
import functools
from itsdangerous import SignatureExpired, BadSignature
from werkzeug.http import dump_cookie
from werkzeug.wsgi import get_current_url
from werkzeug.utils import redirect
from werkzeug.routing import... | |
"""Firewall rule representation"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
ANY_IP = '0.0.0.0/0'
ANY_PORT = 0
class DNATRule(object):
"""Definition of a DNAT Rule
:param ``str`` new_dst_ip:
... | |
import asyncio
import importlib
import inspect
import aiohttp
from bot.logger import new_logger
from .command import Command
import modules as bot_modules
from bot import modules as sys_modules
from .lib.common import is_pm
modules = ['modules.' + x for x in bot_modules.__all__] + ['bot.modules.' + x for x in sys_m... | |
"""
Testing the support of KISAO terms for SED-ML simulations.
test_sedml_phrasedml.py : phrasedml based tests.
test_sedml_kisao.py : SED-ML kisao support
test_sedml_omex.py : SED-ML tests based on Combine Archives
test_sedml_sedml.py : sed-ml tests
"""
from __future__ import absolute_import, print_fun... | |
import math
import random
import warnings
import torch
def calculate_gain(nonlinearity, param=None):
r"""Return the recommended gain value for the given nonlinearity function.
The values are as follows:
================= ====================================================
nonlinearity gain
... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import mimetypes
from io import BytesIO
from flask import flash, jsonify, redirect, request, session
from... | |
from sklearn.linear_model import LinearRegression as _sklearn_LinearRegression
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn import preprocessing
from sklearn.base import TransformerMixin
from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C, RationalQuadratic as RQ
from s... | |
"""Component to integrate the Home Assistant cloud."""
from datetime import datetime, timedelta
import json
import logging
import os
import voluptuous as vol
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, CLOUD_NEVER_EXPOSED_ENTITIES, CONF_REGION,
CONF_MODE, CONF_NAME)
from homeassistant.helpers... | |
"""Bayesian Gaussian Mixture Models and
Dirichlet Process Gaussian Mixture Models"""
from __future__ import print_function
# Author: Alexandre Passos (alexandre.tp@gmail.com)
# Bertrand Thirion <bertrand.thirion@inria.fr>
#
# Based on mixture.py by:
# Ron Weiss <ronweiss@gmail.com>
# Fabian Ped... | |
'''
The MIT License (MIT)
Copyright (c) 2013 Dave P.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publ... | |
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... | |
# -*- coding: utf-8 -*-
"""High level wrapper for MessageBased Instruments.
This file is part of PyVISA.
:copyright: 2014-2020 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import contextlib
import struct
import time
import warnings
from typing import Any, Callable... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | |
# Copyright (c) 2015-2018 Cisco Systems, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge,... | |
import json
import os
import struct
import requests
from flask import request, make_response
from flask_user import login_required, current_user
from bootstrap import db, cont_ext, policy_mode, kex_url
from bootstrap.models import AttrAuth
from cm import cm, models
from const import basedir
@cm.route('', methods=[... | |
#!/usr/bin/env python
"""
make config files to visualize data from selftracking
parcellations (from Wash U) using Circos
based on tutorial from van horn group - http://circos.ca/documentation/tutorials/recipes/cortical_maps/
use mean connectivity for outer ring and power modules for inner ring
"""
import os,sys
im... | |
"""
Async workers for Bitstamp API polling, trading, etc.
"""
import logging
from itertools import groupby
from operator import itemgetter
import redis
from django.conf import settings
from django.db.models import Q
from django.utils import timezone
from django.db.models.query import QuerySet
from tornado.gen import ... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
# Natural Language Toolkit: Semantic Interpretation
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
#
# Copyright (C) 2001-2012 NLTK Project
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions for batch-processing sentences: parsing and
extraction of the semantic representation of... | |
"""
Generative Adversarial Networks
"""
import datetime
import os
import numpy as np
import tensorflow as tf
from .base import GANModel
from .blocks import BasicGenerator, BasicDiscriminator
from ..train import IncrementalAverage
class GAN(GANModel):
def __init__(self,
sess,
X... | |
from abc import ABCMeta, abstractmethod
import numpy.random as rd
from complexism.element import Event, StepTicker
from ..modifier import GloRateModifier, LocRateModifier, BuffModifier, NerfModifier
from .behaviour import PassiveModBehaviour, ActiveModBehaviour
from .trigger import StateTrigger
__author__ = 'TimeWz667'... | |
import retrieveBase
import logging
import retrieveHttps
import retrieveHttpsIgtfTa
import retrieveFacard
def Property(func):
return property(**func())
class retrieve(retrieveBase.retrieve):
def __init__(self, *args, **kwargs):
retrieveBase.retrieve.__init__(self,args,kwargs)
self.port_default... | |
from glob import glob
import textwrap
import os
from os.path import abspath, join
import string
import SCons.Action
import SCons.Builder
import SCons.Defaults
import SCons.Tool
import SCons.Util
# This is what we search for to find mingw:
key_program = 'arm-none-symbianelf-gcc'
from scons_symbian import arguments a... | |
'''Cabal project file reader.
'''
import os.path
import platform
# import pprint
class IndentedFileReader(object):
'''An indented file parser that roughly mimics the Haskell Distribution.Parsec code used to parse both
Cabal project specifications and Cabal's configuration files..
'''
# Parser tokens:... | |
"""
mmhistorytools - tools for cleaning, condensing, and reformatting history data
"""
from .version import __version__
import argparse
from dateutil.parser import parse
import json
from openaps.uses.use import Use
from historytools import TrimHistory, CleanHistory, ReconcileHistory
from historytools import Resolv... | |
import socket
import threading
import sys
import os
import base64
import random
import ssl
import traceback
import core
import pexpect
import re
from colorama import *
from Crypto.Cipher import AES
from Crypto import Random
from datetime import datetime
GOOD = Fore.GREEN + " + " + Fore.RESET
BAD = Fore.RED + " - " + ... | |
from django.conf import settings as django_settings
from django.db import transaction
from django.http import JsonResponse
from rest_framework import generics
from rest_framework import permissions as drf_permissions
from rest_framework import status
from rest_framework.decorators import api_view, throttle_classes
from... | |
from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import warnings
import zipfile
from distutils.util import change_root
from distutils import sysconfig
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from pip._vendor.dist... | |
# -*- coding: utf-8 -*-
"""Calendar is a dictionary like Python object that can render itself as VCAL
files according to rfc2445.
These are the defined components.
"""
from datetime import datetime
from icalendar.caselessdict import CaselessDict
from icalendar.parser import Contentline
from icalendar.parser import Con... | |
# -*- coding: utf-8 -*-
#
# xray documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 6 18:57:54 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | |
import sys, getopt, os
from Adafruit_PWM_Servo_Driver import PWM
sys.path.append('.')
import RTIMU
import os.path
from time import sleep
import math
import picamera
import RPi.GPIO as GPIO
import numpy
import subprocess as sp
import signal
from Adafruit_BME280 import *
from Adafruit_ADS1x15 import ADS1x15
#########... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from ..engine import Layer, InputSpec
from .. import backend as K
class Wrapper(Layer):
def __init__(self, layer, **kwargs):
self.layer = layer
self.uses_learning_phase = layer.uses_learning_phase
super(Wrapper, self).__init__(**kwargs)
def build(self, input_shape=None):
'''A... | |
from __future__ import unicode_literals
from tests import EXAMPLE_AMI_ID
template = {
"Description": "AWS CloudFormation Sample Template vpc_single_instance_in_subnet.template: Sample template showing how to create a VPC and add an EC2 instance with an Elastic IP address and a security group. **WARNING** This tem... | |
# coding: utf-8
"""
Katib
Swagger description for Katib # noqa: E501
The version of the OpenAPI document: v1beta1-0.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubeflow.katib.configuration import Configuration
class V1beta1Suggestion... | |
from sqlalchemy import tuple_, or_, and_, inspect
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.ext.associationproxy import ASSOCIATION_PROXY
from sqlalchemy.sql.operators import eq
from sqlalchemy.exc import DBAPIError
from sqlalchemy.orm.attributes import InstrumentedAttribute
from flask_admin._c... | |
import calendar
import logging
import types
import unicodedata
from datetime import datetime
import regex as re
from tzlocal import get_localzone
from pytz import UTC, timezone, UnknownTimeZoneError
from collections import OrderedDict
from dateparser.timezone_parser import _tz_offsets, StaticTzInfo
def strip_braces... | |
"""Fixtures for component."""
from unittest.mock import patch
from pyatv import conf
from pyatv.const import PairingRequirement, Protocol
from pyatv.support import http
import pytest
from .common import MockPairingHandler, airplay_service, create_conf, mrp_service
@pytest.fixture(autouse=True, name="mock_scan")
de... | |
# -*- coding:utf-8 -*-
import logging
import simplejson
import datetime
from django.contrib.auth import login, load_backend, BACKEND_SESSION_KEY
from django.core.exceptions import MultipleObjectsReturned
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response... | |
# -*- codeing: utf-8 -*-
# Dragon Knight main application
from __future__ import print_function
import logging
import pkgutil
import inspect
from ryu import app as ryu_app
from ryu.lib import hub
from ryu.app.wsgi import WSGIApplication
from ryu.base import app_manager
from ryu.controller.handler import MAIN_DISPATCHE... | |
#
# Copyright 2016 SUSE 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 to in writing, softw... | |
# 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 t... | |
from __future__ import division, print_function, absolute_import
import itertools
import numpy as np
from numpy.testing import assert_allclose
from scipy.integrate import ode
def _band_count(a):
"""Returns ml and mu, the lower and upper band sizes of a."""
nrows, ncols = a.shape
ml = 0
for k in rang... | |
#! /usr/bin/env python
from __future__ import print_function
import sys
import os
import io
import csv
import argparse
import redis
import json
import math
import logging
import hug
import tempfile
import humanfriendly
import yaml
import copy
import multiprocessing
from pyfasta import Fasta
from bigsi.version import _... | |
import json
from django.conf import settings
from django.contrib.admin import helpers
from django.contrib.contenttypes.admin import GenericInlineModelAdmin
from django.contrib.staticfiles.storage import staticfiles_storage
try:
# Django 1.10
from django.urls import reverse
except ImportError:
# Django <= 1... | |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 copyrig... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | |
import hashlib
import logging
import os
import pickle
from functools import partial
import boto3
import elasticsearch
import elasticsearch_dsl
import requests
from biothings.utils.common import run_once
from elasticsearch import AIOHttpConnection
from elasticsearch import RequestsHttpConnection as _Conn
from requests_... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# pylint: disable-msg=C0103
# pylint: disable-msg=C0301
# pylint: disable-msg=W0611
# pylint: disable-msg=W0612
# pylint: disable-msg=W0702
# pylint: disable-msg=W0703
# pylint: disable-msg=W0621
# pylint: disable-msg=R0913
"""
Massive GitHub repo clonning
"""
import os
i... | |
# -*- coding: utf-8 -*-
"""
This serialiser will output an RDF Graph as a JSON-LD formatted document. See:
http://json-ld.org/
Example usage::
>>> from rdflib.plugin import register, Serializer
>>> register('json-ld', Serializer, 'rdflib_jsonld.serializer', 'JsonLDSerializer')
>>> from rdflib import... | |
import os.path
import os
import sys
import copy
from ipp import *
from gpp import *
from gcc import *
from mingw import *
from default import *
from vc9 import *
from clangpp import *
from colors import *
#PLEASE change it if you don't want the standard snocs location
PROJECTS_SRC_PATH = os.getenv('SNOCS_PROJECTS_SRC... | |
import token_names as tokens
import abstract_syntax_tree as AST
class Parser(object):
def __init__(self, lexer):
self.lexer = lexer
self.current_token = self.lexer.get_next_token()
def error(self, message):
raise Exception(message)
def consume(self, token_type):
if self.cu... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | |
# Copyright 2013 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... | |
###################################################
# header items.py
# This file contains declarations for items
# DO NOT EDIT THIS FILE!
###################################################
from header_common import *
from header_item_modifiers import *
#item flags
itp_type_horse = 0x0000000000000001
itp... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, sys
from frappe import _
from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta,
sanitize_html, sanitize_email)
from frapp... | |
import os
os.putenv("DEBIAN_FRONTEND", "noninteractive")
import sys
import apt
import apt_pkg
from upd89.classes.update import Update
from upd89.classes.package import Package
from upd89.classes.packagelist import Packagelist
from upd89.classes.repository import Repository
from upd89.classes.package_version import Pack... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.