gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import absolute_import, print_function, division
import copy
import logging
import time
from theano.compat import izip
from nose.plugins.skip import SkipTest
import numpy
from six.moves import xrange
import theano
from theano.compile.sharedvalue import shared
from theano.compile.pfunc import pfunc
fro... | |
'''
Multipoint Application Sharing protocol (T.128)
'''
import functools, itertools, types, builtins, operator, sys, six
import ptypes, protocol.gcc as gcc
from ptypes import *
ptypes.setbyteorder(ptypes.config.byteorder.littleendian)
### atomic definitions
class Integer8(pint.uint8_t): pass
class Integer16(pint.uin... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import datetime
import locale
import os
import re
import sys
import pytz
import when
# This is a hack for Python 3. Python 3 has no type called basestring.
try:
basestring
except NameError:
basestring = str
sys.path.insert(0, os.path.abspath('..... | |
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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 ... | |
# Natural Language Toolkit: Glue Semantics
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, division, unicode_literals
import os
import nltk
from nltk.internals import Co... | |
# Brain Tumor Classification
# Train 3D Multi-Scale CNN.
# Author: Qixun QU
# Copyleft: MIT Licience
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $$$$ .$$$$$. $$$$'
# $$$DaU$$O$$DaU$$$'
# '$... | |
#
# 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... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 29 07:00:33 2017
@author: Bob Anderson
"""
MIN_SIGMA = 0.1
from math import exp
import numpy as np
from pyoteapp.likelihood_calculations import cum_loglikelihood, aicc, logLikelihoodLine
from pyoteapp.likelihood_calculations import loglikelihood
fr... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='AcademicYear',
field... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Finds android browsers that can be controlled by telemetry."""
import logging
import os
import subprocess
import sys
from py_utils import dependency_uti... | |
# Lint as: python3
# 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 agr... | |
try :
from facepy import GraphAPI
from facepy.exceptions import OAuthError
import time
from sys import stdout
except ImportError:
print "Import Error"
token = 'Enter-Token-Here'
OWNER_NAME = ''
photos_together = {}
no_of_comments = {}
words_in_comment = {}
no_of_messages = {}
total_chat_length = {}... | |
"""DenseNet models for Keras.
# Reference
- [Densely Connected Convolutional Networks](https://arxiv.org/pdf/1608.06993.pdf)
- [The One Hundred Layers Tiramisu: Fully Convolutional DenseNets for Semantic Segmentation](https://arxiv.org/pdf/1611.09326.pdf)
"""
from __future__ import print_function
from __future__ import... | |
# 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 struct
from collections import namedtuple
import os
from functools import lru_cache
import argparse
import logging
from datetime import datetime, timedelta
filetypes = {
0: 'fnode_file',
1: 'free_space_map',
2: 'free_fnodes_map',
3: 'space_accounting_file',
4: 'bad_device_blocks_file',
6... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Twisted component architecture.
"""
from zope.interface import Interface, implements, Attribute
from zope.interface.adapter import AdapterRegistry
from twisted.trial import unittest
from twisted.python import components
from ... | |
"""Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... | |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | |
#!/usr/bin/env python
# Time-stamp: <12-Jun-2012 16:18:43 PDT by rich.pixley@palm.com>
# Copyright (c) 2008 - 2012 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 ... | |
import os
from funcy import distinct, remove
from .helpers import fix_assets_path, array_from_string, parse_boolean, int_or_none, set_from_string
def all_settings():
from types import ModuleType
settings = {}
for name, item in globals().iteritems():
if not callable(item) and not name.startswith(... | |
# Copyright 2014 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.
import random
import unittest
from telemetry.timeline import async_slice
from telemetry.timeline import bounds
from telemetry.timeline import model
from tel... | |
import gc
import sys
import unittest
import UserList
import weakref
from test import test_support
class C:
def method(self):
pass
class Callable:
bar = None
def __call__(self, x):
self.bar = x
def create_function():
def f(): pass
return f
def create_bound_method():
retur... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2019, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Strongly Typed Class Attributes
######################################
This module provides a typed attribute class and class decorator/base class for
creating classes with type ... | |
"""\
Code for restricted open-shell hartree fock programs in PyQuante.
A good reference for the equations here is 'The Self-Consistent Field
Equations for Generalized Valence Bond and Open-Shell Hartree-Fock
Wave Functions', F. W. Bobrowicz and W. A. Goddard, III. in 'Methods
of Electronic Structure Theory', H. F... | |
# coding=utf-8
# Copyright 2022 RigL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
from ..Qt import QtCore, QtGui
from .DockDrop import *
from ..widgets.VerticalLabel import VerticalLabel
from ..python2_3 import asUnicode
class Dock(QtGui.QWidget, DockDrop):
sigStretchChanged = QtCore.Signal()
def __init__(self, name, area=None, size=(10, 10), widget=None, hideTitle=False, autoOri... | |
import os
import shutil
import sys
import tempfile
import six
import tests
base_module_contents = """
import socket
import urllib
print("base {0} {1}".format(socket, urllib))
"""
patching_module_contents = """
from eventlet.green import socket
from eventlet.green import urllib
from eventlet import patcher
print('pa... | |
"""
Mesh refinement for triangular grids.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib.tri.triangulation import Triangulation
import matplotlib.tri.triinterpolate
class TriRefiner(object):
"""
A... | |
#!/usr/bin/env python2
# Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
"""
Functions for creating temporary LMDBs
Used in test_views
"""
from __future__ import absolute_import
import argparse
import os
import sys
import time
# Find the best implementation available
try:
from cStringIO import ... | |
"""
Support for Epson projector.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/media_player.epson/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
DOMAIN, MEDIA_PLAYER_SCHEMA, PLATFORM_SCHEMA, SUPPO... | |
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | |
"""
kombu.entity
================
Exchange and Queue declarations.
"""
from __future__ import absolute_import
from .abstract import MaybeChannelBound
TRANSIENT_DELIVERY_MODE = 1
PERSISTENT_DELIVERY_MODE = 2
DELIVERY_MODES = {'transient': TRANSIENT_DELIVERY_MODE,
'persistent': PERSISTENT_DELIVERY_M... | |
# -*- coding: 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 License, Version 2.0 (the
#... | |
from __future__ import absolute_import
import copy
import inspect
import types
import numpy as np
from ..utils.np_utils import to_categorical
from ..models import Sequential
class BaseWrapper(object):
'''Base class for the Keras scikit-learn wrapper.
Warning: This class should not be used directly.
Use ... | |
import csv
import logging
import os
import eartime_table
import wrangler
logger = logging.getLogger('meeting_parser').getChild(__name__)
def find_header_match(keys, candidates):
#todo need to strip lower both
for key in candidates:
key = key.strip().lower()
try:
keys.remove(key)
except ValueError:
con... | |
from __future__ import division, print_function
import os
import shutil
import pytest
from tempfile import mkstemp, mkdtemp
from subprocess import Popen, PIPE
from distutils.errors import DistutilsError
from numpy.distutils import ccompiler, customized_ccompiler
from numpy.testing import assert_, assert_equal
from nu... | |
from landlab import Component
from ...utils.decorators import use_file_name_or_kwds
import numpy as np
_VALID_METHODS = set(['Grid'])
def _assert_method_is_valid(method):
if method not in _VALID_METHODS:
raise ValueError('%s: Invalid method name' % method)
class Radiation(Component):
"""Compute ... | |
# 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.
"""Parses a JSON request log created by log_requests.py."""
import collections
import json
import operator
import urlparse
Timing = collections.namedtuple(... | |
import pygame
import time
import math
from pygame.locals import *
class Colours(object):
white = (255, 255, 255)
light_gray = (128, 128, 128)
med_gray = (64, 64, 64)
gray = (32, 32, 32)
black = (0, 0, 0)
sepia = (120, 100, 82)
red = (200, 17, 55)
green = (44, 160, 90)
blue = (0,... | |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The maths module provides higher-level interfaces to some of the operations
that can be performed with the fslmaths command-line program.
Change directory to provide... | |
#!/usr/bin/env python2.6
# coding: utf-8
import conf
import logging
import traceback
import logging.handlers
import time
from stat import ST_DEV, ST_INO
import os.path
import os
import sys
# DEFAULT_FORMAT = "%(levelcolor)s[%(asctime)s,%(process)d,%(filename)s,%(lineno)d,%(levelname)s]%(endcolor)s %(message)s"
DEFA... | |
#STANDARD LIB
import datetime
import decimal
import warnings
#LIBRARIES
from django.conf import settings
from django.db.backends import (
BaseDatabaseOperations,
BaseDatabaseClient,
BaseDatabaseIntrospection,
BaseDatabaseWrapper,
BaseDatabaseFeatures,
BaseDatabaseValidation
)
try:
from dja... | |
from __future__ import print_function
from typing import cast, Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Text
from confirmation.models import Confirmation
from django.conf import settings
from django.template import loader
from django.utils.timezone import now as timezone_now
from zerver.decorato... | |
##############################################################################
################## mlabwrap: transparently wraps matlab(tm) ##################
##############################################################################
##
## o author: Alexander Schmolck <a.schmolck@gmx.net>
## o created: 2002-05-29 21... | |
from __future__ import unicode_literals
import datetime
from decimal import Decimal
import unittest
from django import test
from django import forms
from django.core import validators
from django.core import checks
from django.core.exceptions import ValidationError
from django.db import connection, transaction, model... | |
# Copyright 2011 OpenStack LLC. # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/tensorboard/plugins/projector/projector_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _messag... | |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import argparse
import getpass
import os
from absl import app
from future import builtins
import mock
import MySQLdb
from MySQLdb import connections
from MySQLdb.constants import CR as... | |
import imp
import os
import random
import sys
import traceback
import io
try:
import threading
except ImportError:
import dummy_threading as threading
from rgkit import rg
from rgkit.gamestate import GameState
from rgkit.settings import settings
sys.modules['rg'] = rg # preserve backwards compatible robot ... | |
# Copyright (C) 2009 Duncan McGreggor <duncan@canonical.com>
# Licenced under the txaws licence available at /LICENSE in the txaws source.
from txaws.credentials import AWSCredentials
from txaws.ec2.client import EC2Client
try:
from txaws.s3.client import S3Client
except ImportError:
s3clientSkip = ("S3Client ... | |
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Android system-wide tracing utility.
This is a tool for capturing a trace that includes data from both userland and
the kernel... | |
#pylint: disable=invalid-name, too-few-public-methods, too-many-public-methods
from __future__ import print_function, absolute_import
import re
import unittest
from katana import cigar
import katana.util
from test.util_test import MicroMock
class CigarUtilTestCase(unittest.TestCase):
def test_assert_query_lengt... | |
import pytest
pytest.importorskip("ipywidgets")
from ipykernel.comm import Comm
from ipywidgets import Widget
#################
# Utility stuff #
#################
# Taken from ipywidgets/widgets/tests/test_interaction.py
# https://github.com/ipython/ipywidgets
# Licensed under Modified BSD. Copyright I... | |
import numpy as np
import pytest
from packaging.version import parse as parse_version
pytestmark = pytest.mark.gpu
import dask.array as da
from dask.array.numpy_compat import _numpy_120
from dask.array.utils import assert_eq
cupy = pytest.importorskip("cupy")
cupy_version = parse_version(cupy.__version__)
@pytest.... | |
# Copyright 2016 Joel Dunham
#
# 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... | |
#
# 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... | |
"""
Tests for models/states
"""
import unittest2
class StatesTests(unittest2.TestCase):
def setUp(self):
super(StatesTests, self).setUp()
self.config = {}
self.config['CARD_STATES'] = (
'Backlog',
'In Progress',
'Deploy',
'Done',
)
... | |
from copy import copy
from datetime import datetime
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_dynamic_fixture import G
from mock import patch
import pytz
from data_schema.models import DataSchema, FieldSchema, FieldOption
from data_schema.field_schema_type... | |
# Copyright (c) 2010 Arek Korbik, Alessandro Decina
#
# 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... | |
import os
import sys
import numpy as np
import pygame
from pygame.constants import K_w
from .. import base
class BirdPlayer(pygame.sprite.Sprite):
def __init__(self,
SCREEN_WIDTH, SCREEN_HEIGHT, init_pos,
image_assets, rng, color="red", scale=1.0):
self.SCREEN_WIDTH = SCREEN_WI... | |
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import function
from chainer.functions.activation import log_softmax
from chainer.utils import type_check
from chainer import variable
def _broadcast_to(array, shape):
if hasattr(numpy, 'broadcast_to'):
return numpy.bro... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Author(s): Matthew Loper
See LICENCE.txt for licensing and contact information.
"""
import time
from numpy import *
import unittest
from . import ch
from .optimization import minimize
from .ch import Ch
import numpy as np
from scipy.optimize import rosen, rosen_der
from .ut... | |
# -*- coding: utf-8 -*-
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
class flowbtc (Exchange):
def describe(self):
return self.deep_extend(super(flowbtc, self).describe(), {
'id': 'flowbtc',
'name': 'flowBTC',
'countries': 'BR', ... | |
#!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science
author: Aidan Heerdegen <aidan.heerdegen@anu.edu.au>
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
... | |
from unittest import TestCase
import errno
from mock import ANY, Mock, call, mock_open, patch
from os import path
try:
import __builtin__ as builtins
except ImportError:
import builtins
from ceres import CeresNode, CeresSlice, CeresTree
from ceres import DATAPOINT_SIZE, DEFAULT_NODE_CACHING_BEHAVIOR, DEFAULT_S... | |
import base64
from hashlib import sha1
import types
import socket
try:
from gevent.coros import Semaphore as Lock
except ImportError:
from threading import Lock
from ws4py import WS_KEY
from ws4py.exc import HandshakeError
from ws4py.streaming import Stream
WS_VERSION = 8
class WebSocket(object):
"""Web... | |
#!/usr/bin/env python3
""" Script to generate Serial (UART) parameters and the ROMFS startup script """
from __future__ import print_function
import argparse
import os
import sys
try:
from jinja2 import Environment, FileSystemLoader
except ImportError as e:
print("Failed to import jinja2: " + str(e))
pri... | |
#Calculate joint histogram and related metrics
from math import sin,cos,pi
import numpy as np
from scipy.ndimage import affine_transform, geometric_transform
from scipy.ndimage.interpolation import rotate,shift,zoom
from scipy.optimize import fmin as fmin_simplex, fmin_powell, fmin_cg
from scipy.optimize import leastsq... | |
# coding: utf-8
# # Test pyIAST for match with competitive Langmuir model
# In the case that the pure-component isotherms $N_{i,pure}(P)$ follow the Langmuir model with the same saturation loading $M$:
#
# $N_{i,pure} = M \frac{K_iP}{1+K_iP},$
#
# The mixed gas adsorption isotherm follows the competitive Langmuir iso... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Dispatches tests, either sharding or replicating them.
Performs the following steps:
* Create a test collection factory, using the given tests
- If sha... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import os
import abc
import warnings
import six
from six.moves import filter, map
from collections import defaultdict
from monty.design_patterns import cache... | |
"""
This module implements the recktype() factory function and DefaultFactory
class for creating lightweight record classes with mutable fields and optional
per-field defaults.
:copyright: (c) 2015 by Mark Richards.
:license: BSD 3-Clause, see LICENSE.txt for more details.
"""
import collections
import keyword
import... | |
import unittest
from django.conf import settings
from django.core.checks import Error
from django.core.checks.model_checks import _check_lazy_references
from django.core.exceptions import ImproperlyConfigured
from django.db import connections, models
from django.db.models.signals import post_init
from django.test impo... | |
"""
Test suite for the productdb.excel_import module
"""
import os
import pandas as pd
import pytest
import datetime
from django.contrib.auth.models import User
from app.productdb.excel_import import ProductsExcelImporter, InvalidImportFormatException, InvalidExcelFileFormat, \
ProductMigrationsExcelImporter
from a... | |
"""Main logic"""
import argparse
import os
import sys
from typing import cast, List, Optional
import traceback
import questionary
import requests
import toml
from tqdm import tqdm
from . import constants
from .models import (
ManiaException,
ManiaSeriousException,
UnavailableException,
Client,
Tr... | |
import json
import os
import random
import re
import subprocess
from ccmlib import common
from ccmlib.node import ToolError
from dtest import Tester, debug
from tools.decorators import known_failure, since
class TestOfflineTools(Tester):
# In 2.0, we will get this error log message due to jamm not being
# ... | |
#!/usr/bin/env python
"""
This script allows one to submit resources (URLs and files) for analysis.
The submission consists of 2 steps: URL submission and result retrieval.
1. To request the processing of a resource, use the -s option with the URL
or filename to be checked:
$ python submit_to_wepawet.py -s 'htt... | |
#
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['BaseProcess', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import i... | |
# 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 ply.lex as lex
# resultado del analisis
resultado_lexema = []
reservada = (
# Palabras Reservadas
'INCLUDE',
'USING',
'NAMESPACE',
'STD',
'COUT',
'CIN',
'GET',
'CADENA',
'RETURN',
'VOID',
'INT',
'ENDL',
)
tokens = reservada + (
'IDENTIFICADOR',
'ENTERO',
... | |
###############################################################################
# Copyright 2012-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | |
# 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 ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgetbase.py
__version__=''' $Id$ '''
__doc__='''Base class for user-defined graphical widgets'''
import string
from reportlab.graphics imp... | |
""" NIC tests for VM """
import signal
import sys
import time
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.codes import PASS
from marvin.lib.base import (Account,
ServiceOffering,
Network,
VirtualMachine,
... | |
"""
.. codeauthor:: Kevin Kennedy <protonyx@users.noreply.github.com>
"""
import labtronyx
import time
import re
class d_3441XA(labtronyx.DriverBase):
"""
Driver for Agilent 34410A and 34411A Digital Multimeter
"""
author = 'KKENNEDY'
version = '1.0'
deviceType = 'Multimeter'
compatible... | |
import datetime
import pandas as pd
from odmtools.odmdata import *
import os
import sys
def build_db(engine):
Base.metadata.create_all(engine)
# Create DB objects #
def add_bulk_data_values(session, series, dvs_size):
"""
Load up exampleData.csv into a series' datavalues field
"""
assert 10000 ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/TestScript) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class TestScript(domainresource.DomainResource):
""" Describes a set of tests.
A structured s... | |
# 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... | |
from __future__ import absolute_import
from __future__ import unicode_literals
import flask
from flask import request
from keg.web import BaseView as KegBaseView, route, rule
blueprint = flask.Blueprint('routing', __name__)
class BaseView(KegBaseView):
blueprint = blueprint
class VerbRouting(BaseView):
""... | |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-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/li... | |
from .. import query_processor
from nose.tools import assert_true, assert_equal
from numpy import random
import ast
# Ten tracts traversing random labels
another_set = True
while (another_set):
tracts_labels = dict([(i, set(random.randint(100, size=2))) for i in xrange(100)])
labels_tracts = query_processor.l... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, 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 code must retain the above... | |
# Copyright 2013 Mirantis 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 ... | |
"""
CmdSethandler
The Cmdsethandler tracks an object's 'Current CmdSet', which is the
current merged sum of all CmdSets added to it.
A CmdSet constitues a set of commands. The CmdSet works as a special
intelligent container that, when added to other CmdSet make sure that
same-name commands are treated correctly (usua... | |
# For the makeReport example
from treedict import TreeDict
t = TreeDict("mytree")
t.x = 1
t.y = 2
t.a.z = [1,2,3]
t.a.y = {1 : 2}
t.b.x = "hello"
t.a.x = None
t.b.z = 2
print t.makeReport()
print t.a.makeReport()
print t.a.makeReport(add_path = True)
print t.a.makeReport(add_path = True, add_tree_name = False)
# F... | |
"""Use pika with the Asyncio EventLoop"""
import asyncio
import logging
import sys
from pika.adapters import base_connection
from pika.adapters.utils import nbio_interface, io_services_utils
LOGGER = logging.getLogger(__name__)
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEv... | |
""" A simple way of interacting to a ethereum node through JSON RPC commands. """
from __future__ import print_function
from builtins import map
from builtins import str
from builtins import object
import logging
import warnings
import json
import gevent
from ethereum.abi import ContractTranslator
from ethereum.tools.... | |
# -*- 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 'Performance.order'
db.add_column('gig_registry_performance', 'order',
... | |
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
import cPickle as pickle
from openmdao.api import Problem
from wakeexchange.OptimizationGroups import OptAEP
from wakeexchange.gauss import gauss_wrapper, add_gauss_params_IndepVarComps
from wakeexchange.floris import floris_wrapper, add_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.