gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2014, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | |
'''Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
'''
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import re
from scipy import linalg
import scipy.ndimag... | |
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
"""
Compliance Checker suite runner
"""
import os
import sys
import subprocess
import inspect
import itertools
from operator import itemgetter
from netCDF4 import Dataset
from lxml import etree as ET
from distutils.version import StrictVersion
from compliance_checker.base import fix_return_value, Result, GenericFile
f... | |
# 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 ... | |
import unittest
from test import support
from weakref import proxy, ref, WeakSet
import operator
import copy
import string
import os
from random import randrange, shuffle
import sys
import warnings
import collections
from collections import UserString as ustr
import gc
import contextlib
class Foo:
pass
class Ref... | |
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
import datetime
import errno
from flickrapi import FlickrAPI, FlickrError
from flickrauth import API_KEY, API_SECRET
from lxml import etree
from os import makedirs
from os.path import abspath, exists, isdir, isfile, join, splitext
from PIL import Image, ImageCms
import re
import simplejson as json
import sys
import url... | |
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass
from pygments.token import Token
from prompt_toolkit.document import Document
from prompt_toolkit.enums import SEARCH_BUFFER
from prompt_toolkit.filters import to_cli_filter, Never
from .utils import token_... | |
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not u... | |
"""\
Example.
%(prog)s production.ini
"""
from webtest import TestApp
from snovault import STORAGE
from snovault.elasticsearch import ELASTIC_SEARCH
import atexit
import datetime
import elasticsearch.exceptions
import json
import logging
import os
import psycopg2
import select
import signal
import socket
import ... | |
# Copyright 2016 Pinterest, 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 writi... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, absolute_import, print_function
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import logging
import re
import time
from datetime import datetime, timedelta
from dateutil.pa... | |
#
# 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... | |
import os
import random
import cookielib
import re
import urllib2
import urllib
from mimetypes import MimeTypes
import urlparse
from ptdb import PtSqlite
from ptthread import PtWorkManager
from ptcore import PtCp,PtFile
from ptcore import hex_md5, pathHashDir, makeDir, rmDir, user_agents,\
error_log, trace_back
... | |
from __future__ import print_function
from __future__ import absolute_import
import os
import re
import subprocess
import threading
import logging
import socket
import inspect
import tempfile
import stat
import shlex
import platform
from . import config
#from common import *
MODULEFILE = re.sub('\.py', '',
... | |
"""
:codeauthor: :email:`Christian McHugh <[email protected]>`
"""
import salt.modules.config as config
import salt.modules.zabbix as zabbix
from salt.exceptions import SaltException
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.u... | |
# oracle/base.py
# Copyright (C) 2005-2011 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
"""Support for the Oracle database.
Oracle version 8 through current (11g at the time ... | |
"""Fuzzy Linear Discriminant Analysis"""
import numpy as np
import pandas as pd
from collections import Counter
from sklearn.utils.validation import check_is_fitted
from scipy import linalg
from sklearn.decomposition import PCA
from collections import Counter
from sklearn.utils.extmath import softmax
from sklearn.base... | |
from django.shortcuts import get_object_or_404, render
from django.http import Http404
from wagtail.utils.pagination import paginate
from wagtail.wagtailadmin.modal_workflow import render_modal_workflow
from wagtail.wagtailadmin.forms import (
SearchForm, ExternalLinkChooserForm, ExternalLinkChooserWithLinkTextFor... | |
# file openpyxl/style.py
# Copyright (c) 2010 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... | |
#
# Copyright 2019 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 applicabl... | |
#!/usr/bin/env python
"""This file controls the central function of EVOLVE, the calculation of the log-
likelihood of an alignment given a phylogenetic tree and substitution model.
The likelihood calculation is done according to Felsenstein's 1981 pruning
algorithm. This file contains a Python implementation of that
al... | |
"""
plot_radar.py
Class instance used to make Display.
"""
from __future__ import print_function
# Load the needed packages
import numpy as np
import os
import pyart
from matplotlib.backends.qt_compat import is_pyqt5
if is_pyqt5():
from matplotlib.backends.backend_qt5agg import (
FigureCanvas, NavigationT... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Project.popularity'
db.add_column(u'projects_project', 'popularity',
s... | |
import datetime
import math
import traceback
try:
import subprocess32 as subprocess
except Exception:
import subprocess
from pandaharvester.harvestercore.work_spec import WorkSpec
from .base_worker_maker import BaseWorkerMaker
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestermis... | |
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
################################################################################
# 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... | |
# 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... | |
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.db.model... | |
from seamless.core.transformation import SeamlessTransformationError
header = """
/*
The following C header has been auto-generated from the transformer schema
It will be used to generate bindings, but it will not be automatically
added to the compiled transformer code.
If your transformer code is written in C/C++,... | |
# Copyright 2015 PLUMgrid
#
# 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, softwar... | |
#!/usr/bin/env python3
# testBoundLog.py
import os
import time
import unittest
from xlattice import HashTypes, check_hashtype
from upax.ftlog import BoundLog, FileReader, LogEntry, StringReader
class TestBoundLog(unittest.TestCase):
def setUp(self):
self.u_dir = "dev0/U"
self.path_to_log = "%s... | |
#!/usr/bin/env python
import logging
import unittest
import MySQLdb
import environment
import tablet
import utils
use_mysqlctld = True
tablet_master = tablet.Tablet(use_mysqlctld=use_mysqlctld)
tablet_replica1 = tablet.Tablet(use_mysqlctld=use_mysqlctld)
tablet_replica2 = tablet.Tablet(use_mysqlctld=use_mysqlctld)... | |
import pytest
import re
from pynt import _pynt, main
import sys
if sys.version.startswith("3."):
from io import StringIO as SOut
else:
from StringIO import StringIO as SOut
import os
from os import path
import imp
def fpath(mod):
return path.splitext(mod.__file__)[0] + '.py'
def simulate_dynamic_mod... | |
import os
import sys
import urllib.request, urllib.error, urllib.parse
import copy
import threading
import time
import math
import tempfile
import base64
import hashlib
import socket
import logging
from io import StringIO
import multiprocessing.dummy as multiprocessing
from ctypes import c_int
import json
import ssl
f... | |
"""Test for RFLink cover components.
Test setup of RFLink covers component/platform. State tracking and
control of RFLink cover devices.
"""
import logging
from homeassistant.components.rflink import EVENT_BUTTON_PRESSED
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_CLOSE_COVER,
SERVICE_OPEN... | |
##############################################################################
#
# 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... | |
# Copyright (C) 2007 Alexandre Conrad, alexandre (dot) conrad (at) gmail (dot) com
#
# This module is part of FormAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import cgi
import warnings
import logging
logger = logging.getLogger('formalchemy.' + __name__)
MIN_SA_V... | |
# Configuration file for ipython.
# ------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
# ------------------------------------------------------------------------------
## A Mixin for applications that start InteractiveShell instances.
#
# P... | |
from __future__ import absolute_import
from __future__ import print_function
import theano
import theano.tensor as T
import numpy as np
import warnings
import time, json
from collections import deque
from .utils.generic_utils import Progbar
from .utils.plotting_utils import PlotGenerator
class CallbackList(object):
... | |
# -*- coding: utf-8 -*-
import time
import urlparse
import datetime
import pytz
from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import make_aware, now
from django.contrib.auth... | |
import os,sys, psycopg2,flask,jsonify,request,json
from flask_cors import CORS
from psycopg2.extras import RealDictCursor
#https://tecadmin.net/install-python-3-7-on-ubuntu-linuxmint/
#https://bitlaunch.io/blog/create-a-bitcoin-node-with-ubuntu/
#nohup pythonScript.py
conn_string = "host='localhost' dbname='swift' use... | |
#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Performance runner for d8.
Call e.g. with tools/run-perf.py --arch ia32 some_suite.json
The suite json format is expected to be... | |
import itsdangerous
from django.middleware.csrf import get_token
from django.utils.translation import ugettext_lazy as _
import waffle
from rest_framework import authentication
from rest_framework.authentication import BasicAuthentication, CSRFCheck
from rest_framework import exceptions
from addons.twofactor.models ... | |
"""Support for DoorBird devices."""
import asyncio
import logging
import urllib
from urllib.error import HTTPError
from aiohttp import web
from doorbirdpy import DoorBird
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.config_entries import SOURCE_IMPORT, Config... | |
#!/usr/bin/env python
# ===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... | |
"""Elliptical geometrical entities.
Contains
* Ellipse
* Circle
"""
from __future__ import print_function, division
from sympy.core import S, C, sympify, pi, Dummy
from sympy.core.logic import fuzzy_bool
from sympy.core.numbers import oo, zoo, Rational
from sympy.simplify import simplify, trigsimp
from sympy.functi... | |
#!/usr/bin/env python
"""
@package ion.agents.port.logger_process
@file ion/agents.port/logger_process.py
@author Edward Hunter
@brief Daemon processes providing hardware specific device connections
and logging.
"""
__author__ = 'Edward Hunter'
import socket
import threading
import time
import datetime
import atexi... | |
# Copyright 2014 Cloudbase Solutions Srl
# 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... | |
#! /usr/bin/env python
import os
import re
import sys
import time
import random
import logging
import tempfile
import subprocess
import shutil
import argparse
# params overwrite priority:
# for default:
# default_params < blackbox|whitebox_default_params < args
# for simple:
# simple_default_params < b... | |
#
# Copyright (c) 2014, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... | |
# -*- coding: utf8 -*-
from beehive.compat import unicode
from beehive.formatter.ansi_escapes import escapes, up
from beehive.formatter.base import Formatter
from beehive.model_describe import escape_cell, escape_triple_quotes
from beehive.textutil import indent
import sys
# -----------------------------------------... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
# Created by Pearu Peterson, September 2002
from __future__ import division, print_function, absolute_import
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test()'
Run tests if fftpack is not installed:
python tests/test_basic.... | |
from unittest import TestCase
from numpy.testing import assert_equal, assert_array_equal
import numpy as np
from srsly import msgpack
class ThirdParty(object):
def __init__(self, foo=b"bar"):
self.foo = foo
def __eq__(self, other):
return isinstance(other, ThirdParty) and self.foo == other.fo... | |
#!/usr/bin/env python
"""Test the flow archive."""
import os
import mock
from grr.gui import api_call_handler_utils
from grr.gui import api_call_router_with_approval_checks
from grr.gui import gui_test_lib
from grr.gui import runtests_test
from grr.gui.api_plugins import flow as api_flow
from grr.lib import action... | |
from StringIO import StringIO
from collections import namedtuple
from contextlib import closing
import logging
import pprint
import sys
import traceback
from pyutilib.component.core import ExtensionPoint, PluginGlobals
# TODO Update plugins to import from `pyutilib.component.core` directly
# instead of importing from ... | |
# Copyright (c) 2015, University of Memphis, MD2K Center of Excellence
# - Timothy Hnat <[email protected]>
# - Karen Hovsepian <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are m... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shu... | |
# 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
# distributed under the... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
# Import PyQt5 classes
from .qt import *
import os
import sys
import numpy as np
import types
from collections import defaultdict, OrderedDict
import operator
import logging
try:
import xml.etree.cElementTree as et
except ImportError... | |
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
# Copyright 2017 Battelle Energy Alliance, 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 types
import threading
from django import http
import amfast
from amfast.remoting import Packet
import amfast.remoting.flex_messages as messaging
from amfast.remoting.channel import HttpChannel, ChannelError
def django_response_wrapper(func):
'''
A decorator which wrap a bare response to a DjangoResop... | |
import pickle
import json
import pandas as pd
import numpy as np
from .store import exists_key_store, get_key_store
from .dataset import get_dataset_list, get_dataset_folder, get_dataset
from .prepare import get_idx_train_test, get_eval_sets
def get_importance(dataset_id, round_id):
"""
features importance of... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
import numpy as np
from PySide import QtGui, QtCore
from PySide.QtOpenGL import *
import sharppy.sharptab as tab
from sharppy.sharptab.constants import *
## routine written by Kelton Halbert - OU School of Meteorology
## [email protected]
__all__ = ['backgroundThetae', 'plotThetae']
class backgroundThetae(QtGui.... | |
import numpy as np
import time
import gym
import queue
import ray
from ray.rllib.agents.ppo.ppo_tf_policy import PPOTFPolicy
from ray.rllib.evaluation.worker_set import WorkerSet
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.execution.concurrency_ops import Concurrently, Enqueue, Dequeue... | |
import itertools
import weakref
import six
from mongoengine.common import _import_class
from mongoengine.errors import DoesNotExist, MultipleObjectsReturned
__all__ = ('BaseDict', 'BaseList', 'EmbeddedDocumentList')
class BaseDict(dict):
"""A special dict so we can watch any changes."""
_dereferenced = Fa... | |
#!/usr/bin/env python3
import os
import sys
import logging
import argparse
import platform
import subprocess
import glob
import hashlib
import traceback
os.environ["PYTHONUNBUFFERED"] = "y"
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scri... | |
#!/usr/bin/env python
#
# Generated by generateDS.py.
#
import sys
import out2_sup as supermod
etree_ = None
Verbose_import_ = False
( XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_library = None
try:
# lxml
from lxml import etree as etre... | |
"""Google Cloud Hierarchical Firewall Generator.
Hierarchical Firewalls (HF) are represented in a SecurityPolicy GCP resouce.
"""
import copy
import re
from typing import Dict, Any
from absl import logging
from capirca.lib import gcp
from capirca.lib import nacaddr
class ExceededCostError(gcp.Error):
"""Raised ... | |
# Copyright (c) 2019 Iotic Labs Ltd. 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
#
# https://github.com/Iotic-Labs/py-IoticAgent/blob/master/LICENSE
#
# Unless re... | |
#!/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.
import fnmatch
import glob
import optparse
import os
import posixpath
import shutil
import stat
import sys
import time
import zipfi... | |
#!/usr/bin/env python
# Copyright (c) 2015 Angel Terrones (<[email protected]>)
#
# 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 r... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Microsoft Corporation. All rights reserved.
# Released under Apache 2.0 license as described in the file LICENSE.
#
# Authors: Soonho Kong, Leonardo de Moura, Ulrik Buchholtz
# Python 2/3 compatibility
from __future__ import print_function
import os... | |
# Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
import logging
import re
from datetime import datetime
try:
from enum import Enum
except ImportError:
from enum34 import Enum
from itertools import repeat
import numpy... | |
# -*- coding: utf-8 -*-
import json
import random
import logging as l
import os
import scipy.sparse as ss
import scipy.io as sio
import pandas as pd
import numpy as np
from sklearn.cross_validation import StratifiedShuffleSplit as SSS
from sklearn.cross_validation import KFold
from sklearn.externals.joblib import Para... | |
import matplotlib
from kid_readout.measurement.legacy import sweeps
from kid_readout.roach import baseband
matplotlib.use('agg')
import numpy as np
import time
import sys
from kid_readout.utils import data_file
from kid_readout.analysis.resonator.legacy_resonator import fit_best_resonator
from kid_readout.equipment i... | |
#!python
# Implementation of Clustering Algorithms in POVME
# By Celia Wong
# Advised by Jeff Wagner
# Amaro Lab, UCSD
import scipy.cluster.vq, scipy.cluster.hierarchy
import argparse
import numpy
import sys
import os
import csv
import copy
import itertools
import collections
#import fnmatch
import pylab
import POVME.... | |
"""
Test script for dataclasses
"""
from __future__ import absolute_import, division, print_function
from tests.util import unittest_reporter, glob_tests
import logging
logger = logging.getLogger('dataclasses')
import os
import sys
import json
try:
import cPickle as pickle
except:
import pickle
import uni... | |
# 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 applicable... | |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from typing import List, Optional, Tuple
from shared.insn_yaml import InsnsFile
from shared.mem_layout import get_memory_layout
from .program import ProgInsn, Program
c... | |
#!/usr/bin/env python2
#
# 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 "L... | |
from datetime import datetime, timedelta
from OpenSSL import crypto
from djutils.views.generic import SortMixin
from django.http import HttpResponse
from django.utils import timezone
from django.conf import settings
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.urls im... | |
# -*- coding: utf-8 -*-
"""Test parsing of VCF header lines from strings
"""
import sys
import pytest
from vcfpy import header
from vcfpy import parser
__author__ = "Manuel Holtgrewe <[email protected]>"
# parser.StupidHeaderLineParser.parse_key_value() --------------------------
def test_stupid_vcf_... | |
import json
import requests
from access_token import get_access_token
from vocabulary import ThreatExchange as t
from errors import (
pytxFetchError,
pytxValueError
)
class Broker(object):
"""
The Broker handles validation and submission of requests as well as
consumption and returning of the r... | |
# Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
"""This file is a fork from a MIT-licensed project named OpenAI Baselines:
https://github.com/openai/baselines/blob/master/baselines/common/atari_wrappers.py
"""
from collections import deque
import gym
import numpy as np
from gym import spaces
import chainerrl
try:
import cv2
cv2.ocl.setUseOpenCL(False)
... | |
'''An asynchronous multi-process `HTTP proxy server`_. It works for both
``http`` and ``https`` (tunneled) requests.
Managing Headers
=====================
It is possible to add middleware to manipulate the original request headers.
If the header middleware is
an empty list, the proxy passes requests and responses un... | |
# Copyright 2016 Capital One Services, 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... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Subuser'
db.create_table('blogs_subuser', (
('id', self.gf('django.db.models.fie... | |
#!/usr/bin/env python
"""
Unittests for wtforms_appengine
To run the tests, use NoseGAE:
pip install nose nosegae
nosetests --with-gae --without-sandbox
"""
from __future__ import unicode_literals
# This needs to stay as the first import, it sets up paths.
from gaetest_common import DummyPostData, fill_authors, DBT... | |
import math
from PIL import Image, ImageDraw
def get_angle(p1, p2, p3):
"""
Calculates the angle between three points
https://en.wikipedia.org/wiki/Law_of_cosines#Applications
:param p1: center point
:type p1: tuple
:type p2: tuple
:type p3: tuple
:rtype: float
"""
f = point... | |
# Thierry Parmentelat -- INRIA
#
# a minimal library for writing "lightweight" SFA clients
#
# xxx todo
# this library should probably check for the expiration date of the various
# certificates and automatically retrieve fresh ones when expired
import sys
import os,os.path
import subprocess
from datetime import date... | |
"""Simple language detector
"""
import re
import math
import random
import unicodedata
from operator import itemgetter
from itertools import chain
from collections import defaultdict
def stream_sample(filename):
"""Streams over a dataset, iterates over language label and sample text"""
with open(filename) a... | |
'''
This file runs analysis on the vision output from buoys (or other things)
to determine where the buoy is most likely to be.
This outputs as the mission's tagged location the location where it is
most likely to find the buoy.
We keep a grid storing a top-down view of the area where we think the buoy is.
Vision resu... | |
# Copyright 2014 Dirk Pranke. 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.