gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from xml.sax.handler import ContentHandler
from xml.sax.xmlreader import Locator
import sys
import xml.sax # @UnusedImport
import xml.sax.handler # @UnusedImport
class AimlParserError(Exception): pass
class AimlHandler(ContentHandler):
# The legal states of the AIML parser
_STATE_OutsideAiml = 0
_STATE_Inside... | |
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
#!/usr/bin/env python
"""
__author__ = "Axelle Apvrille"
__status__ = "Beta"
__copyright__ = "Copyright 2015, Fortinet, Fortiguard Labs"
__license__ = "The MIT License (MIT)"
This utility helps work with Fitbit fitness trackers
Connect the USB dongle to your host, and place your tracker nearby.
Use responsibly.
Use a... | |
'''Actors communicate with each other by sending and receiving messages.
The :mod:`pulsar.async.mailbox` module implements the message passing layer
via a bidirectional socket connections between the :class:`.Arbiter`
and any :class:`.Actor`.
Message sending is asynchronous and safe, the message is guaranteed to
event... | |
import sys
import copy
import functools
import datetime
import decimal
from functools import update_wrapper
from inspect import getargspec
from django import forms
from django.utils.encoding import force_unicode
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import Val... | |
# 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... | |
# 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 skimage.data import imread
import numpy as np
import math
class Img:
@staticmethod
def load_image(path, as_grey = False, to_float = True):
# Load image
image = imread(path, as_grey)
if to_float:
# Convert to floating point matrix
image = image.astype(np.fl... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CsrfViewMiddleware
from django.views.decorators.csrf import csrf_exempt, requires_csrf_token, ensure_csrf_cookie
from django.core.context_p... | |
"""
process.py
"""
from helper import config as helper_config
from tornado import httpserver
from tornado import ioloop
import logging
import multiprocessing
import signal
import socket
import ssl
from tornado import version as tornado_version
from tinman import application
from tinman import config
from tinman impor... | |
# coding=utf-8
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2012, Intel Performance Learning Solutions Ltd.
#
# 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
#
# ... | |
import os
import subprocess
import sublime
from ..SublimeCscope import DEBUG, PACKAGE_NAME
from . import settings
from .indexer import PRIMARY_DB, SECONDARY_DB
from .cscope_results import CscopeBuildDbResult, CscopeQueryResult, CscopeResultLimitException
CSCOPE_FILE_LIST_EXT = 'files'
CSCOPE_DB_EXT = 'out'
CSCOPE_O... | |
"""Fabfile for the ``webfaction-django-boilerplate``.
Make sure to setup your ``fabric_settings.py`` first. As a start, just copy
``fabric_settings.py.sample``.
"""
from __future__ import with_statement
import os
from fabric.api import (
cd,
env,
lcd,
local,
run,
settings,
)
from fabric.cont... | |
# 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 ... | |
"""
Module that builds the melted_variant_schema used to construct the
materialized view of the melted variant data.
Build the schema used to build the materialized view.
"""
class SchemaBuilder(object):
"""Builder object for the schema.
Usage:
schema_builder = SchemaBuilder()
schema_builder... | |
"""numpy.distutils.fcompiler
Contains FCompiler, an abstract base class that defines the interface
for the numpy.distutils Fortran compiler abstraction model.
Terminology:
To be consistent, where the term 'executable' is used, it means the single
file, like 'gcc', that is executed, and should be a string. In contras... | |
# Copyright 2014 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
import sys
from mock import Mock, patch
import pytest
from remoto import backends
from remoto.backends import local
from remoto.tests import fake_module
from remoto.tests.conftest import Capture, Factory
class FakeSocket(object):
def __init__(self, gethostname, getfqdn=None):
self.gethostname = lambda: g... | |
from __future__ import unicode_literals
from django.utils import six
from djblets.testing.decorators import add_fixtures
from djblets.webapi.errors import DOES_NOT_EXIST, PERMISSION_DENIED
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import BaseWebAPITestCase
from reviewboard.... | |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, with_transaction
from nereid.testing import NereidTestCase
class TestTranslation(... | |
import json
import time
import attr
import requests
import responses
from htmlvis import HTTPSniffer, RequestsSniffer
from pytest import fixture, mark
@fixture
def success_response():
responses.add(
responses.GET,
'http://mysniffer.com/api/1/success',
json={"greeting": "hi there!"}, )
@... | |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
if len(sys.argv) > 1:
sys.path.insert(0, sys.argv.pop(1))
import unittest
import math
import viennagrid.wrapper
from utils import equal, point_equal
class TestPointCartesian1D(unittest.TestCase):
def setUp(self):
self.addTypeEqualityFunc(viennagrid.wrappe... | |
import os
import pprint
import unittest
import pytest
import orthauth as oa
from pyontutils import sheets
# TODO move some of this to orthauth directly
# no SCOPES
# bad path
# no path/path is null
auth_config = {'auth-variables': {'google-api-store-file': None,
'google-api-store-fil... | |
"""
Implements a generic plotting interface which plots given figures or from plotting functions and respective data.
AnalysisPlotter is a sub-class of QWidget and can be added to any QLayout.
"""
import matplotlib
import inspect
import logging
from testbeam_analysis.gui.gui_widgets.worker import AnalysisWorker
from ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Python script to convert Forex files into different formats (e.g. FXT/HST/HCC).
from struct import pack, pack_into, calcsize
import argparse
import bstruct
import csv
import datetime
import mmap
import os
import re
import sys
import time
class Spinner:
"""Displays... | |
import numpy as np
util = """
#include <stdio.h>
#define PI 3.14159265
typedef struct Point {
double x;
double y;
double z;
} Point;
typedef struct Plane {
Point n;
Point c;
} Plane;
typedef struct Ray {
Point r0;
Point r1;
} Ray;
__device__ Point add(struct Point p1, struct Po... | |
# import_export_maplight/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from datetime import datetime
from django.db import models
from election_office_measure.models import CandidateCampaign, ContestOffice, ContestOfficeManager
from exception.models import handle_record_found_more_than_one_ex... | |
# scoping.py
# Copyright (C) the SQLAlchemy authors and contributors
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sqlalchemy.exceptions as sa_exc
from sqlalchemy.util import ScopedRegistry, ThreadLocalRegistry, \
... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 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 mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on sta... | |
# Copyright 2016 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... | |
"""Tests of http client with custom Connector"""
import asyncio
import gc
import os.path
import platform
import shutil
import socket
import ssl
import tempfile
import unittest
from unittest import mock
import pytest
from yarl import URL
import aiohttp
from aiohttp import client, helpers, web
from aiohttp.client impo... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import logging
import os
import shutil
from six.moves import input # pylint: disable=redefined-builtin
from telemetry... | |
import random
import string
import sys
import click
from collections import OrderedDict
import hvac
import os
import requests.packages.urllib3
file_name = "vault_token.txt"
def get_vault_client():
"""
Return a vault client if possible.
"""
# Disable warnings for the insecure calls
requests.package... | |
"""
This module provides decorator functions which can be applied to test objects
in order to skip those objects when certain conditions occur. A sample use case
is to detect if the platform is missing ``matplotlib``. If so, any test objects
which require ``matplotlib`` and decorated with ``@td.skip_if_no_mpl`` will be... | |
# third party
from nacl.signing import SigningKey
from nacl.signing import VerifyKey
import pytest
# syft absolute
import syft as sy
from syft import ReprMessage
from syft import serialize
from syft.core.common.message import SignedImmediateSyftMessageWithoutReply
from syft.util import get_fully_qualified_name
def g... | |
import taichi as ti
from tests import test_utils
n = 128
def run_atomic_add_global_case(vartype, step, valproc=lambda x: x):
x = ti.field(vartype)
y = ti.field(vartype)
c = ti.field(vartype)
ti.root.dense(ti.i, n).place(x, y)
ti.root.place(c)
# Make Taichi correctly infer the type
# TOD... | |
# Copyright 2020 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... | |
# Authors: Nicolas Goix <[email protected]>
# Alexandre Gramfort <[email protected]>
# License: BSD 3 clause
import numbers
import numpy as np
from scipy.sparse import issparse
from warnings import warn
from ..tree import ExtraTreeRegressor
from ..utils import (
chec... | |
import os
import subprocess
from conda_concourse_ci import execute
import conda_concourse_ci
from conda_concourse_ci.utils import HashableDict
import pytest
import yaml
from .utils import test_data_dir, graph_data_dir, test_config_dir
def test_collect_tasks(mocker, testing_conda_resolve, testing_graph):
mocker... | |
import unittest
import os
import random
from toil.lib.bioio import getTempFile
from toil.job import Job, JobGraphDeadlockException
from toil.test import ToilTest
class JobTest(ToilTest):
"""
Tests testing the job class
"""
def testStatic(self):
"""
Create a DAG of jobs non-dynamically... | |
# Natural Language Toolkit: Dependency Grammars
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Jason Narad <[email protected]>
# Steven Bird <[email protected]> (modifications)
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
"""
Tools for reading and writing dependency tree... | |
"""Starts a service to scan in intervals for new devices."""
from datetime import timedelta
import json
import logging
from netdisco.discovery import NetworkDiscovery
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.const import EVENT_H... | |
# Copyright (C) 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Base classes and constants involved in pool stock samples creation tasks.
AAB
"""
from thelma.tools.semiconstants import PIPETTING_SPECS_NAMES
from thelma.t... | |
# Author: Xavier Paredes-Fortuny ([email protected])
# License: MIT, see LICENSE.md
import numpy as np
import os
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from mpl_toolkits.axes_grid1 import make_axes_locatable
from m... | |
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
from functools import partial
from threading import local
from django.conf import settings as django_settings
from django.contrib import admin, messages
from django.co... | |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Exercise the wallet. Ported from wallet.sh.
# Does the following:
# a) creates 3 nodes, with an empty c... | |
"""Base classes for creating GUI objects to create manually selected points.
The definition of X,Y axis is the following:
xmin,ymin o---------o xmax,ymin
| |
| |
| |
| |
xmin,ymax o---------o xmax,ymax
"""
from collections import na... | |
from __future__ import absolute_import
import responses
import six
from six.moves.urllib.parse import parse_qs, urlencode, urlparse
from sentry.utils.compat.mock import patch, Mock
from sentry.integrations.gitlab import GitlabIntegrationProvider
from sentry.models import (
Identity,
IdentityProvider,
Ide... | |
"""
PEP386-version comparison algorithm.
(c) Tarek Ziade and others
extracted unmodified from https://bitbucket.org/tarek/distutilsversion
licensed under the PSF license (i guess)
"""
import sys
import re
class IrrationalVersionError(Exception):
"""This is an irrational version."""
pass
class HugeMajorVer... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, Nathan Davison <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | |
# 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... | |
"""passlib.tests.test_handlers_django - tests for passlib hash algorithms"""
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
import logging; log = logging.... | |
# Copyright (c) 2012-2022, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
from . import AWSObject, AWSProperty, PropsDictType, Tags
from .validators import boolean, integer
class ArtifactDetails(AWSProperty):
"""
... | |
import unittest
import pickle
import sys
from test import support
py_operator = support.import_fresh_module('operator', blocked=['_operator'])
c_operator = support.import_fresh_module('operator', fresh=['_operator'])
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
retur... | |
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi ([email protected]), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | |
import itertools
from sqlalchemy import Boolean
from sqlalchemy import delete
from sqlalchemy import exc as sa_exc
from sqlalchemy import func
from sqlalchemy import insert
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import Sequence
from sqlalchemy impor... | |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | |
"""
Internal package providing a Python CRUD interface to MLflow experiments and runs.
This is a lower level API than the :py:mod:`mlflow.tracking.fluent` module, and is
exposed in the :py:mod:`mlflow.tracking` module.
"""
import time
import os
from mlflow.store.tracking import SEARCH_MAX_RESULTS_DEFAULT
from mlflow.... | |
# -*- coding: utf-8 -*-
import logging
import cgi
import re
import widgets
from . import convs
from ..utils import cached_property
from collections import OrderedDict
from .perms import FieldPerm
logger = logging.getLogger(__name__)
__all__ = ['BaseField', 'Field', 'FieldBlock', 'FieldSet', 'FieldList', 'FileField'... | |
# -*- coding: utf-8 -*-
"""JMdict support."""
# This could be a bit cleaner if I used something like SQLalchemy
# perhaps... The create/insert/index bits were done decent enough,
# but lookups are done in straight SQL due to the potential
# complexity, and this sadly does break the abstraction of the table
# objects.... | |
# 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 ... | |
# Copyright 2014 Cisco Systems, 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 requir... | |
#!/usr/bin/env python3
"""
Usage: make_lite.py <wrapped_routines_file> <lapack_dir>
Typical invocation:
make_lite.py wrapped_routines /tmp/lapack-3.x.x
Requires the following to be on the path:
* f2c
* patch
"""
import sys
import os
import re
import subprocess
import shutil
import fortran
import clapack_scru... | |
# Copyright 2012 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 agree... | |
# The following tests are purposely limited to the exposed interface by iorw.py
import os.path
import pytest
import boto3
import moto
from moto import mock_s3
from ..s3 import Bucket, Prefix, Key, S3
@pytest.fixture
def bucket_no_service():
"""Returns a bucket instance with no services"""
return Bucket('my... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import codecs
try:
from setuptools import setup, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, Command # noqa
from distutils.command.install import INSTALL_SCHE... | |
from __future__ import absolute_import
from __future__ import print_function
import os
import csv
import numpy as np
import time
import json
import warnings
from collections import deque
from collections import OrderedDict
from collections import Iterable
from .utils.generic_utils import Progbar
from . import backen... | |
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import multiprocessing
import optparse
import os
import sys
import buildbot_common
import build_version
import generate_make
impor... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 29 00:09:26 2010
@author: Charles Law
"""
import math
def fft(fin, inverse):
nfft = len(fin)
twiddles, factors = fft_alloc(nfft, inverse)
fout = []
for i in xrange(nfft):
fout.append((0, 0))
fout_ind_start = 0
fin_ind_start ... | |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | |
import mock
import pytest
from paasta_tools import long_running_service_tools
from paasta_tools import native_mesos_scheduler
def test_main():
with mock.patch(
'paasta_tools.native_mesos_scheduler.get_paasta_native_jobs_for_cluster',
return_value=[('service1', 'instance1'), ('service2', '... | |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""
Test Program Creator role
"""
import unittest
from integration.ggrc import ... | |
# 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... | |
# Copyright 2016 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 ag... | |
# Copyright 2014 MongoDB, 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, so... | |
from PIL import Image
from worldengine.drawing_functions import *
from worldengine.common import *
# -------------
# Helper values
# -------------
_biome_colors = {
'ocean': (23, 94, 145),
'ice': (255, 255, 255),
'subpolar dry tundra': (128, 128, 128),
'subpolar moist tundra': (96, 128, 128),
'su... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
... | |
"""Support for Coinbase sensors."""
from __future__ import annotations
import logging
from homeassistant.components.sensor import SensorEntity, SensorStateClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.core import HomeAssistant
from homea... | |
#!/usr/bin/env python
"""
@package mi.dataset.parser
@file mi/dataset/parser/flort_dj_sio.py
@author Emily Hahn
@brief An flort-dj SIO specific dataset agent parser
"""
__author__ = 'Emily Hahn'
__license__ = 'Apache 2.0'
import re
from mi.core.log import get_logger
log = get_logger()
from mi.core.common import Bas... | |
#!/usr/bin/env python
# This document is part of Pelagos Data
# https://github.com/skytruth/pelagos-data
# =========================================================================== #
#
# The MIT License (MIT)
#
# Copyright (c) 2014 SkyTruth
#
# Permission is hereby granted, free of charge, to any person obtain... | |
from .._abstract.abstract import BaseParameters
from ..common.geometry import SpatialReference, Envelope
import os
import json
########################################################################
class AnalyzeParameters(BaseParameters):
"""
The analyzeParameters JSON object used to analyze a CSV file are
... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | |
import os
import logging
import importlib
import json
from billy.scrape.validator import DatetimeValidator
from billy.core import settings
from billy.utils import JSONEncoderPlus
import scrapelib
class ScrapeError(Exception):
"""
Base class for scrape errors.
"""
def __init__(self, msg, orig_except... | |
# 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... | |
from collections import OrderedDict
from django import forms
from django.contrib import admin
from django.core.paginator import Paginator
from django.db.models import Count, Q, Prefetch
from django.template import loader
from django.utils.translation import ugettext
from rangefilter.filter import (
DateRangeFilte... | |
# 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 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from sentry.constants import RESERVED_TEAM_SLUGS
from sentry.models import slugify_instance
for team in ... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | |
import itertools
import unittest
from collections import OrderedDict
import numpy
import theano
from numpy.testing import assert_allclose, assert_raises
from theano import tensor
from theano.gof.graph import is_same_graph
from blocks.utils import is_shared_variable
from blocks.bricks.base import application
from block... | |
# -*- 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 django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.sites.shortcuts import get_current_site
from django.http import (
Http404,
HttpResponsePermanentRedirect,
HttpResponseRedirect,
)
from django.shortcuts import redirect
from django.utils.decorato... | |
"""Test inter-conversion of different polynomial classes.
This tests the convert and cast methods of all the polynomial classes.
"""
from __future__ import division, absolute_import, print_function
import operator as op
from numbers import Number
import numpy as np
from numpy.compat import long
from numpy.polynomia... | |
# pylint: disable=C0103, I1101
"""
File Converter Widget
"""
import os
import logging
import numpy as np
from PyQt5 import QtWidgets, QtCore, QtGui
from sas.sascalc.file_converter.ascii2d_loader import ASCII2DLoader
from sas.sascalc.file_converter.nxcansas_writer import NXcanSASWriter
from sas.sascalc.dataloader.dat... | |
"""Config flow to configure Philips Hue."""
import asyncio
import json
import os
from aiohue.discovery import discover_nupnp
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
from .bridge imp... | |
#!/usr/bin/env python
"""
Tests for the backpacks.
Copyright (c) 2005 Dustin Sallings <[email protected]>
"""
# arch-tag: 0BCECE3E-2629-498A-A897-C66F6DC41EB4
import os
import sys
import time
import unittest
import exceptions
import xml.dom.minidom
import backpack
# These tests all assume you're in California.
os.env... | |
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Library for interacting with gdata (i.e. Google Docs, Tracker, etc)."""
from __future__ import print_function
import functools
import getpass
imp... | |
# Copyright 2016 - StackStorm, 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 ... | |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
qualities,
strip_jsonp,
unified_strdate,
url_basename,
)
class NPOBaseIE(InfoExtractor):
def _get_token(self, video_id):
token_page = self._download_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.