gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from sympy.core.compatibility import range
from sympy.sets.fancysets import (ImageSet, Range, normalize_theta_set,
ComplexRegion)
from sympy.sets.sets import (FiniteSet, Interval, imageset, EmptySet, Union,
Intersection)
from sympy import (S, Symbol, Lambda... | |
import unittest
from boto3 import Session
from moto import mock_ec2
from smartaws.ec2 import base
from smartaws.ec2 import internet_gateway as ec2_igw
from smartaws.ec2 import vpc as ec2_vpc
class InternetGatewayTestCase(unittest.TestCase):
credentials = {
'aws_access_key_id': 'access_key',
'aw... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Model Code.
"""
from typing import Optional
from parlai.core.params import ParlaiParser
from parlai.core.opt import ... | |
import time
from isobus.vt.interface import IBSVTInterface
from isobus.common import IBSException
from isobus.log import log
from isobus.ibsinterface import IBSRxHandler
from isobus.cf import IBSControlFunction
from isobus.cf import BuildISOBUSName
class VTClient(IBSControlFunction):
"""VT Client (implement) simul... | |
from collections import OrderedDict
import numpy
from numpy.testing import assert_raises, assert_equal
from picklable_itertools import repeat
from six.moves import zip, range
from fuel.datasets import Dataset, IterableDataset, IndexableDataset
from fuel.streams import DataStream
from fuel.schemes import ShuffledSchem... | |
# -*- coding: utf-8 -*-
"""This module implements the logic of the operations for selecting,
unselecting, expanding, hiding, showing etc. of clusters of
streamlines. It basically provides set operations for streamline IDs.
Copyright (c) 2012-2014, Emanuele Olivetti and Eleftherios Garyfallidis
Distributed under the B... | |
# Copyright 2016 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# 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 applicable law or ... | |
# Copyright (c) 2013 Dave McCoy (dave.mccoy@cospandesign.com)
#
# This file is part of Nysa.
#
# (http://wiki.cospandesign.com/index.php?title=Nysa.org)
#
# Nysa is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Found... | |
from __future__ import unicode_literals
import json
import dicttoxml
from jinja2 import Template
from six import iteritems
from moto.core.responses import BaseResponse
from .models import redshift_backends
def convert_json_error_to_xml(json_error):
error = json.loads(json_error)
code = error['Error']['Code... | |
# -*-coding:utf-8 -*-
import base64
import os
import re
from datetime import datetime
from consts import *
from bson.objectid import ObjectId
from db import get_db
IMG_DIR = os.path.join(os.path.dirname(__file__), os.pardir, "static", "img", "user")
class User(object):
@property
def uid(self):
retur... | |
"""This file contains code for use with "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import math
import numpy
import random
import sys
import correlation
import thinkplot
import matplotlib.pyplot as pypl... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2007, Playful Invention Company
# Copyright (c) 2008-17, Walter Bender
# Copyright (c) 2009-13 Raul Gutierrez Segales
# Copyright (c) 2012 Alan Aguiar
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation f... | |
"""
About
=====
cosmics.py is a small and simple python module to detect and clean cosmic ray hits on images (numpy arrays or FITS), using scipy, and based on Pieter van Dokkum's L.A.Cosmic algorithm.
L.A.Cosmic = Laplacian cosmic ray detection
U{http://www.astro.yale.edu/dokkum/lacosmic/}
(article : U{http://arxiv... | |
# Copyright 2013 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... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.protocols.tls}.
"""
from zope.interface.verify import verifyObject
try:
from twisted.protocols.tls import TLSMemoryBIOProtocol, TLSMemoryBIOFactory
from twisted.protocols.tls import _PullToPush, _ProducerMembrane
... | |
import os
import paramiko
import queue
from botocore.exceptions import EndpointConnectionError
from ebcli.objects.exceptions import NoRegionError
from ebcli.objects.exceptions import ServiceError
from os.path import expanduser
from paramiko.ssh_exception import SSHException
from threading import Thread
from queue impo... | |
#!/usr/bin/env vpython
#
# [VPYTHON:BEGIN]
# wheel: <
# name: "infra/python/wheels/google-auth-py2_py3"
# version: "version:1.2.1"
# >
#
# wheel: <
# name: "infra/python/wheels/pyasn1-py2_py3"
# version: "version:0.4.5"
# >
#
# wheel: <
# name: "infra/python/wheels/pyasn1_modules-py2_py3"
# version: "versio... | |
# 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 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... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
#!/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.
"""Install Debian Wheezy sysroots for building chromium.
"""
# The sysroot is needed to ensure that binaries will run on Debian Wh... | |
from UIHandling import *
from Quartz import *
import math
kOurImageFile = "ptlobos.tif"
# For best performance make bytesPerRow a multiple of 16 bytes.
BEST_BYTE_ALIGNMENT = 16
def COMPUTE_BEST_BYTES_PER_ROW(bpr):
return ((bpr + (BEST_BYTE_ALIGNMENT-1)) & ~(BEST_BYTE_ALIGNMENT-1))
def DEGREES_TO_RADIANS(degrees)... | |
# Copyright (C) 2007 - 2009 The MITRE Corporation. See the toplevel
# file LICENSE for license terms.
from mat_unittest_resources import PluginContextTestCase, CmdlinePluginContextTestCase, \
CmdlinePluginContextTestCaseWithTeardown
import MAT
_jsonIO = MAT.DocumentIO.getDocumentIO('mat-json')
import os, sys
#... | |
# Copyright (c) 2016, Serge Guelton
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fol... | |
# Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | |
from header_sounds import *
sounds = [
("click", sf_2d|sf_vol_3,["drum_3.ogg"]),
("tutorial_1", sf_2d|sf_vol_7,["tutorial_1.ogg"]),
("tutorial_2", sf_2d|sf_vol_7,["tutorial_2.ogg"]),
("gong", sf_2d|sf_priority_9|sf_vol_7, ["s_cymbals.ogg"]),
("quest_taken", sf_2d|sf_priority_9|sf_vol_7, []),
("quest_completed", ... | |
from django.db import transaction
from django.db.models import Case
from django.db.models import Count
from django.db.models import F
from django.db.models import Sum
from django.db.models import When
from le_utils.constants import content_kinds
from .models import HelpReason
from .models import LearnerProgressNotific... | |
"""
sentry.client.base
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import base64
import datetime
import functools
import logging
import sys
import time
import traceback
import urllib2... | |
#!/usr/bin/env python
# Copyright 2015 University of Chicago
# Licensed under the APL 2.0 license
# Process jobs that have been uploaded and create
# a pegasus workflow and submit
import argparse
import re
import sys
import os
import time
import subprocess
import fcntl
import cStringIO
import psycopg2
import Pegasu... | |
# 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 ... | |
import pytest
from linkedlist import LinkedList
class TestLinkedList:
def test_init(self):
'''There are no front or back in a newly initialized list'''
ll = LinkedList()
assert ll.front == None
assert ll.back == None
def test_add_to_empty_list(self):
'''
Adding... | |
"""
=======================================================
Gaussian process regression (GPR) on Mauna Loa CO2 data
=======================================================
This example is based on Section 5.4.3 of "Gaussian Processes for Machine
Learning" [RW2006]_. It illustrates an example of complex kernel engineer... | |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange, zip
import unittest
from nose.tools import assert_equal, assert_raises
import numpy.testing as np_test
from numpy.testing import assert_almost_equal, assert_array_equa... | |
"""The Tasmota integration."""
import asyncio
import logging
from hatasmota.const import (
CONF_MAC,
CONF_MANUFACTURER,
CONF_MODEL,
CONF_NAME,
CONF_SW_VERSION,
)
from hatasmota.discovery import clear_discovery_topic
from hatasmota.mqtt import TasmotaMQTTClient
import voluptuous as vol
from homeass... | |
#!/usr/bin/env python
import sys
import os
import zipfile
import shutil
libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib')
sys.path.append(libdir)
import utils
import jdecode
import cardlib
from cbow import CBOW
from namediff import Namediff
def exclude_sets(cardset):
return cardset == 'Ung... | |
#!/usr/bin/env python
"""Test maximum expected accuracy alignment algorithm"""
########################################################################
# File: mea_algorithm_test.py
# executable: mea_algorithm_test.py
#
# Author: Andrew Bailey
# History: 1/25/18 Created
################################################... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
import json
import pytest
from share.transform.chain import ctx
from share.transformers.v1_push import V1Transformer
class TestV1Transformer:
@pytest.mark.parametrize('input, expected', [
({
"contributors": [{
"name": "Roger Movies Ebert",
"sameAs": ["https://... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (C) 2015 Andris Raugulis (moo@arthepsy.eu)
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 w... | |
# Arithmetic tests for DataFrame/Series/Index/Array classes that should
# behave identically.
# Specifically for Period dtype
import operator
import numpy as np
import pytest
from pandas._libs.tslibs.period import IncompatibleFrequency
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas impo... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from numpy.testing import assert_array_equal
from astropy import modeling
from .basic import TransformType
from . import _parameter_to_value
__all__ = ['AffineType', 'Rotate2DType', 'Rotate3DType',
'RotationSequenceTy... | |
# Copyright 2020 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 pycuda.autoinit
import pycuda.driver as drv
import numpy
import time
from pycuda.compiler import SourceModule
from jinja2 import Environment, PackageLoader
def main():
#Set up global timer
tot_time = time.time()
#Define constants
BankSize = 8 # Do not go beyond 8!
WarpSize = 32 #Do not cha... | |
from sqlalchemy.orm import attributes, create_session, mapper, relationship, configure_mappers
from sqlalchemy import Integer, ForeignKey, ForeignKeyConstraint
from sqlalchemy import event, and_
from sqlalchemy.engine import Engine
from sqlalchemy.testing import fixtures
from sqlalchemy.testing.schema import Table, Co... | |
#!/usr/bin/env python
########################################################################
#
# To install panda using this script, type 'installpanda.py'.
# To specify an alternate location than the filesystem root /,
# either pass it as only argument or set the DESTDIR environment
# variable. This script only func... | |
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
# partial --== Decompile ==-- with fixes
import Live
from TransportComponent import TransportComponent
from _Framework.ButtonElement import ButtonElement
from _Framework.EncoderElement import EncoderElement #added
class ShiftableTransportComponent(TransportComponent):
__doc__ = ' TransportComponent that only uses cer... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from multiprocessing import set_start_method, cpu_count
set_start_method('forkserver')
import os
os.environ["OMP_NUM_THREADS"] = str(cpu_count()) # or to whatever you want
from argparse import ArgumentParser
from datetime import datetime
time_now = datetime.utcnow().strftime("%Y%m%d%H%M%S")
def str2bool(v):
if ... | |
# -*- coding: utf-8 -*-
"""
Utilities
-------
Utility module for Folium helper functions.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import time
import math
import zlib
import struct
from jinja2 import Environment, PackageLoader
try:
import ... | |
import logging
import os
import six
from contextlib import contextmanager
from insights.util import streams, subproc
log = logging.getLogger(__name__)
GLOBAL_PRODUCTS = []
PRODUCT_NAMES = []
DEFAULT_VERSION = ["-1", "-1"]
FSRoots = []
def fs_root(thing):
FSRoots.append(thing)
return thing
def product(klas... | |
# 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... | |
"""Iterative methods for solving linear systems"""
__all__ = ['bicg','bicgstab','cg','cgs','gmres','qmr']
import warnings
import numpy as np
from . import _iterative
from scipy.sparse.linalg.interface import LinearOperator
from .utils import make_system
from scipy._lib._util import _aligned_zeros
from scipy._lib._t... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EventTag'
db.create_table(
'sentry_eventtag', ... | |
from __future__ import absolute_import
import mailcap
import mimetypes
import tempfile
import os
import os.path
import shlex
import signal
import stat
import subprocess
import sys
import traceback
import urwid
import weakref
from .. import controller, flow, script
from . import flowlist, flowview, help, window, signa... | |
#!/usr/bin/env python
import unittest
from os import path
import sys
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from src.drafter_postprocessing.instantiate_uri import instantiate_uri
class TestInstantiatingURIParameters( unittest.TestCase ):
def test_simple_uri_parameter(sel... | |
# Copyright 2011 OpenStack Foundation
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | |
import math
import copy
import string
class BBox():
def __init__(self, minx, miny, maxx, maxy):
self.minx = min(minx, maxx)
self.miny = min(miny, maxy)
self.maxx = max(minx, maxx)
self.maxy = max(miny, maxy)
def __str__(self):
return 'BBox[' + str(self.minx) + \
... | |
# Copyright (c) 2015 Clinton Knight. 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... | |
# Copyright 2011 The greplin-twisted-utils Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Module for generating NUV z1QSO candidates
# Imports
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
import glob, os, sys
from astropy.io import ascii, fits
from astropy import units as u
from astropy.table import Table, Column, QTable
from astropy import coord... | |
#!/usr/bin/env python
import sys
if sys.version_info[0] == 3:
unichr = chr
#You can use the names on the page http://www.webhostinghub.com/glyphs/bootstrap/
_codepoints = [
("icon-aaabattery", 0xf413),
("icon-abacus", 0xf261),
("icon-accountfilter", 0xf05e),
("icon-acsource", 0xf3ea),
("icon-a... | |
"""
Logfile compressor
"""
from __future__ import absolute_import
import argparse
import datetime
import logging
import os
import os.path
import subprocess
import tempfile
from . import parse
from . import service
COMMAND_DESCRIPTION = """
Takes a directory of ISO8601 logfiles. Compresses any superseded logs
and s... | |
# 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... | |
import os
import json
import sqlite3
import time
from pipeline.exceptions import (
IsHeaderException, InvalidConfigException, DuplicateFileException, MissingStatusDatabaseError
)
from pipeline.status import Status
from pipeline.exceptions import InvalidConfigException
HERE = os.path.abspath(os.path.dirname(__file... | |
"""Testing for Gaussian process regression """
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Licence: BSD 3 clause
import numpy as np
from scipy.optimize import approx_fprime
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels \
import RBF, Constan... | |
from builtins import super
from collections import namedtuple
from concurrent.futures import CancelledError
from io import StringIO
import json
import os
import pickle
from tempfile import TemporaryDirectory
from unittest import mock
import joblib
try:
import pandas as pd
HAS_PANDAS = True
except ImportError:
... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 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.org/licenses/LICENSE-2... | |
# The MIT License (MIT)
#
# Original work Copyright (c) 2016 Taehoon Kim
# Modified work Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
#
# 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... | |
#!/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... | |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | |
#!/usr/bin/env python
'''
OOI Models
'''
__author__ = 'M@Campbell'
from werkzeug.security import generate_password_hash, check_password_hash
from sqlalchemy.sql import expression
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
from flask.ext.sqlalchemy import BaseQ... | |
"""Module implements the `State` class.
`State` stores and exposes a parent `hoomd.Simulation` object's data (e.g.
particle positions, system bonds).
"""
from collections import defaultdict
from . import _hoomd
from hoomd.box import Box
from hoomd.snapshot import Snapshot
from hoomd.data import LocalSnapshot, LocalS... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import common_functions as common
import argparse
from matplotlib import pyplot as plt
import copy
NPE_RANGE_1 = ( 0, 50)
NPE_RANGE_2 = ( 50, 100)
NPE_RANGE_3 = ( 100, 110)
NPE_RANGE_4 = ( ... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import os
import uni... | |
#!/usr/bin/python
import os
import datetime
import copy
import sys
from lxml import etree as et
import pcbmode.config as config
from . import messages as msg
from . import svg
from . import utils
from . import place
try:
# Python 3
import html.parser as HTMLParser
except:
# Python 2
import HTMLParse... | |
#
# General:
# This file is part of .NET Bridge
#
# Copyright:
# 2010 Jonathan Shore
# 2017 Jonathan Shore and Contributors
#
# License:
# 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 c... | |
#from __future__ import unicode_literals # unused.
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import logging
import asks
from multio import asynclib
from oauthlib.common import add_params_to_uri
from oauthlib.common import urldecode as _urldecode
from oauthlib.oa... | |
# 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
# d... | |
from __future__ import division
import collections
import ctypes
import sys
import numpy
import six
from cupy import binary
from cupy import carray
from cupy import creation
from cupy import cuda
from cupy import elementwise
from cupy import flags
from cupy import indexing
from cupy import internal
from cupy import i... | |
"""
:Product: three_day_forecast.txt
:Issued: 2012 Dec 12 1235 UTC
# Prepared by the U.S. Dept. of Commerce, NOAA, Space Weather Prediction
Center
#
A. NOAA Geomagnetic Activity Observation and Forecast
The greatest observed 3 hr Kp over the past 24 hours was 1 (below NOAA
Scale levels).
The greatest expected 3 hr Kp ... | |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | |
# 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... | |
#!/usr/bin/env python
import os
import cairo
import math
import glob
import collections
def colorTuple(h):
return (int(h[0:2], 16) / 255.0, int(h[2:4], 16) / 255.0, int(h[4:6], 16) / 255.0)
NULL_MAP = 'null'
ALL_MAPS = [
('folly', colorTuple('606080')),
('tervel', colorTuple('9090b0'))... | |
import unittest
import time
import socket
import os
from unittest.mock import patch
from redis import Redis
from pyrq.unique_queues import UniqueQueue, CHUNK_SIZE
QUEUE_NAME = os.getenv('QUEUE_NAME', 'test-queue')
PROCESSING_QUEUE_SCHEMA = QUEUE_NAME + '-processing-{}[{}][{}]'
TIMEOUT_QUEUE = QUEUE_NAME + '-timeouts'... | |
# 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 ... | |
"""Unit system helper class and methods."""
from __future__ import annotations
from numbers import Number
from homeassistant.const import (
ACCUMULATED_PRECIPITATION,
CONF_UNIT_SYSTEM_IMPERIAL,
CONF_UNIT_SYSTEM_METRIC,
LENGTH,
LENGTH_INCHES,
LENGTH_KILOMETERS,
LENGTH_MILES,
LENGTH_MILL... | |
#!/usr/bin/env python
'''
Convert lecture/slides from Markdown to Jupyter Notebook format.
Fenced code blocks are converted to notebook code cells, by default.
Optionally, indented code blocks may also be converted to cells.
'''
from __future__ import print_function
import base64
import json
import os
import re
im... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Daniel Homola <dani.homola@gmail.com>
Original code and method by: Miron B Kursa, https://m2.icm.edu.pl/boruta/
License: BSD 3 clause
"""
from __future__ import print_function, division
import numpy as np
import scipy as sp
import bottleneck as bn
from sklear... | |
from threading import Thread
import json, urllib.request, urllib.parse, configparser, re, base64, sys, os, time, atexit, signal, logging, subprocess, collections, argparse, grp, pwd, shutil
from threading import Lock
import threading;
from collections import namedtuple
import random, atexit, signal, inspect
import time... | |
# -*- coding: utf-8 -*-
"""Copyright 2015 Roger R Labbe Jr.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.readthedocs.org
Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is licensed under an MIT license. See the readme.MD file
for mo... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.... | |
# vim:ts=4:sw=4:et:
# Copyright 2017-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
# no unicode literals
from __future__ import absolute_import, division, print_function
import os
import pywatchman
import WatchmanSCMTestCase
import WatchmanTestCase
def is_ubuntu():
try:
with o... | |
"""remove_dictionary_tables
Revision ID: 2ae0848d71ea
Revises: 1938f1c53c37
Create Date: 2018-12-12 10:24:00.086725
"""
# revision identifiers, used by Alembic.
revision = '2ae0848d71ea'
down_revision = '1938f1c53c37'
branch_labels = None
depends_on = None
import sqlalchemy as sa
from alembic import op
def upgra... | |
import base64
import datetime
import json
import re
import six
from dateutil import parser
from django.db import connection
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import ugettext as _
from onadata.apps.logger.models.note import Note
from onadata.apps.... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
[env]
# Conda Environment
conda create --name automate_po_job python=3.9.7
conda info --envs
source activate automate_po_job
conda deactivate
# if needed to remove
conda env remove -n [NAME_OF_THE_CONDA_ENVIRONMENT]
[path]
cd /Users/brunoflaven/Documents/03_git/BlogArtic... | |
import threading
import logging
import json
import re
from subprocess import call
import time
import os
import yaml
from PIL import Image
from six.moves import queue as Queue
from pyslack import SlackClient
from event_handler import EventHandler
def getFromDict(dataDict, mapList):
return reduce(lambda d, k: d[k... | |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.