gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from test import test_support
from tokenize import (untokenize, generate_tokens, NUMBER, NAME, OP,
STRING, ENDMARKER, tok_name, Untokenizer, tokenize)
from StringIO import StringIO
import os
from unittest import TestCase
class TokenizeTest(TestCase):
# Tests for the tokenize module.
# Th... | |
"""
Implementation of `nbio_interface.AbstractIOServices` on top of a
selector-based I/O loop, such as tornado's and our home-grown
select_connection's I/O loops.
"""
import abc
import logging
import socket
import threading
from rez.vendor.pika.adapters.utils import nbio_interface, io_services_utils
from rez.vendor.p... | |
# Copyright 2014 Rackspace Hosting
# 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 r... | |
from datetime import timedelta
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
CategoricalIndex,
Index,
IntervalIndex,
MultiIndex,
date_range,
)
from pandas.core.indexes.base import InvalidIndexError
import pandas.util.testing as tm
from pandas.util.testi... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Local node REST api.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import flask
import flask_restplus as restplus
from flask_restplus import inputs
from treadmill import webutils
_... | |
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
)
import numpy as np
from pandas._config import get_option
from pandas._libs import (
lib,
missing as libmissing,
)
from pandas._libs.arrays import NDArrayBacked
from pandas._typing import (
Dtype,
Scalar,
type_t... | |
#!/bin/bash/python
from __future__ import print_function
import commandLineErrors
from commandLineErrors import *
import dataConsistency
import graph as gr
import stringOperations as strOps
import json
import os
import sys
# Define a class for handling the command line and operations around it.
class commandLine:
... | |
#!/usr/bin/env python
import logging
import sys
import unittest
import mango.unittest
import scipy as sp
import numpy as np
import numpy.random
import random
import mango.mpi as mpi
import mango.fmm
import mango.data
import mango.io
import os, os.path
logger, rootLogger = mpi.getLoggers(__name__)
class PValueTest(man... | |
#
# Copyright (C) 2000-2008 greg Landrum and Rational Discovery LLC
#
""" Contains functionality for doing tree pruning
"""
import numpy
from rdkit.ML.DecTree import CrossValidate, DecTree
import copy
_verbose = 0
def MaxCount(examples):
""" given a set of examples, returns the most common result code
**Argu... | |
#!/usr/bin/env python
# Copyright 2013 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
"""Client tool to trigger tasks or retrieve results from a Swarming server."""
__version__ = '0.6.1'
import collection... | |
# coding: utf-8
from functools import partial
import sublime
from sublime_plugin import WindowCommand
from ..util import noop, StatusSpinner
from ..cmd import GitFlowCmd
enabled = True
__all__ = ['GitFlowInitCommand', 'GitFlowFeatureCommand', 'GitFlowFeatureStartCommand', 'GitFlowFeatureFinishCommand',
... | |
#!/usr/bin/env python
#
# The purpose of the script is to parse the DeepLearning.java file and emit
# code related to parameters.
#
# Currently pieces of R code get emitted and need to be pasted in manually to the R file.
#
import sys
import os
import shutil
import signal
import time
import random
import getpass
impo... | |
import logging
from voluptuous import *
from ...adjust import adjust as adjustmodule
from ... import pull as pullmodule
from ... import repo
def mode_b_ify(raw):
clone = raw.copy()
del clone["name"]
clone["internal_url"] = {
"readwrite": Url(), #pylint: disable=no-value-for-parameter
"rea... | |
from __future__ import print_function, absolute_import, division
import abc
import uuid
import warnings
import tempfile
from six.moves import zip
import numpy as np
from numpy.lib.stride_tricks import as_strided
import dask.array as da
from astropy.wcs import InconsistentAxisTypesError
from astropy.io import fits
... | |
"""
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... | |
#!/usr/bin/python
"""
sc_video.py
This file includes functions to:
Initialise the camera
Initialise the output video
Image size is held in the smart_camera.cnf
"""
import sys
from os.path import expanduser
import time
import math
import multiprocessing
import cv2
import numpy as np
import sc_config
from sc_log... | |
#! /usr/bin/env python
"""Static analysis tool for checking docstring conventions and style.
Implemented checks cover PEP257:
http://www.python.org/dev/peps/pep-0257/
Other checks can be added, e.g. NumPy docstring conventions:
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
The repository is l... | |
from panda3d.core import *
from panda3d.physics import PhysicalNode
from panda3d.physics import ParticleSystem
from panda3d.physics import PointParticleFactory
from panda3d.physics import ZSpinParticleFactory
#from panda3d.physics import OrientedParticleFactory
from panda3d.physics import BaseParticleRenderer
from pan... | |
"""Support for Automation Device Specification (ADS)."""
import threading
import struct
import logging
import ctypes
from collections import namedtuple
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
import homeassistant.helpers.config_... | |
from lace.serialization.obj.objutils import LoadObjError # lint isn't able to find the defintion in a c++ module pylint: disable=no-name-in-module
EXTENSION = '.obj'
def load(f, existing_mesh=None):
from baiji.serialization.util.openlib import ensure_file_open_and_call
return ensure_file_open_and_call(f, _loa... | |
#
# 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... | |
from __future__ import division
import unittest
from math import sqrt, pi
from ..path import CubicBezier, QuadraticBezier, Line, Arc, Path
# Most of these test points are not calculated serparately, as that would
# take too long and be too error prone. Instead the curves have been verified
# to be correct visually, ... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CERN@school - Make Plots
See the README.md file for more information.
"""
# Import the code needed to manage files.
import os, glob
#...for parsing the arguments.
import argparse
#...for the logging.
import logging as lg
#...for file manipulation.
from shutil ... | |
# Copyright 2013, Big Switch Networks, 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 applic... | |
"""Tests launch, teardown, and update of multiple Ray clusters using Kubernetes
operator. Also tests submission of jobs via Ray client."""
import copy
import sys
import os
import subprocess
import tempfile
import time
import unittest
from contextlib import contextmanager
import kubernetes
import pytest
import yaml
i... | |
"""
Supports flushing statsite metrics to Librato
"""
import ast
import sys
import socket
import logging
import ConfigParser
import re
import base64
import urllib2
import json
import os
##
# Librato sink for statsite
# =========================
#
# Use with the following stream command:
#
# stream_cmd = python sinks/... | |
# 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... | |
from expects.testing import failure
from expects import *
from datetime import datetime, timedelta
from dateutil import relativedelta
import calendar
import zipfile
from io import BytesIO
import json
import os
from esios import Esios
from esios.archives import Liquicomun, A1_liquicomun, A2_liquicomun, C2_liquicomun
f... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2010 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://babel.edgewall.org/wiki/License.
#
# This software consists... | |
import os.path as op
from functools import wraps
from flask import Blueprint, current_app, render_template, abort, g, url_for
from flask_admin import babel
from flask_admin._compat import with_metaclass, as_unicode
from flask_admin import helpers as h
# For compatibility reasons import MenuLink
from flask_admin.menu... | |
# 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 u... | |
#
# 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 u... | |
# 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
=======
Activate other frameworks/toolkits inside the kivy event loop.
'''
__all__ = ('install_gobject_iteration', 'install_twisted_reactor',
'uninstall_twisted_reactor', 'install_android')
def install_gobject_iteration():
'''Import and install gobject context iteration inside our event ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Django settings for myshop project.
For more information on this file, see
https://docs.djangoproject.com/en/stable/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/stable/ref/settings/
"""
# Bui... | |
#!/usr/bin/env python
# Copyright (c) 2010-2016 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS"... | |
"""The tests for numeric state automation."""
from datetime import timedelta
import logging
from unittest.mock import patch
import pytest
import voluptuous as vol
import homeassistant.components.automation as automation
from homeassistant.components.homeassistant.triggers import (
numeric_state as numeric_state_t... | |
#dice guideline
from random import randint
#FOR program module
moduleName="Dice Module"
#moduleName="The Lusty Orc Dice Module"
#FOR dice rolls
#mulligan_yes_or_no=True not implemented
the_lowest_possible_roll=1
the_number_of_sides_on_a_die=6
the_number_of_rolls_in_a_set=4
reroll_if_equal_or_less=0
number_of_lowest_... | |
import theano.sandbox.cuda.basic_ops as sbcuda
import numpy as np
import load_data
import realtime_augmentation as ra
import time
import sys
import json
from custom_for_keras import input_generator
from datetime import datetime, timedelta
from keras.optimizers import Adam
from custom_keras_model_x_cat_x_maxout import ... | |
import os
import signal
import threading
import docker
import dockerpty
from subprocess import Popen, STDOUT, PIPE, SubprocessError, CalledProcessError
import spython
from spython.main.parse.parsers import DockerParser
from spython.main.parse.writers import SingularityWriter
from popper import utils as pu
from popp... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from django.test import TestCase
from django.core.files import File
from django.core.files.uploadedfile import SimpleUploadedFile
from django.conf import settings
import os.path
from validatedfile.fields import FileQuota
from testing.models import TestModel, TestModelNoValidate, TestContainer, TestElement
from testi... | |
#
# 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 time
import pytest
import datetime
import cronparse
def test_input_cron():
"""
Make sure we can send values to cron
"""
parser = cronparse.CronParse()
with pytest.raises(TypeError):
parser.set_cron(input_cron=1)
with pytest.raises(ValueError):
parser.set_cron(input_cro... | |
#
# Copyright 2012 John Gerlock
#
# 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 wr... | |
import arrow
from path import Path
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql.expression import func
from sqlalchemy import Column, Integer, String, Text
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import twittback
import twittback.config
class NoSuc... | |
class SkipTest(Exception):
pass
class AssertRaisesContext:
def __init__(self, exc):
self.expected = exc
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, tb):
if exc_type is None:
assert False, "%r not raised" % self.expected
if iss... | |
"""
Testing strategies for Hypothesis-based tests.
"""
import keyword
import string
from collections import OrderedDict
from hypothesis import strategies as st
import attr
from .utils import make_class
def gen_attr_names():
"""
Generate names for attributes, 'a'...'z', then 'aa'...'zz'.
~702 differe... | |
from __future__ import print_function, division
from sympy.core import S, sympify, Dummy, Mod
from sympy.core.function import Function, ArgumentIndexError
from sympy.core.logic import fuzzy_and
from sympy.core.numbers import Integer, pi
from sympy.core.relational import Eq
from sympy.ntheory import sieve
from math i... | |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee... | |
from __future__ import unicode_literals
import tempfile
import shutil
import os
from compose import config
from compose.project import Project
from compose.const import LABEL_CONFIG_HASH
from .testcases import DockerClientTestCase
class ProjectTestCase(DockerClientTestCase):
def run_up(self, cfg, **kwargs):
... | |
"""
Handles all requests relevant to the extraction service of the API.
"""
import base64
import cv2
from hutts_verification.image_processing.sample_extract import TextExtractor
from flask import Blueprint, jsonify, request, make_response
from hutts_verification.utils.image_handling import grab_image
from hutts_verific... | |
import time
import log
from led import LEDMatrix
from led import LEDStrip
from led import LEDCircle
import colors
from util import d
import threading
class animThread(threading.Thread):
def __init__(self, anim, args):
super(animThread, self).__init__()
self.setDaemon(True)
self._anim =... | |
"""Test SQLAlchemy form extensions."""
import pytest
import mock
from django import forms
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, Integer, String
from sqlalchemy import create_engine
import forms2
from forms2 import sqlalchemy
fr... | |
from __future__ import absolute_import, unicode_literals
from datetime import date
from django import forms
from django.conf import settings
from django.contrib.admin.options import (ModelAdmin, TabularInline,
HORIZONTAL, VERTICAL)
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.widget... | |
#!/usr/bin/python2.7
# Copyright 2010 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 ... | |
# This file is responsible for setup up the executing environment of droidbox app
# Here the executing environment includes:
# 1. Static environments: contacts, call logs, SMS, pre-installed apps, etc
# 2. Dynamic environments: continuous GPS, Accelerometer, etc
# The environment should be determined before app start r... | |
import datetime
from datetime import timedelta
from django.test import TestCase
from django.forms.models import model_to_dict
from django.contrib.auth import models as auth_models
from django.core.exceptions import ValidationError
from pyconde.conference.test_utils import ConferenceTestingMixin
from pyconde.conferenc... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# Copyright (c) 2015-2016 Tigera, 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 applicabl... | |
# 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... | |
#!/usr/bin/env python2
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Copyright (c) 2015-2018 The PIVX developers
# Copyright (c) 2018 The Ion developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Exercise th... | |
import math as python_lib_Math
import math as Math
import builtins as python_lib_Builtins
import inspect as python_lib_Inspect
class Enum:
_hx_class_name = "Enum"
_hx_fields = ["tag", "index", "params"]
_hx_methods = ["__str__"]
def __init__(self,tag,index,params):
self.tag = None
self.index = None
self.pa... | |
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import random
from django.db.models import Max, Min, Sum
from django.db.models.query import F
from kolibri.auth.filters import HierarchyRelationsFilter
from kolibri.auth.models import Classroom, Facility, FacilityUser
from kolibr... | |
'''
Copyright Zlatko Minev and Zaki Leghtas
2015, 2016, 2017
'''
import os
import time
import shutil
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from stat import S_ISREG, ST_CTIME, ST_MODE
from pandas import HDFStore, Series, DataFrame
from pint import UnitRegistry
from hfss import *
f... | |
import random
import six.moves.urllib.error
import six.moves.urllib.parse
import six.moves.urllib.request
from splunk_eventgen.lib.logging_config import logger
from splunk_eventgen.lib.outputplugin import OutputPlugin
try:
from concurrent.futures import ThreadPoolExecutor
import requests
from requests i... | |
"""fontTools.misc.bezierTools.py -- tools for working with bezier path segments.
Rewritten to elimate the numpy dependency
"""
__all__ = [
"calcQuadraticBounds",
"calcCubicBounds",
"splitLine",
"splitQuadratic",
"splitCubic",
"splitQuadraticAtT",
"splitCubicAtT",
"solveQuadratic",
... | |
# 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 u... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 4 23:00:43 2016
@author: ddboline
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import argparse
import os
from subprocess import call
from movie_collection_app.movie_collection import MovieCollection
from... | |
#!/usr/bin/env python
# isbn.py
# Code for messing with ISBN numbers
# Especially stuff for converting between ISBN-10 and ISBN-13
# Copyright (C) 2007 Darren J Wilkinson
# Free GPL code
# Last updated: 14/8/2007
import sys,re
__doc__="""Code for messing with ISBN numbers. Stuff for validating ISBN-10 and
ISBN-13 num... | |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from keras.layers import Dense, Dropout
from keras.engine.topology import merge, Input
from keras.engine.training import Model
from keras.models import Sequential
from keras import backend as K
from keras.utils.test_utils import keras_test
@k... | |
import unittest, random, sys, time, re
sys.path.extend(['.','..','py'])
import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_hosts, h2o_import as h2i
initList = [
('r.hex', 'r.hex=i.hex'),
]
DO_IFELSE = False
DO_CAN_RETURN_NAN = False
DO_FAIL1 = False
DO_TERNARY = False
DO_APPLY = True
DO_FUNCTION = Fa... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
import datetime
import logging
import MySQLdb
import random
import re
import subprocess
from pylons import config
from anygit.backends import common
from anygit.data import exceptions
logger = logging.getLogger(__name__)
connection = None
collection_to_class = {}
sha1_re = re.compile('^[a-f0-9]*')
## Exported fun... | |
#!/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... | |
from __future__ import absolute_import
import os
import six
import logging
import warnings
from django import VERSION
from leonardo.base import leonardo, default
from leonardo.utils.settings import (get_conf_from_module, merge,
get_leonardo_modules, get_loaded_modules,
... | |
from yahoo_finance import Share
from argparse import ArgumentParser
import time
import sys
import datetime
import timeit
mystock = ""
yearhighlist = ""
yearlowlist = ""
volumealert = ""
winnerList = ""
looserList = ""
sp500index = Share('^GSPC')
nasdaqindex = Share('^IXIC')
sp500Price = ""
sp500Change = ""
sp500perc... | |
#!/usr/bin/env python
"""
This module has functions that generated random values for django fields.
"""
import datetime
import os
import uuid
from decimal import Decimal
from itertools import ifilter
from itertools import imap
from itertools import islice
from random import choice
from random import randint
from random... | |
# -*- coding: utf-8 -*-
#
# boltons documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 21 00:34:18 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | |
"""Import tasks for the Harvard Center for Astrophysics."""
import csv
import os
from glob import glob
from math import floor
from astrocats.catalog.photometry import PHOTOMETRY
from astrocats.catalog.utils import (is_number, jd_to_mjd, pbar, pbar_strings,
uniq_cdl)
from astropy.ti... | |
import contextlib
from collections import namedtuple, defaultdict
from datetime import datetime
from dask.callbacks import Callback
# The names of the Ray-specific callbacks. These are the kwarg names that
# RayDaskCallback will accept on construction, and is considered the
# source-of-truth for what Ray-specific ca... | |
# Load and dump a diagnostics database in CDD format.
import logging
from xml.etree import ElementTree
from ..data import Data
from ..did import Did
from ..internal_database import InternalDatabase
from ...errors import ParseError
from ...utils import cdd_offset_to_dbc_start_bit
LOGGER = logging.getLogger(__name__)
... | |
# -*- coding: utf-8 -*-
"""
Django settings for test_project project.
Generated by 'django-admin startproject' using Django 1.11.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.1... | |
"""Nodes that make up parse trees
Parsing spits out a tree of these, which you can then tell to walk itself and
spit out a useful value. Or you can walk it yourself; the structural attributes
are public.
"""
# TODO: If this is slow, think about using cElementTree or something.
from inspect import isfunction
from sys ... | |
# $Id$
#
# Copyright (C) 2007,2008 Greg Landrum
#
# @@ All Rights Reserved @@
#
import os,sys
import io
import unittest
from rdkit.six.moves import cPickle
from rdkit import RDConfig
from rdkit import DataStructs as ds
def feq(v1,v2,tol=1e-4):
return abs(v1-v2)<tol
class TestCase(unittest.TestCase):
def setUp(sel... | |
#!/usr/bin/env python
# coding: utf-8
import logging
from multiprocessing.pool import ThreadPool
import pprint
import struct
import threading
import time
import traceback
import unittest
import environment
import tablet
import utils
from protocols_flavor import protocols_flavor
from vtdb import dbexceptions
from vtd... | |
#from seq2seq import ngramlm, neurallm
import cPickle, pickle
import numpy as np
import os
from collections import defaultdict
import dynet as dy
from dynet import *
import numpy
import random
from nltk.tokenize import RegexpTokenizer
class Attention_Batch:
def __init__(self, src_vocab_size, tgt_vocab_size... | |
"""
Copyright 2017-present Airbnb, 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, sof... | |
# 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
# distr... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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
DOCUMENTATION = r'''
---
module: bigip_virtual_address
s... | |
from __future__ import division
import math
from sorl.thumbnail.engines.base import EngineBase
from sorl.thumbnail.compat import BufferIO
try:
from PIL import Image, ImageFile, ImageDraw, ImageChops, ImageFilter
except ImportError:
import Image, ImageFile, ImageDraw, ImageChops
def round_corner(radius, fill... | |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# _*_ coding:utf-8 _*_
import tornado.web
import ujson
import pymongo
import datetime
import time
import logging
from Constant import ConstantVar, SUtils
logger = logging.getLogger()
class CpReportDetailHandler(tornado.web.RequestHandler):
"""
report handler for every cid every day
post method
"""
... | |
#!/usr/bin/python
import csv
def comma_decimal(val):
return float(val.replace(",", "."))
def comma_decimal_formatter(val):
return str(val).replace(".", ",")
class CSVError(Exception):
pass
class CSVHeaderError(CSVError):
def __init__(self, expected, actual):
CSVError.__init__(self, "Inva... | |
#!/usr/bin/python
# Author: Brian Kellogg
# Version: 1.4
#
# Bro Intel file MUST have the below header and it MUST be TAB DELIMITED
# #fields indicator indicator_type meta.source meta.desc meta.url meta.do_notice meta.if_in
#
# This script was written for Bro and OSSEC intel file update... | |
from topaz.objects.fileobject import FNM_NOESCAPE, FNM_DOTMATCH
from topaz.objects.regexpobject import RegexpCache
from topaz.utils.glob import Glob
from ..base import BaseTopazTest
class GlobHelper(object):
def __init__(self, space, tmpdir, monkeypatch):
self.space = space
self.tmpdir = tmpdir
... | |
import os
import json
import numpy as np
from shutil import copyfile
from keras.optimizers import SGD
import keras.backend as K
from AlphaGo.ai import ProbabilisticPolicyPlayer
import AlphaGo.go as go
from AlphaGo.models.policy import CNNPolicy
from AlphaGo.util import flatten_idx
def _make_training_pair(st, mv, prep... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.