gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python3
import struct
import json
import socket
import re
from enum import Enum
from Xlib import display
class MessageType(Enum):
COMMAND = 0
GET_WORKSPACES = 1
SUBSCRIBE = 2
GET_OUTPUTS = 3
GET_TREE = 4
GET_MARKS = 5
GET_BAR_CONFIG = 6
GET_VERSION = 7
class Event(obj... | |
# Copyright 2015, eBay 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 agre... | |
"""
Test the ColumnTransformer.
"""
import numpy as np
from scipy import sparse
import pytest
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing i... | |
from collections.abc import Sequence
import numpy as np
import pytest
try:
import rowan
skip_rowan = False
except ImportError:
skip_rowan = True
import hoomd
import hoomd.md as md
skip_rowan = pytest.mark.skipif(skip_rowan, reason="rowan cannot be imported.")
@pytest.fixture
def valid_body_definition(... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 22 22:34:46 2016
"""
#!/usr/bin/env python
import json
import socket
import smbus
import os
import hashlib
import httplib
import time
import threading
from M2Crypto import m2
from M2Crypto import RSA
class AVRChip(object):
"""
Class for communicating with the AV... | |
import gzip
import json
import logging
import os
import tempfile
import zipfile
import pytest
import retrying
import test_helpers
from dcos_test_utils.diagnostics import Diagnostics
from dcos_test_utils.helpers import check_json
__maintainer__ = 'mnaboka'
__contact__ = '[email protected]'
# Expected la... | |
# Copyright (c) 2021, Manfred Moitzi
# License: MIT License
from typing import Any, List, Dict, Optional
import textwrap
from ezdxf.lldxf.types import (
render_tag,
DXFVertex,
GROUP_MARKERS,
POINTER_CODES,
)
from ezdxf.addons.xqt import QModelIndex, QAbstractTableModel, Qt
from ezdxf.addons.xqt import... | |
'''
This module contains the command-line parser. All imports are inside the functions
because we don't want to execute code before the parser is created and when Pyg is
used as a library.
'''
ITERABLE_T = (list, tuple)
COMMANDS = set(['install', 'remove', 'bundle', 'pack', 'download', 'update',
'searc... | |
# Copyright (C) 2016 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
"""This module implements the Scraper component which parses responses and
extracts information from them"""
from collections import deque
from twisted.python.failure import Failure
from twisted.internet import defer
from scrapy.utils.defer import defer_result, defer_succeed, parallel, iter_errback
from scrapy.utils... | |
# Copyright 2019 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 unittest
from . import model, modification, test_common, test_config
mock = test_common.import_mock()
def plist_read(*args):
bundle_id = test_... | |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | |
from __future__ import print_function
from django.test import LiveServerTestCase
from selenium import webdriver
import os
from django.contrib.auth.models import User
# from imager_images.models import Photo, Album
import factory
import time
SCREEN_DUMP_LOCATION = os.path.join(
os.path.dirname(os.path.abspath(__fi... | |
import sublime
import os
import time
import math
from .action_history import ActionHistory
from .java_utils import JavaUtils
from .settings import Settings
from .state_property import StateProperty
from .status_manager import StatusManager
from .thread_progress import MultiThreadProgress
class _BuildSystem:
"""
... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
###############################################################################
# Name: doctools.py #
# Purpose: Tools for managing document services #
# Author: Cody Precord <[email protected]> #
... | |
import unittest
from ometa.runtime import OMetaBase, ParseError, expected, eof
class RuntimeTests(unittest.TestCase):
"""
Tests for L{pymeta.runtime}.
"""
def test_anything(self):
"""
L{OMetaBase.rule_anything} returns each item from the input
along with its position.
"... | |
# -*- coding: utf-8 -*-
"""
h2/settings
~~~~~~~~~~~
This module contains a HTTP/2 settings object. This object provides a simple
API for manipulating HTTP/2 settings, keeping track of both the current active
state of the settings and the unacknowledged future values of the settings.
"""
import collections
from hyperf... | |
"""
SQL functions reference lists:
https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
"""
flask_oauthlib.contrib.apps
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The bundle of remote app factories for famous third platforms.
Usage::
from flask import Flask
from flask_oauthlib.client import OAuth
from flask_oauthlib.contrib.apps import github
app = Flask(__name__)
... | |
#!/usr/bin/env python
#
# Test cases for tournament.py
from tournament import *
def test_delete_all_event(test_num):
delete_all_events()
c = count_events()
if type(c) is not long:
raise TypeError(
"count_events() should return long value.")
if c != 0:
raise ValueError("Aft... | |
# -*- coding: utf-8 -*-
"""
tipfy
~~~~~
Minimalist WSGI application and utilities for App Engine.
:copyright: 2010 by tipfy.org.
:license: BSD, see LICENSE.txt for more details.
"""
import logging
import os
from wsgiref.handlers import CGIHandler
# Werkzeug swiss knife.
# Need to import werkzeug ... | |
import numpy as np
import ipdb
import os
def convert_camel_to_underscore(name):
import re
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
def get_config_name_abbr(config_name):
abbr = ''
uncamel_key = convert_camel_to_underscore(config_name)... | |
# 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... | |
################################################################################
# Copyright (C) 2013-2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Unit tests for `dot` module.
"""
import unittest
import nu... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import logging
import os
import random
import re
import sys
import time
import Queue
import threading
from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i, get_cell_ids
import cell_w... | |
from __future__ import print_function, division
from sympy import S, C, pi, I, Rational, Symbol, Wild, cacheit, sympify
from sympy.core.function import Function, ArgumentIndexError
from sympy.functions.elementary.trigonometric import sin, cos, csc, cot
from sympy.functions.elementary.complexes import Abs
from sympy.fu... | |
#-*- coding: UTF-8 -*-
"""
PyAssimp
This is the main-module of PyAssimp.
"""
import sys
if sys.version_info < (2,6):
raise 'pyassimp: need python 2.6 or newer'
import ctypes
import os
import numpy
import logging; logger = logging.getLogger("pyassimp")
# Attach a default, null handler, to the logger.
# applic... | |
# coding: utf-8
import os
import signal
import shutil
import subprocess
from subprocess import CalledProcessError
import simplejson as json
from sqlalchemy.exc import SQLAlchemyError, SAWarning
from flask import Blueprint, request, url_for, jsonify, make_response
from flask import current_app
from flask.views import... | |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import print_function
import itertools
import os
import shutil
import time
from collections import namedtuple
from contextlib import contextmanager
import pkg_resources
f... | |
import subprocess
import re
import os
import errno
import glob
from collections import OrderedDict
from os.path import expanduser
from bricklayer.doctor.metrics import Metrics
from jinja2 import Environment, PackageLoader
class TLSystem(object):
HOME = expanduser("~")
TL_HOME = os.environ.get("TL_HOME", os.p... | |
# -*- coding: utf-8 -*-
"""
Setup script for atoman
@author: Chris Scott
"""
from __future__ import print_function
from __future__ import absolute_import
import os
import glob
import sys
import subprocess
import shutil
import platform
import tempfile
# setuptools is required for entry point
import setuptools
import... | |
import os.path
import dj_database_url
from django.contrib.messages import constants as messages
DEBUG = bool(os.environ.get('DEBUG', False))
TEMPLATE_DEBUG = DEBUG
SITE_ID = 1
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
ROOT_URLCONF = 'saleor.urls'
WSGI_APPLICATION = 'saleor.ws... | |
# 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... | |
# adapted from https://github.com/lisa-lab/DeepLearningTutorials
from collections import OrderedDict
import copy
import os
import re
import codecs
import random
import timeit
from hyperopt import STATUS_OK
import numpy as np
import pandas as pd
from scipy import stats
import theano
from theano import tensor as T
... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | |
#!/usr/bin/env python
# coding: utf-8
import math
import socket
import random
import string
import regex2dfa
import fte.encoder
import fte.bit_ops
import re
import marionette_tg.record_layer
def send(channel, marionette_state, input_args):
grammar = input_args[0]
ctxt = generate_template(grammar)
for ... | |
#!/usr/bin/env python3.6
# Copyright 2017 WSO2 Inc. (http://wso2.org)
#
# 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... | |
#! /usr/bin/env python
#
# SCons - a Software Constructor
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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
#... | |
#!/usr/bin/env python3
#from collections import namedtuple # student in Student datatype
from sys import argv
import sys
import signal
from queue import *
version = [0, 3, 2]
repo = "https://github.com/Paul-Haley/practical_questions"
prompt = "\nPlease enter your eight digit student number: "
def signal_handler(sig,... | |
# 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... | |
# Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
"""
==================================================
Explicit feature map approximation for RBF kernels
==================================================
An example illustrating the approximation of the feature map
of an RBF kernel.
.. currentmodule:: sklearn.kernel_approximation
It shows how to use :class:`RBFSa... | |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import argparse
import sys
import xml.etree.ElementTree as et
import StringIO
import re
import json
from distutils.sysconfig import get_python_lib
sys.path.append(get_python_lib() + '/vnc_cfg_api_server')
from operator import ite... | |
# -*- coding: utf-8 -*-
# Copyright 2021 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 agr... | |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | |
#!/usr/bin/env python3
#
# Copyright (c) 2020 Project CHIP 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 a... | |
# -*- coding: utf-8 -*-
from cms.utils.conf import get_cms_setting
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import signals
from django.dispatch import Signal
from cms.cache.permissions import clear_user_permission_cache, clear_permission_cache
from cms.models import Page, Title, CMSP... | |
"""
Define a base command class that:
1) provides a consistent interface with `git`,
2) implements common git operations in one place, and
3) tracks file- and repo- specific data the is necessary
for Git operations.
"""
import os
import subprocess
import shutil
import sublime
from ..common import util
fro... | |
#!/usr/bin/env python
from __future__ import print_function
import requests
import hashlib
import re
import os
import sys
API_KEY = "0d9c21f4af919c86946abbe45e226713"
SHARED_SECRET = "d59f49d7997ac6254a05355e60a8ec45"
APP_NAME = "cmus-scrobble"
REGISTERED_TO = "drooool"
URL_API_ROOT = "http://ws.audioscrobbler.com/2... | |
"""Test the tplink config flow."""
from unittest.mock import patch
import pytest
from homeassistant import config_entries, setup
from homeassistant.components import dhcp
from homeassistant.components.tplink import DOMAIN
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_MAC, CONF_NAME
from homeassistant.c... | |
from pathlib import Path
from pkg_resources import resource_filename
import numpy
from numpy import nan
import geopandas
import pytest
import numpy.testing as nptest
from pygridtools import misc
from pygridgen.tests import raises
from . import utils
numpy.set_printoptions(linewidth=150, nanstr='-')
try:
import... | |
#!/usr/bin/python -Wall
# ================================================================
# Copyright (c) John Kerl 2007
# [email protected]
# ================================================================
from __future__ import division # 1/2 = 0.5, not 0.
from math import *
from sackmat_m import *
import cop... | |
from python_terraform import * # NOQA
from .common import * # NOQA
RANCHER_AWS_AMI = os.environ.get("AWS_AMI", "")
RANCHER_AWS_USER = os.environ.get("AWS_USER", "ubuntu")
RANCHER_REGION = os.environ.get("AWS_REGION")
RANCHER_VPC_ID = os.environ.get("AWS_VPC")
RANCHER_SUBNETS = os.environ.get("AWS_SUBNET")
RANCHER_A... | |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import mock
from django.core.urlresolvers import reverse
from django.db.models import ProtectedError
from rest_framework import status
from rest_framework.test import APITestCase
from pdc.apps.common.test_uti... | |
# 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.
"""Cloud Endpoints API for Package Repository service."""
import functools
import logging
import endpoints
from protorpc import message_types
from protorp... | |
# main.py that controls the whole app
# to run: just run bokeh serve --show crossfilter_app in the benchmark-view repo
from random import random
import os
from bokeh.layouts import column
from bokeh.models import Button
from bokeh.models.widgets import Select, MultiSelect, Slider
from bokeh.palettes import RdYlBu3
fr... | |
from babel import Locale
from ..allspeak import pluralize
def test_pluralize_numbers():
d = {
0: u'No apples',
1: u'One apple',
3: u'Few apples',
'other': u'{count} apples',
}
assert pluralize(d, 0) == u'No apples'
assert pluralize(d, 1) == u'One apple'
assert plur... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
import uuid
import logging
import time
import binascii
from utils import table_exists
class Index (object):
"""
Index is an instance of an index of an entity. An index is a matching
between any entity property and an entity id. It is used for performing
look ups that do not use an entity id. The ... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) Spyder Project Contributors
# Licensed under the terms of the MIT License
"""Qt widgets for the notebook."""
# Standard library imports
import json
import os
import os.path as osp
from string import Template
import sys
# Qt imports
from qtpy.QtCore import QUrl, Qt
from qtpy.... | |
import datetime
import logging
from itertools import chain, product
from actstream.actions import follow, unfollow
from actstream.models import Follow
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fi... | |
"""
author: Lalit Jain, [email protected]
modified: Chris Fernandez
last updated: 06/03/2015
A module that can be used to create and launch experiments. Can be imported as a module or used on the command line.
Usage:
As a module:
exp_uid_list, exp_key_list, widget_key_list = launch_experiment(host, experiment_fi... | |
# 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/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
from pandac.PandaModules import Vec3, Point3, Point4, TextNode, NodePath
from pandac.PandaModules import CollisionHandlerEvent, CollisionNode, CollisionSphere
from direct.distributed.ClockDelta import globalClockDelta
from direct.interval.IntervalGlobal import Sequence, Parallel
from direct.interval.IntervalGlobal impo... | |
# 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... | |
import os
import sys
import difflib
import __builtin__
import re
import py_compile
import pydoc
import contextlib
import inspect
import keyword
import pkgutil
import unittest
import xml.etree
import types
import test.test_support
import xml.etree.ElementTree
from collections import namedtuple
from test.script_helper im... | |
#! /usr/bin/python3
import sys
import os
import threading
import decimal
import time
import json
import re
import requests
import collections
import logging
import binascii
from datetime import datetime
from dateutil.tz import tzlocal
import argparse
import configparser
import appdirs
import tarfile
import urllib.requ... | |
# -*- coding: utf-8 -*-
#==============================================================================
# module : agilent_psa.py
# author : Benjamin Huard
# license : MIT license
#==============================================================================
"""
This module defines drivers for agilent PSA.
:Contains:... | |
from __future__ import print_function
import unittest
import os, copy
import math
import numpy
from rdkit.six.moves import cPickle as pickle
from rdkit.six import next
from rdkit import Chem
from rdkit.Chem import rdDistGeom, ChemicalForceFields, rdMolAlign
from rdkit import RDConfig, rdBase
from rdkit.Geometry import... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
Support for reading and writing genomic intervals from delimited text files.
"""
from bx.bitset import (
BinnedBitSet,
MAX
)
from bx.tabular.io import (
ParseError,
TableReader,
TableRow,
)
class MissingFieldError(ParseError):
pass
class FieldFormatError(ParseError):
def __init__(se... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
import datetime
import logging
import httplib
import httplib as http # TODO: Inconsistent usage of aliased import
from dateutil.parser import parse as parse_date
from flask import request
import markupsafe
from modularodm.exceptions import ValidationError, NoResultsFound, MultipleResultsFound... | |
import unicodedata
from django import forms
from django.contrib.auth import (
authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_to... | |
# -- coding: utf-8 --
# 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
# "Li... | |
# Copyright (c) 2009 Raymond Hettinger
#
# 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, merge,
# publish,... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (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 ... | |
import unittest
from g1.asyncs import kernels
from g1.bases import contexts
from g1.webs import consts
from g1.webs import wsgi_apps
from g1.webs.handlers import composers
class TestCaseBase(unittest.TestCase):
ENVIRON = {
'REQUEST_METHOD': 'GET',
'PATH_INFO': '/foo/bar',
'QUERY_STRING':... | |
import unittest
from unittest.mock import Mock, call
from pipeline_notifier.pipeline_model import Pipeline, BuildStep, Commit
from pipeline_notifier_test.test_utils import *
class PipelineTests(unittest.TestCase):
def test_callbacks_are_set_on_build_steps(self):
step, notifier = Mock(), Mock()
Pi... | |
"""
Author: Dr. John T. Hwang <[email protected]>
Dr. Mohamed A. Bouhlel <mbouhlel@umich>
This package is distributed under New BSD license.
"""
import numpy as np
import unittest
import inspect
from collections import OrderedDict
from smt.problems import TensorProduct
from smt.sampling_methods import LHS, ... | |
"""
Author: Eric J. Ma
Affiliation: Massachusetts Institute of Technology
Purpose of this Python definitions file:
- To provide accuracy metric functions for use in simulations.
"""
# Prototype #2 for Accuracy Functions (created on 2 July 2014)
def fraction_accurate_reassortants(simulator, reconstructor, reconstruc... | |
import subprocess
import xmltodict
import os
import sys
import logging
import stat
from functools import lru_cache
import iepy
from iepy.utils import DIRS, unzip_from_url
logger = logging.getLogger(__name__)
def detect_java_version():
java_cmd = os.getenv('JAVAHOME')
if not java_cmd:
print('Environ... | |
#
# 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... | |
import uuid
import threading
import time
import mock
from nose.tools import eq_
from kazoo.exceptions import LockTimeout
from kazoo.testing import KazooTestCase
from kazoo.recipe.partitioner import PartitionState
class SlowLockMock():
"""Emulates a slow ZooKeeper lock."""
default_delay_time = 3
def __... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# 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://genshi.edgewall.org/wiki/License.
#
# This software consist... | |
# -*- coding: utf-8 -*-
# (C) 2017 Tampere University of Technology
# MIT License
# Pauli Losoi
"""
Evaluate compound demands and prices.
Constants
---------
RELATIONS_DEMAND
Set of ChEBI relation ID strings used in evaluating demand.
RELATIONS_PRICE
Set of ChEBI relation ID strings used in evaluating price.
C... | |
# Copyright (c) 2014 NetApp, Inc. All Rights Reserved.
# Copyright (c) 2015 Alex Meade. All Rights Reserved.
# Copyright (c) 2015 Rushil Chugh. All Rights Reserved.
# Copyright (c) 2015 Navneet Singh. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | |
# Natural Language Toolkit: Discourse Processing
#
# Author: Ewan Klein <[email protected]>
#
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# $Id: discourse.py 5783 2008-02-27 14:51:45Z ehk $
from nltk.sem import root_semrep, Expression
from nltk import parse
from nltk.inference import Mace, s... | |
import msgpack
import json
import pickle
import os.path
from Queue import PriorityQueue
import re
import doench_score
import azimuth.model_comparison
import numpy as np
import pandas as pd
import csv
from intervaltree import IntervalTree
class GuideRNA():
"""Holder of gRNA information"""
def __init__(self, selecte... | |
"""
========
numpydoc
========
Sphinx extension that handles docstrings in the Numpy standard format. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined
otherwis... | |
import os
import subprocess
import readline
import sys
from contextlib import redirect_stdout
#def __init__(self, cmd_output,dir= 'blank', dev='blank'):
# if dir is 'blank':
# print("Directory is blank")
# self.dir=get_dir()
#
# if dev is 'blank':
# print("Device is blank")
# s... | |
# -*- coding: utf-8 -*-
#
# Created on 7/28/13
"""Common settings and globals."""
from os import listdir, mkdir
from os.path import abspath, basename, dirname, join, normpath, isdir, exists
from sys import path, stderr
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_... | |
from __future__ import division
import math
import os
import sys
import re
import shutil
import tempfile
import codecs
import subprocess
import atexit
import weakref
import matplotlib as mpl
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
from matplotli... | |
import Tools.HTML
if __name__ == "__main__":
import sys,os
append_path = os.path.abspath(sys.argv[0])[:-20]
print("Append to PYTHONPATH: %s" % (append_path))
sys.path.append(append_path)
import re
import copy
from Tools.file2 import file2
from Tools import ChemicalInfo
from Geometry import Scan,IRC,Ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.