gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'ReservableProductCartReservation'
db.create_table(u'shop_... | |
import contextlib
import logging
import os
import re
import signal
import timeit
import hail as hl
from py4j.protocol import Py4JError
from .resources import all_resources
from .. import init_logging
class BenchmarkTimeoutError(KeyboardInterrupt):
pass
_timeout_state = False
_init_args = {}
# https://stacko... | |
#!/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.
# Virtual Me2Me implementation. This script runs and manages the processes
# required for a Virtual Me2Me desktop, which are: X se... | |
# Copyright 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 accompa... | |
#!/usr/bin/env python
# Some of this is from here:
# https://github.com/bvanheu/pytoutv/blob/master/toutvcli/app.py
# Copyright (c) 2012, Benjamin Vanheuverzwijn <bvanheu@gmail.com>
# Copyright (c) 2014, Philippe Proulx <eepp.ca>
# All rights reserved.
#
# Thanks to Marc-Etienne M. Leveille
#
# Redistribution and use... | |
#!/bin/env python
import os
import sys
import string
from xml.dom import minidom
#
# opgen.py -- generates tables and constants for decoding
#
# - itab.c
# - itab.h
#
#
# special mnemonic types for internal purposes.
#
spl_mnm_types = [ 'd3vil', \
'na', \
'grp_r... | |
"""Fields tests."""
import datetime
import time
import six
import unittest2 as unittest
from domain_models import models
from domain_models import collections
from domain_models import fields
from domain_models import errors
class RelatedModel(models.DomainModel):
"""Example model that is used for testing rela... | |
# orm/attributes.py
# Copyright (C) 2005-2014 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
"""Defines instrumentation for class attributes and their interaction
with instances... | |
import itertools
from nose.tools import assert_equal, assert_true, assert_false, assert_raises
import networkx as nx
from networkx.algorithms import flow
from networkx.algorithms.connectivity import local_edge_connectivity
from networkx.algorithms.connectivity import local_node_connectivity
flow_funcs = [
flow.bo... | |
import os
import sys
import datetime
import re
import shutil
import webbrowser
FILEDIR = "templates"
DESIGNDIR = "design"
ASSETSDIR = "assets_url"
ASSETS_ORG = "assets"
notParse = ['404.html', 'layout.html']
SUBCONTENT = "{{ content }}"
now = datetime.datetime.now()
nowDate = now.strftime("%Y-%m-%d %H:%M")
menuBlok ... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import ops
from .groupby import DataArrayGroupBy, DatasetGroupBy
from .pycompat import dask_array_type, OrderedDict
RESAMPLE_DIM = '__resample_dim__'
class Resample(object):
"""An object that exte... | |
# Copyright (c) 2011 Justin Santa Barbara
#
# 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... | |
"""
Unittests for the ffs.filesystem module
"""
from __future__ import with_statement
import getpass
import os
import sys
import tempfile
import unittest
from mock import MagicMock, patch
if sys.version_info < (2, 7): import unittest2 as unittest
from ffs import exceptions, filesystem, nix
class BaseFilesystemTest... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | |
# 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... | |
"""
byceps.blueprints.admin.shop.article.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from datetime import datetime
from decimal import Decimal
from flask import abort, request... | |
from urllib.parse import urljoin
from pyramid.httpexceptions import HTTPSeeOther
from pyramid.response import Response
from libweasyl import ratings
from libweasyl import staff
from libweasyl.text import markdown, slug_for
from weasyl import (
character, comment, define, folder, journal, macro, profile,
repo... | |
from __future__ import unicode_literals
import base64
import json
import datetime
import mock
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from django.utils import timezone
from ..compat import urlparse, parse_qs, urlencode, get_user_model
from ..models import get_app... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__license__ = 'Public Domain'
import codecs
import io
import os
import random
import sys
from .options import (
parseOpts,
)
from .compat import (
compat_expanduser,
compat_getpass,
compat_shlex_split,
workaro... | |
# Buy in the evening and then sell next day in the morning
#
# Buy again the next day
# repeat
# The idea
# we should buy in 10% increments (tunable) towards the end of the day if the price is going up
# every buy should be around 10 mins apart (tunable)
# Thus we have 10 sales, by eod
# Sell each tr... | |
#!/usr/bin/env python
# encoding: utf-8
import logging
import inspect
import os
import tempfile
import threading
import time
from hashlib import md5
from itertools import izip
import cPickle as pickle
from functools import wraps
import errno
def generate_cache_key(namespace, f, *args, **kwargs):
"""Generates a st... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pprint
import sys
import textwrap
import pytest
from _pytest.main import _in_venv
from _pytest.main import EXIT_NOTESTSCOLLECTED
from _pytest.main import Session
class TestCollector(object):
def t... | |
# Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test import TestCase
from django.conf import settings
from django.test.client import Client, encode_multipart
from django.core.files.uploadedfile import SimpleUploadedFile
from spotseeker_server.models import Spot, SpotI... | |
#!/usr/bin/env python
# http://stackoverflow.com/questions/23046809/filtering-based-on-key-value-in-all-objects-in-array-in-rethinkdb
import rethinkdb as r
from optparse import OptionParser
import json
import sys
def string_or_number(s):
try:
val = int(s)
return val
except ValueError:
... | |
#!/usr/bin/env python
# Copyright 2017 The Kubernetes 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 appli... | |
# Copyright (c) 2015-2019 Volodymyr Shymanskyy. See the file LICENSE for copying permission.
__version__ = "1.0.0"
import struct
import time
import sys
import os
try:
import machine
gettime = lambda: time.ticks_ms()
SOCK_TIMEOUT = 0
except ImportError:
const = lambda x: x
gettime = lambda: int(ti... | |
# 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... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | |
"""
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
from __future__ import unicode_literals
import base64
import binascii
import cgi
import sys
from django.conf import settings
from django.core.exceptions imp... | |
import pytest
import shutil
import os
import numpy as np
import astropy.units as u
import astropy.table as at
from astropy.io import fits
import filecmp
from ....obsobj import obsObj
from .. import isoMeasurer
from .. import polytools
from .... import tabtools
dir_parent = './testing/'
bandline = 'i'
bandconti = '... | |
# 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... | |
'''
Created on Apr 2, 2014
@author: sstober
'''
import os
import logging
log = logging.getLogger(__name__)
import numpy as np
from pylearn2.utils.timing import log_timing
from functools import wraps
import librosa
from deepthought.util.fs_util import load
from deepthought.util.timeseries_util import frame as comp... | |
import json
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from django.conf import settings
from django.shortcuts import render, redirect, get_object_or_404, reverse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.views import generic
f... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Grid Dynamics
# 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/l... | |
"""Tests for the Google Assistant traits."""
from unittest.mock import patch, Mock
import pytest
from homeassistant.components import (
binary_sensor,
camera,
cover,
fan,
input_boolean,
light,
lock,
media_player,
scene,
script,
switch,
vacuum,
group,
)
from homeassi... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
# 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
# d... | |
"""
This applet can be viewed directly on a bokeh-server.
See the README.md file in this directory for instructions on running.
"""
import logging
logging.basicConfig(level=logging.DEBUG)
import lib.bayesian_ab as ab
import numpy as np
from scipy.stats import beta
from bokeh.plotting import segment, line, show, fig... | |
"""The tests for the MQTT light platform.
Configuration for RGB Version with brightness:
light:
platform: mqtt
name: "Office Light RGB"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: "office/rgb1/brightness/status"
brightness_command_topic: "offic... | |
import fpformat
import curses
import glob
from math import sqrt, fsum
class Benchmark(object):
"""
Class to define benchmark environment. Accept a game constructor during init
TODO: create a better organization with curses and benchmark itself separation
"""
benchmark_game = None
def __init_... | |
#!/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.
"""Provides an interface to start and stop Android emulator.
Assumes system environment ANDROID_NDK_ROOT has been set.
Emulat... | |
# Copyright 2019 The MLIR 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 wri... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# coding: utf-8
####################### To Do list ##################################
#TODO remove all methods which involve writing , or the feature part. after pickling the data.
__author__ = 'kobi_luria'
import requests
import json
import objects
import os
import tools
import pickle
################## END_POIN... | |
# PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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... | |
from collections import OrderedDict as odict
from ruamel import yaml
import copy
from .named_item import NamedItem
from .err import FlagAliasNotFound
from . import util
def get_name_for_flags(compiler):
if isinstance(compiler, str):
return compiler
sn = compiler.name_for_flags
if compiler.is_msvc... | |
#!/usr/bin/env python3
"""
ruledxml.core
-------------
Core implementation for application of rules to XML files.
It covers the following steps:
1. Read rules file
2. Retrieve source XML file
3. Do required elements exist?
4. Apply rules
5. Write resulting XML to file
(C) 201... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.webmisc
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for misc. web stuff.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, byg... | |
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | |
import numpy as np
import numpy.matlib as matlib
import random
from math import sin, sqrt
''' Problem Definition'''
def MOP2(x):
n=len(x)
z1=1-np.exp(-np.sum(np.power((x-1/sqrt(n)),2))) #ckeck exp for single
z2=1-np.exp(-np.sum((x+1/sqrt(n))**2))
... | |
import itertools
from datetime import datetime, timedelta
from subprocess import Popen, PIPE
from django.conf import settings
from django.db import connection
import cronjobs
import commonware.log
import waffle
from olympia import amo
from olympia.amo.utils import chunked
from olympia.amo.helpers import user_media_p... | |
# -*- coding: utf-8 -*-
"""
trueskill.mathematics
~~~~~~~~~~~~~~~~~~~~~
This module contains basic mathematics functions and objects for TrueSkill
algorithm. If you have not scipy, this module provides the fallback.
:copyright: (c) 2012-2013 by Heungsub Lee.
:license: BSD, see LICENSE for more... | |
from __future__ import print_function
import os
import time
import numpy as np
import theano
import theano.tensor as T
import lasagne
import matplotlib.pyplot as plt
from tqdm import tqdm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from lasagne.layers import InputLayer, Conv2DLayer, Pool2DLayer
from lasag... | |
"""
Python library for iTOP API
github.com/jonatasbaldin/itopy
"""
import json
import requests
class MyException(Exception):
"""
Handle custom exceptions
"""
pass
class Api(object):
"""
To instanciate an itopy object.
No parameter needed.
"""
def __init__(self, search_keys=None... | |
from threading import Thread
from time import sleep, time
import numpy
from couchbase.bucket import Bucket
from couchbase.n1ql import N1QLQuery
from decorator import decorator
from cbagent.collectors import Latency
from cbagent.collectors.libstats.pool import Pool
from logger import logger
from perfrunner.helpers.mis... | |
import copy
import time
import warnings
from collections import deque
from contextlib import contextmanager
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import utils
from django.db.backends.signals import connect... | |
# Copyright (c) 2009 StudioNow, Inc <patrick@studionow.com>
#
# 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, modi... | |
""" Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Mathieu Blondel <mathieu@mblondel.org>
# Tom Dupre la Tour
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# ... | |
from jedi._compatibility import Python3Method
from jedi.common import unite
from parso.python.tree import ExprStmt, CompFor
from jedi.parser_utils import clean_scope_docstring, get_doc_with_call_signature
class Context(object):
"""
Should be defined, otherwise the API returns empty types.
"""
"""
... | |
#!/usr/bin/env python -OO
# encoding: utf-8
###########
# ORP - Open Robotics Platform
#
# Copyright (c) 2010 John Harrison, William Woodall
#
# 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... | |
import openpnm as op
from openpnm.io import Dict
import py
import os
class DictTest:
def setup_class(self):
ws = op.Workspace()
ws.settings['local_data'] = True
self.net = op.network.Cubic(shape=[2, 2, 2])
Ps = [0, 1, 2, 3]
Ts = self.net.find_neighbor_throats(pores=Ps)
... | |
#!/usr/bin/env python
#
# 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,
# ... | |
# Copyright (C) 2016-present MagicStack Inc. and the EdgeDB authors.
# Copyright (C) 2016-present the asyncpg authors and contributors
#
# 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
#
# ... | |
"""
Copyright (c) 2017, Jose Dolz .All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the f... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime
import numpy as np
import pytest
from pandas.compat import PY37
import pandas as pd
from pandas import (
Categorical, CategoricalIndex, DataFrame, Index, MultiIndex, Series, qcut)
import pandas.util.testing as tm
from pa... | |
import numpy as np
import os
try:
import netCDF4 as netCDF
except:
import netCDF3 as netCDF
import matplotlib.pyplot as plt
import time
from datetime import datetime
from matplotlib.dates import date2num, num2date
import pyroms
import pyroms_toolbox
import _remapping
class nctime(object):
pass
def remap_bdry... | |
# lshash/storage.py
# Copyright 2012 Kay Zhu (a.k.a He Zhu) and contributors (see CONTRIBUTORS.txt)
#
# This module is part of lshash and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import time
import cPickle
try:
import redis
except ImportError:
redis = None
try:
... | |
# Copyright 2019 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 time
import sys
import serial
import os
import time
import datetime
import cwiid
# Button
'''
https://github.com/abstrakraft/cwiid/blob/master/libcwiid/cwiid.h
'''
CWIID_BTN_2 = 0x0001
CWIID_BTN_1 = 0x0002
CWIID_BTN_B = 0x0004
CWIID_BTN_A = 0x0008
CWIID_BTN_MINUS = 0x0010
CWIID_BTN_HOME = 0x0080
CWIID_BT... | |
import os
import time
import random
import re
import copy
import tensorflow as tf
import numpy as np
from utils import *
from data_pipeline import *
class cgan(object):
def __init__(
self,
sess,
epoch,
batch_size,
predicate,
neurons_per_layer... | |
'''
Created on Nov 7, 2011
@author: cryan
'''
import unittest
import numpy as np
from scipy.constants import pi
import matplotlib.pyplot as plt
from PySim.SystemParams import SystemParams
from PySim.PulseSequence import PulseSequence
from PySim.Simulation import simulate_sequence_stack, simulate_sequence
from PyS... | |
# Copyright 2018 PerfKitBenchmarker 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 appli... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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.apach... | |
import warnings
import pytest
import pandas as pd
from pandas import MultiIndex
import pandas.util.testing as tm
def test_dtype_str(indices):
with tm.assert_produces_warning(FutureWarning):
dtype = indices.dtype_str
assert isinstance(dtype, str)
assert dtype == str(indices.dtype)
def test_form... | |
from sympy.core import Basic, S, sympify, Expr, Rational, Symbol
from sympy.core import Add, Mul
from sympy.core.cache import cacheit
from sympy.core.compatibility import cmp_to_key
class Order(Expr):
""" Represents the limiting behavior of some function
The order of a function characterizes the function base... | |
#!/usr/bin/env python
import os
import sys
lib_path = os.path.realpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'lib'))
if lib_path not in sys.path:
sys.path[0:0] = [lib_path]
import utils
import os
import argparse
import processors
import tokenizers
import analyzers
import clusterers
impor... | |
from typing import Dict, Optional, TYPE_CHECKING
from ray.rllib.env import BaseEnv
from ray.rllib.policy import Policy
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.evaluation import MultiAgentEpisode
from ray.rllib.utils.annotations import PublicAPI
from ray.rllib.utils.deprecation import depre... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Card'
db.create_table(u'uppsell_card', (
(u'i... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import IntegrityError, models, transaction, connection
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
class Migration(DataMigration):
def forward... | |
#
# Copyright (c) 2014 Chris Jerdonek. All rights reserved.
#
# 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, modi... | |
import re
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.test import TestCase
import LabtrackerCore.utils as utils
import LabtrackerCore.models as coreModels
from datetime import date, datetime
from south.modelsinspector import... | |
from __future__ import division
# -*- coding: utf-8 -*-
"""
Written by Daniel M. Aukes.
Email: danaukes<at>seas.harvard.edu.
Please see LICENSE.txt for full license.
"""
import popupcad
import numpy
from popupcad.filetypes.popupcad_file import popupCADFile
try:
import itertools.izip as zip
except ImportError:
... | |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Factories that create entities."""
# pylint: disable=too-many-arguments
# pylint: disable=invalid-name
# pylint: disable=redefined-builtin
import copy
import random
import re
from lib.constants import e... | |
# -*- coding: utf-8 -*-
"""
Dynamic DynamoDB
Auto provisioning functionality for Amazon Web Service DynamoDB tables.
APACHE LICENSE 2.0
Copyright 2013-2014 Sebastian Dahlgren
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | |
# Create your views here.
from uuid import uuid4
import logging
import json
import zipfile
import os
import csv
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse, reverse_lazy
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_40... | |
# Copyright 2012 NEC Corporation
#
# 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... | |
# -*- coding: utf-8 -*-
"""A plugin to enable quick triage of Windows Services."""
import yaml
from plaso.analysis import interface
from plaso.analysis import manager
from plaso.lib import event
from plaso.winnt import human_readable_service_enums
class WindowsService(yaml.YAMLObject):
"""Class to represent a Win... | |
import re
import ipaddr
import properties
from security import ACE, AtomicACE, LowlevelACE
from enums import RuleInteractionType, RuleOperation, ServiceProtocol, GraphAttribute, SecurityElement, RuleEffect
from exception import ParserException
def Singleton(cls):
instances = {}
def GetInstance():
if c... | |
#!/usr/bin/env python
"""
A newick/nexus file/string parser based on the ete3.parser.newick. Takes as
input a string or file that contains one or multiple lines that contain
newick strings. Lines that do not contain newick strings are ignored, unless
the #NEXUS is in the header in which case the 'translate' and 'tre... | |
import collections
import glob
import hashlib
import json
import logging
import os
import re
import shutil
import stat
import StringIO
import tempfile
import zipfile
from cStringIO import StringIO as cStringIO
from datetime import datetime
from itertools import groupby
from xml.dom import minidom
from zipfile import B... | |
#!/usr/bin/python
# web service, so return only JSON (no HTML)
from flask import Flask, jsonify, request, url_for, make_response, render_template, send_file
import sqlite3
import interface_db as d
import os.path
import urlparse
import argparse
import textwrap
import functools # need to wrap own decorators to comply ... | |
# 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
# d... | |
# Copyright (c) 2010 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.
"""Generic presubmit checks that can be reused by other presubmit checks."""
### Description checks
def CheckChangeHasTestField(input_api, output_api):... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
import cherrypy
import demjson
from tickets import *
from mailing import sendMail#, sendNewTicketNotifications, sendEditTicketNotifications, sendNewCommentNotifications, sendDeleteNotifications
from postgres import getConnection
from security import *
from urls import setRoutes
from various import *
from webfaction im... | |
# 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, s... | |
# LoPy (MicroPython on ESP32) access to 64-bit timer
import uctypes
# Peripheral map:
# highaddr 4k device
# 3ff0_0 1 dport
# 3ff0_1 1 aes
# 3ff0_2 1 rsa
# 3ff0_3 1 sha
# 3ff0_4 1 secure boot
# 3ff1_0 4 cache mmu table
# 3ff1_f 1 PID controller (per CPU)
# 3ff4_0 1 uart0
# 3ff... | |
import numpy as np
import pyflux as pf
import pandas as pd
data = pd.read_csv('http://www.pyflux.com/notebooks/eastmidlandsderby.csv')
total_goals = pd.DataFrame(data['Forest'] + data['Derby'])
data = total_goals.values.T[0]
def test_poisson_couple_terms():
"""
Tests latent variable list length is correct, an... | |
# Copyright (c) 2016 Clinton Knight
# 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 requir... | |
from basic import *
import parse_tsv
from collections import Counter
from itertools import chain
import sys
def show(tcr):
"For debugging"
if type( tcr[0] ) is str:
return ' '.join(tcr[:3])
else:
return ' '.join( show(x) for x in tcr )
# yes, this is very silly, should just add pandas depe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.