gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | |
"""This is a fairly straightforward fork of the python2.6 pprint module.
While the standard pprint uses a fairly odd and nonstandard indentation scheme,
we strive to output with an indentation that's suitable for python code written
in a standard style.
"""
from .version import __version__
__version__ = __version__ #... | |
# Copyright 2002-2011 Nick Mathewson. See LICENSE for licensing information.
"""mixminion.BuildMessage
Code to fragment and reassemble messages."""
import binascii
import math
import time
import mixminion._minionlib
import mixminion.Filestore
from mixminion.Crypto import ceilDiv, getCommonPRNG, sha1, whiten, unw... | |
# Copyright 2018 ARM Limited
#
# 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 writin... | |
#!/usr/bin/env python
# coding: utf-8
"""Test environment for client library tests.
This module has functions for creating keyspaces, tablets for the client
library test.
"""
import hashlib
import random
import struct
import threading
import time
import traceback
import unittest
import environment
import tablet
impo... | |
from os import path
from .info import __VERSION__
# <p>Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a
# BSD-style licence.</p>
from . import licences
##
# <p><b>A Python module for extracting data from MS Excel (TM) spreadsheet... | |
from __future__ import absolute_import, division
from django.core import urlresolvers
from django.db import connection
from django.db.models import Sum
from django.db.models.query import QuerySet
from django.http import HttpResponseNotFound, HttpRequest, HttpResponse
from django.template import RequestContext, loader
... | |
from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V13
from bingads.v13.internal.bulk.string_table import _StringTable
from bingads.v13.internal.bulk.entities.single_record_bulk_entity import _SingleRecordBulkEntity
from bingads.v13.internal.bulk.mappings import _SimpleBulkMapping
from bingads.v13.internal.ext... | |
# Copyright 2013-2015 DataStax, 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... | |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.cogdominium.CogdoMazeGameObjects
from panda3d.direct import WaitInterval
from panda3d.core import BitMask32, CollideMask, CollisionNode, CollisionSphere, CollisionTube, NodePath, Point3, Point4, Vec3, Vec4
from direct.interval.IntervalGlobal import Ler... | |
"""
neural network stuff, intended to be used with Lasagne.
Taken from
https://github.com/openai/improved-gan/blob/master/mnist_svhn_cifar10/nn.py
NOTE: Written by Tim Salimans. Does not fall under the BSD license of
the rest of the repository; licensing is unclear.
"""
import numpy as np
import theano as th
impor... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# coding=utf-8
# Copyright 2021 TF.Text 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 ag... | |
import numpy as np
import tensorflow as tf
import scipy.misc as sm
FLAGS = tf.app.flags.FLAGS
def gen_pred_img(ffg, fbg, lfg):
border = 2
shape = ffg.shape # [h, w, c]
image = np.ones([shape[0]+2*border, shape[1]*3+4*border, shape[2]]) * 255
image[border:-border,border:shape[1]+border] = ffg
ima... | |
#!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | |
# 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... | |
#!/usr/bin/env python
#
# pKaTool - analysis of systems of titratable groups
# Copyright (C) 2010 Jens Erik Nielsen
#
# This program 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 Lice... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# (c) 2015, Evan Kaufman <evan@digitalflophouse.com>
# (c) 2015, Luca Berruti <nadirio@gmail.com>
#
# GNU General Public Li... | |
import datetime
import mongoengine as mongo
import urllib2
import redis
from django.conf import settings
from apps.social.models import MSharedStory
from apps.profile.models import Profile
from apps.statistics.rstats import RStats, round_time
from utils import json_functions as json
from utils import db_functions
from ... | |
"""Support for a State MQTT vacuum."""
import json
import voluptuous as vol
from homeassistant.components.vacuum import (
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_IDLE,
STATE_PAUSED,
STATE_RETURNING,
SUPPORT_BATTERY,
SUPPORT_CLEAN_SPOT,
SUPPORT_FAN_SPEED,
SUPPORT_LOCATE... | |
#!/usr/bin/python
# Author: Rob Sanderson (azaroth@liv.ac.uk)
# Distributed and Usable under the GPL
# Version: 1.7
# Most Recent Changes: contexts, new modifier style for 1.1
#
# With thanks to Adam from IndexData and Mike Taylor for their valuable input
from shlex import shlex
from xml.sax.saxutils import escape
... | |
#!/usr/bin/env python2.7
import sys
import os
import argparse
import re
from operator import itemgetter
#God this is dumb. This needs to be done so python doesn't throw an error when you pipe it to head
import signal
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
#argParser = argparse.ArgumentParser()
#argParser.add_... | |
# Copyright (C) 2009, Hyves (Startphone Ltd.)
#
# This module is part of the Concurrence Framework and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from __future__ import with_statement
import logging
from concurrence import Tasklet, TaskletPool, Channel, DeferredQueue, ... | |
# 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... | |
import copy
import datetime
from django.core.exceptions import FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.query_utils import Q
from django.utils import six
from django.utils.functional import cached_property
class Combinable(object):
... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | |
# Copyright 2015 Metaswitch Networks
#
# 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 w... | |
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# 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... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import warnings
import numpy as np
from math import pi
import unittest
import os
from monty.os.path import which
from pymatgen.analysis.local_env import ValenceIonicRadiusEvaluator, \
VoronoiNN, JmolNN, M... | |
"""Test EQ3 Max! Thermostats."""
from datetime import timedelta
from maxcube.cube import MaxCube
from maxcube.device import (
MAX_DEVICE_MODE_AUTOMATIC,
MAX_DEVICE_MODE_BOOST,
MAX_DEVICE_MODE_MANUAL,
MAX_DEVICE_MODE_VACATION,
)
from maxcube.thermostat import MaxThermostat
from maxcube.wallthermostat im... | |
import re
import sys
import json
import locale
from tornado.options import options
from dateutil import tz
class Filters():
'''
Checks whether the passed in value is considered useful otherwise will return None
will return None on the following values:
None
''
... | |
#
# Copyright John Reid 2013, 2014
#
"""
A python package for non-parametric sequence models.
"""
import logging
_logger = logging.getLogger(__name__)
import numpy.random
import math
import seqan.traverse
import seqan
from copy import copy
from collections import defaultdict
# Types we use to create strings and i... | |
# coding=utf-8
# Copyright 2015 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 logging
impor... | |
#
# 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... | |
# Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | |
# encoding: 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):
# Deleting model 'ItemRequiresSpell'
db.delete_table('dnd_itemrequiresspell')
# Adding M2M table ... | |
from __future__ import absolute_import
import json
import os
import string
from collections import namedtuple
import paramiko
import logging
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group, User
from django.contrib.contenttypes.models import ContentType
from django.core.excep... | |
# -*- coding: utf-8 -*-
'''
Module for running arbitrary tests
'''
from __future__ import absolute_import
# Import Python libs
import os
import sys
import time
import traceback
import random
# Import Salt libs
import salt
import salt.utils
import salt.version
import salt.loader
import salt.ext.six as six
from salt.ut... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley NV
#
# 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... | |
from PyQt4 import QtGui,QtCore
from datetime import datetime
from rq.job import Job
from redis import Redis
from rq import Queue
from gui.experiment_combo_box import ExperimentComboBox
from gui.new_trial_dialog import NewTrialDialog
from gui.sqlalchemy_table_model import SQLAlchemyTableModel
from gui.trial_detail_widge... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# 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 (t... | |
"""
Contains generic class-based CRUD views.
"""
from django.contrib import messages
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
from django.views.generic import CreateView as _CreateView
from django.views.generic impo... | |
# -*- coding: utf-8 -*-
import os
import unittest
from StringIO import StringIO
from mimecat import (Catalogue, _canonicalize_extension,
_parse_file, _parse_line)
TEST_MIME_TYPES = """
# This file maps Internet media types to unique file extension(s).
# Although created for httpd, this file is us... | |
import time, unittest
from reset_database import reset_database, reset_data
from flask import url_for
from modules.Shared.database import db
from shepard import create_flask
# http://flask.pocoo.org/docs/0.11/testing/
# http://flask.pocoo.org/docs/0.11/api/#flask.Response
# https://docs.python.org/2/library/unittest.h... | |
from south.db import db
from django.db import models
from ietf.community.models import *
class Migration:
def forwards(self, orm):
# Adding model 'Rule'
db.create_table('community_rule', (
('id', orm['community.Rule:id']),
('community_list', orm['community.Rul... | |
"""
Line editing functionality.
---------------------------
This provides a UI for a line input, similar to GNU Readline, libedit and
linenoise.
Either call the `prompt` function for every line input. Or create an instance
of the :class:`.PromptSession` class and call the `prompt` method from that
class. In the secon... | |
#
# Copyright (c) 2016 NEC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | |
# 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 ... | |
#GUI_Configuration_state_management
import yaml
import gzip
from PyQt4 import QtGui
def ui_state(ui):
""" Returns the current state of the GUI in an easily usable dict """
state = dict()
ip = str(ui.ipField.text())
f = str(ui.fileField.text())
ip_vna = str(ui.vna_ip_field.text())
file_vna = s... | |
# -*- coding: utf-8 -*-
'''
Return data to a PostgreSQL server with json data stored in Pg's jsonb data type
:maintainer: Dave Boucha <dave@saltstack.com>, Seth House <shouse@saltstack.com>, C. R. Oldham <cr@saltstack.com>
:maturity: new
:depends: python-psycopg2
:platform: all
To enable this retur... | |
#
# ff7.data - Final Fantasy VII translation-related data tables
#
# Copyright (C) 2014 Christian Bauer <www.cebix.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appe... | |
import random
class Gen(object):
'''
A set of values, which may either be randomly drawn from or
traversed serially. For uncountable sets (or those which are pain
to exhaustively enumerate) the function series should return None
'''
def series(self, size):
'''
An iterator o... | |
import sys
sys.path += ['../']
import torch
from torch import nn
from transformers import (
RobertaConfig,
RobertaModel,
RobertaForSequenceClassification,
RobertaTokenizer,
BertModel,
BertTokenizer,
BertConfig
)
import torch.nn.functional as F
from data.process_fn import triple_process_fn, t... | |
"""
../wps.py?request=execute
&service=wps
&version=1.0.0
&identifier=esmvaltool-perfmetrics
&status=true
&storeExecuteResponse=true
"""
import datetime
import shutil
import netCDF4
import urlparse
from pywps.Process import WPSProcess
import os
import logging
from jinja2 import FileSystemLoader, Environment,select... | |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | |
# Copyright 2020 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
# -*- coding: utf-8 -*-
##############################################################################
# Copyright Kitware 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 t... | |
#!/usr/bin/env python
"""
A sample implementation of Ukkonen's suffix trie.
"""
__all__ = ['MaximalRepeat', 'Node', 'STrie']
class MaximalRepeat(object):
"""
A struct-like object for maximal repeat metadata.
"""
__slots__ = ('strings', 'length', 'indices', 'contains')
def __init__(self, strings,... | |
import unittest
from picogeojson import (Point, LineString, Polygon,
MultiPoint, MultiLineString, MultiPolygon,
GeometryCollection, Feature, FeatureCollection,
DEFAULTCRS)
from picogeojson.map import Map
class MapTests(unittest.TestCase):
... | |
# Copyright 2013 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.
"""A wrapper around ssh for common operations on a CrOS-based device"""
import logging
import os
import re
import subprocess
import sys
import tempfile
# TOD... | |
# coding=utf-8
# 2-dimensional ising model with visualization
# Written by Kyrre Ness Sjoebaek
from __future__ import division
import matplotlib.pyplot as plt
from numba import jit
import numpy
import numpy as np
import sys
import math
import pygame
from timeit import default_timer as timer
from scipy import integrate
... | |
# 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... | |
import re
from collections import defaultdict
from enum import Enum
import pytest
from selenium.webdriver.common.by import By
class TriggerTypes(Enum):
KEY = "KEY"
STRING = "STRING"
class AssertionObject:
def __init__(self, expected_trigger_types=[], expected_hotkey_ids=[]):
self._trigger_types... | |
"""Database models used by django-reversion."""
from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.conf import settings
from django.core import serializers
from django.core.exceptions import ObjectDoesNotExist
... | |
# -*- coding: utf-8 -*-
"""Python has a very powerful mapping type at its core: the :class:`dict`
type. While versatile and featureful, the :class:`dict` prioritizes
simplicity and performance. As a result, it does not retain the order
of item insertion [1]_, nor does it store multiple values per key. It
is a fast, uno... | |
import os
import pytest
import glob
from tests.lib.path import Path
from tests.lib import TestFailure
def test_install_from_future_wheel_version(script, data):
"""
Test installing a future wheel
"""
package = data.packages.join("futurewheel-3.0-py2.py3-none-any.whl")
result = script.pip('install'... | |
from math import *
import numarray as N
def fit(x, y, sig=None):
#Given a set of data points x, y,
#with individual standard deviations sig,
#fit them to a straight line y = a + bx by minimizing chi-sq.
#Returned are a, b and their respective probable uncertainties siga and sigb,
#the chi-square ch... | |
"""Support for AirVisual air quality sensors."""
from logging import getLogger
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
ATTR_STATE,
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
CONF_LATITUDE,
CONF_LON... | |
#!/usr/bin/python
# Copyright 2016 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 appli... | |
def chr_is_hex(c):
return (c >= '0' and c <= '9') or (c >= 'a' and c <= 'f') or (c >= 'A' and c <= 'F')
def chr_is_oct(c):
return c >= '0' and c <= '7'
def chr_is_bin(c):
return c == '0' or c == '1'
def chr_is_identifier_start(c):
return c.isalpha() or c in '_'
def chr_is_identifier(c):
return ... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# 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. Yo... | |
"""
Test a bunch of functions that serve as an interface to standard stellar data
table
"""
import numpy as np
import logging
from astropy.io import fits
from astropy.table import Table
# from astropy.units.core import UnitConversionError
try:
import exceptions
except ImportError:
import builtins as exceptions... | |
"""
Code to manage IAM roles, groups, and policies.
"""
from __future__ import print_function
import json
import os
import os.path
import urllib
import urllib2
from collections import defaultdict
import logging
from datetime import datetime
import boto
import boto.iam
import boto3
import botocore
from .disco_config im... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | |
# -*- 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... | |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | |
#! /usr/bin/python3
import sys
import time
import threading
import select
import signal
import fcntl
import os
import socket
import struct
import math
import argparse
import functools
from gpiozero import MCP3008
###
### Python debug
###
### If debug is needed you should uncomment the next line
#import pdb
### and pl... | |
# -*- coding: utf8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
import re
import os
import sys
import cgi
import codecs
from .core import *
from ._compat import urllib, URLError
def usage():
return """Usage: %(progname)s -s STOPLIST [OPTIONS] [HTM... | |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | |
#! /usr/bin/env python
import multiprocessing as mp
import numpy as np
import os
import shutil
import configparser
import subprocess
import collections
"""Module that contains functions to help run batches and parameter sweeps
"""
def _parse_config_fr_to_by(config_string):
"""Returns the value for the fr, to, a... | |
from __future__ import print_function
import functools
from copy import copy
import numpy as np
from scipy.stats import norm as ndist
import functools
from copy import copy
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
import regreg.affine as ra
from ..constraints.affine import c... | |
"""Tweet text preprocessing module, processes Line Delimited JSON files.
Reads Line Delimited JSON file and and processes tweet's text. In text it
replaces entities specified in replacements.json.
"""
from __future__ import print_function
import json
import argparse
import sys
from functools import partial
from Mult... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | |
#
# Copyright (c) 2017 Luis F. Simoes (github: @lfsimoes)
#
# Licensed under the MIT License. See the LICENSE file for details.
from math import sqrt, log
import os, inspect, pickle
import numpy as np
import PyKEP as pk
from .constants import *
from .lambert import lambert_eval, lambert_optimize_dt
from .multiobj... | |
from __future__ import division, unicode_literals
import base64
import io
import itertools
import os
import time
from .fragment import FragmentFD
from ..compat import (
compat_etree_fromstring,
compat_urlparse,
compat_urllib_error,
compat_urllib_parse_urlparse,
compat_struct_pack,
compat_struc... | |
from __future__ import absolute_import
import logging
from weblib.etree import get_node_text
from weblib.text import find_number
from weblib.const import NULL
from weblib.error import DataNotFound
from weblib.encoding import make_unicode
import six
from grab.util.misc import deprecated
from grab.error import GrabMisus... | |
"Materialized Path Trees"
import operator
from numconv import NumConv
from django.core import serializers
from django.db import models, transaction, connection
from django.db.models import Q
from treebeard.models import Node
from treebeard.exceptions import InvalidMoveToDescendant, PathOverflow
class MP_NodeQueryS... | |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
'''
Redis checks
'''
# stdlib
from collections import defaultdict
import re
import time
# 3rd party
import redis
# project
from checks import AgentCheck
DEFAULT_MAX_SLOW_ENTRIES = 128
MAX_SLOW_ENTRIES_KEY = "sl... | |
# 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... | |
# -*- 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 'Book'
db.create_table('cabinet_book', (
('id', self.gf('django.db.models.fields.... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# enable debugging
import sys, os, time, datetime, random
from glob import glob
sys.path.append( os.environ['CONFPATH'] )
import config
config.set_incpath()
import session
templates = {'main':''}
rendered = False
coloured = True
cookies = ''
colors = {
'red' : [255,5... | |
# Copyright 2015 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | |
"""Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from scipy.sparse.linalg import eigsh
from ..utils import check_random_state
from ..utils.validation import check_is_fitted, check_array
from ..exceptions im... | |
# Copyright 2014 VMware, 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 a... | |
# 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... | |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.utils import six
from django.utils.... | |
# Author: Denis A. Engemann <denis.engemann@gmail.com>
# License: BSD (3-clause)
import numpy as np
import mne
from mne.io import set_bipolar_reference
from mne.io.bti.bti import (
_convert_coil_trans, _coil_trans_to_loc, _get_bti_dev_t,
_loc_to_coil_trans)
from mne.transforms import Transform
from mne.utils i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.