gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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... | |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel, StatusModel, TimeFramedModel, TitleSlugModel
from model_utils.tracker import Field... | |
def init_ephem(orbits, load_path=None, show=False,
parallax_correction=False):
'''Initialize Skyfield ephemeris for Jupiter BSP file
Takes output of io.parse_occ as input.
Requires Astropy and SkyField
Optional:
load_path (where the bsp and SkyField data files are found.
... | |
#! /usr/bin/env python
"""Generate C code from an ASDL description."""
import os, sys
import asdl
TABSIZE = 4
MAX_COL = 80
def get_c_type(name):
"""Return a string for the C name of the type.
This function special cases the default types provided by asdl.
"""
if name in asdl.builtin_types:
... | |
#!/usr/bin/python
"""
Sahana-Eden ADAT helper script
==============================
Script to generate the import files for a new survey template.
The input is a "xls" spreadsheet with four sheets, namely:
* Template
* Sections
* Questions
* Layout
The output is two csv files o... | |
import os
import sys
import time
import pickle
import threading
import traceback
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))
from simple_host_target.client impor... | |
# Copyright 2010-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... | |
import os.path
import sys
try:
this_file_name = __file__
except NameError:
# stupid jython. plain old __file__ isnt working for some reason
import test_runfiles #@UnresolvedImport - importing the module itself
this_file_name = test_runfiles.__file__
desired_runfiles_path = os.path.normpath(os.pat... | |
"""
Properties of the Point Spread Function
=======================================
This script can be used to plot some PSF properties such as ellipticity and size as a function of the focal plane position.
:requires: PyFITS
:requires: NumPy
:requires: SciPy
:requires: matplotlib
:requires: VISsim-Python
:author: S... | |
# Copyright (c) 2019 Rackspace US, 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... | |
#------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Copyright (C) 2008-2012, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
import re
from ... | |
#
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
# Copyright 2015 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 module for storing and getting objects from datastore.
This module provides Get, Set and Delete functions for storing pickleable
objects in datastore, ... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
import logging
import requests
import simplejson
from time import sleep
API_URL = "https://home.nest.com"
CAMERA_WEBAPI_BASE = "https://webapi.camera.home.nest.com"
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) " \
"AppleWebKit/537.36 (KHTML, like Gecko) " \
"Chrome/75.0.377... | |
#!/usr/bin/env python
from __future__ import division
# NOTE: optparse deprecated in python3, but still supported
from optparse import OptionParser
import math
import sys
import numpy
import random
import time
import os
def read_cmd():
"""Function for reading command line options. Returns tuple options, args."""
... | |
# Hidden Markov Models
#
# Author: Ron Weiss <ronweiss@gmail.com>
# and Shiqiao Du <lucidfrontier.45@gmail.com>
# API changes: Jaques Grobler <jaquesgrobler@gmail.com>
# Modifications to create of the HMMLearn module: Gael Varoquaux
"""
The :mod:`hmmlearn.hmm` module implements hidden Markov models.
"""
import string... | |
"""Ginkgo service core
This module implements the core service model and several convenience
decorators to use with your services. The primary export of this module is
`Service`, but much of the implementation is in `BasicService`. `BasicService`
uses a simple state machine defined by `ServiceStateMachine` and impleme... | |
# stdlib
from collections import defaultdict, namedtuple
import time
import urlparse
# 3p
import requests
# project
from checks import AgentCheck
from config import _is_affirmative
from util import headers
class NodeNotFound(Exception):
pass
ESInstanceConfig = namedtuple(
'ESInstanceConfig', [
'ps... | |
# 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... | |
# class analyzer
# analyze a text returning some stats and Most_Freq_Words
import nltk
import string
import numpy
import re
from nltk.stem.porter import *
from nltk.corpus import stopwords
from nltk import wordpunct_tokenize
from nltk.stem.snowball import SnowballStemmer
from nltk.stem.wordnet import WordNetLemmatize... | |
from __future__ import division, absolute_import, print_function
__all__ = ['memmap']
import warnings
import sys
import numpy as np
from .numeric import uint8, ndarray, dtype
from numpy.compat import long, basestring
dtypedescr = dtype
valid_filemodes = ["r", "c", "r+", "w+"]
writeable_filemodes = ["r+", "w+"]
mod... | |
from contextlib import contextmanager
from jinja2 import Undefined
from werkzeug.local import LocalProxy
from werkzeug.local import LocalStack
from lektor.reporter import reporter
_ctx_stack = LocalStack()
def url_to(*args, **kwargs):
"""Calculates a URL to another record."""
ctx = get_ctx()
if ctx is... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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.... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_asm_policy_signat... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | |
"""
Attempt to scape AIM25's Wiener Library material.
"""
import os
import re
import sys
import json
import httplib2
import urllib
import codecs
import babel
from django.core.management.base import BaseCommand, CommandError
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
BASEURL = "http://www.aim25.ac... | |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | |
from typing import Dict, List
import textwrap
from keras.layers import Input
from overrides import overrides
import numpy
from ...data.instances.multiple_choice_qa import TupleInferenceInstance
from ...layers import NoisyOr
from ...layers.attention import MaskedSoftmax
from ...layers.backend import RepeatLike
from ..... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | |
#!/usr/bin/python
import serial
import time
import sys
from simulator import *
class Display(object):
'''
Driver for the Hanover display.
Currently, this driver only works with resolution of 128x16, at address 1
This limitation must be changed in a future version.
'''
def __init__(self, serial... | |
"""
solve the diffusion equation:
phi_t = k phi_{xx}
with a Crank-Nicolson implicit discretization
M. Zingale (2013-04-03)
"""
import numpy
from scipy import linalg
import sys
import pylab
import diffimplicit
def diffuseCN(gr, phi, k, dt):
""" diffuse phi implicitly through timestep dt, with a C-N
te... | |
# Copyright (c) 2017 Intel 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 agreed to i... | |
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | |
"""Functions to construct sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag']
import numpy as np
from sc... | |
#!/usr/bin/env python
"""Functions for audit and logging."""
import logging
from logging import handlers
import os
import socket
import time
from grr.lib import config_lib
from grr.lib import flags
# Global Application Logger.
LOGGER = None
class GrrApplicationLogger(object):
"""The GRR application logger.
... | |
# 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... | |
# coding: utf-8
import os
import numpy as np
from astropy.table import Table, vstack
from astropy.io import fits
import multiprocessing
nproc = multiprocessing.cpu_count() // 2
from desispec.io.util import write_bintable
from desitarget.cuts import isBGS_bright, isBGS_faint
from desiutil.log import get_logger, DEBUG
... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# Copyright (c) 2010 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | |
#!/usr/bin/env python3
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
Script to generate a linker script organizing application memory partitions
Applications may declare build-time memory domain partitions with
K_APPMEM_PARTITION_DEFINE, and assign globals to them using K_APP_DM... | |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... | |
"""SCons.Tool.icl
Tool-specific initialization for the Intel C/C++ compiler.
Supports Linux and Windows compilers, v7 and up.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission ... | |
# -*- coding: utf-8 -*-
"""
github3.api
~~~~~~~~~~~
This module provies the core GitHub3 API interface.
"""
from urlparse import urlparse, parse_qs
import requests
from decorator import decorator
from .packages import omnijson as json
from .packages.link_header import parse_link_value
from .models import *
from .... | |
from rest_framework import serializers
import amo
from addons.models import Category, Preview
from amo.helpers import absolutify
from amo.urlresolvers import reverse
from amo.utils import find_language
from constants.applications import DEVICE_TYPES
from versions.models import Version
import mkt
from mkt.api.fields i... | |
import numpy as np
from itertools import cycle
from model import *
from scaletracker import ScaleTracker
from flask import session
# Global variables
EXPONENTS = {1: 0.5, 2: 0.87, 3: 1.25, 4: 1.62, 5: 1.8, 6: 2}
PRE_DEFINED_PARTS = set(['bass', 'synth_pad', 'synth_pluck'])
class Sequencer(object):
"""Abstract ... | |
# -*- coding: utf-8 -*-
"""
logbook._fallback
~~~~~~~~~~~~~~~~~
Fallback implementations in case speedups is not around.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
from itertools import count
from logbook.helpers import get_iterator_next_... | |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
# Copyright 2014 OneConvergence, 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 requir... | |
# Copyright (C) 2015 Yahoo! 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Reading register value from the inferior, and provides a
standardized interface to registers like "sp" and "pc".
"""
import collections
import ctypes
import re
import sys
from types import ModuleType
import gdb
import pwndbg.arch
import pwndbg.events
import pwndbg.mem... | |
# -*- Mode: Python; tab-width: 4 -*-
# Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission... | |
from django.contrib.auth.models import Permission
from django.test import TestCase
from django.urls import reverse
from wagtail.admin.admin_url_finder import AdminURLFinder
from wagtail.core.models import Page, Site
from wagtail.tests.utils import WagtailTestUtils
class TestSiteIndexView(TestCase, WagtailTestUtils):... | |
"""Required models to handle and store generated reports."""
import base64
import pickle
from datetime import date
from decimal import Decimal, getcontext
from timeit import default_timer as timer
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.db import mo... | |
__author__ = "George Chantzialexiou"
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
import sys
import os
import radical.pilot as rp
import time
import copy
import numpy as np
SHARED_INPUT_FILE = 'dataset.in'
MY_STAGING_AREA = 'staging:///'
""" DESCRIPTION: k-means
For every ta... | |
import logging
import re
import warnings
from urllib import urlencode
from django.template import Context
from django.template.loader import get_template
from monocle.cache import cache
from monocle.resources import Resource
from monocle.settings import settings
from monocle.tasks import request_external_oembed
from... | |
##
# @filename : epd7in5.py
# @brief : Implements for Dual-color e-paper library
# @author : Yehui from Waveshare
#
# Copyright (C) Waveshare July 10 2017
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation fil... | |
#
# File : mkdir.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
#
# 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 2 of th... | |
import pytest
import logging
import os
import subprocess
from distutils.version import LooseVersion
from cassandra import ConsistencyLevel
from ccmlib.common import is_win
from ccmlib.node import handle_external_tool_process, ToolError
import ccmlib.repository
from dtest import Tester, create_ks, create_cf
from tool... | |
#Reeve D'Cunha AS91367 version 0.6
import tkinter as tk
import string, random
#from PIL import ImageTk, Image
class MainApp:
def __init__(self, master):
self.defaultbg = root.cget('bg')
self.master = master #Creates Frames
photo = tk.PhotoImage(file="icon.gif")
self.masterImage = tk.Label(master,... | |
from django import forms
from django.utils.safestring import mark_safe
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.db.models import Max, Min
from winthrop.books.models import Book
## Disabled input logic borrowed... | |
import unittest
from prototype import prototype, PrototypeException, PrototypeSwitcher
class BaseClass(object):
def __init__(self, base_list):
print "in base ctr"
self.base_list = base_list
self.base_test = True
self.base_list.append('init')
def __getattr__(self, name):
... | |
# -*- coding: utf-8 -*-
"""UI for baking crowd simulations to individual RSProxies and creating
necessary nodes to be able to render them
"""
import hou
def create_bake_setup():
"""creates the necessary nodes to bake the crowd to RSProxies"""
nodes = hou.selectedNodes()
if not nodes:
raise Runti... | |
# -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2005-2010 Slide, 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 copyrig... | |
# 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 ... | |
# 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... | |
# Copyright 2015, Rackspace US, 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 w... | |
# Copyright (c) 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 agreed to... | |
__author__ = 'greg'
import re
import os
import zipfile
import math
import csv
import json
import numpy
import tarfile
import rollbar
class CsvOut:
def __init__(self,project):
print type(project)
# assert isinstance(project,aggregation_api.AggregationAPI)
self.project = project
sel... | |
"""Support for Eight Sleep sensors."""
from __future__ import annotations
import logging
from typing import Any
from pyeight.eight import EightSleep
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.core import HomeAs... | |
# -*- coding: utf-8 -*-
"""Module providing views for a contentpage section"""
from AccessControl import Unauthorized
from Acquisition import aq_inner
from Acquisition import aq_parent
from plone import api
from plone.api.exc import InvalidParameterError
from plone.protect.utils import addTokenToUrl
from Products.CMFPl... | |
#!/usr/bin/env python
"""A class for handling 5C read data."""
import os
import sys
import numpy
import h5py
try:
import pysam
except:
pass
class FiveCData(object):
"""
This class handles interaction count data for 5C experiments.
The FiveCData class contains all of the interaction informati... | |
import copy
from hearthbreaker.tags.base import Status, Action, Aura, Condition, AuraUntil, CardQuery, \
CARD_SOURCE, Effect, Buff, BuffUntil, Amount, Picker, Selector
from hearthbreaker.tags.condition import IsSecret
from hearthbreaker.tags.selector import AllPicker, ConstantSelector
class Give(Action):
def ... | |
#!/usr/bin/env python
"""This file contains utility functions used in ApiCallHandler classes."""
import cStringIO
import itertools
import os
import re
import sys
import zipfile
import yaml
import logging
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib import utils
from grr.lib.flows.general im... | |
#!/usr/bin/env python3
# Written by John Hoffman
# see LICENSE.txt for license information
DOWNLOAD_SCROLL_RATE = 1
import sys
import os
import time
import signal
import threading
from BitTornado.Client.launchmanycore import LaunchMany
from BitTornado.Client.download_bt1 import defaults, get_usage
from BitTornado.Ap... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
use 2nd order friedmann equations + the continuity equation
numerically integrate the cosmological equations for standard cosmology where
omega = 1 for matter universe
also
omega = 1 30% matter, 70% dark energy
luminosity distance plots
https://arxiv.org/pdf/astro-ph/9... | |
# 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... | |
#! /usr/bin/env python
"""
Module with cube cosmetic functions for SDI datasets.
"""
from __future__ import division
from __future__ import print_function
__author__ = 'V. Christiaens @ UChile/ULg, C. Gomez @ ULg'
__all__ = ['cube_correct_nan',
'approx_stellar_position']
import copy
import numpy as np
fr... | |
#!/usr/bin/env python
# encoding: utf-8
#
# 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 Licens... | |
"""
Reference-physical domain mappings.
"""
import numpy as nm
from sfepy.base.base import Struct
class PhysicalQPs(Struct):
"""
Physical quadrature points in a region.
"""
def __init__(self, num=0):
Struct.__init__(self, num=num, shape=(0, 0, 0))
self.values = nm.empty(self.shape, dt... | |
# 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 ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script to train a neural networks for NLP tagging tasks.
Author: Erick Rocha Fonseca
"""
import logging
import numpy as np
import nlpnet.config as config
import nlpnet.utils as utils
import nlpnet.taggers as taggers
import nlpnet.metadata as metadata
import nlpnet.s... | |
# 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... | |
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | |
# Copyright 2015 Cisco Systems, 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 requir... | |
"""
SoftLayer.tests.api_tests
~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import mock
import SoftLayer
import SoftLayer.API
from SoftLayer import testing
from SoftLayer import transports
class Inititialization(testing.TestCase):
def test_init(self):
client = So... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | |
# Copyright (c) 2014 Rackspace, 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 wr... | |
#!/usr/bin/env python
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | |
# Copyright 2015 Dell 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... | |
# (C) Copyright 2010 Bewype <http://www.bewype.org>
# sqlite3 import
from sqlite3 import Cursor as sqli3_cursor
from MySQLdb.cursors import Cursor as mysql_cursor
class ExecuteError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class I... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Justin Santa Barbara
# 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... | |
"""Test module for enumerated types under PyTables."""
import itertools
import operator
import tables as tb
from tables.tests import common
class CreateColTestCase(common.PyTablesTestCase):
"""Test creating enumerated column descriptions."""
def _createCol(self, enum, dflt, base='uint32', shape=()):
... | |
# 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... | |
from __future__ import unicode_literals
from reviewboard.webapi.tests.mixins import test_template
from reviewboard.webapi.tests.mixins_extra_data import (ExtraDataItemMixin,
ExtraDataListMixin)
class ReviewListMixin(ExtraDataListMixin):
@test_template
d... | |
import jwt, base64, json
from collections import namedtuple
from werkzeug.exceptions import InternalServerError
from flask_restful import reqparse, request, Resource, abort
from functools import wraps
from time import sleep
from jenova.models import UserSchema, Scope
from jenova.components import Security, InvalidCred... | |
# Copyright 2010 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... | |
import argparse
import json
from pathlib import Path
from typing import Iterator, List, Dict
from shutil import copyfile
import pytest
import torch
from flaky import flaky
from allennlp.commands.evaluate import evaluate_from_args, Evaluate
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.data_lo... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written by Ulrich Germann on the basis of contrib/server/client.py.
# This script simulates post-editing of MT output and incrementally
# updates the dynamic phrase tables in the moses server.
import xmlrpclib,datetime,argparse,sys,os,time
import moses
from moses import... | |
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import timezone
from .models import (
Comment,
Rating,
)
from administration.models import (
Application,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.