gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python2
from __future__ import print_function
from subprocess import call, check_call, check_output
import io
import logging
import os
import subprocess
import tempfile
import time
from datetime import datetime
from behave import *
from cluster_under_test import *
from sample_cluster_management import Sa... | |
# -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2010 Olle Johansson
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,... | |
import numpy as np
import cv2
from matplotlib import pyplot as plt
from matplotlib import patches as patches
help_message = '''USAGE: slat_recognition.py [<image>]'''
if __name__ == '__main__':
import sys
try:
fn = sys.argv[1]
except:
print help_message
sys.exit(-1)
rectpo... | |
"""Miscellaneous utility functions and classes.
This module is used internally by Tornado. It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.
The one public-facing part of this module is the `Configurable` cl... | |
# coding=utf-8
# Copyright 2017 The DLT2T 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 ... | |
import time
from animation import *
from asteroidField import *
from background import *
from loader import *
from physics import *
from player import *
from powerup import *
import pygame
from pygame.locals import *
from rotatingMenu_img import *
from spacemenu import *
from starField import *
# teclas dos jogadore... | |
from qtpy.QtWidgets import QFileDialog
from addie.processing.mantid.master_table.table_tree_handler import TableTreeHandler, TableConfig, H3TableHandler
from addie.processing.mantid.master_table.selection_handler import TableHandler as MtdTableHandler
from addie.processing.mantid.master_table.table_row_handler import ... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
import shutil
import tempfile
import configparser
from textwrap import dedent
import tarfile
import pyaml
import hashlib
import os
import re
import bs4
import urllib
from urllib import request
from urllib import parse
from urllib import error
from collections import OrderedDict
import logging
imp... | |
"""
Base/mixin classes for the spatial backend database operations and the
`SpatialRefSys` model the backend.
"""
import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class BaseSpatialOperations(object):
"""
This module holds... | |
"""Converter from typedoc output to jsdoc doclet format"""
import os
import sys
import json
from six import iteritems
# JSDoc entries used in sphinx-js:
# - optional access of [ public, private, protected ]
# - optional classdesc
# - optional comment (controls doclet inclusion)
# - optional description
# - optional ... | |
import random
import docker
from docker.utils import create_ipam_config
from docker.utils import create_ipam_pool
import pytest
from .. import helpers
from ..base import requires_api_version
class TestNetworks(helpers.BaseTestCase):
def create_network(self, *args, **kwargs):
net_name = u'dockerpy{}'.for... | |
"""Unit test for websocket.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import os
import shutil
import sqlite3
import tempfile
import time
import unittest
# Disable W0611: Unused import
... | |
import os
import sys
import subprocess
import json
import random
import operator
import logging
import requests
import indicoio
from chatterbot import ChatBot
from uuid import uuid4
from binascii import a2b_base64
from clarifai.client import ClarifaiApi
from flask import (Flask, render_template, request, redirect, ses... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2021 BigML
#
# 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 ... | |
#!/usr/bin/env python
import datetime
import json
import logging
import os
import sys
import time
from collections import deque
from tornado import gen
import motor
import tornado.ioloop
import tornado.web
import tornado.options
import tornadio2
import pymongo
from bson.objectid import ObjectId
# Global state: new c... | |
#!/Users/alicetopping/dev/nyu-python/course3/assignments/blog_virtual/bin/python
import datetime
import sys
from getpass import getpass
from optparse import OptionParser
from peewee import *
from peewee import print_
from peewee import __version__ as peewee_version
from playhouse.reflection import *
TEMPLATE = """fr... | |
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from direct.showbase.PythonUtil import *
from direct.interval.IntervalGlobal import *
from direct.showbase.InputStateGlobal import inputState
from pandac.PandaModules import *
import Avatar
from direct.controls import ControlManager
import Distributed... | |
import traceback
import ipaddress
from logging import Logger
from cloudshell.shell.core.driver_context import CancellationContext
from cloudshell.cp.aws.domain.common.cancellation_service import CommandCancellationService
from cloudshell.cp.aws.domain.services.ec2.subnet import SubnetService
from cloudshell.cp.aws.do... | |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
"""
Implementation of the configuration object.
"""
from __future__ import absolute_import
from __future__ import print_funct... | |
from __future__ import print_function
import sys
import re
import copy
from .options import BeautifierOptions
from jsbeautifier.core.options import mergeOpts
from jsbeautifier.core.output import Output
from jsbeautifier.__version__ import __version__
#
# The MIT License (MIT)
# Copyright (c) 2007-2017 Einar Lielmanis... | |
import os
import sys
import math
import numpy as np
from PyQt4 import QtCore
from PyQt4.QtGui import *
from PyQt4.QtCore import Qt, QSize, pyqtSignal
from Orange.canvas.utils import environ
from Orange.widgets import gui
from Orange.widgets.utils import colorbrewer
DefaultRGBColors = [
(0, 0, 255), (255, 0, 0), ... | |
from __future__ import unicode_literals
import requests
from django.db import transaction
from api.files.serializers import get_file_download_link
from osf.models import ChronosJournal
from osf.models import ChronosSubmission
from osf.utils.workflows import ChronosSubmissionStatus, ReviewStates
from website.settings ... | |
"""Test the config manager."""
import asyncio
from datetime import timedelta
from unittest.mock import MagicMock, patch
import pytest
from homeassistant import config_entries, data_entry_flow, loader
from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.se... | |
# Copyright 2010-2013 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Python 3 compatibility tools (PRIVATE).
We used to have lines like this under Python 2 in... | |
import hashlib
import json
from PIL import Image
from django.http import HttpResponse
from django.shortcuts import render
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from crits.core.class_mapper import class_from_id
from crits.core.crits_mongoengine i... | |
import re
import warnings
import numpy as np
import logging
from scipy import stats
import os
import mirnylib.h5dict
import mirnylib.numutils
import mirnylib.numutils_new
from scipy.stats.stats import spearmanr
log = logging.getLogger(__name__)
try:
from fastBinSearch import binarySearch as bs # @UnresolvedI... | |
#!/usr/bin/python
"""
.. module:: shellscribe
Shell-Scribe run.py
@author: Keith E. Miller <keithmiller@umass.edu>
Expected issues:
- cd command is shell-scribe specific so commands that use cd in a non-trivial
way might break the cd command
"""
import cmd
import os
import sys
import argparse as ap
import datetime
im... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | |
'''
Created on Nov 17, 2012
@author: ambarik
'''
import pexpect
import string
import time
import os
SCRIPT_LOG = 'Script Logs.log'
IOS = 'IOS'
IOS_XR = 'IOS XR'
MORE_OUTPUT_PROMPT = " --More-- "
STRIP_ASCII_CHAR = '\x08'
# TODO: Fix STRIP_ASCII_CHAR
def printable_out(str_in):
# In case of --More--
str_in ... | |
# -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... | |
#
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The exos legacy fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the con... | |
import gzip
import os
import struct
import numpy as np
from time import perf_counter
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
import cntk
from cntk.layers import Convolution, MaxPooling, Dropout, Dense
from cntk.initializer import gaussian
'''
----------... | |
"""TestCases for the PaystackSDK."""
import unittest
import random
import string
from paystack import util
from paystack.resource import (TransactionResource,
)
from paystack.client import (HTTPClient,
RequestsClient)
class PaystackSDKTest(unittest.TestCas... | |
"""
This module implements some special functions that commonly appear in
combinatorial contexts (e.g. in power series); in particular,
sequences of rational numbers such as Bernoulli and Fibonacci numbers.
Factorials, binomial coefficients and related functions are located in
the separate 'factorials' module.
"""
fr... | |
# -*- coding: utf-8 -*-
"""Parser for Linux utmp files."""
from dfdatetime import posix_time as dfdatetime_posix_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import errors
from plaso.lib import definitions
from plaso.parsers import dtfabric_parser
from plaso.parsers... | |
# Copyright 2017-present Open Networking 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 agr... | |
from __future__ import unicode_literals
import copy
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from django.apps import AppConfig
from django.apps.registry import Apps, apps as global_apps
from django.conf import settings
from django.db import models
from django.db.models... | |
# Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
# 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 ... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | |
# Std lib imports
import logging
import os
# Django imports
from django.shortcuts import get_object_or_404, redirect
from django.conf import settings
from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic import View
from django.core.serializers import serialize
# DRF imp... | |
import multiprocessing
import paramiko
import select
import threading
import time
import traceback
class Connection(object):
def __init__(self, client, connection_id, publisher, keyfile):
self.transport = paramiko.Transport(client)
key = None
with open(keyfile) as f:
header = f... | |
#Wikipedia Crawler v3 (inserting results into MySQL)
# @author: Hardik Vasa
#Import Libraries
import time #For Delay
import urllib.request #Extracting web pages
import re
#Defining pages
starting_page = "https://en.wikipedia.org/wiki/Spacetime"
seed_page = "https://en.wikipedia.org" #Crawling the English Wik... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from unittest.mock import MagicMock, call
from syncer import sync
from wdom.document import set_app
from wdom.event import create_event
from wdom.node import Text
from wdom.server import _tornado
from wdom.web_node import WdomElement
from .base import TestCase
class ... | |
"""
CS311
Author: Joe Pinsonault
Contains unit tests for the DFA module
Tests all the DFAs in ./test_dfas
Each DFA yaml file includes a list of strings it should accept and
a list it shouldn't. These are all tested here
In addition, each DFA contains a regular expression describing the
... | |
#!/usr/bin/env python
#Copyright (C) 2014 by Glenn Hickey
#
#Released under the MIT license, see LICENSE.txt
import sys
import os
import argparse
import logging
import numpy as np
import math
import copy
from teHmm.track import TrackList
from teHmm.trackIO import readTrackData
from teHmm.common import myLog, EPSILON,... | |
#!/usr/bin/env python3
# Quantopian, Inc. licenses this file to you 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 ... | |
#Copyright 2008, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#LIMITED... | |
import json
import re
from datetime import datetime, timedelta
from os import path, unlink
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import six
import olympia.core.logger
from olympia import amo
from olympia.addons.models import Addon
from olympia.stats.mode... | |
import time
import sqlalchemy
from sqlalchemy.orm import relationship, backref
from sqlalchemy.orm.exc import NoResultFound
import zeeguu_core
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, UnicodeText, Table
from zeeguu_core.constants import JSON_TIME_FORMAT
from zeeguu_core.language.difficu... | |
"""
Large portions of this implementation were influenced or downright copied from
the `eth-testrpc` project by ConsenSys
https://github.com/ConsenSys/eth-testrpc
"""
import os
import time
import itertools
import functools
from testrpc.compat import threading
import rlp
from ethereum import transactions
from ethere... | |
from datetime import datetime
from io import StringIO
from textwrap import dedent
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
option_context,
to_datetime,
)
def test_repr_embedded_ndarray():
arr = np.empty(10, dtype=[("err", object)])
for i in range(len(arr)):
... | |
import random, copy, types
def aux_insertTree(childTree, parentTree):
"""This a private (You shouldn't have to call it) recursive function that inserts a child tree into a parent tree."""
if childTree.x1 != None and childTree.x2 != None :
parentTree.insert(childTree.x1, childTree.x2, childTree.name, childTree.refe... | |
# engine/default.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
"""Default implementations of per-dialect sqlalchemy.engine classes.
These are semi... | |
# Copyright 2013 Open Cloud Consortium
#
# 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... | |
# 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 ... | |
"""
Environment wrappers for turn/travel corridor navigation.
$Id: facegridworld.py,v 1.11 2006/03/24 23:53:55 adastra Exp $
"""
import random
from plastk.rl.gridworld import *
from plastk.display import pol2cart,pi
class FaceGridWorld(GridWorld):
"""
FaceGridWorld is a dummy wrapper around GridWorld,
w... | |
##################################################
# ./AppService_services.py
# generated by ZSI.wsdl2python
#
#
##################################################
from AppService_services_types import *
from AppService_services_types import \
nbcr_sdsc_edu_opal_types as ns1
import urlparse, types
from ZSI.T... | |
# Copyright (c) 2013 Hortonworks, 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 ... | |
#!/usr/bin/env python
#
# test_iso.py - Unit test cases for ISO disk representation.
#
# October 2016, Glenn F. Matthews
# Copyright (c) 2014-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes_py.models.v1.ContainerPort import ContainerPort
from kubernetes_py.models.v1.EnvVar import EnvVar
from kubernetes_py.models.v1... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# lapack_testing.py
###############################################################################
from subprocess import Popen, STDOUT, PIPE
import os, sys, math
import getopt
# Argume... | |
"""
Unit tests for the differential global minimization algorithm.
"""
from scipy.optimize import _differentialevolution
from scipy.optimize._differentialevolution import DifferentialEvolutionSolver
from scipy.optimize import differential_evolution
import numpy as np
from scipy.optimize import rosen
from numpy.testing ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | |
#!/usr/bin/env python3
import argparse
import logging
import os
import stat
import subprocess
import sys
import time
import yaml
import paramiko
'''
config-agent: {}
nsr_name: ccore_testbed_nsd
parameter: {}
vnfr:
1:
connection_point:
- ip_address: 14.0.0.4
name: homesteadprov_vnfd/sigport
mgmt_ip_a... | |
#-----------------------------------------------------------------------
# Comment
#-----------------------------------------------------------------------
class Comment(In.entity.Entity):
'''Comment Entity class.
'''
def __init__(self, data = None, items = None, **args):
# default
self.nabar_id = 0
... | |
# Copyright 2015 HP Software, LLC
# 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 o... | |
# issue: https://github.com/0-complexity/openvcloud/issues/768
def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
return {
'test': ['install']
... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
# Copyright (c) 1998-2002 John Aycock
#
# 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 re... | |
# Copyright (c) 2021 PaddlePaddle 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 app... | |
try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, urlunparse
import uuid
from datetime import datetime
from functools import update_wrapper
from werkzeug.utils import redirect
from flask import Flask
from flask.json import jsonify
from flask.templating import... | |
import collections
from collections import defaultdict
from fractions import Fraction
import pyperf
def topoSort(roots, getParents):
"""Return a topological sorting of nodes in a graph.
roots - list of root nodes to search from
getParents - function which returns the parents of a given node
"""
... | |
import re
from six.moves import xrange
from pychemy.amino_acids import AMINO_ACIDS, LOSSES
from pychemy.molmass import Formula
# Retreives first amino acid from peptide sequence based on those available in AMINO_ACIDS
def get_next_aa(sequence):
keep = []
for key in AMINO_ACIDS:
if sequence.startswith(key.mo... | |
# -*- coding: utf-8 -*-
"""OSF mailing utilities.
Email templates go in website/templates/emails
Templates must end in ``.txt.mako`` for plaintext emails or``.html.mako`` for html emails.
You can then create a `Mail` object given the basename of the template and
the email subject. ::
CONFIRM_EMAIL = Mail(tpl_pre... | |
#!/usr/bin/env python3
import sys
import re
import os
import subprocess
import numpy
import fileinput
from datetime import *
## NOTE: We want this file with only dependencies on standart-library things
## Dependencies to own files are an absolut no-go
def parse_sk_m(line):
"""
Parse sk_m measurements.
T... | |
"""Build and maintain a database of Kepler/K2 publications.
"""
from __future__ import print_function, division, unicode_literals
# Standard library
import os
import re
import sys
import json
import datetime
import argparse
import collections
import sqlite3 as sql
import numpy as np
try:
import ads
except Excepti... | |
# -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
from website.models import Node
from tests.base import ApiTestCase
from api.base.settings.defaults import API_BASE
from tests.factories import ProjectFactory, FolderFactory, DashboardFactory, AuthUserFactory
from website.util.sanitize import strip_html
... | |
#!/usr/bin/python
# Copyright: Ansible Project
# 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_version': '1.1',
'status': ['stableinterf... | |
# 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 contextlib import contextmanager
from recipe_engine import recipe_api
from recipe_engine.types import freeze
DEPS = [
'chromium',
'chromium_android... | |
'''
This file contains useful wrappers for the primary reduction and analysis
functions of pyDIS. These helper routines enable painless reduction of,
for example, an entire night of simple data (autoreduce).
'''
import pydis
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import datetime... | |
import torch
import torch.nn as nn
import numpy as np
from typing import Dict, List
from eight_mile.pytorch.layers import (
Dense,
TransformerEncoderStack,
TransformerEncoder,
TransformerDecoderStack,
TransformerDecoder,
EmbeddingsStack,
WithDropout,
SingleHeadReduction,
SpatialGatin... | |
"""Logging in Kea"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import srv_msg
import misc
@pytest.mark.v4
@pytest.mark.kea_only
@pytest.mark.logging
def test_v4_loggers_options_debug():
misc.test_setup()
srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192... | |
import binascii
import logging
import os
import random
import socket
import tarfile
import tempfile
import time
import traceback
import redis
import zmq
import bqueryd
from bqueryd.messages import msg_factory, Message, WorkerRegisterMessage, ErrorMessage, \
BusyMessage, DoneMessage, StopMessage, TicketDoneMessage... | |
import zmq.green as zmq
from zmq.utils.garbage import gc
_zmqctx = zmq.Context()
_zmqctx.max_sockets = 32768
gc.context = _zmqctx
import base64
import datetime
import gevent
import gevent.pywsgi
import msgpack
import os
import secrets
import socket
import sys
import types
import weakref
from ._env import ... | |
from collections import OrderedDict
from django.contrib.gis.geos import Polygon
from django.core.exceptions import ImproperlyConfigured
from rest_framework.serializers import (
LIST_SERIALIZER_KWARGS,
ListSerializer,
ModelSerializer,
)
from .fields import GeometryField, GeometrySerializerMethodField # no... | |
# (c) The James Hutton Institute 2013
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@hutton.ac.uk
#
# Leighton Pritchard,
# Information and Computing Sciences,
# James Hutton Institute,
# Errol Road,
# Invergowrie,
# Dundee,
# DD6 9LH,
# Scotland,
# UK
#
# The MIT License
#
# Copyright (c) 2010-2014 The... | |
import numpy as np
from copy import deepcopy
from pycqed.measurement.waveform_control import pulsar as ps
from pycqed.measurement.waveform_control import sequence as sequence
from pycqed.measurement.waveform_control import segment as segment
from pycqed.measurement.pulse_sequences.single_qubit_tek_seq_elts import \
... | |
# Copyright (c) 2014 Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | |
from datetime import datetime
from dimagi.utils.couch.undo import DELETED_SUFFIX
from dimagi.utils.modules import to_function
from toggle.shortcuts import set_toggle
from corehq.toggles import NEW_EXPORTS, NAMESPACE_DOMAIN, ALLOW_USER_DEFINED_EXPORT_COLUMNS
from corehq.util.log import with_progress_bar
from corehq.ap... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 27 2015 16:45
@author: mayers
"""
#
#import matplotlib
#matplotlib.use('TkAgg')
import gettext
import sys
from tkinter import *
from tkinter import ttk
import CoolProp
from CoolProp.CoolProp import PropsSI
from cpgui_all import *
class cpgStatepoint(myDialog):
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Anima Istanbul
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import os
class EditBase(object):
"""The base for other Edit classes
"""
def from_xml(self, xml_node):
... | |
import numpy as np
from . import backend as K
from .utils.generic_utils import get_from_module
def binary_accuracy(y_true, y_pred):
'''Calculates the mean accuracy rate across all predictions for binary
classification problems.
'''
return K.mean(K.equal(y_true, K.round(y_pred)))
def categorical_accu... | |
# Copyright (c) 2015 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 ... | |
# Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
import hashlib
import itertools
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from binascii i... | |
# ----- Info ------------------------------------------------------------------
__author__ = 'Michael Montero <mcmontero@gmail.com>'
# ----- Imports ---------------------------------------------------------------
from tinyAPI.base.config import ConfigManager
from tinyAPI.base.data_store.provider import DataStoreMySQ... | |
# class to get get data from OpenBooks
import httplib2
import json
import sqlalchemy
from copy import deepcopy
from oauth2client import file, client, tools
from octopus.core import app, initialise
from service.database import db, FA_API_TABLES
from service.lib import util
class Sync(object):
SCOPES = 'CottageLab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.