gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography import utils
@six.add_metacla... | |
"""String generation"""
import re
from string import Formatter
dflt_formatter = Formatter()
########### Partial and incremental formatting #########################################################################
# TODO: Make .vformat (therefore .format) work with args and kwargs
# TODO: Make it not blow up and cons... | |
# coding=utf-8
# Copyright 2019 The Interval Bound Propagation 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 ... | |
# -*- coding: utf-8 -*-
"""
Project Tracking & Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
mode_task = settings.get_project_mode_task()
# =================================================... | |
import mock
import django.test
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.cache import cache
from django.template import context
from ..models import Token
from ..middle... | |
#!/usr/bin/env/python
import wx
from collections import deque
class SnakeGame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(300,350), style = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
# Initialize status bar
self.statusB... | |
"""
@package mi.dataset.parser.test
@file mi-dataset/mi/dataset/parser/test/test_phsen_abcdef_imodem.py
@author Joe Padula
@brief Test code for the phsen_abcdef_imodem parser
"""
__author__ = 'Joe Padula'
import os
from nose.plugins.attrib import attr
from mi.core.exceptions import UnexpectedDataException
from mi.... | |
#!/usr/bin/env python
import os
import sys
import logging
import click
import textwrap
import shutil
from mkdocs import __version__
from mkdocs import utils
from mkdocs import config
if sys.platform.startswith("win"):
try:
import colorama
except ImportError:
pass
else:
colorama.i... | |
import logging
import warnings
from twisted.internet import defer
from twisted.trial import unittest
from pytest import raises
import scrapy
from scrapy.crawler import Crawler, CrawlerRunner, CrawlerProcess
from scrapy.settings import Settings, default_settings
from scrapy.spiderloader import SpiderLoader
from scrapy... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import re
import logging
import threading
import parsers
import apirdflib
#from apirdflib import rdfGetTargets, rdfGetSources
logging.basicConfig(level=logging.INFO) # dev_appserver.py --log_level debug .
log = logging.getLogger(__name__)
schemasInitialized =... | |
#!/usr/bin/env python
# 12.01.2007, c
"""
Probe finite element solutions in points defined by various geometrical probes.
Generation mode
---------------
python probe.py [generation options] <input file> <results file>
Probe the data in the results file corresponding to the problem defined in the
input file. The inpu... | |
import time
import os.path
import bencode
from django.db import models
from django.utils import timezone
from django.utils.functional import cached_property
from pyquery.pyquery import PyQuery
from bibliotik.settings import BIBLIOTIK_GET_TORRENT_URL
from home.models import TransTorrentBase
from what_transcode.utils i... | |
import numpy as np
from math import ceil
import tensorflow as tf
# import backprojecting_layer.backprojecting_op as backproject_op
# import backprojecting_layer.backprojecting_op_grad
# import projecting_layer.projecting_op as project_op
# import projecting_layer.projecting_op_grad
# import computing_label_layer.comput... | |
# 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... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
#!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from elasticsearch import... | |
# 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 ... | |
# 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 ... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
#!/usr/bin/env python
from __future__ import unicode_literals
import datetime
import json
import unittest
import webapp2
import main
from models.score import ScoreModel
from lib.constants import DATA_BLOB as d
from lib.constants import HTTP_CODE as http_code
from lib.constants import NFL as nfl
from lib.constants im... | |
#
# 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
# ... | |
# Generated by Django 2.1.4 on 2018-12-27 08:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Dbnfsp',
fields=[
... | |
#
# Copyright (c) SAS Institute 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 agreed to in w... | |
#!/usr/bin/python
from gevent import monkey
monkey.patch_all()
import logging
import gevent
from gevent.coros import BoundedSemaphore
from kafka import KafkaClient, KeyedProducer, SimpleConsumer, common
from uveserver import UVEServer
import os
import json
import copy
import traceback
import uuid
import struct
import ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for dealing with HEALPix projections and mappings
"""
from __future__ import absolute_import, division, print_function
import re
import healpy as hp
import numpy as np
from astropy.io import fits
from astropy.wcs import WCS
from astropy.coord... | |
# Copyright (c) 2013 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... | |
import os
import logging
import claripy
from cle import MetaELF
from cle.address_translator import AT
from archinfo import ArchX86, ArchAMD64, ArchARM, ArchAArch64, ArchMIPS32, ArchMIPS64, ArchPPC32, ArchPPC64
from ..tablespecs import StringTableSpec
from ..procedures import SIM_PROCEDURES as P, SIM_LIBRARIES as L
fr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... | |
#
# PGDB x86 32bit architecture module
#
# implementation notes:
# - don't create class objects in this module that are not quickly
# released by pgdb.py. the x86 modules get switched out dynamically
# when qemu switches in and out of 64bit mode!
# - syntax errors in this module can be found by running... | |
import collections.abc
import contextlib
import copy
import itertools
import random
import string
import threading
from functools import total_ordering, wraps
from typing import TYPE_CHECKING, Iterable, List, Optional, Union
from loguru import logger
from sqlalchemy import Column, Integer, String, Unicode
from flexge... | |
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# 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 condit... | |
# -*- coding: utf-8 -*-
"""Provides `nTorque <http://ntorque.com>`_ task queue clients."""
__all__ = [
'DEFAULTS',
'HookDispatcher',
'WebTestDispatcher',
'WorkEngineClient',
'get_torque_api',
'includeme',
]
import logging
logger = logging.getLogger(__name__)
import json
import os
import urlp... | |
"""
Handlers for predicates related to set membership: integer, rational, etc.
"""
from __future__ import print_function, division
from sympy.assumptions import Q, ask
from sympy.assumptions.handlers import CommonHandler, test_closed_group
from sympy.core.numbers import pi
from sympy.functions.elementary.exponential i... | |
# Copyright (c) 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 ... | |
import datetime
from unittest import skipIf, skipUnless
from django.db import connection
from django.db.models import CASCADE, ForeignKey, Index, Q
from django.test import (
TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature,
)
from django.test.utils import override_settings
from django.utils impo... | |
#!/usr/bin/python
# (C) Copyright 2018 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
from django.shortcuts import render,resolve_url,redirect
from django.template.response import TemplateResponse
from django.core.urlresolvers import reverse,reverse_lazy
from django.contrib.auth.views import deprecate_current_app
from django.views.decorators.csrf import csrf_protect
from django.views.decorators.cache im... | |
import os
import struct
import scipy.spatial, scipy.optimize
import numpy as np
from ibex.utilities import dataIO
from ibex.utilities.constants import *
def ReadSkeletonEndpoints(filename):
endpoints = []
with open(filename, 'rb') as fd:
zres, yres, xres, max_label, = struct.unpack('qqqq', fd.read... | |
"""Database models for tracking project schema history."""
from __future__ import unicode_literals
import json
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import post_init
from django.utils.timezone import now
from django_evolution.compat import six
... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
import time
import json
from c7n.exceptions import PolicyValidationError
from .common import event_data
class TestGlueConnections(BaseTest):
def test_connections_query(self):
session_factory = self... | |
# Thanks to Zhao Yu for converting the .ipynb notebook to
# this simplified Python script that I edited a little.
# Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
import tensorflow as tf
import numpy as np
import matplotlib
import mat... | |
#!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, InvalidRequestError
from jso... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import redis, frappe, re
from six.moves import cPickle as pickle
from frappe.utils import cstr
from six import iteritems
class RedisWrapper(redis.Redis):
"""Redis client that w... | |
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
class Use... | |
"""Command line interface tests."""
# pylint: disable=missing-function-docstring,protected-access,no-self-use
# pylint: disable=redefined-outer-name,missing-class-docstring
from datetime import datetime, timedelta
from os.path import expanduser
from typing import NamedTuple, Optional
import json
import pathlib
import r... | |
import os
import io
import re
import pytest
from contextlib import redirect_stdout
import numpy as np
from sklearn.neighbors import KDTree
from sklearn.neighbors import NearestNeighbors
from sklearn.preprocessing import normalize
import pickle
import joblib
import scipy
from pynndescent import NNDescent, PyNNDescentT... | |
# coding=utf-8
# Copyright 2022 The init2winit Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create()
NORTH = 2
SOUTH = 0
def fill(start_x, start_y, start_z, block=49, size=5, facing=NORTH):
for x in range(0, size):
for y in range(0, 5):
mc.setBlock(start_x + (facing-1) * x, start_y + y, start_z, block)
def a(x, y, z, fg_b... | |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
import importlib
import os
import shlex
import traceback
from xml.dom import minidom
from .util import make_dirs, remove_tree
def get_rerun_targets(xml_file: str):
test_targets = []
doc = minidom.parse(xml_file)
if doc.documentElement.nodeName == "testsuites":
root = doc.documentElement
else:... | |
from __future__ import absolute_import
from __future__ import print_function
import os
import sublime
from .const import AUTO_FORMAT_FILE_EXTENSIONS
from .const import IS_ST3
from .const import PLUGIN_NAME
from .const import PRETTIER_OPTIONS_KEY
from .const import PROJECT_SETTINGS_KEY
from .const import SETTINGS_FILE... | |
#!/usr/bin/env python
###############################################################################
#
# genomeCoverage.py version 1.0
#
# Calculates windowed coverage across a genome and finds mate
# matches and positions for each genome scaffold using a SAM file
#
# Calculates GC content across genom... | |
from collections import Iterable
from common.exceptions import LogicError
from ledger.ledger import Ledger
from plenum.common.constants import AUDIT_LEDGER_ID, TXN_VERSION, AUDIT_TXN_VIEW_NO, AUDIT_TXN_PP_SEQ_NO, \
AUDIT_TXN_LEDGERS_SIZE, AUDIT_TXN_LEDGER_ROOT, AUDIT_TXN_STATE_ROOT, AUDIT_TXN_PRIMARIES, AUDIT_TXN_... | |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | |
import unittest
import re
from django.conf import settings
from django.contrib.auth.models import User
from tango_comments import signals
from tango_comments.models import Comment
from . import CommentTestCase
from tests.testapp.models import Article, Book
post_redirect_re = re.compile(r'^/posted/\?c=(?P<pk>\d+$)... | |
#
# 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... | |
#!/usr/bin/env python
"""Standard actions that happen on the client."""
import cStringIO as StringIO
import ctypes
import gzip
import hashlib
import os
import platform
import socket
import sys
import time
import zlib
import psutil
import logging
from grr.client import actions
from grr.client import client_utils_c... | |
"""Support for a Hue API to control Home Assistant."""
import logging
from aiohttp import web
from homeassistant import core
from homeassistant.components import (
climate, cover, fan, light, media_player, scene, script)
from homeassistant.components.climate.const import (
SERVICE_SET_TEMPERATURE, SUPPORT_TAR... | |
# pylint:skip-file
from collections import namedtuple
import mxnet as mx
from stt_layer_batchnorm import batchnorm
LSTMState = namedtuple("LSTMState", ["c", "h"])
LSTMParam = namedtuple("LSTMParam", ["i2h_weight", "i2h_bias",
"h2h_weight", "h2h_bias",
... | |
from __future__ import print_function
from itertools import chain
import pytest
pd = pytest.importorskip('pandas')
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import ExtraTreesRegressor
from eli5 import (
format_as_dataframes, format_as_dataframe,
explain_weights... | |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | |
# To make forward fast
import os
os.environ["CHAINER_TYPE_CHECK"] = "0"
import six
import itertools
import numpy as np
import multiprocessing
import chainer
from chainer import serializers
from chainer import cuda
import nutszebra_log2
import nutszebra_utility
import nutszebra_sampling
import nutszebra_download_cifar10... | |
# Copyright 2018 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... | |
import logging
from typing import Optional
from gi.repository import Gtk
from sastool.io.credo_cct import Header, Exposure
from ..core.functions import update_comboboxtext_choices
from ..core.plotcurve import PlotCurveWindow
from ..core.plotimage import PlotImageWindow
from ..core.toolwindow import ToolWindow
from ..... | |
from OpenGL.GL import *
from PyQt4 import QtGui
from PyQt4.QtCore import *
from PyQt4.QtOpenGL import *
import math
GLUT_UP = 1
GLUT_DOWN = 0
GLUT_ACTIVE_CTRL = 2
GLUT_ACTIVE_SHIFT = 1
GLUT_ACTIVE_ALT = 4
keymap = {Qt.Key_F1:'f1',
Qt.Key_F2:'f2',
Qt.Key_F3:'f3',
Qt.Key_F4:'f4',
Qt.Key_F5:'f5',
Qt.... | |
#!/usr/bin/python
# Download WHO geographic distribution of COVID-19 cases worldwide
# Source : European Centre for Disease Prevention and Control
# Plot cases and deaths for selected countries
# The downloaded spreadsheet is stored locally in Covid-19.csv
# To use cached local spreadsheet, use "-l" option
# Intermedi... | |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc. All Rights Reserved.
"""Testing mapreduce functionality end to end."""
import datetime
import logging
import random
import string
import unittest
from google.appengine.ext import ndb
from google.appengine.api import files
from google.appengine.ext import db
fr... | |
import inspect
import asplib.asp.codegen.python_ast as ast
import asplib.asp.codegen.cpp_ast as cpp_ast
import asplib.asp.codegen.ast_tools as ast_tools
import codepy.cgen
import asplib.asp.jit.asp_module as asp_module
from collections import namedtuple
class IfNotDefined(cpp_ast.Generable):
"""
A generable A... | |
import os
import unittest
import uuid
import floe
import webtest
import json
import wsgiadapter
import logging
import socket
import floe.restapi
import floe.connector
import time
import pymysql
wsgiadapter.logger.addHandler(logging.NullHandler())
mysql_user = os.getenv('MYSQL_USER', 'root')
mysql_pass = os.getenv('MY... | |
import collections
import datetime
import json
from django.urls import reverse
from django.utils import timezone
from wagtail.api.v2.tests.test_pages import TestPageDetail, TestPageListing
from wagtail.core.models import Page
from wagtail.tests.demosite import models
from wagtail.tests.testapp.models import SimplePag... | |
#!/usr/bin/python
##Time
from datetime import datetime, timedelta
from time import gmtime, strftime, sleep
##Data Acqusition
from xml.dom import minidom
import urllib2
import json
import feedparser
##Scheduling
import schedule
import time
## Raspberry libraries
import RPi.GPIO as GPIO
from RPLCD import CharLCD
##... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 New Dream Network, LLC (DreamHost)
# Copyright 2013 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 a... | |
import math
import sys
import operator
import networkx as nx
#import matplotlib.pyplot as plt
import numpy as np
import scipy.spatial.distance
import scipy.signal
import skimage
import skimage.io
from skimage.segmentation import slic
from skimage.util import img_as_float
from scipy.optimize import minimize
#import pdb
... | |
from __future__ import division, with_statement
import gzip
import mmap
import os
import shutil
import sys
import warnings
import zipfile
import numpy as np
from ..extern.six import BytesIO
import pyfits as fits
from ..convenience import _getext
from ..file import _File
from ..util import PyfitsDeprecationWarning
f... | |
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import os.path
import re
import time
import logging
import subprocess
import signal
import flask
import gevent.event
from . import utils
import digits.log
from config import config_value
from status import Status, StatusCls
import platform
# NOTE... | |
# -*- coding: utf-8 -*-
"""
Smoothers.
:copyright: 2015 Agile Geoscience
:license: Apache 2.0
"""
import numpy as np
import scipy.ndimage
from bruges.bruges import BrugesError
from bruges.util import nearest
from bruges.util import rms as rms_
# TODO:
# - 1D and 2D Gaussian (or, better, n-D)
# - See how thes... | |
# 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... | |
# python3
# pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. 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... | |
from __future__ import print_function
import unittest
import argparse
import re
import tempfile
import subprocess
import threading
import os
import sys
import inspect
lldb = ''
clrdir = ''
workdir = ''
corerun = ''
sosplugin = ''
assembly = ''
fail_flag = ''
fail_flag_lldb = ''
summary_file = ''
timeout = 0
regex = ''... | |
#!/usr/bin/env python
"""
Update an ROI IR timeseries CSV file.
"""
from __future__ import absolute_import
from __future__ import print_function
import argparse
import os
import sys
from configparser import ConfigParser as configparser
from datetime import timedelta
# use this because numpy/openblas is automaticall... | |
"""
Templating for ops docstrings
"""
from typing import Dict, Optional
def _make_flex_doc(op_name, typ):
"""
Make the appropriate substitutions for the given operation and class-typ
into either _flex_doc_SERIES or _flex_doc_FRAME to return the docstring
to attach to a generated method.
Parameter... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
from __future__ import print_function
from io import open
import vstruct
import vstruct.defs.inet as vs_inet
from vstruct.primitives import *
PCAP_LINKTYPE_ETHER = 1
PCAP_LINKTYPE_RAW = 101
PCAP_LINKTYPE_LINUX_SLL = 113
PCAP_DLT_RAW = 12
PCAPNG_BOM = 0x1A2B3C4D
OPT_ENDOFOPT ... | |
from __future__ import absolute_import, division, print_function
import collections
from contextlib import closing
import errno
import gzip
import logging
import os
import re
import socket
import ssl
import sys
from tornado.escape import to_unicode, utf8
from tornado import gen
from tornado.httpclient import AsyncHTT... | |
# 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 ... | |
"""Support to manage a shopping list."""
import asyncio
import logging
import uuid
import voluptuous as vol
from homeassistant.const import HTTP_NOT_FOUND, HTTP_BAD_REQUEST
from homeassistant.core import callback
from homeassistant.components import http
from homeassistant.components.http.data_validator import Reques... | |
# 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 unde... | |
import numpy as np
import pylab as plt
import sys
plt.ion()
#plt.close('all')
#constants
TRAIN=0
TESTLOC=1
TESTHIC=2
D=10
a2str=['B','W','G','RS','RM','RL','S','M','L','XL']
a2data=np.array([[0,1,2,2,1,0,2,1,0,np.nan],
[2,1,0,2,1,0,2,1,0,np.nan],[np.nan,np.nan,np.nan,2,1,0,np.nan,2,1,0]])
data2a=np.zeros((3,D,3))
f... | |
import sublime
import sublime_plugin
from os import path
import tempfile
import sys
import re
PACKAGE_SETTINGS = "ExportHtml.sublime-settings"
if sublime.platform() == "linux":
# Try and load Linux Python2.6 lib. Default path is for Ubuntu.
linux_lib = sublime.load_settings(PACKAGE_SETTINGS).get("linux_pytho... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack 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... | |
"""
Maximum likelihood covariance estimator.
"""
# Author: Alexandre Gramfort <[email protected]>
# Gael Varoquaux <[email protected]>
# Virgile Fritsch <[email protected]>
#
# License: BSD 3 clause
# avoid division truncation
import warnings
import numpy as np
from scipy... | |
# -*- coding: utf-8 -*-
__author__ = 'tivvit'
from google.appengine.ext import ndb
from google.appengine.ext.ndb import msgprop
from protorpc import messages
from google.appengine.api import memcache
from backend.cdh_m import User_m, UsersCollection_m, SolvedQuestSum_m, SolvedQuest_m, SolvedQuestsCollection_m
from ... | |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: [email protected]
##
## This file is part of VisTrails.
##
## ... | |
#
# DrawingMixin.py -- enable drawing capabilities.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time
import math
from ginga import trcalc
from ginga.misc.Bunch import Bunch
from ginga.Bindings import KeyEvent
from .CanvasMixin import CanvasMixi... | |
import pathlib
from collections import defaultdict
from operator import itemgetter
from itertools import groupby
from flask import Flask, send_from_directory, request, jsonify
from logbook import Logger
from aesop import isocodes, events
from aesop.models import Movie, TVShow, TVShowEpisode, Source, Config, database_... | |
#
#
# Copyright (C) 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
'''
As of zookeeper 3.4.0, the `mntr` admin command is provided for easy parsing of zookeeper stats.
This check first parses the `stat` admin command for a version number.
If the zookeeper version supports `mntr`,... | |
u'''
Created on Jan 9, 2011
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
'''
from arelle import (XPathContext, XbrlConst, XmlUtil, XbrlUtil, XmlValidate)
from arelle.FunctionXs import xsString
from arelle.ModelObject import ModelObject
from arelle.ModelFormulaObject i... | |
import copy
import os
import socket
import sys
import pickle
from parameterized import parameterized
from gssapi import creds as gsscreds
from gssapi import mechs as gssmechs
from gssapi import names as gssnames
from gssapi import sec_contexts as gssctx
from gssapi import raw as gb
from gssapi import _utils as gssuti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.