gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""The extraction front-end."""
import logging
import os
import pdb
import traceback
from dfvfs.helpers import source_scanner
from dfvfs.resolver import context
import plaso
from plaso import parsers # pylint: disable=unused-import
from plaso import hashers # pylint: disable=unused-import... | |
import re
import csv
from aerofiles.errors import ParserError
RE_COUNTRY = re.compile(r'^([\w]{2})?$', re.I)
RE_LATITUDE = re.compile(r'^([\d]{2})([\d]{2}\.[\d]{3})([NS])$', re.I)
RE_LONGITUDE = re.compile(r'^([\d]{3})([\d]{2}\.[\d]{3})([EW])$', re.I)
RE_ELEVATION = re.compile(r'^(-?[\d]*(?:\.[\d]+)?)\s?(m|ft)?$', r... | |
# Python test set -- part 4b, built-in functions n-z
from test_support import *
print 'oct'
if oct(100) != '0144': raise TestFailed, 'oct(100)'
if oct(100L) != '0144L': raise TestFailed, 'oct(100L)'
if oct(-100) not in ('037777777634', '01777777777777777777634'):
raise TestFailed, 'oct(-100)'
if oct(-100L) != '-0... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/utilities.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | |
import decimal
import json as _json
import sys
import re
from _plotly_utils.optional_imports import get_module
from _plotly_utils.basevalidators import ImageUriValidator
PY36_OR_LATER = sys.version_info >= (3, 6)
class PlotlyJSONEncoder(_json.JSONEncoder):
"""
Meant to be passed as the `cls` kwarg to json.... | |
from __future__ import absolute_import
import ast
import logging
import os.path
from pathlib import Path
import pytest
import pretend
from pip_check_reqs import common
@pytest.mark.parametrize(
["path", "result"],
[
('/', ''),
('__init__.py', ''), # a top-level file like this has no packag... | |
#!/usr/bin/env python
import numpy;
import sptensor;
import tools;
from scipy import sparse;
class sptenmat:
subs = None;
vals = None;
rdims = None;
cdims = None;
tsize = None;
def __init__(self, T, rdim = None, cdim = None, tsiz = None, option = None):
"""Create a sptenmat o... | |
# 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... | |
"""
ios.py
Handle arguments, configuration file
@author: K.Edeline
"""
import sys
import argparse
import configparser
import logging
import shutil
class IOManager(object):
"""
extend me
"""
#DEFAULT_CONFIG_LOC="/tmp/deploypl.ini"
PKG_FILE = "packages.txt"
def __init__(self, child=None, **kw... | |
"""Modular aircraft concept"""
import cPickle as pickle
import numpy as np
from gpkit import Model, Vectorize, parse_variables
class AircraftP(Model):
"""Aircraft flight physics: weight <= lift, fuel burn
Variables
---------
Wfuel [lbf] fuel weight
Wburn [lbf] segment fuel burn
Upper Unb... | |
# Copyright (c) 2015 Red Hat, 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 require... | |
class ChangeParser():
"""
Provides many different notification change parsers and utility methods.
"""
@staticmethod
def get_changed_field_handler(top_level_type, field):
"""
Returns a change handler for the field and top level object type. If
not found then None is return... | |
from operator import attrgetter
from typing import Iterable, Iterator, List, MutableSequence, \
Optional, Sequence, TypeVar, Type
from iota.codecs import TrytesDecodeError
from iota.crypto import Curl, HASH_LENGTH
from iota.json import JsonSerializable
from iota.transaction.types import BundleHash, Fragment, Nonce... | |
# Copyright 2012 by Wibowo Arindrarto. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Bio.SearchIO parser for BLAST+ XML output formats."""
# for more info: http://www.ncbi.... | |
from django.test import override_settings
import mock
import datetime
import ldap
import copy
from django.conf import settings
from tests.utilities.utils import SafeTestCase
from tests.utilities.ldap import (
get_ldap_user_defaults,
get_ldap_group_defaults,
build_mock_rcldap_user,
build_mock_rcldap_gr... | |
###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... | |
"""Test Z-Wave config panel."""
import asyncio
import json
from unittest.mock import MagicMock, patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from homeassistant.components.zwave import DATA_NETWORK, const
from homeassistant.components.config.zwave import (... | |
import functools
import os.path
import random
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.uix.scrollview import ScrollView
from kivy.uix.textinput import TextInput
from src.util.board... | |
# -*- coding: utf-8 -*-
"""
These test the private routines in types/cast.py
"""
import pytest
from datetime import datetime, timedelta, date
import numpy as np
import pandas as pd
from pandas import (Timedelta, Timestamp, DatetimeIndex,
DataFrame, NaT, Period, Series)
from pandas.core.dtypes.c... | |
"""Test the module ensemble classifiers."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
from collections import Counter
import numpy as np
import pytest
from sklearn.datasets import load_iris, make_hastie_10_2, make_classification
from sklearn.model_selection impo... | |
# 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 ... | |
"""Manage flooding to ports on VLANs."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under th... | |
# Copyright 2016 Joel Dunham
#
# 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... | |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | |
from django.db import models
from django.db.models import Q, F, Sum, Case, When, ExpressionWrapper
from django.db.models.functions import Coalesce
from django.core.validators import MinValueValidator, RegexValidator
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as ... | |
# Copyright (c) 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
"""
Methods for identifying space-time interaction in spatio-temporal event
data.
"""
__author__ = "Nicholas Malizia <nmalizia@asu.edu>"
import pysal
#from pysal.common import *
import numpy as np
import scipy.stats as stats
import pysal.weights.Distance as Distance
from pysal import cg
from pysal.spatial_dynamics imp... | |
# The MIT License (MIT)
#
# Copyright (c) 2015 Brian Wray (brian@wrocket.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 Software without restriction, including without limitation the rights
# ... | |
# Class definition:
# RunJobHopper
# [Add description here]
# Instances are generated with RunJobFactory via pUtil::getRunJob()
# Implemented as a singleton class
# http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
# Import relevant python/pilot modules
from RunJobHPC import RunJobHP... | |
import lacuna, lacuna.exceptions, lacuna.binutils.libbin
import argparse, operator, os, sys
from enum import Enum
class BodyCache():
""" We don't want to use a request cache for any part of send_excavs, but we
do want to keep track of stations, stars, and bodies that we know are no
good for whatever rea... | |
from sympy import Symbol, exp, log, oo, Rational
from sympy.series.limits import compare, mrv, rewrite, mrv_leadterm, limit, \
sign
from sympy.utilities.pytest import XFAIL
"""
This test suite is testing the limit algoritm using the bottom up approach.
See the documentation in limits2.py. The algorithm itself is h... | |
import os
import sys
try:
from PIL import Image
from PIL import ImageOps
from PIL import ImageDraw
from PIL import ImageEnhance
import cv2
import numpy as np
except Exception as e:
print(str(e))
from stve.log import Log
from stve.exception import *
SHARPNESS = 2.0
CONTRAST = 2.0
PMC_THRE... | |
'''
Defines all plugin-related messaging elements.
@author: Eitan Isaacson
@organization: Mozilla Foundation
@copyright: Copyright (c) 2006, 2007 Mozilla Foundation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this dist... | |
#!/usr/bin/env python
# encoding: utf-8
import ast
import docutils
import docutils.examples
import inspect
import logging
import os
import re
import sys
logging.basicConfig(level=logging.DEBUG)
from talus.fileset import FileSet
class TalusError(Exception):
pass
class PyFuncTypeComponent(object):
def _... | |
"""
A module for dealing with the polylines used throughout matplotlib.
The primary class for polyline handling in matplotlib is :class:`Path`.
Almost all vector drawing makes use of Paths somewhere in the drawing
pipeline.
Whilst a :class:`Path` instance itself cannot be drawn, there exists
:class:`~matplotlib.artis... | |
#!/usr/bin/python
#
# This file is a modification of jsparser.py from pynarcissus ( https://code.google.com/p/pynarcissus/ )
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this... | |
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase.ToontownGlobals import *
from toontown.toonbase.ToonBaseGlobal import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from toontown.toonbase import Too... | |
"""Contains knowledge to build a COM object definition.
This module is used by both the @dynamic@ and @makepy@ modules to build
all knowledge of a COM object.
This module contains classes which contain the actual knowledge of the object.
This include parameter and return type information, the COM dispid and CLSID, et... | |
import operator
import core.reports.ReportsDataSource
import time
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units... | |
# 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 ... | |
"""Provides some utilities widely used by other modules"""
import bisect
import collections
import collections.abc
import operator
import os.path
import random
import math
# ______________________________________________________________________________
# Functions on Sequences and Iterables
def sequence(iterable):
... | |
# 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... | |
# 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... | |
from troposphere import (
Parameter,
Ref,
Output,
Tags,
GetAtt,
Base64,
Join,
Equals,
ec2,
elasticloadbalancing as elb,
autoscaling as asg,
route53 as r53
)
from cfn.utils.cfn import get_recent_ami
from cfn.utils.constants import (
ALLOW_ALL_CIDR,
EC2_INSTANCE_T... | |
#!/usr/bin/env python
import os
import shutil
import sqlite3
import sys
import uuid
import database as gemini_db
def append_variant_info(main_curr, chunk_db):
"""
Append the variant and variant_info data from a chunk_db
to the main database.
"""
cmd = "attach ? as toMerge"
main_curr.execute(... | |
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http... | |
"""File format classes for the games The Lost Vikings (1992) and Blackthorne (1994).
"""
import logging
logger = logging.getLogger( __name__ )
from mrcrowbar import models as mrc
from mrcrowbar import utils
class Config( mrc.Block ):
pad1 = mrc.UInt16_LE( 0x00 )
sound_type = mrc.UInt16_LE( 0x02 )
sound_... | |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
import re
from sqlalchemy import desc
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
from flexget.manager import Ses... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Metaswitch Networks
#
# 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... | |
# Copyright 2022 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, ... | |
import base64
import json
import os
import posixpath
import re
from time import time
from wsgiref.handlers import format_date_time
from olympia.constants import base
from services.utils import log_configure, log_exception, mypool
from services.utils import settings, user_media_path, user_media_url
# This has to be i... | |
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from .model import Model
from .parameterization.variational import VariationalPosterior
from .mapping import Mapping
from .. import likelihoods
from .. import kern
from ..inference.l... | |
from flask import Flask, request, session, jsonify, current_app, url_for, redirect
from flask.ext.pymongo import PyMongo
from flask.sessions import SessionInterface, SessionMixin
from pymongo import Connection, MongoClient
import os
from random import random
from uuid import uuid4
from datetime import datetime, timedel... | |
# 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... | |
#!/usr/bin/env python
# Copyright (c) 2016 Forrest Pieper
"""
Tool for managing and pushing local git branches to various git remotes and branches on those remotes
"""
import argparse
import logging
import os
import threading
import subprocess
command_list = ('list', 'delete', 'push', 'add')
BASE_DIR = './.deploy'... | |
# -*- coding: iso-8859-1 -*-
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the usef... | |
import torch.utils.data as data
import torch
import h5py
from bisect import bisect_right
import numpy as np
from src.data import load_data
import src.data.stats as stats
import dill
from tqdm import tqdm
class DatasetFromHdf5(data.Dataset):
def __init__(self, filename, normalized=True, log=False, maxsize=30000)... | |
def get_injured_sharks():
"""
>>> from ibeis.scripts.getshark import * # NOQA
"""
import requests
url = 'http://www.whaleshark.org/getKeywordImages.jsp'
resp = requests.get(url)
assert resp.status_code == 200
keywords = resp.json()['keywords']
key_list = ut.take_column(keywords, 'in... | |
from django.db.models import Q, Sum
from django.db.models.deletion import ProtectedError
from django.db.utils import IntegrityError
from django.forms.models import modelform_factory
from django.test import TestCase, skipIfDBFeature
from .models import (
A, Address, B, Board, C, CharLink, Company, Contact, Content,... | |
"""Command-line utilities for experiments subsystem."""
import argparse
import datetime
import collections
import yaml
import dateutil.tz
from jacquard.utils import is_recursive
from jacquard.buckets import NotEnoughBucketsException, close, release
from jacquard.storage import retrying
from jacquard.commands import ... | |
"""
Copyright 2016 Brian Quach
Licensed under MIT (https://github.com/brianquach/udacity-nano-fullstack-catalog/blob/master/LICENSE) # noqa
"""
import httplib2
import json
import os
import random
import string
from apiclient import discovery
from apiclient import errors as gErrors
from dicttoxml import dicttoxml
from ... | |
#!/usr/bin/env python
# Copyright 2014 Mirantis, 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 a... | |
# Copyright 2014 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 ... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
from .SingleCharClass import *
from .Styling import DefaultStyle
from .TextEnums import *
DEFAULTSPACING = 1.0 / 10
class Label(BaseControl):
"""
Text displayer.
@rtype : Label
"""
def __init__(self, left, top, width, text, parent, pinning=PinningEnum.TopLeft, fontSize=10, fontID='defaul... | |
# 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... | |
"""
User name to file name conversion.
This was taken form the UFO 3 spec.
"""
from __future__ import unicode_literals
from fontTools.misc.py23 import basestring, unicode
illegalCharacters = "\" * + / : < > ? [ \ ] | \0".split(" ")
illegalCharacters += [chr(i) for i in range(1, 32)]
illegalCharacters += [chr(0x7F)]
r... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import os
from functools import partial
import pytest
import torch
import pyro
import pyro.distributions as dist
from pyro import poutine
from pyro.infer.mcmc import HMC, NUTS
from pyro.infer.mcmc.api import MCMC, StreamingMCMC, ... | |
"""
Data Structures used to represented molecules for convolutions.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Han Altae-Tran and Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import csv... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
import tensorflow as tf
from niftynet.engine.application_driver import ApplicationDriver
from niftynet.utilities.util_common import ParserNamespace
from tests.niftynet_testcase import NiftyNetTestCase
TARGET_FILE = os.path.join... | |
"""
Houdini to lucille RIB exporter.
Written by Syoyo Fujita(syoyo@lucillerender.org)
"""
import os, sys
import re
import math
ribnodelist = {}
def vnormalize(v):
d2 = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]
d = math.sqrt(d2)
if (d > 1.0e-12):
invd = 1.0 / d
v[0] *= invd
v[1]... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import tempfile
import shutil
from tempfile import mkdtemp
from shutil import rmtree
import numpy as np
import nibabel as nb
from nipype.testing import (assert_equal, assert_not_equal,
... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
# Copyright (c) 2016 Fabian Kochem
from libtree import core, utils
class Node:
"""
Representation of a tree node and entrypoint for local tree
operations.
It's a thin wrapper around the underlaying core functions. It does
not contain any data besides the database ID and must therefore
query... | |
"""
Author: Robert Post
UOfAlberta 2015
This Class stores samples of experience - Only the most recent x samples are stored.
Samples are stores in a circular array.
Memory is used to construct random batches for the DQN.
"""
import time
import numpy as np
import theano
floatX = theano.config.floatX
class DQNAgentMe... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pickle
import textwrap
from collections import OrderedDict
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from astropy.nddata.nddata import NDData
from astropy.nddata.nduncertainty import StdDevUncertainty
from ast... | |
import re
from django.db import connection
from hashlib import sha256
from graphite.tags.base import BaseTagDB, TaggedSeries
class LocalDatabaseTagDB(BaseTagDB):
def find_series_query(self, tags):
# sql will select series that match all tag expressions that don't match empty tags
sql = 'SELECT s.path'
... | |
# -*- coding: utf-8 -*-
"""
Use nose
`$ pip install nose`
`$ pip install mock`
`$ nosetests test_commando.py -d -v`
"""
from contextlib import nested
from commando import *
from mock import patch
try:
import cStringIO
StringIO = cStringIO
except ImportError:
import StringIO as xStringIO
StringIO = xS... | |
# 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 ... | |
"""Generate ast module from specification
This script generates the ast module from a simple specification,
which makes it easy to accomodate changes in the grammar. This
approach would be quite reasonable if the grammar changed often.
Instead, it is rather complex to generate the appropriate code. And
the Node inte... | |
#
# Python Macro Language for Dragon NaturallySpeaking
# (c) Copyright 1999 by Joel Gould
# Portions (c) Copyright 1999 by Dragon Systems, Inc.
#
# gramparser.py
# This module contains the Python code to convert the textual represenation
# of a command and control grammar in the standard SAPI CFG binary format.... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
This module implements the Field class, which simply a WeightedGraph
(see the graph.py) module, plus an arrray that yields (possibly
multi-dimnesional) features associated with graph vertices. This
allo... | |
# Copyright 2016 Splunk, 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 writing,... | |
#!/usr/bin/env python
#
# KEISER 2018-06-08
#
# Script to parse myNCBI My Bibliography medline export to jekyll page MD
#
# mybib.nbib source:
# https://www.ncbi.nlm.nih.gov/myncbi/collections/mybibliography/
# download as "text file (MEDLINE format)" (.mybib)
#
# preprints.csv source:
# <manual>
from optparse i... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import calendar
from datetime import datetime, timedelta
from mock import patch
from preggy import expect
from tornado.testing import gen_test
from tornado.httpclient import HTTPError
from ujson import loads
from tests.unit.base import ApiTestCase
from tests.fixtu... | |
"""This component provides basic support for Foscam IP cameras."""
from __future__ import annotations
import asyncio
from libpyfoscam import FoscamCamera
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, SUPPORT_STREAM, Camera
from homeassistant.config_entries import SOURCE_IMPORT... | |
from django.db import models
from django.contrib.auth.models import Group
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from django.conf import settings
from daiquiri.core.constants import ACCESS_LEVEL_CHOICES
from daiquiri.core.managers import AccessLevelManager
class Sche... | |
#!/usr/bin/env python
from math import sqrt
class Sudoku(object):
"""docstring for Sudoku"""
def __init__(self, rows=[], dim=9, boxes=9):
super(Sudoku, self).__init__()
self.dim = dim
self.box_lim = int(sqrt(dim))
self.numbers_range = set(range(1, dim+1))
self.grid = [... | |
# Copyright (c) 2012-2014 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use, copy, modify, mer... | |
'''
Created on Apr 5, 2016
@author: Jakub Bernat
'''
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
import random
import core.observerlibrary as mo
import core.tools as ctls
import logging
class Simulation:
logger = logging.getLogger('Simulation')
def __init__(sel... | |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
# import components here
from autonomous import AutonomousModeManager
from components import drive, intake, catapult
from common import delay
# keep in sync with the driver station
MODE_DISABLED = 0
MODE_AUTONOMOUS = 1
MODE_TELEO... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
#
# Copyright 2016 Quantopian, 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 wr... | |
<<<<<<< HEAD
<<<<<<< HEAD
import unittest
import gc
import sys
import weakref
from unittest.test.support import LoggingResult, TestEquality
### Support code for Test_TestSuite
################################################################
class Test(object):
class Foo(unittest.TestCase):
def test_1(se... | |
#
# 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
# ... | |
# coding=utf-8
"""Module related to test for all the models."""
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.utils.http import urlsafe_base64_encode
from django.utils.encoding import force_bytes
from user_map.tests.model_factories impor... | |
from collections.abc import Iterable
from contextlib import contextmanager
from functools import partial
from inspect import signature
from bonobo.config import Option
from bonobo.errors import UnrecoverableTypeError
from bonobo.util import deprecated_alias, ensure_tuple
_raw = object()
_args = object()
_none = objec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.