gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# ocean
import json
import random
import os
import time
from datetime import datetime
from itertools import chain
from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.http import JsonResponse
import django_filters.rest_framework
from django.core.cache... | |
import numpy as np
import dask
import dask.array as dsa
from dask.base import tokenize, normalize_token
import xarray as xr
import warnings
from .duck_array_ops import concatenate
from .shrunk_index import all_index_data
def _get_grid_metadata():
# keep this separate from get_var_metadata
# because grid stuff... | |
import pytest
from pytestqt.qt_compat import qt_api
from pytestqt import modeltest
pytestmark = pytest.mark.usefixtures("qtbot")
class BasicModel(qt_api.QtCore.QAbstractItemModel):
def data(self, index, role=qt_api.QtCore.Qt.DisplayRole):
return None
def rowCount(self, parent=qt_api.QtCore.QModelIn... | |
# Copyright (c) 2010-2012 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 law or agree... | |
#!/usr/bin/env python
############################################################################
#
# Copyright (c) 2013, 2014 PX4 Development Team. 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 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import print_function
from __future__ import absolute_import
import warnings
import sys
sys.path.append('/home/cbritt2/keras/build... | |
import jsonschema
from django.utils import timezone
from rest_framework import serializers as ser
from rest_framework import exceptions
from addons.twofactor.models import UserSettings as TwoFactorUserSettings
from api.base.exceptions import InvalidModelValueError, Conflict
from api.base.serializers import (
BaseA... | |
#!/home/mpvoss/PycharmProjects/PyDemo/env/bin/python
"""PILdriver, an image-processing calculator using PIL.
An instance of class PILDriver is essentially a software stack machine
(Polish-notation interpreter) for sequencing PIL image
transformations. The state of the instance is the interpreter stack.
The only meth... | |
#!/usr/bin/env python
import os
import tempfile
import unittest
import time
import math
import re
import platform
import uuid
import pwd
import signal
from functools import partial
from multiprocessing import Process, Event
from ast import literal_eval
import psutil
from thrift.protocol import TBinaryProtocol
... | |
import synapseclient
from synapseclient import File, Project, Folder, Table, Schema, Link, Wiki, Entity, Activity
from synapseclient.core.cache import Cache
from synapseclient.core.exceptions import SynapseHTTPError
from synapseclient.core.constants.limits import MAX_FILE_HANDLE_PER_COPY_REQUEST
import re
import json
i... | |
#!/usr/bin/env python
"""
Do windowed detection by classifying a number of images/crops at once,
optionally using the selective search window proposal method.
This implementation follows
Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik.
Rich feature hierarchies for accurate object detection and semantic... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Validate VO Services."""
from __future__ import absolute_import, division, print_function, unicode_literals
from ...extern import six
# STDLIB
import multiprocessing
import os
import warnings
# LOCAL
from .exceptions import ValidationMultiprocessingEr... | |
"""
@package mi.instrument.um.thsph.thsph.driver
@file marine-integrations/mi/instrument/um/thsph/thsph/driver.py
@author Richard Han
@brief Driver for the thsph
Release notes:
Vent Chemistry Instrument Driver
"""
import re
import time
from mi.core.exceptions import InstrumentException
from mi.core.driver_scheduler... | |
'''
MFEM example 17
How to run:
python <arguments>
Example of arguments:
ex17.py -m beam-tri.mesh
ex17.py -m beam-quad.mesh
ex17.py -m beam-tet.mesh
ex17.py -m beam-hex.mesh
ex17.py -m beam-quad.mesh -r 2 -o 3
ex17.py -m beam-quad.mesh -r 2 -o 2 -a 1 -k 1
... | |
# -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# 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, thi... | |
from tweet_preprocess import load_df
from textblob import TextBlob
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import cartopy
# set graph display options
pd.set_option('display.max_colwidth', 200)
pd.options.display.mpl_style = 'default'
matplotlib.s... | |
# Lint as: python2, python3
# Copyright 2020 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
#
... | |
import nose
import unittest
from soap.datatype import auto_type, int_type, float_type, IntegerArrayType
from soap.expression import expression_factory, operators, Variable, Subscript
from soap.semantics import IntegerInterval, ErrorSemantics
from soap.program.flow import (
AssignFlow, IfFlow, WhileFlow, ForFlow, C... | |
# Copyright (c) 2010-2013 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
# -----------------------------------------------------------------------
# Standalone and testing code
from ctypes import *
try:
import _idaapi
except:
print("Please try me from inside IDA")
sys.exit(0)
try:
import pywraps
pywraps_there = True
print("Choose2: using pywraps")
_idaapi.choo... | |
"""
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | |
#!/usr/bin/env python
""" Copy mongo data to psql by using two strategies:
1. Do initial load - copy data using trunk&load process, which rewriting
destination data every time.
2. If mongodb oplog - 'operational log' is enabled - patch psql data by oplog
operations, so it's should not overwrite dest data. If initial l... | |
import clingo
import yaml
import threading
import os
class WrappedPropagateControl(object):
def __init__(self, control, calls):
self.control = control
self.calls = calls
def add_literal(self):
call = {}
call["name"] = "add_literal"
call["args"] = []
self.calls.a... | |
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from mmdet.models.builder import HEADS, build_loss
@HEADS.register_module()
class GridHead(BaseModule):
def __i... | |
# Copyright (c) 2017 Dell Inc. or its subsidiaries.
# 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
#
# ... | |
'''
Helper to track integer operations.
>>> track(5) * 2 - 3
7
>>> (track(5) * 2 - 3).operations
sub(lhs=mul(lhs=5, rhs=2), rhs=3)
>>> expression((track(5) * 2 - 3).operations)
'((5 * 2) - 3)'
'''
import operator
import unittest
import sys
from collections import namedtuple
from decimal import Decimal
from functools ... | |
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# 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 lim... | |
'''Deep Dreaming in Keras.
Run the script with:
```
python deep_dream.py path_to_your_base_image.jpg prefix_for_results
```
e.g.:
```
python deep_dream.py img/mypic.jpg results/dream
```
It is preferrable to run this script on GPU, for speed.
If running on CPU, prefer the TensorFlow backend (much faster).
Example re... | |
#!/usr/bin/env python2
"""Command line utility for querying the Logitech Harmony."""
import argparse
import logging
import json
import sys
from harmony import auth
from harmony import client as harmony_client
LOGGER = logging.getLogger(__name__)
def login_to_logitech(args):
"""Logs in to the Logitech service.
... | |
from abc import ABC
from typing import Any
from toil.job import Promise
class WDLRuntimeError(RuntimeError):
pass
class WDLType:
"""
Represents a primitive or compound WDL type:
https://github.com/openwdl/wdl/blob/main/versions/development/SPEC.md#types
"""
def __init__(self, optional: bo... | |
"""Test the Home Assistant local auth provider."""
import asyncio
from unittest.mock import Mock, patch
import pytest
import voluptuous as vol
from homeassistant import data_entry_flow
from homeassistant.auth import auth_manager_from_config, auth_store
from homeassistant.auth.providers import (
auth_provider_from... | |
import json
import inspect
import numpy as np
import pandas as pd
from sklearn.preprocessing import binarize
from abc import abstractmethod, ABC, ABCMeta
# imports from gpmap dependency
from gpmap.gpm import GenotypePhenotypeMap
# Local imports
from epistasis.mapping import EpistasisMap, encoding_to_sites
from epist... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Beat and tempo
==============
.. autosummary::
:toctree: generated/
beat_track
estimate_tempo
"""
import numpy as np
import scipy
from . import cache
from . import core
from . import onset
from . import util
from .util.exceptions import ParameterError
__all... | |
# 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... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
"""Simplify, correct, and consolidate network topology."""
import logging as lg
import geopandas as gpd
import networkx as nx
from shapely.geometry import LineString
from shapely.geometry import MultiPolygon
from shapely.geometry import Point
from shapely.geometry import Polygon
from . import stats
from . import uti... | |
# coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "Lic... | |
#!/usr/bin/env python3
import os
import sys
import socket
import time
try:
from urllib.parse import urlparse # Python 3
except ImportError:
from urlparse import urlparse # Python 2
import posixpath
import json
from hashlib import sha1
from base64 import b64encode
import requests
import classad
TOKEN_DIR_ENV... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Versio... | |
import os
from math import sqrt
import numpy as np
import scipy.optimize
from scipy.stats import chi2
import matplotlib
matplotlib.use('Agg')
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 15})
matplotlib.rc('text', usetex=True)
import matplotlib.pyplot as plt
from enrico import utils... | |
import requests
from icalendar import Calendar, Event
import icalendar
import pytz
import sys
import datetime
from lxml import html
import getpass
class Course:
name = ""
code = ""
sections = []
def __init__(self, n, c):
self.name = n
self.code = c
self.sections = []
class Section:
name =""
location = ""... | |
"""
LICENCE
-------
Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
Object for handling signal overrides and managing what signals have been seen
since override.
... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import ast
import datetime
import logging
import os
import re
import socket
import time
# We can remove ExpatError when we drop support for Python 2.6:
from xml.parsers.expat import ExpatError
from tornado import gen, htt... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation.
# Copyright 2013 NTT corp.
# 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
... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme 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 ... | |
import os
import os.path as op
import warnings
import gc
from nose.tools import assert_true, assert_raises
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
from mne.datasets import testing
from mne import (read_forwa... | |
# pylint: disable=too-many-instance-attributes,attribute-defined-outside-init
"""
account.py
==========
Account related functions.
"""
from __future__ import absolute_import
import inspect
import re
import sys
import time
from PyQt4 import QtGui
import queues
from addresses import decodeAddress
from bmconfigparse... | |
# -*- 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 'Post.soundcloud_id'
db.add_column('blogs_post', 'soundcloud_id',
self.... | |
# Copyright (c) 2015 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 copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | |
import pandas as pd
import glob
import os
import numpy as np
import gc
import logging
import mne
logger = logging.getLogger('__SignalManager__')
"""Utility that acts as a wrapper around the Python Pandas package, which is useful for handling time series data efficiently.
In particular, the management tool helps ... | |
from __future__ import unicode_literals
import copy
import datetime
from django.db import models
from django.utils.functional import curry
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from audit_log.models.fields import LastUserField
from audit_log import settings as local_... | |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import re
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from django.utils import six
import h... | |
# Author: Nicolas Boulanger-Lewandowski
# University of Montreal (2012)
# RNN-RBM deep learning tutorial
# More information at http://deeplearning.net/tutorial/rnnrbm.html
import glob
import os
import sys
import numpy
try:
import pylab
except ImportError:
print (
"pylab isn't available. If you use its... | |
import sys
import mosek.array
from mosek import array
#import numpy
import operator
import random
import new
class AbstractMethodError(Exception): pass
def is_basestring(s):
return isinstance(s,basestring)
class PrintTrace:
def __enter__(self):
return self
def __exit__(self,exc_type,exc_value,tb):
if ... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
import urllib
import json
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.forms.util import ErrorLis... | |
# encoding: utf-8
"""Gherkin step implementations for chart axis features."""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from behave import given, then, when
from pptx import Presentation
from pptx.enum.chart import XL_AXIS_CROSSES, XL_CATEGORY_TYPE
from helpers impo... | |
from django import forms
from django.utils.safestring import mark_safe
from django.forms import TextInput
from datetimewidget.widgets import DateWidget
from .models import Pledge, FollowUp, Contribution, BulkPayment
from contacts.models import Person
class PledgeForm(forms.ModelForm):
person = forms.ModelChoic... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('academic... | |
##
# Copyright (c) 2007-2017 Apple 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 l... | |
# ----- Copyright (c) 2014 Datacratic. All rights reserved.
"""
This module extends tornados handler classes implementing GET and POST
requests to respond to BID requests
A basic openRtb class helps to interpret requests and prepare responses
Tornado request handlers are extended to handle openRtb, and a
FixedPriceBi... | |
# coding: utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _
# http://www.unece.org/cefact/locode/service/location.html
COUNTRIES = (
('AF', _('Afghanistan')),
('AL', _('Albania')),
('DZ', _('Algeria')),
('AS', _('American Samoa')),
('AD', _('Andorra')),
... | |
# 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... | |
import ael
import acm
import HTI_FeedTrade_EDD_Util
import HTI_Util
import HTI_Email_Util
import os
import sys, traceback
COL_PRODUCT_ID = 0
COL_INS_TYP = 1
COL_UND_INS = 2
COL_PORTFOLIO_ID = 3
COL_PORTFOLIO_CCY = 4
COL_WAY = 5
COL_CP = 6
COL_QTY = 7
COL_PRICE = 8
COL_MKTV = 9
COL_NTRADE = 10
COL_UPLD = 11
COL_UPLM = ... | |
#-*- coding:utf-8-*-
#author:cd
import wx
import pyHook
import pythoncom
import time
import win32api
import win32con
import threading
import pickle
from wx.lib.embeddedimage import PyEmbeddedImage
from wx.lib.wordwrap import wordwrap
figurefree = PyEmbeddedImage(
"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAA3... | |
#!/usr/bin/env python
# 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 r... | |
"""
Django settings for kaistusc project.
Generated by 'django-admin startproject' using Django 1.10.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... | |
from .trainer import Trainer
import numpy as np
import torch
from torch.autograd import Variable
class WassersteinGanTrainer(Trainer):
"""
Args:
network (nn.Module): the network to train
latent_dimension (tuple): A tuple that defines the shape of the latent
dimension (noise) that i... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set ts=2 sw=2 noet:
'''Various string representations of trees.'''
import pstree, parse_errors
def text_words(tree, show_traces=False):
'''Print just the words in the tree.'''
text = []
for node in tree:
if node.is_terminal():
if node.is_trace() and not sho... | |
#
# 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... | |
import collections
import os
import sys
import numpy
try:
from PIL import Image
available = True
except ImportError as e:
available = False
_import_error = e
import chainer
from chainer.dataset.convert import concat_examples
from chainer.dataset import download
from chainer import function
from chaine... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors,
# The HuggingFace Inc. team, and The XTREME Benchmark Authors.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... | |
from __future__ import print_function, division
import numpy as np
from numpy.testing import (run_module_suite, assert_array_almost_equal_nulp,
assert_almost_equal, assert_array_equal,
assert_raises, assert_)
import warnings
from skimage.restoration import unwrap_... | |
## @file GenDecFile.py
#
# This file contained the logical of transfer package object to DEC files.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies t... | |
#!/usr/bin/env python
from __future__ import print_function
import sys
from datetime import datetime
import time
import array
import struct
import os
import codecs
import dpansf
if sys.version_info[0] < 3:
input = raw_input
class Bye(Exception):
pass
def collect_screenshot(dest, ser):
import Image
... | |
#!/usr/bin/env python
import errno
import hashlib
import fnmatch
import os
import platform
import re
import repo
import subprocess
import sys
from lldbbuild import *
#### SETTINGS ####
def LLVM_HASH_INCLUDES_DIFFS():
return False
# For use with Xcode-style builds
def process_vcs(vcs):
return {
"sv... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import numpy as np
from numpy.testing import assert_almost_equal
from numpy.testing import assert_allclose
from scipy.optimize import newton
from scipy.special import logit
from sklearn.utils import assert_all_finite
from sklearn.utils.fixes import sp_version, parse_version
import pytest
from sklearn.ensemble._hist_gr... | |
# -*- coding: utf-8
# 'version': '0.3'
#
# Copyright (c) 2017, Stephen B, Hope, All rights reserved.
#
# CommAI-env Copyright (c) 2016-present, Facebook, Inc., All rights reserved.
# Round1 Copyright (c) 2017-present, GoodAI All rights reserved.
#
# This source code is licensed under the BSD-style license found in the... | |
from collections import OrderedDict
import hashlib
import uuid
from base64 import b64encode, b64decode
from datetime import datetime, date, time
from speaklater import _LazyString
from werkzeug.http import http_date, parse_date
from flask import Markup, json
from flask._compat import iteritems, text_type
from flask.deb... | |
import base64
import json
import os
import responses
import pytest
import mapbox
import mapbox.services.uploads
username = 'rsbaumann'
access_token = unicode(os.environ['MAPBOX_ACCESS_TOKEN'])
upload_response_body = """
{{"progress": 0,
"modified": "date.test",
"error": null,
"tileset": "{username}.t... | |
import pytest
from mock import MagicMock
from requests import Timeout
from scrapyd_api.compat import StringIO
from scrapyd_api.constants import (
ADD_VERSION_ENDPOINT,
CANCEL_ENDPOINT,
FINISHED,
PENDING
)
from scrapyd_api.wrapper import ScrapydAPI
HOST_URL = 'http://localhost'
AUTH = ('username', 'pas... | |
# 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 logging
impor... | |
#!/usr/bin/python
"""
PlotContours.py
Plot individual contour plots of discrimination significance
for a given ensemble and DM mass...
BJK 30/06/2017
"""
import numpy as np
from numpy import pi
from scipy.integrate import quad
from scipy.interpolate import interp1d, interp2d
from scipy import ndimage
from matplotlib... | |
################################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
A module for the binomial distribution node
"""
import numpy as n... | |
from django.conf import settings
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Permission
from grid.models import Grid, Element, Feature, GridPackage
from package.models import Package
from grid.tests import data
class FunctionalGridTest(T... | |
# Copyright 2013 Nicira, 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 -*-
"""SQLite parser plugin for Google Chrome history database files."""
from dfdatetime import posix_time as dfdatetime_posix_time
from dfdatetime import webkit_time as dfdatetime_webkit_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import defini... | |
#!/usr/bin/python2
from __future__ import print_function
from argparse import ArgumentParser
import code
import socket
from subprocess import check_call, check_output, STDOUT, call
from time import time, sleep
import re
import json
from threading import Thread
import sys
import traceback
machines = [pool + str(i)
... | |
# Copyright 2012 Nebula, 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 agree... | |
# Chicago Tribune News Applications fabfile
# No copying allowed
from fabric.api import *
"""
Base configuration
"""
#name of the deployed site if different from the name of the project
env.site_name = 'boundaries'
env.project_name = 'boundaries'
env.database_password = ''
env.site_media_prefix = "site_media"
env.ad... | |
# -*- coding: utf-8 -*-
"""
Evacuees Registry
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
s3db.set_method("pr", "group",
method = "add_members",
action = s3db.evr_AddG... | |
#!/usr/bin/env python
# @license
# Copyright 2020 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 applicab... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Includes the Schedule class, validation functions, and compilation functions
for compiling a schedule of files to process.
Methods:
compile: shortcut for validating the loaded configuration, then
performing the search, and _resolve functions
load: load ... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
from decimal import Decimal
from django.core.cache import cache
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils import unittest
from rest_framework import status, permissions
from rest_framework.compat import yaml, etree, patterns, url, include
from rest_framework.respon... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.