gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#---------------------------------------------------------------------------
# Copyright 2013 PwC
#
# 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/LICENS... | |
# 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... | |
"""IVR-based menuing system with retry, exit, and similar useful features
You use the menuing system by instantiating Interaction and Option sub-classes
as a tree of options that make up an IVR menu. Calling the top-level menu
produces a Deferred that fires with a list of [(Option,value),...] pairs,
where Option is ... | |
"""
This module implements ipython_display
A function to embed images/videos/audio in the IPython Notebook
"""
# Notes:
# All media are physically embedded in the IPython Notebook
# (instead of simple links to the original files)
# That is because most browsers use a cache system and they won't
# properly refresh the ... | |
# START GENERATED CODE FOR ESCAPERS.
from __future__ import unicode_literals
import re
import urllib
try:
str = unicode
except NameError:
pass
def escape_uri_helper(v):
return urllib.quote(str(v), '')
_ESCAPE_MAP_FOR_ESCAPE_HTML__AND__NORMALIZE_HTML__AND__ESCAPE_HTML_NOSPACE__AND__NORMALIZE_HTML_NOSPACE = {
... | |
# Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... | |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Bob Callaway. 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 ... | |
import sys
from overrides import overrides
from keras import backend as K
from keras.engine import InputSpec, Layer
from keras.layers import LSTM, Dense
class NSE(Layer):
'''
Simple Neural Semantic Encoder.
'''
def __init__(self, output_dim, input_length=None, composer_activation='linear',
... | |
"""
Kolibri Webpack hooks
---------------------
To manage assets, we use the webpack format. In order to have assets bundled in,
you should put them in ``yourapp/assets/src``.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import codecs
import ... | |
import numpy as np
from astropy.table import Table
from astropy.io import fits
import matplotlib.pyplot as plt
import matplotlib
import pickle
from matplotlib import cm
from numpy.random import randn
# table path
path = "/Users/caojunzhi/Downloads/upload_20170330/red_clump_dr13.fits"
star = fits.open(path)
table =... | |
"""Base Command class, and related routines"""
from __future__ import absolute_import, print_function
import logging
import logging.config
import optparse
import os
import platform
import sys
import traceback
from pipenv.patched.notpip._internal.cli import cmdoptions
from pipenv.patched.notpip._internal.cli.command_... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM 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
#
# http://www.apache.org/licenses/LIC... | |
from io import StringIO
import types
import re
from contextlib import contextmanager
from .util import nested
class Node(object):
__slots__ = ('_futures',)
pattern = re.compile(r'(?P<bracket>\{\{|\}\})|'
r'\{(?P<prefix>\s*)(?P<key>\w+)(?P<suffix>\s*)\}')
def __init__(self, *args, **kwargs):
... | |
#
# 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 us... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, KOL
# 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... | |
from models import Answer, Survey, Question, Choice
from django.conf import settings
from django.forms import Form, ValidationError
from django.forms import CharField, ChoiceField, SplitDateTimeField
from django.forms import Textarea, TextInput, Select, RadioSelect,\
CheckboxSelectMultiple, ... | |
import unittest
from config import (
access_token, access_token_secret, bearer_token, consumer_key,
consumer_secret, tape, user_id
)
import tweepy
class TweepyTestCase(unittest.TestCase):
def setUp(self):
self.client = tweepy.Client(
bearer_token, consumer_key, consumer_secret,
... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | |
#!/usr/bin/env python
from boto.route53.record import ResourceRecordSets
from boto.route53.status import Status
import boto.route53 as r53
from collections import namedtuple
import argparse
import time
import yaml
# a DNS record for hesiod
# fqdn should include the trailing .
# value should contain the value without... | |
# Copyright (c) Pelagicore AB 2016
from jinja2 import Environment, Template, Undefined, StrictUndefined
from jinja2 import FileSystemLoader, PackageLoader, ChoiceLoader
from jinja2 import TemplateSyntaxError, TemplateNotFound, TemplateError
from path import Path
from antlr4 import InputStream, FileStream, CommonToken... | |
from bottle import Bottle, request, template, redirect
import argparse as ap
import os, re, sys, csv, traceback
import json
from user_data import user_dir
from model import db, apps, jobs, plots, datasource
from common import replace_tags
import config
routes = Bottle()
def bind(app):
global root
root = ap.... | |
"""Tests for common methods of DataseIndex and FilesIndex classes.
"""
# pylint: disable=missing-docstring
# pylint: disable=protected-access
# pylint: disable=redefined-outer-name
import os
import shutil
import pytest
import numpy as np
from batchflow import DatasetIndex, FilesIndex
@pytest.fixture(scope='module')... | |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019, Arm Limited 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
# Copyright (c) 2011-2016 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 ... | |
########################################################################################
# Davi Frossard, 2016 #
# VGG16 implementation in TensorFlow #
# Details: ... | |
"""Taiga integration for Zulip.
Tips for notification output:
*Text formatting*: if there has been a change of a property, the new
value should always be in bold; otherwise the subject of US/task
should be in bold.
"""
from typing import Any, Dict, List, Mapping, Optional, Tuple
from django.http import HttpRequest, ... | |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, 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 cod... | |
import os
from cStringIO import StringIO
import datetime
import unittest
from string import letters
from hashlib import md5
import decimal
# LIBRARIES
from django.core.files.uploadhandler import StopFutureHandlers
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.db im... | |
# 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... | |
import asyncio
import collections
import numpy as np
import os
import pytest
import signal
import sys
import time
import ray
import ray.test_utils
import ray.cluster_utils
from ray.test_utils import (
wait_for_condition,
wait_for_pid_to_exit,
generate_system_config_map,
get_other_nodes,
new_schedul... | |
# 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... | |
"""Tests for light platform."""
from typing import Optional
from unittest.mock import PropertyMock
import pytest
from homeassistant.components import tplink
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_MODE,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_MAX_MIREDS,
ATTR_MIN... | |
import unittest
from ctypes import *
import re, sys
from ctypes.test import xfail
if sys.byteorder == "little":
THIS_ENDIAN = "<"
OTHER_ENDIAN = ">"
else:
THIS_ENDIAN = ">"
OTHER_ENDIAN = "<"
def normalize(format):
# Remove current endian specifier and white space from a format
# string
if... | |
"""Classes utilized by the Seqparse class."""
# Standard Libraries
import os
from collections import MutableMapping, MutableSet
from functools import total_ordering
from .files import File
from .sequences import FileSequence
__all__ = ("FileExtension", "FileSequenceContainer", "SingletonContainer")
################... | |
#
# Protein Engineering Analysis Tool Structure Analysis (PEATSA)
# Copyright (C) 2010 Michael Johnston & Jens Erik Nielsen
#
# Author: Michael Johnston
#
# 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 Fou... | |
# ------------------------------------------------------------------------
#
# Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
#
# 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.... | |
from typing import Union, Tuple, Any, Optional
from typing_extensions import Literal
import math
import eagerpy as ep
from ..models import Model
from ..criteria import Misclassification, TargetedMisclassification
from ..distances import l1
from ..devutils import atleast_kd, flatten
from .base import Minimization... | |
"""
Renders the command line on the console.
(Redraws parts of the input line that were changed.)
"""
from __future__ import unicode_literals
from prompt_toolkit.filters import to_cli_filter
from prompt_toolkit.layout.mouse_handlers import MouseHandlers
from prompt_toolkit.layout.screen import Point, Screen, WritePosi... | |
# 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... | |
#!c:\users\juan.digicash\documents\workspace-django\miblog\scripts\python.exe
"""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 interpre... | |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | |
from unittest import mock
from django.test import RequestFactory, TestCase
from django.urls.exceptions import NoReverseMatch
from wagtail.contrib.routable_page.templatetags.wagtailroutablepage_tags import routablepageurl
from wagtail.core.models import Page, Site
from wagtail.tests.routablepage.models import (
Ro... | |
# -*- coding: utf-8 -*-
"""The processing status classes."""
import time
class ProcessStatus(object):
"""The status of an individual process.
Attributes:
display_name (str): human readable of the file entry currently being
processed by the process.
identifier (str): process identifier.
last_... | |
# Copyright (c) 2015 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 ... | |
from aiohttp import ClientSession, TCPConnector, BasicAuth
import asyncio
from collections import defaultdict, namedtuple
from IPython import embed
import json
import pandas as pd
import random
import requests as r
import string
from sys import exit
from typing import Union, List, Dict
import ilxutils.scicrunch_client_... | |
import os
import configparser
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
from pyspark.sql.types import *
#
# define types for omop schema
#
class Model:
#
# Check the model matches
#
def __init__(self):
self.model_schema = self.omopSchema()
#
# define... | |
# Copyright (c) 2012, Somia Reality Oy
# 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 an... | |
import unittest
from xml.etree import ElementTree
from masher import xml_rules
from masher.xml_rules import MasherXmlRuleError
from masher.generators import ConstantGenerator
def make_xml(xml):
return '<?xml version="1.0"?><data>' + xml + '</data>'
class TestMisc(unittest.TestCase):
def testCleanText(self):
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# Test name = Settings
# Script dir = R:\Stingray\Tests\Settings\05-dateTime\05-dateTime.py
from time import sleep
from device import handler, updateTestResult
import RC
import UART
import DO
import GRAB
import MOD
import os
import OPER
from DO import status
def runTest():
status("active")
TestName = "Settin... | |
'''This assignment is backed by a sparse matrix and is suitable for
large systems.
'''
import os
import logging
import random
import itertools
import scipy as sp
import numpy as np
import model
from assignments import Assignment, AssignmentError
class SparseAssignmentError(AssignmentError):
'''Base class for exc... | |
"""
Typeclass for Player objects
Note that this object is primarily intended to
store OOC information, not game info! This
object represents the actual user (not their
character) and has NO actual precence in the
game world (this is handled by the associated
character object, so you should customize that
instead for m... | |
"""
Demonstration module for quadratic interpolation.
Sample solutions for Homework 2 problems #2 through #7.
"""
import numpy as np
import matplotlib.pyplot as plt
from numpy.linalg import solve
def quad_interp(xi,yi):
"""
Quadratic interpolation. Compute the coefficients of the polynomial
interpolat... | |
########################################################################
#
# License: BSD
# Created: September 1, 2010
# Author: Francesc Alted - francesc@continuum.io
#
########################################################################
import sys
import numpy as np
from numpy.testing import ... | |
from datetime import datetime
from holster.enum import Enum
from peewee import BigIntegerField, IntegerField, SmallIntegerField, TextField, BooleanField, DateTimeField
from playhouse.postgres_ext import BinaryJSONField
from rowboat.sql import BaseModel
@BaseModel.register
class User(BaseModel):
user_id = BigInte... | |
# 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 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import pylab
from colour import Color
from pylab import cm
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from matplotlib.pyplot import figure
from bigbang.visualisation import stackedareachart
from bi... | |
# 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... | |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
AI-related functions
"""
# XXX take penalty into account, in a smart way:
# threshold based on number of remaining blocks ?
# threshold based on the number of variations that can be played
# for each block (a block which can only be placed in one way
# might to interesti... | |
# -*- coding: utf-8 -*-
# LICENCE
from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves import zip
import numpy as np
import utool as ut
import ubelt as ub
import cv2
def bboxes_from_vert_list(verts_list, castint=False):
""" Fit the bounding polygon inside a rectangle "... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | |
# XXX Backquoted words should have precedence over grouping
# XXX Give warning when starting new block after calls were made
# XXX Give warning when def-block contains 'call' put no 'push'
# XXX Give warning when def-block contains code but no 'ret'
# XXX Give warning when a variable is not both written and read
from... | |
import bs
import bsVector
import bsSpaz
import bsBomb
import bsUtils
import random
import SnoBallz
#please note that this Minigame requires the separate file SnoBallz.py.
#It's a separate file to allow for snowballs as a powerup in any game.
def bsGetAPIVersion():
# see bombsquadgame.com/apichanges
return 4
... | |
# coding=utf-8
# Copyright 2022 The init2winit 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 la... | |
from weakref import WeakValueDictionary
from rpython.annotator import model as annmodel
from rpython.rlib import jit, types, objectmodel
from rpython.rlib.objectmodel import (malloc_zero_filled, we_are_translated,
ll_hash_string, keepalive_until_here, specialize, enforceargs, dont_inline)
from rpython.rlib.signatu... | |
#
# 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 ConfigParser
import errno
import socket
import os
import shutil
import tempfile
import platform
def platform_information(_linux_distribution=None):
""" detect platform information from remote host """
linux_distribution = _linux_distribution or platform.linux_distribution
distro, release, codename ... | |
###############################################################################
# Name: ed_basestc.py #
# Purpose: Editra's base StyledTextCtrl. #
# Author: Cody Precord <cprecord@editra.org> #
... | |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## Copyright (C) 6WIND <olivier.matz@6wind.com>
## This program is published under a GPLv2 license
"""
SCTP (Stream Control Transmission Protocol).
"""
import struct
from... | |
# -*- coding: utf-8 -*-
{
'!langcode!': 'id',
'!langname!': 'Indonesian',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%d days ago':... | |
from distutils.version import StrictVersion
import datetime
import hashlib
import os
import re
import socket
import shutil
import time
import sys
import urllib
try:
import requests
except ImportError:
print('Please install or update the requests module.')
sys.exit(1)
import seesaw
from seesaw.config import... | |
from toolset.utils.output_helper import log
from toolset.test_types import test_types
import os
import subprocess
import uuid
import time
import json
import requests
import threading
import re
import math
import csv
import traceback
from datetime import datetime
# Cross-platform colored text
from colorama import Fore... | |
"""
Created on Jul 13, 2012
@author: cdecker
"""
from time import time
import six
import struct
import socket
from io import BytesIO
from bitcoin.utils import decodeVarLength, decodeVarString, encodeVarLength, \
encodeVarString, doubleSha256
PROTOCOL_VERSION = 70001
MIN_PROTOCOL_VERSION = 60001
IPV4_PREFIX = "0... | |
# Copyright (c) 2015 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 ... | |
# coding: utf-8
"""
Twisted Deferred Request
========================
Introduction
------------
This module contains an implementation of a Twisted Request that allows
Resources rendering to return Deferreds instead of ``NOT_DONT_YET``. By
using deferreds one can ensure that a request will always be finished
regardle... | |
#!/usr/bin/python
# Copyright (c) 2006-2009 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.
#
# Wrapper script around Rietveld's upload.py that groups files into
# changelists.
import getpass
import os
import random
import... | |
from typing import Type
import filters as f
from filters.macros import filter_macro
from urllib.parse import urlparse
from iota import Address, TryteString, TrytesCompatible
from iota.crypto.addresses import AddressGenerator
__all__ = [
'AddressNoChecksum',
'GeneratedAddress',
'NodeUri',
'SecurityLev... | |
""""
Copyright 2021 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HdaughterMother_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HdaughterMother_CompleteLHS.
"""
... | |
import os
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Required for Django 1.5.
# If horizon is running in production (DEBUG is False), set this
# with the list of host/domain names that the application can serve.
# For more... | |
# -*- coding: utf-8 -*-
"""Models for the builds app."""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import logging
import os.path
import re
from builtins import object
from shutil import rmtree
from django.conf import settings
from django.core.urlresolvers import revers... | |
"""
Models the MicrobiomeAssayPrep object.
"""
import json
import logging
from itertools import count
from cutlass.iHMPSession import iHMPSession
from cutlass.Base import Base
from cutlass.Util import *
# pylint: disable=W0703, C0302, C1801
# Create a module logger named after the module
module_logger = logging.getL... | |
import numpy as np
from nltk import wordpunct_tokenize
import operator
import re, string
import math
SENTENCE_START_TOKEN = "sentence_start"
SENTENCE_END_TOKEN = "sentence_end"
UNKNOWN_TOKEN = "unknown_token"
def load_data(loc='./data/', _train=False, _test=False):
"Load the MSRP dataset."
trainloc = loc + '... | |
# Copyright 2012 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# Copyright 2015 0xc0170
#
# 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, soft... | |
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.shortcuts import render_to_response, get_object_or_404
from django.template import loader, Context, RequestContext
from django.template.loader import select_template
from django.http import (Http404, HttpResponseNotAllowed,
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import unittest
from quikql import *
from sqlite3 import IntegrityError
class QuikqlTest(unittest.TestCase):
@classmethod
def setUpClass(self):
self.path = os.getcwd() + '/radio.db'
remove_db(self.path)
self.testdb ... | |
from __future__ import annotations
import itertools
from typing import (
TYPE_CHECKING,
Sequence,
cast,
)
import numpy as np
from pandas._libs import (
NaT,
internals as libinternals,
)
from pandas._typing import (
ArrayLike,
DtypeObj,
Manager,
Shape,
)
from pandas.util._decorator... | |
#! /usr/bin/python
import sys, os, timeit, pprint
moddir = os.path.join( os.path.dirname( __file__ ), '..' )
sys.path = [moddir] + sys.path
import pytest
from dynconfig.read import *
from utils import *
def test_simple():
data = '''
var1 : 1
var2 : some string
var3 : 3
var4 : "$({var3} + m.pi + 2)"
var... | |
# coding: utf-8
'''
------------------------------------------------------------------------------
Copyright 2015 Esri
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/li... | |
#!/usr/bin/env python
"""
Job manager utility.
This does not run the jobs but simply manages the records in the PlaceJob
table.
This is easier to managing jobs using SQL. Though this could been done in a
simpler way using a SQL UI or even a YAML config. Also, once I set this up I
didn't need that much flexibility, so... | |
# Lint as: python3
# 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 ... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import json
import pytest
from awx.main.models.credential import CredentialType, Credential
from awx.api.versioning import reverse
@pytest.mark.django_db
def test_list_as_unauthorized_xfail(get):
response = get(reverse('api:credential_type_list'))
assert response.status_code == 401
@pytest.mark.django_db
... | |
"""
Module for building a complete dataset from local directory with csv files.
"""
import os
import sys
from logbook import Logger, StreamHandler
from numpy import empty
from pandas import DataFrame, read_csv, Index, Timedelta, NaT
from trading_calendars import register_calendar_alias
from zipline.utils.cli import m... | |
# -*- coding: utf-8 -*-
"""
celery.app.trace
~~~~~~~~~~~~~~~~
This module defines how the task execution is traced:
errors are recorded, handlers are applied and so on.
"""
from __future__ import absolute_import
# ## ---
# This is the heart of the worker, the inner loop so to speak.
# It used to be s... | |
# These classes implement a doctest runner plugin for nose, a "known failure"
# error class, and a customized TestProgram for NumPy.
# Because this module imports nose directly, it should not
# be used except by nosetester.py to avoid a general NumPy
# dependency on nose.
from __future__ import division, absolute_impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.