gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#-*- coding=utf-8 -*-
#author: zhihua.ye@spreadtrum.com
"""
1. assemble sipp cmd
sipp -sf reg.xml -p 5060 -t u1 -m 1 -trace_err
2. assemble tmtc cmd
echo -n "c-reg" | busybox nc 127.0.0.1 21904
"""
import sys
import json
import os
from logConf import *
from utjsonparser import *
from time import gmtime, strftime
imp... | |
"""
Paramiko run support
"""
from cStringIO import StringIO
from paramiko import ChannelFile
import gevent
import gevent.event
import socket
import pipes
import logging
import shutil
from ..contextutil import safe_while
from ..exceptions import (CommandCrashedError, CommandFailedError,
Conne... | |
# -*- coding: utf-8 -
import operator
from .local_time import get_now, TZ
from copy import deepcopy
from datetime import timedelta
from dateutil.parser import parse
from dpath.util import delete as xpathdelete, get as xpathget, new as xpathnew
from haversine import haversine
from json import load, loads
from jsonpath_r... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import io
import os
import re
from distutils.version import LooseVersion
import subprocess
import pdfkit
import six
from bs4 import BeautifulSoup
from PyPDF2 import PdfFileReader... | |
import logging
import collections
import pickle
from copy import deepcopy
import pymongo
import bson
from . import utils
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
_CONVERSION_MAP = dict()
ID_KEY = '_id'
CONVERSION_KEY = '_conversion_key'
TIMESTAMP_CREATION_KEY = 'timestamp_created'
TIMES... | |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import gyp.common
import os.p... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os
import json
from frappe import _
from frappe.modules import scrub, get_module_path
from frappe.utils import (
flt,
cint,
get_html_format,
get_url_to_... | |
# Lint as: python3
# 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 ... | |
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This sphinx extension adds two directives for summarizing the public
members of a module or package.
These directives are primarily for use with the `automodapi`_ extension,
but can be used independently.
.. _automodsumm:
=======================
aut... | |
# coding: utf-8
"""
Custom luigi base task definitions.
"""
__all__ = ["Task", "WrapperTask", "ExternalTask"]
import sys
import socket
import time
import logging
from collections import OrderedDict
from contextlib import contextmanager
from abc import ABCMeta, abstractmethod
from inspect import getargspec
import l... | |
# PythonJS Low Level Runtime
# by Amirouche Boubekki and Brett Hartshorn - copyright 2013
# License: "New BSD"
__NULL_OBJECT__ = Object.create( null )
__WEBWORKER__ = False
__NODEJS__ = False
__BROWSER__ = False
## note browser and nodejs can both be true in the case of NodeWebkit
if typeof(process) != 'undefined': ... | |
# Copyright (c) 2010-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | |
# /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Vojtech Burian
@summary: Common selenium webdriver related functions.
Helper functions that abstract often basic webdriver operations into more usable functional blocks.
"""
import inspect
import time
import os
import glob
import requests
from selenium.webdriv... | |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# -*- coding: utf-8 -*-
import datetime
import json
import requests
from reversion import revisions as reversion
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.db.models import Q
from django.http import HttpResponse, ... | |
# Copyright 2018 The Oppia 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 applicable ... | |
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip
import configparser
import collections
import numpy as np
import scipy.stats
import time
import timeit
impor... | |
# -*- coding: utf-8 -*-
"""
Written by Daniel M. Aukes.
Email: danaukes<at>seas.harvard.edu.
Please see LICENSE.txt for full license.
"""
import popupcad
import shapely.geometry
import numpy
import PySide.QtCore as qc
import PySide.QtGui as qg
import scipy.linalg
try: #Hack to ensure Python 2 & 3 support
import i... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# -*- coding: utf-8 -*-
"""
sphinx.domains.c
~~~~~~~~~~~~~~~~
The C language domain.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import string
from docutils import nodes
from sphinx import addnodes
from sphinx.roles impo... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 14 07:53:12 2016
@author: c_dolar
"""
import datetime, csv, re
def extractAuthorInfo(infostr):
"""
This function extracts data from the author information string.
The string needs to be in the format Last_name, first_name (affiliation, country)
""... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
"""
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import uuid
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
# Provide th... | |
# sqlalchemy/ext/baked.py
# Copyright (C) 2005-2015 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
"""Baked query extension.
Provides a creational pattern for the :class:`.que... | |
# -----------------------------------------------------------------------------
# Copyright * 2014, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The Crisis Mapping Toolkit (CMT) v1 platform is licensed under the Apache
#... | |
#!/usr/bin/env python
# Copyright 2017 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 __future__ import absolute_import
import argparse
import fnmatch
import logging
import os
import sys
import telemetry_mini
import... | |
import py, struct, sys
from rpython.jit.codewriter.assembler import Assembler, AssemblerError
from rpython.jit.codewriter.flatten import SSARepr, Label, TLabel, Register
from rpython.jit.codewriter.flatten import ListOfKind, IndirectCallTargets
from rpython.jit.codewriter.jitcode import MissingLiveness
from rpython.jit... | |
"""The tests for the nx584 sensor platform."""
import requests
import unittest
from unittest import mock
from nx584 import client as nx584_client
from homeassistant.components.binary_sensor import nx584
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
class StopMe(Ex... | |
# graphicsCrawlerDisplay.py
# -------------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link t... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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.... | |
import functools, hashlib
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
from selection.tests.instance import gaussian_instance
from selection.learning.learners import mixture_learner
from selection.learning.utils import naive_partial_model_inference, pivot_plot
from selection.lear... | |
# coding=utf-8
# Copyright 2019 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 t... | |
import struct
from elftools.elf import elffile, sections
import archinfo
from .absobj import Symbol, Relocation, Segment, Section
from .metaelf import MetaELF
from .errors import CLEError, CLEInvalidBinaryError
import logging
l = logging.getLogger('cle.elf')
__all__ = ('ELFSymbol', 'ELF')
class ELFSymbol(Symbol):
... | |
'''
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 this ... | |
#!/usr/bin/env python
"""
MIT License
Copyright (c) 2017 Guillaume Papin
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,... | |
from datetime import datetime
from abc import ABCMeta, abstractmethod
import argparse
import os.path
import numpy as np
import gdal
import netCDF4
import yaml
from eodatasets import serialise
from ingester.utils import _get_nbands_lats_lons_from_gdalds
EPOCH = datetime(1970, 1, 1, 0, 0, 0)
class BaseNetCDF(object)... | |
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddleware
from django.contrib.sites.models import Site, c... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit tests for grit.format.policy_templates.writers.plist_strings_writer'''
import os
import sys
if __name__ == '__main__':
... | |
import testing as tm
import pytest
import xgboost as xgb
import numpy as np
from hypothesis import given, strategies, settings, note
exact_parameter_strategy = strategies.fixed_dictionaries({
'nthread': strategies.integers(1, 4),
'max_depth': strategies.integers(1, 11),
'min_child_weight': strategies.float... | |
#! /usr/bin/env python
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import sys, os
import logging
from ginga import AstroImage, colors
import ginga.toolkit as ginga_toolkit
from ginga.canvas.CanvasObject import get... | |
#------------------------------------------------------------------------------
# setlx2py: setlx_parser.py
#
# Parser class: parser for the setlx language
#
# Copyright (C) 2013, Jan-Christoph Klie
# License: Apache v2
#------------------------------------------------------------------------------
from ply import ya... | |
import json
import time
class CbFeed(object):
def __init__(self, feedinfo, reports):
self.data = {'feedinfo': feedinfo,
'reports': reports}
def dump(self):
return json.dumps(self.data, indent=2)
class CbFeedInfo(object):
def __init__(self, **kwargs):
self.yi... | |
#!/usr/bin/env python
# encoding: utf-8
import json
import os
import collections
import datetime
import mmap
import re
import requests
import shlex
import sys
import time
try:
import requests
except ImportError as e:
print("Error! requests module could not be imported. Perhaps install it with\n\n pip install req... | |
def quickview(results, n = 25):
"""view top n results of results.
Ideally, pass it interrogator() or plotter output. It will also accept DatFrames
or Series (i.e. .results or .totals branches."""
import corpkit
import pandas
import numpy
import os
# handle dictionaries too:
dictpa... | |
import json
import os
from cStringIO import StringIO
from xml.parsers.expat import ExpatError
from django import http
from django.shortcuts import render, get_object_or_404, redirect
from django.db import transaction
from django.conf import settings
from django.utils import timezone
from django.db.models import Count
... | |
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | |
import argparse
from collections import OrderedDict
import os
import re
import sys
import types
if sys.version_info >= (3, 0):
from io import StringIO
else:
from StringIO import StringIO
__version__ = "0.9"
ACTION_TYPES_THAT_DONT_NEED_A_VALUE = {argparse._StoreTrueAction,
argparse._StoreFalseAction, arg... | |
#!/usr/bin/env python
"""This file contains tests that do not fit into any specific file yet.
Feel free to make your own test file if appropriate.
Refer to conftest.py for shared helper methods.
resources/test_* : For tests related to resources
test_* : For other tests of the non-resource elements of the jira packag... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# Copyright 2014 Alcatel-Lucent USA 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 l... | |
#!/usr/bin/env python2
#
# Copyright (C) Microsoft Corporation, All rights reserved.
"""Urllib3 HttpClient."""
import sys
import http.client
import socket
import time
import traceback
import urllib.request, urllib.error, urllib.parse
from httpclient import *
from workerexception import *
PY_MAJOR_VERSION = 0
PY_... | |
# 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, ... | |
#!/usr/bin/env python
"""
TwoDelegateDatasetAgent: improved generalized implementation of external dataset agent:
- avoids artificial agent/driver communication and state model
- pluggable behavior to find new data files (Poller) and parse contents (Parser)
- hands-off interrupt/resume state mechanism: memento generat... | |
import hashlib
import os.path
import urllib
from contextlib import contextmanager
from mimetypes import guess_type
from django.conf import settings
from django.core.validators import FileExtensionValidator
from django.db import models
from django.dispatch import Signal
from django.urls import reverse
from django.utils... | |
import weakref
from warnings import warn
from fontTools.misc import bezierTools
from defcon.objects.base import BaseObject
from defcon.tools import bezierMath
from defcon.tools.representations import contourBoundsRepresentationFactory,\
contourControlPointBoundsRepresentationFactory, contourClockwiseRepresentationF... | |
"""Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ulg.ac... | |
# -*- python -*-
# Copyright (c) 2012 The Native Client 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 json
import optparse
import os
import re
import socket
import subprocess
import sys
import unittest
if sys.platform == 'wi... | |
import os
import random
import time
import hashlib
import warnings
from tempfile import mkdtemp
from shutil import rmtree
from six.moves.urllib.parse import urlparse
from six import BytesIO
from twisted.trial import unittest
from twisted.internet import defer
from scrapy.pipelines.files import FilesPipeline, FSFilesS... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# 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
# ... | |
import sqlalchemy
from raggregate.models import DBSession
from raggregate.models.vote import Vote
from raggregate.models.submission import Submission
from raggregate.models.comment import Comment
from raggregate.models.epistle import Epistle
from raggregate.models.section import Section
from raggregate.queries import... | |
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 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 ... | |
# Copyright 2015 Mirantis, 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 applica... | |
# -*- coding: utf-8 -*-
'''
Create adjacency matrices and analyse terms dynamically
'''
print('Create dynamic adjacency matrices and ESOMs')
#--------------------------------------------
#run create_Info_Files.py before running this
#--------------------------------------------
import pickle, time, igraph, glob, os... | |
# Hidden Markov Model Implementation
import pylab as pyl
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy as scp
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
#import hrl_lib.mayavi2_util as mu
import hrl_lib.viz ... | |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
#!/usr/bin/python -B
'''
TDM HDB - File Hash Calc
By: TDM HDB Team
HDB Url: https://tdm.io/hdb
GitHub: https://github.com/TheDoxMedia/HDB-Hash-Calc
License: MIT
'''
import sys, time, json
from PySide import QtCore, QtGui
from gui.main_window import Ui_main_window
from gui.login_window import Ui_login_window
from cor... | |
# pylint:disable=missing-class-docstring
class AngrError(Exception):
pass
class AngrValueError(AngrError, ValueError):
pass
class AngrLifterError(AngrError):
pass
class AngrExitError(AngrError):
pass
class AngrPathError(AngrError):
pass
class AngrVaultError(AngrError):
pass
class PathUnre... | |
# Copyright (c) 2010 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 in wr... | |
from typing import Any, Dict, Optional, Union
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.utils.translation import gettext as _
from django.views.decorators.http import require_safe
from confirmation.models import... | |
# 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... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for generating the version string for Astropy (or an affiliated
package) and the version.py module, which contains version info for the
package.
Within the generated astropy.version module, the `major`, `minor`, and `bugfix`
variables hold ... | |
# 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 a... | |
"""
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | |
from abc import ABCMeta, abstractmethod, abstractproperty
from operator import itemgetter
from .experiment import Experiment, DefaultExperiment
from .ops.random import Sample, RandomInteger
from .assignment import Assignment
# decorator for methods that assume assignments have been made
def requires_experiment(f):
... | |
# Copyright 2015 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
# (c) 2017, XYSec Labs
#
# This list based on the AdAway blocklist (https://github.com/AdAway/AdAway)
#
# AdAway default blocklist
# Blocking mobile ad providers and some analytics providers
#
# Contribute:
# Create an issue at https://github.com/AdAway/AdAway/issues
#
# Changelog:
# 2016-07-18 Now hosted on GitHub + C... | |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''pip-faster is a thin wrapper around pip.
It only adds a --prune option to the `install` subcommand.
`pip-faster install --prune` will *uninstall* any installed packages that are
not required.
Otherwise, you should find that pip-faster gives the same results as pip, jus... | |
#!/usr/bin/env python
# CREATED:2014-01-18 14:09:05 by Brian McFee <brm2132@columbia.edu>
# unit tests for util routines
# Disable cache
import os
try:
os.environ.pop('LIBROSA_CACHE_DIR')
except:
pass
import matplotlib
matplotlib.use('Agg')
import numpy as np
np.set_printoptions(precision=3)
from nose.tools i... | |
# Copyright 2014 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, s... | |
#!/usr/bin/env python3
# Copyright (c) 2016 The nealcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import re
import fnmatch
import sys
import subprocess
import datetime
import os
############################... | |
"""
Executes a test suite consisting of two separate cases: short tests and long tests.
Before each case, an instance of Clipper is created. Tests
are then performed by invoking methods on this instance, often resulting
in the execution of docker commands.
"""
from __future__ import absolute_import, division, print_fu... | |
"""Support for non-delivered packages recorded in AfterShip."""
from datetime import timedelta
import logging
from pyaftership.tracker import Tracking
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME, HTTP_OK... | |
"""The WiderFace dataset.
"""
# standard imports
import os
import logging
# third party imports
import numpy as np
# toolbox imports
from dltb.base.data import Data
from dltb.base.image import BoundingBox, Region, Landmarks
from dltb.tool.classifier import ClassScheme
from dltb.datasource import Imagesource, Section... | |
# vim: expandtab:tabstop=4:shiftwidth=4
"""This module comprises Aws specific utility functions."""
import os
import re
# Buildbot does not have multi_inventory installed
#pylint: disable=no-name-in-module
from openshift_ansible import multi_inventory
class ArgumentError(Exception):
"""This class is raised when... | |
# some methods should use 'put' instead of 'get'
# some seem to require 'delete' now?
# use the right (latest) version of this:
# http://s3.amazonaws.com/h2o-release/h2o-dev/master/1019/docs-website/REST/endpoints/markdown/toc.md
import os, sys, time, requests, zipfile, StringIO, re
import h2o_args
# from h2o_cmd imp... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 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 or... | |
"""Support for the Unitymedia Horizon HD Recorder."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHAN... | |
"""
pygments.lexers.igor
~~~~~~~~~~~~~~~~~~~~
Lexers for Igor Pro.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, words
from pygments.token import Text, Comment, Keyword, Name, String... | |
#
# Copyright John Reid 2008, 2009
#
"""
Code to analyse sequences in preparation for the HDPM.
"""
from shared import *
import biopsy.analyse_remos.consolidate_hits as CH
import biopsy.analyse_remos.expectations as EX
from boost.graph import Graph
class LabelledGraph(Graph):
"""
A boost.graph.Graph that ... | |
import pytest
from yelp_beans.logic.user import add_preferences
from yelp_beans.logic.user import create_new_employees_from_list
from yelp_beans.logic.user import hash_employee_data
from yelp_beans.logic.user import is_valid_user_subscription_preference
from yelp_beans.logic.user import mark_termed_employees
from yelp_... | |
# vim: set expandtab ts=4 sw=4 filetype=python fileencoding=utf8:
import logging
import textwrap
import psycopg2.extras
log = logging.getLogger(__name__)
fighters_and_moves = dict({
"Liu Kang": [
("Fire blast", 20),
("Flying kick", 30),
],
'Scorpion': [
("Harpoon", 30),
... | |
from __future__ import absolute_import
import os
import shlex
import signal
import subprocess
import time
from collections import namedtuple
from operator import attrgetter
from textwrap import dedent
from docker import errors
from .. import mock
from compose.cli.command import get_project
from compose.cli.docker_cl... | |
"""Extra magics for terminal use."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from logging import error
import os
import sys
from IPython.core.error import TryNext, UsageError
from IPython.core.magic import Magics, magics_class, line_magic
from IPython.lib... | |
import numpy as np
import nltk
from tqdm import tqdm
import pickle
import math
import os
import random
from cornell_data import CornellData
from batch import Batch
# Monkey patch math.isclose for Python <3.5
if not hasattr(math, 'isclose'):
math.isclose = lambda a, b, rel_tol=1e-09, abs_tol=0.0: \
abs(a - b) <= ma... | |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from acq4.pyqtgraph.Qt import QtCore, QtGui
from CanvasItem import CanvasItem
import numpy as np
import scipy.ndimage as ndimage
import acq4.pyqtgraph as pg
import acq4.pyqtgraph.flowchart
import acq4.util.DataManager as DataManager
import acq4.util.debug as d... | |
#!/usr/bin/env python
from future.standard_library import install_aliases
install_aliases()
from builtins import range
from argparse import ArgumentParser
from multiprocessing.queues import Empty
from multiprocessing import Process, Queue, Value, cpu_count
import requests
import shutil
import sys
import signal
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.