gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import sys
import traceback
import zstackwoodpecker.header.checker as checker_header
import zstackwoodpecker.header.vm as vm_header
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstacklib.ut... | |
# 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 (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above ... | |
import random
import string
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Categorical, date_range, read_csv
from pandas.compat import cStringIO as StringIO
from ..pandas_vb_common import BaseIO
class ToCSV(BaseIO):
fname = '__test__.csv'
params = ['wide', 'long', 'mixed'... | |
# -*- coding: utf-8 -*-
from logging import getLogger
from os.path import join
from django.conf import settings
from django.contrib.auth import get_permission_codename
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.core.ur... | |
#!/usr/bin/env python
"""
Core Neurokernel classes.
"""
import atexit
import time
import bidict
from mpi4py import MPI
import numpy as np
import twiggy
from ctx_managers import IgnoreKeyboardInterrupt, OnKeyboardInterrupt, \
ExceptionOnSignal, TryExceptionOnSignal
from mixins import LoggerMixin
import mpi
from... | |
''' Version 1.000
Code provided by Daniel Jiwoong Im
Permission is granted for anyone to copy, use, modify, or distribute this
program and accompanying programs and documents for any purpose, provided
this copyright notice is retained and prominently displayed, along with
a note saying that the original programs... | |
'''
Implements stream writing of data after pcikling and compressing them.
'''
# TODO: optimization
# https://www.python.org/doc/essays/list2str/
import pickle as cP
import re
import zlib
import fileops as fops
import err
from IPython import embed
# Problem is, the delmiter is not unique. And the pickled data ca... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
'''
The MIT License (MIT)
Copyright (c) 2015 Thami Rusdi Agus - https://github.com/janglapuk/SPB-OpenCV-Recognizer
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 w... | |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Execute a volatility command on the client memory.
This module implements the volatility enabled client actions which enable
volatility to operate directly on the client.
"""
# Initialize the volatility plugins, so pylint: disable=unused-i... | |
# sqlalchemy/events.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Core event interfaces."""
from . import event, exc
from .pool import Pool
fro... | |
#
# 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... | |
""" Vanilla RNN
@author Graham Taylor
"""
import numpy as np
import theano
import theano.tensor as T
from sklearn.base import BaseEstimator
import logging
import time
import os
import datetime
import pickle as pickle
import math
import matplotlib.pyplot as plt
plt.ion()
mode = theano.Mode(linker='cvm')
#mode = '... | |
"""Class to manage the entities for a single platform."""
from __future__ import annotations
import asyncio
from contextvars import ContextVar
from datetime import datetime, timedelta
from logging import Logger
from types import ModuleType
from typing import TYPE_CHECKING, Callable, Coroutine, Dict, Iterable, List, Op... | |
from PyObjCTools.TestSupport import *
import objc
import array
import sys
from Foundation import *
from PyObjCTest.testhelper import PyObjC_TestClass3
if sys.version_info[0] == 3:
buffer = memoryview
def array_frombytes(a, b):
return a.frombytes(b)
def array_tobytes(a):
return a.tobytes(... | |
'''
Created on Jan 4, 2011
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
'''
from arelle import PythonUtil # define 2.x or 3.x string types
import copy, datetime, isodate
from decimal import Decimal
try:
import regex as re
except ImportError:
import re
XmlUtil ... | |
import logging
from threading import local
from django.conf import settings
from django.core import signals
from django.db import models
from django.db.models.signals import pre_delete, post_save, m2m_changed
from django.dispatch import receiver
from elasticutils.contrib.django import MappingType, Indexable, MLT
from... | |
# Copyright (c) 2012 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 os
import unittest
from telemetry.page import buildbot_page_measurement_results
from telemetry.page import page_set
from telemetry.page import per... | |
# Copyright (c) 2013 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 agreed to in writ... | |
from datetime import datetime, timezone
from unittest.mock import patch
from rest_framework.test import APITestCase, APIClient
task_keys = ['id',
'task_def',
'status',
'worker_id',
'locked_at',
'priority',
'unique',
'run_at',
... | |
#!/usr/bin/env python
# Copyright (C) 2011, Kees Bos <cornelis.bos@gmail.com>
#
# 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 req... | |
import io
import re
import serial
import time
import glob
from pocs.focuser.focuser import AbstractFocuser
# Birger adaptor serial numbers should be 5 digits
serial_number_pattern = re.compile('^\d{5}$')
# Error codes should be 'ERR' followed by 1-2 digits
error_pattern = re.compile('(?<=ERR)\d{1,2}')
error_message... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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... | |
import upseto
import unittest
import gitwrapper
import upsetowrapper
import upseto.manifest
import upseto.gitwrapper
import os
import shutil
import tempfile
import zipfile
class Test(unittest.TestCase):
def setUp(self):
gitwrapper.setUp()
def tearDown(self):
gitwrapper.tearDown()
class S... | |
#!/usr/bin/env python
"""
The LLVM Compiler Infrastructure
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
Prepares language bindings for LLDB build process. Run with --help
to see a description of the supported command line arguments.
... | |
#!/usr/bin/env python
from data_iterator import *
from state import *
from session_encdec import *
from utils import *
import time
import traceback
import os.path
import sys
import argparse
import cPickle
import logging
import search
import pprint
import numpy
import collections
import signal
class Unbuffered:
d... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# change log:
# 2016-02-04 - RP
# altered functions: load(), long and short_sma() etc., enabled passing args w/o prompts
# in sign_sequence: got rid of consolidation to single column
from __future__ import (
absolute_import, division, print_function, with_stat... | |
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import IntegerField, BooleanField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils.encoding import python_2_unicode_co... | |
def _reset_sys_path():
# Clear generic sys.path[0]
import sys, os
resources = os.environ['RESOURCEPATH']
while sys.path[0] == resources:
del sys.path[0]
_reset_sys_path()
def _site_packages():
import site, sys, os
paths = []
prefixes = [sys.prefix]
if sys.exec_prefix != sys.pre... | |
# 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... | |
# VMware vCloud Python SDK
# Copyright (c) 2014 VMware, 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... | |
from __future__ import print_function
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import argparse
import csv
import os
import os.path
import shutil
import time
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.... | |
#!/usr/local/bin/python3
"""
containers
Python 3 version
This is a simple implementation of Stack, Queue, and Deque
Under the covers these are all derived from a doubley
linked list class
Clive Darke QA
"""
class _Node:
def __init__(self, Data):
self.NextNode = None
self.PrevNode = None
s... | |
# Copyright (c) 2016-present, Facebook, 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... | |
# ext/declarative/clsregistry.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to handle the string class registry used by declarative.
... | |
import json
import numpy
from heroes import HEROES
__author__ = 'yanbo'
import io
import os
from smoke.io.wrap import demo as io_wrap_demo
from smoke.replay import demo as replay_demo
from smoke.replay.const import Data
import pylab
import matplotlib
import matplotlib.image
import scipy.ndimage
import cPickle
from map... | |
"""abd automates the creation and landing of reviews from branches."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdi_processrepo
#
# Public Functions:
# create_review
# create_differen... | |
import re
import logging
from decimal import Decimal
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from product_spiders.items import Product, ProductLoader
cla... | |
# -*- coding: utf-8 -*-
from flexmock import flexmock, flexmock_teardown
from .. import OratorTestCase, mock
from ..utils import MockModel, MockQueryBuilder, MockConnection, MockProcessor
from orator.query.grammars.grammar import QueryGrammar
from orator.query.builder import QueryBuilder
from orator.orm.builder import... | |
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 law or agreed... | |
"""
Taiga integration for Zulip.
Tips for notification output:
*Emojis*: most of the events have specific emojis e.g.
- :notebook: - change of subject/name/description
- :chart_with_upwards_trend: - change of status
etc. If no there's no meaningful emoji for certain event, the defaults are used:
- :thought_balloon: -... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
import unittest
import numpy as np
import tensorflow as tf
from niftynet.engine.image_window import N_SPATIAL, LOCATION_FORMAT
from niftynet.engine.image_window_dataset import ImageWindowDataset
from niftynet.io.image_reader imp... | |
__author__ = "Andre Merzky, Ole Weidner"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
import os
import saga.context
import saga.exceptions as se
import saga.adaptors.base
import saga.adaptors.cpi.context
SYNC_CALL = saga.adaptors.cpi.decorators.SYNC_CALL
ASYNC_CALL = saga.adapt... | |
#!/usr/bin/python3
#import the ibm code
from IBMQuantumExperience import *
from interactCfg import *
from helperFunction import *
from Error import *
import os
import sys
import re
from Gate import SplitGate
import time
#get the info about the function name and the line number
def get_curl_info():
try:
raise Except... | |
import random
import math
from xdict import utils
#####
def gen_random_ascii_chr():
return(chr(math.floor(random.random() * 256 + 1) % 256))
def gen_random_ascii_str(length):
rslt = ""
for i in range(0,length):
rslt = rslt + gen_random_ascii_chr()
return(rslt)
def gen_random_str_of_length(len... | |
# Which key(s) were pressed
# What chars to print (if any)
# Keycode(s) generating event
import string
from .unikeys import UnicodeAsciiKeys
# These are used for the names of ctrl keys, etc.
ASCII_NAMES = {
'\t': 'tab',
' ': 'space', # 0x20
'!': 'exclamation', # 0x21
'"': 'double quote', ... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
import numpy as np
# Delayed import: scipy.optimize
# It is imported in the minimization function, so the main functionality
# of this module is preserved even if SciPy is not installed.
def ElasticConstants(atoms, symmetry, minimize=False, **kwargs):
"""Calculate the anisotropic elastic constants of a system.
... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | |
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>.
# Use of this source code is governed by MIT license that can be
# found in the LICENSE file.
import os
import stat
import tempfile
import time
try:
from stat import filemode as _filemode # PY 3.3
except ImportError:
from tarfile import filemode as ... | |
# Copyright 2018 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 or agreed to in writing,... | |
'''
Copyright (c) 2010 Pavel Grafov
Implementation of AVL trees (http://en.wikipedia.org/wiki/AVL_tree) in Python.
Class AVL Tree supports the following functionality:
- insertion of a new entry in the tree;
- removal of any entry in the tree;
- search for any entry in the tree;
- "sanity check" for the tree (desc... | |
# 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 (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2014-2017 The Mocacoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinr... | |
from __future__ import absolute_import, unicode_literals
import sys
import warnings
from kombu import Connection
from kombu.exceptions import ResourceError, ChannelError
from kombu.transport import virtual
from kombu.utils import uuid
from kombu.compression import compress
from kombu.tests.case import Case, MagicMoc... | |
# xmlrpc_registry.py - A method registry for use with xmlrpclib
# Copyright (C) 2001 by Eric Kidd. All rights reserved.
# Modified by Daniel J. Pearson on 24 Feb 2003
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... | |
# 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 2013 Rackspace Hosting 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 applic... | |
"""Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------
# Copyright (c) 2016 The Regents of the University of California
#
# This file is part of kevlar (http://github.com/dib-lab/kevlar) and is
# licensed under the MIT license: see LICENSE.
# ----... | |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | |
import pytest
import importlib
from unittest import mock
from google.protobuf import json_format
from google.protobuf import struct_pb2
from google.cloud import aiplatform
from google.cloud.aiplatform import base
from google.cloud.aiplatform import datasets
from google.cloud.aiplatform import initializer
from google.... | |
print(" # db_model.py")
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from basic_wms import app
DB_FILENAME = 'database.db'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///model/' + DB_FILENAME
# app.config['SQLALCHEMY_ECHO'] = True
db = SQLAlchemy(app)
class CommonFieldsSQLA:
"""
... | |
from __future__ import print_function
from os.path import dirname, abspath
from subprocess import check_output
import json
import os
import requests
import subprocess
import pytest
from pprint import pprint
DATADIR = "testdata"
DEBUG = 0
SHOCK_URL = ""
SHOCK_USER_AUTH = ""
SHOCK_ADMIN_AUTH = ""
AUTH = ""
FILELIST... | |
"""
Wrapper class around the ndarray object for the array API standard.
The array API standard defines some behaviors differently than ndarray, in
particular, type promotion rules are different (the standard has no
value-based casting). The standard also specifies a more limited subset of
array methods and functionali... | |
import unittest
from nose.tools import eq_, ok_
from mock import patch, Mock
from docar.backends import BackendManager
from docar.backends.django import DjangoBackendManager
from docar import Document, Collection, fields
class when_a_django_backend_manager_gets_instantiated(unittest.TestCase):
# def it_can_fetc... | |
# -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : Automated test suites with unittest
run "python -m unittest -v test" in the module directory to run the tests
The clock decorator in utils will measure the run time of the test
"""
#########################################################
# Import Packages an... | |
#!/usr/bin/python
# posts to youtube
from process import process
import youtube_v3_uploader
import ia_uploader
# import rax_uploader
import os
import pprint
import re
import pw
from django.template.defaultfilters import slugify
# from add_to_richard import get_video_id
from main.models import Show, Location, Ep... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Consumes tweets from the Twitter Streaming API and puts them on a
redis queue. In addition, it listens to the redis queue, for:
* new hashtags and follower ids to add to the track predicates
* a "reload" instruction
XXX implement the ``manager.reload_pre... | |
from mss import mss
from PIL import Image, ImageTk
from collections import deque
from tkinter import ttk
import tkinter as tk
import threading, queue, time, sys, sdl2, pickle, json, os
from JoystickInput import JoystickInput_SDL
from DataViewer import DataViewerFrame
from JoystickServer import JoystickServerFrame
glo... | |
from cStringIO import StringIO
import boto.connection
import boto.exception
import boto.s3.connection
import boto.s3.acl
import boto.utils
import bunch
import nose
import operator
import random
import string
import socket
import ssl
import os
import re
from email.utils import formatdate
from urlparse import urlparse
... | |
# 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... | |
"""This module defines the `IoManager` class
which manages I/O for file objects connected to an existing gdb process
or pty.
"""
import io
import select
import time
from pprint import pformat
from typing import Union, List, Optional, Dict, Any, Tuple
from pygdbmi import gdbmiparser
import os
import logging
from pygdbmi... | |
# Copyright 2019 The TensorFlow Probability 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 o... | |
"""This file show how we can use Pycuda compiled fct in a Theano
Op. Do no use those op in production code. See the TODO.
You can use them as a guide to use your pycuda code into a Theano op.
The PycudaElemwiseSourceModuleOp is a Theano op use pycuda code
generated with pycuda.compiler.SourceModule
Their is a test i... | |
# Copyright 2013 Beijing Huron Technology Co.Ltd.
#
# Authors: Li Xipeng <lixipeng@hihuron.com>
#
# 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/lice... | |
from dbt.contracts.graph.manifest import CompileResultNode
from dbt.contracts.graph.unparsed import (
FreshnessThreshold
)
from dbt.contracts.graph.parsed import ParsedSourceDefinition
from dbt.contracts.util import (
BaseArtifactMetadata,
ArtifactMixin,
VersionedSchema,
Replaceable,
schema_vers... | |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
from... | |
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... | |
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
# Copyright (c) 2013, 2014 Bob Tolbert <bob@tolbert.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, incl... | |
# 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... | |
# util/compat.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Handle Python version/platform incompatibilities."""
from __future__ import anno... | |
"""Compute the action of the matrix exponential.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
import scipy.sparse.linalg
from scipy.sparse.linalg import LinearOperator, aslinearoperator
__all__ = ['expm_multiply']
def _exact_inf_norm(A):
# A compa... | |
# A few utility functions
import itertools
import numpy as np
###############################################
# Generally useful functions #
###############################################
# useful with reshape
def linearize_indices(indices, dims):
res = []
remain = indices
for i, _ in en... | |
# 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 ... | |
"""SOClone views."""
import datetime
import itertools
from django.contrib.auth.models import User
from django.contrib.auth import views as auth_views
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404, HttpResponseRedirect... | |
#!/bin/env python
# ColorImgSort
# Sorts images based on color
# by Ed Salisbury <ed@edsalisbury.net>
# Written: 2013/12/24
import argparse
import os
import os.path
import math
from PIL import Image
class ImgSort():
def __init__(self, **kwargs):
"""Class constructor - sets up the internal variables"""
... | |
#
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | |
"""Exception and error handling.
This contains the core exceptions that the implementations should raise
as well as the IActiveScriptError interface code.
"""
import sys, traceback
from win32com.axscript import axscript
import winerror
import win32com.server.exception
import win32com.server.util
import pythoncom
... | |
# 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 agreed to in... | |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import time
from django.conf import settings
from django.core import mail
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.amo.tests import addon_factory, user_factory
from olympia.addons.models import Addon, AddonUser
from ol... | |
#!/usr/bin/env python3
import os
import sys
import random
import time
from random import seed, randint
import argparse
import platform
from datetime import datetime
# import imp
import glob
from time import sleep
import fileinput
import numpy as np
import pandas as pd
# from small_script.variable_test import variable_t... | |
# 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 ... | |
#!/usr/bin/env python
"""
Wgetter is another command line download utility written completely in python.
It is based on python-wget (https://bitbucket.org/techtonik/python-wget/src) with some improvements.
It works on python >= 2.6 or python >=3.0 Runs on Windows or Linux or Mac
API Usage:
>>> import wgetter
>>> fil... | |
"""Manage config entries in Home Assistant."""
import asyncio
import functools
import logging
from typing import Any, Callable, Dict, List, Optional, Set, Union, cast
import uuid
import weakref
import attr
from homeassistant import data_entry_flow, loader
from homeassistant.core import HomeAssistant, callback
from ho... | |
#
# Copyright Ericsson AB 2013. All rights reserved
#
# Authors: Ildiko Vancsa <ildiko.vancsa@ericsson.com>
# Balazs Gibizer <balazs.gibizer@ericsson.com>
#
# 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 co... | |
import math
import os
import timeit;
program_start_time = timeit.default_timer()
import random
random.seed(int(timeit.default_timer()))
from phoneme_set import phoneme_set_39_list
import formatting, preprocessWavs
import general_tools
import logging
logger = logging.getLogger('PrepTCDTIMIT')
logger.setLevel(logging.... | |
from __future__ import division, print_function,absolute_import
import pylab as plt
import amitgroup.plot as gr
import numpy as np
import amitgroup as ag
import os
import pnet
import matplotlib.pylab as plot
from pnet.cyfuncs import index_map_pooling
from Queue import Queue
"""This tutorial introduces restricted boltz... | |
import abc
import os
import time
import markupsafe
import requests
from django.db import models
from framework.auth import Auth
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError, PermissionsError
from mako.lookup import TemplateLookup
from osf.models.base import BaseMod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.